From d1f966b9c507c07d5b706e5196ad16a002b379b4 Mon Sep 17 00:00:00 2001 From: nmatuschek Date: Wed, 13 Mar 2024 10:18:15 +0100 Subject: [PATCH 001/292] 0040628: Course Links require Read Access to Target Course --- .../class.ilObjCategoryReferenceGUI.php | 4 +- .../classes/class.ilObjCourseReferenceGUI.php | 1 - ...nerReferenceRepositorySelectorInputGUI.php | 120 ++++++++++++++++++ .../classes/class.ilContainerReferenceGUI.php | 8 +- ...ReferenceRepositorySelectorExplorerGUI.php | 46 +++++++ 5 files changed, 171 insertions(+), 8 deletions(-) create mode 100644 Services/ContainerReference/Form/class.ilContainerReferenceRepositorySelectorInputGUI.php create mode 100644 Services/ContainerReference/classes/class.ilContainerReferenceRepositorySelectorExplorerGUI.php diff --git a/Modules/CategoryReference/classes/class.ilObjCategoryReferenceGUI.php b/Modules/CategoryReference/classes/class.ilObjCategoryReferenceGUI.php index d81528e7ec83..3d044ec59380 100644 --- a/Modules/CategoryReference/classes/class.ilObjCategoryReferenceGUI.php +++ b/Modules/CategoryReference/classes/class.ilObjCategoryReferenceGUI.php @@ -1,7 +1,5 @@ * @ilCtrl_Calls ilObjCategoryReferenceGUI: ilPermissionGUI, ilInfoScreenGUI, ilPropertyFormGUI diff --git a/Modules/CourseReference/classes/class.ilObjCourseReferenceGUI.php b/Modules/CourseReference/classes/class.ilObjCourseReferenceGUI.php index d1957d01b4aa..833d6aa6130c 100644 --- a/Modules/CourseReference/classes/class.ilObjCourseReferenceGUI.php +++ b/Modules/CourseReference/classes/class.ilObjCourseReferenceGUI.php @@ -16,7 +16,6 @@ * *********************************************************************/ - /** * @author Stefan Meyer * @version $Id$ diff --git a/Services/ContainerReference/Form/class.ilContainerReferenceRepositorySelectorInputGUI.php b/Services/ContainerReference/Form/class.ilContainerReferenceRepositorySelectorInputGUI.php new file mode 100644 index 000000000000..0564c10d0eb7 --- /dev/null +++ b/Services/ContainerReference/Form/class.ilContainerReferenceRepositorySelectorInputGUI.php @@ -0,0 +1,120 @@ +ctrl = $DIC->ctrl(); + $this->multi_nodes = $a_multi; + $this->postvar = $a_postvar; + $forwarder_class = (is_null($forwarder)) + ? ilPropertyFormGUI::class + : get_class($forwarder); + $this->explorer_gui = new ilContainerReferenceRepositorySelectorExplorerGUI( + [$forwarder_class, ilFormPropertyDispatchGUI::class, ilContainerReferenceRepositorySelectorInputGUI::class], + $this->getExplHandleCmd(), + $this, + "selectRepositoryItem", + "root_id", + "rep_exp_sel_" . $a_postvar + ); + $this->explorer_gui->setSelectMode($a_postvar . "_sel", $this->multi_nodes); + + parent::__construct($a_title, $a_postvar, $this->explorer_gui, $this->multi_nodes); + $this->setType("rep_select"); + } + + public function setTitleModifier(?Closure $a_val): void + { + $this->title_modifier = $a_val; + if ($a_val != null) { + $this->explorer_gui->setNodeContentModifier(function ($a_node) use ($a_val) { + return $a_val($a_node["child"]); + }); + } else { + $this->explorer_gui->setNodeContentModifier(null); + } + } + + public function getTitleModifier(): ?Closure + { + return $this->title_modifier; + } + + public function getTitleForNodeId($a_id): string + { + $c = $this->getTitleModifier(); + if (is_callable($c)) { + return $c($a_id); + } + return ilObject::_lookupTitle(ilObject::_lookupObjId((int) $a_id)); + } + + public function getExplorerGUI(): ilContainerReferenceRepositorySelectorExplorerGUI + { + return $this->explorer_gui; + } + + public function setExplorerGUI(\ILIAS\ContainerReference\ilContainerReferenceRepositorySelectorExplorerGUI $explorer): void + { + $this->explorer_gui = $explorer; + } + + public function getOnloadCode(): array + { + return [ + "il.Explorer2.initSelect('" . $this->getFieldId() . "');" + ]; + } + + public function getHTML(): string + { + $ilCtrl = $this->ctrl; + $ilCtrl->setParameterByClass("ilformpropertydispatchgui", "postvar", $this->postvar); + $html = parent::render(); + $ilCtrl->setParameterByClass("ilformpropertydispatchgui", "postvar", $this->str("postvar")); + return $html; + } + + public function render(string $a_mode = "property_form"): string + { + $ilCtrl = $this->ctrl; + $ilCtrl->setParameterByClass("ilformpropertydispatchgui", "postvar", $this->postvar); + $ret = parent::render($a_mode); + $ilCtrl->setParameterByClass("ilformpropertydispatchgui", "postvar", $this->str("postvar")); + return $ret; + } +} diff --git a/Services/ContainerReference/classes/class.ilContainerReferenceGUI.php b/Services/ContainerReference/classes/class.ilContainerReferenceGUI.php index 0b17986fd5c1..4ab2f7693dc8 100644 --- a/Services/ContainerReference/classes/class.ilContainerReferenceGUI.php +++ b/Services/ContainerReference/classes/class.ilContainerReferenceGUI.php @@ -1,7 +1,5 @@ addOption($custom); $form->addItem($ttype); - include_once("./Services/Form/classes/class.ilRepositorySelector2InputGUI.php"); - $repo = new ilRepositorySelector2InputGUI($this->lng->txt("objref_edit_ref"), "target_id"); - //$repo->setParent($this); + $repo = new ilContainerReferenceRepositorySelectorInputGUI($this->lng->txt("objref_edit_ref"), "target_id"); $repo->setRequired(true); $repo->getExplorerGUI()->setSelectableTypes([$this->getTargetType()]); $repo->getExplorerGUI()->setTypeWhiteList( diff --git a/Services/ContainerReference/classes/class.ilContainerReferenceRepositorySelectorExplorerGUI.php b/Services/ContainerReference/classes/class.ilContainerReferenceRepositorySelectorExplorerGUI.php new file mode 100644 index 000000000000..fa7522b82e8c --- /dev/null +++ b/Services/ContainerReference/classes/class.ilContainerReferenceRepositorySelectorExplorerGUI.php @@ -0,0 +1,46 @@ +access; + + if (!$ilAccess->hasUserRBACorAnyPositionAccess('visible', $a_node['child'])) { + return false; + } + + if (is_array($this->getClickableTypes()) && count($this->getClickableTypes()) > 0) { + return in_array($a_node['type'], $this->getClickableTypes(), true); + } + + return true; + } +} + From bc23fa42e8d36daab8bae383147084ca9149418a Mon Sep 17 00:00:00 2001 From: Christoph Ludolf Date: Wed, 15 May 2024 14:41:52 +0200 Subject: [PATCH 002/292] Fixes array diff call, the structure of the compared arrays did not match --- Services/Tracking/classes/class.ilLPStatus.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Services/Tracking/classes/class.ilLPStatus.php b/Services/Tracking/classes/class.ilLPStatus.php index 4f9dfd659097..6ff61f15dd8a 100644 --- a/Services/Tracking/classes/class.ilLPStatus.php +++ b/Services/Tracking/classes/class.ilLPStatus.php @@ -889,8 +889,9 @@ protected static function checkLPModesForObjects( } // missing objects in DB (default mode) + $existing_obj_ids = array_keys($existing); if (sizeof($existing) != sizeof($a_obj_ids)) { - foreach (array_diff($a_obj_ids, $existing) as $obj_id) { + foreach (array_diff($a_obj_ids, $existing_obj_ids) as $obj_id) { $olp = ilObjectLP::getInstance($obj_id); $mode = $olp->getCurrentMode(); if ($mode == ilLPObjSettings::LP_MODE_DEACTIVATED) { From 10771d67be64f88852e59e8394c7cad450f696b2 Mon Sep 17 00:00:00 2001 From: Christoph Ludolf Date: Wed, 15 May 2024 15:01:58 +0200 Subject: [PATCH 003/292] copyright fix --- Services/Tracking/classes/class.ilLPStatus.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Services/Tracking/classes/class.ilLPStatus.php b/Services/Tracking/classes/class.ilLPStatus.php index 6ff61f15dd8a..59bdf3f6067f 100644 --- a/Services/Tracking/classes/class.ilLPStatus.php +++ b/Services/Tracking/classes/class.ilLPStatus.php @@ -1,6 +1,4 @@ Date: Wed, 15 May 2024 15:05:28 +0200 Subject: [PATCH 004/292] copyright fix --- Services/Tracking/classes/class.ilLPStatus.php | 1 + 1 file changed, 1 insertion(+) diff --git a/Services/Tracking/classes/class.ilLPStatus.php b/Services/Tracking/classes/class.ilLPStatus.php index 59bdf3f6067f..7e1baf76c8d3 100644 --- a/Services/Tracking/classes/class.ilLPStatus.php +++ b/Services/Tracking/classes/class.ilLPStatus.php @@ -1,4 +1,5 @@ Date: Mon, 20 May 2024 20:16:31 +0200 Subject: [PATCH 005/292] Display public key in LTI provider form The form didn't display the RSA public key material, leaving the user in the dark about whether their key material was actually saved. With this change, the stored key gets displayed. --- .../LTIConsumer/classes/class.ilLTIConsumeProviderFormGUI.php | 1 + 1 file changed, 1 insertion(+) diff --git a/Modules/LTIConsumer/classes/class.ilLTIConsumeProviderFormGUI.php b/Modules/LTIConsumer/classes/class.ilLTIConsumeProviderFormGUI.php index 00019c420bc4..6fddf98d3c52 100755 --- a/Modules/LTIConsumer/classes/class.ilLTIConsumeProviderFormGUI.php +++ b/Modules/LTIConsumer/classes/class.ilLTIConsumeProviderFormGUI.php @@ -535,6 +535,7 @@ public function initToolConfigForm(string $formaction, string $saveCmd, string $ $publicKey = new ilTextAreaInputGUI($lng->txt('lti_con_key_type_rsa_public_key'), 'public_key'); $publicKey->setRows(6); $publicKey->setRequired(true); + $publicKey->setValue($this->provider->getPublicKey()); $publicKey->setInfo($lng->txt('lti_con_key_type_rsa_public_key_info')); $keyRsa->addSubItem($publicKey); //JWK From 6ca36e9f40c54bdea5bd0dc59203626cab7d113d Mon Sep 17 00:00:00 2001 From: FElliger Date: Mon, 20 May 2024 21:05:23 +0200 Subject: [PATCH 006/292] Allow using RSA key when saving LTI Content Selection Previously, the LTI forms allowed storing a static public key, but the code for processing the content selection response only looked for the keyset URL. With this change, both ways are supported, depending on which key type is stored. --- .../classes/class.ilObjLTIConsumerGUI.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Modules/LTIConsumer/classes/class.ilObjLTIConsumerGUI.php b/Modules/LTIConsumer/classes/class.ilObjLTIConsumerGUI.php index 3a36509497c8..254046802f21 100755 --- a/Modules/LTIConsumer/classes/class.ilObjLTIConsumerGUI.php +++ b/Modules/LTIConsumer/classes/class.ilObjLTIConsumerGUI.php @@ -480,11 +480,15 @@ public function cancelContentSelection(): void public function saveContentSelection(ilLTIConsumeProvider $provider, string $token): void { - //ToDo: fetch with file_get_contents ok? needs caching? - $jwks = file_get_contents($provider->getPublicKeyset()); - //ToDo: Errorhandling - $keyset = json_decode($jwks, true); - $keys = Firebase\JWT\JWK::parseKeySet($keyset); + if ($provider->getKeyType() == 'RSA_KEY') { + $key = $provider->getPublicKey(); + $keys = new Firebase\JWT\Key($key, "RS256"); + } else { + $jwks = file_get_contents($provider->getPublicKeyset()); + //ToDo: Errorhandling + $keyset = json_decode($jwks, true); + $keys = Firebase\JWT\JWK::parseKeySet($keyset); + } $data = Firebase\JWT\JWT::decode($token, $keys); //ilObjLTIConsumer::getLogger()->debug(var_export($data,TRUE)); $refId = $this->getRequestValue('ref_id'); From 45050cd7ffdf7eff890ebc9fa0d4fcf1fa0b9d3a Mon Sep 17 00:00:00 2001 From: ingoj <120396930+ingoj@users.noreply.github.com> Date: Thu, 6 Jun 2024 15:25:31 +0200 Subject: [PATCH 007/292] fix some functoins if optional parameters are omitted --- .../class.ilSoapObjectAdministration.php | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/webservice/soap/classes/class.ilSoapObjectAdministration.php b/webservice/soap/classes/class.ilSoapObjectAdministration.php index bdfd462c96fd..1485fd9eeca8 100644 --- a/webservice/soap/classes/class.ilSoapObjectAdministration.php +++ b/webservice/soap/classes/class.ilSoapObjectAdministration.php @@ -159,7 +159,7 @@ public function getObjIdsByRefIds(string $sid, array $ref_ids) /** * @return soap_fault|SoapFault|string|null */ - public function getObjectByReference(string $sid, int $a_ref_id, int $user_id) + public function getObjectByReference(string $sid, int $a_ref_id, ?int $user_id = null) { $this->initAuth($sid); $this->initIlias(); @@ -178,7 +178,7 @@ public function getObjectByReference(string $sid, int $a_ref_id, int $user_id) $xml_writer = new ilObjectXMLWriter(); $xml_writer->enablePermissionCheck(true); - if ($user_id) { + if (is_int($user_id)) { $xml_writer->setUserId($user_id); $xml_writer->enableOperations(true); } @@ -192,7 +192,7 @@ public function getObjectByReference(string $sid, int $a_ref_id, int $user_id) /** * @return soap_fault|SoapFault|string|null */ - public function getObjectsByTitle(string $sid, string $a_title, int $user_id) + public function getObjectsByTitle(string $sid, string $a_title, ?int $user_id = null) { $this->initAuth($sid); $this->initIlias(); @@ -251,7 +251,7 @@ public function getObjectsByTitle(string $sid, string $a_title, int $user_id) $xml_writer = new ilObjectXMLWriter(); $xml_writer->enablePermissionCheck(true); - if ($user_id) { + if (is_int($user_id)) { $xml_writer->setUserId($user_id); $xml_writer->enableOperations(true); } @@ -265,7 +265,7 @@ public function getObjectsByTitle(string $sid, string $a_title, int $user_id) /** * @return soap_fault|SoapFault|string|null */ - public function searchObjects(string $sid, array $types, string $key, string $combination, int $user_id) + public function searchObjects(string $sid, ?array $types, string $key, string $combination, ?int $user_id = null) { $this->initAuth($sid); $this->initIlias(); @@ -344,7 +344,7 @@ public function searchObjects(string $sid, array $types, string $key, string $co $object_search = new ilLikeObjectSearch($query_parser); $object_search->setFilter($types); $res = $object_search->performSearch(); - if ($user_id) { + if (is_int($user_id)) { $res->setUserId($user_id); } $res->setMaxHits(100); @@ -389,7 +389,7 @@ public function searchObjects(string $sid, array $types, string $key, string $co /** * @return soap_fault|SoapFault|string|null */ - public function getTreeChilds(string $sid, int $ref_id, array $types, int $user_id) + public function getTreeChilds(string $sid, int $ref_id, ?array $types, ?int $user_id = null) { $this->initAuth($sid); $this->initIlias(); @@ -417,7 +417,7 @@ public function getTreeChilds(string $sid, int $ref_id, array $types, int $user_ ); } - if (!$types) { + if (!is_array($types)) { $all = true; } @@ -436,7 +436,7 @@ public function getTreeChilds(string $sid, int $ref_id, array $types, int $user_ $xml_writer->enablePermissionCheck(true); $xml_writer->setObjects($objs); $xml_writer->enableOperations(true); - if ($user_id) { + if (is_int($user_id)) { $xml_writer->setUserId($user_id); } @@ -449,7 +449,7 @@ public function getTreeChilds(string $sid, int $ref_id, array $types, int $user_ /** * @return soap_fault|SoapFault|string|null */ - public function getXMLTree(string $sid, int $ref_id, array $types, int $user_id) + public function getXMLTree(string $sid, int $ref_id, ?array $types, ?int $user_id =null) { $this->initAuth($sid); $this->initIlias(); @@ -489,7 +489,7 @@ public function getXMLTree(string $sid, int $ref_id, array $types, int $user_id) $xml_writer->setObjects($nodes); $xml_writer->enableOperations(false); - if ($user_id) { + if (is_int($user_id)) { $xml_writer->setUserId($user_id); } From f718661c2170f69d67cf7a767ba3fbddff0fd427 Mon Sep 17 00:00:00 2001 From: Thomas Neumann Date: Wed, 17 Jul 2024 13:00:40 +0200 Subject: [PATCH 008/292] Fix 0041741: SOAP function Ilias.addUserRoleEntry and Ilias.deleteUserRoleEntry always throw an error. --- .../classes/class.ilSoapRBACAdministration.php | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/webservice/soap/classes/class.ilSoapRBACAdministration.php b/webservice/soap/classes/class.ilSoapRBACAdministration.php index caed38709c97..6a245dec0dbe 100644 --- a/webservice/soap/classes/class.ilSoapRBACAdministration.php +++ b/webservice/soap/classes/class.ilSoapRBACAdministration.php @@ -115,12 +115,7 @@ public function addUserRoleEntry(string $sid, int $user_id, int $role_id) return $this->raiseError('Check access failed. No permission to assign users', 'Server'); } - if (!$rbacadmin->assignUser($role_id, $user_id)) { - return $this->raiseError( - 'Error rbacadmin->assignUser()', - 'Server' - ); - } + $rbacadmin->assignUser($role_id, $user_id); return true; } @@ -160,12 +155,7 @@ public function deleteUserRoleEntry(string $sid, int $user_id, int $role_id) return $this->raiseError('Check access failed. No permission to deassign users', 'Server'); } - if (!$rbacadmin->deassignUser($role_id, $user_id)) { - return $this->raiseError( - 'Error rbacadmin->deassignUser()', - 'Server' - ); - } + $rbacadmin->deassignUser($role_id, $user_id); return true; } From 04adcd9b583ddc16d33c058ef32ad3c8ddd36829 Mon Sep 17 00:00:00 2001 From: nmatuschek Date: Mon, 5 Aug 2024 10:23:11 +0200 Subject: [PATCH 009/292] Added option for rbac permission check. Deleted unused classes. --- ...nerReferenceRepositorySelectorInputGUI.php | 120 ------------------ .../classes/class.ilContainerReferenceGUI.php | 3 +- ...ReferenceRepositorySelectorExplorerGUI.php | 46 ------- .../class.ilRepositorySelectorExplorerGUI.php | 8 +- 4 files changed, 9 insertions(+), 168 deletions(-) delete mode 100644 Services/ContainerReference/Form/class.ilContainerReferenceRepositorySelectorInputGUI.php delete mode 100644 Services/ContainerReference/classes/class.ilContainerReferenceRepositorySelectorExplorerGUI.php diff --git a/Services/ContainerReference/Form/class.ilContainerReferenceRepositorySelectorInputGUI.php b/Services/ContainerReference/Form/class.ilContainerReferenceRepositorySelectorInputGUI.php deleted file mode 100644 index 0564c10d0eb7..000000000000 --- a/Services/ContainerReference/Form/class.ilContainerReferenceRepositorySelectorInputGUI.php +++ /dev/null @@ -1,120 +0,0 @@ -ctrl = $DIC->ctrl(); - $this->multi_nodes = $a_multi; - $this->postvar = $a_postvar; - $forwarder_class = (is_null($forwarder)) - ? ilPropertyFormGUI::class - : get_class($forwarder); - $this->explorer_gui = new ilContainerReferenceRepositorySelectorExplorerGUI( - [$forwarder_class, ilFormPropertyDispatchGUI::class, ilContainerReferenceRepositorySelectorInputGUI::class], - $this->getExplHandleCmd(), - $this, - "selectRepositoryItem", - "root_id", - "rep_exp_sel_" . $a_postvar - ); - $this->explorer_gui->setSelectMode($a_postvar . "_sel", $this->multi_nodes); - - parent::__construct($a_title, $a_postvar, $this->explorer_gui, $this->multi_nodes); - $this->setType("rep_select"); - } - - public function setTitleModifier(?Closure $a_val): void - { - $this->title_modifier = $a_val; - if ($a_val != null) { - $this->explorer_gui->setNodeContentModifier(function ($a_node) use ($a_val) { - return $a_val($a_node["child"]); - }); - } else { - $this->explorer_gui->setNodeContentModifier(null); - } - } - - public function getTitleModifier(): ?Closure - { - return $this->title_modifier; - } - - public function getTitleForNodeId($a_id): string - { - $c = $this->getTitleModifier(); - if (is_callable($c)) { - return $c($a_id); - } - return ilObject::_lookupTitle(ilObject::_lookupObjId((int) $a_id)); - } - - public function getExplorerGUI(): ilContainerReferenceRepositorySelectorExplorerGUI - { - return $this->explorer_gui; - } - - public function setExplorerGUI(\ILIAS\ContainerReference\ilContainerReferenceRepositorySelectorExplorerGUI $explorer): void - { - $this->explorer_gui = $explorer; - } - - public function getOnloadCode(): array - { - return [ - "il.Explorer2.initSelect('" . $this->getFieldId() . "');" - ]; - } - - public function getHTML(): string - { - $ilCtrl = $this->ctrl; - $ilCtrl->setParameterByClass("ilformpropertydispatchgui", "postvar", $this->postvar); - $html = parent::render(); - $ilCtrl->setParameterByClass("ilformpropertydispatchgui", "postvar", $this->str("postvar")); - return $html; - } - - public function render(string $a_mode = "property_form"): string - { - $ilCtrl = $this->ctrl; - $ilCtrl->setParameterByClass("ilformpropertydispatchgui", "postvar", $this->postvar); - $ret = parent::render($a_mode); - $ilCtrl->setParameterByClass("ilformpropertydispatchgui", "postvar", $this->str("postvar")); - return $ret; - } -} diff --git a/Services/ContainerReference/classes/class.ilContainerReferenceGUI.php b/Services/ContainerReference/classes/class.ilContainerReferenceGUI.php index 4ab2f7693dc8..777e5bd170f7 100644 --- a/Services/ContainerReference/classes/class.ilContainerReferenceGUI.php +++ b/Services/ContainerReference/classes/class.ilContainerReferenceGUI.php @@ -264,7 +264,7 @@ protected function initForm(int $a_mode = self::MODE_EDIT): ilPropertyFormGUI $ttype->addOption($custom); $form->addItem($ttype); - $repo = new ilContainerReferenceRepositorySelectorInputGUI($this->lng->txt("objref_edit_ref"), "target_id"); + $repo = new ilRepositorySelector2InputGUI($this->lng->txt("objref_edit_ref"), "target_id"); $repo->setRequired(true); $repo->getExplorerGUI()->setSelectableTypes([$this->getTargetType()]); $repo->getExplorerGUI()->setTypeWhiteList( @@ -273,6 +273,7 @@ protected function initForm(int $a_mode = self::MODE_EDIT): ilPropertyFormGUI ["root", "cat", "grp", "fold", "crs"] ) ); + $repo->getExplorerGUI()->setClickablePermission('visible'); $repo->setInfo($this->lng->txt($this->getReferenceType() . '_edit_info')); if ($a_mode === self::MODE_EDIT) { diff --git a/Services/ContainerReference/classes/class.ilContainerReferenceRepositorySelectorExplorerGUI.php b/Services/ContainerReference/classes/class.ilContainerReferenceRepositorySelectorExplorerGUI.php deleted file mode 100644 index fa7522b82e8c..000000000000 --- a/Services/ContainerReference/classes/class.ilContainerReferenceRepositorySelectorExplorerGUI.php +++ /dev/null @@ -1,46 +0,0 @@ -access; - - if (!$ilAccess->hasUserRBACorAnyPositionAccess('visible', $a_node['child'])) { - return false; - } - - if (is_array($this->getClickableTypes()) && count($this->getClickableTypes()) > 0) { - return in_array($a_node['type'], $this->getClickableTypes(), true); - } - - return true; - } -} - diff --git a/Services/Repository/classes/class.ilRepositorySelectorExplorerGUI.php b/Services/Repository/classes/class.ilRepositorySelectorExplorerGUI.php index a69b14e188aa..c8ced6d8a20e 100644 --- a/Services/Repository/classes/class.ilRepositorySelectorExplorerGUI.php +++ b/Services/Repository/classes/class.ilRepositorySelectorExplorerGUI.php @@ -29,6 +29,7 @@ */ class ilRepositorySelectorExplorerGUI extends ilTreeExplorerGUI { + private string $clickable_permission = 'read'; protected ilObjectDefinition $obj_definition; protected array $type_grps = []; protected array $session_materials = []; @@ -252,11 +253,16 @@ public function getChildsOfNode($a_parent_node_id): array return parent::getChildsOfNode($a_parent_node_id); } + public function setClickablePermission(string $rbac_perm): void + { + $this->clickable_permission = $rbac_perm; + } + public function isNodeClickable($a_node): bool { $ilAccess = $this->access; - if (!$ilAccess->hasUserRBACorAnyPositionAccess("read", $a_node["child"])) { + if (!$ilAccess->hasUserRBACorAnyPositionAccess($this->clickable_permission, $a_node["child"])) { return false; } From 2ace16483da7ccee9b120ba7e9275cbb4079eb90 Mon Sep 17 00:00:00 2001 From: nmatuschek Date: Mon, 5 Aug 2024 10:40:25 +0200 Subject: [PATCH 010/292] Fixed code style --- .../classes/class.ilContainerReferenceGUI.php | 1 - .../classes/class.ilRepositorySelectorExplorerGUI.php | 7 +++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/Services/ContainerReference/classes/class.ilContainerReferenceGUI.php b/Services/ContainerReference/classes/class.ilContainerReferenceGUI.php index 777e5bd170f7..180d40279acb 100644 --- a/Services/ContainerReference/classes/class.ilContainerReferenceGUI.php +++ b/Services/ContainerReference/classes/class.ilContainerReferenceGUI.php @@ -135,7 +135,6 @@ public function createObject(): void $this->tpl->setContent($form->getHTML()); } - public function saveObject(): void { $ilAccess = $this->access; diff --git a/Services/Repository/classes/class.ilRepositorySelectorExplorerGUI.php b/Services/Repository/classes/class.ilRepositorySelectorExplorerGUI.php index c8ced6d8a20e..b212ff0981fd 100644 --- a/Services/Repository/classes/class.ilRepositorySelectorExplorerGUI.php +++ b/Services/Repository/classes/class.ilRepositorySelectorExplorerGUI.php @@ -45,8 +45,8 @@ class ilRepositorySelectorExplorerGUI extends ilTreeExplorerGUI protected int $cur_ref_id; /** - * @param object|string[] $a_parent_obj parent gui class or class array - * @param object|string $a_selection_gui gui class that should be called for the selection command + * @param object|string[] $a_parent_obj parent gui class or class array + * @param object|string $a_selection_gui gui class that should be called for the selection command */ public function __construct( $a_parent_obj, @@ -127,7 +127,7 @@ public function getNodeContent($a_node): string $title = $lng->txt("repository"); } - return (string) $title; + return (string) $title; } public function getNodeIcon($a_node): string @@ -148,7 +148,6 @@ public function getNodeIconAlt($a_node): string return $lng->txt("icon") . " " . $title; } - return parent::getNodeIconAlt($a_node); } From b8f7aa98b837fb364615e2e50460c9e58a329adf Mon Sep 17 00:00:00 2001 From: Alex Killing Date: Thu, 22 Aug 2024 13:14:54 +0200 Subject: [PATCH 011/292] improve no team message, if submission ended --- Modules/Exercise/Submission/class.ilExSubmissionTeamGUI.php | 2 +- lang/ilias_de.lang | 2 +- lang/ilias_en.lang | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Modules/Exercise/Submission/class.ilExSubmissionTeamGUI.php b/Modules/Exercise/Submission/class.ilExSubmissionTeamGUI.php index 63e1df59f77e..b67cd5a99000 100644 --- a/Modules/Exercise/Submission/class.ilExSubmissionTeamGUI.php +++ b/Modules/Exercise/Submission/class.ilExSubmissionTeamGUI.php @@ -176,7 +176,7 @@ public static function getOverviewContent( $team_info .= '
' . $lng->txt("exc_no_team_yet_info_tutor") . '
'; } } else { - $team_info = '' . $lng->txt("exc_create_team_times_up_warning") . ''; + $team_info = $lng->txt("exc_create_team_times_up_warning"); } $a_info->addProperty($lng->txt("exc_team_members"), $team_info); diff --git a/lang/ilias_de.lang b/lang/ilias_de.lang index 8a3c5b57d001..32e4e495d392 100644 --- a/lang/ilias_de.lang +++ b/lang/ilias_de.lang @@ -9107,7 +9107,7 @@ exc#:#exc_create_blog_select_info#:#Wählen Sie in Ihren persönlichen Ressource exc#:#exc_create_portfolio#:#Portfolio erstellen exc#:#exc_create_portfolio_no_template#:#Keine Vorlage verwenden exc#:#exc_create_team#:#Team erstellen -exc#:#exc_create_team_times_up_warning#:#Sie können kein Team mehr erstellen. Bitte kontaktieren Sie Ihren Tutor. +exc#:#exc_create_team_times_up_warning#:#Sie können kein Team mehr erstellen oder einem Team beitreten. exc#:#exc_create_wiki#:#Wiki erstellen exc#:#exc_crit_cat_protected_assignment#:#Aktives Peer-Feedback exc#:#exc_crit_cat_protected_assignment_info#:#Kriterienkataloge von Übungseinheiten mit aktivem Peer-Feedback können nicht mehr bearbeitet werden. diff --git a/lang/ilias_en.lang b/lang/ilias_en.lang index 93595372d363..ad0a645e2423 100644 --- a/lang/ilias_en.lang +++ b/lang/ilias_en.lang @@ -9107,7 +9107,7 @@ exc#:#exc_create_blog_select_info#:#Please select the resource folder to add the exc#:#exc_create_portfolio#:#Create Portfolio exc#:#exc_create_portfolio_no_template#:#Do not use template exc#:#exc_create_team#:#Create Team -exc#:#exc_create_team_times_up_warning#:#You cannot create a team anymore - please contact your tutor. +exc#:#exc_create_team_times_up_warning#:#You cannot create or join a team anymore. exc#:#exc_create_wiki#:#Create Wiki exc#:#exc_crit_cat_protected_assignment#:#Active Peer Feedback exc#:#exc_crit_cat_protected_assignment_info#:#Criteria catalogues of assignments with active peer feedback cannot be edited anymore. From 1f7409c20e3fbb004b0fb4c876596d2a8c86ba3f Mon Sep 17 00:00:00 2001 From: Thomas Famula <35489053+tfamula@users.noreply.github.com> Date: Fri, 23 Aug 2024 15:19:33 +0200 Subject: [PATCH 012/292] =?UTF-8?q?Fix=2041541:=20'Enter'=20key=20in=20num?= =?UTF-8?q?ber=20filter=20input=20field=20collapses=20the=20fil=E2=80=A6?= =?UTF-8?q?=20(#7691)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix 41541: 'Enter' key in number filter input field collapses the filter content area, instead of applying the filter * Use rollup --- .../js/Input/Container/dist/filter.js | 19 +++++++++++++++++-- .../js/Input/Container/src/filter.main.js | 19 +++++++++++++++++-- 2 files changed, 34 insertions(+), 4 deletions(-) diff --git a/src/UI/templates/js/Input/Container/dist/filter.js b/src/UI/templates/js/Input/Container/dist/filter.js index a87140fe9909..525712bf2553 100644 --- a/src/UI/templates/js/Input/Container/dist/filter.js +++ b/src/UI/templates/js/Input/Container/dist/filter.js @@ -4,11 +4,12 @@ var filter = function($) { var init = function () { $("div.il-filter").each(function () { var $filter = this; + var $form = $($filter).find(".il-standard-form"); var cnt_hid = 0; var cnt_bar = 1; //Set form action - $($filter).find(".il-standard-form").attr('action', window.location.pathname); + $form.attr('action', window.location.pathname); //Filter fields (hide hidden stuff) $($filter).find(".il-filter-field-status").each(function () { @@ -68,6 +69,20 @@ var filter = function($) { $(".btn-bulky").parents(".il-popover-container").hide(); } + // Using Return while the focus is on an Input Field imitates a click on the Apply Button + $form.on("keydown", ":input:not(:button)", function(event) { + var key = event.which; + if ((key === 13)) { // 13 = Return + var action = $form.attr("data-cmd-apply"); + var url = parse_url(action); + var url_params = url['query_params']; + createHiddenInputs($(this), url_params); + $form.attr('action', url['path']); + $form.submit(); + event.preventDefault(); + } + }); + //Accessibility for complex Input Fields $(".il-filter-field").keydown(function (event) { var key = event.which; @@ -334,7 +349,7 @@ var filter = function($) { $.ajax({ type: 'GET', url: action + "&" + formData, - }) + }); }; /** diff --git a/src/UI/templates/js/Input/Container/src/filter.main.js b/src/UI/templates/js/Input/Container/src/filter.main.js index 2004992b4620..2d6d28cb7262 100644 --- a/src/UI/templates/js/Input/Container/src/filter.main.js +++ b/src/UI/templates/js/Input/Container/src/filter.main.js @@ -4,11 +4,12 @@ var filter = function($) { var init = function () { $("div.il-filter").each(function () { var $filter = this; + var $form = $($filter).find(".il-standard-form"); var cnt_hid = 0; var cnt_bar = 1; //Set form action - $($filter).find(".il-standard-form").attr('action', window.location.pathname); + $form.attr('action', window.location.pathname); //Filter fields (hide hidden stuff) $($filter).find(".il-filter-field-status").each(function () { @@ -68,6 +69,20 @@ var filter = function($) { $(".btn-bulky").parents(".il-popover-container").hide(); } + // Using Return while the focus is on an Input Field imitates a click on the Apply Button + $form.on("keydown", ":input:not(:button)", function(event) { + var key = event.which; + if ((key === 13)) { // 13 = Return + var action = $form.attr("data-cmd-apply"); + var url = parse_url(action); + var url_params = url['query_params']; + createHiddenInputs($(this), url_params); + $form.attr('action', url['path']); + $form.submit(); + event.preventDefault(); + } + }); + //Accessibility for complex Input Fields $(".il-filter-field").keydown(function (event) { var key = event.which; @@ -334,7 +349,7 @@ var filter = function($) { $.ajax({ type: 'GET', url: action + "&" + formData, - }) + }); }; /** From 0316fdf34d9cbfb2263b67a02c85cc76ce9dac1d Mon Sep 17 00:00:00 2001 From: mjansen Date: Mon, 26 Aug 2024 11:14:09 +0200 Subject: [PATCH 013/292] Course: Fix default value in LO course See: https://mantis.ilias.de/view.php?id=41738 --- Modules/Course/classes/Objectives/class.ilLOEditorGUI.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Modules/Course/classes/Objectives/class.ilLOEditorGUI.php b/Modules/Course/classes/Objectives/class.ilLOEditorGUI.php index 077115d2805c..193d748ffa4a 100644 --- a/Modules/Course/classes/Objectives/class.ilLOEditorGUI.php +++ b/Modules/Course/classes/Objectives/class.ilLOEditorGUI.php @@ -437,7 +437,9 @@ protected function initSettingsForm(): ilPropertyFormGUI $type_qa->addSubItem($start_q); $passed_mode = new ilRadioGroupInputGUI($this->lng->txt('crs_loc_settings_passed_mode'), 'passed_mode'); - $passed_mode->setValue((string) $this->getSettings()->getPassedObjectiveMode()); + $passed_mode->setValue( + (string) ($this->getSettings()->getPassedObjectiveMode() ?: ilLOSettings::HIDE_PASSED_OBJECTIVE_QST) + ); $passed_mode->addOption( new ilRadioOption( From 7362130ea243ec049d18b788d8b5e09ea332c751 Mon Sep 17 00:00:00 2001 From: Thomas Famula <35489053+tfamula@users.noreply.github.com> Date: Tue, 27 Aug 2024 09:10:33 +0200 Subject: [PATCH 014/292] Fix rollup config (#7935) --- src/UI/templates/js/Chart/Bar/dist/bar.js | 71 +++++++++---------- .../templates/js/Chart/Bar/rollup.config.js | 4 +- .../js/Chart/Bar/src/bar.horizontal.js | 10 +-- .../js/Chart/Bar/src/bar.vertical.js | 10 +-- 4 files changed, 47 insertions(+), 48 deletions(-) diff --git a/src/UI/templates/js/Chart/Bar/dist/bar.js b/src/UI/templates/js/Chart/Bar/dist/bar.js index fb20b99e6e4a..70acdf99f16e 100644 --- a/src/UI/templates/js/Chart/Bar/dist/bar.js +++ b/src/UI/templates/js/Chart/Bar/dist/bar.js @@ -14,49 +14,18 @@ var horizontal = function() { return { init: init }; -} - -var vertical = function() { - - var init = function(element, preferences, series, yLabels, tooltips){ - determineYLabels(preferences, yLabels); - determineToolTipYLabels(preferences, yLabels, tooltips); - - var chart = new Chart(document.getElementById(element.id), { - type: 'bar', - data: series, - options: preferences, - }); - }; - - return { - init: init - }; -} +}; function determineXLabels(preferences, xLabels) { // Replace labels on x-axes with custom values if defined. If not, use default numeric values. if (Object.keys(xLabels).length != 0) { preferences.scales.x.ticks.callback = function (value, index, values) { return xLabels[index]; - } + }; } else { preferences.scales.x.ticks.callback = function (value, index, values) { return value; - } - } -} - -function determineYLabels(preferences, yLabels) { - // Replace labels on x-axes with custom values if defined. If not, use default numeric values. - if (Object.keys(yLabels).length != 0) { - preferences.scales.y.ticks.callback = function (value, index, values) { - return yLabels[index]; - } - } else { - preferences.scales.y.ticks.callback = function (value, index, values) { - return value; - } + }; } } @@ -76,6 +45,37 @@ function determineToolTipXLabels(preferences, axisLabels, tooltips) { label = label + context.formattedValue; } return label; + }; +} + +var vertical = function() { + + var init = function(element, preferences, series, yLabels, tooltips){ + determineYLabels(preferences, yLabels); + determineToolTipYLabels(preferences, yLabels, tooltips); + + var chart = new Chart(document.getElementById(element.id), { + type: 'bar', + data: series, + options: preferences, + }); + }; + + return { + init: init + }; +}; + +function determineYLabels(preferences, yLabels) { + // Replace labels on x-axes with custom values if defined. If not, use default numeric values. + if (Object.keys(yLabels).length != 0) { + preferences.scales.y.ticks.callback = function (value, index, values) { + return yLabels[index]; + }; + } else { + preferences.scales.y.ticks.callback = function (value, index, values) { + return value; + }; } } @@ -95,10 +95,9 @@ function determineToolTipYLabels(preferences, axisLabels, tooltips) { label = label + context.formattedValue; } return label; - } + }; } - il = il || {}; il.UI = il.UI || {}; il.UI.chart = il.UI.chart || {}; diff --git a/src/UI/templates/js/Chart/Bar/rollup.config.js b/src/UI/templates/js/Chart/Bar/rollup.config.js index 67794afb273f..a1958c9e4f95 100644 --- a/src/UI/templates/js/Chart/Bar/rollup.config.js +++ b/src/UI/templates/js/Chart/Bar/rollup.config.js @@ -1,7 +1,7 @@ export default { input: './src/bar.js', output: { - file: './dist/filter.js', + file: './dist/bar.js', format: 'es' } -}; \ No newline at end of file +}; diff --git a/src/UI/templates/js/Chart/Bar/src/bar.horizontal.js b/src/UI/templates/js/Chart/Bar/src/bar.horizontal.js index ce20048cd0c4..e6436c59377c 100644 --- a/src/UI/templates/js/Chart/Bar/src/bar.horizontal.js +++ b/src/UI/templates/js/Chart/Bar/src/bar.horizontal.js @@ -14,18 +14,18 @@ var horizontal = function() { return { init: init }; -} +}; function determineXLabels(preferences, xLabels) { // Replace labels on x-axes with custom values if defined. If not, use default numeric values. if (Object.keys(xLabels).length != 0) { preferences.scales.x.ticks.callback = function (value, index, values) { return xLabels[index]; - } + }; } else { preferences.scales.x.ticks.callback = function (value, index, values) { return value; - } + }; } } @@ -45,7 +45,7 @@ function determineToolTipXLabels(preferences, axisLabels, tooltips) { label = label + context.formattedValue; } return label; - } + }; } -export default horizontal; \ No newline at end of file +export default horizontal; diff --git a/src/UI/templates/js/Chart/Bar/src/bar.vertical.js b/src/UI/templates/js/Chart/Bar/src/bar.vertical.js index be79e083f2f2..68e26e4b27aa 100644 --- a/src/UI/templates/js/Chart/Bar/src/bar.vertical.js +++ b/src/UI/templates/js/Chart/Bar/src/bar.vertical.js @@ -14,18 +14,18 @@ var vertical = function() { return { init: init }; -} +}; function determineYLabels(preferences, yLabels) { // Replace labels on x-axes with custom values if defined. If not, use default numeric values. if (Object.keys(yLabels).length != 0) { preferences.scales.y.ticks.callback = function (value, index, values) { return yLabels[index]; - } + }; } else { preferences.scales.y.ticks.callback = function (value, index, values) { return value; - } + }; } } @@ -45,7 +45,7 @@ function determineToolTipYLabels(preferences, axisLabels, tooltips) { label = label + context.formattedValue; } return label; - } + }; } -export default vertical; \ No newline at end of file +export default vertical; From a6cd7367128f50a6f90e09796d5008a9163f772c Mon Sep 17 00:00:00 2001 From: mjansen Date: Wed, 7 Aug 2024 09:18:38 +0200 Subject: [PATCH 015/292] Init/PasswordAssistance: Fix lost `cmd` when submitting a new password See: https://mantis.ilias.de/view.php?id=41531 --- .../classes/class.ilPasswordAssistanceGUI.php | 59 ++++++++++++------- 1 file changed, 37 insertions(+), 22 deletions(-) diff --git a/Services/Init/classes/class.ilPasswordAssistanceGUI.php b/Services/Init/classes/class.ilPasswordAssistanceGUI.php index 0f6ce5ef9686..8c43ff337184 100755 --- a/Services/Init/classes/class.ilPasswordAssistanceGUI.php +++ b/Services/Init/classes/class.ilPasswordAssistanceGUI.php @@ -26,7 +26,7 @@ * @author Michael Jansen * @ingroup ServicesInit */ -class ilPasswordAssistanceGUI +class ilPasswordAssistanceGUI implements ilCtrlSecurityInterface { private const PERMANENT_LINK_TARGET_PW = 'pwassist'; private const PERMANENT_LINK_TARGET_NAME = 'nameassist'; @@ -64,6 +64,24 @@ public function __construct() $this->help->setScreenIdComponent('init'); } + private function retrieveRequestedKey(): string + { + $key = $this->http->wrapper()->query()->retrieve( + 'key', + $this->refinery->byTrying([ + $this->refinery->kindlyTo()->string(), + $this->refinery->always( + $this->http->wrapper()->post()->retrieve( + 'key', + $this->refinery->byTrying([$this->refinery->kindlyTo()->string(), $this->refinery->always('')]) + ) + ) + ]) + ); + + return $key; + } + /** * as replacement for "this->ilias" */ @@ -86,32 +104,19 @@ public function executeCommand() $this->ilErr->raiseError($this->lng->txt('permission_denied'), $this->ilErr->MESSAGE); } - // Change the language, if necessary. - // And load the 'pwassist' language module - $lang = ''; - if ($this->http->wrapper()->query()->has('lang')) { - $lang = $this->http->wrapper()->query()->retrieve( - 'lang', - $this->refinery->kindlyTo()->string() - ); - } - $key = ''; - if ($this->http->wrapper()->query()->has('key')) { - $key = $this->http->wrapper()->query()->retrieve( - 'key', - $this->refinery->kindlyTo()->string() - ); - } $this->lng->loadLanguageModule('pwassist'); - $cmd = $this->ctrl->getCmd(); + $cmd = $this->ctrl->getCmd() ?? ''; $next_class = $this->ctrl->getNextClass($this); switch ($next_class) { default: - if ($cmd != '' && method_exists($this, $cmd)) { - return $this->$cmd(); - } elseif (!empty($key)) { //ToDo PHP8: This will never happen. smeyer: why? $_GET['key'] != '' && $_GET['cmd'] = '' - $this->showAssignPasswordForm(); + if ($cmd !== '' && method_exists($this, $cmd)) { + $this->$cmd(); + return; + } + + if ($this->retrieveRequestedKey() !== '') { + $this->showAssignPasswordForm(null, $this->retrieveRequestedKey()); } else { $this->showAssistanceForm(); } @@ -119,6 +124,16 @@ public function executeCommand() } } + public function getUnsafeGetCommands(): array + { + return []; + } + + public function getSafePostCommands(): array + { + return ['submitAssignPasswordForm']; + } + /** * Returns the ILIAS http path without a trailing / */ From 15d859de57b589c6da8b5fa687a9785d53111ac6 Mon Sep 17 00:00:00 2001 From: mjansen Date: Wed, 28 Aug 2024 11:26:56 +0200 Subject: [PATCH 016/292] Auth: Fix SOAP authentication See: https://mantis.ilias.de/view.php?id=41971 --- Services/Init/classes/class.ilStartUpGUI.php | 22 +++++++------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/Services/Init/classes/class.ilStartUpGUI.php b/Services/Init/classes/class.ilStartUpGUI.php index 03f6d2c05dcf..899f09f6ebbd 100755 --- a/Services/Init/classes/class.ilStartUpGUI.php +++ b/Services/Init/classes/class.ilStartUpGUI.php @@ -268,20 +268,14 @@ protected function showLoginPage(ilPropertyFormGUI $form = null): void $this->getLogger()->debug('Showing login page'); - $extUid = ''; - if ($this->http->wrapper()->query()->has('ext_uid')) { - $extUid = $this->http->wrapper()->query()->retrieve( - 'ext_uid', - $this->refinery->kindlyTo()->string() - ); - } - $soapPw = ''; - if ($this->http->wrapper()->query()->has('soap_pw')) { - $extUid = $this->http->wrapper()->query()->retrieve( - 'soap_pw', - $this->refinery->kindlyTo()->string() - ); - } + $extUid = $this->http->wrapper()->query()->retrieve( + 'ext_uid', + $this->refinery->byTrying([$this->refinery->kindlyTo()->string(), $this->refinery->always('')]) + ); + $soapPw = $this->http->wrapper()->query()->retrieve( + 'soap_pw', + $this->refinery->byTrying([$this->refinery->kindlyTo()->string(), $this->refinery->always('')]) + ); $credentials = new ilAuthFrontendCredentialsSoap( $GLOBALS['DIC']->http()->request(), $this->ctrl, From 2f79050dd18b23f52a890565ac87be7db49d5824 Mon Sep 17 00:00:00 2001 From: mjansen Date: Mon, 26 Aug 2024 11:56:31 +0200 Subject: [PATCH 017/292] GS: Add workaround in access checks if user id equals `0` See: https://mantis.ilias.de/view.php?id=41601 --- .../Helper/BasicAccessCheckClosures.php | 66 ++++++++++--------- .../test/ilServicesGlobalScreenTest.php | 29 ++++---- 2 files changed, 50 insertions(+), 45 deletions(-) diff --git a/Services/GlobalScreen/classes/Helper/BasicAccessCheckClosures.php b/Services/GlobalScreen/classes/Helper/BasicAccessCheckClosures.php index ee61c75aa922..71dcf2459246 100644 --- a/Services/GlobalScreen/classes/Helper/BasicAccessCheckClosures.php +++ b/Services/GlobalScreen/classes/Helper/BasicAccessCheckClosures.php @@ -1,5 +1,21 @@ access_cache['repo_read'])) { $is_user_logged_in = $this->isUserLoggedIn()(); - if (!$is_user_logged_in) { - $this->access_cache['repo_read'] = $this->dic->settings()->get('pub_section') && $this->dic->access( - )->checkAccess( - 'read', - '', - \ROOT_FOLDER_ID - ); - } else { + if ($is_user_logged_in) { $this->access_cache['repo_read'] = $this->dic->access()->checkAccess( 'read', '', \ROOT_FOLDER_ID ); + } else { + $this->access_cache['repo_read'] = $this->dic->settings()->get('pub_section') && $this->dic->access( + )->checkAccessOfUser( + $this->dic->user()->getId() ?: ANONYMOUS_USER_ID, + 'read', + '', + \ROOT_FOLDER_ID + ); } } @@ -72,19 +75,20 @@ public function isRepositoryVisible(?Closure $additional = null): Closure { if (!isset($this->access_cache['repo_visible'])) { $is_user_logged_in = $this->isUserLoggedIn()(); - if (!$is_user_logged_in) { - $this->access_cache['repo_visible'] = $this->dic->settings()->get('pub_section') && $this->dic->access( - )->checkAccess( - 'visible', - '', - \ROOT_FOLDER_ID - ); - } else { + if ($is_user_logged_in) { $this->access_cache['repo_visible'] = $this->dic->access()->checkAccess( 'visible', '', \ROOT_FOLDER_ID ); + } else { + $this->access_cache['repo_visible'] = $this->dic->settings()->get('pub_section') && $this->dic->access( + )->checkAccessOfUser( + $this->dic->user()->getId() ?: ANONYMOUS_USER_ID, + 'visible', + '', + \ROOT_FOLDER_ID + ); } } @@ -97,7 +101,7 @@ public function isUserLoggedIn(?Closure $additional = null): Closure { if (!isset($this->access_cache['is_anonymous'])) { $this->access_cache['is_anonymous'] = ($this->dic->user()->isAnonymous() || $this->dic->user()->getId( - ) === 0); + ) === 0); } return $this->getClosureWithOptinalClosure(function (): bool { diff --git a/Services/GlobalScreen/test/ilServicesGlobalScreenTest.php b/Services/GlobalScreen/test/ilServicesGlobalScreenTest.php index d59c7f865392..0db1837c386e 100644 --- a/Services/GlobalScreen/test/ilServicesGlobalScreenTest.php +++ b/Services/GlobalScreen/test/ilServicesGlobalScreenTest.php @@ -1,24 +1,25 @@ willReturn('1'); $access_mock->expects($this->once()) - ->method('checkAccess') - ->with('read', '', $this->ROOT_FOLDER_ID) + ->method('checkAccessOfUser') + ->with($this->isType('integer'), 'read', '', $this->ROOT_FOLDER_ID) ->willReturn(true); $this->assertTrue($class->isRepositoryReadable()()); @@ -171,7 +172,7 @@ public function testRepoAccessTrueNotLoggedInNoPublicSection(): void ->willReturn('0'); $access_mock->expects($this->never()) - ->method('checkAccess'); + ->method('checkAccessOfUser'); $this->assertFalse($class->isRepositoryReadable()()); $this->assertFalse( From b08c7541ca217bd0aadfa15383da99d9751797fd Mon Sep 17 00:00:00 2001 From: Stefan Meyer Date: Thu, 29 Aug 2024 09:26:33 +0200 Subject: [PATCH 018/292] 0041970: Whoops while altering a start date of a session --- .../Session/classes/class.ilObjSessionGUI.php | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/Modules/Session/classes/class.ilObjSessionGUI.php b/Modules/Session/classes/class.ilObjSessionGUI.php index ecdeb404fa62..1b46d27e6c2a 100644 --- a/Modules/Session/classes/class.ilObjSessionGUI.php +++ b/Modules/Session/classes/class.ilObjSessionGUI.php @@ -19,17 +19,16 @@ declare(strict_types=1); /** -* -* @author Stefan Meyer -* @version $Id$ -* -* @ilCtrl_Calls ilObjSessionGUI: ilPermissionGUI, ilInfoScreenGUI, ilObjectCopyGUI -* @ilCtrl_Calls ilObjSessionGUI: ilExportGUI, ilCommonActionDispatcherGUI, ilMembershipMailGUI -* @ilCtrl_Calls ilObjSessionGUI: ilLearningProgressGUI, ilSessionMembershipGUI, ilObjectMetaDataGUI, ilPropertyFormGUI -* @ilCtrl_Calls ilObjSessionGUI: ilBookingGatewayGUI -* -* @ingroup ModulesSession -*/ + * + * @author Stefan Meyer + * + * @ilCtrl_Calls ilObjSessionGUI: ilPermissionGUI, ilInfoScreenGUI, ilObjectCopyGUI + * @ilCtrl_Calls ilObjSessionGUI: ilExportGUI, ilCommonActionDispatcherGUI, ilMembershipMailGUI + * @ilCtrl_Calls ilObjSessionGUI: ilLearningProgressGUI, ilSessionMembershipGUI, ilObjectMetaDataGUI, ilPropertyFormGUI + * @ilCtrl_Calls ilObjSessionGUI: ilBookingGatewayGUI + * + * @ingroup ModulesSession + */ class ilObjSessionGUI extends ilObjectGUI implements ilDesktopItemHandling { protected \ILIAS\DI\UIServices $ui; @@ -57,7 +56,7 @@ class ilObjSessionGUI extends ilObjectGUI implements ilDesktopItemHandling protected int $container_obj_id = 0; protected array $files = []; protected ?ilPropertyFormGUI $form = null; - protected ilAdvancedMDRecordGUI $record_gui; + protected ?ilAdvancedMDRecordGUI $record_gui = null; protected ?ilEventRecurrence $rec = null; protected ?ilEventItems $event_items = null; protected ?ilEventParticipants $event_part = null; From 6ac6f2e07c40fba6b6b5f3644d59ab68e64c324c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Jou=C3=9Fen?= Date: Mon, 5 Aug 2024 14:08:00 +0200 Subject: [PATCH 019/292] Test,QuestionPool,LearningModule: Set title max length to 255 in form gui. --- .../LearningModule/classes/class.ilObjContentObjectGUI.php | 1 + Modules/Test/classes/class.ilObjTestSettingsGeneralGUI.php | 7 ++++--- .../classes/class.ilObjQuestionPoolSettingsGeneralGUI.php | 1 + 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Modules/LearningModule/classes/class.ilObjContentObjectGUI.php b/Modules/LearningModule/classes/class.ilObjContentObjectGUI.php index 24f81b65197d..33149103d556 100755 --- a/Modules/LearningModule/classes/class.ilObjContentObjectGUI.php +++ b/Modules/LearningModule/classes/class.ilObjContentObjectGUI.php @@ -502,6 +502,7 @@ public function initPropertiesForm(): void // title $ti = new ilTextInputGUI($lng->txt("title"), "title"); $ti->setRequired(true); + $ti->setMaxLength(255); $this->form->addItem($ti); // description diff --git a/Modules/Test/classes/class.ilObjTestSettingsGeneralGUI.php b/Modules/Test/classes/class.ilObjTestSettingsGeneralGUI.php index 3df88f1f85f6..6c6fd434ddf6 100644 --- a/Modules/Test/classes/class.ilObjTestSettingsGeneralGUI.php +++ b/Modules/Test/classes/class.ilObjTestSettingsGeneralGUI.php @@ -548,6 +548,7 @@ private function addGeneralProperties(ilPropertyFormGUI $form) $title = new ilTextInputGUI($this->lng->txt("title"), "title"); $title->setRequired(true); + $title->setMaxLength(255); if ($md_section !== null) { $title->setValue($md_section->getTitle()); } @@ -1541,8 +1542,8 @@ private function saveTestFinishProperties(ilPropertyFormGUI $form) $this->testOBJ->setShowFinalStatement((bool) $form->getInput('showfinalstatement')); $this->testOBJ->setFinalStatement($form->getInput('finalstatement') ?? ''); - if ($this->formPropertyExists($form,'redirection_enabled')) { - if (empty($form->getInput('redirection_enabled'))){ + if ($this->formPropertyExists($form, 'redirection_enabled')) { + if (empty($form->getInput('redirection_enabled'))) { $this->testOBJ->setRedirectionMode(REDIRECT_NONE); } else { $this->testOBJ->setRedirectionMode(($form->getInput('redirection_mode'))); @@ -1550,7 +1551,7 @@ private function saveTestFinishProperties(ilPropertyFormGUI $form) } else { $this->testOBJ->setRedirectionMode(REDIRECT_NONE); } - if ($this->formPropertyExists($form,'redirection_url')) { + if ($this->formPropertyExists($form, 'redirection_url')) { $this->testOBJ->setRedirectionUrl($form->getInput('redirection_url')); } else { $this->testOBJ->setRedirectionUrl(null); diff --git a/Modules/TestQuestionPool/classes/class.ilObjQuestionPoolSettingsGeneralGUI.php b/Modules/TestQuestionPool/classes/class.ilObjQuestionPoolSettingsGeneralGUI.php index 4c9896fb47a0..0451d71fb396 100644 --- a/Modules/TestQuestionPool/classes/class.ilObjQuestionPoolSettingsGeneralGUI.php +++ b/Modules/TestQuestionPool/classes/class.ilObjQuestionPoolSettingsGeneralGUI.php @@ -228,6 +228,7 @@ private function buildForm(): ilPropertyFormGUI $title = new ilTextInputGUI($this->lng->txt("title"), "title"); $title->setRequired(true); + $title->setMaxLength(255); $title->setValue($md_section->getTitle()); $form->addItem($title); From a7e2f0bb28da71dc9de001731aa46aa5bca5c006 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Jou=C3=9Fen?= Date: Fri, 9 Aug 2024 15:32:22 +0200 Subject: [PATCH 020/292] QuestionPool: Remove custom instance from ilToolbarGUI and reuse instance inside ilObjQuestionPoolGUI --- .../classes/class.ilObjQuestionPoolGUI.php | 24 +++++++------------ 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/Modules/TestQuestionPool/classes/class.ilObjQuestionPoolGUI.php b/Modules/TestQuestionPool/classes/class.ilObjQuestionPoolGUI.php index 32d124b42b71..d006042452d8 100755 --- a/Modules/TestQuestionPool/classes/class.ilObjQuestionPoolGUI.php +++ b/Modules/TestQuestionPool/classes/class.ilObjQuestionPoolGUI.php @@ -1131,33 +1131,28 @@ public function questionsObject(): void $table_gui->setPreventDoubleSubmission(false); if ($this->rbac_system->checkAccess('write', $this->qplrequest->getRefId())) { - $toolbar = new ilToolbarGUI(); $btn = ilLinkButton::getInstance(); $btn->setCaption('ass_create_question'); $btn->setUrl($this->ctrl->getLinkTarget($this, 'createQuestionForm')); $btn->setPrimary(true); - $toolbar->addButtonInstance($btn); + $this->toolbar->addButtonInstance($btn); $btnImport = ilLinkButton::getInstance(); $btnImport->setCaption('import'); $btnImport->setUrl($this->ctrl->getLinkTarget($this, 'importQuestions')); - $toolbar->addButtonInstance($btnImport); + $this->toolbar->addButtonInstance($btnImport); if (ilSession::get("qpl_clipboard") != null && count(ilSession::get('qpl_clipboard'))) { $btnPaste = ilLinkButton::getInstance(); $btnPaste->setCaption('paste'); $btnPaste->setUrl($this->ctrl->getLinkTarget($this, 'paste')); - $toolbar->addButtonInstance($btnPaste); + $this->toolbar->addButtonInstance($btnPaste); } - - $this->tpl->setContent( - $this->ctrl->getHTML($toolbar) . $this->ctrl->getHTML($table_gui) - ); - } else { - $this->tpl->setContent($this->ctrl->getHTML($table_gui)); } + $this->tpl->setContent($this->ctrl->getHTML($table_gui)); + if ($this->object->getShowTaxonomies()) { $this->lng->loadLanguageModule('tax'); @@ -1278,8 +1273,7 @@ private function buildCreateQuestionForm(): ilPropertyFormGUI */ public function printObject(): void { - $ilToolbar = $this->toolbar; - $ilToolbar->setFormAction($this->ctrl->getFormAction($this, 'print')); + $this->toolbar->setFormAction($this->ctrl->getFormAction($this, 'print')); $mode = new ilSelectInputGUI($this->lng->txt('output_mode'), 'output'); $mode->setOptions(array( @@ -1292,9 +1286,9 @@ public function printObject(): void $mode->setValue(ilUtil::stripSlashes($output)); - $ilToolbar->setFormName('printviewOptions'); - $ilToolbar->addInputItem($mode, true); - $ilToolbar->addFormButton($this->lng->txt('submit'), 'print'); + $this->toolbar->setFormName('printviewOptions'); + $this->toolbar->addInputItem($mode, true); + $this->toolbar->addFormButton($this->lng->txt('submit'), 'print'); $table_gui = new ilQuestionPoolPrintViewTableGUI($this, 'print', $output); $data = $this->object->getPrintviewQuestions(); $totalPoints = 0; From 74a1965567064bbc68d9dfb097b61564ef445a1b Mon Sep 17 00:00:00 2001 From: mjansen Date: Fri, 30 Aug 2024 11:25:33 +0200 Subject: [PATCH 021/292] Composer: Apply changes from `phpspreadsheet:2.x.x` --- composer.json | 3 + composer.lock | 467 +++++++++++---------- libs/composer/patches/phpspreadsheet.patch | 138 ++++++ 3 files changed, 379 insertions(+), 229 deletions(-) create mode 100644 libs/composer/patches/phpspreadsheet.patch diff --git a/composer.json b/composer.json index 5f2bbf9ae154..d3e617131b80 100644 --- a/composer.json +++ b/composer.json @@ -498,6 +498,9 @@ }, "imsglobal/lti": { "ILIAS LTI Patches": "./libs/composer/patches/lti.patch" + }, + "phpoffice/phpspreadsheet": { + "ILIAS PHPSpreadsheet Patches": "./libs/composer/patches/phpspreadsheet.patch" } } } diff --git a/composer.lock b/composer.lock index 6e0082ea8f2f..ccab52a0f068 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "a1c177aba2611926fca17a45191e6bdd", + "content-hash": "eff4d3e7fa85dc76d6ef7456b8248836", "packages": [ { "name": "cweagans/composer-patches", @@ -490,22 +490,22 @@ }, { "name": "guzzlehttp/guzzle", - "version": "7.8.1", + "version": "7.8.2", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "41042bc7ab002487b876a0683fc8dce04ddce104" + "reference": "f4152d9eb85c445fe1f992001d1748e8bec070d2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/41042bc7ab002487b876a0683fc8dce04ddce104", - "reference": "41042bc7ab002487b876a0683fc8dce04ddce104", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/f4152d9eb85c445fe1f992001d1748e8bec070d2", + "reference": "f4152d9eb85c445fe1f992001d1748e8bec070d2", "shasum": "" }, "require": { "ext-json": "*", - "guzzlehttp/promises": "^1.5.3 || ^2.0.1", - "guzzlehttp/psr7": "^1.9.1 || ^2.5.1", + "guzzlehttp/promises": "^1.5.3 || ^2.0.3", + "guzzlehttp/psr7": "^1.9.1 || ^2.6.3", "php": "^7.2.5 || ^8.0", "psr/http-client": "^1.0", "symfony/deprecation-contracts": "^2.2 || ^3.0" @@ -516,9 +516,9 @@ "require-dev": { "bamarni/composer-bin-plugin": "^1.8.2", "ext-curl": "*", - "php-http/client-integration-tests": "dev-master#2c025848417c1135031fdf9c728ee53d0a7ceaee as 3.0.999", + "guzzle/client-integration-tests": "3.0.2", "php-http/message-factory": "^1.1", - "phpunit/phpunit": "^8.5.36 || ^9.6.15", + "phpunit/phpunit": "^8.5.39 || ^9.6.20", "psr/log": "^1.1 || ^2.0 || ^3.0" }, "suggest": { @@ -596,7 +596,7 @@ ], "support": { "issues": "https://github.com/guzzle/guzzle/issues", - "source": "https://github.com/guzzle/guzzle/tree/7.8.1" + "source": "https://github.com/guzzle/guzzle/tree/7.8.2" }, "funding": [ { @@ -612,20 +612,20 @@ "type": "tidelift" } ], - "time": "2023-12-03T20:35:24+00:00" + "time": "2024-07-18T11:12:18+00:00" }, { "name": "guzzlehttp/promises", - "version": "2.0.2", + "version": "2.0.3", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "bbff78d96034045e58e13dedd6ad91b5d1253223" + "reference": "6ea8dd08867a2a42619d65c3deb2c0fcbf81c8f8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/bbff78d96034045e58e13dedd6ad91b5d1253223", - "reference": "bbff78d96034045e58e13dedd6ad91b5d1253223", + "url": "https://api.github.com/repos/guzzle/promises/zipball/6ea8dd08867a2a42619d65c3deb2c0fcbf81c8f8", + "reference": "6ea8dd08867a2a42619d65c3deb2c0fcbf81c8f8", "shasum": "" }, "require": { @@ -633,7 +633,7 @@ }, "require-dev": { "bamarni/composer-bin-plugin": "^1.8.2", - "phpunit/phpunit": "^8.5.36 || ^9.6.15" + "phpunit/phpunit": "^8.5.39 || ^9.6.20" }, "type": "library", "extra": { @@ -679,7 +679,7 @@ ], "support": { "issues": "https://github.com/guzzle/promises/issues", - "source": "https://github.com/guzzle/promises/tree/2.0.2" + "source": "https://github.com/guzzle/promises/tree/2.0.3" }, "funding": [ { @@ -695,7 +695,7 @@ "type": "tidelift" } ], - "time": "2023-12-03T20:19:20+00:00" + "time": "2024-07-18T10:29:17+00:00" }, { "name": "guzzlehttp/psr7", @@ -1914,16 +1914,16 @@ }, { "name": "phpseclib/phpseclib", - "version": "3.0.39", + "version": "3.0.41", "source": { "type": "git", "url": "https://github.com/phpseclib/phpseclib.git", - "reference": "211ebc399c6e73c225a018435fe5ae209d1d1485" + "reference": "621c73f7dcb310b61de34d1da4c4204e8ace6ceb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/211ebc399c6e73c225a018435fe5ae209d1d1485", - "reference": "211ebc399c6e73c225a018435fe5ae209d1d1485", + "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/621c73f7dcb310b61de34d1da4c4204e8ace6ceb", + "reference": "621c73f7dcb310b61de34d1da4c4204e8ace6ceb", "shasum": "" }, "require": { @@ -2004,7 +2004,7 @@ ], "support": { "issues": "https://github.com/phpseclib/phpseclib/issues", - "source": "https://github.com/phpseclib/phpseclib/tree/3.0.39" + "source": "https://github.com/phpseclib/phpseclib/tree/3.0.41" }, "funding": [ { @@ -2020,7 +2020,7 @@ "type": "tidelift" } ], - "time": "2024-06-24T06:27:33+00:00" + "time": "2024-08-12T00:13:54+00:00" }, { "name": "pimple/pimple", @@ -2754,25 +2754,25 @@ }, { "name": "sabre/event", - "version": "5.1.4", + "version": "5.1.7", "source": { "type": "git", "url": "https://github.com/sabre-io/event.git", - "reference": "d7da22897125d34d7eddf7977758191c06a74497" + "reference": "86d57e305c272898ba3c28e9bd3d65d5464587c2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sabre-io/event/zipball/d7da22897125d34d7eddf7977758191c06a74497", - "reference": "d7da22897125d34d7eddf7977758191c06a74497", + "url": "https://api.github.com/repos/sabre-io/event/zipball/86d57e305c272898ba3c28e9bd3d65d5464587c2", + "reference": "86d57e305c272898ba3c28e9bd3d65d5464587c2", "shasum": "" }, "require": { "php": "^7.1 || ^8.0" }, "require-dev": { - "friendsofphp/php-cs-fixer": "~2.17.1", + "friendsofphp/php-cs-fixer": "~2.17.1||^3.63", "phpstan/phpstan": "^0.12", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.0" + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.6" }, "type": "library", "autoload": { @@ -2816,20 +2816,20 @@ "issues": "https://github.com/sabre-io/event/issues", "source": "https://github.com/fruux/sabre-event" }, - "time": "2021-11-04T06:51:17+00:00" + "time": "2024-08-27T11:23:05+00:00" }, { "name": "sabre/http", - "version": "5.1.10", + "version": "5.1.12", "source": { "type": "git", "url": "https://github.com/sabre-io/http.git", - "reference": "f9f3d1fba8916fa2f4ec25636c4fedc26cb94e02" + "reference": "dedff73f3995578bc942fa4c8484190cac14f139" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sabre-io/http/zipball/f9f3d1fba8916fa2f4ec25636c4fedc26cb94e02", - "reference": "f9f3d1fba8916fa2f4ec25636c4fedc26cb94e02", + "url": "https://api.github.com/repos/sabre-io/http/zipball/dedff73f3995578bc942fa4c8484190cac14f139", + "reference": "dedff73f3995578bc942fa4c8484190cac14f139", "shasum": "" }, "require": { @@ -2841,9 +2841,9 @@ "sabre/uri": "^2.0" }, "require-dev": { - "friendsofphp/php-cs-fixer": "~2.17.1", + "friendsofphp/php-cs-fixer": "~2.17.1||^3.63", "phpstan/phpstan": "^0.12", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.0" + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.6" }, "suggest": { "ext-curl": " to make http requests with the Client class" @@ -2879,31 +2879,31 @@ "issues": "https://github.com/sabre-io/http/issues", "source": "https://github.com/fruux/sabre-http" }, - "time": "2023-08-18T01:55:28+00:00" + "time": "2024-08-27T16:07:41+00:00" }, { "name": "sabre/uri", - "version": "2.3.3", + "version": "2.3.4", "source": { "type": "git", "url": "https://github.com/sabre-io/uri.git", - "reference": "7e0e7dfd0b7e14346a27eabd66e843a6e7f1812b" + "reference": "b76524c22de90d80ca73143680a8e77b1266c291" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sabre-io/uri/zipball/7e0e7dfd0b7e14346a27eabd66e843a6e7f1812b", - "reference": "7e0e7dfd0b7e14346a27eabd66e843a6e7f1812b", + "url": "https://api.github.com/repos/sabre-io/uri/zipball/b76524c22de90d80ca73143680a8e77b1266c291", + "reference": "b76524c22de90d80ca73143680a8e77b1266c291", "shasum": "" }, "require": { "php": "^7.4 || ^8.0" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^3.17", - "phpstan/extension-installer": "^1.3", - "phpstan/phpstan": "^1.10", - "phpstan/phpstan-phpunit": "^1.3", - "phpstan/phpstan-strict-rules": "^1.5", + "friendsofphp/php-cs-fixer": "^3.63", + "phpstan/extension-installer": "^1.4", + "phpstan/phpstan": "^1.12", + "phpstan/phpstan-phpunit": "^1.4", + "phpstan/phpstan-strict-rules": "^1.6", "phpunit/phpunit": "^9.6" }, "type": "library", @@ -2939,20 +2939,20 @@ "issues": "https://github.com/sabre-io/uri/issues", "source": "https://github.com/fruux/sabre-uri" }, - "time": "2023-06-09T06:54:04+00:00" + "time": "2024-08-27T12:18:16+00:00" }, { "name": "sabre/vobject", - "version": "4.5.4", + "version": "4.5.5", "source": { "type": "git", "url": "https://github.com/sabre-io/vobject.git", - "reference": "a6d53a3e5bec85ed3dd78868b7de0f5b4e12f772" + "reference": "7148cf57d25aaba0a49f6656d37c35e8175b3087" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sabre-io/vobject/zipball/a6d53a3e5bec85ed3dd78868b7de0f5b4e12f772", - "reference": "a6d53a3e5bec85ed3dd78868b7de0f5b4e12f772", + "url": "https://api.github.com/repos/sabre-io/vobject/zipball/7148cf57d25aaba0a49f6656d37c35e8175b3087", + "reference": "7148cf57d25aaba0a49f6656d37c35e8175b3087", "shasum": "" }, "require": { @@ -3043,20 +3043,20 @@ "issues": "https://github.com/sabre-io/vobject/issues", "source": "https://github.com/fruux/sabre-vobject" }, - "time": "2023-11-09T12:54:37+00:00" + "time": "2024-07-02T08:48:52+00:00" }, { "name": "sabre/xml", - "version": "2.2.7", + "version": "2.2.10", "source": { "type": "git", "url": "https://github.com/sabre-io/xml.git", - "reference": "f1d53d55976bbd4cf3e640dda6ebc31120c71a4e" + "reference": "0734b7af7f045d9ffb0018929750c492698a1536" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sabre-io/xml/zipball/f1d53d55976bbd4cf3e640dda6ebc31120c71a4e", - "reference": "f1d53d55976bbd4cf3e640dda6ebc31120c71a4e", + "url": "https://api.github.com/repos/sabre-io/xml/zipball/0734b7af7f045d9ffb0018929750c492698a1536", + "reference": "0734b7af7f045d9ffb0018929750c492698a1536", "shasum": "" }, "require": { @@ -3068,9 +3068,9 @@ "sabre/uri": ">=1.0,<3.0.0" }, "require-dev": { - "friendsofphp/php-cs-fixer": "~2.17.1", + "friendsofphp/php-cs-fixer": "~2.17.1||^3.63", "phpstan/phpstan": "^0.12", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.0" + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.6" }, "type": "library", "autoload": { @@ -3112,27 +3112,27 @@ "issues": "https://github.com/sabre-io/xml/issues", "source": "https://github.com/fruux/sabre-xml" }, - "time": "2024-04-18T10:15:43+00:00" + "time": "2024-08-27T15:55:05+00:00" }, { "name": "seld/jsonlint", - "version": "1.10.2", + "version": "1.11.0", "source": { "type": "git", "url": "https://github.com/Seldaek/jsonlint.git", - "reference": "9bb7db07b5d66d90f6ebf542f09fc67d800e5259" + "reference": "1748aaf847fc731cfad7725aec413ee46f0cc3a2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/9bb7db07b5d66d90f6ebf542f09fc67d800e5259", - "reference": "9bb7db07b5d66d90f6ebf542f09fc67d800e5259", + "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/1748aaf847fc731cfad7725aec413ee46f0cc3a2", + "reference": "1748aaf847fc731cfad7725aec413ee46f0cc3a2", "shasum": "" }, "require": { "php": "^5.3 || ^7.0 || ^8.0" }, "require-dev": { - "phpstan/phpstan": "^1.5", + "phpstan/phpstan": "^1.11", "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0 || ^8.5.13" }, "bin": [ @@ -3164,7 +3164,7 @@ ], "support": { "issues": "https://github.com/Seldaek/jsonlint/issues", - "source": "https://github.com/Seldaek/jsonlint/tree/1.10.2" + "source": "https://github.com/Seldaek/jsonlint/tree/1.11.0" }, "funding": [ { @@ -3176,7 +3176,7 @@ "type": "tidelift" } ], - "time": "2024-02-07T12:57:50+00:00" + "time": "2024-07-11T14:55:45+00:00" }, { "name": "simplesamlphp/assert", @@ -5063,16 +5063,16 @@ }, { "name": "symfony/cache", - "version": "v5.4.40", + "version": "v5.4.42", "source": { "type": "git", "url": "https://github.com/symfony/cache.git", - "reference": "89005bc368ca02ed0433c592e4d27670d0844a66" + "reference": "6f5f750692bd5a212e01a4f1945fd856bceef89e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/cache/zipball/89005bc368ca02ed0433c592e4d27670d0844a66", - "reference": "89005bc368ca02ed0433c592e4d27670d0844a66", + "url": "https://api.github.com/repos/symfony/cache/zipball/6f5f750692bd5a212e01a4f1945fd856bceef89e", + "reference": "6f5f750692bd5a212e01a4f1945fd856bceef89e", "shasum": "" }, "require": { @@ -5140,7 +5140,7 @@ "psr6" ], "support": { - "source": "https://github.com/symfony/cache/tree/v5.4.40" + "source": "https://github.com/symfony/cache/tree/v5.4.42" }, "funding": [ { @@ -5156,7 +5156,7 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:33:22+00:00" + "time": "2024-07-10T06:02:18+00:00" }, { "name": "symfony/cache-contracts", @@ -5318,16 +5318,16 @@ }, { "name": "symfony/console", - "version": "v5.4.40", + "version": "v5.4.42", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "aa73115c0c24220b523625bfcfa655d7d73662dd" + "reference": "cef62396a0477e94fc52e87a17c6e5c32e226b7f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/aa73115c0c24220b523625bfcfa655d7d73662dd", - "reference": "aa73115c0c24220b523625bfcfa655d7d73662dd", + "url": "https://api.github.com/repos/symfony/console/zipball/cef62396a0477e94fc52e87a17c6e5c32e226b7f", + "reference": "cef62396a0477e94fc52e87a17c6e5c32e226b7f", "shasum": "" }, "require": { @@ -5397,7 +5397,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.4.40" + "source": "https://github.com/symfony/console/tree/v5.4.42" }, "funding": [ { @@ -5413,20 +5413,20 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:33:22+00:00" + "time": "2024-07-26T12:21:55+00:00" }, { "name": "symfony/dependency-injection", - "version": "v5.4.40", + "version": "v5.4.42", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "408b33326496030c201b8051b003e9e8cdb2efc9" + "reference": "c8409889fdbf48b99271930ea0ebcf3ee5e1ceae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/408b33326496030c201b8051b003e9e8cdb2efc9", - "reference": "408b33326496030c201b8051b003e9e8cdb2efc9", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/c8409889fdbf48b99271930ea0ebcf3ee5e1ceae", + "reference": "c8409889fdbf48b99271930ea0ebcf3ee5e1ceae", "shasum": "" }, "require": { @@ -5486,7 +5486,7 @@ "description": "Allows you to standardize and centralize the way objects are constructed in your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/dependency-injection/tree/v5.4.40" + "source": "https://github.com/symfony/dependency-injection/tree/v5.4.42" }, "funding": [ { @@ -5502,7 +5502,7 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:33:22+00:00" + "time": "2024-07-25T13:57:40+00:00" }, { "name": "symfony/deprecation-contracts", @@ -5573,16 +5573,16 @@ }, { "name": "symfony/error-handler", - "version": "v5.4.40", + "version": "v5.4.42", "source": { "type": "git", "url": "https://github.com/symfony/error-handler.git", - "reference": "c6c8f965a87b22d5005a7806783c7f10ae7e58cd" + "reference": "db15ba0fd50890156ed40087ccedc7851a1f5b76" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/error-handler/zipball/c6c8f965a87b22d5005a7806783c7f10ae7e58cd", - "reference": "c6c8f965a87b22d5005a7806783c7f10ae7e58cd", + "url": "https://api.github.com/repos/symfony/error-handler/zipball/db15ba0fd50890156ed40087ccedc7851a1f5b76", + "reference": "db15ba0fd50890156ed40087ccedc7851a1f5b76", "shasum": "" }, "require": { @@ -5624,7 +5624,7 @@ "description": "Provides tools to manage errors and ease debugging PHP code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/error-handler/tree/v5.4.40" + "source": "https://github.com/symfony/error-handler/tree/v5.4.42" }, "funding": [ { @@ -5640,7 +5640,7 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:33:22+00:00" + "time": "2024-07-23T12:34:05+00:00" }, { "name": "symfony/event-dispatcher", @@ -5808,16 +5808,16 @@ }, { "name": "symfony/filesystem", - "version": "v5.4.40", + "version": "v5.4.41", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "26dd9912df6940810ea00f8f53ad48d6a3424995" + "reference": "6d29dd9340b372fa603f04e6df4dd76bb808591e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/26dd9912df6940810ea00f8f53ad48d6a3424995", - "reference": "26dd9912df6940810ea00f8f53ad48d6a3424995", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/6d29dd9340b372fa603f04e6df4dd76bb808591e", + "reference": "6d29dd9340b372fa603f04e6df4dd76bb808591e", "shasum": "" }, "require": { @@ -5855,7 +5855,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v5.4.40" + "source": "https://github.com/symfony/filesystem/tree/v5.4.41" }, "funding": [ { @@ -5871,20 +5871,20 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:33:22+00:00" + "time": "2024-06-28T09:36:24+00:00" }, { "name": "symfony/finder", - "version": "v5.4.40", + "version": "v5.4.42", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "f51cff4687547641c7d8180d74932ab40b2205ce" + "reference": "0724c51fa067b198e36506d2864e09a52180998a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/f51cff4687547641c7d8180d74932ab40b2205ce", - "reference": "f51cff4687547641c7d8180d74932ab40b2205ce", + "url": "https://api.github.com/repos/symfony/finder/zipball/0724c51fa067b198e36506d2864e09a52180998a", + "reference": "0724c51fa067b198e36506d2864e09a52180998a", "shasum": "" }, "require": { @@ -5918,7 +5918,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v5.4.40" + "source": "https://github.com/symfony/finder/tree/v5.4.42" }, "funding": [ { @@ -5934,20 +5934,20 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:33:22+00:00" + "time": "2024-07-22T08:53:29+00:00" }, { "name": "symfony/framework-bundle", - "version": "v5.4.40", + "version": "v5.4.42", "source": { "type": "git", "url": "https://github.com/symfony/framework-bundle.git", - "reference": "603090d8327e279bd233d5ce42a1ed89bc91612f" + "reference": "0a9f66cd53cb2578c9dff53645304ef313ecb63b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/framework-bundle/zipball/603090d8327e279bd233d5ce42a1ed89bc91612f", - "reference": "603090d8327e279bd233d5ce42a1ed89bc91612f", + "url": "https://api.github.com/repos/symfony/framework-bundle/zipball/0a9f66cd53cb2578c9dff53645304ef313ecb63b", + "reference": "0a9f66cd53cb2578c9dff53645304ef313ecb63b", "shasum": "" }, "require": { @@ -6068,7 +6068,7 @@ "description": "Provides a tight integration between Symfony components and the Symfony full-stack framework", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/framework-bundle/tree/v5.4.40" + "source": "https://github.com/symfony/framework-bundle/tree/v5.4.42" }, "funding": [ { @@ -6084,20 +6084,20 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:33:22+00:00" + "time": "2024-07-09T20:57:15+00:00" }, { "name": "symfony/http-foundation", - "version": "v5.4.40", + "version": "v5.4.42", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "cf4893ca4eca3fac4ae06da1590afdbbb4217847" + "reference": "9c375b2abef0b657aa0b7612b763df5c12a465ab" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/cf4893ca4eca3fac4ae06da1590afdbbb4217847", - "reference": "cf4893ca4eca3fac4ae06da1590afdbbb4217847", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/9c375b2abef0b657aa0b7612b763df5c12a465ab", + "reference": "9c375b2abef0b657aa0b7612b763df5c12a465ab", "shasum": "" }, "require": { @@ -6144,7 +6144,7 @@ "description": "Defines an object-oriented layer for the HTTP specification", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-foundation/tree/v5.4.40" + "source": "https://github.com/symfony/http-foundation/tree/v5.4.42" }, "funding": [ { @@ -6160,20 +6160,20 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:33:22+00:00" + "time": "2024-07-26T11:59:59+00:00" }, { "name": "symfony/http-kernel", - "version": "v5.4.40", + "version": "v5.4.42", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "3ad03183c6985adc2eece16f239f8cfe1c4ccbe3" + "reference": "948db7caf761dacc8abb9a59465f0639c30cc6dd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/3ad03183c6985adc2eece16f239f8cfe1c4ccbe3", - "reference": "3ad03183c6985adc2eece16f239f8cfe1c4ccbe3", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/948db7caf761dacc8abb9a59465f0639c30cc6dd", + "reference": "948db7caf761dacc8abb9a59465f0639c30cc6dd", "shasum": "" }, "require": { @@ -6257,7 +6257,7 @@ "description": "Provides a structured process for converting a Request into a Response", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-kernel/tree/v5.4.40" + "source": "https://github.com/symfony/http-kernel/tree/v5.4.42" }, "funding": [ { @@ -6273,7 +6273,7 @@ "type": "tidelift" } ], - "time": "2024-06-02T15:53:08+00:00" + "time": "2024-07-26T14:46:22+00:00" }, { "name": "symfony/polyfill-ctype", @@ -6900,16 +6900,16 @@ }, { "name": "symfony/routing", - "version": "v5.4.40", + "version": "v5.4.42", "source": { "type": "git", "url": "https://github.com/symfony/routing.git", - "reference": "6df1dd8b306649303267a760699cf04cf39b1f7b" + "reference": "f8dd6f80c96aeec9b13fc13757842342e05c4878" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/6df1dd8b306649303267a760699cf04cf39b1f7b", - "reference": "6df1dd8b306649303267a760699cf04cf39b1f7b", + "url": "https://api.github.com/repos/symfony/routing/zipball/f8dd6f80c96aeec9b13fc13757842342e05c4878", + "reference": "f8dd6f80c96aeec9b13fc13757842342e05c4878", "shasum": "" }, "require": { @@ -6970,7 +6970,7 @@ "url" ], "support": { - "source": "https://github.com/symfony/routing/tree/v5.4.40" + "source": "https://github.com/symfony/routing/tree/v5.4.42" }, "funding": [ { @@ -6986,7 +6986,7 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:33:22+00:00" + "time": "2024-07-09T20:57:15+00:00" }, { "name": "symfony/service-contracts", @@ -7073,16 +7073,16 @@ }, { "name": "symfony/string", - "version": "v5.4.40", + "version": "v5.4.42", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "142877285aa974a6f7685e292ab5ba9aae86b143" + "reference": "909cec913edea162a3b2836788228ad45fcab337" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/142877285aa974a6f7685e292ab5ba9aae86b143", - "reference": "142877285aa974a6f7685e292ab5ba9aae86b143", + "url": "https://api.github.com/repos/symfony/string/zipball/909cec913edea162a3b2836788228ad45fcab337", + "reference": "909cec913edea162a3b2836788228ad45fcab337", "shasum": "" }, "require": { @@ -7139,7 +7139,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.4.40" + "source": "https://github.com/symfony/string/tree/v5.4.42" }, "funding": [ { @@ -7155,20 +7155,20 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:33:22+00:00" + "time": "2024-07-20T18:38:32+00:00" }, { "name": "symfony/var-dumper", - "version": "v5.4.40", + "version": "v5.4.42", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "af8868a6e9d6082dfca11f1a1f205ae93a8b6d93" + "reference": "0c17c56d8ea052fc33942251c75d0e28936e043d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/af8868a6e9d6082dfca11f1a1f205ae93a8b6d93", - "reference": "af8868a6e9d6082dfca11f1a1f205ae93a8b6d93", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/0c17c56d8ea052fc33942251c75d0e28936e043d", + "reference": "0c17c56d8ea052fc33942251c75d0e28936e043d", "shasum": "" }, "require": { @@ -7228,7 +7228,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v5.4.40" + "source": "https://github.com/symfony/var-dumper/tree/v5.4.42" }, "funding": [ { @@ -7244,7 +7244,7 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:33:22+00:00" + "time": "2024-07-26T12:23:09+00:00" }, { "name": "symfony/var-exporter", @@ -7911,30 +7911,38 @@ }, { "name": "composer/pcre", - "version": "3.1.4", + "version": "3.3.1", "source": { "type": "git", "url": "https://github.com/composer/pcre.git", - "reference": "04229f163664973f68f38f6f73d917799168ef24" + "reference": "63aaeac21d7e775ff9bc9d45021e1745c97521c4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/pcre/zipball/04229f163664973f68f38f6f73d917799168ef24", - "reference": "04229f163664973f68f38f6f73d917799168ef24", + "url": "https://api.github.com/repos/composer/pcre/zipball/63aaeac21d7e775ff9bc9d45021e1745c97521c4", + "reference": "63aaeac21d7e775ff9bc9d45021e1745c97521c4", "shasum": "" }, "require": { "php": "^7.4 || ^8.0" }, + "conflict": { + "phpstan/phpstan": "<1.11.10" + }, "require-dev": { - "phpstan/phpstan": "^1.3", + "phpstan/phpstan": "^1.11.10", "phpstan/phpstan-strict-rules": "^1.1", - "symfony/phpunit-bridge": "^5" + "phpunit/phpunit": "^8 || ^9" }, "type": "library", "extra": { "branch-alias": { "dev-main": "3.x-dev" + }, + "phpstan": { + "includes": [ + "extension.neon" + ] } }, "autoload": { @@ -7962,7 +7970,7 @@ ], "support": { "issues": "https://github.com/composer/pcre/issues", - "source": "https://github.com/composer/pcre/tree/3.1.4" + "source": "https://github.com/composer/pcre/tree/3.3.1" }, "funding": [ { @@ -7978,20 +7986,20 @@ "type": "tidelift" } ], - "time": "2024-05-27T13:40:54+00:00" + "time": "2024-08-27T18:44:43+00:00" }, { "name": "composer/semver", - "version": "3.4.0", + "version": "3.4.2", "source": { "type": "git", "url": "https://github.com/composer/semver.git", - "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32" + "reference": "c51258e759afdb17f1fd1fe83bc12baaef6309d6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/35e8d0af4486141bc745f23a29cc2091eb624a32", - "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32", + "url": "https://api.github.com/repos/composer/semver/zipball/c51258e759afdb17f1fd1fe83bc12baaef6309d6", + "reference": "c51258e759afdb17f1fd1fe83bc12baaef6309d6", "shasum": "" }, "require": { @@ -8043,7 +8051,7 @@ "support": { "irc": "ircs://irc.libera.chat:6697/composer", "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/3.4.0" + "source": "https://github.com/composer/semver/tree/3.4.2" }, "funding": [ { @@ -8059,7 +8067,7 @@ "type": "tidelift" } ], - "time": "2023-08-31T09:50:34+00:00" + "time": "2024-07-12T11:35:52+00:00" }, { "name": "composer/xdebug-handler", @@ -8307,16 +8315,16 @@ }, { "name": "friendsofphp/php-cs-fixer", - "version": "v3.59.3", + "version": "v3.63.2", "source": { "type": "git", "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", - "reference": "30ba9ecc2b0e5205e578fe29973c15653d9bfd29" + "reference": "9d427f3f14984403a6ae9fc726b61765ca0c005e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/30ba9ecc2b0e5205e578fe29973c15653d9bfd29", - "reference": "30ba9ecc2b0e5205e578fe29973c15653d9bfd29", + "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/9d427f3f14984403a6ae9fc726b61765ca0c005e", + "reference": "9d427f3f14984403a6ae9fc726b61765ca0c005e", "shasum": "" }, "require": { @@ -8398,7 +8406,7 @@ ], "support": { "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", - "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.59.3" + "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.63.2" }, "funding": [ { @@ -8406,7 +8414,7 @@ "type": "github" } ], - "time": "2024-06-16T14:17:03+00:00" + "time": "2024-08-28T10:47:21+00:00" }, { "name": "hamcrest/hamcrest-php", @@ -8461,23 +8469,24 @@ }, { "name": "mikey179/vfsstream", - "version": "v1.6.11", + "version": "v1.6.12", "source": { "type": "git", "url": "https://github.com/bovigo/vfsStream.git", - "reference": "17d16a85e6c26ce1f3e2fa9ceeacdc2855db1e9f" + "reference": "fe695ec993e0a55c3abdda10a9364eb31c6f1bf0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/bovigo/vfsStream/zipball/17d16a85e6c26ce1f3e2fa9ceeacdc2855db1e9f", - "reference": "17d16a85e6c26ce1f3e2fa9ceeacdc2855db1e9f", + "url": "https://api.github.com/repos/bovigo/vfsStream/zipball/fe695ec993e0a55c3abdda10a9364eb31c6f1bf0", + "reference": "fe695ec993e0a55c3abdda10a9364eb31c6f1bf0", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": ">=7.1.0" }, "require-dev": { - "phpunit/phpunit": "^4.5|^5.0" + "phpunit/phpunit": "^7.5||^8.5||^9.6", + "yoast/phpunit-polyfills": "^2.0" }, "type": "library", "extra": { @@ -8508,7 +8517,7 @@ "source": "https://github.com/bovigo/vfsStream/tree/master", "wiki": "https://github.com/bovigo/vfsStream/wiki" }, - "time": "2022-02-23T02:02:42+00:00" + "time": "2024-08-29T18:43:31+00:00" }, { "name": "mockery/mockery", @@ -8655,16 +8664,16 @@ }, { "name": "nikic/php-parser", - "version": "v5.0.2", + "version": "v5.1.0", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "139676794dc1e9231bf7bcd123cfc0c99182cb13" + "reference": "683130c2ff8c2739f4822ff7ac5c873ec529abd1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/139676794dc1e9231bf7bcd123cfc0c99182cb13", - "reference": "139676794dc1e9231bf7bcd123cfc0c99182cb13", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/683130c2ff8c2739f4822ff7ac5c873ec529abd1", + "reference": "683130c2ff8c2739f4822ff7ac5c873ec529abd1", "shasum": "" }, "require": { @@ -8675,7 +8684,7 @@ }, "require-dev": { "ircmaxell/php-yacc": "^0.0.7", - "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" + "phpunit/phpunit": "^9.0" }, "bin": [ "bin/php-parse" @@ -8707,9 +8716,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v5.0.2" + "source": "https://github.com/nikic/PHP-Parser/tree/v5.1.0" }, - "time": "2024-03-05T20:51:40+00:00" + "time": "2024-07-01T20:03:41+00:00" }, { "name": "phar-io/manifest", @@ -8831,16 +8840,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.11.5", + "version": "1.12.0", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "490f0ae1c92b082f154681d7849aee776a7c1443" + "reference": "384af967d35b2162f69526c7276acadce534d0e1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/490f0ae1c92b082f154681d7849aee776a7c1443", - "reference": "490f0ae1c92b082f154681d7849aee776a7c1443", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/384af967d35b2162f69526c7276acadce534d0e1", + "reference": "384af967d35b2162f69526c7276acadce534d0e1", "shasum": "" }, "require": { @@ -8885,39 +8894,39 @@ "type": "github" } ], - "time": "2024-06-17T15:10:54+00:00" + "time": "2024-08-27T09:18:05+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "9.2.31", + "version": "9.2.32", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "48c34b5d8d983006bd2adc2d0de92963b9155965" + "reference": "85402a822d1ecf1db1096959413d35e1c37cf1a5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/48c34b5d8d983006bd2adc2d0de92963b9155965", - "reference": "48c34b5d8d983006bd2adc2d0de92963b9155965", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/85402a822d1ecf1db1096959413d35e1c37cf1a5", + "reference": "85402a822d1ecf1db1096959413d35e1c37cf1a5", "shasum": "" }, "require": { "ext-dom": "*", "ext-libxml": "*", "ext-xmlwriter": "*", - "nikic/php-parser": "^4.18 || ^5.0", + "nikic/php-parser": "^4.19.1 || ^5.1.0", "php": ">=7.3", - "phpunit/php-file-iterator": "^3.0.3", - "phpunit/php-text-template": "^2.0.2", - "sebastian/code-unit-reverse-lookup": "^2.0.2", - "sebastian/complexity": "^2.0", - "sebastian/environment": "^5.1.2", - "sebastian/lines-of-code": "^1.0.3", - "sebastian/version": "^3.0.1", - "theseer/tokenizer": "^1.2.0" + "phpunit/php-file-iterator": "^3.0.6", + "phpunit/php-text-template": "^2.0.4", + "sebastian/code-unit-reverse-lookup": "^2.0.3", + "sebastian/complexity": "^2.0.3", + "sebastian/environment": "^5.1.5", + "sebastian/lines-of-code": "^1.0.4", + "sebastian/version": "^3.0.2", + "theseer/tokenizer": "^1.2.3" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^9.6" }, "suggest": { "ext-pcov": "PHP extension that provides line coverage", @@ -8926,7 +8935,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "9.2-dev" + "dev-main": "9.2.x-dev" } }, "autoload": { @@ -8955,7 +8964,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.31" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.32" }, "funding": [ { @@ -8963,7 +8972,7 @@ "type": "github" } ], - "time": "2024-03-02T06:37:42+00:00" + "time": "2024-08-22T04:23:01+00:00" }, { "name": "phpunit/php-file-iterator", @@ -9208,45 +9217,45 @@ }, { "name": "phpunit/phpunit", - "version": "9.6.19", + "version": "9.6.20", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "a1a54a473501ef4cdeaae4e06891674114d79db8" + "reference": "49d7820565836236411f5dc002d16dd689cde42f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/a1a54a473501ef4cdeaae4e06891674114d79db8", - "reference": "a1a54a473501ef4cdeaae4e06891674114d79db8", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/49d7820565836236411f5dc002d16dd689cde42f", + "reference": "49d7820565836236411f5dc002d16dd689cde42f", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.3.1 || ^2", + "doctrine/instantiator": "^1.5.0 || ^2", "ext-dom": "*", "ext-json": "*", "ext-libxml": "*", "ext-mbstring": "*", "ext-xml": "*", "ext-xmlwriter": "*", - "myclabs/deep-copy": "^1.10.1", - "phar-io/manifest": "^2.0.3", - "phar-io/version": "^3.0.2", + "myclabs/deep-copy": "^1.12.0", + "phar-io/manifest": "^2.0.4", + "phar-io/version": "^3.2.1", "php": ">=7.3", - "phpunit/php-code-coverage": "^9.2.28", - "phpunit/php-file-iterator": "^3.0.5", + "phpunit/php-code-coverage": "^9.2.31", + "phpunit/php-file-iterator": "^3.0.6", "phpunit/php-invoker": "^3.1.1", - "phpunit/php-text-template": "^2.0.3", - "phpunit/php-timer": "^5.0.2", - "sebastian/cli-parser": "^1.0.1", - "sebastian/code-unit": "^1.0.6", + "phpunit/php-text-template": "^2.0.4", + "phpunit/php-timer": "^5.0.3", + "sebastian/cli-parser": "^1.0.2", + "sebastian/code-unit": "^1.0.8", "sebastian/comparator": "^4.0.8", - "sebastian/diff": "^4.0.3", - "sebastian/environment": "^5.1.3", - "sebastian/exporter": "^4.0.5", - "sebastian/global-state": "^5.0.1", - "sebastian/object-enumerator": "^4.0.3", - "sebastian/resource-operations": "^3.0.3", - "sebastian/type": "^3.2", + "sebastian/diff": "^4.0.6", + "sebastian/environment": "^5.1.5", + "sebastian/exporter": "^4.0.6", + "sebastian/global-state": "^5.0.7", + "sebastian/object-enumerator": "^4.0.4", + "sebastian/resource-operations": "^3.0.4", + "sebastian/type": "^3.2.1", "sebastian/version": "^3.0.2" }, "suggest": { @@ -9291,7 +9300,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.19" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.20" }, "funding": [ { @@ -9307,7 +9316,7 @@ "type": "tidelift" } ], - "time": "2024-04-05T04:35:58+00:00" + "time": "2024-07-10T11:45:39+00:00" }, { "name": "react/cache", @@ -9683,31 +9692,31 @@ }, { "name": "react/socket", - "version": "v1.15.0", + "version": "v1.16.0", "source": { "type": "git", "url": "https://github.com/reactphp/socket.git", - "reference": "216d3aec0b87f04a40ca04f481e6af01bdd1d038" + "reference": "23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/reactphp/socket/zipball/216d3aec0b87f04a40ca04f481e6af01bdd1d038", - "reference": "216d3aec0b87f04a40ca04f481e6af01bdd1d038", + "url": "https://api.github.com/repos/reactphp/socket/zipball/23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1", + "reference": "23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1", "shasum": "" }, "require": { "evenement/evenement": "^3.0 || ^2.0 || ^1.0", "php": ">=5.3.0", - "react/dns": "^1.11", + "react/dns": "^1.13", "react/event-loop": "^1.2", - "react/promise": "^3 || ^2.6 || ^1.2.1", - "react/stream": "^1.2" + "react/promise": "^3.2 || ^2.6 || ^1.2.1", + "react/stream": "^1.4" }, "require-dev": { "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", - "react/async": "^4 || ^3 || ^2", + "react/async": "^4.3 || ^3.3 || ^2", "react/promise-stream": "^1.4", - "react/promise-timer": "^1.10" + "react/promise-timer": "^1.11" }, "type": "library", "autoload": { @@ -9751,7 +9760,7 @@ ], "support": { "issues": "https://github.com/reactphp/socket/issues", - "source": "https://github.com/reactphp/socket/tree/v1.15.0" + "source": "https://github.com/reactphp/socket/tree/v1.16.0" }, "funding": [ { @@ -9759,7 +9768,7 @@ "type": "open_collective" } ], - "time": "2023-12-15T11:02:10+00:00" + "time": "2024-07-26T10:38:09+00:00" }, { "name": "react/stream", diff --git a/libs/composer/patches/phpspreadsheet.patch b/libs/composer/patches/phpspreadsheet.patch new file mode 100644 index 000000000000..741ca2fa36f6 --- /dev/null +++ b/libs/composer/patches/phpspreadsheet.patch @@ -0,0 +1,138 @@ +diff --git a/src/PhpSpreadsheet/Writer/Html.php b/src/PhpSpreadsheet/Writer/Html.php +index bba60f635fb..842998f9eb5 100644 +--- a/src/PhpSpreadsheet/Writer/Html.php ++++ b/src/PhpSpreadsheet/Writer/Html.php +@@ -31,6 +31,21 @@ use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet; + + class Html extends BaseWriter + { ++ /** ++ * Migration aid to tell if html tags will be treated as plaintext in comments. ++ * if ( ++ * defined( ++ * \PhpOffice\PhpSpreadsheet\Writer\Html::class ++ * . '::COMMENT_HTML_TAGS_PLAINTEXT' ++ * ) ++ * ) { ++ * new logic with styling in TextRun elements ++ * } else { ++ * old logic with styling via Html tags ++ * }. ++ */ ++ public const COMMENT_HTML_TAGS_PLAINTEXT = true; ++ + /** + * Spreadsheet object. + * +@@ -1069,7 +1084,7 @@ class Html extends BaseWriter + } + + $css['color'] = '#' . $font->getColor()->getRGB(); +- $css['font-family'] = '\'' . $font->getName() . '\''; ++ $css['font-family'] = '\'' . htmlspecialchars((string) $font->getName(), ENT_QUOTES) . '\''; + $css['font-size'] = $font->getSize() . 'pt'; + + return $css; +@@ -1289,10 +1304,11 @@ class Html extends BaseWriter + return [$cell, $cssClass, $coordinate]; + } + +- private function generateRowCellDataValueRich(Cell $cell, string &$cellData): void ++ private function generateRowCellDataValueRich(RichText $richText): string + { ++ $cellData = ''; + // Loop through rich text elements +- $elements = $cell->getValue()->getRichTextElements(); ++ $elements = $richText->getRichTextElements(); + foreach ($elements as $element) { + // Rich text start? + if ($element instanceof Run) { +@@ -1307,6 +1323,8 @@ class Html extends BaseWriter + $cellData .= ''; + $cellEnd = ''; + } ++ } else { ++ $cellData .= ''; + } + + // Convert UTF8 data to PCDATA +@@ -1322,12 +1340,14 @@ class Html extends BaseWriter + $cellData .= htmlspecialchars($cellText, Settings::htmlEntityFlags()); + } + } ++ ++ return nl2br($cellData); + } + + private function generateRowCellDataValue(Worksheet $worksheet, Cell $cell, string &$cellData): void + { + if ($cell->getValue() instanceof RichText) { +- $this->generateRowCellDataValueRich($cell, $cellData); ++ $cellData .= $this->generateRowCellDataValueRich($cell->getValue()); + } else { + $origData = $this->preCalculateFormulas ? $cell->getCalculatedValue() : $cell->getValue(); + $formatCode = $worksheet->getParentOrThrow()->getCellXfByIndex($cell->getXfIndex())->getNumberFormat()->getFormatCode(); +@@ -1816,15 +1836,10 @@ class Html extends BaseWriter + { + $result = ''; + if (!$this->isPdf && isset($worksheet->getComments()[$coordinate])) { +- $sanitizer = new HTMLPurifier(); +- $cachePath = File::sysGetTempDir() . '/phpsppur'; +- if (is_dir($cachePath) || mkdir($cachePath)) { +- $sanitizer->config->set('Cache.SerializerPath', $cachePath); +- } +- $sanitizedString = $sanitizer->purify($worksheet->getComment($coordinate)->getText()->getPlainText()); ++ $sanitizedString = $this->generateRowCellDataValueRich($worksheet->getComment($coordinate)->getText()); + if ($sanitizedString !== '') { + $result .= ''; +- $result .= '
' . nl2br($sanitizedString) . '
'; ++ $result .= '
' . $sanitizedString . '
'; + $result .= PHP_EOL; + } + } + +diff --git a/src/PhpSpreadsheet/Reader/Security/XmlScanner.php b/src/PhpSpreadsheet/Reader/Security/XmlScanner.php +index 874ed1e7f95..f8eaf39d096 100644 +--- a/src/PhpSpreadsheet/Reader/Security/XmlScanner.php ++++ b/src/PhpSpreadsheet/Reader/Security/XmlScanner.php +@@ -113,15 +113,12 @@ class XmlScanner + */ + private function toUtf8($xml) + { +- $pattern = '/encoding="(.*?)"/'; +- $result = preg_match($pattern, $xml, $matches); +- $charset = strtoupper($result ? $matches[1] : 'UTF-8'); ++ $charset = $this->findCharSet($xml); + + if ($charset !== 'UTF-8') { + $xml = self::forceString(mb_convert_encoding($xml, 'UTF-8', $charset)); + +- $result = preg_match($pattern, $xml, $matches); +- $charset = strtoupper($result ? $matches[1] : 'UTF-8'); ++ $charset = $this->findCharSet($xml); + if ($charset !== 'UTF-8') { + throw new Reader\Exception('Suspicious Double-encoded XML, spreadsheet file load() aborted to prevent XXE/XEE attacks'); + } +@@ -130,6 +127,22 @@ class XmlScanner + return $xml; + } + ++ private function findCharSet(string $xml): string ++ { ++ $patterns = [ ++ '/encoding="([^"]*]?)"/', ++ "/encoding='([^']*?)'/", ++ ]; ++ ++ foreach ($patterns as $pattern) { ++ if (preg_match($pattern, $xml, $matches)) { ++ return strtoupper($matches[1]); ++ } ++ } ++ ++ return 'UTF-8'; ++ } ++ + /** + * Scan the XML for use of Date: Fri, 30 Aug 2024 13:51:00 +0200 Subject: [PATCH 022/292] Improved English lang file --- lang/ilias_en.lang | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lang/ilias_en.lang b/lang/ilias_en.lang index ad0a645e2423..59ce202e4e34 100644 --- a/lang/ilias_en.lang +++ b/lang/ilias_en.lang @@ -16874,7 +16874,7 @@ user#:#usr_public_profile_global#:#WWW / Accessible for all users on the Interne user#:#usr_public_profile_logged_in#:#Visible to logged-in users of ILIAS usr#:#user_action#:#User Action usr#:#user_actions#:#User Actions -usr#:#user_actions_activation_info#:#Actions will only be made available to users if the corresponding services are activated and all preconditions are fulfilled (e.g. permissions requirements). +usr#:#user_actions_activation_info#:#Actions will only be listed for users if the corresponding services have been activated and all preconditions are met (e.g. permissions requirements). validation#:#no_array#:#Given value is not an array validation#:#not_a_null#:#Value of type '%s' is not a null. validation#:#not_a_string#:#Value of type '%s' is not a string. @@ -17203,4 +17203,4 @@ wsp#:#wsp_type_ltiv#:#Certificate: LTI Consumer wsp#:#wsp_type_scov#:#Certificate: SCORM wsp#:#wsp_type_tstv#:#Certificate: Test wsp#:#wsp_type_webr#:#Weblink -wsp#:#wsp_type_wfld#:#Folder \ No newline at end of file +wsp#:#wsp_type_wfld#:#Folder From d232173c8ff531bace4c99476272129bd7834985 Mon Sep 17 00:00:00 2001 From: Stephan Kergomard Date: Fri, 30 Aug 2024 16:20:52 +0200 Subject: [PATCH 023/292] Lang: Sort Language File --- lang/ilias_en.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/ilias_en.lang b/lang/ilias_en.lang index 59ce202e4e34..23887030d44f 100644 --- a/lang/ilias_en.lang +++ b/lang/ilias_en.lang @@ -17203,4 +17203,4 @@ wsp#:#wsp_type_ltiv#:#Certificate: LTI Consumer wsp#:#wsp_type_scov#:#Certificate: SCORM wsp#:#wsp_type_tstv#:#Certificate: Test wsp#:#wsp_type_webr#:#Weblink -wsp#:#wsp_type_wfld#:#Folder +wsp#:#wsp_type_wfld#:#Folder \ No newline at end of file From cbd49961e1af225f88a9cee079763ad6720d25c8 Mon Sep 17 00:00:00 2001 From: mjansen Date: Mon, 2 Sep 2024 16:24:30 +0200 Subject: [PATCH 024/292] Forum: Fix long table id when moving threads See: https://mantis.ilias.de/view.php?id=41995 --- Modules/Forum/classes/class.ilObjForumGUI.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/Forum/classes/class.ilObjForumGUI.php b/Modules/Forum/classes/class.ilObjForumGUI.php index 311405cad8db..ab56053a7a15 100755 --- a/Modules/Forum/classes/class.ilObjForumGUI.php +++ b/Modules/Forum/classes/class.ilObjForumGUI.php @@ -3756,7 +3756,7 @@ public function moveThreadsObject(): bool } $tblThr = new ilTable2GUI($this); - $tblThr->setId('il_frm_thread_move_table_' . $this->object->getRefId()); + $tblThr->setId('frmthrmv' . $this->object->getRefId()); $tblThr->setTitle($this->lng->txt('move_chosen_topics')); $tblThr->addColumn($this->lng->txt('subject'), 'top_name', '100%'); $tblThr->disable('header'); From d2de713e3050af6f314d68790b891e25579eab97 Mon Sep 17 00:00:00 2001 From: mjansen Date: Tue, 27 Aug 2024 14:59:12 +0200 Subject: [PATCH 025/292] File/Finder: Fix return type of `key` iterator method See: https://mantis.ilias.de/view.php?id=41967 --- src/Filesystem/Finder/Iterator/RecursiveDirectoryIterator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Filesystem/Finder/Iterator/RecursiveDirectoryIterator.php b/src/Filesystem/Finder/Iterator/RecursiveDirectoryIterator.php index 767f15fcd6b9..fda26be8eb1b 100644 --- a/src/Filesystem/Finder/Iterator/RecursiveDirectoryIterator.php +++ b/src/Filesystem/Finder/Iterator/RecursiveDirectoryIterator.php @@ -48,7 +48,7 @@ public function __construct(Filesystem $filesystem, string $dir) /** * @inheritdoc */ - public function key(): string + public function key() { return key($this->files); } From 14513c543f49f4174b0d71a3f0d8cfd1c9c6595e Mon Sep 17 00:00:00 2001 From: Stephan Kergomard Date: Mon, 9 Sep 2024 09:45:42 +0200 Subject: [PATCH 026/292] User: Fix Setting ImportId When it is Null See: https://mantis.ilias.de/view.php?id=42001 --- Services/User/classes/class.ilUserImportParser.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Services/User/classes/class.ilUserImportParser.php b/Services/User/classes/class.ilUserImportParser.php index 686ed3f05319..8e0456ccbf27 100755 --- a/Services/User/classes/class.ilUserImportParser.php +++ b/Services/User/classes/class.ilUserImportParser.php @@ -575,7 +575,7 @@ public function verifyBeginTag( $this->containedTags = []; $this->userObj = new ilObjUser(); $this->userObj->setLanguage($a_attribs["Language"] ?? ''); - $this->userObj->setImportId($a_attribs["Id"]); + $this->userObj->setImportId($a_attribs["Id"] ?? ''); $this->currentPrefKey = null; // if we have an object id, store it $this->user_id = -1; From 10ed54fb0a70ccbc38ee24c871ac580ba5eb67db Mon Sep 17 00:00:00 2001 From: Stephan Kergomard Date: Mon, 9 Sep 2024 10:02:09 +0200 Subject: [PATCH 027/292] User: Show Missing Starting Point Access on Debug See: https://mantis.ilias.de/view.php?id=41749 --- Services/User/classes/class.ilUserUtil.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Services/User/classes/class.ilUserUtil.php b/Services/User/classes/class.ilUserUtil.php index c0f61b6c3b55..4e52a12b1e7d 100755 --- a/Services/User/classes/class.ilUserUtil.php +++ b/Services/User/classes/class.ilUserUtil.php @@ -336,7 +336,6 @@ public static function getStartingPointAsUrl(): string global $DIC; $log = $DIC->logger()->root(); - $lng = $DIC['lng']; $tree = $DIC['tree']; $ilUser = $DIC['ilUser']; $ilSetting = $DIC['ilSetting']; @@ -406,7 +405,7 @@ public static function getStartingPointAsUrl(): string ) ) ) { - $log->warning(sprintf('Permission to Starting Point Denied. Starting Point Type: %s.', $current)); + $log->debug(sprintf('Permission to Starting Point Denied. Starting Point Type: %s.', $current)); $current = self::START_REPOSITORY; } @@ -419,14 +418,14 @@ public static function getStartingPointAsUrl(): string || $current === self::START_PD_CALENDAR && !ilCalendarSettings::_getInstance()->isEnabled() ) { - $log->warning(sprintf('Permission to Starting Point Denied. Starting Point Type: %s.', $current)); + $log->debug(sprintf('Permission to Starting Point Denied. Starting Point Type: %s.', $current)); $current = self::START_PD_OVERVIEW; // #10715 - if 1 is disabled overview will display the current default if ($ilSetting->get('disable_my_offers') == 0 && $ilSetting->get('disable_my_memberships') == 0 && $ilSetting->get('personal_items_default_view') == 1) { - $log->warning(sprintf('Permission to Starting Point Denied. Starting Point Type: %s.', $current)); + $log->debug(sprintf('Permission to Starting Point Denied. Starting Point Type: %s.', $current)); $current = self::START_PD_SUBSCRIPTION; } } From 1497484964bc17e4ab3264e299c82231721c25de Mon Sep 17 00:00:00 2001 From: Stephan Kergomard Date: Mon, 9 Sep 2024 11:26:38 +0200 Subject: [PATCH 028/292] User: Allow to Import Skin-Setting in User See: https://mantis.ilias.de/view.php?id=18875 --- .../User/classes/class.ilUserImportParser.php | 32 +++++-------------- 1 file changed, 8 insertions(+), 24 deletions(-) diff --git a/Services/User/classes/class.ilUserImportParser.php b/Services/User/classes/class.ilUserImportParser.php index 8e0456ccbf27..3f799a051df0 100755 --- a/Services/User/classes/class.ilUserImportParser.php +++ b/Services/User/classes/class.ilUserImportParser.php @@ -187,24 +187,14 @@ class ilUserImportParser extends ilSaxParser */ public array $parentRolesCache; - public string $skin; - public string $style; + public string $skin = ''; + public string $style = ''; /** * User assigned styles */ public array $userStyles; // Missing array type. - /** - * Indicates if the skins are hidden - */ - public bool $hideSkin; - - /** - * Indicates if the skins are enabled - */ - public bool $disableSkin; - public int $user_id; private ilObjUser $userObj; @@ -257,9 +247,6 @@ public function __construct( } } - $this->hideSkin = (!$this->user_settings_config->isVisible("skin_style")); - $this->disableSkin = (!$this->user_settings_config->isChangeable("skin_style")); - $this->acc_mail = new ilAccountMail(); $this->acc_mail->setAttachConfiguredFiles(true); $this->acc_mail->useLangVariablesAsFallback(true); @@ -1576,15 +1563,12 @@ public function importEndTag( case "Look": $this->updateLookAndSkin = false; - if (!$this->hideSkin) { - // TODO: what to do with disabled skins? is it possible to change the skin via import? - if ((strlen($this->skin) > 0) && (strlen($this->style) > 0)) { - if (is_array($this->userStyles)) { - if (in_array($this->skin . ":" . $this->style, $this->userStyles)) { - $this->userObj->setPref("skin", $this->skin); - $this->userObj->setPref("style", $this->style); - $this->updateLookAndSkin = true; - } + if ($this->skin !== '' && $this->style !== '') { + if (is_array($this->userStyles)) { + if (in_array($this->skin . ':' . $this->style, $this->userStyles)) { + $this->userObj->setPref('skin', $this->skin); + $this->userObj->setPref('style', $this->style); + $this->updateLookAndSkin = true; } } } From 9ef8a789660a238f63a3539936749871612e6ad2 Mon Sep 17 00:00:00 2001 From: Stephan Kergomard Date: Mon, 9 Sep 2024 11:55:57 +0200 Subject: [PATCH 029/292] Object: Do Not Shorten Long Description See: https://mantis.ilias.de/view.php?id=41909 --- Services/Object/classes/class.ilObject.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/Services/Object/classes/class.ilObject.php b/Services/Object/classes/class.ilObject.php index 031af02e11b5..fe1c3a90aca3 100755 --- a/Services/Object/classes/class.ilObject.php +++ b/Services/Object/classes/class.ilObject.php @@ -497,9 +497,6 @@ public function create(): int $this->log->write("ilObject::create(), start"); - $this->title = ilStr::shortenTextExtended($this->getTitle(), $this->max_title, $this->add_dots); - $this->desc = ilStr::shortenTextExtended($this->getDescription(), $this->max_desc, $this->add_dots); - // determine owner $owner = 0; if ($this->getOwner() > 0) { From e7a1ea703bce58dfa2777d327dd95db06c97bc23 Mon Sep 17 00:00:00 2001 From: mjansen Date: Wed, 3 Apr 2024 15:25:03 +0200 Subject: [PATCH 030/292] SOAP: Avoid `client.ini.php` change to make SOAP plugins work This is a follow-up PR for https://github.com/ILIAS-eLearning/ILIAS/pull/7116 . Instead of setting cookies based on the `sid` passed in the SOAP request, `session_id` is used to set the current session id to load the user session when `session_start` is called. --- .../classes/class.ilAbstractSoapMethod.php | 18 ++++++- .../classes/class.ilSoapAdministration.php | 52 +++++++++---------- 2 files changed, 42 insertions(+), 28 deletions(-) diff --git a/Services/WebServices/SOAP/classes/class.ilAbstractSoapMethod.php b/Services/WebServices/SOAP/classes/class.ilAbstractSoapMethod.php index 1429ca993289..54dc46ef141d 100644 --- a/Services/WebServices/SOAP/classes/class.ilAbstractSoapMethod.php +++ b/Services/WebServices/SOAP/classes/class.ilAbstractSoapMethod.php @@ -1,5 +1,21 @@ initAuth($session_id, true); + $this->initAuth($session_id); $this->reInitUser(); if (!$this->checkSession($session_id)) { throw new ilSoapPluginException($this->getMessage()); diff --git a/webservice/soap/classes/class.ilSoapAdministration.php b/webservice/soap/classes/class.ilSoapAdministration.php index cb2873cf1696..9e120d80879c 100644 --- a/webservice/soap/classes/class.ilSoapAdministration.php +++ b/webservice/soap/classes/class.ilSoapAdministration.php @@ -1,27 +1,22 @@ message_code; } - protected function initAuth(string $sid, bool $mutate_super_global_cookies = false): void + protected function initAuth(string $sid): void { global $DIC; [$sid, $client] = $this->explodeSid($sid); - if ($mutate_super_global_cookies || !isset($DIC)) { - $_COOKIE['ilClientId'] = $client; - $_COOKIE[session_name()] = $sid; - } else { - ilUtil::setCookie(session_name(), $sid); + if (session_status() === PHP_SESSION_ACTIVE && $sid === session_id()) { + return; } + + if (session_status() === PHP_SESSION_ACTIVE) { + session_destroy(); + } + + session_id($sid); } protected function initIlias(): void From bc3575e2b619b27ab3947f42047c3f1fb1b6f1c9 Mon Sep 17 00:00:00 2001 From: mjansen Date: Mon, 9 Sep 2024 15:30:31 +0200 Subject: [PATCH 031/292] BackgroundTask: Use `CLIENT_ID` constant as fallback for SOAP request --- .../TaskManager/AsyncTaskManager.php | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/BackgroundTasks/Implementation/TaskManager/AsyncTaskManager.php b/src/BackgroundTasks/Implementation/TaskManager/AsyncTaskManager.php index 1968914ef0b2..8ac4128f63d8 100644 --- a/src/BackgroundTasks/Implementation/TaskManager/AsyncTaskManager.php +++ b/src/BackgroundTasks/Implementation/TaskManager/AsyncTaskManager.php @@ -48,12 +48,16 @@ public function run(Bucket $bucket): void $soap_client->enableWSDL(true); $soap_client->init(); $session_id = session_id(); - $client_id = $DIC->http()->wrapper()->cookie()->has('ilClientId') - ? $DIC->http()->wrapper()->cookie()->retrieve( - 'ilClientId', - $DIC->refinery()->kindlyTo()->string() - ) - : ''; + $client_id = $DIC->http()->wrapper()->cookie()->retrieve( + 'ilClientId', + $DIC->refinery()->byTrying([ + $DIC->refinery()->kindlyTo()->string(), + $DIC->refinery()->always( + defined('CLIENT_ID') ? CLIENT_ID : null + ) + ]) + ); + try { $soap_client->call(self::CMD_START_WORKER, array( $session_id . '::' . $client_id, From ae16425087b457a73419ece45e6557037dd076d5 Mon Sep 17 00:00:00 2001 From: Tim Schmitz Date: Mon, 9 Sep 2024 17:05:17 +0200 Subject: [PATCH 032/292] MetaData: matching copyright in import/export for 8 (24498) --- .../class.ilMDCopyrightSelectionEntry.php | 74 +++++++++++-------- .../MetaData/classes/class.ilMDRights.php | 4 +- 2 files changed, 45 insertions(+), 33 deletions(-) diff --git a/Services/MetaData/classes/class.ilMDCopyrightSelectionEntry.php b/Services/MetaData/classes/class.ilMDCopyrightSelectionEntry.php index a906934af1d6..89f05c44d685 100644 --- a/Services/MetaData/classes/class.ilMDCopyrightSelectionEntry.php +++ b/Services/MetaData/classes/class.ilMDCopyrightSelectionEntry.php @@ -136,46 +136,58 @@ public static function _lookupCopyright(string $a_cp_string): string return self::renderCopyrightFromRow($row); } - public static function lookupCopyrightByText(string $copyright_text): int + public static function _lookupCopyrightForExport(string $a_cp_string): string { global $DIC; - $db = $DIC->database(); - $full_name = ''; - $link = ''; - $image_link = ''; - $alt_text = ''; - - //find the image - if (preg_match('/<\s*img((?:.|\n)*?)\/>/i', $copyright_text, $img_matches)) { - if (preg_match('/src\s*=\s*(?:"|\')(.*?)(?:"|\')/i', $img_matches[1], $src_matches)) { - $image_link = strip_tags($src_matches[1]); - } - if (preg_match('/alt\s*=\s*(?:"|\')(.*?)(?:"|\')/i', $img_matches[1], $alt_matches)) { - $alt_text = strip_tags($alt_matches[1]); - } + $ilDB = $DIC->database(); + + if (!$entry_id = self::_extractEntryId($a_cp_string)) { + return $a_cp_string; } - //find the link - if (preg_match('/<\s*a((?:.|\n)[^<]*?)<\s*\/a>/i', $copyright_text, $link_matches)) { - if (preg_match('/href\s*=\s*(?:"|\')(.*?)(?:"|\')/i', $link_matches[1], $name_matches)) { - $link = strip_tags($name_matches[1]); + $query = "SELECT full_name, link, image_link, alt_text FROM il_md_cpr_selections " . + "WHERE entry_id = " . $ilDB->quote($entry_id, ilDBConstants::T_INTEGER) . " "; + $res = $ilDB->query($query); + $row = $ilDB->fetchObject($res); + + $data = self::getCopyrightDataFromRow($row); + + return (string) ($data->link() ?? $data->fullName()); + } + + public static function lookupCopyrightFromImport(string $copyright_text): int + { + global $DIC; + + $db = $DIC->database(); + + // url should be made to match regardless of scheme + $normalized_copyright = str_replace('https://', 'http://', $copyright_text); + $matches_by_name = null; + + $query = 'SELECT entry_id, full_name, link, image_link, alt_text FROM il_md_cpr_selections'; + $res = $db->query($query); + while ($row = $db->fetchObject($res)) { + $entry_id = (int) $row->entry_id; + $data = self::getCopyrightDataFromRow($row); + + $entry_link = (string) $data->link(); + $normalized_link = str_replace('https://', 'http://', $entry_link); + if ($normalized_link !== '' && str_contains($normalized_copyright, $normalized_link)) { + return $entry_id; } - if (preg_match('/>((?:\n|.)*)/i', $link_matches[1], $href_matches)) { - $full_name = strip_tags($href_matches[1]); + + if ( + is_null($matches_by_name) && + trim($copyright_text) === trim($data->fullName()) + ) { + $matches_by_name = $entry_id; } - } else { - $full_name = strip_tags($copyright_text); } - $query = 'SELECT entry_id FROM il_md_cpr_selections ' . - 'WHERE full_name = ' . $db->quote($full_name, ilDBConstants::T_TEXT) . - ' AND link = ' . $db->quote($link, ilDBConstants::T_TEXT) . - ' AND image_link = ' . $db->quote($image_link, ilDBConstants::T_TEXT) . - ' AND alt_text = ' . $db->quote($alt_text, ilDBConstants::T_TEXT); - $res = $db->query($query); - while ($row = $db->fetchObject($res)) { - return (int) $row->entry_id; + if (!is_null($matches_by_name)) { + return $matches_by_name; } return 0; } diff --git a/Services/MetaData/classes/class.ilMDRights.php b/Services/MetaData/classes/class.ilMDRights.php index 4d43b4370f55..2909ec44db9b 100644 --- a/Services/MetaData/classes/class.ilMDRights.php +++ b/Services/MetaData/classes/class.ilMDRights.php @@ -199,14 +199,14 @@ public function toXML(ilXmlWriter $writer): void [ 'Language' => $this->getDescriptionLanguageCode() ?: 'en' ], - ilMDCopyrightSelectionEntry::_lookupCopyright($this->getDescription()) + ilMDCopyrightSelectionEntry::_lookupCopyrightForExport($this->getDescription()) ); $writer->xmlEndTag('Rights'); } public function parseDescriptionFromImport(string $a_description): void { - $entry_id = ilMDCopyrightSelectionEntry::lookupCopyrightByText($a_description); + $entry_id = ilMDCopyrightSelectionEntry::lookupCopyrightFromImport($a_description); if (!$entry_id) { $this->setDescription($a_description); } else { From 117c11c42e512ec84233888dcee93c233836e8f2 Mon Sep 17 00:00:00 2001 From: Stephan Kergomard Date: Mon, 9 Sep 2024 18:30:06 +0200 Subject: [PATCH 033/292] User: Fix Endless Loop on VCardExport on Portfolio See: https://mantis.ilias.de/view.php?id=41987 --- .../User/classes/class.ilPublicUserProfileGUI.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Services/User/classes/class.ilPublicUserProfileGUI.php b/Services/User/classes/class.ilPublicUserProfileGUI.php index bc5a5871653e..24e30bd23fdc 100644 --- a/Services/User/classes/class.ilPublicUserProfileGUI.php +++ b/Services/User/classes/class.ilPublicUserProfileGUI.php @@ -153,9 +153,15 @@ public function executeCommand(): string $tpl->loadStandardTemplate(); switch ($next_class) { + case 'ilbuddysystemgui': + $gui = new ilBuddySystemGUI(); + $ilCtrl->setReturn($this, 'view'); + $ilCtrl->forwardCommand($gui); + break; case "ilobjportfoliogui": $portfolio_id = $this->getProfilePortfolio(); - if ($portfolio_id) { + if ($portfolio_id + && $cmd !== 'deliverVCard') { $gui = new ilObjPortfolioGUI($portfolio_id); // #11876 $gui->setAdditional($this->getAdditional()); $gui->setPermaLink($this->getUserId(), "usr"); @@ -163,11 +169,6 @@ public function executeCommand(): string break; } // no break - case 'ilbuddysystemgui': - $gui = new ilBuddySystemGUI(); - $ilCtrl->setReturn($this, 'view'); - $ilCtrl->forwardCommand($gui); - break; default: $ret = $this->$cmd(); $tpl->setContent($ret); From 1fbd971439679a96a0606dca10a09916e2095722 Mon Sep 17 00:00:00 2001 From: Stephan Kergomard Date: Mon, 9 Sep 2024 20:55:42 +0200 Subject: [PATCH 034/292] Test: Fix Loading MultipleChoice & Kprim Questions See: https://mantis.ilias.de/view.php?id=41129 --- .../TestQuestionPool/classes/class.assKprimChoice.php | 10 +++++----- .../classes/class.assMultipleChoice.php | 8 ++++---- .../TestQuestionPool/classes/class.assSingleChoice.php | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Modules/TestQuestionPool/classes/class.assKprimChoice.php b/Modules/TestQuestionPool/classes/class.assKprimChoice.php index 53f210bea227..7b34eac25183 100644 --- a/Modules/TestQuestionPool/classes/class.assKprimChoice.php +++ b/Modules/TestQuestionPool/classes/class.assKprimChoice.php @@ -219,15 +219,15 @@ public function loadFromDb($questionId): void $this->setObjId($data['obj_fi']); - $this->setTitle((string) $data['title']); + $this->setTitle($data['title'] ?? ''); $this->setNrOfTries($data['nr_of_tries']); - $this->setComment((string) $data['description']); + $this->setComment($data['description'] ?? ''); $this->setAuthor($data['author']); $this->setPoints($data['points']); $this->setOwner($data['owner']); $this->setLastChange($data['tstamp']); require_once 'Services/RTE/classes/class.ilRTE.php'; - $this->setQuestion(ilRTE::_replaceMediaObjectImageSrc((string) $data['question_text'], 1)); + $this->setQuestion(ilRTE::_replaceMediaObjectImageSrc($data['question_text'] ?? '', 1)); $this->setShuffleAnswersEnabled((bool) $data['shuffle_answers']); @@ -290,7 +290,7 @@ private function loadAnswerData($questionId): void $answer->setPosition($data['position']); - $answer->setAnswertext(ilRTE::_replaceMediaObjectImageSrc($data['answertext'], 1)); + $answer->setAnswertext(ilRTE::_replaceMediaObjectImageSrc($data['answertext'] ?? '', 1)); $answer->setImageFile($data['imagefile']); $answer->setThumbPrefix($this->getThumbPrefix()); @@ -630,7 +630,7 @@ protected function generateThumbForFile($path, $file): void $ext = 'JPEG'; break; } - ilShellUtil::convertImage($filename, $thumbpath, $ext, (string)$this->getThumbSize()); + ilShellUtil::convertImage($filename, $thumbpath, $ext, (string) $this->getThumbSize()); } } diff --git a/Modules/TestQuestionPool/classes/class.assMultipleChoice.php b/Modules/TestQuestionPool/classes/class.assMultipleChoice.php index 6907ad345e4a..4f5762fa65f2 100755 --- a/Modules/TestQuestionPool/classes/class.assMultipleChoice.php +++ b/Modules/TestQuestionPool/classes/class.assMultipleChoice.php @@ -227,15 +227,15 @@ public function loadFromDb($question_id): void $data = $ilDB->fetchAssoc($result); $this->setId($question_id); $this->setObjId($data["obj_fi"]); - $this->setTitle((string) $data["title"]); + $this->setTitle($data["title"] ?? ''); $this->setNrOfTries($data['nr_of_tries']); - $this->setComment((string) $data["description"]); + $this->setComment($data["description"] ?? ''); $this->setOriginalId($data["original_id"]); $this->setAuthor($data["author"]); $this->setPoints($data["points"]); $this->setOwner($data["owner"]); include_once("./Services/RTE/classes/class.ilRTE.php"); - $this->setQuestion(ilRTE::_replaceMediaObjectImageSrc((string) $data["question_text"], 1)); + $this->setQuestion(ilRTE::_replaceMediaObjectImageSrc($data["question_text"] ?? '', 1)); $shuffle = (is_null($data['shuffle'])) ? true : $data['shuffle']; $this->setShuffle((bool) $shuffle); if ($data['thumb_size'] !== null && $data['thumb_size'] >= self::MINIMUM_THUMB_SIZE) { @@ -271,7 +271,7 @@ public function loadFromDb($question_id): void $data["imagefile"] = ""; } include_once("./Services/RTE/classes/class.ilRTE.php"); - $data["answertext"] = ilRTE::_replaceMediaObjectImageSrc($data["answertext"], 1); + $data["answertext"] = ilRTE::_replaceMediaObjectImageSrc($data["answertext"] ?? '', 1); $answer = new ASS_AnswerMultipleResponseImage( $data["answertext"], diff --git a/Modules/TestQuestionPool/classes/class.assSingleChoice.php b/Modules/TestQuestionPool/classes/class.assSingleChoice.php index a6bb448ca010..764287b9a3d9 100755 --- a/Modules/TestQuestionPool/classes/class.assSingleChoice.php +++ b/Modules/TestQuestionPool/classes/class.assSingleChoice.php @@ -188,7 +188,7 @@ protected function generateThumbForFile($path, $file): void $ext = 'JPEG'; break; } - ilShellUtil::convertImage($filename, $thumbpath, $ext, (string)$this->getThumbSize()); + ilShellUtil::convertImage($filename, $thumbpath, $ext, (string) $this->getThumbSize()); } } @@ -213,7 +213,7 @@ public function loadFromDb($question_id): void $data = $ilDB->fetchAssoc($result); $this->setId($question_id); $this->setObjId($data["obj_fi"]); - $this->setTitle((string) $data["title"]); + $this->setTitle($data["title"] ?? ''); $this->setNrOfTries($data['nr_of_tries']); $this->setComment($data["description"] ?? ''); $this->setOriginalId($data["original_id"]); From 244e7acb467ce65909864b84bfdedd1e047ec3bc Mon Sep 17 00:00:00 2001 From: mjansen Date: Tue, 10 Sep 2024 10:53:57 +0200 Subject: [PATCH 035/292] Composer: Upgrade `phpspreadsheet` and remove patch --- composer.json | 9 +- composer.lock | 16 +-- libs/composer/patches/phpspreadsheet.patch | 138 --------------------- 3 files changed, 11 insertions(+), 152 deletions(-) delete mode 100644 libs/composer/patches/phpspreadsheet.patch diff --git a/composer.json b/composer.json index d3e617131b80..50d51c3a2ecb 100644 --- a/composer.json +++ b/composer.json @@ -389,11 +389,11 @@ }, "phpoffice/phpspreadsheet" : { "source" : "https://github.com/PHPOffice/PhpSpreadsheet", - "used_version" : "v1.18.0", + "used_version" : "v1.29.1", "wrapped_by" : "Services/Excel", "added_by" : "Jesús López ", - "last_update" : "2021-06-19", - "last_update_by" : "Alex Killing ", + "last_update" : "2024-09-10", + "last_update_by" : "Michael Jansen ", "approved-by": "Jour Fixe", "approved-date": "2018-01-22" }, @@ -498,9 +498,6 @@ }, "imsglobal/lti": { "ILIAS LTI Patches": "./libs/composer/patches/lti.patch" - }, - "phpoffice/phpspreadsheet": { - "ILIAS PHPSpreadsheet Patches": "./libs/composer/patches/phpspreadsheet.patch" } } } diff --git a/composer.lock b/composer.lock index ccab52a0f068..cde8e6869335 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "eff4d3e7fa85dc76d6ef7456b8248836", + "content-hash": "123cc4b71996b3cb1ec40c6c40f5daae", "packages": [ { "name": "cweagans/composer-patches", @@ -1809,16 +1809,16 @@ }, { "name": "phpoffice/phpspreadsheet", - "version": "1.29.0", + "version": "1.29.1", "source": { "type": "git", "url": "https://github.com/PHPOffice/PhpSpreadsheet.git", - "reference": "fde2ccf55eaef7e86021ff1acce26479160a0fa0" + "reference": "59ee38f7480904cd6487e5cbdea4d80ff2758719" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPOffice/PhpSpreadsheet/zipball/fde2ccf55eaef7e86021ff1acce26479160a0fa0", - "reference": "fde2ccf55eaef7e86021ff1acce26479160a0fa0", + "url": "https://api.github.com/repos/PHPOffice/PhpSpreadsheet/zipball/59ee38f7480904cd6487e5cbdea4d80ff2758719", + "reference": "59ee38f7480904cd6487e5cbdea4d80ff2758719", "shasum": "" }, "require": { @@ -1853,7 +1853,7 @@ "phpcompatibility/php-compatibility": "^9.3", "phpstan/phpstan": "^1.1", "phpstan/phpstan-phpunit": "^1.0", - "phpunit/phpunit": "^8.5 || ^9.0 || ^10.0", + "phpunit/phpunit": "^8.5 || ^9.0", "squizlabs/php_codesniffer": "^3.7", "tecnickcom/tcpdf": "^6.5" }, @@ -1908,9 +1908,9 @@ ], "support": { "issues": "https://github.com/PHPOffice/PhpSpreadsheet/issues", - "source": "https://github.com/PHPOffice/PhpSpreadsheet/tree/1.29.0" + "source": "https://github.com/PHPOffice/PhpSpreadsheet/tree/1.29.1" }, - "time": "2023-06-14T22:48:31+00:00" + "time": "2024-09-03T00:55:32+00:00" }, { "name": "phpseclib/phpseclib", diff --git a/libs/composer/patches/phpspreadsheet.patch b/libs/composer/patches/phpspreadsheet.patch deleted file mode 100644 index 741ca2fa36f6..000000000000 --- a/libs/composer/patches/phpspreadsheet.patch +++ /dev/null @@ -1,138 +0,0 @@ -diff --git a/src/PhpSpreadsheet/Writer/Html.php b/src/PhpSpreadsheet/Writer/Html.php -index bba60f635fb..842998f9eb5 100644 ---- a/src/PhpSpreadsheet/Writer/Html.php -+++ b/src/PhpSpreadsheet/Writer/Html.php -@@ -31,6 +31,21 @@ use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet; - - class Html extends BaseWriter - { -+ /** -+ * Migration aid to tell if html tags will be treated as plaintext in comments. -+ * if ( -+ * defined( -+ * \PhpOffice\PhpSpreadsheet\Writer\Html::class -+ * . '::COMMENT_HTML_TAGS_PLAINTEXT' -+ * ) -+ * ) { -+ * new logic with styling in TextRun elements -+ * } else { -+ * old logic with styling via Html tags -+ * }. -+ */ -+ public const COMMENT_HTML_TAGS_PLAINTEXT = true; -+ - /** - * Spreadsheet object. - * -@@ -1069,7 +1084,7 @@ class Html extends BaseWriter - } - - $css['color'] = '#' . $font->getColor()->getRGB(); -- $css['font-family'] = '\'' . $font->getName() . '\''; -+ $css['font-family'] = '\'' . htmlspecialchars((string) $font->getName(), ENT_QUOTES) . '\''; - $css['font-size'] = $font->getSize() . 'pt'; - - return $css; -@@ -1289,10 +1304,11 @@ class Html extends BaseWriter - return [$cell, $cssClass, $coordinate]; - } - -- private function generateRowCellDataValueRich(Cell $cell, string &$cellData): void -+ private function generateRowCellDataValueRich(RichText $richText): string - { -+ $cellData = ''; - // Loop through rich text elements -- $elements = $cell->getValue()->getRichTextElements(); -+ $elements = $richText->getRichTextElements(); - foreach ($elements as $element) { - // Rich text start? - if ($element instanceof Run) { -@@ -1307,6 +1323,8 @@ class Html extends BaseWriter - $cellData .= ''; - $cellEnd = ''; - } -+ } else { -+ $cellData .= ''; - } - - // Convert UTF8 data to PCDATA -@@ -1322,12 +1340,14 @@ class Html extends BaseWriter - $cellData .= htmlspecialchars($cellText, Settings::htmlEntityFlags()); - } - } -+ -+ return nl2br($cellData); - } - - private function generateRowCellDataValue(Worksheet $worksheet, Cell $cell, string &$cellData): void - { - if ($cell->getValue() instanceof RichText) { -- $this->generateRowCellDataValueRich($cell, $cellData); -+ $cellData .= $this->generateRowCellDataValueRich($cell->getValue()); - } else { - $origData = $this->preCalculateFormulas ? $cell->getCalculatedValue() : $cell->getValue(); - $formatCode = $worksheet->getParentOrThrow()->getCellXfByIndex($cell->getXfIndex())->getNumberFormat()->getFormatCode(); -@@ -1816,15 +1836,10 @@ class Html extends BaseWriter - { - $result = ''; - if (!$this->isPdf && isset($worksheet->getComments()[$coordinate])) { -- $sanitizer = new HTMLPurifier(); -- $cachePath = File::sysGetTempDir() . '/phpsppur'; -- if (is_dir($cachePath) || mkdir($cachePath)) { -- $sanitizer->config->set('Cache.SerializerPath', $cachePath); -- } -- $sanitizedString = $sanitizer->purify($worksheet->getComment($coordinate)->getText()->getPlainText()); -+ $sanitizedString = $this->generateRowCellDataValueRich($worksheet->getComment($coordinate)->getText()); - if ($sanitizedString !== '') { - $result .= ''; -- $result .= '
' . nl2br($sanitizedString) . '
'; -+ $result .= '
' . $sanitizedString . '
'; - $result .= PHP_EOL; - } - } - -diff --git a/src/PhpSpreadsheet/Reader/Security/XmlScanner.php b/src/PhpSpreadsheet/Reader/Security/XmlScanner.php -index 874ed1e7f95..f8eaf39d096 100644 ---- a/src/PhpSpreadsheet/Reader/Security/XmlScanner.php -+++ b/src/PhpSpreadsheet/Reader/Security/XmlScanner.php -@@ -113,15 +113,12 @@ class XmlScanner - */ - private function toUtf8($xml) - { -- $pattern = '/encoding="(.*?)"/'; -- $result = preg_match($pattern, $xml, $matches); -- $charset = strtoupper($result ? $matches[1] : 'UTF-8'); -+ $charset = $this->findCharSet($xml); - - if ($charset !== 'UTF-8') { - $xml = self::forceString(mb_convert_encoding($xml, 'UTF-8', $charset)); - -- $result = preg_match($pattern, $xml, $matches); -- $charset = strtoupper($result ? $matches[1] : 'UTF-8'); -+ $charset = $this->findCharSet($xml); - if ($charset !== 'UTF-8') { - throw new Reader\Exception('Suspicious Double-encoded XML, spreadsheet file load() aborted to prevent XXE/XEE attacks'); - } -@@ -130,6 +127,22 @@ class XmlScanner - return $xml; - } - -+ private function findCharSet(string $xml): string -+ { -+ $patterns = [ -+ '/encoding="([^"]*]?)"/', -+ "/encoding='([^']*?)'/", -+ ]; -+ -+ foreach ($patterns as $pattern) { -+ if (preg_match($pattern, $xml, $matches)) { -+ return strtoupper($matches[1]); -+ } -+ } -+ -+ return 'UTF-8'; -+ } -+ - /** - * Scan the XML for use of Date: Tue, 10 Sep 2024 11:50:13 +0200 Subject: [PATCH 036/292] Chatroom: Bump NPM package version of express --- .../chat/node_modules/.package-lock.json | 125 +- .../chat/node_modules/body-parser/HISTORY.md | 7 + .../chat/node_modules/body-parser/README.md | 11 + .../body-parser/lib/types/urlencoded.js | 37 +- .../body-parser/node_modules/qs/.editorconfig | 46 + .../body-parser/node_modules/qs/.eslintrc | 38 + .../node_modules/qs/.github/FUNDING.yml | 12 + .../body-parser/node_modules/qs/.nycrc | 13 + .../body-parser/node_modules/qs/CHANGELOG.md | 600 ++++++++ .../body-parser/node_modules/qs/LICENSE.md | 29 + .../body-parser/node_modules/qs/README.md | 709 +++++++++ .../body-parser/node_modules/qs/dist/qs.js | 90 ++ .../node_modules/qs/lib/formats.js | 23 + .../body-parser/node_modules/qs/lib/index.js | 11 + .../body-parser/node_modules/qs/lib/parse.js | 296 ++++ .../node_modules/qs/lib/stringify.js | 351 +++++ .../body-parser/node_modules/qs/lib/utils.js | 265 ++++ .../body-parser/node_modules/qs/package.json | 91 ++ .../node_modules/qs/test/empty-keys-cases.js | 267 ++++ .../body-parser/node_modules/qs/test/parse.js | 1170 +++++++++++++++ .../node_modules/qs/test/stringify.js | 1298 +++++++++++++++++ .../body-parser/node_modules/qs/test/utils.js | 136 ++ .../node_modules/body-parser/package.json | 4 +- .../chat/node_modules/express/History.md | 18 + .../chat/node_modules/express/Readme.md | 106 +- .../chat/node_modules/express/lib/response.js | 20 +- .../express/node_modules/encodeurl/LICENSE | 22 + .../express/node_modules/encodeurl/README.md | 109 ++ .../express/node_modules/encodeurl/index.js | 60 + .../node_modules/encodeurl/package.json | 40 + .../chat/node_modules/express/package.json | 18 +- .../node_modules/merge-descriptors/README.md | 7 +- .../node_modules/merge-descriptors/index.js | 6 +- .../merge-descriptors/package.json | 21 +- .../node_modules/object-inspect/CHANGELOG.md | 15 + .../chat/node_modules/object-inspect/index.js | 5 +- .../node_modules/object-inspect/package.json | 23 +- .../object-inspect/readme.markdown | 20 +- .../node_modules/path-to-regexp/History.md | 36 - .../chat/node_modules/path-to-regexp/index.js | 97 +- .../node_modules/path-to-regexp/package.json | 4 +- .../chat/node_modules/send/HISTORY.md | 5 + .../Chatroom/chat/node_modules/send/index.js | 3 +- .../chat/node_modules/send/package.json | 2 +- .../chat/node_modules/serve-static/HISTORY.md | 6 + .../chat/node_modules/serve-static/index.js | 3 +- .../node_modules/debug/.coveralls.yml | 1 + .../serve-static/node_modules/debug/.eslintrc | 11 + .../node_modules/debug/.npmignore | 9 + .../node_modules/debug/.travis.yml | 14 + .../node_modules/debug/CHANGELOG.md | 362 +++++ .../serve-static/node_modules/debug/LICENSE | 19 + .../serve-static/node_modules/debug/Makefile | 50 + .../serve-static/node_modules/debug/README.md | 312 ++++ .../node_modules/debug/component.json | 19 + .../node_modules/debug/karma.conf.js | 70 + .../serve-static/node_modules/debug/node.js | 1 + .../debug/node_modules/ms/index.js | 152 ++ .../debug/node_modules/ms/license.md | 21 + .../debug/node_modules/ms/package.json | 37 + .../debug/node_modules/ms/readme.md | 51 + .../node_modules/debug/package.json | 49 + .../node_modules/debug/src/browser.js | 185 +++ .../node_modules/debug/src/debug.js | 202 +++ .../node_modules/debug/src/index.js | 10 + .../node_modules/debug/src/inspector-log.js | 15 + .../node_modules/debug/src/node.js | 248 ++++ .../serve-static/node_modules/ms/index.js | 162 ++ .../serve-static/node_modules/ms/license.md | 21 + .../serve-static/node_modules/ms/package.json | 38 + .../serve-static/node_modules/ms/readme.md | 59 + .../serve-static/node_modules/send/HISTORY.md | 521 +++++++ .../serve-static/node_modules/send/LICENSE | 23 + .../serve-static/node_modules/send/README.md | 327 +++++ .../node_modules/send/SECURITY.md | 24 + .../serve-static/node_modules/send/index.js | 1143 +++++++++++++++ .../node_modules/send/package.json | 62 + .../node_modules/serve-static/package.json | 2 +- Modules/Chatroom/chat/package-lock.json | 238 ++- Modules/Chatroom/chat/package.json | 2 +- 80 files changed, 10497 insertions(+), 238 deletions(-) create mode 100644 Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/.editorconfig create mode 100644 Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/.eslintrc create mode 100644 Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/.github/FUNDING.yml create mode 100644 Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/.nycrc create mode 100644 Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/CHANGELOG.md create mode 100644 Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/LICENSE.md create mode 100644 Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/README.md create mode 100644 Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/dist/qs.js create mode 100644 Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/lib/formats.js create mode 100644 Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/lib/index.js create mode 100644 Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/lib/parse.js create mode 100644 Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/lib/stringify.js create mode 100644 Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/lib/utils.js create mode 100644 Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/package.json create mode 100644 Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/test/empty-keys-cases.js create mode 100644 Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/test/parse.js create mode 100644 Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/test/stringify.js create mode 100644 Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/test/utils.js create mode 100644 Modules/Chatroom/chat/node_modules/express/node_modules/encodeurl/LICENSE create mode 100644 Modules/Chatroom/chat/node_modules/express/node_modules/encodeurl/README.md create mode 100644 Modules/Chatroom/chat/node_modules/express/node_modules/encodeurl/index.js create mode 100644 Modules/Chatroom/chat/node_modules/express/node_modules/encodeurl/package.json delete mode 100644 Modules/Chatroom/chat/node_modules/path-to-regexp/History.md create mode 100644 Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/.coveralls.yml create mode 100644 Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/.eslintrc create mode 100644 Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/.npmignore create mode 100644 Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/.travis.yml create mode 100644 Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/CHANGELOG.md create mode 100644 Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/LICENSE create mode 100644 Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/Makefile create mode 100644 Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/README.md create mode 100644 Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/component.json create mode 100644 Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/karma.conf.js create mode 100644 Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/node.js create mode 100644 Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/node_modules/ms/index.js create mode 100644 Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/node_modules/ms/license.md create mode 100644 Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/node_modules/ms/package.json create mode 100644 Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/node_modules/ms/readme.md create mode 100644 Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/package.json create mode 100644 Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/src/browser.js create mode 100644 Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/src/debug.js create mode 100644 Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/src/index.js create mode 100644 Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/src/inspector-log.js create mode 100644 Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/src/node.js create mode 100644 Modules/Chatroom/chat/node_modules/serve-static/node_modules/ms/index.js create mode 100644 Modules/Chatroom/chat/node_modules/serve-static/node_modules/ms/license.md create mode 100644 Modules/Chatroom/chat/node_modules/serve-static/node_modules/ms/package.json create mode 100644 Modules/Chatroom/chat/node_modules/serve-static/node_modules/ms/readme.md create mode 100644 Modules/Chatroom/chat/node_modules/serve-static/node_modules/send/HISTORY.md create mode 100644 Modules/Chatroom/chat/node_modules/serve-static/node_modules/send/LICENSE create mode 100644 Modules/Chatroom/chat/node_modules/serve-static/node_modules/send/README.md create mode 100644 Modules/Chatroom/chat/node_modules/serve-static/node_modules/send/SECURITY.md create mode 100644 Modules/Chatroom/chat/node_modules/serve-static/node_modules/send/index.js create mode 100644 Modules/Chatroom/chat/node_modules/serve-static/node_modules/send/package.json diff --git a/Modules/Chatroom/chat/node_modules/.package-lock.json b/Modules/Chatroom/chat/node_modules/.package-lock.json index e6f3528e5d46..15a2213b8938 100644 --- a/Modules/Chatroom/chat/node_modules/.package-lock.json +++ b/Modules/Chatroom/chat/node_modules/.package-lock.json @@ -74,9 +74,9 @@ } }, "node_modules/body-parser": { - "version": "1.20.2", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz", - "integrity": "sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==", + "version": "1.20.3", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz", + "integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==", "dependencies": { "bytes": "3.1.2", "content-type": "~1.0.5", @@ -86,7 +86,7 @@ "http-errors": "2.0.0", "iconv-lite": "0.4.24", "on-finished": "2.4.1", - "qs": "6.11.0", + "qs": "6.13.0", "raw-body": "2.5.2", "type-is": "~1.6.18", "unpipe": "1.0.0" @@ -109,6 +109,20 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" }, + "node_modules/body-parser/node_modules/qs": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", + "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", + "dependencies": { + "side-channel": "^1.0.6" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/bytes": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", @@ -422,36 +436,36 @@ } }, "node_modules/express": { - "version": "4.19.2", - "resolved": "https://registry.npmjs.org/express/-/express-4.19.2.tgz", - "integrity": "sha512-5T6nhjsT+EOMzuck8JjBHARTHfMht0POzlA60WV2pMD3gyXw2LZnZ+ueGdNxG+0calOJcWKbpFcuzLZ91YWq9Q==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/express/-/express-4.20.0.tgz", + "integrity": "sha512-pLdae7I6QqShF5PnNTCVn4hI91Dx0Grkn2+IAsMTgMIKuQVte2dN9PeGSSAME2FR8anOhVA62QDIUaWVfEXVLw==", "dependencies": { "accepts": "~1.3.8", "array-flatten": "1.1.1", - "body-parser": "1.20.2", + "body-parser": "1.20.3", "content-disposition": "0.5.4", "content-type": "~1.0.4", "cookie": "0.6.0", "cookie-signature": "1.0.6", "debug": "2.6.9", "depd": "2.0.0", - "encodeurl": "~1.0.2", + "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "etag": "~1.8.1", "finalhandler": "1.2.0", "fresh": "0.5.2", "http-errors": "2.0.0", - "merge-descriptors": "1.0.1", + "merge-descriptors": "1.0.3", "methods": "~1.1.2", "on-finished": "2.4.1", "parseurl": "~1.3.3", - "path-to-regexp": "0.1.7", + "path-to-regexp": "0.1.10", "proxy-addr": "~2.0.7", "qs": "6.11.0", "range-parser": "~1.2.1", "safe-buffer": "5.2.1", - "send": "0.18.0", - "serve-static": "1.15.0", + "send": "0.19.0", + "serve-static": "1.16.0", "setprototypeof": "1.2.0", "statuses": "2.0.1", "type-is": "~1.6.18", @@ -478,6 +492,14 @@ "ms": "2.0.0" } }, + "node_modules/express/node_modules/encodeurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", + "engines": { + "node": ">= 0.8" + } + }, "node_modules/express/node_modules/ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", @@ -723,9 +745,12 @@ } }, "node_modules/merge-descriptors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", - "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==" + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", + "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==", + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } }, "node_modules/methods": { "version": "1.1.2", @@ -834,9 +859,12 @@ } }, "node_modules/object-inspect": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", - "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==", + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz", + "integrity": "sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==", + "engines": { + "node": ">= 0.4" + }, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -869,9 +897,9 @@ } }, "node_modules/path-to-regexp": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", - "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" + "version": "0.1.10", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.10.tgz", + "integrity": "sha512-7lf7qcQidTku0Gu3YDPc8DJ1q7OOucfa/BSsIwjuh56VU7katFvuM8hULfkwB3Fns/rsVF7PwPKVw1sl5KQS9w==" }, "node_modules/process-nextick-args": { "version": "2.0.1", @@ -951,9 +979,9 @@ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, "node_modules/send": { - "version": "0.18.0", - "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", - "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz", + "integrity": "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==", "dependencies": { "debug": "2.6.9", "depd": "2.0.0", @@ -992,9 +1020,9 @@ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" }, "node_modules/serve-static": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", - "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", + "version": "1.16.0", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.0.tgz", + "integrity": "sha512-pDLK8zwl2eKaYrs8mrPZBJua4hMplRWJ1tIFksVC3FtBEBnl8dxgeHtsaMS8DhS9i4fLObaon6ABoc4/hQGdPA==", "dependencies": { "encodeurl": "~1.0.2", "escape-html": "~1.0.3", @@ -1005,6 +1033,47 @@ "node": ">= 0.8.0" } }, + "node_modules/serve-static/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/serve-static/node_modules/debug/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + }, + "node_modules/serve-static/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + }, + "node_modules/serve-static/node_modules/send": { + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", + "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", + "dependencies": { + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "2.4.1", + "range-parser": "~1.2.1", + "statuses": "2.0.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/set-function-length": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", diff --git a/Modules/Chatroom/chat/node_modules/body-parser/HISTORY.md b/Modules/Chatroom/chat/node_modules/body-parser/HISTORY.md index b89249198a83..81d23e064d55 100644 --- a/Modules/Chatroom/chat/node_modules/body-parser/HISTORY.md +++ b/Modules/Chatroom/chat/node_modules/body-parser/HISTORY.md @@ -1,3 +1,10 @@ +1.20.3 / 2024-09-10 +=================== + + * deps: qs@6.13.0 + * add `depth` option to customize the depth level in the parser + * IMPORTANT: The default `depth` level for parsing URL-encoded data is now `32` (previously was `Infinity`) + 1.20.2 / 2023-02-21 =================== diff --git a/Modules/Chatroom/chat/node_modules/body-parser/README.md b/Modules/Chatroom/chat/node_modules/body-parser/README.md index 38553bf79878..f6661b7d33c1 100644 --- a/Modules/Chatroom/chat/node_modules/body-parser/README.md +++ b/Modules/Chatroom/chat/node_modules/body-parser/README.md @@ -4,6 +4,7 @@ [![NPM Downloads][npm-downloads-image]][npm-url] [![Build Status][ci-image]][ci-url] [![Test Coverage][coveralls-image]][coveralls-url] +[![OpenSSF Scorecard Badge][ossf-scorecard-badge]][ossf-scorecard-visualizer] Node.js body parsing middleware. @@ -277,6 +278,10 @@ The `verify` option, if supplied, is called as `verify(req, res, buf, encoding)` where `buf` is a `Buffer` of the raw request body and `encoding` is the encoding of the request. The parsing can be aborted by throwing an error. +#### depth + +The `depth` option is used to configure the maximum depth of the `qs` library when `extended` is `true`. This allows you to limit the amount of keys that are parsed and can be useful to prevent certain types of abuse. Defaults to `32`. It is recommended to keep this value as low as possible. + ## Errors The middlewares provided by this module create errors using the @@ -373,6 +378,10 @@ as well as in the `encoding` property. The `status` property is set to `415`, the `type` property is set to `'encoding.unsupported'`, and the `encoding` property is set to the encoding that is unsupported. +### The input exceeded the depth + +This error occurs when using `bodyParser.urlencoded` with the `extended` property set to `true` and the input exceeds the configured `depth` option. The `status` property is set to `400`. It is recommended to review the `depth` option and evaluate if it requires a higher value. When the `depth` option is set to `32` (default value), the error will not be thrown. + ## Examples ### Express/Connect top-level generic @@ -463,3 +472,5 @@ app.use(bodyParser.text({ type: 'text/html' })) [npm-downloads-image]: https://badgen.net/npm/dm/body-parser [npm-url]: https://npmjs.org/package/body-parser [npm-version-image]: https://badgen.net/npm/v/body-parser +[ossf-scorecard-badge]: https://api.scorecard.dev/projects/github.com/expressjs/body-parser/badge +[ossf-scorecard-visualizer]: https://ossf.github.io/scorecard-visualizer/#/projects/github.com/expressjs/body-parser \ No newline at end of file diff --git a/Modules/Chatroom/chat/node_modules/body-parser/lib/types/urlencoded.js b/Modules/Chatroom/chat/node_modules/body-parser/lib/types/urlencoded.js index b2ca8f16d0c1..2bd4485f54e3 100644 --- a/Modules/Chatroom/chat/node_modules/body-parser/lib/types/urlencoded.js +++ b/Modules/Chatroom/chat/node_modules/body-parser/lib/types/urlencoded.js @@ -55,6 +55,9 @@ function urlencoded (options) { : opts.limit var type = opts.type || 'application/x-www-form-urlencoded' var verify = opts.verify || false + var depth = typeof opts.depth !== 'number' + ? Number(opts.depth || 32) + : opts.depth if (verify !== false && typeof verify !== 'function') { throw new TypeError('option verify must be function') @@ -118,7 +121,8 @@ function urlencoded (options) { encoding: charset, inflate: inflate, limit: limit, - verify: verify + verify: verify, + depth: depth }) } } @@ -133,12 +137,20 @@ function extendedparser (options) { var parameterLimit = options.parameterLimit !== undefined ? options.parameterLimit : 1000 + + var depth = typeof options.depth !== 'number' + ? Number(options.depth || 32) + : options.depth var parse = parser('qs') if (isNaN(parameterLimit) || parameterLimit < 1) { throw new TypeError('option parameterLimit must be a positive number') } + if (isNaN(depth) || depth < 0) { + throw new TypeError('option depth must be a zero or a positive number') + } + if (isFinite(parameterLimit)) { parameterLimit = parameterLimit | 0 } @@ -156,12 +168,23 @@ function extendedparser (options) { var arrayLimit = Math.max(100, paramCount) debug('parse extended urlencoding') - return parse(body, { - allowPrototypes: true, - arrayLimit: arrayLimit, - depth: Infinity, - parameterLimit: parameterLimit - }) + try { + return parse(body, { + allowPrototypes: true, + arrayLimit: arrayLimit, + depth: depth, + strictDepth: true, + parameterLimit: parameterLimit + }) + } catch (err) { + if (err instanceof RangeError) { + throw createError(400, 'The input exceeded the depth', { + type: 'querystring.parse.rangeError' + }) + } else { + throw err + } + } } } diff --git a/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/.editorconfig b/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/.editorconfig new file mode 100644 index 000000000000..6adecfbf4cb3 --- /dev/null +++ b/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/.editorconfig @@ -0,0 +1,46 @@ +root = true + +[*] +indent_style = space +indent_size = 4 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true +max_line_length = 160 +quote_type = single + +[test/*] +max_line_length = off + +[LICENSE.md] +indent_size = off + +[*.md] +max_line_length = off + +[*.json] +max_line_length = off + +[Makefile] +max_line_length = off + +[CHANGELOG.md] +indent_style = space +indent_size = 2 + +[LICENSE] +indent_size = 2 +max_line_length = off + +[coverage/**/*] +indent_size = off +indent_style = off +indent = off +max_line_length = off + +[.nycrc] +indent_style = tab + +[tea.yaml] +indent_size = 2 diff --git a/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/.eslintrc b/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/.eslintrc new file mode 100644 index 000000000000..b6927611e43b --- /dev/null +++ b/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/.eslintrc @@ -0,0 +1,38 @@ +{ + "root": true, + + "extends": "@ljharb", + + "ignorePatterns": [ + "dist/", + ], + + "rules": { + "complexity": 0, + "consistent-return": 1, + "func-name-matching": 0, + "id-length": [2, { "min": 1, "max": 25, "properties": "never" }], + "indent": [2, 4], + "max-lines-per-function": [2, { "max": 150 }], + "max-params": [2, 18], + "max-statements": [2, 100], + "multiline-comment-style": 0, + "no-continue": 1, + "no-magic-numbers": 0, + "no-restricted-syntax": [2, "BreakStatement", "DebuggerStatement", "ForInStatement", "LabeledStatement", "WithStatement"], + }, + + "overrides": [ + { + "files": "test/**", + "rules": { + "function-paren-newline": 0, + "max-lines-per-function": 0, + "max-statements": 0, + "no-buffer-constructor": 0, + "no-extend-native": 0, + "no-throw-literal": 0, + }, + }, + ], +} diff --git a/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/.github/FUNDING.yml b/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/.github/FUNDING.yml new file mode 100644 index 000000000000..0355f4f5fbec --- /dev/null +++ b/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/qs +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with a single custom sponsorship URL diff --git a/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/.nycrc b/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/.nycrc new file mode 100644 index 000000000000..1d57cabe1b64 --- /dev/null +++ b/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/.nycrc @@ -0,0 +1,13 @@ +{ + "all": true, + "check-coverage": false, + "reporter": ["text-summary", "text", "html", "json"], + "lines": 86, + "statements": 85.93, + "functions": 82.43, + "branches": 76.06, + "exclude": [ + "coverage", + "dist" + ] +} diff --git a/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/CHANGELOG.md b/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/CHANGELOG.md new file mode 100644 index 000000000000..02a6b504fc9c --- /dev/null +++ b/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/CHANGELOG.md @@ -0,0 +1,600 @@ +## **6.13.0** +- [New] `parse`: add `strictDepth` option (#511) +- [Tests] use `npm audit` instead of `aud` + +## **6.12.3** +- [Fix] `parse`: properly account for `strictNullHandling` when `allowEmptyArrays` +- [meta] fix changelog indentation + +## **6.12.2** +- [Fix] `parse`: parse encoded square brackets (#506) +- [readme] add CII best practices badge + +## **6.12.1** +- [Fix] `parse`: Disable `decodeDotInKeys` by default to restore previous behavior (#501) +- [Performance] `utils`: Optimize performance under large data volumes, reduce memory usage, and speed up processing (#502) +- [Refactor] `utils`: use `+=` +- [Tests] increase coverage + +## **6.12.0** + +- [New] `parse`/`stringify`: add `decodeDotInKeys`/`encodeDotKeys` options (#488) +- [New] `parse`: add `duplicates` option +- [New] `parse`/`stringify`: add `allowEmptyArrays` option to allow [] in object values (#487) +- [Refactor] `parse`/`stringify`: move allowDots config logic to its own variable +- [Refactor] `stringify`: move option-handling code into `normalizeStringifyOptions` +- [readme] update readme, add logos (#484) +- [readme] `stringify`: clarify default `arrayFormat` behavior +- [readme] fix line wrapping +- [readme] remove dead badges +- [Deps] update `side-channel` +- [meta] make the dist build 50% smaller +- [meta] add `sideEffects` flag +- [meta] run build in prepack, not prepublish +- [Tests] `parse`: remove useless tests; add coverage +- [Tests] `stringify`: increase coverage +- [Tests] use `mock-property` +- [Tests] `stringify`: improve coverage +- [Dev Deps] update `@ljharb/eslint-config `, `aud`, `has-override-mistake`, `has-property-descriptors`, `mock-property`, `npmignore`, `object-inspect`, `tape` +- [Dev Deps] pin `glob`, since v10.3.8+ requires a broken `jackspeak` +- [Dev Deps] pin `jackspeak` since 2.1.2+ depends on npm aliases, which kill the install process in npm < 6 + +## **6.11.2** +- [Fix] `parse`: Fix parsing when the global Object prototype is frozen (#473) +- [Tests] add passing test cases with empty keys (#473) + +## **6.11.1** +- [Fix] `stringify`: encode comma values more consistently (#463) +- [readme] add usage of `filter` option for injecting custom serialization, i.e. of custom types (#447) +- [meta] remove extraneous code backticks (#457) +- [meta] fix changelog markdown +- [actions] update checkout action +- [actions] restrict action permissions +- [Dev Deps] update `@ljharb/eslint-config`, `aud`, `object-inspect`, `tape` + +## **6.11.0** +- [New] [Fix] `stringify`: revert 0e903c0; add `commaRoundTrip` option (#442) +- [readme] fix version badge + +## **6.10.5** +- [Fix] `stringify`: with `arrayFormat: comma`, properly include an explicit `[]` on a single-item array (#434) + +## **6.10.4** +- [Fix] `stringify`: with `arrayFormat: comma`, include an explicit `[]` on a single-item array (#441) +- [meta] use `npmignore` to autogenerate an npmignore file +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `has-symbol`, `object-inspect`, `tape` + +## **6.10.3** +- [Fix] `parse`: ignore `__proto__` keys (#428) +- [Robustness] `stringify`: avoid relying on a global `undefined` (#427) +- [actions] reuse common workflows +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `object-inspect`, `tape` + +## **6.10.2** +- [Fix] `stringify`: actually fix cyclic references (#426) +- [Fix] `stringify`: avoid encoding arrayformat comma when `encodeValuesOnly = true` (#424) +- [readme] remove travis badge; add github actions/codecov badges; update URLs +- [Docs] add note and links for coercing primitive values (#408) +- [actions] update codecov uploader +- [actions] update workflows +- [Tests] clean up stringify tests slightly +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `object-inspect`, `safe-publish-latest`, `tape` + +## **6.10.1** +- [Fix] `stringify`: avoid exception on repeated object values (#402) + +## **6.10.0** +- [New] `stringify`: throw on cycles, instead of an infinite loop (#395, #394, #393) +- [New] `parse`: add `allowSparse` option for collapsing arrays with missing indices (#312) +- [meta] fix README.md (#399) +- [meta] only run `npm run dist` in publish, not install +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `has-symbols`, `tape` +- [Tests] fix tests on node v0.6 +- [Tests] use `ljharb/actions/node/install` instead of `ljharb/actions/node/run` +- [Tests] Revert "[meta] ignore eclint transitive audit warning" + +## **6.9.7** +- [Fix] `parse`: ignore `__proto__` keys (#428) +- [Fix] `stringify`: avoid encoding arrayformat comma when `encodeValuesOnly = true` (#424) +- [Robustness] `stringify`: avoid relying on a global `undefined` (#427) +- [readme] remove travis badge; add github actions/codecov badges; update URLs +- [Docs] add note and links for coercing primitive values (#408) +- [Tests] clean up stringify tests slightly +- [meta] fix README.md (#399) +- Revert "[meta] ignore eclint transitive audit warning" +- [actions] backport actions from main +- [Dev Deps] backport updates from main + +## **6.9.6** +- [Fix] restore `dist` dir; mistakenly removed in d4f6c32 + +## **6.9.5** +- [Fix] `stringify`: do not encode parens for RFC1738 +- [Fix] `stringify`: fix arrayFormat comma with empty array/objects (#350) +- [Refactor] `format`: remove `util.assign` call +- [meta] add "Allow Edits" workflow; update rebase workflow +- [actions] switch Automatic Rebase workflow to `pull_request_target` event +- [Tests] `stringify`: add tests for #378 +- [Tests] migrate tests to Github Actions +- [Tests] run `nyc` on all tests; use `tape` runner +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `browserify`, `mkdirp`, `object-inspect`, `tape`; add `aud` + +## **6.9.4** +- [Fix] `stringify`: when `arrayFormat` is `comma`, respect `serializeDate` (#364) +- [Refactor] `stringify`: reduce branching (part of #350) +- [Refactor] move `maybeMap` to `utils` +- [Dev Deps] update `browserify`, `tape` + +## **6.9.3** +- [Fix] proper comma parsing of URL-encoded commas (#361) +- [Fix] parses comma delimited array while having percent-encoded comma treated as normal text (#336) + +## **6.9.2** +- [Fix] `parse`: Fix parsing array from object with `comma` true (#359) +- [Fix] `parse`: throw a TypeError instead of an Error for bad charset (#349) +- [meta] ignore eclint transitive audit warning +- [meta] fix indentation in package.json +- [meta] add tidelift marketing copy +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `object-inspect`, `has-symbols`, `tape`, `mkdirp`, `iconv-lite` +- [actions] add automatic rebasing / merge commit blocking + +## **6.9.1** +- [Fix] `parse`: with comma true, handle field that holds an array of arrays (#335) +- [Fix] `parse`: with comma true, do not split non-string values (#334) +- [meta] add `funding` field +- [Dev Deps] update `eslint`, `@ljharb/eslint-config` +- [Tests] use shared travis-ci config + +## **6.9.0** +- [New] `parse`/`stringify`: Pass extra key/value argument to `decoder` (#333) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `evalmd` +- [Tests] `parse`: add passing `arrayFormat` tests +- [Tests] add `posttest` using `npx aud` to run `npm audit` without a lockfile +- [Tests] up to `node` `v12.10`, `v11.15`, `v10.16`, `v8.16` +- [Tests] `Buffer.from` in node v5.0-v5.9 and v4.0-v4.4 requires a TypedArray + +## **6.8.3** +- [Fix] `parse`: ignore `__proto__` keys (#428) +- [Robustness] `stringify`: avoid relying on a global `undefined` (#427) +- [Fix] `stringify`: avoid encoding arrayformat comma when `encodeValuesOnly = true` (#424) +- [readme] remove travis badge; add github actions/codecov badges; update URLs +- [Tests] clean up stringify tests slightly +- [Docs] add note and links for coercing primitive values (#408) +- [meta] fix README.md (#399) +- [actions] backport actions from main +- [Dev Deps] backport updates from main +- [Refactor] `stringify`: reduce branching +- [meta] do not publish workflow files + +## **6.8.2** +- [Fix] proper comma parsing of URL-encoded commas (#361) +- [Fix] parses comma delimited array while having percent-encoded comma treated as normal text (#336) + +## **6.8.1** +- [Fix] `parse`: Fix parsing array from object with `comma` true (#359) +- [Fix] `parse`: throw a TypeError instead of an Error for bad charset (#349) +- [Fix] `parse`: with comma true, handle field that holds an array of arrays (#335) +- [fix] `parse`: with comma true, do not split non-string values (#334) +- [meta] add tidelift marketing copy +- [meta] add `funding` field +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape`, `safe-publish-latest`, `evalmd`, `has-symbols`, `iconv-lite`, `mkdirp`, `object-inspect` +- [Tests] `parse`: add passing `arrayFormat` tests +- [Tests] use shared travis-ci configs +- [Tests] `Buffer.from` in node v5.0-v5.9 and v4.0-v4.4 requires a TypedArray +- [actions] add automatic rebasing / merge commit blocking + +## **6.8.0** +- [New] add `depth=false` to preserve the original key; [Fix] `depth=0` should preserve the original key (#326) +- [New] [Fix] stringify symbols and bigints +- [Fix] ensure node 0.12 can stringify Symbols +- [Fix] fix for an impossible situation: when the formatter is called with a non-string value +- [Refactor] `formats`: tiny bit of cleanup. +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `browserify`, `safe-publish-latest`, `iconv-lite`, `tape` +- [Tests] add tests for `depth=0` and `depth=false` behavior, both current and intuitive/intended (#326) +- [Tests] use `eclint` instead of `editorconfig-tools` +- [docs] readme: add security note +- [meta] add github sponsorship +- [meta] add FUNDING.yml +- [meta] Clean up license text so it’s properly detected as BSD-3-Clause + +## **6.7.3** +- [Fix] `parse`: ignore `__proto__` keys (#428) +- [Fix] `stringify`: avoid encoding arrayformat comma when `encodeValuesOnly = true` (#424) +- [Robustness] `stringify`: avoid relying on a global `undefined` (#427) +- [readme] remove travis badge; add github actions/codecov badges; update URLs +- [Docs] add note and links for coercing primitive values (#408) +- [meta] fix README.md (#399) +- [meta] do not publish workflow files +- [actions] backport actions from main +- [Dev Deps] backport updates from main +- [Tests] use `nyc` for coverage +- [Tests] clean up stringify tests slightly + +## **6.7.2** +- [Fix] proper comma parsing of URL-encoded commas (#361) +- [Fix] parses comma delimited array while having percent-encoded comma treated as normal text (#336) + +## **6.7.1** +- [Fix] `parse`: Fix parsing array from object with `comma` true (#359) +- [Fix] `parse`: with comma true, handle field that holds an array of arrays (#335) +- [fix] `parse`: with comma true, do not split non-string values (#334) +- [Fix] `parse`: throw a TypeError instead of an Error for bad charset (#349) +- [Fix] fix for an impossible situation: when the formatter is called with a non-string value +- [Refactor] `formats`: tiny bit of cleanup. +- readme: add security note +- [meta] add tidelift marketing copy +- [meta] add `funding` field +- [meta] add FUNDING.yml +- [meta] Clean up license text so it’s properly detected as BSD-3-Clause +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape`, `safe-publish-latest`, `evalmd`, `iconv-lite`, `mkdirp`, `object-inspect`, `browserify` +- [Tests] `parse`: add passing `arrayFormat` tests +- [Tests] use shared travis-ci configs +- [Tests] `Buffer.from` in node v5.0-v5.9 and v4.0-v4.4 requires a TypedArray +- [Tests] add tests for `depth=0` and `depth=false` behavior, both current and intuitive/intended +- [Tests] use `eclint` instead of `editorconfig-tools` +- [actions] add automatic rebasing / merge commit blocking + +## **6.7.0** +- [New] `stringify`/`parse`: add `comma` as an `arrayFormat` option (#276, #219) +- [Fix] correctly parse nested arrays (#212) +- [Fix] `utils.merge`: avoid a crash with a null target and a truthy non-array source, also with an array source +- [Robustness] `stringify`: cache `Object.prototype.hasOwnProperty` +- [Refactor] `utils`: `isBuffer`: small tweak; add tests +- [Refactor] use cached `Array.isArray` +- [Refactor] `parse`/`stringify`: make a function to normalize the options +- [Refactor] `utils`: reduce observable [[Get]]s +- [Refactor] `stringify`/`utils`: cache `Array.isArray` +- [Tests] always use `String(x)` over `x.toString()` +- [Tests] fix Buffer tests to work in node < 4.5 and node < 5.10 +- [Tests] temporarily allow coverage to fail + +## **6.6.1** +- [Fix] `parse`: ignore `__proto__` keys (#428) +- [Fix] fix for an impossible situation: when the formatter is called with a non-string value +- [Fix] `utils.merge`: avoid a crash with a null target and an array source +- [Fix] `utils.merge`: avoid a crash with a null target and a truthy non-array source +- [Fix] correctly parse nested arrays +- [Robustness] `stringify`: avoid relying on a global `undefined` (#427) +- [Robustness] `stringify`: cache `Object.prototype.hasOwnProperty` +- [Refactor] `formats`: tiny bit of cleanup. +- [Refactor] `utils`: `isBuffer`: small tweak; add tests +- [Refactor]: `stringify`/`utils`: cache `Array.isArray` +- [Refactor] `utils`: reduce observable [[Get]]s +- [Refactor] use cached `Array.isArray` +- [Refactor] `parse`/`stringify`: make a function to normalize the options +- [readme] remove travis badge; add github actions/codecov badges; update URLs +- [Docs] Clarify the need for "arrayLimit" option +- [meta] fix README.md (#399) +- [meta] do not publish workflow files +- [meta] Clean up license text so it’s properly detected as BSD-3-Clause +- [meta] add FUNDING.yml +- [meta] Fixes typo in CHANGELOG.md +- [actions] backport actions from main +- [Tests] fix Buffer tests to work in node < 4.5 and node < 5.10 +- [Tests] always use `String(x)` over `x.toString()` +- [Dev Deps] backport from main + +## **6.6.0** +- [New] Add support for iso-8859-1, utf8 "sentinel" and numeric entities (#268) +- [New] move two-value combine to a `utils` function (#189) +- [Fix] `stringify`: fix a crash with `strictNullHandling` and a custom `filter`/`serializeDate` (#279) +- [Fix] when `parseArrays` is false, properly handle keys ending in `[]` (#260) +- [Fix] `stringify`: do not crash in an obscure combo of `interpretNumericEntities`, a bad custom `decoder`, & `iso-8859-1` +- [Fix] `utils`: `merge`: fix crash when `source` is a truthy primitive & no options are provided +- [refactor] `stringify`: Avoid arr = arr.concat(...), push to the existing instance (#269) +- [Refactor] `parse`: only need to reassign the var once +- [Refactor] `parse`/`stringify`: clean up `charset` options checking; fix defaults +- [Refactor] add missing defaults +- [Refactor] `parse`: one less `concat` call +- [Refactor] `utils`: `compactQueue`: make it explicitly side-effecting +- [Dev Deps] update `browserify`, `eslint`, `@ljharb/eslint-config`, `iconv-lite`, `safe-publish-latest`, `tape` +- [Tests] up to `node` `v10.10`, `v9.11`, `v8.12`, `v6.14`, `v4.9`; pin included builds to LTS + +## **6.5.3** +- [Fix] `parse`: ignore `__proto__` keys (#428) +- [Fix] `utils.merge`: avoid a crash with a null target and a truthy non-array source +- [Fix] correctly parse nested arrays +- [Fix] `stringify`: fix a crash with `strictNullHandling` and a custom `filter`/`serializeDate` (#279) +- [Fix] `utils`: `merge`: fix crash when `source` is a truthy primitive & no options are provided +- [Fix] when `parseArrays` is false, properly handle keys ending in `[]` +- [Fix] fix for an impossible situation: when the formatter is called with a non-string value +- [Fix] `utils.merge`: avoid a crash with a null target and an array source +- [Refactor] `utils`: reduce observable [[Get]]s +- [Refactor] use cached `Array.isArray` +- [Refactor] `stringify`: Avoid arr = arr.concat(...), push to the existing instance (#269) +- [Refactor] `parse`: only need to reassign the var once +- [Robustness] `stringify`: avoid relying on a global `undefined` (#427) +- [readme] remove travis badge; add github actions/codecov badges; update URLs +- [Docs] Clean up license text so it’s properly detected as BSD-3-Clause +- [Docs] Clarify the need for "arrayLimit" option +- [meta] fix README.md (#399) +- [meta] add FUNDING.yml +- [actions] backport actions from main +- [Tests] always use `String(x)` over `x.toString()` +- [Tests] remove nonexistent tape option +- [Dev Deps] backport from main + +## **6.5.2** +- [Fix] use `safer-buffer` instead of `Buffer` constructor +- [Refactor] utils: `module.exports` one thing, instead of mutating `exports` (#230) +- [Dev Deps] update `browserify`, `eslint`, `iconv-lite`, `safer-buffer`, `tape`, `browserify` + +## **6.5.1** +- [Fix] Fix parsing & compacting very deep objects (#224) +- [Refactor] name utils functions +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape` +- [Tests] up to `node` `v8.4`; use `nvm install-latest-npm` so newer npm doesn’t break older node +- [Tests] Use precise dist for Node.js 0.6 runtime (#225) +- [Tests] make 0.6 required, now that it’s passing +- [Tests] on `node` `v8.2`; fix npm on node 0.6 + +## **6.5.0** +- [New] add `utils.assign` +- [New] pass default encoder/decoder to custom encoder/decoder functions (#206) +- [New] `parse`/`stringify`: add `ignoreQueryPrefix`/`addQueryPrefix` options, respectively (#213) +- [Fix] Handle stringifying empty objects with addQueryPrefix (#217) +- [Fix] do not mutate `options` argument (#207) +- [Refactor] `parse`: cache index to reuse in else statement (#182) +- [Docs] add various badges to readme (#208) +- [Dev Deps] update `eslint`, `browserify`, `iconv-lite`, `tape` +- [Tests] up to `node` `v8.1`, `v7.10`, `v6.11`; npm v4.6 breaks on node < v1; npm v5+ breaks on node < v4 +- [Tests] add `editorconfig-tools` + +## **6.4.1** +- [Fix] `parse`: ignore `__proto__` keys (#428) +- [Fix] fix for an impossible situation: when the formatter is called with a non-string value +- [Fix] use `safer-buffer` instead of `Buffer` constructor +- [Fix] `utils.merge`: avoid a crash with a null target and an array source +- [Fix] `utils.merge`: avoid a crash with a null target and a truthy non-array source +- [Fix] `stringify`: fix a crash with `strictNullHandling` and a custom `filter`/`serializeDate` (#279) +- [Fix] `utils`: `merge`: fix crash when `source` is a truthy primitive & no options are provided +- [Fix] when `parseArrays` is false, properly handle keys ending in `[]` +- [Robustness] `stringify`: avoid relying on a global `undefined` (#427) +- [Refactor] use cached `Array.isArray` +- [Refactor] `stringify`: Avoid arr = arr.concat(...), push to the existing instance (#269) +- [readme] remove travis badge; add github actions/codecov badges; update URLs +- [Docs] Clarify the need for "arrayLimit" option +- [meta] fix README.md (#399) +- [meta] Clean up license text so it’s properly detected as BSD-3-Clause +- [meta] add FUNDING.yml +- [actions] backport actions from main +- [Tests] remove nonexistent tape option +- [Dev Deps] backport from main + +## **6.4.0** +- [New] `qs.stringify`: add `encodeValuesOnly` option +- [Fix] follow `allowPrototypes` option during merge (#201, #201) +- [Fix] support keys starting with brackets (#202, #200) +- [Fix] chmod a-x +- [Dev Deps] update `eslint` +- [Tests] up to `node` `v7.7`, `v6.10`,` v4.8`; disable osx builds since they block linux builds +- [eslint] reduce warnings + +## **6.3.3** +- [Fix] `parse`: ignore `__proto__` keys (#428) +- [Fix] fix for an impossible situation: when the formatter is called with a non-string value +- [Fix] `utils.merge`: avoid a crash with a null target and an array source +- [Fix] `utils.merge`: avoid a crash with a null target and a truthy non-array source +- [Fix] `stringify`: fix a crash with `strictNullHandling` and a custom `filter`/`serializeDate` (#279) +- [Fix] `utils`: `merge`: fix crash when `source` is a truthy primitive & no options are provided +- [Fix] when `parseArrays` is false, properly handle keys ending in `[]` +- [Robustness] `stringify`: avoid relying on a global `undefined` (#427) +- [Refactor] use cached `Array.isArray` +- [Refactor] `stringify`: Avoid arr = arr.concat(...), push to the existing instance (#269) +- [Docs] Clarify the need for "arrayLimit" option +- [meta] fix README.md (#399) +- [meta] Clean up license text so it’s properly detected as BSD-3-Clause +- [meta] add FUNDING.yml +- [actions] backport actions from main +- [Tests] use `safer-buffer` instead of `Buffer` constructor +- [Tests] remove nonexistent tape option +- [Dev Deps] backport from main + +## **6.3.2** +- [Fix] follow `allowPrototypes` option during merge (#201, #200) +- [Dev Deps] update `eslint` +- [Fix] chmod a-x +- [Fix] support keys starting with brackets (#202, #200) +- [Tests] up to `node` `v7.7`, `v6.10`,` v4.8`; disable osx builds since they block linux builds + +## **6.3.1** +- [Fix] ensure that `allowPrototypes: false` does not ever shadow Object.prototype properties (thanks, @snyk!) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `browserify`, `iconv-lite`, `qs-iconv`, `tape` +- [Tests] on all node minors; improve test matrix +- [Docs] document stringify option `allowDots` (#195) +- [Docs] add empty object and array values example (#195) +- [Docs] Fix minor inconsistency/typo (#192) +- [Docs] document stringify option `sort` (#191) +- [Refactor] `stringify`: throw faster with an invalid encoder +- [Refactor] remove unnecessary escapes (#184) +- Remove contributing.md, since `qs` is no longer part of `hapi` (#183) + +## **6.3.0** +- [New] Add support for RFC 1738 (#174, #173) +- [New] `stringify`: Add `serializeDate` option to customize Date serialization (#159) +- [Fix] ensure `utils.merge` handles merging two arrays +- [Refactor] only constructors should be capitalized +- [Refactor] capitalized var names are for constructors only +- [Refactor] avoid using a sparse array +- [Robustness] `formats`: cache `String#replace` +- [Dev Deps] update `browserify`, `eslint`, `@ljharb/eslint-config`; add `safe-publish-latest` +- [Tests] up to `node` `v6.8`, `v4.6`; improve test matrix +- [Tests] flesh out arrayLimit/arrayFormat tests (#107) +- [Tests] skip Object.create tests when null objects are not available +- [Tests] Turn on eslint for test files (#175) + +## **6.2.4** +- [Fix] `parse`: ignore `__proto__` keys (#428) +- [Fix] `utils.merge`: avoid a crash with a null target and an array source +- [Fix] `utils.merge`: avoid a crash with a null target and a truthy non-array source +- [Fix] `utils`: `merge`: fix crash when `source` is a truthy primitive & no options are provided +- [Fix] when `parseArrays` is false, properly handle keys ending in `[]` +- [Robustness] `stringify`: avoid relying on a global `undefined` (#427) +- [Refactor] use cached `Array.isArray` +- [Docs] Clarify the need for "arrayLimit" option +- [meta] fix README.md (#399) +- [meta] Clean up license text so it’s properly detected as BSD-3-Clause +- [meta] add FUNDING.yml +- [actions] backport actions from main +- [Tests] use `safer-buffer` instead of `Buffer` constructor +- [Tests] remove nonexistent tape option +- [Dev Deps] backport from main + +## **6.2.3** +- [Fix] follow `allowPrototypes` option during merge (#201, #200) +- [Fix] chmod a-x +- [Fix] support keys starting with brackets (#202, #200) +- [Tests] up to `node` `v7.7`, `v6.10`,` v4.8`; disable osx builds since they block linux builds + +## **6.2.2** +- [Fix] ensure that `allowPrototypes: false` does not ever shadow Object.prototype properties + +## **6.2.1** +- [Fix] ensure `key[]=x&key[]&key[]=y` results in 3, not 2, values +- [Refactor] Be explicit and use `Object.prototype.hasOwnProperty.call` +- [Tests] remove `parallelshell` since it does not reliably report failures +- [Tests] up to `node` `v6.3`, `v5.12` +- [Dev Deps] update `tape`, `eslint`, `@ljharb/eslint-config`, `qs-iconv` + +## [**6.2.0**](https://github.com/ljharb/qs/issues?milestone=36&state=closed) +- [New] pass Buffers to the encoder/decoder directly (#161) +- [New] add "encoder" and "decoder" options, for custom param encoding/decoding (#160) +- [Fix] fix compacting of nested sparse arrays (#150) + +## **6.1.2** +- [Fix] follow `allowPrototypes` option during merge (#201, #200) +- [Fix] chmod a-x +- [Fix] support keys starting with brackets (#202, #200) +- [Tests] up to `node` `v7.7`, `v6.10`,` v4.8`; disable osx builds since they block linux builds + +## **6.1.1** +- [Fix] ensure that `allowPrototypes: false` does not ever shadow Object.prototype properties + +## [**6.1.0**](https://github.com/ljharb/qs/issues?milestone=35&state=closed) +- [New] allowDots option for `stringify` (#151) +- [Fix] "sort" option should work at a depth of 3 or more (#151) +- [Fix] Restore `dist` directory; will be removed in v7 (#148) + +## **6.0.4** +- [Fix] follow `allowPrototypes` option during merge (#201, #200) +- [Fix] chmod a-x +- [Fix] support keys starting with brackets (#202, #200) +- [Tests] up to `node` `v7.7`, `v6.10`,` v4.8`; disable osx builds since they block linux builds + +## **6.0.3** +- [Fix] ensure that `allowPrototypes: false` does not ever shadow Object.prototype properties +- [Fix] Restore `dist` directory; will be removed in v7 (#148) + +## [**6.0.2**](https://github.com/ljharb/qs/issues?milestone=33&state=closed) +- Revert ES6 requirement and restore support for node down to v0.8. + +## [**6.0.1**](https://github.com/ljharb/qs/issues?milestone=32&state=closed) +- [**#127**](https://github.com/ljharb/qs/pull/127) Fix engines definition in package.json + +## [**6.0.0**](https://github.com/ljharb/qs/issues?milestone=31&state=closed) +- [**#124**](https://github.com/ljharb/qs/issues/124) Use ES6 and drop support for node < v4 + +## **5.2.1** +- [Fix] ensure `key[]=x&key[]&key[]=y` results in 3, not 2, values + +## [**5.2.0**](https://github.com/ljharb/qs/issues?milestone=30&state=closed) +- [**#64**](https://github.com/ljharb/qs/issues/64) Add option to sort object keys in the query string + +## [**5.1.0**](https://github.com/ljharb/qs/issues?milestone=29&state=closed) +- [**#117**](https://github.com/ljharb/qs/issues/117) make URI encoding stringified results optional +- [**#106**](https://github.com/ljharb/qs/issues/106) Add flag `skipNulls` to optionally skip null values in stringify + +## [**5.0.0**](https://github.com/ljharb/qs/issues?milestone=28&state=closed) +- [**#114**](https://github.com/ljharb/qs/issues/114) default allowDots to false +- [**#100**](https://github.com/ljharb/qs/issues/100) include dist to npm + +## [**4.0.0**](https://github.com/ljharb/qs/issues?milestone=26&state=closed) +- [**#98**](https://github.com/ljharb/qs/issues/98) make returning plain objects and allowing prototype overwriting properties optional + +## [**3.1.0**](https://github.com/ljharb/qs/issues?milestone=24&state=closed) +- [**#89**](https://github.com/ljharb/qs/issues/89) Add option to disable "Transform dot notation to bracket notation" + +## [**3.0.0**](https://github.com/ljharb/qs/issues?milestone=23&state=closed) +- [**#80**](https://github.com/ljharb/qs/issues/80) qs.parse silently drops properties +- [**#77**](https://github.com/ljharb/qs/issues/77) Perf boost +- [**#60**](https://github.com/ljharb/qs/issues/60) Add explicit option to disable array parsing +- [**#74**](https://github.com/ljharb/qs/issues/74) Bad parse when turning array into object +- [**#81**](https://github.com/ljharb/qs/issues/81) Add a `filter` option +- [**#68**](https://github.com/ljharb/qs/issues/68) Fixed issue with recursion and passing strings into objects. +- [**#66**](https://github.com/ljharb/qs/issues/66) Add mixed array and object dot notation support Closes: #47 +- [**#76**](https://github.com/ljharb/qs/issues/76) RFC 3986 +- [**#85**](https://github.com/ljharb/qs/issues/85) No equal sign +- [**#84**](https://github.com/ljharb/qs/issues/84) update license attribute + +## [**2.4.1**](https://github.com/ljharb/qs/issues?milestone=20&state=closed) +- [**#73**](https://github.com/ljharb/qs/issues/73) Property 'hasOwnProperty' of object # is not a function + +## [**2.4.0**](https://github.com/ljharb/qs/issues?milestone=19&state=closed) +- [**#70**](https://github.com/ljharb/qs/issues/70) Add arrayFormat option + +## [**2.3.3**](https://github.com/ljharb/qs/issues?milestone=18&state=closed) +- [**#59**](https://github.com/ljharb/qs/issues/59) make sure array indexes are >= 0, closes #57 +- [**#58**](https://github.com/ljharb/qs/issues/58) make qs usable for browser loader + +## [**2.3.2**](https://github.com/ljharb/qs/issues?milestone=17&state=closed) +- [**#55**](https://github.com/ljharb/qs/issues/55) allow merging a string into an object + +## [**2.3.1**](https://github.com/ljharb/qs/issues?milestone=16&state=closed) +- [**#52**](https://github.com/ljharb/qs/issues/52) Return "undefined" and "false" instead of throwing "TypeError". + +## [**2.3.0**](https://github.com/ljharb/qs/issues?milestone=15&state=closed) +- [**#50**](https://github.com/ljharb/qs/issues/50) add option to omit array indices, closes #46 + +## [**2.2.5**](https://github.com/ljharb/qs/issues?milestone=14&state=closed) +- [**#39**](https://github.com/ljharb/qs/issues/39) Is there an alternative to Buffer.isBuffer? +- [**#49**](https://github.com/ljharb/qs/issues/49) refactor utils.merge, fixes #45 +- [**#41**](https://github.com/ljharb/qs/issues/41) avoid browserifying Buffer, for #39 + +## [**2.2.4**](https://github.com/ljharb/qs/issues?milestone=13&state=closed) +- [**#38**](https://github.com/ljharb/qs/issues/38) how to handle object keys beginning with a number + +## [**2.2.3**](https://github.com/ljharb/qs/issues?milestone=12&state=closed) +- [**#37**](https://github.com/ljharb/qs/issues/37) parser discards first empty value in array +- [**#36**](https://github.com/ljharb/qs/issues/36) Update to lab 4.x + +## [**2.2.2**](https://github.com/ljharb/qs/issues?milestone=11&state=closed) +- [**#33**](https://github.com/ljharb/qs/issues/33) Error when plain object in a value +- [**#34**](https://github.com/ljharb/qs/issues/34) use Object.prototype.hasOwnProperty.call instead of obj.hasOwnProperty +- [**#24**](https://github.com/ljharb/qs/issues/24) Changelog? Semver? + +## [**2.2.1**](https://github.com/ljharb/qs/issues?milestone=10&state=closed) +- [**#32**](https://github.com/ljharb/qs/issues/32) account for circular references properly, closes #31 +- [**#31**](https://github.com/ljharb/qs/issues/31) qs.parse stackoverflow on circular objects + +## [**2.2.0**](https://github.com/ljharb/qs/issues?milestone=9&state=closed) +- [**#26**](https://github.com/ljharb/qs/issues/26) Don't use Buffer global if it's not present +- [**#30**](https://github.com/ljharb/qs/issues/30) Bug when merging non-object values into arrays +- [**#29**](https://github.com/ljharb/qs/issues/29) Don't call Utils.clone at the top of Utils.merge +- [**#23**](https://github.com/ljharb/qs/issues/23) Ability to not limit parameters? + +## [**2.1.0**](https://github.com/ljharb/qs/issues?milestone=8&state=closed) +- [**#22**](https://github.com/ljharb/qs/issues/22) Enable using a RegExp as delimiter + +## [**2.0.0**](https://github.com/ljharb/qs/issues?milestone=7&state=closed) +- [**#18**](https://github.com/ljharb/qs/issues/18) Why is there arrayLimit? +- [**#20**](https://github.com/ljharb/qs/issues/20) Configurable parametersLimit +- [**#21**](https://github.com/ljharb/qs/issues/21) make all limits optional, for #18, for #20 + +## [**1.2.2**](https://github.com/ljharb/qs/issues?milestone=6&state=closed) +- [**#19**](https://github.com/ljharb/qs/issues/19) Don't overwrite null values + +## [**1.2.1**](https://github.com/ljharb/qs/issues?milestone=5&state=closed) +- [**#16**](https://github.com/ljharb/qs/issues/16) ignore non-string delimiters +- [**#15**](https://github.com/ljharb/qs/issues/15) Close code block + +## [**1.2.0**](https://github.com/ljharb/qs/issues?milestone=4&state=closed) +- [**#12**](https://github.com/ljharb/qs/issues/12) Add optional delim argument +- [**#13**](https://github.com/ljharb/qs/issues/13) fix #11: flattened keys in array are now correctly parsed + +## [**1.1.0**](https://github.com/ljharb/qs/issues?milestone=3&state=closed) +- [**#7**](https://github.com/ljharb/qs/issues/7) Empty values of a POST array disappear after being submitted +- [**#9**](https://github.com/ljharb/qs/issues/9) Should not omit equals signs (=) when value is null +- [**#6**](https://github.com/ljharb/qs/issues/6) Minor grammar fix in README + +## [**1.0.2**](https://github.com/ljharb/qs/issues?milestone=2&state=closed) +- [**#5**](https://github.com/ljharb/qs/issues/5) array holes incorrectly copied into object on large index diff --git a/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/LICENSE.md b/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/LICENSE.md new file mode 100644 index 000000000000..fecf6b6942d1 --- /dev/null +++ b/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/LICENSE.md @@ -0,0 +1,29 @@ +BSD 3-Clause License + +Copyright (c) 2014, Nathan LaFreniere and other [contributors](https://github.com/ljharb/qs/graphs/contributors) +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/README.md b/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/README.md new file mode 100644 index 000000000000..1e0d9adc482d --- /dev/null +++ b/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/README.md @@ -0,0 +1,709 @@ +

+ qs +

+ +# qs [![Version Badge][npm-version-svg]][package-url] + +[![github actions][actions-image]][actions-url] +[![coverage][codecov-image]][codecov-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] +[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/9058/badge)](https://bestpractices.coreinfrastructure.org/projects/9058) + +[![npm badge][npm-badge-png]][package-url] + +A querystring parsing and stringifying library with some added security. + +Lead Maintainer: [Jordan Harband](https://github.com/ljharb) + +The **qs** module was originally created and maintained by [TJ Holowaychuk](https://github.com/visionmedia/node-querystring). + +## Usage + +```javascript +var qs = require('qs'); +var assert = require('assert'); + +var obj = qs.parse('a=c'); +assert.deepEqual(obj, { a: 'c' }); + +var str = qs.stringify(obj); +assert.equal(str, 'a=c'); +``` + +### Parsing Objects + +[](#preventEval) +```javascript +qs.parse(string, [options]); +``` + +**qs** allows you to create nested objects within your query strings, by surrounding the name of sub-keys with square brackets `[]`. +For example, the string `'foo[bar]=baz'` converts to: + +```javascript +assert.deepEqual(qs.parse('foo[bar]=baz'), { + foo: { + bar: 'baz' + } +}); +``` + +When using the `plainObjects` option the parsed value is returned as a null object, created via `Object.create(null)` and as such you should be aware that prototype methods will not exist on it and a user may set those names to whatever value they like: + +```javascript +var nullObject = qs.parse('a[hasOwnProperty]=b', { plainObjects: true }); +assert.deepEqual(nullObject, { a: { hasOwnProperty: 'b' } }); +``` + +By default parameters that would overwrite properties on the object prototype are ignored, if you wish to keep the data from those fields either use `plainObjects` as mentioned above, or set `allowPrototypes` to `true` which will allow user input to overwrite those properties. +*WARNING* It is generally a bad idea to enable this option as it can cause problems when attempting to use the properties that have been overwritten. +Always be careful with this option. + +```javascript +var protoObject = qs.parse('a[hasOwnProperty]=b', { allowPrototypes: true }); +assert.deepEqual(protoObject, { a: { hasOwnProperty: 'b' } }); +``` + +URI encoded strings work too: + +```javascript +assert.deepEqual(qs.parse('a%5Bb%5D=c'), { + a: { b: 'c' } +}); +``` + +You can also nest your objects, like `'foo[bar][baz]=foobarbaz'`: + +```javascript +assert.deepEqual(qs.parse('foo[bar][baz]=foobarbaz'), { + foo: { + bar: { + baz: 'foobarbaz' + } + } +}); +``` + +By default, when nesting objects **qs** will only parse up to 5 children deep. +This means if you attempt to parse a string like `'a[b][c][d][e][f][g][h][i]=j'` your resulting object will be: + +```javascript +var expected = { + a: { + b: { + c: { + d: { + e: { + f: { + '[g][h][i]': 'j' + } + } + } + } + } + } +}; +var string = 'a[b][c][d][e][f][g][h][i]=j'; +assert.deepEqual(qs.parse(string), expected); +``` + +This depth can be overridden by passing a `depth` option to `qs.parse(string, [options])`: + +```javascript +var deep = qs.parse('a[b][c][d][e][f][g][h][i]=j', { depth: 1 }); +assert.deepEqual(deep, { a: { b: { '[c][d][e][f][g][h][i]': 'j' } } }); +``` + +You can configure **qs** to throw an error when parsing nested input beyond this depth using the `strictDepth` option (defaulted to false): + +```javascript +try { + qs.parse('a[b][c][d][e][f][g][h][i]=j', { depth: 1, strictDepth: true }); +} catch (err) { + assert(err instanceof RangeError); + assert.strictEqual(err.message, 'Input depth exceeded depth option of 1 and strictDepth is true'); +} +``` + +The depth limit helps mitigate abuse when **qs** is used to parse user input, and it is recommended to keep it a reasonably small number. The strictDepth option adds a layer of protection by throwing an error when the limit is exceeded, allowing you to catch and handle such cases. + +For similar reasons, by default **qs** will only parse up to 1000 parameters. This can be overridden by passing a `parameterLimit` option: + +```javascript +var limited = qs.parse('a=b&c=d', { parameterLimit: 1 }); +assert.deepEqual(limited, { a: 'b' }); +``` + +To bypass the leading question mark, use `ignoreQueryPrefix`: + +```javascript +var prefixed = qs.parse('?a=b&c=d', { ignoreQueryPrefix: true }); +assert.deepEqual(prefixed, { a: 'b', c: 'd' }); +``` + +An optional delimiter can also be passed: + +```javascript +var delimited = qs.parse('a=b;c=d', { delimiter: ';' }); +assert.deepEqual(delimited, { a: 'b', c: 'd' }); +``` + +Delimiters can be a regular expression too: + +```javascript +var regexed = qs.parse('a=b;c=d,e=f', { delimiter: /[;,]/ }); +assert.deepEqual(regexed, { a: 'b', c: 'd', e: 'f' }); +``` + +Option `allowDots` can be used to enable dot notation: + +```javascript +var withDots = qs.parse('a.b=c', { allowDots: true }); +assert.deepEqual(withDots, { a: { b: 'c' } }); +``` + +Option `decodeDotInKeys` can be used to decode dots in keys +Note: it implies `allowDots`, so `parse` will error if you set `decodeDotInKeys` to `true`, and `allowDots` to `false`. + +```javascript +var withDots = qs.parse('name%252Eobj.first=John&name%252Eobj.last=Doe', { decodeDotInKeys: true }); +assert.deepEqual(withDots, { 'name.obj': { first: 'John', last: 'Doe' }}); +``` + +Option `allowEmptyArrays` can be used to allowing empty array values in object +```javascript +var withEmptyArrays = qs.parse('foo[]&bar=baz', { allowEmptyArrays: true }); +assert.deepEqual(withEmptyArrays, { foo: [], bar: 'baz' }); +``` + +Option `duplicates` can be used to change the behavior when duplicate keys are encountered +```javascript +assert.deepEqual(qs.parse('foo=bar&foo=baz'), { foo: ['bar', 'baz'] }); +assert.deepEqual(qs.parse('foo=bar&foo=baz', { duplicates: 'combine' }), { foo: ['bar', 'baz'] }); +assert.deepEqual(qs.parse('foo=bar&foo=baz', { duplicates: 'first' }), { foo: 'bar' }); +assert.deepEqual(qs.parse('foo=bar&foo=baz', { duplicates: 'last' }), { foo: 'baz' }); +``` + +If you have to deal with legacy browsers or services, there's also support for decoding percent-encoded octets as iso-8859-1: + +```javascript +var oldCharset = qs.parse('a=%A7', { charset: 'iso-8859-1' }); +assert.deepEqual(oldCharset, { a: '§' }); +``` + +Some services add an initial `utf8=✓` value to forms so that old Internet Explorer versions are more likely to submit the form as utf-8. +Additionally, the server can check the value against wrong encodings of the checkmark character and detect that a query string or `application/x-www-form-urlencoded` body was *not* sent as utf-8, eg. if the form had an `accept-charset` parameter or the containing page had a different character set. + +**qs** supports this mechanism via the `charsetSentinel` option. +If specified, the `utf8` parameter will be omitted from the returned object. +It will be used to switch to `iso-8859-1`/`utf-8` mode depending on how the checkmark is encoded. + +**Important**: When you specify both the `charset` option and the `charsetSentinel` option, the `charset` will be overridden when the request contains a `utf8` parameter from which the actual charset can be deduced. +In that sense the `charset` will behave as the default charset rather than the authoritative charset. + +```javascript +var detectedAsUtf8 = qs.parse('utf8=%E2%9C%93&a=%C3%B8', { + charset: 'iso-8859-1', + charsetSentinel: true +}); +assert.deepEqual(detectedAsUtf8, { a: 'ø' }); + +// Browsers encode the checkmark as ✓ when submitting as iso-8859-1: +var detectedAsIso8859_1 = qs.parse('utf8=%26%2310003%3B&a=%F8', { + charset: 'utf-8', + charsetSentinel: true +}); +assert.deepEqual(detectedAsIso8859_1, { a: 'ø' }); +``` + +If you want to decode the `&#...;` syntax to the actual character, you can specify the `interpretNumericEntities` option as well: + +```javascript +var detectedAsIso8859_1 = qs.parse('a=%26%239786%3B', { + charset: 'iso-8859-1', + interpretNumericEntities: true +}); +assert.deepEqual(detectedAsIso8859_1, { a: '☺' }); +``` + +It also works when the charset has been detected in `charsetSentinel` mode. + +### Parsing Arrays + +**qs** can also parse arrays using a similar `[]` notation: + +```javascript +var withArray = qs.parse('a[]=b&a[]=c'); +assert.deepEqual(withArray, { a: ['b', 'c'] }); +``` + +You may specify an index as well: + +```javascript +var withIndexes = qs.parse('a[1]=c&a[0]=b'); +assert.deepEqual(withIndexes, { a: ['b', 'c'] }); +``` + +Note that the only difference between an index in an array and a key in an object is that the value between the brackets must be a number to create an array. +When creating arrays with specific indices, **qs** will compact a sparse array to only the existing values preserving their order: + +```javascript +var noSparse = qs.parse('a[1]=b&a[15]=c'); +assert.deepEqual(noSparse, { a: ['b', 'c'] }); +``` + +You may also use `allowSparse` option to parse sparse arrays: + +```javascript +var sparseArray = qs.parse('a[1]=2&a[3]=5', { allowSparse: true }); +assert.deepEqual(sparseArray, { a: [, '2', , '5'] }); +``` + +Note that an empty string is also a value, and will be preserved: + +```javascript +var withEmptyString = qs.parse('a[]=&a[]=b'); +assert.deepEqual(withEmptyString, { a: ['', 'b'] }); + +var withIndexedEmptyString = qs.parse('a[0]=b&a[1]=&a[2]=c'); +assert.deepEqual(withIndexedEmptyString, { a: ['b', '', 'c'] }); +``` + +**qs** will also limit specifying indices in an array to a maximum index of `20`. +Any array members with an index of greater than `20` will instead be converted to an object with the index as the key. +This is needed to handle cases when someone sent, for example, `a[999999999]` and it will take significant time to iterate over this huge array. + +```javascript +var withMaxIndex = qs.parse('a[100]=b'); +assert.deepEqual(withMaxIndex, { a: { '100': 'b' } }); +``` + +This limit can be overridden by passing an `arrayLimit` option: + +```javascript +var withArrayLimit = qs.parse('a[1]=b', { arrayLimit: 0 }); +assert.deepEqual(withArrayLimit, { a: { '1': 'b' } }); +``` + +To disable array parsing entirely, set `parseArrays` to `false`. + +```javascript +var noParsingArrays = qs.parse('a[]=b', { parseArrays: false }); +assert.deepEqual(noParsingArrays, { a: { '0': 'b' } }); +``` + +If you mix notations, **qs** will merge the two items into an object: + +```javascript +var mixedNotation = qs.parse('a[0]=b&a[b]=c'); +assert.deepEqual(mixedNotation, { a: { '0': 'b', b: 'c' } }); +``` + +You can also create arrays of objects: + +```javascript +var arraysOfObjects = qs.parse('a[][b]=c'); +assert.deepEqual(arraysOfObjects, { a: [{ b: 'c' }] }); +``` + +Some people use comma to join array, **qs** can parse it: +```javascript +var arraysOfObjects = qs.parse('a=b,c', { comma: true }) +assert.deepEqual(arraysOfObjects, { a: ['b', 'c'] }) +``` +(_this cannot convert nested objects, such as `a={b:1},{c:d}`_) + +### Parsing primitive/scalar values (numbers, booleans, null, etc) + +By default, all values are parsed as strings. +This behavior will not change and is explained in [issue #91](https://github.com/ljharb/qs/issues/91). + +```javascript +var primitiveValues = qs.parse('a=15&b=true&c=null'); +assert.deepEqual(primitiveValues, { a: '15', b: 'true', c: 'null' }); +``` + +If you wish to auto-convert values which look like numbers, booleans, and other values into their primitive counterparts, you can use the [query-types Express JS middleware](https://github.com/xpepermint/query-types) which will auto-convert all request query parameters. + +### Stringifying + +[](#preventEval) +```javascript +qs.stringify(object, [options]); +``` + +When stringifying, **qs** by default URI encodes output. Objects are stringified as you would expect: + +```javascript +assert.equal(qs.stringify({ a: 'b' }), 'a=b'); +assert.equal(qs.stringify({ a: { b: 'c' } }), 'a%5Bb%5D=c'); +``` + +This encoding can be disabled by setting the `encode` option to `false`: + +```javascript +var unencoded = qs.stringify({ a: { b: 'c' } }, { encode: false }); +assert.equal(unencoded, 'a[b]=c'); +``` + +Encoding can be disabled for keys by setting the `encodeValuesOnly` option to `true`: +```javascript +var encodedValues = qs.stringify( + { a: 'b', c: ['d', 'e=f'], f: [['g'], ['h']] }, + { encodeValuesOnly: true } +); +assert.equal(encodedValues,'a=b&c[0]=d&c[1]=e%3Df&f[0][0]=g&f[1][0]=h'); +``` + +This encoding can also be replaced by a custom encoding method set as `encoder` option: + +```javascript +var encoded = qs.stringify({ a: { b: 'c' } }, { encoder: function (str) { + // Passed in values `a`, `b`, `c` + return // Return encoded string +}}) +``` + +_(Note: the `encoder` option does not apply if `encode` is `false`)_ + +Analogue to the `encoder` there is a `decoder` option for `parse` to override decoding of properties and values: + +```javascript +var decoded = qs.parse('x=z', { decoder: function (str) { + // Passed in values `x`, `z` + return // Return decoded string +}}) +``` + +You can encode keys and values using different logic by using the type argument provided to the encoder: + +```javascript +var encoded = qs.stringify({ a: { b: 'c' } }, { encoder: function (str, defaultEncoder, charset, type) { + if (type === 'key') { + return // Encoded key + } else if (type === 'value') { + return // Encoded value + } +}}) +``` + +The type argument is also provided to the decoder: + +```javascript +var decoded = qs.parse('x=z', { decoder: function (str, defaultDecoder, charset, type) { + if (type === 'key') { + return // Decoded key + } else if (type === 'value') { + return // Decoded value + } +}}) +``` + +Examples beyond this point will be shown as though the output is not URI encoded for clarity. +Please note that the return values in these cases *will* be URI encoded during real usage. + +When arrays are stringified, they follow the `arrayFormat` option, which defaults to `indices`: + +```javascript +qs.stringify({ a: ['b', 'c', 'd'] }); +// 'a[0]=b&a[1]=c&a[2]=d' +``` + +You may override this by setting the `indices` option to `false`, or to be more explicit, the `arrayFormat` option to `repeat`: + +```javascript +qs.stringify({ a: ['b', 'c', 'd'] }, { indices: false }); +// 'a=b&a=c&a=d' +``` + +You may use the `arrayFormat` option to specify the format of the output array: + +```javascript +qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'indices' }) +// 'a[0]=b&a[1]=c' +qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'brackets' }) +// 'a[]=b&a[]=c' +qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'repeat' }) +// 'a=b&a=c' +qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'comma' }) +// 'a=b,c' +``` + +Note: when using `arrayFormat` set to `'comma'`, you can also pass the `commaRoundTrip` option set to `true` or `false`, to append `[]` on single-item arrays, so that they can round trip through a parse. + +When objects are stringified, by default they use bracket notation: + +```javascript +qs.stringify({ a: { b: { c: 'd', e: 'f' } } }); +// 'a[b][c]=d&a[b][e]=f' +``` + +You may override this to use dot notation by setting the `allowDots` option to `true`: + +```javascript +qs.stringify({ a: { b: { c: 'd', e: 'f' } } }, { allowDots: true }); +// 'a.b.c=d&a.b.e=f' +``` + +You may encode the dot notation in the keys of object with option `encodeDotInKeys` by setting it to `true`: +Note: it implies `allowDots`, so `stringify` will error if you set `decodeDotInKeys` to `true`, and `allowDots` to `false`. +Caveat: when `encodeValuesOnly` is `true` as well as `encodeDotInKeys`, only dots in keys and nothing else will be encoded. +```javascript +qs.stringify({ "name.obj": { "first": "John", "last": "Doe" } }, { allowDots: true, encodeDotInKeys: true }) +// 'name%252Eobj.first=John&name%252Eobj.last=Doe' +``` + +You may allow empty array values by setting the `allowEmptyArrays` option to `true`: +```javascript +qs.stringify({ foo: [], bar: 'baz' }, { allowEmptyArrays: true }); +// 'foo[]&bar=baz' +``` + +Empty strings and null values will omit the value, but the equals sign (=) remains in place: + +```javascript +assert.equal(qs.stringify({ a: '' }), 'a='); +``` + +Key with no values (such as an empty object or array) will return nothing: + +```javascript +assert.equal(qs.stringify({ a: [] }), ''); +assert.equal(qs.stringify({ a: {} }), ''); +assert.equal(qs.stringify({ a: [{}] }), ''); +assert.equal(qs.stringify({ a: { b: []} }), ''); +assert.equal(qs.stringify({ a: { b: {}} }), ''); +``` + +Properties that are set to `undefined` will be omitted entirely: + +```javascript +assert.equal(qs.stringify({ a: null, b: undefined }), 'a='); +``` + +The query string may optionally be prepended with a question mark: + +```javascript +assert.equal(qs.stringify({ a: 'b', c: 'd' }, { addQueryPrefix: true }), '?a=b&c=d'); +``` + +The delimiter may be overridden with stringify as well: + +```javascript +assert.equal(qs.stringify({ a: 'b', c: 'd' }, { delimiter: ';' }), 'a=b;c=d'); +``` + +If you only want to override the serialization of `Date` objects, you can provide a `serializeDate` option: + +```javascript +var date = new Date(7); +assert.equal(qs.stringify({ a: date }), 'a=1970-01-01T00:00:00.007Z'.replace(/:/g, '%3A')); +assert.equal( + qs.stringify({ a: date }, { serializeDate: function (d) { return d.getTime(); } }), + 'a=7' +); +``` + +You may use the `sort` option to affect the order of parameter keys: + +```javascript +function alphabeticalSort(a, b) { + return a.localeCompare(b); +} +assert.equal(qs.stringify({ a: 'c', z: 'y', b : 'f' }, { sort: alphabeticalSort }), 'a=c&b=f&z=y'); +``` + +Finally, you can use the `filter` option to restrict which keys will be included in the stringified output. +If you pass a function, it will be called for each key to obtain the replacement value. +Otherwise, if you pass an array, it will be used to select properties and array indices for stringification: + +```javascript +function filterFunc(prefix, value) { + if (prefix == 'b') { + // Return an `undefined` value to omit a property. + return; + } + if (prefix == 'e[f]') { + return value.getTime(); + } + if (prefix == 'e[g][0]') { + return value * 2; + } + return value; +} +qs.stringify({ a: 'b', c: 'd', e: { f: new Date(123), g: [2] } }, { filter: filterFunc }); +// 'a=b&c=d&e[f]=123&e[g][0]=4' +qs.stringify({ a: 'b', c: 'd', e: 'f' }, { filter: ['a', 'e'] }); +// 'a=b&e=f' +qs.stringify({ a: ['b', 'c', 'd'], e: 'f' }, { filter: ['a', 0, 2] }); +// 'a[0]=b&a[2]=d' +``` + +You could also use `filter` to inject custom serialization for user defined types. +Consider you're working with some api that expects query strings of the format for ranges: + +``` +https://domain.com/endpoint?range=30...70 +``` + +For which you model as: + +```javascript +class Range { + constructor(from, to) { + this.from = from; + this.to = to; + } +} +``` + +You could _inject_ a custom serializer to handle values of this type: + +```javascript +qs.stringify( + { + range: new Range(30, 70), + }, + { + filter: (prefix, value) => { + if (value instanceof Range) { + return `${value.from}...${value.to}`; + } + // serialize the usual way + return value; + }, + } +); +// range=30...70 +``` + +### Handling of `null` values + +By default, `null` values are treated like empty strings: + +```javascript +var withNull = qs.stringify({ a: null, b: '' }); +assert.equal(withNull, 'a=&b='); +``` + +Parsing does not distinguish between parameters with and without equal signs. +Both are converted to empty strings. + +```javascript +var equalsInsensitive = qs.parse('a&b='); +assert.deepEqual(equalsInsensitive, { a: '', b: '' }); +``` + +To distinguish between `null` values and empty strings use the `strictNullHandling` flag. In the result string the `null` +values have no `=` sign: + +```javascript +var strictNull = qs.stringify({ a: null, b: '' }, { strictNullHandling: true }); +assert.equal(strictNull, 'a&b='); +``` + +To parse values without `=` back to `null` use the `strictNullHandling` flag: + +```javascript +var parsedStrictNull = qs.parse('a&b=', { strictNullHandling: true }); +assert.deepEqual(parsedStrictNull, { a: null, b: '' }); +``` + +To completely skip rendering keys with `null` values, use the `skipNulls` flag: + +```javascript +var nullsSkipped = qs.stringify({ a: 'b', c: null}, { skipNulls: true }); +assert.equal(nullsSkipped, 'a=b'); +``` + +If you're communicating with legacy systems, you can switch to `iso-8859-1` using the `charset` option: + +```javascript +var iso = qs.stringify({ æ: 'æ' }, { charset: 'iso-8859-1' }); +assert.equal(iso, '%E6=%E6'); +``` + +Characters that don't exist in `iso-8859-1` will be converted to numeric entities, similar to what browsers do: + +```javascript +var numeric = qs.stringify({ a: '☺' }, { charset: 'iso-8859-1' }); +assert.equal(numeric, 'a=%26%239786%3B'); +``` + +You can use the `charsetSentinel` option to announce the character by including an `utf8=✓` parameter with the proper encoding if the checkmark, similar to what Ruby on Rails and others do when submitting forms. + +```javascript +var sentinel = qs.stringify({ a: '☺' }, { charsetSentinel: true }); +assert.equal(sentinel, 'utf8=%E2%9C%93&a=%E2%98%BA'); + +var isoSentinel = qs.stringify({ a: 'æ' }, { charsetSentinel: true, charset: 'iso-8859-1' }); +assert.equal(isoSentinel, 'utf8=%26%2310003%3B&a=%E6'); +``` + +### Dealing with special character sets + +By default the encoding and decoding of characters is done in `utf-8`, and `iso-8859-1` support is also built in via the `charset` parameter. + +If you wish to encode querystrings to a different character set (i.e. +[Shift JIS](https://en.wikipedia.org/wiki/Shift_JIS)) you can use the +[`qs-iconv`](https://github.com/martinheidegger/qs-iconv) library: + +```javascript +var encoder = require('qs-iconv/encoder')('shift_jis'); +var shiftJISEncoded = qs.stringify({ a: 'こんにちは!' }, { encoder: encoder }); +assert.equal(shiftJISEncoded, 'a=%82%B1%82%F1%82%C9%82%BF%82%CD%81I'); +``` + +This also works for decoding of query strings: + +```javascript +var decoder = require('qs-iconv/decoder')('shift_jis'); +var obj = qs.parse('a=%82%B1%82%F1%82%C9%82%BF%82%CD%81I', { decoder: decoder }); +assert.deepEqual(obj, { a: 'こんにちは!' }); +``` + +### RFC 3986 and RFC 1738 space encoding + +RFC3986 used as default option and encodes ' ' to *%20* which is backward compatible. +In the same time, output can be stringified as per RFC1738 with ' ' equal to '+'. + +``` +assert.equal(qs.stringify({ a: 'b c' }), 'a=b%20c'); +assert.equal(qs.stringify({ a: 'b c' }, { format : 'RFC3986' }), 'a=b%20c'); +assert.equal(qs.stringify({ a: 'b c' }, { format : 'RFC1738' }), 'a=b+c'); +``` + +## Security + +Please email [@ljharb](https://github.com/ljharb) or see https://tidelift.com/security if you have a potential security vulnerability to report. + +## qs for enterprise + +Available as part of the Tidelift Subscription + +The maintainers of qs and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. +Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. +[Learn more.](https://tidelift.com/subscription/pkg/npm-qs?utm_source=npm-qs&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) + +[package-url]: https://npmjs.org/package/qs +[npm-version-svg]: https://versionbadg.es/ljharb/qs.svg +[deps-svg]: https://david-dm.org/ljharb/qs.svg +[deps-url]: https://david-dm.org/ljharb/qs +[dev-deps-svg]: https://david-dm.org/ljharb/qs/dev-status.svg +[dev-deps-url]: https://david-dm.org/ljharb/qs#info=devDependencies +[npm-badge-png]: https://nodei.co/npm/qs.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/qs.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/qs.svg +[downloads-url]: https://npm-stat.com/charts.html?package=qs +[codecov-image]: https://codecov.io/gh/ljharb/qs/branch/main/graphs/badge.svg +[codecov-url]: https://app.codecov.io/gh/ljharb/qs/ +[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/qs +[actions-url]: https://github.com/ljharb/qs/actions + +## Acknowledgements + +qs logo by [NUMI](https://github.com/numi-hq/open-design): + +[NUMI Logo](https://numi.tech/?ref=qs) diff --git a/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/dist/qs.js b/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/dist/qs.js new file mode 100644 index 000000000000..154e72e575b0 --- /dev/null +++ b/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/dist/qs.js @@ -0,0 +1,90 @@ +(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Qs = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i-1?e.split(","):e},isoSentinel="utf8=%26%2310003%3B",charsetSentinel="utf8=%E2%9C%93",parseValues=function parseQueryStringValues(e,t){var r={__proto__:null},a=t.ignoreQueryPrefix?e.replace(/^\?/,""):e;a=a.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var i,o=t.parameterLimit===1/0?void 0:t.parameterLimit,l=a.split(t.delimiter,o),s=-1,n=t.charset;if(t.charsetSentinel)for(i=0;i-1&&(c=isArray(c)?[c]:c);var y=has.call(r,p);y&&"combine"===t.duplicates?r[p]=utils.combine(r[p],c):y&&"last"!==t.duplicates||(r[p]=c)}return r},parseObject=function(e,t,r,a){for(var i=a?t:parseArrayValue(t,r),o=e.length-1;o>=0;--o){var l,s=e[o];if("[]"===s&&r.parseArrays)l=r.allowEmptyArrays&&(""===i||r.strictNullHandling&&null===i)?[]:[].concat(i);else{l=r.plainObjects?Object.create(null):{};var n="["===s.charAt(0)&&"]"===s.charAt(s.length-1)?s.slice(1,-1):s,p=r.decodeDotInKeys?n.replace(/%2E/g,"."):n,c=parseInt(p,10);r.parseArrays||""!==p?!isNaN(c)&&s!==p&&String(c)===p&&c>=0&&r.parseArrays&&c<=r.arrayLimit?(l=[])[c]=i:"__proto__"!==p&&(l[p]=i):l={0:i}}i=l}return i},parseKeys=function parseQueryStringKeys(e,t,r,a){if(e){var i=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,o=/(\[[^[\]]*])/g,l=r.depth>0&&/(\[[^[\]]*])/.exec(i),s=l?i.slice(0,l.index):i,n=[];if(s){if(!r.plainObjects&&has.call(Object.prototype,s)&&!r.allowPrototypes)return;n.push(s)}for(var p=0;r.depth>0&&null!==(l=o.exec(i))&&p0?w.join(",")||null:void 0}];else if(isArray(f))E=f;else{var S=Object.keys(w);E=u?S.sort(u):S}var O=l?r.replace(/\./g,"%2E"):r,T=o&&isArray(w)&&1===w.length?O+"[]":O;if(a&&isArray(w)&&0===w.length)return T+"[]";for(var k=0;k0?y+d:""}; + +},{"1":1,"29":29,"5":5}],5:[function(require,module,exports){ +"use strict";var formats=require(1),has=Object.prototype.hasOwnProperty,isArray=Array.isArray,hexTable=function(){for(var e=[],r=0;r<256;++r)e.push("%"+((r<16?"0":"")+r.toString(16)).toUpperCase());return e}(),compactQueue=function compactQueue(e){for(;e.length>1;){var r=e.pop(),t=r.obj[r.prop];if(isArray(t)){for(var o=[],n=0;n=limit?a.slice(i,i+limit):a,p=[],s=0;s=48&&f<=57||f>=65&&f<=90||f>=97&&f<=122||n===formats.RFC1738&&(40===f||41===f)?p[p.length]=u.charAt(s):f<128?p[p.length]=hexTable[f]:f<2048?p[p.length]=hexTable[192|f>>6]+hexTable[128|63&f]:f<55296||f>=57344?p[p.length]=hexTable[224|f>>12]+hexTable[128|f>>6&63]+hexTable[128|63&f]:(s+=1,f=65536+((1023&f)<<10|1023&u.charCodeAt(s)),p[p.length]=hexTable[240|f>>18]+hexTable[128|f>>12&63]+hexTable[128|f>>6&63]+hexTable[128|63&f])}c+=p.join("")}return c},compact=function compact(e){for(var r=[{obj:{o:e},prop:"o"}],t=[],o=0;o-1?callBind(t):t}; + +},{"20":20,"8":8}],20:[function(require,module,exports){ +"use strict";var undefined,$Error=require(12),$EvalError=require(11),$RangeError=require(13),$ReferenceError=require(14),$SyntaxError=require(15),$TypeError=require(16),$URIError=require(17),$Function=Function,getEvalledConstructor=function(r){try{return $Function('"use strict"; return ('+r+").constructor;")()}catch(r){}},$gOPD=Object.getOwnPropertyDescriptor;if($gOPD)try{$gOPD({},"")}catch(r){$gOPD=null}var throwTypeError=function(){throw new $TypeError},ThrowTypeError=$gOPD?function(){try{return throwTypeError}catch(r){try{return $gOPD(arguments,"callee").get}catch(r){return throwTypeError}}}():throwTypeError,hasSymbols=require(24)(),hasProto=require(23)(),getProto=Object.getPrototypeOf||(hasProto?function(r){return r.__proto__}:null),needsEval={},TypedArray="undefined"!=typeof Uint8Array&&getProto?getProto(Uint8Array):undefined,INTRINSICS={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?undefined:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?undefined:ArrayBuffer,"%ArrayIteratorPrototype%":hasSymbols&&getProto?getProto([][Symbol.iterator]()):undefined,"%AsyncFromSyncIteratorPrototype%":undefined,"%AsyncFunction%":needsEval,"%AsyncGenerator%":needsEval,"%AsyncGeneratorFunction%":needsEval,"%AsyncIteratorPrototype%":needsEval,"%Atomics%":"undefined"==typeof Atomics?undefined:Atomics,"%BigInt%":"undefined"==typeof BigInt?undefined:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?undefined:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?undefined:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?undefined:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":$Error,"%eval%":eval,"%EvalError%":$EvalError,"%Float32Array%":"undefined"==typeof Float32Array?undefined:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?undefined:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?undefined:FinalizationRegistry,"%Function%":$Function,"%GeneratorFunction%":needsEval,"%Int8Array%":"undefined"==typeof Int8Array?undefined:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?undefined:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?undefined:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":hasSymbols&&getProto?getProto(getProto([][Symbol.iterator]())):undefined,"%JSON%":"object"==typeof JSON?JSON:undefined,"%Map%":"undefined"==typeof Map?undefined:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&hasSymbols&&getProto?getProto((new Map)[Symbol.iterator]()):undefined,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?undefined:Promise,"%Proxy%":"undefined"==typeof Proxy?undefined:Proxy,"%RangeError%":$RangeError,"%ReferenceError%":$ReferenceError,"%Reflect%":"undefined"==typeof Reflect?undefined:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?undefined:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&hasSymbols&&getProto?getProto((new Set)[Symbol.iterator]()):undefined,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?undefined:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":hasSymbols&&getProto?getProto(""[Symbol.iterator]()):undefined,"%Symbol%":hasSymbols?Symbol:undefined,"%SyntaxError%":$SyntaxError,"%ThrowTypeError%":ThrowTypeError,"%TypedArray%":TypedArray,"%TypeError%":$TypeError,"%Uint8Array%":"undefined"==typeof Uint8Array?undefined:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?undefined:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?undefined:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?undefined:Uint32Array,"%URIError%":$URIError,"%WeakMap%":"undefined"==typeof WeakMap?undefined:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?undefined:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?undefined:WeakSet};if(getProto)try{null.error}catch(r){var errorProto=getProto(getProto(r));INTRINSICS["%Error.prototype%"]=errorProto}var doEval=function doEval(r){var e;if("%AsyncFunction%"===r)e=getEvalledConstructor("async function () {}");else if("%GeneratorFunction%"===r)e=getEvalledConstructor("function* () {}");else if("%AsyncGeneratorFunction%"===r)e=getEvalledConstructor("async function* () {}");else if("%AsyncGenerator%"===r){var t=doEval("%AsyncGeneratorFunction%");t&&(e=t.prototype)}else if("%AsyncIteratorPrototype%"===r){var o=doEval("%AsyncGenerator%");o&&getProto&&(e=getProto(o.prototype))}return INTRINSICS[r]=e,e},LEGACY_ALIASES={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},bind=require(19),hasOwn=require(26),$concat=bind.call(Function.call,Array.prototype.concat),$spliceApply=bind.call(Function.apply,Array.prototype.splice),$replace=bind.call(Function.call,String.prototype.replace),$strSlice=bind.call(Function.call,String.prototype.slice),$exec=bind.call(Function.call,RegExp.prototype.exec),rePropName=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,reEscapeChar=/\\(\\)?/g,stringToPath=function stringToPath(r){var e=$strSlice(r,0,1),t=$strSlice(r,-1);if("%"===e&&"%"!==t)throw new $SyntaxError("invalid intrinsic syntax, expected closing `%`");if("%"===t&&"%"!==e)throw new $SyntaxError("invalid intrinsic syntax, expected opening `%`");var o=[];return $replace(r,rePropName,(function(r,e,t,n){o[o.length]=t?$replace(n,reEscapeChar,"$1"):e||r})),o},getBaseIntrinsic=function getBaseIntrinsic(r,e){var t,o=r;if(hasOwn(LEGACY_ALIASES,o)&&(o="%"+(t=LEGACY_ALIASES[o])[0]+"%"),hasOwn(INTRINSICS,o)){var n=INTRINSICS[o];if(n===needsEval&&(n=doEval(o)),void 0===n&&!e)throw new $TypeError("intrinsic "+r+" exists, but is not available. Please file an issue!");return{alias:t,name:o,value:n}}throw new $SyntaxError("intrinsic "+r+" does not exist!")};module.exports=function GetIntrinsic(r,e){if("string"!=typeof r||0===r.length)throw new $TypeError("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new $TypeError('"allowMissing" argument must be a boolean');if(null===$exec(/^%?[^%]*%?$/,r))throw new $SyntaxError("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var t=stringToPath(r),o=t.length>0?t[0]:"",n=getBaseIntrinsic("%"+o+"%",e),a=n.name,y=n.value,i=!1,p=n.alias;p&&(o=p[0],$spliceApply(t,$concat([0,1],p)));for(var d=1,s=!0;d=t.length){var c=$gOPD(y,f);y=(s=!!c)&&"get"in c&&!("originalValue"in c.get)?c.get:y[f]}else s=hasOwn(y,f),y=y[f];s&&!i&&(INTRINSICS[a]=y)}}return y}; + +},{"11":11,"12":12,"13":13,"14":14,"15":15,"16":16,"17":17,"19":19,"23":23,"24":24,"26":26}],8:[function(require,module,exports){ +"use strict";var bind=require(19),GetIntrinsic=require(20),setFunctionLength=require(28),$TypeError=require(16),$apply=GetIntrinsic("%Function.prototype.apply%"),$call=GetIntrinsic("%Function.prototype.call%"),$reflectApply=GetIntrinsic("%Reflect.apply%",!0)||bind.call($call,$apply),$defineProperty=require(10),$max=GetIntrinsic("%Math.max%");module.exports=function callBind(e){if("function"!=typeof e)throw new $TypeError("a function is required");var n=$reflectApply(bind,$call,arguments);return setFunctionLength(n,1+$max(0,e.length-(arguments.length-1)),!0)};var applyBind=function applyBind(){return $reflectApply(bind,$apply,arguments)};$defineProperty?$defineProperty(module.exports,"apply",{value:applyBind}):module.exports.apply=applyBind; + +},{"10":10,"16":16,"19":19,"20":20,"28":28}],16:[function(require,module,exports){ +"use strict";module.exports=TypeError; + +},{}],19:[function(require,module,exports){ +"use strict";var implementation=require(18);module.exports=Function.prototype.bind||implementation; + +},{"18":18}],10:[function(require,module,exports){ +"use strict";var GetIntrinsic=require(20),$defineProperty=GetIntrinsic("%Object.defineProperty%",!0)||!1;if($defineProperty)try{$defineProperty({},"a",{value:1})}catch(e){$defineProperty=!1}module.exports=$defineProperty; + +},{"20":20}],28:[function(require,module,exports){ +"use strict";var GetIntrinsic=require(20),define=require(9),hasDescriptors=require(22)(),gOPD=require(21),$TypeError=require(16),$floor=GetIntrinsic("%Math.floor%");module.exports=function setFunctionLength(e,r){if("function"!=typeof e)throw new $TypeError("`fn` is not a function");if("number"!=typeof r||r<0||r>4294967295||$floor(r)!==r)throw new $TypeError("`length` must be a positive 32-bit integer");var t=arguments.length>2&&!!arguments[2],i=!0,n=!0;if("length"in e&&gOPD){var o=gOPD(e,"length");o&&!o.configurable&&(i=!1),o&&!o.writable&&(n=!1)}return(i||n||!t)&&(hasDescriptors?define(e,"length",r,!0,!0):define(e,"length",r)),e}; + +},{"16":16,"20":20,"21":21,"22":22,"9":9}],9:[function(require,module,exports){ +"use strict";var $defineProperty=require(10),$SyntaxError=require(15),$TypeError=require(16),gopd=require(21);module.exports=function defineDataProperty(e,r,o){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new $TypeError("`obj` must be an object or a function`");if("string"!=typeof r&&"symbol"!=typeof r)throw new $TypeError("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new $TypeError("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new $TypeError("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new $TypeError("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new $TypeError("`loose`, if provided, must be a boolean");var n=arguments.length>3?arguments[3]:null,l=arguments.length>4?arguments[4]:null,t=arguments.length>5?arguments[5]:null,i=arguments.length>6&&arguments[6],a=!!gopd&&gopd(e,r);if($defineProperty)$defineProperty(e,r,{configurable:null===t&&a?a.configurable:!t,enumerable:null===n&&a?a.enumerable:!n,value:o,writable:null===l&&a?a.writable:!l});else{if(!i&&(n||l||t))throw new $SyntaxError("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");e[r]=o}}; + +},{"10":10,"15":15,"16":16,"21":21}],15:[function(require,module,exports){ +"use strict";module.exports=SyntaxError; + +},{}],21:[function(require,module,exports){ +"use strict";var GetIntrinsic=require(20),$gOPD=GetIntrinsic("%Object.getOwnPropertyDescriptor%",!0);if($gOPD)try{$gOPD([],"length")}catch(t){$gOPD=null}module.exports=$gOPD; + +},{"20":20}],11:[function(require,module,exports){ +"use strict";module.exports=EvalError; + +},{}],12:[function(require,module,exports){ +"use strict";module.exports=Error; + +},{}],13:[function(require,module,exports){ +"use strict";module.exports=RangeError; + +},{}],14:[function(require,module,exports){ +"use strict";module.exports=ReferenceError; + +},{}],17:[function(require,module,exports){ +"use strict";module.exports=URIError; + +},{}],18:[function(require,module,exports){ +"use strict";var ERROR_MESSAGE="Function.prototype.bind called on incompatible ",toStr=Object.prototype.toString,max=Math.max,funcType="[object Function]",concatty=function concatty(t,n){for(var r=[],o=0;o-1e3&&t<1e3||$test.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof t){var n=t<0?-$floor(-t):$floor(t);if(n!==t){var o=String(n),i=$slice.call(e,o.length+1);return $replace.call(o,r,"$&_")+"."+$replace.call($replace.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return $replace.call(e,r,"$&_")}var utilInspect=require(6),inspectCustom=utilInspect.custom,inspectSymbol=isSymbol(inspectCustom)?inspectCustom:null;function wrapQuotes(t,e,r){var n="double"===(r.quoteStyle||e)?'"':"'";return n+t+n}function quote(t){return $replace.call(String(t),/"/g,""")}function isArray(t){return!("[object Array]"!==toStr(t)||toStringTag&&"object"==typeof t&&toStringTag in t)}function isDate(t){return!("[object Date]"!==toStr(t)||toStringTag&&"object"==typeof t&&toStringTag in t)}function isRegExp(t){return!("[object RegExp]"!==toStr(t)||toStringTag&&"object"==typeof t&&toStringTag in t)}function isError(t){return!("[object Error]"!==toStr(t)||toStringTag&&"object"==typeof t&&toStringTag in t)}function isString(t){return!("[object String]"!==toStr(t)||toStringTag&&"object"==typeof t&&toStringTag in t)}function isNumber(t){return!("[object Number]"!==toStr(t)||toStringTag&&"object"==typeof t&&toStringTag in t)}function isBoolean(t){return!("[object Boolean]"!==toStr(t)||toStringTag&&"object"==typeof t&&toStringTag in t)}function isSymbol(t){if(hasShammedSymbols)return t&&"object"==typeof t&&t instanceof Symbol;if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||!symToString)return!1;try{return symToString.call(t),!0}catch(t){}return!1}function isBigInt(t){if(!t||"object"!=typeof t||!bigIntValueOf)return!1;try{return bigIntValueOf.call(t),!0}catch(t){}return!1}module.exports=function inspect_(t,e,r,n){var o=e||{};if(has(o,"quoteStyle")&&"single"!==o.quoteStyle&&"double"!==o.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(has(o,"maxStringLength")&&("number"==typeof o.maxStringLength?o.maxStringLength<0&&o.maxStringLength!==1/0:null!==o.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var i=!has(o,"customInspect")||o.customInspect;if("boolean"!=typeof i&&"symbol"!==i)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(has(o,"indent")&&null!==o.indent&&"\t"!==o.indent&&!(parseInt(o.indent,10)===o.indent&&o.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(has(o,"numericSeparator")&&"boolean"!=typeof o.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var a=o.numericSeparator;if(void 0===t)return"undefined";if(null===t)return"null";if("boolean"==typeof t)return t?"true":"false";if("string"==typeof t)return inspectString(t,o);if("number"==typeof t){if(0===t)return 1/0/t>0?"0":"-0";var c=String(t);return a?addNumericSeparator(t,c):c}if("bigint"==typeof t){var l=String(t)+"n";return a?addNumericSeparator(t,l):l}var p=void 0===o.depth?5:o.depth;if(void 0===r&&(r=0),r>=p&&p>0&&"object"==typeof t)return isArray(t)?"[Array]":"[Object]";var u=getIndent(o,r);if(void 0===n)n=[];else if(indexOf(n,t)>=0)return"[Circular]";function inspect(t,e,i){if(e&&(n=$arrSlice.call(n)).push(e),i){var a={depth:o.depth};return has(o,"quoteStyle")&&(a.quoteStyle=o.quoteStyle),inspect_(t,a,r+1,n)}return inspect_(t,o,r+1,n)}if("function"==typeof t&&!isRegExp(t)){var f=nameOf(t),s=arrObjKeys(t,inspect);return"[Function"+(f?": "+f:" (anonymous)")+"]"+(s.length>0?" { "+$join.call(s,", ")+" }":"")}if(isSymbol(t)){var y=hasShammedSymbols?$replace.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):symToString.call(t);return"object"!=typeof t||hasShammedSymbols?y:markBoxed(y)}if(isElement(t)){for(var S="<"+$toLowerCase.call(String(t.nodeName)),g=t.attributes||[],b=0;b"}if(isArray(t)){if(0===t.length)return"[]";var m=arrObjKeys(t,inspect);return u&&!singleLineValues(m)?"["+indentedJoin(m,u)+"]":"[ "+$join.call(m,", ")+" ]"}if(isError(t)){var h=arrObjKeys(t,inspect);return"cause"in Error.prototype||!("cause"in t)||isEnumerable.call(t,"cause")?0===h.length?"["+String(t)+"]":"{ ["+String(t)+"] "+$join.call(h,", ")+" }":"{ ["+String(t)+"] "+$join.call($concat.call("[cause]: "+inspect(t.cause),h),", ")+" }"}if("object"==typeof t&&i){if(inspectSymbol&&"function"==typeof t[inspectSymbol]&&utilInspect)return utilInspect(t,{depth:p-r});if("symbol"!==i&&"function"==typeof t.inspect)return t.inspect()}if(isMap(t)){var d=[];return mapForEach&&mapForEach.call(t,(function(e,r){d.push(inspect(r,t,!0)+" => "+inspect(e,t))})),collectionOf("Map",mapSize.call(t),d,u)}if(isSet(t)){var j=[];return setForEach&&setForEach.call(t,(function(e){j.push(inspect(e,t))})),collectionOf("Set",setSize.call(t),j,u)}if(isWeakMap(t))return weakCollectionOf("WeakMap");if(isWeakSet(t))return weakCollectionOf("WeakSet");if(isWeakRef(t))return weakCollectionOf("WeakRef");if(isNumber(t))return markBoxed(inspect(Number(t)));if(isBigInt(t))return markBoxed(inspect(bigIntValueOf.call(t)));if(isBoolean(t))return markBoxed(booleanValueOf.call(t));if(isString(t))return markBoxed(inspect(String(t)));if("undefined"!=typeof window&&t===window)return"{ [object Window] }";if("undefined"!=typeof globalThis&&t===globalThis||"undefined"!=typeof global&&t===global)return"{ [object globalThis] }";if(!isDate(t)&&!isRegExp(t)){var O=arrObjKeys(t,inspect),w=gPO?gPO(t)===Object.prototype:t instanceof Object||t.constructor===Object,$=t instanceof Object?"":"null prototype",k=!w&&toStringTag&&Object(t)===t&&toStringTag in t?$slice.call(toStr(t),8,-1):$?"Object":"",v=(w||"function"!=typeof t.constructor?"":t.constructor.name?t.constructor.name+" ":"")+(k||$?"["+$join.call($concat.call([],k||[],$||[]),": ")+"] ":"");return 0===O.length?v+"{}":u?v+"{"+indentedJoin(O,u)+"}":v+"{ "+$join.call(O,", ")+" }"}return String(t)};var hasOwn=Object.prototype.hasOwnProperty||function(t){return t in this};function has(t,e){return hasOwn.call(t,e)}function toStr(t){return objectToString.call(t)}function nameOf(t){if(t.name)return t.name;var e=$match.call(functionToString.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}function indexOf(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;re.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return inspectString($slice.call(t,0,e.maxStringLength),e)+n}return wrapQuotes($replace.call($replace.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,lowbyte),"single",e)}function lowbyte(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+$toUpperCase.call(e.toString(16))}function markBoxed(t){return"Object("+t+")"}function weakCollectionOf(t){return t+" { ? }"}function collectionOf(t,e,r,n){return t+" ("+e+") {"+(n?indentedJoin(r,n):$join.call(r,", "))+"}"}function singleLineValues(t){for(var e=0;e=0)return!1;return!0}function getIndent(t,e){var r;if("\t"===t.indent)r="\t";else{if(!("number"==typeof t.indent&&t.indent>0))return null;r=$join.call(Array(t.indent+1)," ")}return{base:r,prev:$join.call(Array(e+1),r)}}function indentedJoin(t,e){if(0===t.length)return"";var r="\n"+e.prev+e.base;return r+$join.call(t,","+r)+"\n"+e.prev}function arrObjKeys(t,e){var r=isArray(t),n=[];if(r){n.length=t.length;for(var o=0;o -1) { + return val.split(','); + } + + return val; +}; + +// This is what browsers will submit when the ✓ character occurs in an +// application/x-www-form-urlencoded body and the encoding of the page containing +// the form is iso-8859-1, or when the submitted form has an accept-charset +// attribute of iso-8859-1. Presumably also with other charsets that do not contain +// the ✓ character, such as us-ascii. +var isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('✓') + +// These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded. +var charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓') + +var parseValues = function parseQueryStringValues(str, options) { + var obj = { __proto__: null }; + + var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str; + cleanStr = cleanStr.replace(/%5B/gi, '[').replace(/%5D/gi, ']'); + var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit; + var parts = cleanStr.split(options.delimiter, limit); + var skipIndex = -1; // Keep track of where the utf8 sentinel was found + var i; + + var charset = options.charset; + if (options.charsetSentinel) { + for (i = 0; i < parts.length; ++i) { + if (parts[i].indexOf('utf8=') === 0) { + if (parts[i] === charsetSentinel) { + charset = 'utf-8'; + } else if (parts[i] === isoSentinel) { + charset = 'iso-8859-1'; + } + skipIndex = i; + i = parts.length; // The eslint settings do not allow break; + } + } + } + + for (i = 0; i < parts.length; ++i) { + if (i === skipIndex) { + continue; + } + var part = parts[i]; + + var bracketEqualsPos = part.indexOf(']='); + var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1; + + var key, val; + if (pos === -1) { + key = options.decoder(part, defaults.decoder, charset, 'key'); + val = options.strictNullHandling ? null : ''; + } else { + key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key'); + val = utils.maybeMap( + parseArrayValue(part.slice(pos + 1), options), + function (encodedVal) { + return options.decoder(encodedVal, defaults.decoder, charset, 'value'); + } + ); + } + + if (val && options.interpretNumericEntities && charset === 'iso-8859-1') { + val = interpretNumericEntities(val); + } + + if (part.indexOf('[]=') > -1) { + val = isArray(val) ? [val] : val; + } + + var existing = has.call(obj, key); + if (existing && options.duplicates === 'combine') { + obj[key] = utils.combine(obj[key], val); + } else if (!existing || options.duplicates === 'last') { + obj[key] = val; + } + } + + return obj; +}; + +var parseObject = function (chain, val, options, valuesParsed) { + var leaf = valuesParsed ? val : parseArrayValue(val, options); + + for (var i = chain.length - 1; i >= 0; --i) { + var obj; + var root = chain[i]; + + if (root === '[]' && options.parseArrays) { + obj = options.allowEmptyArrays && (leaf === '' || (options.strictNullHandling && leaf === null)) + ? [] + : [].concat(leaf); + } else { + obj = options.plainObjects ? Object.create(null) : {}; + var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root; + var decodedRoot = options.decodeDotInKeys ? cleanRoot.replace(/%2E/g, '.') : cleanRoot; + var index = parseInt(decodedRoot, 10); + if (!options.parseArrays && decodedRoot === '') { + obj = { 0: leaf }; + } else if ( + !isNaN(index) + && root !== decodedRoot + && String(index) === decodedRoot + && index >= 0 + && (options.parseArrays && index <= options.arrayLimit) + ) { + obj = []; + obj[index] = leaf; + } else if (decodedRoot !== '__proto__') { + obj[decodedRoot] = leaf; + } + } + + leaf = obj; + } + + return leaf; +}; + +var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) { + if (!givenKey) { + return; + } + + // Transform dot notation to bracket notation + var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey; + + // The regex chunks + + var brackets = /(\[[^[\]]*])/; + var child = /(\[[^[\]]*])/g; + + // Get the parent + + var segment = options.depth > 0 && brackets.exec(key); + var parent = segment ? key.slice(0, segment.index) : key; + + // Stash the parent if it exists + + var keys = []; + if (parent) { + // If we aren't using plain objects, optionally prefix keys that would overwrite object prototype properties + if (!options.plainObjects && has.call(Object.prototype, parent)) { + if (!options.allowPrototypes) { + return; + } + } + + keys.push(parent); + } + + // Loop through children appending to the array until we hit depth + + var i = 0; + while (options.depth > 0 && (segment = child.exec(key)) !== null && i < options.depth) { + i += 1; + if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) { + if (!options.allowPrototypes) { + return; + } + } + keys.push(segment[1]); + } + + // If there's a remainder, check strictDepth option for throw, else just add whatever is left + + if (segment) { + if (options.strictDepth === true) { + throw new RangeError('Input depth exceeded depth option of ' + options.depth + ' and strictDepth is true'); + } + keys.push('[' + key.slice(segment.index) + ']'); + } + + return parseObject(keys, val, options, valuesParsed); +}; + +var normalizeParseOptions = function normalizeParseOptions(opts) { + if (!opts) { + return defaults; + } + + if (typeof opts.allowEmptyArrays !== 'undefined' && typeof opts.allowEmptyArrays !== 'boolean') { + throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided'); + } + + if (typeof opts.decodeDotInKeys !== 'undefined' && typeof opts.decodeDotInKeys !== 'boolean') { + throw new TypeError('`decodeDotInKeys` option can only be `true` or `false`, when provided'); + } + + if (opts.decoder !== null && typeof opts.decoder !== 'undefined' && typeof opts.decoder !== 'function') { + throw new TypeError('Decoder has to be a function.'); + } + + if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') { + throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined'); + } + var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset; + + var duplicates = typeof opts.duplicates === 'undefined' ? defaults.duplicates : opts.duplicates; + + if (duplicates !== 'combine' && duplicates !== 'first' && duplicates !== 'last') { + throw new TypeError('The duplicates option must be either combine, first, or last'); + } + + var allowDots = typeof opts.allowDots === 'undefined' ? opts.decodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots; + + return { + allowDots: allowDots, + allowEmptyArrays: typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays, + allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes, + allowSparse: typeof opts.allowSparse === 'boolean' ? opts.allowSparse : defaults.allowSparse, + arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit, + charset: charset, + charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel, + comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma, + decodeDotInKeys: typeof opts.decodeDotInKeys === 'boolean' ? opts.decodeDotInKeys : defaults.decodeDotInKeys, + decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder, + delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter, + // eslint-disable-next-line no-implicit-coercion, no-extra-parens + depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults.depth, + duplicates: duplicates, + ignoreQueryPrefix: opts.ignoreQueryPrefix === true, + interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities, + parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit, + parseArrays: opts.parseArrays !== false, + plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects, + strictDepth: typeof opts.strictDepth === 'boolean' ? !!opts.strictDepth : defaults.strictDepth, + strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling + }; +}; + +module.exports = function (str, opts) { + var options = normalizeParseOptions(opts); + + if (str === '' || str === null || typeof str === 'undefined') { + return options.plainObjects ? Object.create(null) : {}; + } + + var tempObj = typeof str === 'string' ? parseValues(str, options) : str; + var obj = options.plainObjects ? Object.create(null) : {}; + + // Iterate over the keys and setup the new object + + var keys = Object.keys(tempObj); + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + var newObj = parseKeys(key, tempObj[key], options, typeof str === 'string'); + obj = utils.merge(obj, newObj, options); + } + + if (options.allowSparse === true) { + return obj; + } + + return utils.compact(obj); +}; diff --git a/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/lib/stringify.js b/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/lib/stringify.js new file mode 100644 index 000000000000..9b934d69b7f7 --- /dev/null +++ b/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/lib/stringify.js @@ -0,0 +1,351 @@ +'use strict'; + +var getSideChannel = require('side-channel'); +var utils = require('./utils'); +var formats = require('./formats'); +var has = Object.prototype.hasOwnProperty; + +var arrayPrefixGenerators = { + brackets: function brackets(prefix) { + return prefix + '[]'; + }, + comma: 'comma', + indices: function indices(prefix, key) { + return prefix + '[' + key + ']'; + }, + repeat: function repeat(prefix) { + return prefix; + } +}; + +var isArray = Array.isArray; +var push = Array.prototype.push; +var pushToArray = function (arr, valueOrArray) { + push.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]); +}; + +var toISO = Date.prototype.toISOString; + +var defaultFormat = formats['default']; +var defaults = { + addQueryPrefix: false, + allowDots: false, + allowEmptyArrays: false, + arrayFormat: 'indices', + charset: 'utf-8', + charsetSentinel: false, + delimiter: '&', + encode: true, + encodeDotInKeys: false, + encoder: utils.encode, + encodeValuesOnly: false, + format: defaultFormat, + formatter: formats.formatters[defaultFormat], + // deprecated + indices: false, + serializeDate: function serializeDate(date) { + return toISO.call(date); + }, + skipNulls: false, + strictNullHandling: false +}; + +var isNonNullishPrimitive = function isNonNullishPrimitive(v) { + return typeof v === 'string' + || typeof v === 'number' + || typeof v === 'boolean' + || typeof v === 'symbol' + || typeof v === 'bigint'; +}; + +var sentinel = {}; + +var stringify = function stringify( + object, + prefix, + generateArrayPrefix, + commaRoundTrip, + allowEmptyArrays, + strictNullHandling, + skipNulls, + encodeDotInKeys, + encoder, + filter, + sort, + allowDots, + serializeDate, + format, + formatter, + encodeValuesOnly, + charset, + sideChannel +) { + var obj = object; + + var tmpSc = sideChannel; + var step = 0; + var findFlag = false; + while ((tmpSc = tmpSc.get(sentinel)) !== void undefined && !findFlag) { + // Where object last appeared in the ref tree + var pos = tmpSc.get(object); + step += 1; + if (typeof pos !== 'undefined') { + if (pos === step) { + throw new RangeError('Cyclic object value'); + } else { + findFlag = true; // Break while + } + } + if (typeof tmpSc.get(sentinel) === 'undefined') { + step = 0; + } + } + + if (typeof filter === 'function') { + obj = filter(prefix, obj); + } else if (obj instanceof Date) { + obj = serializeDate(obj); + } else if (generateArrayPrefix === 'comma' && isArray(obj)) { + obj = utils.maybeMap(obj, function (value) { + if (value instanceof Date) { + return serializeDate(value); + } + return value; + }); + } + + if (obj === null) { + if (strictNullHandling) { + return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder, charset, 'key', format) : prefix; + } + + obj = ''; + } + + if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) { + if (encoder) { + var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset, 'key', format); + return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder, charset, 'value', format))]; + } + return [formatter(prefix) + '=' + formatter(String(obj))]; + } + + var values = []; + + if (typeof obj === 'undefined') { + return values; + } + + var objKeys; + if (generateArrayPrefix === 'comma' && isArray(obj)) { + // we need to join elements in + if (encodeValuesOnly && encoder) { + obj = utils.maybeMap(obj, encoder); + } + objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : void undefined }]; + } else if (isArray(filter)) { + objKeys = filter; + } else { + var keys = Object.keys(obj); + objKeys = sort ? keys.sort(sort) : keys; + } + + var encodedPrefix = encodeDotInKeys ? prefix.replace(/\./g, '%2E') : prefix; + + var adjustedPrefix = commaRoundTrip && isArray(obj) && obj.length === 1 ? encodedPrefix + '[]' : encodedPrefix; + + if (allowEmptyArrays && isArray(obj) && obj.length === 0) { + return adjustedPrefix + '[]'; + } + + for (var j = 0; j < objKeys.length; ++j) { + var key = objKeys[j]; + var value = typeof key === 'object' && typeof key.value !== 'undefined' ? key.value : obj[key]; + + if (skipNulls && value === null) { + continue; + } + + var encodedKey = allowDots && encodeDotInKeys ? key.replace(/\./g, '%2E') : key; + var keyPrefix = isArray(obj) + ? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(adjustedPrefix, encodedKey) : adjustedPrefix + : adjustedPrefix + (allowDots ? '.' + encodedKey : '[' + encodedKey + ']'); + + sideChannel.set(object, step); + var valueSideChannel = getSideChannel(); + valueSideChannel.set(sentinel, sideChannel); + pushToArray(values, stringify( + value, + keyPrefix, + generateArrayPrefix, + commaRoundTrip, + allowEmptyArrays, + strictNullHandling, + skipNulls, + encodeDotInKeys, + generateArrayPrefix === 'comma' && encodeValuesOnly && isArray(obj) ? null : encoder, + filter, + sort, + allowDots, + serializeDate, + format, + formatter, + encodeValuesOnly, + charset, + valueSideChannel + )); + } + + return values; +}; + +var normalizeStringifyOptions = function normalizeStringifyOptions(opts) { + if (!opts) { + return defaults; + } + + if (typeof opts.allowEmptyArrays !== 'undefined' && typeof opts.allowEmptyArrays !== 'boolean') { + throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided'); + } + + if (typeof opts.encodeDotInKeys !== 'undefined' && typeof opts.encodeDotInKeys !== 'boolean') { + throw new TypeError('`encodeDotInKeys` option can only be `true` or `false`, when provided'); + } + + if (opts.encoder !== null && typeof opts.encoder !== 'undefined' && typeof opts.encoder !== 'function') { + throw new TypeError('Encoder has to be a function.'); + } + + var charset = opts.charset || defaults.charset; + if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') { + throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined'); + } + + var format = formats['default']; + if (typeof opts.format !== 'undefined') { + if (!has.call(formats.formatters, opts.format)) { + throw new TypeError('Unknown format option provided.'); + } + format = opts.format; + } + var formatter = formats.formatters[format]; + + var filter = defaults.filter; + if (typeof opts.filter === 'function' || isArray(opts.filter)) { + filter = opts.filter; + } + + var arrayFormat; + if (opts.arrayFormat in arrayPrefixGenerators) { + arrayFormat = opts.arrayFormat; + } else if ('indices' in opts) { + arrayFormat = opts.indices ? 'indices' : 'repeat'; + } else { + arrayFormat = defaults.arrayFormat; + } + + if ('commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') { + throw new TypeError('`commaRoundTrip` must be a boolean, or absent'); + } + + var allowDots = typeof opts.allowDots === 'undefined' ? opts.encodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots; + + return { + addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults.addQueryPrefix, + allowDots: allowDots, + allowEmptyArrays: typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays, + arrayFormat: arrayFormat, + charset: charset, + charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel, + commaRoundTrip: opts.commaRoundTrip, + delimiter: typeof opts.delimiter === 'undefined' ? defaults.delimiter : opts.delimiter, + encode: typeof opts.encode === 'boolean' ? opts.encode : defaults.encode, + encodeDotInKeys: typeof opts.encodeDotInKeys === 'boolean' ? opts.encodeDotInKeys : defaults.encodeDotInKeys, + encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults.encoder, + encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults.encodeValuesOnly, + filter: filter, + format: format, + formatter: formatter, + serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults.serializeDate, + skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults.skipNulls, + sort: typeof opts.sort === 'function' ? opts.sort : null, + strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling + }; +}; + +module.exports = function (object, opts) { + var obj = object; + var options = normalizeStringifyOptions(opts); + + var objKeys; + var filter; + + if (typeof options.filter === 'function') { + filter = options.filter; + obj = filter('', obj); + } else if (isArray(options.filter)) { + filter = options.filter; + objKeys = filter; + } + + var keys = []; + + if (typeof obj !== 'object' || obj === null) { + return ''; + } + + var generateArrayPrefix = arrayPrefixGenerators[options.arrayFormat]; + var commaRoundTrip = generateArrayPrefix === 'comma' && options.commaRoundTrip; + + if (!objKeys) { + objKeys = Object.keys(obj); + } + + if (options.sort) { + objKeys.sort(options.sort); + } + + var sideChannel = getSideChannel(); + for (var i = 0; i < objKeys.length; ++i) { + var key = objKeys[i]; + + if (options.skipNulls && obj[key] === null) { + continue; + } + pushToArray(keys, stringify( + obj[key], + key, + generateArrayPrefix, + commaRoundTrip, + options.allowEmptyArrays, + options.strictNullHandling, + options.skipNulls, + options.encodeDotInKeys, + options.encode ? options.encoder : null, + options.filter, + options.sort, + options.allowDots, + options.serializeDate, + options.format, + options.formatter, + options.encodeValuesOnly, + options.charset, + sideChannel + )); + } + + var joined = keys.join(options.delimiter); + var prefix = options.addQueryPrefix === true ? '?' : ''; + + if (options.charsetSentinel) { + if (options.charset === 'iso-8859-1') { + // encodeURIComponent('✓'), the "numeric entity" representation of a checkmark + prefix += 'utf8=%26%2310003%3B&'; + } else { + // encodeURIComponent('✓') + prefix += 'utf8=%E2%9C%93&'; + } + } + + return joined.length > 0 ? prefix + joined : ''; +}; diff --git a/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/lib/utils.js b/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/lib/utils.js new file mode 100644 index 000000000000..7c860f1b160a --- /dev/null +++ b/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/lib/utils.js @@ -0,0 +1,265 @@ +'use strict'; + +var formats = require('./formats'); + +var has = Object.prototype.hasOwnProperty; +var isArray = Array.isArray; + +var hexTable = (function () { + var array = []; + for (var i = 0; i < 256; ++i) { + array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase()); + } + + return array; +}()); + +var compactQueue = function compactQueue(queue) { + while (queue.length > 1) { + var item = queue.pop(); + var obj = item.obj[item.prop]; + + if (isArray(obj)) { + var compacted = []; + + for (var j = 0; j < obj.length; ++j) { + if (typeof obj[j] !== 'undefined') { + compacted.push(obj[j]); + } + } + + item.obj[item.prop] = compacted; + } + } +}; + +var arrayToObject = function arrayToObject(source, options) { + var obj = options && options.plainObjects ? Object.create(null) : {}; + for (var i = 0; i < source.length; ++i) { + if (typeof source[i] !== 'undefined') { + obj[i] = source[i]; + } + } + + return obj; +}; + +var merge = function merge(target, source, options) { + /* eslint no-param-reassign: 0 */ + if (!source) { + return target; + } + + if (typeof source !== 'object') { + if (isArray(target)) { + target.push(source); + } else if (target && typeof target === 'object') { + if ((options && (options.plainObjects || options.allowPrototypes)) || !has.call(Object.prototype, source)) { + target[source] = true; + } + } else { + return [target, source]; + } + + return target; + } + + if (!target || typeof target !== 'object') { + return [target].concat(source); + } + + var mergeTarget = target; + if (isArray(target) && !isArray(source)) { + mergeTarget = arrayToObject(target, options); + } + + if (isArray(target) && isArray(source)) { + source.forEach(function (item, i) { + if (has.call(target, i)) { + var targetItem = target[i]; + if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') { + target[i] = merge(targetItem, item, options); + } else { + target.push(item); + } + } else { + target[i] = item; + } + }); + return target; + } + + return Object.keys(source).reduce(function (acc, key) { + var value = source[key]; + + if (has.call(acc, key)) { + acc[key] = merge(acc[key], value, options); + } else { + acc[key] = value; + } + return acc; + }, mergeTarget); +}; + +var assign = function assignSingleSource(target, source) { + return Object.keys(source).reduce(function (acc, key) { + acc[key] = source[key]; + return acc; + }, target); +}; + +var decode = function (str, decoder, charset) { + var strWithoutPlus = str.replace(/\+/g, ' '); + if (charset === 'iso-8859-1') { + // unescape never throws, no try...catch needed: + return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape); + } + // utf-8 + try { + return decodeURIComponent(strWithoutPlus); + } catch (e) { + return strWithoutPlus; + } +}; + +var limit = 1024; + +/* eslint operator-linebreak: [2, "before"] */ + +var encode = function encode(str, defaultEncoder, charset, kind, format) { + // This code was originally written by Brian White (mscdex) for the io.js core querystring library. + // It has been adapted here for stricter adherence to RFC 3986 + if (str.length === 0) { + return str; + } + + var string = str; + if (typeof str === 'symbol') { + string = Symbol.prototype.toString.call(str); + } else if (typeof str !== 'string') { + string = String(str); + } + + if (charset === 'iso-8859-1') { + return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) { + return '%26%23' + parseInt($0.slice(2), 16) + '%3B'; + }); + } + + var out = ''; + for (var j = 0; j < string.length; j += limit) { + var segment = string.length >= limit ? string.slice(j, j + limit) : string; + var arr = []; + + for (var i = 0; i < segment.length; ++i) { + var c = segment.charCodeAt(i); + if ( + c === 0x2D // - + || c === 0x2E // . + || c === 0x5F // _ + || c === 0x7E // ~ + || (c >= 0x30 && c <= 0x39) // 0-9 + || (c >= 0x41 && c <= 0x5A) // a-z + || (c >= 0x61 && c <= 0x7A) // A-Z + || (format === formats.RFC1738 && (c === 0x28 || c === 0x29)) // ( ) + ) { + arr[arr.length] = segment.charAt(i); + continue; + } + + if (c < 0x80) { + arr[arr.length] = hexTable[c]; + continue; + } + + if (c < 0x800) { + arr[arr.length] = hexTable[0xC0 | (c >> 6)] + + hexTable[0x80 | (c & 0x3F)]; + continue; + } + + if (c < 0xD800 || c >= 0xE000) { + arr[arr.length] = hexTable[0xE0 | (c >> 12)] + + hexTable[0x80 | ((c >> 6) & 0x3F)] + + hexTable[0x80 | (c & 0x3F)]; + continue; + } + + i += 1; + c = 0x10000 + (((c & 0x3FF) << 10) | (segment.charCodeAt(i) & 0x3FF)); + + arr[arr.length] = hexTable[0xF0 | (c >> 18)] + + hexTable[0x80 | ((c >> 12) & 0x3F)] + + hexTable[0x80 | ((c >> 6) & 0x3F)] + + hexTable[0x80 | (c & 0x3F)]; + } + + out += arr.join(''); + } + + return out; +}; + +var compact = function compact(value) { + var queue = [{ obj: { o: value }, prop: 'o' }]; + var refs = []; + + for (var i = 0; i < queue.length; ++i) { + var item = queue[i]; + var obj = item.obj[item.prop]; + + var keys = Object.keys(obj); + for (var j = 0; j < keys.length; ++j) { + var key = keys[j]; + var val = obj[key]; + if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) { + queue.push({ obj: obj, prop: key }); + refs.push(val); + } + } + } + + compactQueue(queue); + + return value; +}; + +var isRegExp = function isRegExp(obj) { + return Object.prototype.toString.call(obj) === '[object RegExp]'; +}; + +var isBuffer = function isBuffer(obj) { + if (!obj || typeof obj !== 'object') { + return false; + } + + return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj)); +}; + +var combine = function combine(a, b) { + return [].concat(a, b); +}; + +var maybeMap = function maybeMap(val, fn) { + if (isArray(val)) { + var mapped = []; + for (var i = 0; i < val.length; i += 1) { + mapped.push(fn(val[i])); + } + return mapped; + } + return fn(val); +}; + +module.exports = { + arrayToObject: arrayToObject, + assign: assign, + combine: combine, + compact: compact, + decode: decode, + encode: encode, + isBuffer: isBuffer, + isRegExp: isRegExp, + maybeMap: maybeMap, + merge: merge +}; diff --git a/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/package.json b/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/package.json new file mode 100644 index 000000000000..6dae052173fd --- /dev/null +++ b/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/package.json @@ -0,0 +1,91 @@ +{ + "name": "qs", + "description": "A querystring parser that supports nesting and arrays, with a depth limit", + "homepage": "https://github.com/ljharb/qs", + "version": "6.13.0", + "repository": { + "type": "git", + "url": "https://github.com/ljharb/qs.git" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + }, + "main": "lib/index.js", + "sideEffects": false, + "contributors": [ + { + "name": "Jordan Harband", + "email": "ljharb@gmail.com", + "url": "http://ljharb.codes" + } + ], + "keywords": [ + "querystring", + "qs", + "query", + "url", + "parse", + "stringify" + ], + "engines": { + "node": ">=0.6" + }, + "dependencies": { + "side-channel": "^1.0.6" + }, + "devDependencies": { + "@browserify/envify": "^6.0.0", + "@browserify/uglifyify": "^6.0.0", + "@ljharb/eslint-config": "^21.1.1", + "browserify": "^16.5.2", + "bundle-collapser": "^1.4.0", + "common-shakeify": "~1.0.0", + "eclint": "^2.8.1", + "es-value-fixtures": "^1.4.2", + "eslint": "=8.8.0", + "evalmd": "^0.0.19", + "for-each": "^0.3.3", + "glob": "=10.3.7", + "has-override-mistake": "^1.0.1", + "has-property-descriptors": "^1.0.2", + "has-symbols": "^1.0.3", + "iconv-lite": "^0.5.1", + "in-publish": "^2.0.1", + "jackspeak": "=2.1.1", + "mkdirp": "^0.5.5", + "mock-property": "^1.0.3", + "module-deps": "^6.2.3", + "npmignore": "^0.3.1", + "nyc": "^10.3.2", + "object-inspect": "^1.13.2", + "qs-iconv": "^1.0.4", + "safe-publish-latest": "^2.0.0", + "safer-buffer": "^2.1.2", + "tape": "^5.8.1", + "unassertify": "^3.0.1" + }, + "scripts": { + "prepack": "npmignore --auto --commentLines=autogenerated && npm run dist", + "prepublishOnly": "safe-publish-latest", + "prepublish": "not-in-publish || npm run prepublishOnly", + "pretest": "npm run --silent readme && npm run --silent lint", + "test": "npm run tests-only", + "tests-only": "nyc tape 'test/**/*.js'", + "posttest": "npx npm@'>=10.2' audit --production", + "readme": "evalmd README.md", + "postlint": "eclint check $(git ls-files | xargs find 2> /dev/null | grep -vE 'node_modules|\\.git' | grep -v dist/)", + "lint": "eslint --ext=js,mjs .", + "dist": "mkdirp dist && browserify --standalone Qs -g unassertify -g @browserify/envify -g [@browserify/uglifyify --mangle.keep_fnames --compress.keep_fnames --format.indent_level=1 --compress.arrows=false --compress.passes=4 --compress.typeofs=false] -p common-shakeify -p bundle-collapser/plugin lib/index.js > dist/qs.js" + }, + "license": "BSD-3-Clause", + "publishConfig": { + "ignore": [ + "!dist/*", + "bower.json", + "component.json", + ".github/workflows", + "logos", + "tea.yaml" + ] + } +} diff --git a/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/test/empty-keys-cases.js b/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/test/empty-keys-cases.js new file mode 100644 index 000000000000..2b1190ef5a4f --- /dev/null +++ b/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/test/empty-keys-cases.js @@ -0,0 +1,267 @@ +'use strict'; + +module.exports = { + emptyTestCases: [ + { + input: '&', + withEmptyKeys: {}, + stringifyOutput: { + brackets: '', + indices: '', + repeat: '' + }, + noEmptyKeys: {} + }, + { + input: '&&', + withEmptyKeys: {}, + stringifyOutput: { + brackets: '', + indices: '', + repeat: '' + }, + noEmptyKeys: {} + }, + { + input: '&=', + withEmptyKeys: { '': '' }, + stringifyOutput: { + brackets: '=', + indices: '=', + repeat: '=' + }, + noEmptyKeys: {} + }, + { + input: '&=&', + withEmptyKeys: { '': '' }, + stringifyOutput: { + brackets: '=', + indices: '=', + repeat: '=' + }, + noEmptyKeys: {} + }, + { + input: '&=&=', + withEmptyKeys: { '': ['', ''] }, + stringifyOutput: { + brackets: '[]=&[]=', + indices: '[0]=&[1]=', + repeat: '=&=' + }, + noEmptyKeys: {} + }, + { + input: '&=&=&', + withEmptyKeys: { '': ['', ''] }, + stringifyOutput: { + brackets: '[]=&[]=', + indices: '[0]=&[1]=', + repeat: '=&=' + }, + noEmptyKeys: {} + }, + { + input: '=', + withEmptyKeys: { '': '' }, + noEmptyKeys: {}, + stringifyOutput: { + brackets: '=', + indices: '=', + repeat: '=' + } + }, + { + input: '=&', + withEmptyKeys: { '': '' }, + stringifyOutput: { + brackets: '=', + indices: '=', + repeat: '=' + }, + noEmptyKeys: {} + }, + { + input: '=&&&', + withEmptyKeys: { '': '' }, + stringifyOutput: { + brackets: '=', + indices: '=', + repeat: '=' + }, + noEmptyKeys: {} + }, + { + input: '=&=&=&', + withEmptyKeys: { '': ['', '', ''] }, + stringifyOutput: { + brackets: '[]=&[]=&[]=', + indices: '[0]=&[1]=&[2]=', + repeat: '=&=&=' + }, + noEmptyKeys: {} + }, + { + input: '=&a[]=b&a[1]=c', + withEmptyKeys: { '': '', a: ['b', 'c'] }, + stringifyOutput: { + brackets: '=&a[]=b&a[]=c', + indices: '=&a[0]=b&a[1]=c', + repeat: '=&a=b&a=c' + }, + noEmptyKeys: { a: ['b', 'c'] } + }, + { + input: '=a', + withEmptyKeys: { '': 'a' }, + noEmptyKeys: {}, + stringifyOutput: { + brackets: '=a', + indices: '=a', + repeat: '=a' + } + }, + { + input: 'a==a', + withEmptyKeys: { a: '=a' }, + noEmptyKeys: { a: '=a' }, + stringifyOutput: { + brackets: 'a==a', + indices: 'a==a', + repeat: 'a==a' + } + }, + { + input: '=&a[]=b', + withEmptyKeys: { '': '', a: ['b'] }, + stringifyOutput: { + brackets: '=&a[]=b', + indices: '=&a[0]=b', + repeat: '=&a=b' + }, + noEmptyKeys: { a: ['b'] } + }, + { + input: '=&a[]=b&a[]=c&a[2]=d', + withEmptyKeys: { '': '', a: ['b', 'c', 'd'] }, + stringifyOutput: { + brackets: '=&a[]=b&a[]=c&a[]=d', + indices: '=&a[0]=b&a[1]=c&a[2]=d', + repeat: '=&a=b&a=c&a=d' + }, + noEmptyKeys: { a: ['b', 'c', 'd'] } + }, + { + input: '=a&=b', + withEmptyKeys: { '': ['a', 'b'] }, + stringifyOutput: { + brackets: '[]=a&[]=b', + indices: '[0]=a&[1]=b', + repeat: '=a&=b' + }, + noEmptyKeys: {} + }, + { + input: '=a&foo=b', + withEmptyKeys: { '': 'a', foo: 'b' }, + noEmptyKeys: { foo: 'b' }, + stringifyOutput: { + brackets: '=a&foo=b', + indices: '=a&foo=b', + repeat: '=a&foo=b' + } + }, + { + input: 'a[]=b&a=c&=', + withEmptyKeys: { '': '', a: ['b', 'c'] }, + stringifyOutput: { + brackets: '=&a[]=b&a[]=c', + indices: '=&a[0]=b&a[1]=c', + repeat: '=&a=b&a=c' + }, + noEmptyKeys: { a: ['b', 'c'] } + }, + { + input: 'a[]=b&a=c&=', + withEmptyKeys: { '': '', a: ['b', 'c'] }, + stringifyOutput: { + brackets: '=&a[]=b&a[]=c', + indices: '=&a[0]=b&a[1]=c', + repeat: '=&a=b&a=c' + }, + noEmptyKeys: { a: ['b', 'c'] } + }, + { + input: 'a[0]=b&a=c&=', + withEmptyKeys: { '': '', a: ['b', 'c'] }, + stringifyOutput: { + brackets: '=&a[]=b&a[]=c', + indices: '=&a[0]=b&a[1]=c', + repeat: '=&a=b&a=c' + }, + noEmptyKeys: { a: ['b', 'c'] } + }, + { + input: 'a=b&a[]=c&=', + withEmptyKeys: { '': '', a: ['b', 'c'] }, + stringifyOutput: { + brackets: '=&a[]=b&a[]=c', + indices: '=&a[0]=b&a[1]=c', + repeat: '=&a=b&a=c' + }, + noEmptyKeys: { a: ['b', 'c'] } + }, + { + input: 'a=b&a[0]=c&=', + withEmptyKeys: { '': '', a: ['b', 'c'] }, + stringifyOutput: { + brackets: '=&a[]=b&a[]=c', + indices: '=&a[0]=b&a[1]=c', + repeat: '=&a=b&a=c' + }, + noEmptyKeys: { a: ['b', 'c'] } + }, + { + input: '[]=a&[]=b& []=1', + withEmptyKeys: { '': ['a', 'b'], ' ': ['1'] }, + stringifyOutput: { + brackets: '[]=a&[]=b& []=1', + indices: '[0]=a&[1]=b& [0]=1', + repeat: '=a&=b& =1' + }, + noEmptyKeys: { 0: 'a', 1: 'b', ' ': ['1'] } + }, + { + input: '[0]=a&[1]=b&a[0]=1&a[1]=2', + withEmptyKeys: { '': ['a', 'b'], a: ['1', '2'] }, + noEmptyKeys: { 0: 'a', 1: 'b', a: ['1', '2'] }, + stringifyOutput: { + brackets: '[]=a&[]=b&a[]=1&a[]=2', + indices: '[0]=a&[1]=b&a[0]=1&a[1]=2', + repeat: '=a&=b&a=1&a=2' + } + }, + { + input: '[deep]=a&[deep]=2', + withEmptyKeys: { '': { deep: ['a', '2'] } + }, + stringifyOutput: { + brackets: '[deep][]=a&[deep][]=2', + indices: '[deep][0]=a&[deep][1]=2', + repeat: '[deep]=a&[deep]=2' + }, + noEmptyKeys: { deep: ['a', '2'] } + }, + { + input: '%5B0%5D=a&%5B1%5D=b', + withEmptyKeys: { '': ['a', 'b'] }, + stringifyOutput: { + brackets: '[]=a&[]=b', + indices: '[0]=a&[1]=b', + repeat: '=a&=b' + }, + noEmptyKeys: { 0: 'a', 1: 'b' } + } + ] +}; diff --git a/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/test/parse.js b/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/test/parse.js new file mode 100644 index 000000000000..8a2f487c8d47 --- /dev/null +++ b/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/test/parse.js @@ -0,0 +1,1170 @@ +'use strict'; + +var test = require('tape'); +var hasPropertyDescriptors = require('has-property-descriptors')(); +var iconv = require('iconv-lite'); +var mockProperty = require('mock-property'); +var hasOverrideMistake = require('has-override-mistake')(); +var SaferBuffer = require('safer-buffer').Buffer; +var v = require('es-value-fixtures'); +var inspect = require('object-inspect'); +var emptyTestCases = require('./empty-keys-cases').emptyTestCases; + +var qs = require('../'); +var utils = require('../lib/utils'); + +test('parse()', function (t) { + t.test('parses a simple string', function (st) { + st.deepEqual(qs.parse('0=foo'), { 0: 'foo' }); + st.deepEqual(qs.parse('foo=c++'), { foo: 'c ' }); + st.deepEqual(qs.parse('a[>=]=23'), { a: { '>=': '23' } }); + st.deepEqual(qs.parse('a[<=>]==23'), { a: { '<=>': '=23' } }); + st.deepEqual(qs.parse('a[==]=23'), { a: { '==': '23' } }); + st.deepEqual(qs.parse('foo', { strictNullHandling: true }), { foo: null }); + st.deepEqual(qs.parse('foo'), { foo: '' }); + st.deepEqual(qs.parse('foo='), { foo: '' }); + st.deepEqual(qs.parse('foo=bar'), { foo: 'bar' }); + st.deepEqual(qs.parse(' foo = bar = baz '), { ' foo ': ' bar = baz ' }); + st.deepEqual(qs.parse('foo=bar=baz'), { foo: 'bar=baz' }); + st.deepEqual(qs.parse('foo=bar&bar=baz'), { foo: 'bar', bar: 'baz' }); + st.deepEqual(qs.parse('foo2=bar2&baz2='), { foo2: 'bar2', baz2: '' }); + st.deepEqual(qs.parse('foo=bar&baz', { strictNullHandling: true }), { foo: 'bar', baz: null }); + st.deepEqual(qs.parse('foo=bar&baz'), { foo: 'bar', baz: '' }); + st.deepEqual(qs.parse('cht=p3&chd=t:60,40&chs=250x100&chl=Hello|World'), { + cht: 'p3', + chd: 't:60,40', + chs: '250x100', + chl: 'Hello|World' + }); + st.end(); + }); + + t.test('comma: false', function (st) { + st.deepEqual(qs.parse('a[]=b&a[]=c'), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a[0]=b&a[1]=c'), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a=b,c'), { a: 'b,c' }); + st.deepEqual(qs.parse('a=b&a=c'), { a: ['b', 'c'] }); + st.end(); + }); + + t.test('comma: true', function (st) { + st.deepEqual(qs.parse('a[]=b&a[]=c', { comma: true }), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a[0]=b&a[1]=c', { comma: true }), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a=b,c', { comma: true }), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a=b&a=c', { comma: true }), { a: ['b', 'c'] }); + st.end(); + }); + + t.test('allows enabling dot notation', function (st) { + st.deepEqual(qs.parse('a.b=c'), { 'a.b': 'c' }); + st.deepEqual(qs.parse('a.b=c', { allowDots: true }), { a: { b: 'c' } }); + + st.end(); + }); + + t.test('decode dot keys correctly', function (st) { + st.deepEqual( + qs.parse('name%252Eobj.first=John&name%252Eobj.last=Doe', { allowDots: false, decodeDotInKeys: false }), + { 'name%2Eobj.first': 'John', 'name%2Eobj.last': 'Doe' }, + 'with allowDots false and decodeDotInKeys false' + ); + st.deepEqual( + qs.parse('name.obj.first=John&name.obj.last=Doe', { allowDots: true, decodeDotInKeys: false }), + { name: { obj: { first: 'John', last: 'Doe' } } }, + 'with allowDots false and decodeDotInKeys false' + ); + st.deepEqual( + qs.parse('name%252Eobj.first=John&name%252Eobj.last=Doe', { allowDots: true, decodeDotInKeys: false }), + { 'name%2Eobj': { first: 'John', last: 'Doe' } }, + 'with allowDots true and decodeDotInKeys false' + ); + st.deepEqual( + qs.parse('name%252Eobj.first=John&name%252Eobj.last=Doe', { allowDots: true, decodeDotInKeys: true }), + { 'name.obj': { first: 'John', last: 'Doe' } }, + 'with allowDots true and decodeDotInKeys true' + ); + + st.deepEqual( + qs.parse( + 'name%252Eobj%252Esubobject.first%252Egodly%252Ename=John&name%252Eobj%252Esubobject.last=Doe', + { allowDots: false, decodeDotInKeys: false } + ), + { 'name%2Eobj%2Esubobject.first%2Egodly%2Ename': 'John', 'name%2Eobj%2Esubobject.last': 'Doe' }, + 'with allowDots false and decodeDotInKeys false' + ); + st.deepEqual( + qs.parse( + 'name.obj.subobject.first.godly.name=John&name.obj.subobject.last=Doe', + { allowDots: true, decodeDotInKeys: false } + ), + { name: { obj: { subobject: { first: { godly: { name: 'John' } }, last: 'Doe' } } } }, + 'with allowDots true and decodeDotInKeys false' + ); + st.deepEqual( + qs.parse( + 'name%252Eobj%252Esubobject.first%252Egodly%252Ename=John&name%252Eobj%252Esubobject.last=Doe', + { allowDots: true, decodeDotInKeys: true } + ), + { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, + 'with allowDots true and decodeDotInKeys true' + ); + st.deepEqual( + qs.parse('name%252Eobj.first=John&name%252Eobj.last=Doe'), + { 'name%2Eobj.first': 'John', 'name%2Eobj.last': 'Doe' }, + 'with allowDots and decodeDotInKeys undefined' + ); + + st.end(); + }); + + t.test('should decode dot in key of object, and allow enabling dot notation when decodeDotInKeys is set to true and allowDots is undefined', function (st) { + st.deepEqual( + qs.parse( + 'name%252Eobj%252Esubobject.first%252Egodly%252Ename=John&name%252Eobj%252Esubobject.last=Doe', + { decodeDotInKeys: true } + ), + { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, + 'with allowDots undefined and decodeDotInKeys true' + ); + + st.end(); + }); + + t.test('should throw when decodeDotInKeys is not of type boolean', function (st) { + st['throws']( + function () { qs.parse('foo[]&bar=baz', { decodeDotInKeys: 'foobar' }); }, + TypeError + ); + + st['throws']( + function () { qs.parse('foo[]&bar=baz', { decodeDotInKeys: 0 }); }, + TypeError + ); + st['throws']( + function () { qs.parse('foo[]&bar=baz', { decodeDotInKeys: NaN }); }, + TypeError + ); + + st['throws']( + function () { qs.parse('foo[]&bar=baz', { decodeDotInKeys: null }); }, + TypeError + ); + + st.end(); + }); + + t.test('allows empty arrays in obj values', function (st) { + st.deepEqual(qs.parse('foo[]&bar=baz', { allowEmptyArrays: true }), { foo: [], bar: 'baz' }); + st.deepEqual(qs.parse('foo[]&bar=baz', { allowEmptyArrays: false }), { foo: [''], bar: 'baz' }); + + st.end(); + }); + + t.test('should throw when allowEmptyArrays is not of type boolean', function (st) { + st['throws']( + function () { qs.parse('foo[]&bar=baz', { allowEmptyArrays: 'foobar' }); }, + TypeError + ); + + st['throws']( + function () { qs.parse('foo[]&bar=baz', { allowEmptyArrays: 0 }); }, + TypeError + ); + st['throws']( + function () { qs.parse('foo[]&bar=baz', { allowEmptyArrays: NaN }); }, + TypeError + ); + + st['throws']( + function () { qs.parse('foo[]&bar=baz', { allowEmptyArrays: null }); }, + TypeError + ); + + st.end(); + }); + + t.test('allowEmptyArrays + strictNullHandling', function (st) { + st.deepEqual( + qs.parse('testEmptyArray[]', { strictNullHandling: true, allowEmptyArrays: true }), + { testEmptyArray: [] } + ); + + st.end(); + }); + + t.deepEqual(qs.parse('a[b]=c'), { a: { b: 'c' } }, 'parses a single nested string'); + t.deepEqual(qs.parse('a[b][c]=d'), { a: { b: { c: 'd' } } }, 'parses a double nested string'); + t.deepEqual( + qs.parse('a[b][c][d][e][f][g][h]=i'), + { a: { b: { c: { d: { e: { f: { '[g][h]': 'i' } } } } } } }, + 'defaults to a depth of 5' + ); + + t.test('only parses one level when depth = 1', function (st) { + st.deepEqual(qs.parse('a[b][c]=d', { depth: 1 }), { a: { b: { '[c]': 'd' } } }); + st.deepEqual(qs.parse('a[b][c][d]=e', { depth: 1 }), { a: { b: { '[c][d]': 'e' } } }); + st.end(); + }); + + t.test('uses original key when depth = 0', function (st) { + st.deepEqual(qs.parse('a[0]=b&a[1]=c', { depth: 0 }), { 'a[0]': 'b', 'a[1]': 'c' }); + st.deepEqual(qs.parse('a[0][0]=b&a[0][1]=c&a[1]=d&e=2', { depth: 0 }), { 'a[0][0]': 'b', 'a[0][1]': 'c', 'a[1]': 'd', e: '2' }); + st.end(); + }); + + t.test('uses original key when depth = false', function (st) { + st.deepEqual(qs.parse('a[0]=b&a[1]=c', { depth: false }), { 'a[0]': 'b', 'a[1]': 'c' }); + st.deepEqual(qs.parse('a[0][0]=b&a[0][1]=c&a[1]=d&e=2', { depth: false }), { 'a[0][0]': 'b', 'a[0][1]': 'c', 'a[1]': 'd', e: '2' }); + st.end(); + }); + + t.deepEqual(qs.parse('a=b&a=c'), { a: ['b', 'c'] }, 'parses a simple array'); + + t.test('parses an explicit array', function (st) { + st.deepEqual(qs.parse('a[]=b'), { a: ['b'] }); + st.deepEqual(qs.parse('a[]=b&a[]=c'), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a[]=b&a[]=c&a[]=d'), { a: ['b', 'c', 'd'] }); + st.end(); + }); + + t.test('parses a mix of simple and explicit arrays', function (st) { + st.deepEqual(qs.parse('a=b&a[]=c'), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a[]=b&a=c'), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a[0]=b&a=c'), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a=b&a[0]=c'), { a: ['b', 'c'] }); + + st.deepEqual(qs.parse('a[1]=b&a=c', { arrayLimit: 20 }), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a[]=b&a=c', { arrayLimit: 0 }), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a[]=b&a=c'), { a: ['b', 'c'] }); + + st.deepEqual(qs.parse('a=b&a[1]=c', { arrayLimit: 20 }), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a=b&a[]=c', { arrayLimit: 0 }), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a=b&a[]=c'), { a: ['b', 'c'] }); + + st.end(); + }); + + t.test('parses a nested array', function (st) { + st.deepEqual(qs.parse('a[b][]=c&a[b][]=d'), { a: { b: ['c', 'd'] } }); + st.deepEqual(qs.parse('a[>=]=25'), { a: { '>=': '25' } }); + st.end(); + }); + + t.test('allows to specify array indices', function (st) { + st.deepEqual(qs.parse('a[1]=c&a[0]=b&a[2]=d'), { a: ['b', 'c', 'd'] }); + st.deepEqual(qs.parse('a[1]=c&a[0]=b'), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a[1]=c', { arrayLimit: 20 }), { a: ['c'] }); + st.deepEqual(qs.parse('a[1]=c', { arrayLimit: 0 }), { a: { 1: 'c' } }); + st.deepEqual(qs.parse('a[1]=c'), { a: ['c'] }); + st.end(); + }); + + t.test('limits specific array indices to arrayLimit', function (st) { + st.deepEqual(qs.parse('a[20]=a', { arrayLimit: 20 }), { a: ['a'] }); + st.deepEqual(qs.parse('a[21]=a', { arrayLimit: 20 }), { a: { 21: 'a' } }); + + st.deepEqual(qs.parse('a[20]=a'), { a: ['a'] }); + st.deepEqual(qs.parse('a[21]=a'), { a: { 21: 'a' } }); + st.end(); + }); + + t.deepEqual(qs.parse('a[12b]=c'), { a: { '12b': 'c' } }, 'supports keys that begin with a number'); + + t.test('supports encoded = signs', function (st) { + st.deepEqual(qs.parse('he%3Dllo=th%3Dere'), { 'he=llo': 'th=ere' }); + st.end(); + }); + + t.test('is ok with url encoded strings', function (st) { + st.deepEqual(qs.parse('a[b%20c]=d'), { a: { 'b c': 'd' } }); + st.deepEqual(qs.parse('a[b]=c%20d'), { a: { b: 'c d' } }); + st.end(); + }); + + t.test('allows brackets in the value', function (st) { + st.deepEqual(qs.parse('pets=["tobi"]'), { pets: '["tobi"]' }); + st.deepEqual(qs.parse('operators=[">=", "<="]'), { operators: '[">=", "<="]' }); + st.end(); + }); + + t.test('allows empty values', function (st) { + st.deepEqual(qs.parse(''), {}); + st.deepEqual(qs.parse(null), {}); + st.deepEqual(qs.parse(undefined), {}); + st.end(); + }); + + t.test('transforms arrays to objects', function (st) { + st.deepEqual(qs.parse('foo[0]=bar&foo[bad]=baz'), { foo: { 0: 'bar', bad: 'baz' } }); + st.deepEqual(qs.parse('foo[bad]=baz&foo[0]=bar'), { foo: { bad: 'baz', 0: 'bar' } }); + st.deepEqual(qs.parse('foo[bad]=baz&foo[]=bar'), { foo: { bad: 'baz', 0: 'bar' } }); + st.deepEqual(qs.parse('foo[]=bar&foo[bad]=baz'), { foo: { 0: 'bar', bad: 'baz' } }); + st.deepEqual(qs.parse('foo[bad]=baz&foo[]=bar&foo[]=foo'), { foo: { bad: 'baz', 0: 'bar', 1: 'foo' } }); + st.deepEqual(qs.parse('foo[0][a]=a&foo[0][b]=b&foo[1][a]=aa&foo[1][b]=bb'), { foo: [{ a: 'a', b: 'b' }, { a: 'aa', b: 'bb' }] }); + + st.deepEqual(qs.parse('a[]=b&a[t]=u&a[hasOwnProperty]=c', { allowPrototypes: false }), { a: { 0: 'b', t: 'u' } }); + st.deepEqual(qs.parse('a[]=b&a[t]=u&a[hasOwnProperty]=c', { allowPrototypes: true }), { a: { 0: 'b', t: 'u', hasOwnProperty: 'c' } }); + st.deepEqual(qs.parse('a[]=b&a[hasOwnProperty]=c&a[x]=y', { allowPrototypes: false }), { a: { 0: 'b', x: 'y' } }); + st.deepEqual(qs.parse('a[]=b&a[hasOwnProperty]=c&a[x]=y', { allowPrototypes: true }), { a: { 0: 'b', hasOwnProperty: 'c', x: 'y' } }); + st.end(); + }); + + t.test('transforms arrays to objects (dot notation)', function (st) { + st.deepEqual(qs.parse('foo[0].baz=bar&fool.bad=baz', { allowDots: true }), { foo: [{ baz: 'bar' }], fool: { bad: 'baz' } }); + st.deepEqual(qs.parse('foo[0].baz=bar&fool.bad.boo=baz', { allowDots: true }), { foo: [{ baz: 'bar' }], fool: { bad: { boo: 'baz' } } }); + st.deepEqual(qs.parse('foo[0][0].baz=bar&fool.bad=baz', { allowDots: true }), { foo: [[{ baz: 'bar' }]], fool: { bad: 'baz' } }); + st.deepEqual(qs.parse('foo[0].baz[0]=15&foo[0].bar=2', { allowDots: true }), { foo: [{ baz: ['15'], bar: '2' }] }); + st.deepEqual(qs.parse('foo[0].baz[0]=15&foo[0].baz[1]=16&foo[0].bar=2', { allowDots: true }), { foo: [{ baz: ['15', '16'], bar: '2' }] }); + st.deepEqual(qs.parse('foo.bad=baz&foo[0]=bar', { allowDots: true }), { foo: { bad: 'baz', 0: 'bar' } }); + st.deepEqual(qs.parse('foo.bad=baz&foo[]=bar', { allowDots: true }), { foo: { bad: 'baz', 0: 'bar' } }); + st.deepEqual(qs.parse('foo[]=bar&foo.bad=baz', { allowDots: true }), { foo: { 0: 'bar', bad: 'baz' } }); + st.deepEqual(qs.parse('foo.bad=baz&foo[]=bar&foo[]=foo', { allowDots: true }), { foo: { bad: 'baz', 0: 'bar', 1: 'foo' } }); + st.deepEqual(qs.parse('foo[0].a=a&foo[0].b=b&foo[1].a=aa&foo[1].b=bb', { allowDots: true }), { foo: [{ a: 'a', b: 'b' }, { a: 'aa', b: 'bb' }] }); + st.end(); + }); + + t.test('correctly prunes undefined values when converting an array to an object', function (st) { + st.deepEqual(qs.parse('a[2]=b&a[99999999]=c'), { a: { 2: 'b', 99999999: 'c' } }); + st.end(); + }); + + t.test('supports malformed uri characters', function (st) { + st.deepEqual(qs.parse('{%:%}', { strictNullHandling: true }), { '{%:%}': null }); + st.deepEqual(qs.parse('{%:%}='), { '{%:%}': '' }); + st.deepEqual(qs.parse('foo=%:%}'), { foo: '%:%}' }); + st.end(); + }); + + t.test('doesn\'t produce empty keys', function (st) { + st.deepEqual(qs.parse('_r=1&'), { _r: '1' }); + st.end(); + }); + + t.test('cannot access Object prototype', function (st) { + qs.parse('constructor[prototype][bad]=bad'); + qs.parse('bad[constructor][prototype][bad]=bad'); + st.equal(typeof Object.prototype.bad, 'undefined'); + st.end(); + }); + + t.test('parses arrays of objects', function (st) { + st.deepEqual(qs.parse('a[][b]=c'), { a: [{ b: 'c' }] }); + st.deepEqual(qs.parse('a[0][b]=c'), { a: [{ b: 'c' }] }); + st.end(); + }); + + t.test('allows for empty strings in arrays', function (st) { + st.deepEqual(qs.parse('a[]=b&a[]=&a[]=c'), { a: ['b', '', 'c'] }); + + st.deepEqual( + qs.parse('a[0]=b&a[1]&a[2]=c&a[19]=', { strictNullHandling: true, arrayLimit: 20 }), + { a: ['b', null, 'c', ''] }, + 'with arrayLimit 20 + array indices: null then empty string works' + ); + st.deepEqual( + qs.parse('a[]=b&a[]&a[]=c&a[]=', { strictNullHandling: true, arrayLimit: 0 }), + { a: ['b', null, 'c', ''] }, + 'with arrayLimit 0 + array brackets: null then empty string works' + ); + + st.deepEqual( + qs.parse('a[0]=b&a[1]=&a[2]=c&a[19]', { strictNullHandling: true, arrayLimit: 20 }), + { a: ['b', '', 'c', null] }, + 'with arrayLimit 20 + array indices: empty string then null works' + ); + st.deepEqual( + qs.parse('a[]=b&a[]=&a[]=c&a[]', { strictNullHandling: true, arrayLimit: 0 }), + { a: ['b', '', 'c', null] }, + 'with arrayLimit 0 + array brackets: empty string then null works' + ); + + st.deepEqual( + qs.parse('a[]=&a[]=b&a[]=c'), + { a: ['', 'b', 'c'] }, + 'array brackets: empty strings work' + ); + st.end(); + }); + + t.test('compacts sparse arrays', function (st) { + st.deepEqual(qs.parse('a[10]=1&a[2]=2', { arrayLimit: 20 }), { a: ['2', '1'] }); + st.deepEqual(qs.parse('a[1][b][2][c]=1', { arrayLimit: 20 }), { a: [{ b: [{ c: '1' }] }] }); + st.deepEqual(qs.parse('a[1][2][3][c]=1', { arrayLimit: 20 }), { a: [[[{ c: '1' }]]] }); + st.deepEqual(qs.parse('a[1][2][3][c][1]=1', { arrayLimit: 20 }), { a: [[[{ c: ['1'] }]]] }); + st.end(); + }); + + t.test('parses sparse arrays', function (st) { + /* eslint no-sparse-arrays: 0 */ + st.deepEqual(qs.parse('a[4]=1&a[1]=2', { allowSparse: true }), { a: [, '2', , , '1'] }); + st.deepEqual(qs.parse('a[1][b][2][c]=1', { allowSparse: true }), { a: [, { b: [, , { c: '1' }] }] }); + st.deepEqual(qs.parse('a[1][2][3][c]=1', { allowSparse: true }), { a: [, [, , [, , , { c: '1' }]]] }); + st.deepEqual(qs.parse('a[1][2][3][c][1]=1', { allowSparse: true }), { a: [, [, , [, , , { c: [, '1'] }]]] }); + st.end(); + }); + + t.test('parses semi-parsed strings', function (st) { + st.deepEqual(qs.parse({ 'a[b]': 'c' }), { a: { b: 'c' } }); + st.deepEqual(qs.parse({ 'a[b]': 'c', 'a[d]': 'e' }), { a: { b: 'c', d: 'e' } }); + st.end(); + }); + + t.test('parses buffers correctly', function (st) { + var b = SaferBuffer.from('test'); + st.deepEqual(qs.parse({ a: b }), { a: b }); + st.end(); + }); + + t.test('parses jquery-param strings', function (st) { + // readable = 'filter[0][]=int1&filter[0][]==&filter[0][]=77&filter[]=and&filter[2][]=int2&filter[2][]==&filter[2][]=8' + var encoded = 'filter%5B0%5D%5B%5D=int1&filter%5B0%5D%5B%5D=%3D&filter%5B0%5D%5B%5D=77&filter%5B%5D=and&filter%5B2%5D%5B%5D=int2&filter%5B2%5D%5B%5D=%3D&filter%5B2%5D%5B%5D=8'; + var expected = { filter: [['int1', '=', '77'], 'and', ['int2', '=', '8']] }; + st.deepEqual(qs.parse(encoded), expected); + st.end(); + }); + + t.test('continues parsing when no parent is found', function (st) { + st.deepEqual(qs.parse('[]=&a=b'), { 0: '', a: 'b' }); + st.deepEqual(qs.parse('[]&a=b', { strictNullHandling: true }), { 0: null, a: 'b' }); + st.deepEqual(qs.parse('[foo]=bar'), { foo: 'bar' }); + st.end(); + }); + + t.test('does not error when parsing a very long array', function (st) { + var str = 'a[]=a'; + while (Buffer.byteLength(str) < 128 * 1024) { + str = str + '&' + str; + } + + st.doesNotThrow(function () { + qs.parse(str); + }); + + st.end(); + }); + + t.test('should not throw when a native prototype has an enumerable property', function (st) { + st.intercept(Object.prototype, 'crash', { value: '' }); + st.intercept(Array.prototype, 'crash', { value: '' }); + + st.doesNotThrow(qs.parse.bind(null, 'a=b')); + st.deepEqual(qs.parse('a=b'), { a: 'b' }); + st.doesNotThrow(qs.parse.bind(null, 'a[][b]=c')); + st.deepEqual(qs.parse('a[][b]=c'), { a: [{ b: 'c' }] }); + + st.end(); + }); + + t.test('parses a string with an alternative string delimiter', function (st) { + st.deepEqual(qs.parse('a=b;c=d', { delimiter: ';' }), { a: 'b', c: 'd' }); + st.end(); + }); + + t.test('parses a string with an alternative RegExp delimiter', function (st) { + st.deepEqual(qs.parse('a=b; c=d', { delimiter: /[;,] */ }), { a: 'b', c: 'd' }); + st.end(); + }); + + t.test('does not use non-splittable objects as delimiters', function (st) { + st.deepEqual(qs.parse('a=b&c=d', { delimiter: true }), { a: 'b', c: 'd' }); + st.end(); + }); + + t.test('allows overriding parameter limit', function (st) { + st.deepEqual(qs.parse('a=b&c=d', { parameterLimit: 1 }), { a: 'b' }); + st.end(); + }); + + t.test('allows setting the parameter limit to Infinity', function (st) { + st.deepEqual(qs.parse('a=b&c=d', { parameterLimit: Infinity }), { a: 'b', c: 'd' }); + st.end(); + }); + + t.test('allows overriding array limit', function (st) { + st.deepEqual(qs.parse('a[0]=b', { arrayLimit: -1 }), { a: { 0: 'b' } }); + st.deepEqual(qs.parse('a[0]=b', { arrayLimit: 0 }), { a: ['b'] }); + + st.deepEqual(qs.parse('a[-1]=b', { arrayLimit: -1 }), { a: { '-1': 'b' } }); + st.deepEqual(qs.parse('a[-1]=b', { arrayLimit: 0 }), { a: { '-1': 'b' } }); + + st.deepEqual(qs.parse('a[0]=b&a[1]=c', { arrayLimit: -1 }), { a: { 0: 'b', 1: 'c' } }); + st.deepEqual(qs.parse('a[0]=b&a[1]=c', { arrayLimit: 0 }), { a: { 0: 'b', 1: 'c' } }); + + st.end(); + }); + + t.test('allows disabling array parsing', function (st) { + var indices = qs.parse('a[0]=b&a[1]=c', { parseArrays: false }); + st.deepEqual(indices, { a: { 0: 'b', 1: 'c' } }); + st.equal(Array.isArray(indices.a), false, 'parseArrays:false, indices case is not an array'); + + var emptyBrackets = qs.parse('a[]=b', { parseArrays: false }); + st.deepEqual(emptyBrackets, { a: { 0: 'b' } }); + st.equal(Array.isArray(emptyBrackets.a), false, 'parseArrays:false, empty brackets case is not an array'); + + st.end(); + }); + + t.test('allows for query string prefix', function (st) { + st.deepEqual(qs.parse('?foo=bar', { ignoreQueryPrefix: true }), { foo: 'bar' }); + st.deepEqual(qs.parse('foo=bar', { ignoreQueryPrefix: true }), { foo: 'bar' }); + st.deepEqual(qs.parse('?foo=bar', { ignoreQueryPrefix: false }), { '?foo': 'bar' }); + + st.end(); + }); + + t.test('parses an object', function (st) { + var input = { + 'user[name]': { 'pop[bob]': 3 }, + 'user[email]': null + }; + + var expected = { + user: { + name: { 'pop[bob]': 3 }, + email: null + } + }; + + var result = qs.parse(input); + + st.deepEqual(result, expected); + st.end(); + }); + + t.test('parses string with comma as array divider', function (st) { + st.deepEqual(qs.parse('foo=bar,tee', { comma: true }), { foo: ['bar', 'tee'] }); + st.deepEqual(qs.parse('foo[bar]=coffee,tee', { comma: true }), { foo: { bar: ['coffee', 'tee'] } }); + st.deepEqual(qs.parse('foo=', { comma: true }), { foo: '' }); + st.deepEqual(qs.parse('foo', { comma: true }), { foo: '' }); + st.deepEqual(qs.parse('foo', { comma: true, strictNullHandling: true }), { foo: null }); + + // test cases inversed from from stringify tests + st.deepEqual(qs.parse('a[0]=c'), { a: ['c'] }); + st.deepEqual(qs.parse('a[]=c'), { a: ['c'] }); + st.deepEqual(qs.parse('a[]=c', { comma: true }), { a: ['c'] }); + + st.deepEqual(qs.parse('a[0]=c&a[1]=d'), { a: ['c', 'd'] }); + st.deepEqual(qs.parse('a[]=c&a[]=d'), { a: ['c', 'd'] }); + st.deepEqual(qs.parse('a=c,d', { comma: true }), { a: ['c', 'd'] }); + + st.end(); + }); + + t.test('parses values with comma as array divider', function (st) { + st.deepEqual(qs.parse({ foo: 'bar,tee' }, { comma: false }), { foo: 'bar,tee' }); + st.deepEqual(qs.parse({ foo: 'bar,tee' }, { comma: true }), { foo: ['bar', 'tee'] }); + st.end(); + }); + + t.test('use number decoder, parses string that has one number with comma option enabled', function (st) { + var decoder = function (str, defaultDecoder, charset, type) { + if (!isNaN(Number(str))) { + return parseFloat(str); + } + return defaultDecoder(str, defaultDecoder, charset, type); + }; + + st.deepEqual(qs.parse('foo=1', { comma: true, decoder: decoder }), { foo: 1 }); + st.deepEqual(qs.parse('foo=0', { comma: true, decoder: decoder }), { foo: 0 }); + + st.end(); + }); + + t.test('parses brackets holds array of arrays when having two parts of strings with comma as array divider', function (st) { + st.deepEqual(qs.parse('foo[]=1,2,3&foo[]=4,5,6', { comma: true }), { foo: [['1', '2', '3'], ['4', '5', '6']] }); + st.deepEqual(qs.parse('foo[]=1,2,3&foo[]=', { comma: true }), { foo: [['1', '2', '3'], ''] }); + st.deepEqual(qs.parse('foo[]=1,2,3&foo[]=,', { comma: true }), { foo: [['1', '2', '3'], ['', '']] }); + st.deepEqual(qs.parse('foo[]=1,2,3&foo[]=a', { comma: true }), { foo: [['1', '2', '3'], 'a'] }); + + st.end(); + }); + + t.test('parses url-encoded brackets holds array of arrays when having two parts of strings with comma as array divider', function (st) { + st.deepEqual(qs.parse('foo%5B%5D=1,2,3&foo%5B%5D=4,5,6', { comma: true }), { foo: [['1', '2', '3'], ['4', '5', '6']] }); + st.deepEqual(qs.parse('foo%5B%5D=1,2,3&foo%5B%5D=', { comma: true }), { foo: [['1', '2', '3'], ''] }); + st.deepEqual(qs.parse('foo%5B%5D=1,2,3&foo%5B%5D=,', { comma: true }), { foo: [['1', '2', '3'], ['', '']] }); + st.deepEqual(qs.parse('foo%5B%5D=1,2,3&foo%5B%5D=a', { comma: true }), { foo: [['1', '2', '3'], 'a'] }); + + st.end(); + }); + + t.test('parses comma delimited array while having percent-encoded comma treated as normal text', function (st) { + st.deepEqual(qs.parse('foo=a%2Cb', { comma: true }), { foo: 'a,b' }); + st.deepEqual(qs.parse('foo=a%2C%20b,d', { comma: true }), { foo: ['a, b', 'd'] }); + st.deepEqual(qs.parse('foo=a%2C%20b,c%2C%20d', { comma: true }), { foo: ['a, b', 'c, d'] }); + + st.end(); + }); + + t.test('parses an object in dot notation', function (st) { + var input = { + 'user.name': { 'pop[bob]': 3 }, + 'user.email.': null + }; + + var expected = { + user: { + name: { 'pop[bob]': 3 }, + email: null + } + }; + + var result = qs.parse(input, { allowDots: true }); + + st.deepEqual(result, expected); + st.end(); + }); + + t.test('parses an object and not child values', function (st) { + var input = { + 'user[name]': { 'pop[bob]': { test: 3 } }, + 'user[email]': null + }; + + var expected = { + user: { + name: { 'pop[bob]': { test: 3 } }, + email: null + } + }; + + var result = qs.parse(input); + + st.deepEqual(result, expected); + st.end(); + }); + + t.test('does not blow up when Buffer global is missing', function (st) { + var restore = mockProperty(global, 'Buffer', { 'delete': true }); + + var result = qs.parse('a=b&c=d'); + + restore(); + + st.deepEqual(result, { a: 'b', c: 'd' }); + st.end(); + }); + + t.test('does not crash when parsing circular references', function (st) { + var a = {}; + a.b = a; + + var parsed; + + st.doesNotThrow(function () { + parsed = qs.parse({ 'foo[bar]': 'baz', 'foo[baz]': a }); + }); + + st.equal('foo' in parsed, true, 'parsed has "foo" property'); + st.equal('bar' in parsed.foo, true); + st.equal('baz' in parsed.foo, true); + st.equal(parsed.foo.bar, 'baz'); + st.deepEqual(parsed.foo.baz, a); + st.end(); + }); + + t.test('does not crash when parsing deep objects', function (st) { + var parsed; + var str = 'foo'; + + for (var i = 0; i < 5000; i++) { + str += '[p]'; + } + + str += '=bar'; + + st.doesNotThrow(function () { + parsed = qs.parse(str, { depth: 5000 }); + }); + + st.equal('foo' in parsed, true, 'parsed has "foo" property'); + + var depth = 0; + var ref = parsed.foo; + while ((ref = ref.p)) { + depth += 1; + } + + st.equal(depth, 5000, 'parsed is 5000 properties deep'); + + st.end(); + }); + + t.test('parses null objects correctly', { skip: !Object.create }, function (st) { + var a = Object.create(null); + a.b = 'c'; + + st.deepEqual(qs.parse(a), { b: 'c' }); + var result = qs.parse({ a: a }); + st.equal('a' in result, true, 'result has "a" property'); + st.deepEqual(result.a, a); + st.end(); + }); + + t.test('parses dates correctly', function (st) { + var now = new Date(); + st.deepEqual(qs.parse({ a: now }), { a: now }); + st.end(); + }); + + t.test('parses regular expressions correctly', function (st) { + var re = /^test$/; + st.deepEqual(qs.parse({ a: re }), { a: re }); + st.end(); + }); + + t.test('does not allow overwriting prototype properties', function (st) { + st.deepEqual(qs.parse('a[hasOwnProperty]=b', { allowPrototypes: false }), {}); + st.deepEqual(qs.parse('hasOwnProperty=b', { allowPrototypes: false }), {}); + + st.deepEqual( + qs.parse('toString', { allowPrototypes: false }), + {}, + 'bare "toString" results in {}' + ); + + st.end(); + }); + + t.test('can allow overwriting prototype properties', function (st) { + st.deepEqual(qs.parse('a[hasOwnProperty]=b', { allowPrototypes: true }), { a: { hasOwnProperty: 'b' } }); + st.deepEqual(qs.parse('hasOwnProperty=b', { allowPrototypes: true }), { hasOwnProperty: 'b' }); + + st.deepEqual( + qs.parse('toString', { allowPrototypes: true }), + { toString: '' }, + 'bare "toString" results in { toString: "" }' + ); + + st.end(); + }); + + t.test('does not crash when the global Object prototype is frozen', { skip: !hasPropertyDescriptors || !hasOverrideMistake }, function (st) { + // We can't actually freeze the global Object prototype as that will interfere with other tests, and once an object is frozen, it + // can't be unfrozen. Instead, we add a new non-writable property to simulate this. + st.teardown(mockProperty(Object.prototype, 'frozenProp', { value: 'foo', nonWritable: true, nonEnumerable: true })); + + st['throws']( + function () { + var obj = {}; + obj.frozenProp = 'bar'; + }, + // node < 6 has a different error message + /^TypeError: Cannot assign to read only property 'frozenProp' of (?:object '#'|#)/, + 'regular assignment of an inherited non-writable property throws' + ); + + var parsed; + st.doesNotThrow( + function () { + parsed = qs.parse('frozenProp', { allowPrototypes: false }); + }, + 'parsing a nonwritable Object.prototype property does not throw' + ); + + st.deepEqual(parsed, {}, 'bare "frozenProp" results in {}'); + + st.end(); + }); + + t.test('params starting with a closing bracket', function (st) { + st.deepEqual(qs.parse(']=toString'), { ']': 'toString' }); + st.deepEqual(qs.parse(']]=toString'), { ']]': 'toString' }); + st.deepEqual(qs.parse(']hello]=toString'), { ']hello]': 'toString' }); + st.end(); + }); + + t.test('params starting with a starting bracket', function (st) { + st.deepEqual(qs.parse('[=toString'), { '[': 'toString' }); + st.deepEqual(qs.parse('[[=toString'), { '[[': 'toString' }); + st.deepEqual(qs.parse('[hello[=toString'), { '[hello[': 'toString' }); + st.end(); + }); + + t.test('add keys to objects', function (st) { + st.deepEqual( + qs.parse('a[b]=c&a=d'), + { a: { b: 'c', d: true } }, + 'can add keys to objects' + ); + + st.deepEqual( + qs.parse('a[b]=c&a=toString'), + { a: { b: 'c' } }, + 'can not overwrite prototype' + ); + + st.deepEqual( + qs.parse('a[b]=c&a=toString', { allowPrototypes: true }), + { a: { b: 'c', toString: true } }, + 'can overwrite prototype with allowPrototypes true' + ); + + st.deepEqual( + qs.parse('a[b]=c&a=toString', { plainObjects: true }), + { __proto__: null, a: { __proto__: null, b: 'c', toString: true } }, + 'can overwrite prototype with plainObjects true' + ); + + st.end(); + }); + + t.test('dunder proto is ignored', function (st) { + var payload = 'categories[__proto__]=login&categories[__proto__]&categories[length]=42'; + var result = qs.parse(payload, { allowPrototypes: true }); + + st.deepEqual( + result, + { + categories: { + length: '42' + } + }, + 'silent [[Prototype]] payload' + ); + + var plainResult = qs.parse(payload, { allowPrototypes: true, plainObjects: true }); + + st.deepEqual( + plainResult, + { + __proto__: null, + categories: { + __proto__: null, + length: '42' + } + }, + 'silent [[Prototype]] payload: plain objects' + ); + + var query = qs.parse('categories[__proto__]=cats&categories[__proto__]=dogs&categories[some][json]=toInject', { allowPrototypes: true }); + + st.notOk(Array.isArray(query.categories), 'is not an array'); + st.notOk(query.categories instanceof Array, 'is not instanceof an array'); + st.deepEqual(query.categories, { some: { json: 'toInject' } }); + st.equal(JSON.stringify(query.categories), '{"some":{"json":"toInject"}}', 'stringifies as a non-array'); + + st.deepEqual( + qs.parse('foo[__proto__][hidden]=value&foo[bar]=stuffs', { allowPrototypes: true }), + { + foo: { + bar: 'stuffs' + } + }, + 'hidden values' + ); + + st.deepEqual( + qs.parse('foo[__proto__][hidden]=value&foo[bar]=stuffs', { allowPrototypes: true, plainObjects: true }), + { + __proto__: null, + foo: { + __proto__: null, + bar: 'stuffs' + } + }, + 'hidden values: plain objects' + ); + + st.end(); + }); + + t.test('can return null objects', { skip: !Object.create }, function (st) { + var expected = Object.create(null); + expected.a = Object.create(null); + expected.a.b = 'c'; + expected.a.hasOwnProperty = 'd'; + st.deepEqual(qs.parse('a[b]=c&a[hasOwnProperty]=d', { plainObjects: true }), expected); + st.deepEqual(qs.parse(null, { plainObjects: true }), Object.create(null)); + var expectedArray = Object.create(null); + expectedArray.a = Object.create(null); + expectedArray.a[0] = 'b'; + expectedArray.a.c = 'd'; + st.deepEqual(qs.parse('a[]=b&a[c]=d', { plainObjects: true }), expectedArray); + st.end(); + }); + + t.test('can parse with custom encoding', function (st) { + st.deepEqual(qs.parse('%8c%a7=%91%e5%8d%e3%95%7b', { + decoder: function (str) { + var reg = /%([0-9A-F]{2})/ig; + var result = []; + var parts = reg.exec(str); + while (parts) { + result.push(parseInt(parts[1], 16)); + parts = reg.exec(str); + } + return String(iconv.decode(SaferBuffer.from(result), 'shift_jis')); + } + }), { 県: '大阪府' }); + st.end(); + }); + + t.test('receives the default decoder as a second argument', function (st) { + st.plan(1); + qs.parse('a', { + decoder: function (str, defaultDecoder) { + st.equal(defaultDecoder, utils.decode); + } + }); + st.end(); + }); + + t.test('throws error with wrong decoder', function (st) { + st['throws'](function () { + qs.parse({}, { decoder: 'string' }); + }, new TypeError('Decoder has to be a function.')); + st.end(); + }); + + t.test('does not mutate the options argument', function (st) { + var options = {}; + qs.parse('a[b]=true', options); + st.deepEqual(options, {}); + st.end(); + }); + + t.test('throws if an invalid charset is specified', function (st) { + st['throws'](function () { + qs.parse('a=b', { charset: 'foobar' }); + }, new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined')); + st.end(); + }); + + t.test('parses an iso-8859-1 string if asked to', function (st) { + st.deepEqual(qs.parse('%A2=%BD', { charset: 'iso-8859-1' }), { '¢': '½' }); + st.end(); + }); + + var urlEncodedCheckmarkInUtf8 = '%E2%9C%93'; + var urlEncodedOSlashInUtf8 = '%C3%B8'; + var urlEncodedNumCheckmark = '%26%2310003%3B'; + var urlEncodedNumSmiley = '%26%239786%3B'; + + t.test('prefers an utf-8 charset specified by the utf8 sentinel to a default charset of iso-8859-1', function (st) { + st.deepEqual(qs.parse('utf8=' + urlEncodedCheckmarkInUtf8 + '&' + urlEncodedOSlashInUtf8 + '=' + urlEncodedOSlashInUtf8, { charsetSentinel: true, charset: 'iso-8859-1' }), { ø: 'ø' }); + st.end(); + }); + + t.test('prefers an iso-8859-1 charset specified by the utf8 sentinel to a default charset of utf-8', function (st) { + st.deepEqual(qs.parse('utf8=' + urlEncodedNumCheckmark + '&' + urlEncodedOSlashInUtf8 + '=' + urlEncodedOSlashInUtf8, { charsetSentinel: true, charset: 'utf-8' }), { 'ø': 'ø' }); + st.end(); + }); + + t.test('does not require the utf8 sentinel to be defined before the parameters whose decoding it affects', function (st) { + st.deepEqual(qs.parse('a=' + urlEncodedOSlashInUtf8 + '&utf8=' + urlEncodedNumCheckmark, { charsetSentinel: true, charset: 'utf-8' }), { a: 'ø' }); + st.end(); + }); + + t.test('should ignore an utf8 sentinel with an unknown value', function (st) { + st.deepEqual(qs.parse('utf8=foo&' + urlEncodedOSlashInUtf8 + '=' + urlEncodedOSlashInUtf8, { charsetSentinel: true, charset: 'utf-8' }), { ø: 'ø' }); + st.end(); + }); + + t.test('uses the utf8 sentinel to switch to utf-8 when no default charset is given', function (st) { + st.deepEqual(qs.parse('utf8=' + urlEncodedCheckmarkInUtf8 + '&' + urlEncodedOSlashInUtf8 + '=' + urlEncodedOSlashInUtf8, { charsetSentinel: true }), { ø: 'ø' }); + st.end(); + }); + + t.test('uses the utf8 sentinel to switch to iso-8859-1 when no default charset is given', function (st) { + st.deepEqual(qs.parse('utf8=' + urlEncodedNumCheckmark + '&' + urlEncodedOSlashInUtf8 + '=' + urlEncodedOSlashInUtf8, { charsetSentinel: true }), { 'ø': 'ø' }); + st.end(); + }); + + t.test('interprets numeric entities in iso-8859-1 when `interpretNumericEntities`', function (st) { + st.deepEqual(qs.parse('foo=' + urlEncodedNumSmiley, { charset: 'iso-8859-1', interpretNumericEntities: true }), { foo: '☺' }); + st.end(); + }); + + t.test('handles a custom decoder returning `null`, in the `iso-8859-1` charset, when `interpretNumericEntities`', function (st) { + st.deepEqual(qs.parse('foo=&bar=' + urlEncodedNumSmiley, { + charset: 'iso-8859-1', + decoder: function (str, defaultDecoder, charset) { + return str ? defaultDecoder(str, defaultDecoder, charset) : null; + }, + interpretNumericEntities: true + }), { foo: null, bar: '☺' }); + st.end(); + }); + + t.test('does not interpret numeric entities in iso-8859-1 when `interpretNumericEntities` is absent', function (st) { + st.deepEqual(qs.parse('foo=' + urlEncodedNumSmiley, { charset: 'iso-8859-1' }), { foo: '☺' }); + st.end(); + }); + + t.test('does not interpret numeric entities when the charset is utf-8, even when `interpretNumericEntities`', function (st) { + st.deepEqual(qs.parse('foo=' + urlEncodedNumSmiley, { charset: 'utf-8', interpretNumericEntities: true }), { foo: '☺' }); + st.end(); + }); + + t.test('does not interpret %uXXXX syntax in iso-8859-1 mode', function (st) { + st.deepEqual(qs.parse('%u263A=%u263A', { charset: 'iso-8859-1' }), { '%u263A': '%u263A' }); + st.end(); + }); + + t.test('allows for decoding keys and values differently', function (st) { + var decoder = function (str, defaultDecoder, charset, type) { + if (type === 'key') { + return defaultDecoder(str, defaultDecoder, charset, type).toLowerCase(); + } + if (type === 'value') { + return defaultDecoder(str, defaultDecoder, charset, type).toUpperCase(); + } + throw 'this should never happen! type: ' + type; + }; + + st.deepEqual(qs.parse('KeY=vAlUe', { decoder: decoder }), { key: 'VALUE' }); + st.end(); + }); + + t.end(); +}); + +test('parses empty keys', function (t) { + emptyTestCases.forEach(function (testCase) { + t.test('skips empty string key with ' + testCase.input, function (st) { + st.deepEqual(qs.parse(testCase.input), testCase.noEmptyKeys); + + st.end(); + }); + }); +}); + +test('`duplicates` option', function (t) { + v.nonStrings.concat('not a valid option').forEach(function (invalidOption) { + if (typeof invalidOption !== 'undefined') { + t['throws']( + function () { qs.parse('', { duplicates: invalidOption }); }, + TypeError, + 'throws on invalid option: ' + inspect(invalidOption) + ); + } + }); + + t.deepEqual( + qs.parse('foo=bar&foo=baz'), + { foo: ['bar', 'baz'] }, + 'duplicates: default, combine' + ); + + t.deepEqual( + qs.parse('foo=bar&foo=baz', { duplicates: 'combine' }), + { foo: ['bar', 'baz'] }, + 'duplicates: combine' + ); + + t.deepEqual( + qs.parse('foo=bar&foo=baz', { duplicates: 'first' }), + { foo: 'bar' }, + 'duplicates: first' + ); + + t.deepEqual( + qs.parse('foo=bar&foo=baz', { duplicates: 'last' }), + { foo: 'baz' }, + 'duplicates: last' + ); + + t.end(); +}); + +test('qs strictDepth option - throw cases', function (t) { + t.test('throws an exception when depth exceeds the limit with strictDepth: true', function (st) { + st['throws']( + function () { + qs.parse('a[b][c][d][e][f][g][h][i]=j', { depth: 1, strictDepth: true }); + }, + RangeError, + 'Should throw RangeError' + ); + st.end(); + }); + + t.test('throws an exception for multiple nested arrays with strictDepth: true', function (st) { + st['throws']( + function () { + qs.parse('a[0][1][2][3][4]=b', { depth: 3, strictDepth: true }); + }, + RangeError, + 'Should throw RangeError' + ); + st.end(); + }); + + t.test('throws an exception for nested objects and arrays with strictDepth: true', function (st) { + st['throws']( + function () { + qs.parse('a[b][c][0][d][e]=f', { depth: 3, strictDepth: true }); + }, + RangeError, + 'Should throw RangeError' + ); + st.end(); + }); + + t.test('throws an exception for different types of values with strictDepth: true', function (st) { + st['throws']( + function () { + qs.parse('a[b][c][d][e]=true&a[b][c][d][f]=42', { depth: 3, strictDepth: true }); + }, + RangeError, + 'Should throw RangeError' + ); + st.end(); + }); + +}); + +test('qs strictDepth option - non-throw cases', function (t) { + t.test('when depth is 0 and strictDepth true, do not throw', function (st) { + st.doesNotThrow( + function () { + qs.parse('a[b][c][d][e]=true&a[b][c][d][f]=42', { depth: 0, strictDepth: true }); + }, + RangeError, + 'Should not throw RangeError' + ); + st.end(); + }); + + t.test('parses successfully when depth is within the limit with strictDepth: true', function (st) { + st.doesNotThrow( + function () { + var result = qs.parse('a[b]=c', { depth: 1, strictDepth: true }); + st.deepEqual(result, { a: { b: 'c' } }, 'Should parse correctly'); + } + ); + st.end(); + }); + + t.test('does not throw an exception when depth exceeds the limit with strictDepth: false', function (st) { + st.doesNotThrow( + function () { + var result = qs.parse('a[b][c][d][e][f][g][h][i]=j', { depth: 1 }); + st.deepEqual(result, { a: { b: { '[c][d][e][f][g][h][i]': 'j' } } }, 'Should parse with depth limit'); + } + ); + st.end(); + }); + + t.test('parses successfully when depth is within the limit with strictDepth: false', function (st) { + st.doesNotThrow( + function () { + var result = qs.parse('a[b]=c', { depth: 1 }); + st.deepEqual(result, { a: { b: 'c' } }, 'Should parse correctly'); + } + ); + st.end(); + }); + + t.test('does not throw when depth is exactly at the limit with strictDepth: true', function (st) { + st.doesNotThrow( + function () { + var result = qs.parse('a[b][c]=d', { depth: 2, strictDepth: true }); + st.deepEqual(result, { a: { b: { c: 'd' } } }, 'Should parse correctly'); + } + ); + st.end(); + }); +}); diff --git a/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/test/stringify.js b/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/test/stringify.js new file mode 100644 index 000000000000..12b1c71d6dc3 --- /dev/null +++ b/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/test/stringify.js @@ -0,0 +1,1298 @@ +'use strict'; + +var test = require('tape'); +var qs = require('../'); +var utils = require('../lib/utils'); +var iconv = require('iconv-lite'); +var SaferBuffer = require('safer-buffer').Buffer; +var hasSymbols = require('has-symbols'); +var mockProperty = require('mock-property'); +var emptyTestCases = require('./empty-keys-cases').emptyTestCases; +var hasBigInt = typeof BigInt === 'function'; + +test('stringify()', function (t) { + t.test('stringifies a querystring object', function (st) { + st.equal(qs.stringify({ a: 'b' }), 'a=b'); + st.equal(qs.stringify({ a: 1 }), 'a=1'); + st.equal(qs.stringify({ a: 1, b: 2 }), 'a=1&b=2'); + st.equal(qs.stringify({ a: 'A_Z' }), 'a=A_Z'); + st.equal(qs.stringify({ a: '€' }), 'a=%E2%82%AC'); + st.equal(qs.stringify({ a: '' }), 'a=%EE%80%80'); + st.equal(qs.stringify({ a: 'א' }), 'a=%D7%90'); + st.equal(qs.stringify({ a: '𐐷' }), 'a=%F0%90%90%B7'); + st.end(); + }); + + t.test('stringifies falsy values', function (st) { + st.equal(qs.stringify(undefined), ''); + st.equal(qs.stringify(null), ''); + st.equal(qs.stringify(null, { strictNullHandling: true }), ''); + st.equal(qs.stringify(false), ''); + st.equal(qs.stringify(0), ''); + st.end(); + }); + + t.test('stringifies symbols', { skip: !hasSymbols() }, function (st) { + st.equal(qs.stringify(Symbol.iterator), ''); + st.equal(qs.stringify([Symbol.iterator]), '0=Symbol%28Symbol.iterator%29'); + st.equal(qs.stringify({ a: Symbol.iterator }), 'a=Symbol%28Symbol.iterator%29'); + st.equal( + qs.stringify({ a: [Symbol.iterator] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), + 'a[]=Symbol%28Symbol.iterator%29' + ); + st.end(); + }); + + t.test('stringifies bigints', { skip: !hasBigInt }, function (st) { + var three = BigInt(3); + var encodeWithN = function (value, defaultEncoder, charset) { + var result = defaultEncoder(value, defaultEncoder, charset); + return typeof value === 'bigint' ? result + 'n' : result; + }; + st.equal(qs.stringify(three), ''); + st.equal(qs.stringify([three]), '0=3'); + st.equal(qs.stringify([three], { encoder: encodeWithN }), '0=3n'); + st.equal(qs.stringify({ a: three }), 'a=3'); + st.equal(qs.stringify({ a: three }, { encoder: encodeWithN }), 'a=3n'); + st.equal( + qs.stringify({ a: [three] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), + 'a[]=3' + ); + st.equal( + qs.stringify({ a: [three] }, { encodeValuesOnly: true, encoder: encodeWithN, arrayFormat: 'brackets' }), + 'a[]=3n' + ); + st.end(); + }); + + t.test('encodes dot in key of object when encodeDotInKeys and allowDots is provided', function (st) { + st.equal( + qs.stringify( + { 'name.obj': { first: 'John', last: 'Doe' } }, + { allowDots: false, encodeDotInKeys: false } + ), + 'name.obj%5Bfirst%5D=John&name.obj%5Blast%5D=Doe', + 'with allowDots false and encodeDotInKeys false' + ); + st.equal( + qs.stringify( + { 'name.obj': { first: 'John', last: 'Doe' } }, + { allowDots: true, encodeDotInKeys: false } + ), + 'name.obj.first=John&name.obj.last=Doe', + 'with allowDots true and encodeDotInKeys false' + ); + st.equal( + qs.stringify( + { 'name.obj': { first: 'John', last: 'Doe' } }, + { allowDots: false, encodeDotInKeys: true } + ), + 'name%252Eobj%5Bfirst%5D=John&name%252Eobj%5Blast%5D=Doe', + 'with allowDots false and encodeDotInKeys true' + ); + st.equal( + qs.stringify( + { 'name.obj': { first: 'John', last: 'Doe' } }, + { allowDots: true, encodeDotInKeys: true } + ), + 'name%252Eobj.first=John&name%252Eobj.last=Doe', + 'with allowDots true and encodeDotInKeys true' + ); + + st.equal( + qs.stringify( + { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, + { allowDots: false, encodeDotInKeys: false } + ), + 'name.obj.subobject%5Bfirst.godly.name%5D=John&name.obj.subobject%5Blast%5D=Doe', + 'with allowDots false and encodeDotInKeys false' + ); + st.equal( + qs.stringify( + { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, + { allowDots: true, encodeDotInKeys: false } + ), + 'name.obj.subobject.first.godly.name=John&name.obj.subobject.last=Doe', + 'with allowDots false and encodeDotInKeys false' + ); + st.equal( + qs.stringify( + { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, + { allowDots: false, encodeDotInKeys: true } + ), + 'name%252Eobj%252Esubobject%5Bfirst.godly.name%5D=John&name%252Eobj%252Esubobject%5Blast%5D=Doe', + 'with allowDots false and encodeDotInKeys true' + ); + st.equal( + qs.stringify( + { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, + { allowDots: true, encodeDotInKeys: true } + ), + 'name%252Eobj%252Esubobject.first%252Egodly%252Ename=John&name%252Eobj%252Esubobject.last=Doe', + 'with allowDots true and encodeDotInKeys true' + ); + + st.end(); + }); + + t.test('should encode dot in key of object, and automatically set allowDots to `true` when encodeDotInKeys is true and allowDots in undefined', function (st) { + st.equal( + qs.stringify( + { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, + { encodeDotInKeys: true } + ), + 'name%252Eobj%252Esubobject.first%252Egodly%252Ename=John&name%252Eobj%252Esubobject.last=Doe', + 'with allowDots undefined and encodeDotInKeys true' + ); + st.end(); + }); + + t.test('should encode dot in key of object when encodeDotInKeys and allowDots is provided, and nothing else when encodeValuesOnly is provided', function (st) { + st.equal( + qs.stringify({ 'name.obj': { first: 'John', last: 'Doe' } }, { + encodeDotInKeys: true, allowDots: true, encodeValuesOnly: true + }), + 'name%2Eobj.first=John&name%2Eobj.last=Doe' + ); + + st.equal( + qs.stringify({ 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, { allowDots: true, encodeDotInKeys: true, encodeValuesOnly: true }), + 'name%2Eobj%2Esubobject.first%2Egodly%2Ename=John&name%2Eobj%2Esubobject.last=Doe' + ); + + st.end(); + }); + + t.test('throws when `commaRoundTrip` is not a boolean', function (st) { + st['throws']( + function () { qs.stringify({}, { commaRoundTrip: 'not a boolean' }); }, + TypeError, + 'throws when `commaRoundTrip` is not a boolean' + ); + + st.end(); + }); + + t.test('throws when `encodeDotInKeys` is not a boolean', function (st) { + st['throws']( + function () { qs.stringify({ a: [], b: 'zz' }, { encodeDotInKeys: 'foobar' }); }, + TypeError + ); + + st['throws']( + function () { qs.stringify({ a: [], b: 'zz' }, { encodeDotInKeys: 0 }); }, + TypeError + ); + + st['throws']( + function () { qs.stringify({ a: [], b: 'zz' }, { encodeDotInKeys: NaN }); }, + TypeError + ); + + st['throws']( + function () { qs.stringify({ a: [], b: 'zz' }, { encodeDotInKeys: null }); }, + TypeError + ); + + st.end(); + }); + + t.test('adds query prefix', function (st) { + st.equal(qs.stringify({ a: 'b' }, { addQueryPrefix: true }), '?a=b'); + st.end(); + }); + + t.test('with query prefix, outputs blank string given an empty object', function (st) { + st.equal(qs.stringify({}, { addQueryPrefix: true }), ''); + st.end(); + }); + + t.test('stringifies nested falsy values', function (st) { + st.equal(qs.stringify({ a: { b: { c: null } } }), 'a%5Bb%5D%5Bc%5D='); + st.equal(qs.stringify({ a: { b: { c: null } } }, { strictNullHandling: true }), 'a%5Bb%5D%5Bc%5D'); + st.equal(qs.stringify({ a: { b: { c: false } } }), 'a%5Bb%5D%5Bc%5D=false'); + st.end(); + }); + + t.test('stringifies a nested object', function (st) { + st.equal(qs.stringify({ a: { b: 'c' } }), 'a%5Bb%5D=c'); + st.equal(qs.stringify({ a: { b: { c: { d: 'e' } } } }), 'a%5Bb%5D%5Bc%5D%5Bd%5D=e'); + st.end(); + }); + + t.test('`allowDots` option: stringifies a nested object with dots notation', function (st) { + st.equal(qs.stringify({ a: { b: 'c' } }, { allowDots: true }), 'a.b=c'); + st.equal(qs.stringify({ a: { b: { c: { d: 'e' } } } }, { allowDots: true }), 'a.b.c.d=e'); + st.end(); + }); + + t.test('stringifies an array value', function (st) { + st.equal( + qs.stringify({ a: ['b', 'c', 'd'] }, { arrayFormat: 'indices' }), + 'a%5B0%5D=b&a%5B1%5D=c&a%5B2%5D=d', + 'indices => indices' + ); + st.equal( + qs.stringify({ a: ['b', 'c', 'd'] }, { arrayFormat: 'brackets' }), + 'a%5B%5D=b&a%5B%5D=c&a%5B%5D=d', + 'brackets => brackets' + ); + st.equal( + qs.stringify({ a: ['b', 'c', 'd'] }, { arrayFormat: 'comma' }), + 'a=b%2Cc%2Cd', + 'comma => comma' + ); + st.equal( + qs.stringify({ a: ['b', 'c', 'd'] }, { arrayFormat: 'comma', commaRoundTrip: true }), + 'a=b%2Cc%2Cd', + 'comma round trip => comma' + ); + st.equal( + qs.stringify({ a: ['b', 'c', 'd'] }), + 'a%5B0%5D=b&a%5B1%5D=c&a%5B2%5D=d', + 'default => indices' + ); + st.end(); + }); + + t.test('`skipNulls` option', function (st) { + st.equal( + qs.stringify({ a: 'b', c: null }, { skipNulls: true }), + 'a=b', + 'omits nulls when asked' + ); + + st.equal( + qs.stringify({ a: { b: 'c', d: null } }, { skipNulls: true }), + 'a%5Bb%5D=c', + 'omits nested nulls when asked' + ); + + st.end(); + }); + + t.test('omits array indices when asked', function (st) { + st.equal(qs.stringify({ a: ['b', 'c', 'd'] }, { indices: false }), 'a=b&a=c&a=d'); + + st.end(); + }); + + t.test('omits object key/value pair when value is empty array', function (st) { + st.equal(qs.stringify({ a: [], b: 'zz' }), 'b=zz'); + + st.end(); + }); + + t.test('should not omit object key/value pair when value is empty array and when asked', function (st) { + st.equal(qs.stringify({ a: [], b: 'zz' }), 'b=zz'); + st.equal(qs.stringify({ a: [], b: 'zz' }, { allowEmptyArrays: false }), 'b=zz'); + st.equal(qs.stringify({ a: [], b: 'zz' }, { allowEmptyArrays: true }), 'a[]&b=zz'); + + st.end(); + }); + + t.test('should throw when allowEmptyArrays is not of type boolean', function (st) { + st['throws']( + function () { qs.stringify({ a: [], b: 'zz' }, { allowEmptyArrays: 'foobar' }); }, + TypeError + ); + + st['throws']( + function () { qs.stringify({ a: [], b: 'zz' }, { allowEmptyArrays: 0 }); }, + TypeError + ); + + st['throws']( + function () { qs.stringify({ a: [], b: 'zz' }, { allowEmptyArrays: NaN }); }, + TypeError + ); + + st['throws']( + function () { qs.stringify({ a: [], b: 'zz' }, { allowEmptyArrays: null }); }, + TypeError + ); + + st.end(); + }); + + t.test('allowEmptyArrays + strictNullHandling', function (st) { + st.equal( + qs.stringify( + { testEmptyArray: [] }, + { strictNullHandling: true, allowEmptyArrays: true } + ), + 'testEmptyArray[]' + ); + + st.end(); + }); + + t.test('stringifies an array value with one item vs multiple items', function (st) { + st.test('non-array item', function (s2t) { + s2t.equal(qs.stringify({ a: 'c' }, { encodeValuesOnly: true, arrayFormat: 'indices' }), 'a=c'); + s2t.equal(qs.stringify({ a: 'c' }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a=c'); + s2t.equal(qs.stringify({ a: 'c' }, { encodeValuesOnly: true, arrayFormat: 'comma' }), 'a=c'); + s2t.equal(qs.stringify({ a: 'c' }, { encodeValuesOnly: true }), 'a=c'); + + s2t.end(); + }); + + st.test('array with a single item', function (s2t) { + s2t.equal(qs.stringify({ a: ['c'] }, { encodeValuesOnly: true, arrayFormat: 'indices' }), 'a[0]=c'); + s2t.equal(qs.stringify({ a: ['c'] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a[]=c'); + s2t.equal(qs.stringify({ a: ['c'] }, { encodeValuesOnly: true, arrayFormat: 'comma' }), 'a=c'); + s2t.equal(qs.stringify({ a: ['c'] }, { encodeValuesOnly: true, arrayFormat: 'comma', commaRoundTrip: true }), 'a[]=c'); // so it parses back as an array + s2t.equal(qs.stringify({ a: ['c'] }, { encodeValuesOnly: true }), 'a[0]=c'); + + s2t.end(); + }); + + st.test('array with multiple items', function (s2t) { + s2t.equal(qs.stringify({ a: ['c', 'd'] }, { encodeValuesOnly: true, arrayFormat: 'indices' }), 'a[0]=c&a[1]=d'); + s2t.equal(qs.stringify({ a: ['c', 'd'] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a[]=c&a[]=d'); + s2t.equal(qs.stringify({ a: ['c', 'd'] }, { encodeValuesOnly: true, arrayFormat: 'comma' }), 'a=c,d'); + s2t.equal(qs.stringify({ a: ['c', 'd'] }, { encodeValuesOnly: true, arrayFormat: 'comma', commaRoundTrip: true }), 'a=c,d'); + s2t.equal(qs.stringify({ a: ['c', 'd'] }, { encodeValuesOnly: true }), 'a[0]=c&a[1]=d'); + + s2t.end(); + }); + + st.test('array with multiple items with a comma inside', function (s2t) { + s2t.equal(qs.stringify({ a: ['c,d', 'e'] }, { encodeValuesOnly: true, arrayFormat: 'comma' }), 'a=c%2Cd,e'); + s2t.equal(qs.stringify({ a: ['c,d', 'e'] }, { arrayFormat: 'comma' }), 'a=c%2Cd%2Ce'); + + s2t.equal(qs.stringify({ a: ['c,d', 'e'] }, { encodeValuesOnly: true, arrayFormat: 'comma', commaRoundTrip: true }), 'a=c%2Cd,e'); + s2t.equal(qs.stringify({ a: ['c,d', 'e'] }, { arrayFormat: 'comma', commaRoundTrip: true }), 'a=c%2Cd%2Ce'); + + s2t.end(); + }); + + st.end(); + }); + + t.test('stringifies a nested array value', function (st) { + st.equal(qs.stringify({ a: { b: ['c', 'd'] } }, { encodeValuesOnly: true, arrayFormat: 'indices' }), 'a[b][0]=c&a[b][1]=d'); + st.equal(qs.stringify({ a: { b: ['c', 'd'] } }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a[b][]=c&a[b][]=d'); + st.equal(qs.stringify({ a: { b: ['c', 'd'] } }, { encodeValuesOnly: true, arrayFormat: 'comma' }), 'a[b]=c,d'); + st.equal(qs.stringify({ a: { b: ['c', 'd'] } }, { encodeValuesOnly: true }), 'a[b][0]=c&a[b][1]=d'); + st.end(); + }); + + t.test('stringifies comma and empty array values', function (st) { + st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: false, arrayFormat: 'indices' }), 'a[0]=,&a[1]=&a[2]=c,d%'); + st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: false, arrayFormat: 'brackets' }), 'a[]=,&a[]=&a[]=c,d%'); + st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: false, arrayFormat: 'comma' }), 'a=,,,c,d%'); + st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: false, arrayFormat: 'repeat' }), 'a=,&a=&a=c,d%'); + + st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: true, arrayFormat: 'indices' }), 'a[0]=%2C&a[1]=&a[2]=c%2Cd%25'); + st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a[]=%2C&a[]=&a[]=c%2Cd%25'); + st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: true, arrayFormat: 'comma' }), 'a=%2C,,c%2Cd%25'); + st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: true, arrayFormat: 'repeat' }), 'a=%2C&a=&a=c%2Cd%25'); + + st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: false, arrayFormat: 'indices' }), 'a%5B0%5D=%2C&a%5B1%5D=&a%5B2%5D=c%2Cd%25'); + st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: false, arrayFormat: 'brackets' }), 'a%5B%5D=%2C&a%5B%5D=&a%5B%5D=c%2Cd%25'); + st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: false, arrayFormat: 'comma' }), 'a=%2C%2C%2Cc%2Cd%25'); + st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: false, arrayFormat: 'repeat' }), 'a=%2C&a=&a=c%2Cd%25'); + + st.end(); + }); + + t.test('stringifies comma and empty non-array values', function (st) { + st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: false, arrayFormat: 'indices' }), 'a=,&b=&c=c,d%'); + st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: false, arrayFormat: 'brackets' }), 'a=,&b=&c=c,d%'); + st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: false, arrayFormat: 'comma' }), 'a=,&b=&c=c,d%'); + st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: false, arrayFormat: 'repeat' }), 'a=,&b=&c=c,d%'); + + st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: true, encodeValuesOnly: true, arrayFormat: 'indices' }), 'a=%2C&b=&c=c%2Cd%25'); + st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: true, encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a=%2C&b=&c=c%2Cd%25'); + st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: true, encodeValuesOnly: true, arrayFormat: 'comma' }), 'a=%2C&b=&c=c%2Cd%25'); + st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: true, encodeValuesOnly: true, arrayFormat: 'repeat' }), 'a=%2C&b=&c=c%2Cd%25'); + + st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: true, encodeValuesOnly: false, arrayFormat: 'indices' }), 'a=%2C&b=&c=c%2Cd%25'); + st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: true, encodeValuesOnly: false, arrayFormat: 'brackets' }), 'a=%2C&b=&c=c%2Cd%25'); + st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: true, encodeValuesOnly: false, arrayFormat: 'comma' }), 'a=%2C&b=&c=c%2Cd%25'); + st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: true, encodeValuesOnly: false, arrayFormat: 'repeat' }), 'a=%2C&b=&c=c%2Cd%25'); + + st.end(); + }); + + t.test('stringifies a nested array value with dots notation', function (st) { + st.equal( + qs.stringify( + { a: { b: ['c', 'd'] } }, + { allowDots: true, encodeValuesOnly: true, arrayFormat: 'indices' } + ), + 'a.b[0]=c&a.b[1]=d', + 'indices: stringifies with dots + indices' + ); + st.equal( + qs.stringify( + { a: { b: ['c', 'd'] } }, + { allowDots: true, encodeValuesOnly: true, arrayFormat: 'brackets' } + ), + 'a.b[]=c&a.b[]=d', + 'brackets: stringifies with dots + brackets' + ); + st.equal( + qs.stringify( + { a: { b: ['c', 'd'] } }, + { allowDots: true, encodeValuesOnly: true, arrayFormat: 'comma' } + ), + 'a.b=c,d', + 'comma: stringifies with dots + comma' + ); + st.equal( + qs.stringify( + { a: { b: ['c', 'd'] } }, + { allowDots: true, encodeValuesOnly: true } + ), + 'a.b[0]=c&a.b[1]=d', + 'default: stringifies with dots + indices' + ); + st.end(); + }); + + t.test('stringifies an object inside an array', function (st) { + st.equal( + qs.stringify({ a: [{ b: 'c' }] }, { arrayFormat: 'indices', encodeValuesOnly: true }), + 'a[0][b]=c', + 'indices => indices' + ); + st.equal( + qs.stringify({ a: [{ b: 'c' }] }, { arrayFormat: 'repeat', encodeValuesOnly: true }), + 'a[b]=c', + 'repeat => repeat' + ); + st.equal( + qs.stringify({ a: [{ b: 'c' }] }, { arrayFormat: 'brackets', encodeValuesOnly: true }), + 'a[][b]=c', + 'brackets => brackets' + ); + st.equal( + qs.stringify({ a: [{ b: 'c' }] }, { encodeValuesOnly: true }), + 'a[0][b]=c', + 'default => indices' + ); + + st.equal( + qs.stringify({ a: [{ b: { c: [1] } }] }, { arrayFormat: 'indices', encodeValuesOnly: true }), + 'a[0][b][c][0]=1', + 'indices => indices' + ); + st.equal( + qs.stringify({ a: [{ b: { c: [1] } }] }, { arrayFormat: 'repeat', encodeValuesOnly: true }), + 'a[b][c]=1', + 'repeat => repeat' + ); + st.equal( + qs.stringify({ a: [{ b: { c: [1] } }] }, { arrayFormat: 'brackets', encodeValuesOnly: true }), + 'a[][b][c][]=1', + 'brackets => brackets' + ); + st.equal( + qs.stringify({ a: [{ b: { c: [1] } }] }, { encodeValuesOnly: true }), + 'a[0][b][c][0]=1', + 'default => indices' + ); + + st.end(); + }); + + t.test('stringifies an array with mixed objects and primitives', function (st) { + st.equal( + qs.stringify({ a: [{ b: 1 }, 2, 3] }, { encodeValuesOnly: true, arrayFormat: 'indices' }), + 'a[0][b]=1&a[1]=2&a[2]=3', + 'indices => indices' + ); + st.equal( + qs.stringify({ a: [{ b: 1 }, 2, 3] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), + 'a[][b]=1&a[]=2&a[]=3', + 'brackets => brackets' + ); + st.equal( + qs.stringify({ a: [{ b: 1 }, 2, 3] }, { encodeValuesOnly: true, arrayFormat: 'comma' }), + '???', + 'brackets => brackets', + { skip: 'TODO: figure out what this should do' } + ); + st.equal( + qs.stringify({ a: [{ b: 1 }, 2, 3] }, { encodeValuesOnly: true }), + 'a[0][b]=1&a[1]=2&a[2]=3', + 'default => indices' + ); + + st.end(); + }); + + t.test('stringifies an object inside an array with dots notation', function (st) { + st.equal( + qs.stringify( + { a: [{ b: 'c' }] }, + { allowDots: true, encode: false, arrayFormat: 'indices' } + ), + 'a[0].b=c', + 'indices => indices' + ); + st.equal( + qs.stringify( + { a: [{ b: 'c' }] }, + { allowDots: true, encode: false, arrayFormat: 'brackets' } + ), + 'a[].b=c', + 'brackets => brackets' + ); + st.equal( + qs.stringify( + { a: [{ b: 'c' }] }, + { allowDots: true, encode: false } + ), + 'a[0].b=c', + 'default => indices' + ); + + st.equal( + qs.stringify( + { a: [{ b: { c: [1] } }] }, + { allowDots: true, encode: false, arrayFormat: 'indices' } + ), + 'a[0].b.c[0]=1', + 'indices => indices' + ); + st.equal( + qs.stringify( + { a: [{ b: { c: [1] } }] }, + { allowDots: true, encode: false, arrayFormat: 'brackets' } + ), + 'a[].b.c[]=1', + 'brackets => brackets' + ); + st.equal( + qs.stringify( + { a: [{ b: { c: [1] } }] }, + { allowDots: true, encode: false } + ), + 'a[0].b.c[0]=1', + 'default => indices' + ); + + st.end(); + }); + + t.test('does not omit object keys when indices = false', function (st) { + st.equal(qs.stringify({ a: [{ b: 'c' }] }, { indices: false }), 'a%5Bb%5D=c'); + st.end(); + }); + + t.test('uses indices notation for arrays when indices=true', function (st) { + st.equal(qs.stringify({ a: ['b', 'c'] }, { indices: true }), 'a%5B0%5D=b&a%5B1%5D=c'); + st.end(); + }); + + t.test('uses indices notation for arrays when no arrayFormat is specified', function (st) { + st.equal(qs.stringify({ a: ['b', 'c'] }), 'a%5B0%5D=b&a%5B1%5D=c'); + st.end(); + }); + + t.test('uses indices notation for arrays when arrayFormat=indices', function (st) { + st.equal(qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'indices' }), 'a%5B0%5D=b&a%5B1%5D=c'); + st.end(); + }); + + t.test('uses repeat notation for arrays when arrayFormat=repeat', function (st) { + st.equal(qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'repeat' }), 'a=b&a=c'); + st.end(); + }); + + t.test('uses brackets notation for arrays when arrayFormat=brackets', function (st) { + st.equal(qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'brackets' }), 'a%5B%5D=b&a%5B%5D=c'); + st.end(); + }); + + t.test('stringifies a complicated object', function (st) { + st.equal(qs.stringify({ a: { b: 'c', d: 'e' } }), 'a%5Bb%5D=c&a%5Bd%5D=e'); + st.end(); + }); + + t.test('stringifies an empty value', function (st) { + st.equal(qs.stringify({ a: '' }), 'a='); + st.equal(qs.stringify({ a: null }, { strictNullHandling: true }), 'a'); + + st.equal(qs.stringify({ a: '', b: '' }), 'a=&b='); + st.equal(qs.stringify({ a: null, b: '' }, { strictNullHandling: true }), 'a&b='); + + st.equal(qs.stringify({ a: { b: '' } }), 'a%5Bb%5D='); + st.equal(qs.stringify({ a: { b: null } }, { strictNullHandling: true }), 'a%5Bb%5D'); + st.equal(qs.stringify({ a: { b: null } }, { strictNullHandling: false }), 'a%5Bb%5D='); + + st.end(); + }); + + t.test('stringifies an empty array in different arrayFormat', function (st) { + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false }), 'b[0]=&c=c'); + // arrayFormat default + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'indices' }), 'b[0]=&c=c'); + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'brackets' }), 'b[]=&c=c'); + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'repeat' }), 'b=&c=c'); + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'comma' }), 'b=&c=c'); + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'comma', commaRoundTrip: true }), 'b[]=&c=c'); + // with strictNullHandling + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'indices', strictNullHandling: true }), 'b[0]&c=c'); + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'brackets', strictNullHandling: true }), 'b[]&c=c'); + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'repeat', strictNullHandling: true }), 'b&c=c'); + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'comma', strictNullHandling: true }), 'b&c=c'); + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'comma', strictNullHandling: true, commaRoundTrip: true }), 'b[]&c=c'); + // with skipNulls + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'indices', skipNulls: true }), 'c=c'); + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'brackets', skipNulls: true }), 'c=c'); + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'repeat', skipNulls: true }), 'c=c'); + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'comma', skipNulls: true }), 'c=c'); + + st.end(); + }); + + t.test('stringifies a null object', { skip: !Object.create }, function (st) { + var obj = Object.create(null); + obj.a = 'b'; + st.equal(qs.stringify(obj), 'a=b'); + st.end(); + }); + + t.test('returns an empty string for invalid input', function (st) { + st.equal(qs.stringify(undefined), ''); + st.equal(qs.stringify(false), ''); + st.equal(qs.stringify(null), ''); + st.equal(qs.stringify(''), ''); + st.end(); + }); + + t.test('stringifies an object with a null object as a child', { skip: !Object.create }, function (st) { + var obj = { a: Object.create(null) }; + + obj.a.b = 'c'; + st.equal(qs.stringify(obj), 'a%5Bb%5D=c'); + st.end(); + }); + + t.test('drops keys with a value of undefined', function (st) { + st.equal(qs.stringify({ a: undefined }), ''); + + st.equal(qs.stringify({ a: { b: undefined, c: null } }, { strictNullHandling: true }), 'a%5Bc%5D'); + st.equal(qs.stringify({ a: { b: undefined, c: null } }, { strictNullHandling: false }), 'a%5Bc%5D='); + st.equal(qs.stringify({ a: { b: undefined, c: '' } }), 'a%5Bc%5D='); + st.end(); + }); + + t.test('url encodes values', function (st) { + st.equal(qs.stringify({ a: 'b c' }), 'a=b%20c'); + st.end(); + }); + + t.test('stringifies a date', function (st) { + var now = new Date(); + var str = 'a=' + encodeURIComponent(now.toISOString()); + st.equal(qs.stringify({ a: now }), str); + st.end(); + }); + + t.test('stringifies the weird object from qs', function (st) { + st.equal(qs.stringify({ 'my weird field': '~q1!2"\'w$5&7/z8)?' }), 'my%20weird%20field=~q1%212%22%27w%245%267%2Fz8%29%3F'); + st.end(); + }); + + t.test('skips properties that are part of the object prototype', function (st) { + st.intercept(Object.prototype, 'crash', { value: 'test' }); + + st.equal(qs.stringify({ a: 'b' }), 'a=b'); + st.equal(qs.stringify({ a: { b: 'c' } }), 'a%5Bb%5D=c'); + + st.end(); + }); + + t.test('stringifies boolean values', function (st) { + st.equal(qs.stringify({ a: true }), 'a=true'); + st.equal(qs.stringify({ a: { b: true } }), 'a%5Bb%5D=true'); + st.equal(qs.stringify({ b: false }), 'b=false'); + st.equal(qs.stringify({ b: { c: false } }), 'b%5Bc%5D=false'); + st.end(); + }); + + t.test('stringifies buffer values', function (st) { + st.equal(qs.stringify({ a: SaferBuffer.from('test') }), 'a=test'); + st.equal(qs.stringify({ a: { b: SaferBuffer.from('test') } }), 'a%5Bb%5D=test'); + st.end(); + }); + + t.test('stringifies an object using an alternative delimiter', function (st) { + st.equal(qs.stringify({ a: 'b', c: 'd' }, { delimiter: ';' }), 'a=b;c=d'); + st.end(); + }); + + t.test('does not blow up when Buffer global is missing', function (st) { + var restore = mockProperty(global, 'Buffer', { 'delete': true }); + + var result = qs.stringify({ a: 'b', c: 'd' }); + + restore(); + + st.equal(result, 'a=b&c=d'); + st.end(); + }); + + t.test('does not crash when parsing circular references', function (st) { + var a = {}; + a.b = a; + + st['throws']( + function () { qs.stringify({ 'foo[bar]': 'baz', 'foo[baz]': a }); }, + /RangeError: Cyclic object value/, + 'cyclic values throw' + ); + + var circular = { + a: 'value' + }; + circular.a = circular; + st['throws']( + function () { qs.stringify(circular); }, + /RangeError: Cyclic object value/, + 'cyclic values throw' + ); + + var arr = ['a']; + st.doesNotThrow( + function () { qs.stringify({ x: arr, y: arr }); }, + 'non-cyclic values do not throw' + ); + + st.end(); + }); + + t.test('non-circular duplicated references can still work', function (st) { + var hourOfDay = { + 'function': 'hour_of_day' + }; + + var p1 = { + 'function': 'gte', + arguments: [hourOfDay, 0] + }; + var p2 = { + 'function': 'lte', + arguments: [hourOfDay, 23] + }; + + st.equal( + qs.stringify({ filters: { $and: [p1, p2] } }, { encodeValuesOnly: true, arrayFormat: 'indices' }), + 'filters[$and][0][function]=gte&filters[$and][0][arguments][0][function]=hour_of_day&filters[$and][0][arguments][1]=0&filters[$and][1][function]=lte&filters[$and][1][arguments][0][function]=hour_of_day&filters[$and][1][arguments][1]=23' + ); + st.equal( + qs.stringify({ filters: { $and: [p1, p2] } }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), + 'filters[$and][][function]=gte&filters[$and][][arguments][][function]=hour_of_day&filters[$and][][arguments][]=0&filters[$and][][function]=lte&filters[$and][][arguments][][function]=hour_of_day&filters[$and][][arguments][]=23' + ); + st.equal( + qs.stringify({ filters: { $and: [p1, p2] } }, { encodeValuesOnly: true, arrayFormat: 'repeat' }), + 'filters[$and][function]=gte&filters[$and][arguments][function]=hour_of_day&filters[$and][arguments]=0&filters[$and][function]=lte&filters[$and][arguments][function]=hour_of_day&filters[$and][arguments]=23' + ); + + st.end(); + }); + + t.test('selects properties when filter=array', function (st) { + st.equal(qs.stringify({ a: 'b' }, { filter: ['a'] }), 'a=b'); + st.equal(qs.stringify({ a: 1 }, { filter: [] }), ''); + + st.equal( + qs.stringify( + { a: { b: [1, 2, 3, 4], c: 'd' }, c: 'f' }, + { filter: ['a', 'b', 0, 2], arrayFormat: 'indices' } + ), + 'a%5Bb%5D%5B0%5D=1&a%5Bb%5D%5B2%5D=3', + 'indices => indices' + ); + st.equal( + qs.stringify( + { a: { b: [1, 2, 3, 4], c: 'd' }, c: 'f' }, + { filter: ['a', 'b', 0, 2], arrayFormat: 'brackets' } + ), + 'a%5Bb%5D%5B%5D=1&a%5Bb%5D%5B%5D=3', + 'brackets => brackets' + ); + st.equal( + qs.stringify( + { a: { b: [1, 2, 3, 4], c: 'd' }, c: 'f' }, + { filter: ['a', 'b', 0, 2] } + ), + 'a%5Bb%5D%5B0%5D=1&a%5Bb%5D%5B2%5D=3', + 'default => indices' + ); + + st.end(); + }); + + t.test('supports custom representations when filter=function', function (st) { + var calls = 0; + var obj = { a: 'b', c: 'd', e: { f: new Date(1257894000000) } }; + var filterFunc = function (prefix, value) { + calls += 1; + if (calls === 1) { + st.equal(prefix, '', 'prefix is empty'); + st.equal(value, obj); + } else if (prefix === 'c') { + return void 0; + } else if (value instanceof Date) { + st.equal(prefix, 'e[f]'); + return value.getTime(); + } + return value; + }; + + st.equal(qs.stringify(obj, { filter: filterFunc }), 'a=b&e%5Bf%5D=1257894000000'); + st.equal(calls, 5); + st.end(); + }); + + t.test('can disable uri encoding', function (st) { + st.equal(qs.stringify({ a: 'b' }, { encode: false }), 'a=b'); + st.equal(qs.stringify({ a: { b: 'c' } }, { encode: false }), 'a[b]=c'); + st.equal(qs.stringify({ a: 'b', c: null }, { strictNullHandling: true, encode: false }), 'a=b&c'); + st.end(); + }); + + t.test('can sort the keys', function (st) { + var sort = function (a, b) { + return a.localeCompare(b); + }; + st.equal(qs.stringify({ a: 'c', z: 'y', b: 'f' }, { sort: sort }), 'a=c&b=f&z=y'); + st.equal(qs.stringify({ a: 'c', z: { j: 'a', i: 'b' }, b: 'f' }, { sort: sort }), 'a=c&b=f&z%5Bi%5D=b&z%5Bj%5D=a'); + st.end(); + }); + + t.test('can sort the keys at depth 3 or more too', function (st) { + var sort = function (a, b) { + return a.localeCompare(b); + }; + st.equal( + qs.stringify( + { a: 'a', z: { zj: { zjb: 'zjb', zja: 'zja' }, zi: { zib: 'zib', zia: 'zia' } }, b: 'b' }, + { sort: sort, encode: false } + ), + 'a=a&b=b&z[zi][zia]=zia&z[zi][zib]=zib&z[zj][zja]=zja&z[zj][zjb]=zjb' + ); + st.equal( + qs.stringify( + { a: 'a', z: { zj: { zjb: 'zjb', zja: 'zja' }, zi: { zib: 'zib', zia: 'zia' } }, b: 'b' }, + { sort: null, encode: false } + ), + 'a=a&z[zj][zjb]=zjb&z[zj][zja]=zja&z[zi][zib]=zib&z[zi][zia]=zia&b=b' + ); + st.end(); + }); + + t.test('can stringify with custom encoding', function (st) { + st.equal(qs.stringify({ 県: '大阪府', '': '' }, { + encoder: function (str) { + if (str.length === 0) { + return ''; + } + var buf = iconv.encode(str, 'shiftjis'); + var result = []; + for (var i = 0; i < buf.length; ++i) { + result.push(buf.readUInt8(i).toString(16)); + } + return '%' + result.join('%'); + } + }), '%8c%a7=%91%e5%8d%e3%95%7b&='); + st.end(); + }); + + t.test('receives the default encoder as a second argument', function (st) { + st.plan(8); + + qs.stringify({ a: 1, b: new Date(), c: true, d: [1] }, { + encoder: function (str) { + st.match(typeof str, /^(?:string|number|boolean)$/); + return ''; + } + }); + + st.end(); + }); + + t.test('receives the default encoder as a second argument', function (st) { + st.plan(2); + + qs.stringify({ a: 1 }, { + encoder: function (str, defaultEncoder) { + st.equal(defaultEncoder, utils.encode); + } + }); + + st.end(); + }); + + t.test('throws error with wrong encoder', function (st) { + st['throws'](function () { + qs.stringify({}, { encoder: 'string' }); + }, new TypeError('Encoder has to be a function.')); + st.end(); + }); + + t.test('can use custom encoder for a buffer object', { skip: typeof Buffer === 'undefined' }, function (st) { + st.equal(qs.stringify({ a: SaferBuffer.from([1]) }, { + encoder: function (buffer) { + if (typeof buffer === 'string') { + return buffer; + } + return String.fromCharCode(buffer.readUInt8(0) + 97); + } + }), 'a=b'); + + st.equal(qs.stringify({ a: SaferBuffer.from('a b') }, { + encoder: function (buffer) { + return buffer; + } + }), 'a=a b'); + st.end(); + }); + + t.test('serializeDate option', function (st) { + var date = new Date(); + st.equal( + qs.stringify({ a: date }), + 'a=' + date.toISOString().replace(/:/g, '%3A'), + 'default is toISOString' + ); + + var mutatedDate = new Date(); + mutatedDate.toISOString = function () { + throw new SyntaxError(); + }; + st['throws'](function () { + mutatedDate.toISOString(); + }, SyntaxError); + st.equal( + qs.stringify({ a: mutatedDate }), + 'a=' + Date.prototype.toISOString.call(mutatedDate).replace(/:/g, '%3A'), + 'toISOString works even when method is not locally present' + ); + + var specificDate = new Date(6); + st.equal( + qs.stringify( + { a: specificDate }, + { serializeDate: function (d) { return d.getTime() * 7; } } + ), + 'a=42', + 'custom serializeDate function called' + ); + + st.equal( + qs.stringify( + { a: [date] }, + { + serializeDate: function (d) { return d.getTime(); }, + arrayFormat: 'comma' + } + ), + 'a=' + date.getTime(), + 'works with arrayFormat comma' + ); + st.equal( + qs.stringify( + { a: [date] }, + { + serializeDate: function (d) { return d.getTime(); }, + arrayFormat: 'comma', + commaRoundTrip: true + } + ), + 'a%5B%5D=' + date.getTime(), + 'works with arrayFormat comma' + ); + + st.end(); + }); + + t.test('RFC 1738 serialization', function (st) { + st.equal(qs.stringify({ a: 'b c' }, { format: qs.formats.RFC1738 }), 'a=b+c'); + st.equal(qs.stringify({ 'a b': 'c d' }, { format: qs.formats.RFC1738 }), 'a+b=c+d'); + st.equal(qs.stringify({ 'a b': SaferBuffer.from('a b') }, { format: qs.formats.RFC1738 }), 'a+b=a+b'); + + st.equal(qs.stringify({ 'foo(ref)': 'bar' }, { format: qs.formats.RFC1738 }), 'foo(ref)=bar'); + + st.end(); + }); + + t.test('RFC 3986 spaces serialization', function (st) { + st.equal(qs.stringify({ a: 'b c' }, { format: qs.formats.RFC3986 }), 'a=b%20c'); + st.equal(qs.stringify({ 'a b': 'c d' }, { format: qs.formats.RFC3986 }), 'a%20b=c%20d'); + st.equal(qs.stringify({ 'a b': SaferBuffer.from('a b') }, { format: qs.formats.RFC3986 }), 'a%20b=a%20b'); + + st.end(); + }); + + t.test('Backward compatibility to RFC 3986', function (st) { + st.equal(qs.stringify({ a: 'b c' }), 'a=b%20c'); + st.equal(qs.stringify({ 'a b': SaferBuffer.from('a b') }), 'a%20b=a%20b'); + + st.end(); + }); + + t.test('Edge cases and unknown formats', function (st) { + ['UFO1234', false, 1234, null, {}, []].forEach(function (format) { + st['throws']( + function () { + qs.stringify({ a: 'b c' }, { format: format }); + }, + new TypeError('Unknown format option provided.') + ); + }); + st.end(); + }); + + t.test('encodeValuesOnly', function (st) { + st.equal( + qs.stringify( + { a: 'b', c: ['d', 'e=f'], f: [['g'], ['h']] }, + { encodeValuesOnly: true, arrayFormat: 'indices' } + ), + 'a=b&c[0]=d&c[1]=e%3Df&f[0][0]=g&f[1][0]=h', + 'encodeValuesOnly + indices' + ); + st.equal( + qs.stringify( + { a: 'b', c: ['d', 'e=f'], f: [['g'], ['h']] }, + { encodeValuesOnly: true, arrayFormat: 'brackets' } + ), + 'a=b&c[]=d&c[]=e%3Df&f[][]=g&f[][]=h', + 'encodeValuesOnly + brackets' + ); + st.equal( + qs.stringify( + { a: 'b', c: ['d', 'e=f'], f: [['g'], ['h']] }, + { encodeValuesOnly: true, arrayFormat: 'repeat' } + ), + 'a=b&c=d&c=e%3Df&f=g&f=h', + 'encodeValuesOnly + repeat' + ); + + st.equal( + qs.stringify( + { a: 'b', c: ['d', 'e'], f: [['g'], ['h']] }, + { arrayFormat: 'indices' } + ), + 'a=b&c%5B0%5D=d&c%5B1%5D=e&f%5B0%5D%5B0%5D=g&f%5B1%5D%5B0%5D=h', + 'no encodeValuesOnly + indices' + ); + st.equal( + qs.stringify( + { a: 'b', c: ['d', 'e'], f: [['g'], ['h']] }, + { arrayFormat: 'brackets' } + ), + 'a=b&c%5B%5D=d&c%5B%5D=e&f%5B%5D%5B%5D=g&f%5B%5D%5B%5D=h', + 'no encodeValuesOnly + brackets' + ); + st.equal( + qs.stringify( + { a: 'b', c: ['d', 'e'], f: [['g'], ['h']] }, + { arrayFormat: 'repeat' } + ), + 'a=b&c=d&c=e&f=g&f=h', + 'no encodeValuesOnly + repeat' + ); + + st.end(); + }); + + t.test('encodeValuesOnly - strictNullHandling', function (st) { + st.equal( + qs.stringify( + { a: { b: null } }, + { encodeValuesOnly: true, strictNullHandling: true } + ), + 'a[b]' + ); + st.end(); + }); + + t.test('throws if an invalid charset is specified', function (st) { + st['throws'](function () { + qs.stringify({ a: 'b' }, { charset: 'foobar' }); + }, new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined')); + st.end(); + }); + + t.test('respects a charset of iso-8859-1', function (st) { + st.equal(qs.stringify({ æ: 'æ' }, { charset: 'iso-8859-1' }), '%E6=%E6'); + st.end(); + }); + + t.test('encodes unrepresentable chars as numeric entities in iso-8859-1 mode', function (st) { + st.equal(qs.stringify({ a: '☺' }, { charset: 'iso-8859-1' }), 'a=%26%239786%3B'); + st.end(); + }); + + t.test('respects an explicit charset of utf-8 (the default)', function (st) { + st.equal(qs.stringify({ a: 'æ' }, { charset: 'utf-8' }), 'a=%C3%A6'); + st.end(); + }); + + t.test('`charsetSentinel` option', function (st) { + st.equal( + qs.stringify({ a: 'æ' }, { charsetSentinel: true, charset: 'utf-8' }), + 'utf8=%E2%9C%93&a=%C3%A6', + 'adds the right sentinel when instructed to and the charset is utf-8' + ); + + st.equal( + qs.stringify({ a: 'æ' }, { charsetSentinel: true, charset: 'iso-8859-1' }), + 'utf8=%26%2310003%3B&a=%E6', + 'adds the right sentinel when instructed to and the charset is iso-8859-1' + ); + + st.end(); + }); + + t.test('does not mutate the options argument', function (st) { + var options = {}; + qs.stringify({}, options); + st.deepEqual(options, {}); + st.end(); + }); + + t.test('strictNullHandling works with custom filter', function (st) { + var filter = function (prefix, value) { + return value; + }; + + var options = { strictNullHandling: true, filter: filter }; + st.equal(qs.stringify({ key: null }, options), 'key'); + st.end(); + }); + + t.test('strictNullHandling works with null serializeDate', function (st) { + var serializeDate = function () { + return null; + }; + var options = { strictNullHandling: true, serializeDate: serializeDate }; + var date = new Date(); + st.equal(qs.stringify({ key: date }, options), 'key'); + st.end(); + }); + + t.test('allows for encoding keys and values differently', function (st) { + var encoder = function (str, defaultEncoder, charset, type) { + if (type === 'key') { + return defaultEncoder(str, defaultEncoder, charset, type).toLowerCase(); + } + if (type === 'value') { + return defaultEncoder(str, defaultEncoder, charset, type).toUpperCase(); + } + throw 'this should never happen! type: ' + type; + }; + + st.deepEqual(qs.stringify({ KeY: 'vAlUe' }, { encoder: encoder }), 'key=VALUE'); + st.end(); + }); + + t.test('objects inside arrays', function (st) { + var obj = { a: { b: { c: 'd', e: 'f' } } }; + var withArray = { a: { b: [{ c: 'd', e: 'f' }] } }; + + st.equal(qs.stringify(obj, { encode: false }), 'a[b][c]=d&a[b][e]=f', 'no array, no arrayFormat'); + st.equal(qs.stringify(obj, { encode: false, arrayFormat: 'brackets' }), 'a[b][c]=d&a[b][e]=f', 'no array, bracket'); + st.equal(qs.stringify(obj, { encode: false, arrayFormat: 'indices' }), 'a[b][c]=d&a[b][e]=f', 'no array, indices'); + st.equal(qs.stringify(obj, { encode: false, arrayFormat: 'repeat' }), 'a[b][c]=d&a[b][e]=f', 'no array, repeat'); + st.equal(qs.stringify(obj, { encode: false, arrayFormat: 'comma' }), 'a[b][c]=d&a[b][e]=f', 'no array, comma'); + + st.equal(qs.stringify(withArray, { encode: false }), 'a[b][0][c]=d&a[b][0][e]=f', 'array, no arrayFormat'); + st.equal(qs.stringify(withArray, { encode: false, arrayFormat: 'brackets' }), 'a[b][][c]=d&a[b][][e]=f', 'array, bracket'); + st.equal(qs.stringify(withArray, { encode: false, arrayFormat: 'indices' }), 'a[b][0][c]=d&a[b][0][e]=f', 'array, indices'); + st.equal(qs.stringify(withArray, { encode: false, arrayFormat: 'repeat' }), 'a[b][c]=d&a[b][e]=f', 'array, repeat'); + st.equal( + qs.stringify(withArray, { encode: false, arrayFormat: 'comma' }), + '???', + 'array, comma', + { skip: 'TODO: figure out what this should do' } + ); + + st.end(); + }); + + t.test('stringifies sparse arrays', function (st) { + /* eslint no-sparse-arrays: 0 */ + st.equal(qs.stringify({ a: [, '2', , , '1'] }, { encodeValuesOnly: true, arrayFormat: 'indices' }), 'a[1]=2&a[4]=1'); + st.equal(qs.stringify({ a: [, '2', , , '1'] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a[]=2&a[]=1'); + st.equal(qs.stringify({ a: [, '2', , , '1'] }, { encodeValuesOnly: true, arrayFormat: 'repeat' }), 'a=2&a=1'); + + st.equal(qs.stringify({ a: [, { b: [, , { c: '1' }] }] }, { encodeValuesOnly: true, arrayFormat: 'indices' }), 'a[1][b][2][c]=1'); + st.equal(qs.stringify({ a: [, { b: [, , { c: '1' }] }] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a[][b][][c]=1'); + st.equal(qs.stringify({ a: [, { b: [, , { c: '1' }] }] }, { encodeValuesOnly: true, arrayFormat: 'repeat' }), 'a[b][c]=1'); + + st.equal(qs.stringify({ a: [, [, , [, , , { c: '1' }]]] }, { encodeValuesOnly: true, arrayFormat: 'indices' }), 'a[1][2][3][c]=1'); + st.equal(qs.stringify({ a: [, [, , [, , , { c: '1' }]]] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a[][][][c]=1'); + st.equal(qs.stringify({ a: [, [, , [, , , { c: '1' }]]] }, { encodeValuesOnly: true, arrayFormat: 'repeat' }), 'a[c]=1'); + + st.equal(qs.stringify({ a: [, [, , [, , , { c: [, '1'] }]]] }, { encodeValuesOnly: true, arrayFormat: 'indices' }), 'a[1][2][3][c][1]=1'); + st.equal(qs.stringify({ a: [, [, , [, , , { c: [, '1'] }]]] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a[][][][c][]=1'); + st.equal(qs.stringify({ a: [, [, , [, , , { c: [, '1'] }]]] }, { encodeValuesOnly: true, arrayFormat: 'repeat' }), 'a[c]=1'); + + st.end(); + }); + + t.test('encodes a very long string', function (st) { + var chars = []; + var expected = []; + for (var i = 0; i < 5e3; i++) { + chars.push(' ' + i); + + expected.push('%20' + i); + } + + var obj = { + foo: chars.join('') + }; + + st.equal( + qs.stringify(obj, { arrayFormat: 'bracket', charset: 'utf-8' }), + 'foo=' + expected.join('') + ); + + st.end(); + }); + + t.end(); +}); + +test('stringifies empty keys', function (t) { + emptyTestCases.forEach(function (testCase) { + t.test('stringifies an object with empty string key with ' + testCase.input, function (st) { + st.deepEqual( + qs.stringify(testCase.withEmptyKeys, { encode: false, arrayFormat: 'indices' }), + testCase.stringifyOutput.indices, + 'test case: ' + testCase.input + ', indices' + ); + st.deepEqual( + qs.stringify(testCase.withEmptyKeys, { encode: false, arrayFormat: 'brackets' }), + testCase.stringifyOutput.brackets, + 'test case: ' + testCase.input + ', brackets' + ); + st.deepEqual( + qs.stringify(testCase.withEmptyKeys, { encode: false, arrayFormat: 'repeat' }), + testCase.stringifyOutput.repeat, + 'test case: ' + testCase.input + ', repeat' + ); + + st.end(); + }); + }); + + t.test('edge case with object/arrays', function (st) { + st.deepEqual(qs.stringify({ '': { '': [2, 3] } }, { encode: false }), '[][0]=2&[][1]=3'); + st.deepEqual(qs.stringify({ '': { '': [2, 3], a: 2 } }, { encode: false }), '[][0]=2&[][1]=3&[a]=2'); + st.deepEqual(qs.stringify({ '': { '': [2, 3] } }, { encode: false, arrayFormat: 'indices' }), '[][0]=2&[][1]=3'); + st.deepEqual(qs.stringify({ '': { '': [2, 3], a: 2 } }, { encode: false, arrayFormat: 'indices' }), '[][0]=2&[][1]=3&[a]=2'); + + st.end(); + }); +}); diff --git a/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/test/utils.js b/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/test/utils.js new file mode 100644 index 000000000000..aa84dfdc62be --- /dev/null +++ b/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/test/utils.js @@ -0,0 +1,136 @@ +'use strict'; + +var test = require('tape'); +var inspect = require('object-inspect'); +var SaferBuffer = require('safer-buffer').Buffer; +var forEach = require('for-each'); +var utils = require('../lib/utils'); + +test('merge()', function (t) { + t.deepEqual(utils.merge(null, true), [null, true], 'merges true into null'); + + t.deepEqual(utils.merge(null, [42]), [null, 42], 'merges null into an array'); + + t.deepEqual(utils.merge({ a: 'b' }, { a: 'c' }), { a: ['b', 'c'] }, 'merges two objects with the same key'); + + var oneMerged = utils.merge({ foo: 'bar' }, { foo: { first: '123' } }); + t.deepEqual(oneMerged, { foo: ['bar', { first: '123' }] }, 'merges a standalone and an object into an array'); + + var twoMerged = utils.merge({ foo: ['bar', { first: '123' }] }, { foo: { second: '456' } }); + t.deepEqual(twoMerged, { foo: { 0: 'bar', 1: { first: '123' }, second: '456' } }, 'merges a standalone and two objects into an array'); + + var sandwiched = utils.merge({ foo: ['bar', { first: '123', second: '456' }] }, { foo: 'baz' }); + t.deepEqual(sandwiched, { foo: ['bar', { first: '123', second: '456' }, 'baz'] }, 'merges an object sandwiched by two standalones into an array'); + + var nestedArrays = utils.merge({ foo: ['baz'] }, { foo: ['bar', 'xyzzy'] }); + t.deepEqual(nestedArrays, { foo: ['baz', 'bar', 'xyzzy'] }); + + var noOptionsNonObjectSource = utils.merge({ foo: 'baz' }, 'bar'); + t.deepEqual(noOptionsNonObjectSource, { foo: 'baz', bar: true }); + + t.test( + 'avoids invoking array setters unnecessarily', + { skip: typeof Object.defineProperty !== 'function' }, + function (st) { + var setCount = 0; + var getCount = 0; + var observed = []; + Object.defineProperty(observed, 0, { + get: function () { + getCount += 1; + return { bar: 'baz' }; + }, + set: function () { setCount += 1; } + }); + utils.merge(observed, [null]); + st.equal(setCount, 0); + st.equal(getCount, 1); + observed[0] = observed[0]; // eslint-disable-line no-self-assign + st.equal(setCount, 1); + st.equal(getCount, 2); + st.end(); + } + ); + + t.end(); +}); + +test('assign()', function (t) { + var target = { a: 1, b: 2 }; + var source = { b: 3, c: 4 }; + var result = utils.assign(target, source); + + t.equal(result, target, 'returns the target'); + t.deepEqual(target, { a: 1, b: 3, c: 4 }, 'target and source are merged'); + t.deepEqual(source, { b: 3, c: 4 }, 'source is untouched'); + + t.end(); +}); + +test('combine()', function (t) { + t.test('both arrays', function (st) { + var a = [1]; + var b = [2]; + var combined = utils.combine(a, b); + + st.deepEqual(a, [1], 'a is not mutated'); + st.deepEqual(b, [2], 'b is not mutated'); + st.notEqual(a, combined, 'a !== combined'); + st.notEqual(b, combined, 'b !== combined'); + st.deepEqual(combined, [1, 2], 'combined is a + b'); + + st.end(); + }); + + t.test('one array, one non-array', function (st) { + var aN = 1; + var a = [aN]; + var bN = 2; + var b = [bN]; + + var combinedAnB = utils.combine(aN, b); + st.deepEqual(b, [bN], 'b is not mutated'); + st.notEqual(aN, combinedAnB, 'aN + b !== aN'); + st.notEqual(a, combinedAnB, 'aN + b !== a'); + st.notEqual(bN, combinedAnB, 'aN + b !== bN'); + st.notEqual(b, combinedAnB, 'aN + b !== b'); + st.deepEqual([1, 2], combinedAnB, 'first argument is array-wrapped when not an array'); + + var combinedABn = utils.combine(a, bN); + st.deepEqual(a, [aN], 'a is not mutated'); + st.notEqual(aN, combinedABn, 'a + bN !== aN'); + st.notEqual(a, combinedABn, 'a + bN !== a'); + st.notEqual(bN, combinedABn, 'a + bN !== bN'); + st.notEqual(b, combinedABn, 'a + bN !== b'); + st.deepEqual([1, 2], combinedABn, 'second argument is array-wrapped when not an array'); + + st.end(); + }); + + t.test('neither is an array', function (st) { + var combined = utils.combine(1, 2); + st.notEqual(1, combined, '1 + 2 !== 1'); + st.notEqual(2, combined, '1 + 2 !== 2'); + st.deepEqual([1, 2], combined, 'both arguments are array-wrapped when not an array'); + + st.end(); + }); + + t.end(); +}); + +test('isBuffer()', function (t) { + forEach([null, undefined, true, false, '', 'abc', 42, 0, NaN, {}, [], function () {}, /a/g], function (x) { + t.equal(utils.isBuffer(x), false, inspect(x) + ' is not a buffer'); + }); + + var fakeBuffer = { constructor: Buffer }; + t.equal(utils.isBuffer(fakeBuffer), false, 'fake buffer is not a buffer'); + + var saferBuffer = SaferBuffer.from('abc'); + t.equal(utils.isBuffer(saferBuffer), true, 'SaferBuffer instance is a buffer'); + + var buffer = Buffer.from && Buffer.alloc ? Buffer.from('abc') : new Buffer('abc'); + t.equal(utils.isBuffer(buffer), true, 'real Buffer instance is a buffer'); + t.end(); +}); diff --git a/Modules/Chatroom/chat/node_modules/body-parser/package.json b/Modules/Chatroom/chat/node_modules/body-parser/package.json index 4637304389c5..3c9926fc58c4 100644 --- a/Modules/Chatroom/chat/node_modules/body-parser/package.json +++ b/Modules/Chatroom/chat/node_modules/body-parser/package.json @@ -1,7 +1,7 @@ { "name": "body-parser", "description": "Node.js body parsing middleware", - "version": "1.20.2", + "version": "1.20.3", "contributors": [ "Douglas Christopher Wilson ", "Jonathan Ong (http://jongleberry.com)" @@ -17,7 +17,7 @@ "http-errors": "2.0.0", "iconv-lite": "0.4.24", "on-finished": "2.4.1", - "qs": "6.11.0", + "qs": "6.13.0", "raw-body": "2.5.2", "type-is": "~1.6.18", "unpipe": "1.0.0" diff --git a/Modules/Chatroom/chat/node_modules/express/History.md b/Modules/Chatroom/chat/node_modules/express/History.md index ac2e7cf719d2..887a38f182db 100644 --- a/Modules/Chatroom/chat/node_modules/express/History.md +++ b/Modules/Chatroom/chat/node_modules/express/History.md @@ -1,3 +1,21 @@ +4.20.0 / 2024-09-10 +========== + * deps: serve-static@0.16.0 + * Remove link renderization in html while redirecting + * deps: send@0.19.0 + * Remove link renderization in html while redirecting + * deps: body-parser@0.6.0 + * add `depth` option to customize the depth level in the parser + * IMPORTANT: The default `depth` level for parsing URL-encoded data is now `32` (previously was `Infinity`) + * Remove link renderization in html while using `res.redirect` + * deps: path-to-regexp@0.1.10 + - Adds support for named matching groups in the routes using a regex + - Adds backtracking protection to parameters without regexes defined + * deps: encodeurl@~2.0.0 + - Removes encoding of `\`, `|`, and `^` to align better with URL spec + * Deprecate passing `options.maxAge` and `options.expires` to `res.clearCookie` + - Will be ignored in v5, clearCookie will set a cookie with an expires in the past to instruct clients to delete the cookie + 4.19.2 / 2024-03-25 ========== diff --git a/Modules/Chatroom/chat/node_modules/express/Readme.md b/Modules/Chatroom/chat/node_modules/express/Readme.md index d0f3cf56e6dd..bc108d55fc07 100644 --- a/Modules/Chatroom/chat/node_modules/express/Readme.md +++ b/Modules/Chatroom/chat/node_modules/express/Readme.md @@ -1,10 +1,29 @@ [![Express Logo](https://i.cloudup.com/zfY6lL7eFa-3000x3000.png)](http://expressjs.com/) - Fast, unopinionated, minimalist web framework for [Node.js](http://nodejs.org). +**Fast, unopinionated, minimalist web framework for [Node.js](http://nodejs.org).** + +**This project has a [Code of Conduct][].** + +## Table of contents + +* [Installation](#Installation) +* [Features](#Features) +* [Docs & Community](#docs--community) +* [Quick Start](#Quick-Start) +* [Running Tests](#Running-Tests) +* [Philosophy](#Philosophy) +* [Examples](#Examples) +* [Contributing to Express](#Contributing) +* [TC (Technical Committee)](#tc-technical-committee) +* [Triagers](#triagers) +* [License](#license) + + +[![NPM Version][npm-version-image]][npm-url] +[![NPM Install Size][npm-install-size-image]][npm-install-size-url] +[![NPM Downloads][npm-downloads-image]][npm-downloads-url] +[![OpenSSF Scorecard Badge][ossf-scorecard-badge]][ossf-scorecard-visualizer] - [![NPM Version][npm-version-image]][npm-url] - [![NPM Install Size][npm-install-size-image]][npm-install-size-url] - [![NPM Downloads][npm-downloads-image]][npm-downloads-url] ```js const express = require('express') @@ -144,10 +163,82 @@ $ npm test The original author of Express is [TJ Holowaychuk](https://github.com/tj) -The current lead maintainer is [Douglas Christopher Wilson](https://github.com/dougwilson) - [List of all contributors](https://github.com/expressjs/express/graphs/contributors) +### TC (Technical Committee) + +* [UlisesGascon](https://github.com/UlisesGascon) - **Ulises Gascón** (he/him) +* [jonchurch](https://github.com/jonchurch) - **Jon Church** +* [wesleytodd](https://github.com/wesleytodd) - **Wes Todd** +* [LinusU](https://github.com/LinusU) - **Linus Unnebäck** +* [blakeembrey](https://github.com/blakeembrey) - **Blake Embrey** +* [sheplu](https://github.com/sheplu) - **Jean Burellier** +* [crandmck](https://github.com/crandmck) - **Rand McKinney** +* [ctcpip](https://github.com/ctcpip) - **Chris de Almeida** + +
+TC emeriti members + +#### TC emeriti members + + * [dougwilson](https://github.com/dougwilson) - **Douglas Wilson** + * [hacksparrow](https://github.com/hacksparrow) - **Hage Yaapa** + * [jonathanong](https://github.com/jonathanong) - **jongleberry** + * [niftylettuce](https://github.com/niftylettuce) - **niftylettuce** + * [troygoode](https://github.com/troygoode) - **Troy Goode** +
+ + +### Triagers + +* [aravindvnair99](https://github.com/aravindvnair99) - **Aravind Nair** +* [carpasse](https://github.com/carpasse) - **Carlos Serrano** +* [CBID2](https://github.com/CBID2) - **Christine Belzie** +* [enyoghasim](https://github.com/enyoghasim) - **David Enyoghasim** +* [UlisesGascon](https://github.com/UlisesGascon) - **Ulises Gascón** (he/him) +* [mertcanaltin](https://github.com/mertcanaltin) - **Mert Can Altin** +* [0ss](https://github.com/0ss) - **Salah** +* [import-brain](https://github.com/import-brain) - **Eric Cheng** (he/him) +* [3imed-jaberi](https://github.com/3imed-jaberi) - **Imed Jaberi** +* [dakshkhetan](https://github.com/dakshkhetan) - **Daksh Khetan** (he/him) +* [lucasraziel](https://github.com/lucasraziel) - **Lucas Soares Do Rego** +* [IamLizu](https://github.com/IamLizu) - **S M Mahmudul Hasan** (he/him) +* [Sushmeet](https://github.com/Sushmeet) - **Sushmeet Sunger** + +
+Triagers emeriti members + +#### Emeritus Triagers + + * [AuggieH](https://github.com/AuggieH) - **Auggie Hudak** + * [G-Rath](https://github.com/G-Rath) - **Gareth Jones** + * [MohammadXroid](https://github.com/MohammadXroid) - **Mohammad Ayashi** + * [NawafSwe](https://github.com/NawafSwe) - **Nawaf Alsharqi** + * [NotMoni](https://github.com/NotMoni) - **Moni** + * [VigneshMurugan](https://github.com/VigneshMurugan) - **Vignesh Murugan** + * [davidmashe](https://github.com/davidmashe) - **David Ashe** + * [digitaIfabric](https://github.com/digitaIfabric) - **David** + * [e-l-i-s-e](https://github.com/e-l-i-s-e) - **Elise Bonner** + * [fed135](https://github.com/fed135) - **Frederic Charette** + * [firmanJS](https://github.com/firmanJS) - **Firman Abdul Hakim** + * [getspooky](https://github.com/getspooky) - **Yasser Ameur** + * [ghinks](https://github.com/ghinks) - **Glenn** + * [ghousemohamed](https://github.com/ghousemohamed) - **Ghouse Mohamed** + * [gireeshpunathil](https://github.com/gireeshpunathil) - **Gireesh Punathil** + * [jake32321](https://github.com/jake32321) - **Jake Reed** + * [jonchurch](https://github.com/jonchurch) - **Jon Church** + * [lekanikotun](https://github.com/lekanikotun) - **Troy Goode** + * [marsonya](https://github.com/marsonya) - **Lekan Ikotun** + * [mastermatt](https://github.com/mastermatt) - **Matt R. Wilson** + * [maxakuru](https://github.com/maxakuru) - **Max Edell** + * [mlrawlings](https://github.com/mlrawlings) - **Michael Rawlings** + * [rodion-arr](https://github.com/rodion-arr) - **Rodion Abdurakhimov** + * [sheplu](https://github.com/sheplu) - **Jean Burellier** + * [tarunyadav1](https://github.com/tarunyadav1) - **Tarun yadav** + * [tunniclm](https://github.com/tunniclm) - **Mike Tunnicliffe** +
+ + ## License [MIT](LICENSE) @@ -164,3 +255,6 @@ The current lead maintainer is [Douglas Christopher Wilson](https://github.com/d [npm-install-size-url]: https://packagephobia.com/result?p=express [npm-url]: https://npmjs.org/package/express [npm-version-image]: https://badgen.net/npm/v/express +[ossf-scorecard-badge]: https://api.scorecard.dev/projects/github.com/expressjs/express/badge +[ossf-scorecard-visualizer]: https://ossf.github.io/scorecard-visualizer/#/projects/github.com/expressjs/express +[Code of Conduct]: https://github.com/expressjs/express/blob/master/Code-Of-Conduct.md diff --git a/Modules/Chatroom/chat/node_modules/express/lib/response.js b/Modules/Chatroom/chat/node_modules/express/lib/response.js index dd7b3c8201d2..76b6b54a3b8f 100644 --- a/Modules/Chatroom/chat/node_modules/express/lib/response.js +++ b/Modules/Chatroom/chat/node_modules/express/lib/response.js @@ -55,7 +55,6 @@ module.exports = res */ var charsetRegExp = /;\s*charset\s*=/; -var schemaAndHostRegExp = /^(?:[a-zA-Z][a-zA-Z0-9+.-]*:)?\/\/[^\\\/\?]+/; /** * Set status `code`. @@ -823,6 +822,14 @@ res.get = function(field){ */ res.clearCookie = function clearCookie(name, options) { + if (options) { + if (options.maxAge) { + deprecate('res.clearCookie: Passing "options.maxAge" is deprecated. In v5.0.0 of Express, this option will be ignored, as res.clearCookie will automatically set cookies to expire immediately. Please update your code to omit this option.'); + } + if (options.expires) { + deprecate('res.clearCookie: Passing "options.expires" is deprecated. In v5.0.0 of Express, this option will be ignored, as res.clearCookie will automatically set cookies to expire immediately. Please update your code to omit this option.'); + } + } var opts = merge({ expires: new Date(1), path: '/' }, options); return this.cookie(name, '', opts); @@ -914,14 +921,7 @@ res.location = function location(url) { loc = String(url); } - var m = schemaAndHostRegExp.exec(loc); - var pos = m ? m[0].length + 1 : 0; - - // Only encode after host to avoid invalid encoding which can introduce - // vulnerabilities (e.g. `\\` to `%5C`). - loc = loc.slice(0, pos) + encodeUrl(loc.slice(pos)); - - return this.set('Location', loc); + return this.set('Location', encodeUrl(loc)); }; /** @@ -969,7 +969,7 @@ res.redirect = function redirect(url) { html: function(){ var u = escapeHtml(address); - body = '

' + statuses.message[status] + '. Redirecting to ' + u + '

' + body = '

' + statuses.message[status] + '. Redirecting to ' + u + '

' }, default: function(){ diff --git a/Modules/Chatroom/chat/node_modules/express/node_modules/encodeurl/LICENSE b/Modules/Chatroom/chat/node_modules/express/node_modules/encodeurl/LICENSE new file mode 100644 index 000000000000..8812229bc59b --- /dev/null +++ b/Modules/Chatroom/chat/node_modules/express/node_modules/encodeurl/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2016 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/Modules/Chatroom/chat/node_modules/express/node_modules/encodeurl/README.md b/Modules/Chatroom/chat/node_modules/express/node_modules/encodeurl/README.md new file mode 100644 index 000000000000..3842493ec68e --- /dev/null +++ b/Modules/Chatroom/chat/node_modules/express/node_modules/encodeurl/README.md @@ -0,0 +1,109 @@ +# Encode URL + +Encode a URL to a percent-encoded form, excluding already-encoded sequences. + +## Installation + +```sh +npm install encodeurl +``` + +## API + +```js +var encodeUrl = require('encodeurl') +``` + +### encodeUrl(url) + +Encode a URL to a percent-encoded form, excluding already-encoded sequences. + +This function accepts a URL and encodes all the non-URL code points (as UTF-8 byte sequences). It will not encode the "%" character unless it is not part of a valid sequence (`%20` will be left as-is, but `%foo` will be encoded as `%25foo`). + +This encode is meant to be "safe" and does not throw errors. It will try as hard as it can to properly encode the given URL, including replacing any raw, unpaired surrogate pairs with the Unicode replacement character prior to encoding. + +## Examples + +### Encode a URL containing user-controlled data + +```js +var encodeUrl = require('encodeurl') +var escapeHtml = require('escape-html') + +http.createServer(function onRequest (req, res) { + // get encoded form of inbound url + var url = encodeUrl(req.url) + + // create html message + var body = '

Location ' + escapeHtml(url) + ' not found

' + + // send a 404 + res.statusCode = 404 + res.setHeader('Content-Type', 'text/html; charset=UTF-8') + res.setHeader('Content-Length', String(Buffer.byteLength(body, 'utf-8'))) + res.end(body, 'utf-8') +}) +``` + +### Encode a URL for use in a header field + +```js +var encodeUrl = require('encodeurl') +var escapeHtml = require('escape-html') +var url = require('url') + +http.createServer(function onRequest (req, res) { + // parse inbound url + var href = url.parse(req) + + // set new host for redirect + href.host = 'localhost' + href.protocol = 'https:' + href.slashes = true + + // create location header + var location = encodeUrl(url.format(href)) + + // create html message + var body = '

Redirecting to new site: ' + escapeHtml(location) + '

' + + // send a 301 + res.statusCode = 301 + res.setHeader('Content-Type', 'text/html; charset=UTF-8') + res.setHeader('Content-Length', String(Buffer.byteLength(body, 'utf-8'))) + res.setHeader('Location', location) + res.end(body, 'utf-8') +}) +``` + +## Similarities + +This function is _similar_ to the intrinsic function `encodeURI`. However, it will not encode: + +* The `\`, `^`, or `|` characters +* The `%` character when it's part of a valid sequence +* `[` and `]` (for IPv6 hostnames) +* Replaces raw, unpaired surrogate pairs with the Unicode replacement character + +As a result, the encoding aligns closely with the behavior in the [WHATWG URL specification][whatwg-url]. However, this package only encodes strings and does not do any URL parsing or formatting. + +It is expected that any output from `new URL(url)` will not change when used with this package, as the output has already been encoded. Additionally, if we were to encode before `new URL(url)`, we do not expect the before and after encoded formats to be parsed any differently. + +## Testing + +```sh +$ npm test +$ npm run lint +``` + +## References + +- [RFC 3986: Uniform Resource Identifier (URI): Generic Syntax][rfc-3986] +- [WHATWG URL Living Standard][whatwg-url] + +[rfc-3986]: https://tools.ietf.org/html/rfc3986 +[whatwg-url]: https://url.spec.whatwg.org/ + +## License + +[MIT](LICENSE) diff --git a/Modules/Chatroom/chat/node_modules/express/node_modules/encodeurl/index.js b/Modules/Chatroom/chat/node_modules/express/node_modules/encodeurl/index.js new file mode 100644 index 000000000000..a49ee5a0b621 --- /dev/null +++ b/Modules/Chatroom/chat/node_modules/express/node_modules/encodeurl/index.js @@ -0,0 +1,60 @@ +/*! + * encodeurl + * Copyright(c) 2016 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module exports. + * @public + */ + +module.exports = encodeUrl + +/** + * RegExp to match non-URL code points, *after* encoding (i.e. not including "%") + * and including invalid escape sequences. + * @private + */ + +var ENCODE_CHARS_REGEXP = /(?:[^\x21\x23-\x3B\x3D\x3F-\x5F\x61-\x7A\x7C\x7E]|%(?:[^0-9A-Fa-f]|[0-9A-Fa-f][^0-9A-Fa-f]|$))+/g + +/** + * RegExp to match unmatched surrogate pair. + * @private + */ + +var UNMATCHED_SURROGATE_PAIR_REGEXP = /(^|[^\uD800-\uDBFF])[\uDC00-\uDFFF]|[\uD800-\uDBFF]([^\uDC00-\uDFFF]|$)/g + +/** + * String to replace unmatched surrogate pair with. + * @private + */ + +var UNMATCHED_SURROGATE_PAIR_REPLACE = '$1\uFFFD$2' + +/** + * Encode a URL to a percent-encoded form, excluding already-encoded sequences. + * + * This function will take an already-encoded URL and encode all the non-URL + * code points. This function will not encode the "%" character unless it is + * not part of a valid sequence (`%20` will be left as-is, but `%foo` will + * be encoded as `%25foo`). + * + * This encode is meant to be "safe" and does not throw errors. It will try as + * hard as it can to properly encode the given URL, including replacing any raw, + * unpaired surrogate pairs with the Unicode replacement character prior to + * encoding. + * + * @param {string} url + * @return {string} + * @public + */ + +function encodeUrl (url) { + return String(url) + .replace(UNMATCHED_SURROGATE_PAIR_REGEXP, UNMATCHED_SURROGATE_PAIR_REPLACE) + .replace(ENCODE_CHARS_REGEXP, encodeURI) +} diff --git a/Modules/Chatroom/chat/node_modules/express/node_modules/encodeurl/package.json b/Modules/Chatroom/chat/node_modules/express/node_modules/encodeurl/package.json new file mode 100644 index 000000000000..313382214599 --- /dev/null +++ b/Modules/Chatroom/chat/node_modules/express/node_modules/encodeurl/package.json @@ -0,0 +1,40 @@ +{ + "name": "encodeurl", + "description": "Encode a URL to a percent-encoded form, excluding already-encoded sequences", + "version": "2.0.0", + "contributors": [ + "Douglas Christopher Wilson " + ], + "license": "MIT", + "keywords": [ + "encode", + "encodeurl", + "url" + ], + "repository": "pillarjs/encodeurl", + "devDependencies": { + "eslint": "5.11.1", + "eslint-config-standard": "12.0.0", + "eslint-plugin-import": "2.14.0", + "eslint-plugin-node": "7.0.1", + "eslint-plugin-promise": "4.0.1", + "eslint-plugin-standard": "4.0.0", + "istanbul": "0.4.5", + "mocha": "2.5.3" + }, + "files": [ + "LICENSE", + "HISTORY.md", + "README.md", + "index.js" + ], + "engines": { + "node": ">= 0.8" + }, + "scripts": { + "lint": "eslint .", + "test": "mocha --reporter spec --bail --check-leaks test/", + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", + "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" + } +} diff --git a/Modules/Chatroom/chat/node_modules/express/package.json b/Modules/Chatroom/chat/node_modules/express/package.json index f299d882b0d0..bffa70a6f1c5 100644 --- a/Modules/Chatroom/chat/node_modules/express/package.json +++ b/Modules/Chatroom/chat/node_modules/express/package.json @@ -1,7 +1,7 @@ { "name": "express", "description": "Fast, unopinionated, minimalist web framework", - "version": "4.19.2", + "version": "4.20.0", "author": "TJ Holowaychuk ", "contributors": [ "Aaron Heckmann ", @@ -30,30 +30,30 @@ "dependencies": { "accepts": "~1.3.8", "array-flatten": "1.1.1", - "body-parser": "1.20.2", + "body-parser": "1.20.3", "content-disposition": "0.5.4", "content-type": "~1.0.4", "cookie": "0.6.0", "cookie-signature": "1.0.6", "debug": "2.6.9", "depd": "2.0.0", - "encodeurl": "~1.0.2", + "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "etag": "~1.8.1", "finalhandler": "1.2.0", "fresh": "0.5.2", "http-errors": "2.0.0", - "merge-descriptors": "1.0.1", + "merge-descriptors": "1.0.3", "methods": "~1.1.2", "on-finished": "2.4.1", "parseurl": "~1.3.3", - "path-to-regexp": "0.1.7", + "path-to-regexp": "0.1.10", "proxy-addr": "~2.0.7", "qs": "6.11.0", "range-parser": "~1.2.1", "safe-buffer": "5.2.1", - "send": "0.18.0", - "serve-static": "1.15.0", + "send": "0.19.0", + "serve-static": "1.16.0", "setprototypeof": "1.2.0", "statuses": "2.0.1", "type-is": "~1.6.18", @@ -91,8 +91,8 @@ "scripts": { "lint": "eslint .", "test": "mocha --require test/support/env --reporter spec --bail --check-leaks test/ test/acceptance/", - "test-ci": "nyc --reporter=lcovonly --reporter=text npm test", - "test-cov": "nyc --reporter=html --reporter=text npm test", + "test-ci": "nyc --exclude examples --exclude test --exclude benchmarks --reporter=lcovonly --reporter=text npm test", + "test-cov": "nyc --exclude examples --exclude test --exclude benchmarks --reporter=html --reporter=text npm test", "test-tap": "mocha --require test/support/env --reporter tap --check-leaks test/ test/acceptance/" } } diff --git a/Modules/Chatroom/chat/node_modules/merge-descriptors/README.md b/Modules/Chatroom/chat/node_modules/merge-descriptors/README.md index d593c0ebd7c1..3403f4a0cca5 100644 --- a/Modules/Chatroom/chat/node_modules/merge-descriptors/README.md +++ b/Modules/Chatroom/chat/node_modules/merge-descriptors/README.md @@ -1,4 +1,4 @@ -# Merge Descriptors +# merge-descriptors [![NPM Version][npm-image]][npm-url] [![NPM Downloads][downloads-image]][downloads-url] @@ -27,12 +27,13 @@ animal.name === 'jon' ### merge(destination, source) -Redefines `destination`'s descriptors with `source`'s. +Redefines `destination`'s descriptors with `source`'s. The return value is the +`destination` object. ### merge(destination, source, false) Defines `source`'s descriptors on `destination` if `destination` does not have -a descriptor by the same name. +a descriptor by the same name. The return value is the `destination` object. ## License diff --git a/Modules/Chatroom/chat/node_modules/merge-descriptors/index.js b/Modules/Chatroom/chat/node_modules/merge-descriptors/index.js index 573b132eb2ba..f22ebab4c6b9 100644 --- a/Modules/Chatroom/chat/node_modules/merge-descriptors/index.js +++ b/Modules/Chatroom/chat/node_modules/merge-descriptors/index.js @@ -31,7 +31,7 @@ var hasOwnProperty = Object.prototype.hasOwnProperty * @public */ -function merge(dest, src, redefine) { +function merge (dest, src, redefine) { if (!dest) { throw new TypeError('argument dest is required') } @@ -45,9 +45,9 @@ function merge(dest, src, redefine) { redefine = true } - Object.getOwnPropertyNames(src).forEach(function forEachOwnPropertyName(name) { + Object.getOwnPropertyNames(src).forEach(function forEachOwnPropertyName (name) { if (!redefine && hasOwnProperty.call(dest, name)) { - // Skip desriptor + // Skip descriptor return } diff --git a/Modules/Chatroom/chat/node_modules/merge-descriptors/package.json b/Modules/Chatroom/chat/node_modules/merge-descriptors/package.json index 514cdbd814cd..aa9af0a85f45 100644 --- a/Modules/Chatroom/chat/node_modules/merge-descriptors/package.json +++ b/Modules/Chatroom/chat/node_modules/merge-descriptors/package.json @@ -1,7 +1,7 @@ { "name": "merge-descriptors", "description": "Merge objects using descriptors", - "version": "1.0.1", + "version": "1.0.3", "author": { "name": "Jonathan Ong", "email": "me@jongleberry.com", @@ -13,10 +13,17 @@ "Mike Grabowski " ], "license": "MIT", - "repository": "component/merge-descriptors", + "repository": "sindresorhus/merge-descriptors", + "funding": "https://github.com/sponsors/sindresorhus", "devDependencies": { - "istanbul": "0.4.1", - "mocha": "1.21.5" + "eslint": "5.9.0", + "eslint-config-standard": "12.0.0", + "eslint-plugin-import": "2.14.0", + "eslint-plugin-node": "7.0.1", + "eslint-plugin-promise": "4.0.1", + "eslint-plugin-standard": "4.0.0", + "mocha": "5.2.0", + "nyc": "13.1.0" }, "files": [ "HISTORY.md", @@ -25,8 +32,8 @@ "index.js" ], "scripts": { - "test": "mocha --reporter spec --bail --check-leaks test/", - "test-ci": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/", - "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/" + "lint": "eslint .", + "test": "mocha test/", + "test-cov": "nyc --reporter=html --reporter=text npm test" } } diff --git a/Modules/Chatroom/chat/node_modules/object-inspect/CHANGELOG.md b/Modules/Chatroom/chat/node_modules/object-inspect/CHANGELOG.md index c5772b4c0788..056fbcc5ec9d 100644 --- a/Modules/Chatroom/chat/node_modules/object-inspect/CHANGELOG.md +++ b/Modules/Chatroom/chat/node_modules/object-inspect/CHANGELOG.md @@ -5,6 +5,21 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [v1.13.2](https://github.com/inspect-js/object-inspect/compare/v1.13.1...v1.13.2) - 2024-06-21 + +### Commits + +- [readme] update badges [`8a51e6b`](https://github.com/inspect-js/object-inspect/commit/8a51e6bedaf389ec40cc4659e9df53e8543d176e) +- [Dev Deps] update `@ljharb/eslint-config`, `tape` [`ef05f58`](https://github.com/inspect-js/object-inspect/commit/ef05f58c9761a41416ab907299bf0fa79517014b) +- [Dev Deps] update `error-cause`, `has-tostringtag`, `tape` [`c0c6c26`](https://github.com/inspect-js/object-inspect/commit/c0c6c26c44cee6671f7c5d43d2b91d27c5c00d90) +- [Fix] Don't throw when `global` is not defined [`d4d0965`](https://github.com/inspect-js/object-inspect/commit/d4d096570f7dbd0e03266a96de11d05eb7b63e0f) +- [meta] add missing `engines.node` [`17a352a`](https://github.com/inspect-js/object-inspect/commit/17a352af6fe1ba6b70a19081674231eb1a50c940) +- [Dev Deps] update `globalthis` [`9c08884`](https://github.com/inspect-js/object-inspect/commit/9c08884aa662a149e2f11403f413927736b97da7) +- [Dev Deps] update `error-cause` [`6af352d`](https://github.com/inspect-js/object-inspect/commit/6af352d7c3929a4cc4c55768c27bf547a5e900f4) +- [Dev Deps] update `npmignore` [`94e617d`](https://github.com/inspect-js/object-inspect/commit/94e617d38831722562fa73dff4c895746861d267) +- [Dev Deps] update `mock-property` [`2ac24d7`](https://github.com/inspect-js/object-inspect/commit/2ac24d7e58cd388ad093c33249e413e05bbfd6c3) +- [Dev Deps] update `tape` [`46125e5`](https://github.com/inspect-js/object-inspect/commit/46125e58f1d1dcfb170ed3d1ea69da550ea8d77b) + ## [v1.13.1](https://github.com/inspect-js/object-inspect/compare/v1.13.0...v1.13.1) - 2023-10-19 ### Commits diff --git a/Modules/Chatroom/chat/node_modules/object-inspect/index.js b/Modules/Chatroom/chat/node_modules/object-inspect/index.js index ff203349231e..eb89fafb5970 100644 --- a/Modules/Chatroom/chat/node_modules/object-inspect/index.js +++ b/Modules/Chatroom/chat/node_modules/object-inspect/index.js @@ -244,7 +244,10 @@ module.exports = function inspect_(obj, options, depth, seen) { if (typeof window !== 'undefined' && obj === window) { return '{ [object Window] }'; } - if (obj === global) { + if ( + (typeof globalThis !== 'undefined' && obj === globalThis) + || (typeof global !== 'undefined' && obj === global) + ) { return '{ [object globalThis] }'; } if (!isDate(obj) && !isRegExp(obj)) { diff --git a/Modules/Chatroom/chat/node_modules/object-inspect/package.json b/Modules/Chatroom/chat/node_modules/object-inspect/package.json index 02de342ecb2d..9974d2129f8a 100644 --- a/Modules/Chatroom/chat/node_modules/object-inspect/package.json +++ b/Modules/Chatroom/chat/node_modules/object-inspect/package.json @@ -1,31 +1,33 @@ { "name": "object-inspect", - "version": "1.13.1", + "version": "1.13.2", "description": "string representations of objects in node and the browser", "main": "index.js", "sideEffects": false, "devDependencies": { - "@ljharb/eslint-config": "^21.1.0", + "@ljharb/eslint-config": "^21.1.1", "@pkgjs/support": "^0.0.6", "auto-changelog": "^2.4.0", "core-js": "^2.6.12", - "error-cause": "^1.0.6", + "error-cause": "^1.0.8", "es-value-fixtures": "^1.4.2", "eslint": "=8.8.0", "for-each": "^0.3.3", "functions-have-names": "^1.2.3", "glob": "=10.3.7", - "globalthis": "^1.0.3", - "has-tostringtag": "^1.0.0", + "globalthis": "^1.0.4", + "has-symbols": "^1.0.3", + "has-tostringtag": "^1.0.2", "in-publish": "^2.0.1", "jackspeak": "=2.1.1", "make-arrow-function": "^1.2.0", - "mock-property": "^1.0.2", - "npmignore": "^0.3.0", + "mock-property": "^1.0.3", + "npmignore": "^0.3.1", "nyc": "^10.3.2", "safe-publish-latest": "^2.0.0", + "safer-buffer": "^2.1.2", "string.prototype.repeat": "^1.0.0", - "tape": "^5.7.1" + "tape": "^5.8.1" }, "scripts": { "prepack": "npmignore --auto --commentLines=autogenerated", @@ -95,5 +97,8 @@ "./test-core-js.js" ] }, - "support": true + "support": true, + "engines": { + "node": ">= 0.4" + } } diff --git a/Modules/Chatroom/chat/node_modules/object-inspect/readme.markdown b/Modules/Chatroom/chat/node_modules/object-inspect/readme.markdown index 9ff6bec3661b..f91617df32a3 100644 --- a/Modules/Chatroom/chat/node_modules/object-inspect/readme.markdown +++ b/Modules/Chatroom/chat/node_modules/object-inspect/readme.markdown @@ -1,15 +1,13 @@ -# object-inspect [![Version Badge][2]][1] +# object-inspect [![Version Badge][npm-version-svg]][package-url] string representations of objects in node and the browser [![github actions][actions-image]][actions-url] [![coverage][codecov-image]][codecov-url] -[![dependency status][5]][6] -[![dev dependency status][7]][8] [![License][license-image]][license-url] [![Downloads][downloads-image]][downloads-url] -[![npm badge][11]][1] +[![npm badge][npm-badge-png]][package-url] # example @@ -69,13 +67,13 @@ npm install object-inspect MIT -[1]: https://npmjs.org/package/object-inspect -[2]: https://versionbadg.es/inspect-js/object-inspect.svg -[5]: https://david-dm.org/inspect-js/object-inspect.svg -[6]: https://david-dm.org/inspect-js/object-inspect -[7]: https://david-dm.org/inspect-js/object-inspect/dev-status.svg -[8]: https://david-dm.org/inspect-js/object-inspect#info=devDependencies -[11]: https://nodei.co/npm/object-inspect.png?downloads=true&stars=true +[package-url]: https://npmjs.org/package/object-inspect +[npm-version-svg]: https://versionbadg.es/inspect-js/object-inspect.svg +[deps-svg]: https://david-dm.org/inspect-js/object-inspect.svg +[deps-url]: https://david-dm.org/inspect-js/object-inspect +[dev-deps-svg]: https://david-dm.org/inspect-js/object-inspect/dev-status.svg +[dev-deps-url]: https://david-dm.org/inspect-js/object-inspect#info=devDependencies +[npm-badge-png]: https://nodei.co/npm/object-inspect.png?downloads=true&stars=true [license-image]: https://img.shields.io/npm/l/object-inspect.svg [license-url]: LICENSE [downloads-image]: https://img.shields.io/npm/dm/object-inspect.svg diff --git a/Modules/Chatroom/chat/node_modules/path-to-regexp/History.md b/Modules/Chatroom/chat/node_modules/path-to-regexp/History.md deleted file mode 100644 index 7f6587846f67..000000000000 --- a/Modules/Chatroom/chat/node_modules/path-to-regexp/History.md +++ /dev/null @@ -1,36 +0,0 @@ -0.1.7 / 2015-07-28 -================== - - * Fixed regression with escaped round brackets and matching groups. - -0.1.6 / 2015-06-19 -================== - - * Replace `index` feature by outputting all parameters, unnamed and named. - -0.1.5 / 2015-05-08 -================== - - * Add an index property for position in match result. - -0.1.4 / 2015-03-05 -================== - - * Add license information - -0.1.3 / 2014-07-06 -================== - - * Better array support - * Improved support for trailing slash in non-ending mode - -0.1.0 / 2014-03-06 -================== - - * add options.end - -0.0.2 / 2013-02-10 -================== - - * Update to match current express - * add .license property to component.json diff --git a/Modules/Chatroom/chat/node_modules/path-to-regexp/index.js b/Modules/Chatroom/chat/node_modules/path-to-regexp/index.js index 500d1dad0ef1..11503356d085 100644 --- a/Modules/Chatroom/chat/node_modules/path-to-regexp/index.js +++ b/Modules/Chatroom/chat/node_modules/path-to-regexp/index.js @@ -1,13 +1,13 @@ /** - * Expose `pathtoRegexp`. + * Expose `pathToRegexp`. */ -module.exports = pathtoRegexp; +module.exports = pathToRegexp; /** * Match matching groups in a regular expression. */ -var MATCHING_GROUP_REGEXP = /\((?!\?)/g; +var MATCHING_GROUP_REGEXP = /\\.|\((?:\?<(.*?)>)?(?!\?)/g; /** * Normalize the given path string, @@ -25,22 +25,27 @@ var MATCHING_GROUP_REGEXP = /\((?!\?)/g; * @api private */ -function pathtoRegexp(path, keys, options) { +function pathToRegexp(path, keys, options) { options = options || {}; keys = keys || []; var strict = options.strict; var end = options.end !== false; var flags = options.sensitive ? '' : 'i'; + var lookahead = options.lookahead !== false; var extraOffset = 0; var keysOffset = keys.length; var i = 0; var name = 0; + var pos = 0; + var backtrack = ''; var m; if (path instanceof RegExp) { while (m = MATCHING_GROUP_REGEXP.exec(path.source)) { + if (m[0][0] === '\\') continue; + keys.push({ - name: name++, + name: m[1] || name++, optional: false, offset: m.index }); @@ -54,20 +59,47 @@ function pathtoRegexp(path, keys, options) { // the same keys and options instance into every generation to get // consistent matching groups before we join the sources together. path = path.map(function (value) { - return pathtoRegexp(value, keys, options).source; + return pathToRegexp(value, keys, options).source; }); - return new RegExp('(?:' + path.join('|') + ')', flags); + return new RegExp(path.join('|'), flags); } - path = ('^' + path + (strict ? '' : path[path.length - 1] === '/' ? '?' : '/?')) - .replace(/\/\(/g, '/(?:') - .replace(/([\/\.])/g, '\\$1') - .replace(/(\\\/)?(\\\.)?:(\w+)(\(.*?\))?(\*)?(\?)?/g, function (match, slash, format, key, capture, star, optional, offset) { + path = path.replace( + /\\.|(\/)?(\.)?:(\w+)(\(.*?\))?(\*)?(\?)?|[.*]|\/\(/g, + function (match, slash, format, key, capture, star, optional, offset) { + pos = offset + match.length; + + if (match[0] === '\\') { + backtrack += match; + return match; + } + + if (match === '.') { + backtrack += '\\.'; + extraOffset += 1; + return '\\.'; + } + + backtrack = slash || format ? '' : path.slice(pos, offset); + + if (match === '*') { + extraOffset += 3; + return '(.*)'; + } + + if (match === '/(') { + backtrack += '/'; + extraOffset += 2; + return '/(?:'; + } + slash = slash || ''; - format = format || ''; - capture = capture || '([^\\/' + format + ']+?)'; + format = format ? '\\.' : ''; optional = optional || ''; + capture = capture ? + capture.replace(/\\.|\*/, function (m) { return m === '*' ? '(.*)' : m; }) : + (backtrack ? '((?:(?!/|' + backtrack + ').)+?)' : '([^/' + format + ']+?)'); keys.push({ name: key, @@ -75,41 +107,20 @@ function pathtoRegexp(path, keys, options) { offset: offset + extraOffset }); - var result = '' - + (optional ? '' : slash) - + '(?:' - + format + (optional ? slash : '') + capture - + (star ? '((?:[\\/' + format + '].+?)?)' : '') + var result = '(?:' + + format + slash + capture + + (star ? '((?:[/' + format + '].+?)?)' : '') + ')' + optional; extraOffset += result.length - match.length; return result; - }) - .replace(/\*/g, function (star, index) { - var len = keys.length - - while (len-- > keysOffset && keys[len].offset > index) { - keys[len].offset += 3; // Replacement length minus asterisk length. - } - - return '(.*)'; }); // This is a workaround for handling unnamed matching groups. while (m = MATCHING_GROUP_REGEXP.exec(path)) { - var escapeCount = 0; - var index = m.index; - - while (path.charAt(--index) === '\\') { - escapeCount++; - } - - // It's possible to escape the bracket. - if (escapeCount % 2 === 1) { - continue; - } + if (m[0][0] === '\\') continue; if (keysOffset + i === keys.length || keys[keysOffset + i].offset > m.index) { keys.splice(keysOffset + i, 0, { @@ -122,8 +133,14 @@ function pathtoRegexp(path, keys, options) { i++; } + path += strict ? '' : path[path.length - 1] === '/' ? '?' : '/?'; + // If the path is non-ending, match until the end or a slash. - path += (end ? '$' : (path[path.length - 1] === '/' ? '' : '(?=\\/|$)')); + if (end) { + path += '$'; + } else if (path[path.length - 1] !== '/') { + path += lookahead ? '(?=/|$)' : '(?:/|$)'; + } - return new RegExp(path, flags); + return new RegExp('^' + path, flags); }; diff --git a/Modules/Chatroom/chat/node_modules/path-to-regexp/package.json b/Modules/Chatroom/chat/node_modules/path-to-regexp/package.json index d4e51b5743a8..0fe1eede29b2 100644 --- a/Modules/Chatroom/chat/node_modules/path-to-regexp/package.json +++ b/Modules/Chatroom/chat/node_modules/path-to-regexp/package.json @@ -1,7 +1,7 @@ { "name": "path-to-regexp", "description": "Express style path to RegExp utility", - "version": "0.1.7", + "version": "0.1.10", "files": [ "index.js", "LICENSE" @@ -21,7 +21,7 @@ "license": "MIT", "repository": { "type": "git", - "url": "https://github.com/component/path-to-regexp.git" + "url": "https://github.com/pillarjs/path-to-regexp.git" }, "devDependencies": { "mocha": "^1.17.1", diff --git a/Modules/Chatroom/chat/node_modules/send/HISTORY.md b/Modules/Chatroom/chat/node_modules/send/HISTORY.md index a7397749461a..0dd29d0f0f8b 100644 --- a/Modules/Chatroom/chat/node_modules/send/HISTORY.md +++ b/Modules/Chatroom/chat/node_modules/send/HISTORY.md @@ -1,3 +1,8 @@ +0.19.0 / 2024-09-10 +=================== + +* Remove link renderization in html while redirecting + 0.18.0 / 2022-03-23 =================== diff --git a/Modules/Chatroom/chat/node_modules/send/index.js b/Modules/Chatroom/chat/node_modules/send/index.js index 89afd7e584a5..768f8ca60ccb 100644 --- a/Modules/Chatroom/chat/node_modules/send/index.js +++ b/Modules/Chatroom/chat/node_modules/send/index.js @@ -482,8 +482,7 @@ SendStream.prototype.redirect = function redirect (path) { } var loc = encodeUrl(collapseLeadingSlashes(this.path + '/')) - var doc = createHtmlDocument('Redirecting', 'Redirecting to ' + - escapeHtml(loc) + '') + var doc = createHtmlDocument('Redirecting', 'Redirecting to ' + escapeHtml(loc)) // redirect res.statusCode = 301 diff --git a/Modules/Chatroom/chat/node_modules/send/package.json b/Modules/Chatroom/chat/node_modules/send/package.json index 7f269d515c8b..a3233e005711 100644 --- a/Modules/Chatroom/chat/node_modules/send/package.json +++ b/Modules/Chatroom/chat/node_modules/send/package.json @@ -1,7 +1,7 @@ { "name": "send", "description": "Better streaming static file server with Range and conditional-GET support", - "version": "0.18.0", + "version": "0.19.0", "author": "TJ Holowaychuk ", "contributors": [ "Douglas Christopher Wilson ", diff --git a/Modules/Chatroom/chat/node_modules/serve-static/HISTORY.md b/Modules/Chatroom/chat/node_modules/serve-static/HISTORY.md index 6b58456353c6..fde1d72da068 100644 --- a/Modules/Chatroom/chat/node_modules/serve-static/HISTORY.md +++ b/Modules/Chatroom/chat/node_modules/serve-static/HISTORY.md @@ -1,3 +1,9 @@ +1.16.0 / 2024-09-10 +=================== + +* Remove link renderization in html while redirecting + + 1.15.0 / 2022-03-24 =================== diff --git a/Modules/Chatroom/chat/node_modules/serve-static/index.js b/Modules/Chatroom/chat/node_modules/serve-static/index.js index b7d3984c4479..3f3e64e9eaad 100644 --- a/Modules/Chatroom/chat/node_modules/serve-static/index.js +++ b/Modules/Chatroom/chat/node_modules/serve-static/index.js @@ -195,8 +195,7 @@ function createRedirectDirectoryListener () { // reformat the URL var loc = encodeUrl(url.format(originalUrl)) - var doc = createHtmlDocument('Redirecting', 'Redirecting to ' + - escapeHtml(loc) + '') + var doc = createHtmlDocument('Redirecting', 'Redirecting to ' + escapeHtml(loc)) // send redirect response res.statusCode = 301 diff --git a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/.coveralls.yml b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/.coveralls.yml new file mode 100644 index 000000000000..20a706858179 --- /dev/null +++ b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/.coveralls.yml @@ -0,0 +1 @@ +repo_token: SIAeZjKYlHK74rbcFvNHMUzjRiMpflxve diff --git a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/.eslintrc b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/.eslintrc new file mode 100644 index 000000000000..8a37ae2c2e5a --- /dev/null +++ b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/.eslintrc @@ -0,0 +1,11 @@ +{ + "env": { + "browser": true, + "node": true + }, + "rules": { + "no-console": 0, + "no-empty": [1, { "allowEmptyCatch": true }] + }, + "extends": "eslint:recommended" +} diff --git a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/.npmignore b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/.npmignore new file mode 100644 index 000000000000..5f60eecc84e2 --- /dev/null +++ b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/.npmignore @@ -0,0 +1,9 @@ +support +test +examples +example +*.sock +dist +yarn.lock +coverage +bower.json diff --git a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/.travis.yml b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/.travis.yml new file mode 100644 index 000000000000..6c6090c3b09f --- /dev/null +++ b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/.travis.yml @@ -0,0 +1,14 @@ + +language: node_js +node_js: + - "6" + - "5" + - "4" + +install: + - make node_modules + +script: + - make lint + - make test + - make coveralls diff --git a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/CHANGELOG.md b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/CHANGELOG.md new file mode 100644 index 000000000000..eadaa189517b --- /dev/null +++ b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/CHANGELOG.md @@ -0,0 +1,362 @@ + +2.6.9 / 2017-09-22 +================== + + * remove ReDoS regexp in %o formatter (#504) + +2.6.8 / 2017-05-18 +================== + + * Fix: Check for undefined on browser globals (#462, @marbemac) + +2.6.7 / 2017-05-16 +================== + + * Fix: Update ms to 2.0.0 to fix regular expression denial of service vulnerability (#458, @hubdotcom) + * Fix: Inline extend function in node implementation (#452, @dougwilson) + * Docs: Fix typo (#455, @msasad) + +2.6.5 / 2017-04-27 +================== + + * Fix: null reference check on window.documentElement.style.WebkitAppearance (#447, @thebigredgeek) + * Misc: clean up browser reference checks (#447, @thebigredgeek) + * Misc: add npm-debug.log to .gitignore (@thebigredgeek) + + +2.6.4 / 2017-04-20 +================== + + * Fix: bug that would occure if process.env.DEBUG is a non-string value. (#444, @LucianBuzzo) + * Chore: ignore bower.json in npm installations. (#437, @joaovieira) + * Misc: update "ms" to v0.7.3 (@tootallnate) + +2.6.3 / 2017-03-13 +================== + + * Fix: Electron reference to `process.env.DEBUG` (#431, @paulcbetts) + * Docs: Changelog fix (@thebigredgeek) + +2.6.2 / 2017-03-10 +================== + + * Fix: DEBUG_MAX_ARRAY_LENGTH (#420, @slavaGanzin) + * Docs: Add backers and sponsors from Open Collective (#422, @piamancini) + * Docs: Add Slackin invite badge (@tootallnate) + +2.6.1 / 2017-02-10 +================== + + * Fix: Module's `export default` syntax fix for IE8 `Expected identifier` error + * Fix: Whitelist DEBUG_FD for values 1 and 2 only (#415, @pi0) + * Fix: IE8 "Expected identifier" error (#414, @vgoma) + * Fix: Namespaces would not disable once enabled (#409, @musikov) + +2.6.0 / 2016-12-28 +================== + + * Fix: added better null pointer checks for browser useColors (@thebigredgeek) + * Improvement: removed explicit `window.debug` export (#404, @tootallnate) + * Improvement: deprecated `DEBUG_FD` environment variable (#405, @tootallnate) + +2.5.2 / 2016-12-25 +================== + + * Fix: reference error on window within webworkers (#393, @KlausTrainer) + * Docs: fixed README typo (#391, @lurch) + * Docs: added notice about v3 api discussion (@thebigredgeek) + +2.5.1 / 2016-12-20 +================== + + * Fix: babel-core compatibility + +2.5.0 / 2016-12-20 +================== + + * Fix: wrong reference in bower file (@thebigredgeek) + * Fix: webworker compatibility (@thebigredgeek) + * Fix: output formatting issue (#388, @kribblo) + * Fix: babel-loader compatibility (#383, @escwald) + * Misc: removed built asset from repo and publications (@thebigredgeek) + * Misc: moved source files to /src (#378, @yamikuronue) + * Test: added karma integration and replaced babel with browserify for browser tests (#378, @yamikuronue) + * Test: coveralls integration (#378, @yamikuronue) + * Docs: simplified language in the opening paragraph (#373, @yamikuronue) + +2.4.5 / 2016-12-17 +================== + + * Fix: `navigator` undefined in Rhino (#376, @jochenberger) + * Fix: custom log function (#379, @hsiliev) + * Improvement: bit of cleanup + linting fixes (@thebigredgeek) + * Improvement: rm non-maintainted `dist/` dir (#375, @freewil) + * Docs: simplified language in the opening paragraph. (#373, @yamikuronue) + +2.4.4 / 2016-12-14 +================== + + * Fix: work around debug being loaded in preload scripts for electron (#368, @paulcbetts) + +2.4.3 / 2016-12-14 +================== + + * Fix: navigation.userAgent error for react native (#364, @escwald) + +2.4.2 / 2016-12-14 +================== + + * Fix: browser colors (#367, @tootallnate) + * Misc: travis ci integration (@thebigredgeek) + * Misc: added linting and testing boilerplate with sanity check (@thebigredgeek) + +2.4.1 / 2016-12-13 +================== + + * Fix: typo that broke the package (#356) + +2.4.0 / 2016-12-13 +================== + + * Fix: bower.json references unbuilt src entry point (#342, @justmatt) + * Fix: revert "handle regex special characters" (@tootallnate) + * Feature: configurable util.inspect()`options for NodeJS (#327, @tootallnate) + * Feature: %O`(big O) pretty-prints objects (#322, @tootallnate) + * Improvement: allow colors in workers (#335, @botverse) + * Improvement: use same color for same namespace. (#338, @lchenay) + +2.3.3 / 2016-11-09 +================== + + * Fix: Catch `JSON.stringify()` errors (#195, Jovan Alleyne) + * Fix: Returning `localStorage` saved values (#331, Levi Thomason) + * Improvement: Don't create an empty object when no `process` (Nathan Rajlich) + +2.3.2 / 2016-11-09 +================== + + * Fix: be super-safe in index.js as well (@TooTallNate) + * Fix: should check whether process exists (Tom Newby) + +2.3.1 / 2016-11-09 +================== + + * Fix: Added electron compatibility (#324, @paulcbetts) + * Improvement: Added performance optimizations (@tootallnate) + * Readme: Corrected PowerShell environment variable example (#252, @gimre) + * Misc: Removed yarn lock file from source control (#321, @fengmk2) + +2.3.0 / 2016-11-07 +================== + + * Fix: Consistent placement of ms diff at end of output (#215, @gorangajic) + * Fix: Escaping of regex special characters in namespace strings (#250, @zacronos) + * Fix: Fixed bug causing crash on react-native (#282, @vkarpov15) + * Feature: Enabled ES6+ compatible import via default export (#212 @bucaran) + * Feature: Added %O formatter to reflect Chrome's console.log capability (#279, @oncletom) + * Package: Update "ms" to 0.7.2 (#315, @DevSide) + * Package: removed superfluous version property from bower.json (#207 @kkirsche) + * Readme: fix USE_COLORS to DEBUG_COLORS + * Readme: Doc fixes for format string sugar (#269, @mlucool) + * Readme: Updated docs for DEBUG_FD and DEBUG_COLORS environment variables (#232, @mattlyons0) + * Readme: doc fixes for PowerShell (#271 #243, @exoticknight @unreadable) + * Readme: better docs for browser support (#224, @matthewmueller) + * Tooling: Added yarn integration for development (#317, @thebigredgeek) + * Misc: Renamed History.md to CHANGELOG.md (@thebigredgeek) + * Misc: Added license file (#226 #274, @CantemoInternal @sdaitzman) + * Misc: Updated contributors (@thebigredgeek) + +2.2.0 / 2015-05-09 +================== + + * package: update "ms" to v0.7.1 (#202, @dougwilson) + * README: add logging to file example (#193, @DanielOchoa) + * README: fixed a typo (#191, @amir-s) + * browser: expose `storage` (#190, @stephenmathieson) + * Makefile: add a `distclean` target (#189, @stephenmathieson) + +2.1.3 / 2015-03-13 +================== + + * Updated stdout/stderr example (#186) + * Updated example/stdout.js to match debug current behaviour + * Renamed example/stderr.js to stdout.js + * Update Readme.md (#184) + * replace high intensity foreground color for bold (#182, #183) + +2.1.2 / 2015-03-01 +================== + + * dist: recompile + * update "ms" to v0.7.0 + * package: update "browserify" to v9.0.3 + * component: fix "ms.js" repo location + * changed bower package name + * updated documentation about using debug in a browser + * fix: security error on safari (#167, #168, @yields) + +2.1.1 / 2014-12-29 +================== + + * browser: use `typeof` to check for `console` existence + * browser: check for `console.log` truthiness (fix IE 8/9) + * browser: add support for Chrome apps + * Readme: added Windows usage remarks + * Add `bower.json` to properly support bower install + +2.1.0 / 2014-10-15 +================== + + * node: implement `DEBUG_FD` env variable support + * package: update "browserify" to v6.1.0 + * package: add "license" field to package.json (#135, @panuhorsmalahti) + +2.0.0 / 2014-09-01 +================== + + * package: update "browserify" to v5.11.0 + * node: use stderr rather than stdout for logging (#29, @stephenmathieson) + +1.0.4 / 2014-07-15 +================== + + * dist: recompile + * example: remove `console.info()` log usage + * example: add "Content-Type" UTF-8 header to browser example + * browser: place %c marker after the space character + * browser: reset the "content" color via `color: inherit` + * browser: add colors support for Firefox >= v31 + * debug: prefer an instance `log()` function over the global one (#119) + * Readme: update documentation about styled console logs for FF v31 (#116, @wryk) + +1.0.3 / 2014-07-09 +================== + + * Add support for multiple wildcards in namespaces (#122, @seegno) + * browser: fix lint + +1.0.2 / 2014-06-10 +================== + + * browser: update color palette (#113, @gscottolson) + * common: make console logging function configurable (#108, @timoxley) + * node: fix %o colors on old node <= 0.8.x + * Makefile: find node path using shell/which (#109, @timoxley) + +1.0.1 / 2014-06-06 +================== + + * browser: use `removeItem()` to clear localStorage + * browser, node: don't set DEBUG if namespaces is undefined (#107, @leedm777) + * package: add "contributors" section + * node: fix comment typo + * README: list authors + +1.0.0 / 2014-06-04 +================== + + * make ms diff be global, not be scope + * debug: ignore empty strings in enable() + * node: make DEBUG_COLORS able to disable coloring + * *: export the `colors` array + * npmignore: don't publish the `dist` dir + * Makefile: refactor to use browserify + * package: add "browserify" as a dev dependency + * Readme: add Web Inspector Colors section + * node: reset terminal color for the debug content + * node: map "%o" to `util.inspect()` + * browser: map "%j" to `JSON.stringify()` + * debug: add custom "formatters" + * debug: use "ms" module for humanizing the diff + * Readme: add "bash" syntax highlighting + * browser: add Firebug color support + * browser: add colors for WebKit browsers + * node: apply log to `console` + * rewrite: abstract common logic for Node & browsers + * add .jshintrc file + +0.8.1 / 2014-04-14 +================== + + * package: re-add the "component" section + +0.8.0 / 2014-03-30 +================== + + * add `enable()` method for nodejs. Closes #27 + * change from stderr to stdout + * remove unnecessary index.js file + +0.7.4 / 2013-11-13 +================== + + * remove "browserify" key from package.json (fixes something in browserify) + +0.7.3 / 2013-10-30 +================== + + * fix: catch localStorage security error when cookies are blocked (Chrome) + * add debug(err) support. Closes #46 + * add .browser prop to package.json. Closes #42 + +0.7.2 / 2013-02-06 +================== + + * fix package.json + * fix: Mobile Safari (private mode) is broken with debug + * fix: Use unicode to send escape character to shell instead of octal to work with strict mode javascript + +0.7.1 / 2013-02-05 +================== + + * add repository URL to package.json + * add DEBUG_COLORED to force colored output + * add browserify support + * fix component. Closes #24 + +0.7.0 / 2012-05-04 +================== + + * Added .component to package.json + * Added debug.component.js build + +0.6.0 / 2012-03-16 +================== + + * Added support for "-" prefix in DEBUG [Vinay Pulim] + * Added `.enabled` flag to the node version [TooTallNate] + +0.5.0 / 2012-02-02 +================== + + * Added: humanize diffs. Closes #8 + * Added `debug.disable()` to the CS variant + * Removed padding. Closes #10 + * Fixed: persist client-side variant again. Closes #9 + +0.4.0 / 2012-02-01 +================== + + * Added browser variant support for older browsers [TooTallNate] + * Added `debug.enable('project:*')` to browser variant [TooTallNate] + * Added padding to diff (moved it to the right) + +0.3.0 / 2012-01-26 +================== + + * Added millisecond diff when isatty, otherwise UTC string + +0.2.0 / 2012-01-22 +================== + + * Added wildcard support + +0.1.0 / 2011-12-02 +================== + + * Added: remove colors unless stderr isatty [TooTallNate] + +0.0.1 / 2010-01-03 +================== + + * Initial release diff --git a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/LICENSE b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/LICENSE new file mode 100644 index 000000000000..658c933d2825 --- /dev/null +++ b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/LICENSE @@ -0,0 +1,19 @@ +(The MIT License) + +Copyright (c) 2014 TJ Holowaychuk + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software +and associated documentation files (the 'Software'), to deal in the Software without restriction, +including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial +portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT +LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/Makefile b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/Makefile new file mode 100644 index 000000000000..584da8bf938e --- /dev/null +++ b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/Makefile @@ -0,0 +1,50 @@ +# get Makefile directory name: http://stackoverflow.com/a/5982798/376773 +THIS_MAKEFILE_PATH:=$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)) +THIS_DIR:=$(shell cd $(dir $(THIS_MAKEFILE_PATH));pwd) + +# BIN directory +BIN := $(THIS_DIR)/node_modules/.bin + +# Path +PATH := node_modules/.bin:$(PATH) +SHELL := /bin/bash + +# applications +NODE ?= $(shell which node) +YARN ?= $(shell which yarn) +PKG ?= $(if $(YARN),$(YARN),$(NODE) $(shell which npm)) +BROWSERIFY ?= $(NODE) $(BIN)/browserify + +.FORCE: + +install: node_modules + +node_modules: package.json + @NODE_ENV= $(PKG) install + @touch node_modules + +lint: .FORCE + eslint browser.js debug.js index.js node.js + +test-node: .FORCE + istanbul cover node_modules/mocha/bin/_mocha -- test/**.js + +test-browser: .FORCE + mkdir -p dist + + @$(BROWSERIFY) \ + --standalone debug \ + . > dist/debug.js + + karma start --single-run + rimraf dist + +test: .FORCE + concurrently \ + "make test-node" \ + "make test-browser" + +coveralls: + cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js + +.PHONY: all install clean distclean diff --git a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/README.md b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/README.md new file mode 100644 index 000000000000..f67be6b317c1 --- /dev/null +++ b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/README.md @@ -0,0 +1,312 @@ +# debug +[![Build Status](https://travis-ci.org/visionmedia/debug.svg?branch=master)](https://travis-ci.org/visionmedia/debug) [![Coverage Status](https://coveralls.io/repos/github/visionmedia/debug/badge.svg?branch=master)](https://coveralls.io/github/visionmedia/debug?branch=master) [![Slack](https://visionmedia-community-slackin.now.sh/badge.svg)](https://visionmedia-community-slackin.now.sh/) [![OpenCollective](https://opencollective.com/debug/backers/badge.svg)](#backers) +[![OpenCollective](https://opencollective.com/debug/sponsors/badge.svg)](#sponsors) + + + +A tiny node.js debugging utility modelled after node core's debugging technique. + +**Discussion around the V3 API is under way [here](https://github.com/visionmedia/debug/issues/370)** + +## Installation + +```bash +$ npm install debug +``` + +## Usage + +`debug` exposes a function; simply pass this function the name of your module, and it will return a decorated version of `console.error` for you to pass debug statements to. This will allow you to toggle the debug output for different parts of your module as well as the module as a whole. + +Example _app.js_: + +```js +var debug = require('debug')('http') + , http = require('http') + , name = 'My App'; + +// fake app + +debug('booting %s', name); + +http.createServer(function(req, res){ + debug(req.method + ' ' + req.url); + res.end('hello\n'); +}).listen(3000, function(){ + debug('listening'); +}); + +// fake worker of some kind + +require('./worker'); +``` + +Example _worker.js_: + +```js +var debug = require('debug')('worker'); + +setInterval(function(){ + debug('doing some work'); +}, 1000); +``` + + The __DEBUG__ environment variable is then used to enable these based on space or comma-delimited names. Here are some examples: + + ![debug http and worker](http://f.cl.ly/items/18471z1H402O24072r1J/Screenshot.png) + + ![debug worker](http://f.cl.ly/items/1X413v1a3M0d3C2c1E0i/Screenshot.png) + +#### Windows note + + On Windows the environment variable is set using the `set` command. + + ```cmd + set DEBUG=*,-not_this + ``` + + Note that PowerShell uses different syntax to set environment variables. + + ```cmd + $env:DEBUG = "*,-not_this" + ``` + +Then, run the program to be debugged as usual. + +## Millisecond diff + + When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls. + + ![](http://f.cl.ly/items/2i3h1d3t121M2Z1A3Q0N/Screenshot.png) + + When stdout is not a TTY, `Date#toUTCString()` is used, making it more useful for logging the debug information as shown below: + + ![](http://f.cl.ly/items/112H3i0e0o0P0a2Q2r11/Screenshot.png) + +## Conventions + + If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser". + +## Wildcards + + The `*` character may be used as a wildcard. Suppose for example your library has debuggers named "connect:bodyParser", "connect:compress", "connect:session", instead of listing all three with `DEBUG=connect:bodyParser,connect:compress,connect:session`, you may simply do `DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`. + + You can also exclude specific debuggers by prefixing them with a "-" character. For example, `DEBUG=*,-connect:*` would include all debuggers except those starting with "connect:". + +## Environment Variables + + When running through Node.js, you can set a few environment variables that will + change the behavior of the debug logging: + +| Name | Purpose | +|-----------|-------------------------------------------------| +| `DEBUG` | Enables/disables specific debugging namespaces. | +| `DEBUG_COLORS`| Whether or not to use colors in the debug output. | +| `DEBUG_DEPTH` | Object inspection depth. | +| `DEBUG_SHOW_HIDDEN` | Shows hidden properties on inspected objects. | + + + __Note:__ The environment variables beginning with `DEBUG_` end up being + converted into an Options object that gets used with `%o`/`%O` formatters. + See the Node.js documentation for + [`util.inspect()`](https://nodejs.org/api/util.html#util_util_inspect_object_options) + for the complete list. + +## Formatters + + + Debug uses [printf-style](https://wikipedia.org/wiki/Printf_format_string) formatting. Below are the officially supported formatters: + +| Formatter | Representation | +|-----------|----------------| +| `%O` | Pretty-print an Object on multiple lines. | +| `%o` | Pretty-print an Object all on a single line. | +| `%s` | String. | +| `%d` | Number (both integer and float). | +| `%j` | JSON. Replaced with the string '[Circular]' if the argument contains circular references. | +| `%%` | Single percent sign ('%'). This does not consume an argument. | + +### Custom formatters + + You can add custom formatters by extending the `debug.formatters` object. For example, if you wanted to add support for rendering a Buffer as hex with `%h`, you could do something like: + +```js +const createDebug = require('debug') +createDebug.formatters.h = (v) => { + return v.toString('hex') +} + +// …elsewhere +const debug = createDebug('foo') +debug('this is hex: %h', new Buffer('hello world')) +// foo this is hex: 68656c6c6f20776f726c6421 +0ms +``` + +## Browser support + You can build a browser-ready script using [browserify](https://github.com/substack/node-browserify), + or just use the [browserify-as-a-service](https://wzrd.in/) [build](https://wzrd.in/standalone/debug@latest), + if you don't want to build it yourself. + + Debug's enable state is currently persisted by `localStorage`. + Consider the situation shown below where you have `worker:a` and `worker:b`, + and wish to debug both. You can enable this using `localStorage.debug`: + +```js +localStorage.debug = 'worker:*' +``` + +And then refresh the page. + +```js +a = debug('worker:a'); +b = debug('worker:b'); + +setInterval(function(){ + a('doing some work'); +}, 1000); + +setInterval(function(){ + b('doing some work'); +}, 1200); +``` + +#### Web Inspector Colors + + Colors are also enabled on "Web Inspectors" that understand the `%c` formatting + option. These are WebKit web inspectors, Firefox ([since version + 31](https://hacks.mozilla.org/2014/05/editable-box-model-multiple-selection-sublime-text-keys-much-more-firefox-developer-tools-episode-31/)) + and the Firebug plugin for Firefox (any version). + + Colored output looks something like: + + ![](https://cloud.githubusercontent.com/assets/71256/3139768/b98c5fd8-e8ef-11e3-862a-f7253b6f47c6.png) + + +## Output streams + + By default `debug` will log to stderr, however this can be configured per-namespace by overriding the `log` method: + +Example _stdout.js_: + +```js +var debug = require('debug'); +var error = debug('app:error'); + +// by default stderr is used +error('goes to stderr!'); + +var log = debug('app:log'); +// set this namespace to log via console.log +log.log = console.log.bind(console); // don't forget to bind to console! +log('goes to stdout'); +error('still goes to stderr!'); + +// set all output to go via console.info +// overrides all per-namespace log settings +debug.log = console.info.bind(console); +error('now goes to stdout via console.info'); +log('still goes to stdout, but via console.info now'); +``` + + +## Authors + + - TJ Holowaychuk + - Nathan Rajlich + - Andrew Rhyne + +## Backers + +Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/debug#backer)] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +## Sponsors + +Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://opencollective.com/debug#sponsor)] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +## License + +(The MIT License) + +Copyright (c) 2014-2016 TJ Holowaychuk <tj@vision-media.ca> + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/component.json b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/component.json new file mode 100644 index 000000000000..9de26410f0d0 --- /dev/null +++ b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/component.json @@ -0,0 +1,19 @@ +{ + "name": "debug", + "repo": "visionmedia/debug", + "description": "small debugging utility", + "version": "2.6.9", + "keywords": [ + "debug", + "log", + "debugger" + ], + "main": "src/browser.js", + "scripts": [ + "src/browser.js", + "src/debug.js" + ], + "dependencies": { + "rauchg/ms.js": "0.7.1" + } +} diff --git a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/karma.conf.js b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/karma.conf.js new file mode 100644 index 000000000000..103a82d15bd7 --- /dev/null +++ b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/karma.conf.js @@ -0,0 +1,70 @@ +// Karma configuration +// Generated on Fri Dec 16 2016 13:09:51 GMT+0000 (UTC) + +module.exports = function(config) { + config.set({ + + // base path that will be used to resolve all patterns (eg. files, exclude) + basePath: '', + + + // frameworks to use + // available frameworks: https://npmjs.org/browse/keyword/karma-adapter + frameworks: ['mocha', 'chai', 'sinon'], + + + // list of files / patterns to load in the browser + files: [ + 'dist/debug.js', + 'test/*spec.js' + ], + + + // list of files to exclude + exclude: [ + 'src/node.js' + ], + + + // preprocess matching files before serving them to the browser + // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor + preprocessors: { + }, + + // test results reporter to use + // possible values: 'dots', 'progress' + // available reporters: https://npmjs.org/browse/keyword/karma-reporter + reporters: ['progress'], + + + // web server port + port: 9876, + + + // enable / disable colors in the output (reporters and logs) + colors: true, + + + // level of logging + // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG + logLevel: config.LOG_INFO, + + + // enable / disable watching file and executing tests whenever any file changes + autoWatch: true, + + + // start these browsers + // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher + browsers: ['PhantomJS'], + + + // Continuous Integration mode + // if true, Karma captures browsers, runs the tests and exits + singleRun: false, + + // Concurrency level + // how many browser should be started simultaneous + concurrency: Infinity + }) +} diff --git a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/node.js b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/node.js new file mode 100644 index 000000000000..7fc36fe6dbec --- /dev/null +++ b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/node.js @@ -0,0 +1 @@ +module.exports = require('./src/node'); diff --git a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/node_modules/ms/index.js b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/node_modules/ms/index.js new file mode 100644 index 000000000000..6a522b16b3a3 --- /dev/null +++ b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/node_modules/ms/index.js @@ -0,0 +1,152 @@ +/** + * Helpers. + */ + +var s = 1000; +var m = s * 60; +var h = m * 60; +var d = h * 24; +var y = d * 365.25; + +/** + * Parse or format the given `val`. + * + * Options: + * + * - `long` verbose formatting [false] + * + * @param {String|Number} val + * @param {Object} [options] + * @throws {Error} throw an error if val is not a non-empty string or a number + * @return {String|Number} + * @api public + */ + +module.exports = function(val, options) { + options = options || {}; + var type = typeof val; + if (type === 'string' && val.length > 0) { + return parse(val); + } else if (type === 'number' && isNaN(val) === false) { + return options.long ? fmtLong(val) : fmtShort(val); + } + throw new Error( + 'val is not a non-empty string or a valid number. val=' + + JSON.stringify(val) + ); +}; + +/** + * Parse the given `str` and return milliseconds. + * + * @param {String} str + * @return {Number} + * @api private + */ + +function parse(str) { + str = String(str); + if (str.length > 100) { + return; + } + var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec( + str + ); + if (!match) { + return; + } + var n = parseFloat(match[1]); + var type = (match[2] || 'ms').toLowerCase(); + switch (type) { + case 'years': + case 'year': + case 'yrs': + case 'yr': + case 'y': + return n * y; + case 'days': + case 'day': + case 'd': + return n * d; + case 'hours': + case 'hour': + case 'hrs': + case 'hr': + case 'h': + return n * h; + case 'minutes': + case 'minute': + case 'mins': + case 'min': + case 'm': + return n * m; + case 'seconds': + case 'second': + case 'secs': + case 'sec': + case 's': + return n * s; + case 'milliseconds': + case 'millisecond': + case 'msecs': + case 'msec': + case 'ms': + return n; + default: + return undefined; + } +} + +/** + * Short format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ + +function fmtShort(ms) { + if (ms >= d) { + return Math.round(ms / d) + 'd'; + } + if (ms >= h) { + return Math.round(ms / h) + 'h'; + } + if (ms >= m) { + return Math.round(ms / m) + 'm'; + } + if (ms >= s) { + return Math.round(ms / s) + 's'; + } + return ms + 'ms'; +} + +/** + * Long format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ + +function fmtLong(ms) { + return plural(ms, d, 'day') || + plural(ms, h, 'hour') || + plural(ms, m, 'minute') || + plural(ms, s, 'second') || + ms + ' ms'; +} + +/** + * Pluralization helper. + */ + +function plural(ms, n, name) { + if (ms < n) { + return; + } + if (ms < n * 1.5) { + return Math.floor(ms / n) + ' ' + name; + } + return Math.ceil(ms / n) + ' ' + name + 's'; +} diff --git a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/node_modules/ms/license.md b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/node_modules/ms/license.md new file mode 100644 index 000000000000..69b61253a389 --- /dev/null +++ b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/node_modules/ms/license.md @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016 Zeit, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/node_modules/ms/package.json b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/node_modules/ms/package.json new file mode 100644 index 000000000000..6a31c81fac43 --- /dev/null +++ b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/node_modules/ms/package.json @@ -0,0 +1,37 @@ +{ + "name": "ms", + "version": "2.0.0", + "description": "Tiny milisecond conversion utility", + "repository": "zeit/ms", + "main": "./index", + "files": [ + "index.js" + ], + "scripts": { + "precommit": "lint-staged", + "lint": "eslint lib/* bin/*", + "test": "mocha tests.js" + }, + "eslintConfig": { + "extends": "eslint:recommended", + "env": { + "node": true, + "es6": true + } + }, + "lint-staged": { + "*.js": [ + "npm run lint", + "prettier --single-quote --write", + "git add" + ] + }, + "license": "MIT", + "devDependencies": { + "eslint": "3.19.0", + "expect.js": "0.3.1", + "husky": "0.13.3", + "lint-staged": "3.4.1", + "mocha": "3.4.1" + } +} diff --git a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/node_modules/ms/readme.md b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/node_modules/ms/readme.md new file mode 100644 index 000000000000..84a9974cccd8 --- /dev/null +++ b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/node_modules/ms/readme.md @@ -0,0 +1,51 @@ +# ms + +[![Build Status](https://travis-ci.org/zeit/ms.svg?branch=master)](https://travis-ci.org/zeit/ms) +[![Slack Channel](http://zeit-slackin.now.sh/badge.svg)](https://zeit.chat/) + +Use this package to easily convert various time formats to milliseconds. + +## Examples + +```js +ms('2 days') // 172800000 +ms('1d') // 86400000 +ms('10h') // 36000000 +ms('2.5 hrs') // 9000000 +ms('2h') // 7200000 +ms('1m') // 60000 +ms('5s') // 5000 +ms('1y') // 31557600000 +ms('100') // 100 +``` + +### Convert from milliseconds + +```js +ms(60000) // "1m" +ms(2 * 60000) // "2m" +ms(ms('10 hours')) // "10h" +``` + +### Time format written-out + +```js +ms(60000, { long: true }) // "1 minute" +ms(2 * 60000, { long: true }) // "2 minutes" +ms(ms('10 hours'), { long: true }) // "10 hours" +``` + +## Features + +- Works both in [node](https://nodejs.org) and in the browser. +- If a number is supplied to `ms`, a string with a unit is returned. +- If a string that contains the number is supplied, it returns it as a number (e.g.: it returns `100` for `'100'`). +- If you pass a string with a number and a valid unit, the number of equivalent ms is returned. + +## Caught a bug? + +1. [Fork](https://help.github.com/articles/fork-a-repo/) this repository to your own GitHub account and then [clone](https://help.github.com/articles/cloning-a-repository/) it to your local device +2. Link the package to the global module directory: `npm link` +3. Within the module you want to test your local development instance of ms, just link it to the dependencies: `npm link ms`. Instead of the default one from npm, node will now use your clone of ms! + +As always, you can run the tests using: `npm test` diff --git a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/package.json b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/package.json new file mode 100644 index 000000000000..dc787ba76781 --- /dev/null +++ b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/package.json @@ -0,0 +1,49 @@ +{ + "name": "debug", + "version": "2.6.9", + "repository": { + "type": "git", + "url": "git://github.com/visionmedia/debug.git" + }, + "description": "small debugging utility", + "keywords": [ + "debug", + "log", + "debugger" + ], + "author": "TJ Holowaychuk ", + "contributors": [ + "Nathan Rajlich (http://n8.io)", + "Andrew Rhyne " + ], + "license": "MIT", + "dependencies": { + "ms": "2.0.0" + }, + "devDependencies": { + "browserify": "9.0.3", + "chai": "^3.5.0", + "concurrently": "^3.1.0", + "coveralls": "^2.11.15", + "eslint": "^3.12.1", + "istanbul": "^0.4.5", + "karma": "^1.3.0", + "karma-chai": "^0.1.0", + "karma-mocha": "^1.3.0", + "karma-phantomjs-launcher": "^1.0.2", + "karma-sinon": "^1.0.5", + "mocha": "^3.2.0", + "mocha-lcov-reporter": "^1.2.0", + "rimraf": "^2.5.4", + "sinon": "^1.17.6", + "sinon-chai": "^2.8.0" + }, + "main": "./src/index.js", + "browser": "./src/browser.js", + "component": { + "scripts": { + "debug/index.js": "browser.js", + "debug/debug.js": "debug.js" + } + } +} diff --git a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/src/browser.js b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/src/browser.js new file mode 100644 index 000000000000..710692493450 --- /dev/null +++ b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/src/browser.js @@ -0,0 +1,185 @@ +/** + * This is the web browser implementation of `debug()`. + * + * Expose `debug()` as the module. + */ + +exports = module.exports = require('./debug'); +exports.log = log; +exports.formatArgs = formatArgs; +exports.save = save; +exports.load = load; +exports.useColors = useColors; +exports.storage = 'undefined' != typeof chrome + && 'undefined' != typeof chrome.storage + ? chrome.storage.local + : localstorage(); + +/** + * Colors. + */ + +exports.colors = [ + 'lightseagreen', + 'forestgreen', + 'goldenrod', + 'dodgerblue', + 'darkorchid', + 'crimson' +]; + +/** + * Currently only WebKit-based Web Inspectors, Firefox >= v31, + * and the Firebug extension (any Firefox version) are known + * to support "%c" CSS customizations. + * + * TODO: add a `localStorage` variable to explicitly enable/disable colors + */ + +function useColors() { + // NB: In an Electron preload script, document will be defined but not fully + // initialized. Since we know we're in Chrome, we'll just detect this case + // explicitly + if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') { + return true; + } + + // is webkit? http://stackoverflow.com/a/16459606/376773 + // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 + return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) || + // is firebug? http://stackoverflow.com/a/398120/376773 + (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) || + // is firefox >= v31? + // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages + (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) || + // double check webkit in userAgent just in case we are in a worker + (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)); +} + +/** + * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. + */ + +exports.formatters.j = function(v) { + try { + return JSON.stringify(v); + } catch (err) { + return '[UnexpectedJSONParseError]: ' + err.message; + } +}; + + +/** + * Colorize log arguments if enabled. + * + * @api public + */ + +function formatArgs(args) { + var useColors = this.useColors; + + args[0] = (useColors ? '%c' : '') + + this.namespace + + (useColors ? ' %c' : ' ') + + args[0] + + (useColors ? '%c ' : ' ') + + '+' + exports.humanize(this.diff); + + if (!useColors) return; + + var c = 'color: ' + this.color; + args.splice(1, 0, c, 'color: inherit') + + // the final "%c" is somewhat tricky, because there could be other + // arguments passed either before or after the %c, so we need to + // figure out the correct index to insert the CSS into + var index = 0; + var lastC = 0; + args[0].replace(/%[a-zA-Z%]/g, function(match) { + if ('%%' === match) return; + index++; + if ('%c' === match) { + // we only are interested in the *last* %c + // (the user may have provided their own) + lastC = index; + } + }); + + args.splice(lastC, 0, c); +} + +/** + * Invokes `console.log()` when available. + * No-op when `console.log` is not a "function". + * + * @api public + */ + +function log() { + // this hackery is required for IE8/9, where + // the `console.log` function doesn't have 'apply' + return 'object' === typeof console + && console.log + && Function.prototype.apply.call(console.log, console, arguments); +} + +/** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ + +function save(namespaces) { + try { + if (null == namespaces) { + exports.storage.removeItem('debug'); + } else { + exports.storage.debug = namespaces; + } + } catch(e) {} +} + +/** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ + +function load() { + var r; + try { + r = exports.storage.debug; + } catch(e) {} + + // If debug isn't set in LS, and we're in Electron, try to load $DEBUG + if (!r && typeof process !== 'undefined' && 'env' in process) { + r = process.env.DEBUG; + } + + return r; +} + +/** + * Enable namespaces listed in `localStorage.debug` initially. + */ + +exports.enable(load()); + +/** + * Localstorage attempts to return the localstorage. + * + * This is necessary because safari throws + * when a user disables cookies/localstorage + * and you attempt to access it. + * + * @return {LocalStorage} + * @api private + */ + +function localstorage() { + try { + return window.localStorage; + } catch (e) {} +} diff --git a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/src/debug.js b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/src/debug.js new file mode 100644 index 000000000000..6a5e3fc94c3a --- /dev/null +++ b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/src/debug.js @@ -0,0 +1,202 @@ + +/** + * This is the common logic for both the Node.js and web browser + * implementations of `debug()`. + * + * Expose `debug()` as the module. + */ + +exports = module.exports = createDebug.debug = createDebug['default'] = createDebug; +exports.coerce = coerce; +exports.disable = disable; +exports.enable = enable; +exports.enabled = enabled; +exports.humanize = require('ms'); + +/** + * The currently active debug mode names, and names to skip. + */ + +exports.names = []; +exports.skips = []; + +/** + * Map of special "%n" handling functions, for the debug "format" argument. + * + * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". + */ + +exports.formatters = {}; + +/** + * Previous log timestamp. + */ + +var prevTime; + +/** + * Select a color. + * @param {String} namespace + * @return {Number} + * @api private + */ + +function selectColor(namespace) { + var hash = 0, i; + + for (i in namespace) { + hash = ((hash << 5) - hash) + namespace.charCodeAt(i); + hash |= 0; // Convert to 32bit integer + } + + return exports.colors[Math.abs(hash) % exports.colors.length]; +} + +/** + * Create a debugger with the given `namespace`. + * + * @param {String} namespace + * @return {Function} + * @api public + */ + +function createDebug(namespace) { + + function debug() { + // disabled? + if (!debug.enabled) return; + + var self = debug; + + // set `diff` timestamp + var curr = +new Date(); + var ms = curr - (prevTime || curr); + self.diff = ms; + self.prev = prevTime; + self.curr = curr; + prevTime = curr; + + // turn the `arguments` into a proper Array + var args = new Array(arguments.length); + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i]; + } + + args[0] = exports.coerce(args[0]); + + if ('string' !== typeof args[0]) { + // anything else let's inspect with %O + args.unshift('%O'); + } + + // apply any `formatters` transformations + var index = 0; + args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) { + // if we encounter an escaped % then don't increase the array index + if (match === '%%') return match; + index++; + var formatter = exports.formatters[format]; + if ('function' === typeof formatter) { + var val = args[index]; + match = formatter.call(self, val); + + // now we need to remove `args[index]` since it's inlined in the `format` + args.splice(index, 1); + index--; + } + return match; + }); + + // apply env-specific formatting (colors, etc.) + exports.formatArgs.call(self, args); + + var logFn = debug.log || exports.log || console.log.bind(console); + logFn.apply(self, args); + } + + debug.namespace = namespace; + debug.enabled = exports.enabled(namespace); + debug.useColors = exports.useColors(); + debug.color = selectColor(namespace); + + // env-specific initialization logic for debug instances + if ('function' === typeof exports.init) { + exports.init(debug); + } + + return debug; +} + +/** + * Enables a debug mode by namespaces. This can include modes + * separated by a colon and wildcards. + * + * @param {String} namespaces + * @api public + */ + +function enable(namespaces) { + exports.save(namespaces); + + exports.names = []; + exports.skips = []; + + var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); + var len = split.length; + + for (var i = 0; i < len; i++) { + if (!split[i]) continue; // ignore empty strings + namespaces = split[i].replace(/\*/g, '.*?'); + if (namespaces[0] === '-') { + exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); + } else { + exports.names.push(new RegExp('^' + namespaces + '$')); + } + } +} + +/** + * Disable debug output. + * + * @api public + */ + +function disable() { + exports.enable(''); +} + +/** + * Returns true if the given mode name is enabled, false otherwise. + * + * @param {String} name + * @return {Boolean} + * @api public + */ + +function enabled(name) { + var i, len; + for (i = 0, len = exports.skips.length; i < len; i++) { + if (exports.skips[i].test(name)) { + return false; + } + } + for (i = 0, len = exports.names.length; i < len; i++) { + if (exports.names[i].test(name)) { + return true; + } + } + return false; +} + +/** + * Coerce `val`. + * + * @param {Mixed} val + * @return {Mixed} + * @api private + */ + +function coerce(val) { + if (val instanceof Error) return val.stack || val.message; + return val; +} diff --git a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/src/index.js b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/src/index.js new file mode 100644 index 000000000000..e12cf4d58c9f --- /dev/null +++ b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/src/index.js @@ -0,0 +1,10 @@ +/** + * Detect Electron renderer process, which is node, but we should + * treat as a browser. + */ + +if (typeof process !== 'undefined' && process.type === 'renderer') { + module.exports = require('./browser.js'); +} else { + module.exports = require('./node.js'); +} diff --git a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/src/inspector-log.js b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/src/inspector-log.js new file mode 100644 index 000000000000..60ea6c04aafd --- /dev/null +++ b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/src/inspector-log.js @@ -0,0 +1,15 @@ +module.exports = inspectorLog; + +// black hole +const nullStream = new (require('stream').Writable)(); +nullStream._write = () => {}; + +/** + * Outputs a `console.log()` to the Node.js Inspector console *only*. + */ +function inspectorLog() { + const stdout = console._stdout; + console._stdout = nullStream; + console.log.apply(console, arguments); + console._stdout = stdout; +} diff --git a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/src/node.js b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/src/node.js new file mode 100644 index 000000000000..b15109c905a4 --- /dev/null +++ b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/src/node.js @@ -0,0 +1,248 @@ +/** + * Module dependencies. + */ + +var tty = require('tty'); +var util = require('util'); + +/** + * This is the Node.js implementation of `debug()`. + * + * Expose `debug()` as the module. + */ + +exports = module.exports = require('./debug'); +exports.init = init; +exports.log = log; +exports.formatArgs = formatArgs; +exports.save = save; +exports.load = load; +exports.useColors = useColors; + +/** + * Colors. + */ + +exports.colors = [6, 2, 3, 4, 5, 1]; + +/** + * Build up the default `inspectOpts` object from the environment variables. + * + * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js + */ + +exports.inspectOpts = Object.keys(process.env).filter(function (key) { + return /^debug_/i.test(key); +}).reduce(function (obj, key) { + // camel-case + var prop = key + .substring(6) + .toLowerCase() + .replace(/_([a-z])/g, function (_, k) { return k.toUpperCase() }); + + // coerce string value into JS value + var val = process.env[key]; + if (/^(yes|on|true|enabled)$/i.test(val)) val = true; + else if (/^(no|off|false|disabled)$/i.test(val)) val = false; + else if (val === 'null') val = null; + else val = Number(val); + + obj[prop] = val; + return obj; +}, {}); + +/** + * The file descriptor to write the `debug()` calls to. + * Set the `DEBUG_FD` env variable to override with another value. i.e.: + * + * $ DEBUG_FD=3 node script.js 3>debug.log + */ + +var fd = parseInt(process.env.DEBUG_FD, 10) || 2; + +if (1 !== fd && 2 !== fd) { + util.deprecate(function(){}, 'except for stderr(2) and stdout(1), any other usage of DEBUG_FD is deprecated. Override debug.log if you want to use a different log function (https://git.io/debug_fd)')() +} + +var stream = 1 === fd ? process.stdout : + 2 === fd ? process.stderr : + createWritableStdioStream(fd); + +/** + * Is stdout a TTY? Colored output is enabled when `true`. + */ + +function useColors() { + return 'colors' in exports.inspectOpts + ? Boolean(exports.inspectOpts.colors) + : tty.isatty(fd); +} + +/** + * Map %o to `util.inspect()`, all on a single line. + */ + +exports.formatters.o = function(v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts) + .split('\n').map(function(str) { + return str.trim() + }).join(' '); +}; + +/** + * Map %o to `util.inspect()`, allowing multiple lines if needed. + */ + +exports.formatters.O = function(v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts); +}; + +/** + * Adds ANSI color escape codes if enabled. + * + * @api public + */ + +function formatArgs(args) { + var name = this.namespace; + var useColors = this.useColors; + + if (useColors) { + var c = this.color; + var prefix = ' \u001b[3' + c + ';1m' + name + ' ' + '\u001b[0m'; + + args[0] = prefix + args[0].split('\n').join('\n' + prefix); + args.push('\u001b[3' + c + 'm+' + exports.humanize(this.diff) + '\u001b[0m'); + } else { + args[0] = new Date().toUTCString() + + ' ' + name + ' ' + args[0]; + } +} + +/** + * Invokes `util.format()` with the specified arguments and writes to `stream`. + */ + +function log() { + return stream.write(util.format.apply(util, arguments) + '\n'); +} + +/** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ + +function save(namespaces) { + if (null == namespaces) { + // If you set a process.env field to null or undefined, it gets cast to the + // string 'null' or 'undefined'. Just delete instead. + delete process.env.DEBUG; + } else { + process.env.DEBUG = namespaces; + } +} + +/** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ + +function load() { + return process.env.DEBUG; +} + +/** + * Copied from `node/src/node.js`. + * + * XXX: It's lame that node doesn't expose this API out-of-the-box. It also + * relies on the undocumented `tty_wrap.guessHandleType()` which is also lame. + */ + +function createWritableStdioStream (fd) { + var stream; + var tty_wrap = process.binding('tty_wrap'); + + // Note stream._type is used for test-module-load-list.js + + switch (tty_wrap.guessHandleType(fd)) { + case 'TTY': + stream = new tty.WriteStream(fd); + stream._type = 'tty'; + + // Hack to have stream not keep the event loop alive. + // See https://github.com/joyent/node/issues/1726 + if (stream._handle && stream._handle.unref) { + stream._handle.unref(); + } + break; + + case 'FILE': + var fs = require('fs'); + stream = new fs.SyncWriteStream(fd, { autoClose: false }); + stream._type = 'fs'; + break; + + case 'PIPE': + case 'TCP': + var net = require('net'); + stream = new net.Socket({ + fd: fd, + readable: false, + writable: true + }); + + // FIXME Should probably have an option in net.Socket to create a + // stream from an existing fd which is writable only. But for now + // we'll just add this hack and set the `readable` member to false. + // Test: ./node test/fixtures/echo.js < /etc/passwd + stream.readable = false; + stream.read = null; + stream._type = 'pipe'; + + // FIXME Hack to have stream not keep the event loop alive. + // See https://github.com/joyent/node/issues/1726 + if (stream._handle && stream._handle.unref) { + stream._handle.unref(); + } + break; + + default: + // Probably an error on in uv_guess_handle() + throw new Error('Implement me. Unknown stream file type!'); + } + + // For supporting legacy API we put the FD here. + stream.fd = fd; + + stream._isStdio = true; + + return stream; +} + +/** + * Init logic for `debug` instances. + * + * Create a new `inspectOpts` object in case `useColors` is set + * differently for a particular `debug` instance. + */ + +function init (debug) { + debug.inspectOpts = {}; + + var keys = Object.keys(exports.inspectOpts); + for (var i = 0; i < keys.length; i++) { + debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]]; + } +} + +/** + * Enable namespaces listed in `process.env.DEBUG` initially. + */ + +exports.enable(load()); diff --git a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/ms/index.js b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/ms/index.js new file mode 100644 index 000000000000..ea734fb73820 --- /dev/null +++ b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/ms/index.js @@ -0,0 +1,162 @@ +/** + * Helpers. + */ + +var s = 1000; +var m = s * 60; +var h = m * 60; +var d = h * 24; +var w = d * 7; +var y = d * 365.25; + +/** + * Parse or format the given `val`. + * + * Options: + * + * - `long` verbose formatting [false] + * + * @param {String|Number} val + * @param {Object} [options] + * @throws {Error} throw an error if val is not a non-empty string or a number + * @return {String|Number} + * @api public + */ + +module.exports = function (val, options) { + options = options || {}; + var type = typeof val; + if (type === 'string' && val.length > 0) { + return parse(val); + } else if (type === 'number' && isFinite(val)) { + return options.long ? fmtLong(val) : fmtShort(val); + } + throw new Error( + 'val is not a non-empty string or a valid number. val=' + + JSON.stringify(val) + ); +}; + +/** + * Parse the given `str` and return milliseconds. + * + * @param {String} str + * @return {Number} + * @api private + */ + +function parse(str) { + str = String(str); + if (str.length > 100) { + return; + } + var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( + str + ); + if (!match) { + return; + } + var n = parseFloat(match[1]); + var type = (match[2] || 'ms').toLowerCase(); + switch (type) { + case 'years': + case 'year': + case 'yrs': + case 'yr': + case 'y': + return n * y; + case 'weeks': + case 'week': + case 'w': + return n * w; + case 'days': + case 'day': + case 'd': + return n * d; + case 'hours': + case 'hour': + case 'hrs': + case 'hr': + case 'h': + return n * h; + case 'minutes': + case 'minute': + case 'mins': + case 'min': + case 'm': + return n * m; + case 'seconds': + case 'second': + case 'secs': + case 'sec': + case 's': + return n * s; + case 'milliseconds': + case 'millisecond': + case 'msecs': + case 'msec': + case 'ms': + return n; + default: + return undefined; + } +} + +/** + * Short format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ + +function fmtShort(ms) { + var msAbs = Math.abs(ms); + if (msAbs >= d) { + return Math.round(ms / d) + 'd'; + } + if (msAbs >= h) { + return Math.round(ms / h) + 'h'; + } + if (msAbs >= m) { + return Math.round(ms / m) + 'm'; + } + if (msAbs >= s) { + return Math.round(ms / s) + 's'; + } + return ms + 'ms'; +} + +/** + * Long format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ + +function fmtLong(ms) { + var msAbs = Math.abs(ms); + if (msAbs >= d) { + return plural(ms, msAbs, d, 'day'); + } + if (msAbs >= h) { + return plural(ms, msAbs, h, 'hour'); + } + if (msAbs >= m) { + return plural(ms, msAbs, m, 'minute'); + } + if (msAbs >= s) { + return plural(ms, msAbs, s, 'second'); + } + return ms + ' ms'; +} + +/** + * Pluralization helper. + */ + +function plural(ms, msAbs, n, name) { + var isPlural = msAbs >= n * 1.5; + return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : ''); +} diff --git a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/ms/license.md b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/ms/license.md new file mode 100644 index 000000000000..fa5d39b6213f --- /dev/null +++ b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/ms/license.md @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2020 Vercel, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/ms/package.json b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/ms/package.json new file mode 100644 index 000000000000..49971890df8e --- /dev/null +++ b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/ms/package.json @@ -0,0 +1,38 @@ +{ + "name": "ms", + "version": "2.1.3", + "description": "Tiny millisecond conversion utility", + "repository": "vercel/ms", + "main": "./index", + "files": [ + "index.js" + ], + "scripts": { + "precommit": "lint-staged", + "lint": "eslint lib/* bin/*", + "test": "mocha tests.js" + }, + "eslintConfig": { + "extends": "eslint:recommended", + "env": { + "node": true, + "es6": true + } + }, + "lint-staged": { + "*.js": [ + "npm run lint", + "prettier --single-quote --write", + "git add" + ] + }, + "license": "MIT", + "devDependencies": { + "eslint": "4.18.2", + "expect.js": "0.3.1", + "husky": "0.14.3", + "lint-staged": "5.0.0", + "mocha": "4.0.1", + "prettier": "2.0.5" + } +} diff --git a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/ms/readme.md b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/ms/readme.md new file mode 100644 index 000000000000..0fc1abb3b8e3 --- /dev/null +++ b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/ms/readme.md @@ -0,0 +1,59 @@ +# ms + +![CI](https://github.com/vercel/ms/workflows/CI/badge.svg) + +Use this package to easily convert various time formats to milliseconds. + +## Examples + +```js +ms('2 days') // 172800000 +ms('1d') // 86400000 +ms('10h') // 36000000 +ms('2.5 hrs') // 9000000 +ms('2h') // 7200000 +ms('1m') // 60000 +ms('5s') // 5000 +ms('1y') // 31557600000 +ms('100') // 100 +ms('-3 days') // -259200000 +ms('-1h') // -3600000 +ms('-200') // -200 +``` + +### Convert from Milliseconds + +```js +ms(60000) // "1m" +ms(2 * 60000) // "2m" +ms(-3 * 60000) // "-3m" +ms(ms('10 hours')) // "10h" +``` + +### Time Format Written-Out + +```js +ms(60000, { long: true }) // "1 minute" +ms(2 * 60000, { long: true }) // "2 minutes" +ms(-3 * 60000, { long: true }) // "-3 minutes" +ms(ms('10 hours'), { long: true }) // "10 hours" +``` + +## Features + +- Works both in [Node.js](https://nodejs.org) and in the browser +- If a number is supplied to `ms`, a string with a unit is returned +- If a string that contains the number is supplied, it returns it as a number (e.g.: it returns `100` for `'100'`) +- If you pass a string with a number and a valid unit, the number of equivalent milliseconds is returned + +## Related Packages + +- [ms.macro](https://github.com/knpwrs/ms.macro) - Run `ms` as a macro at build-time. + +## Caught a Bug? + +1. [Fork](https://help.github.com/articles/fork-a-repo/) this repository to your own GitHub account and then [clone](https://help.github.com/articles/cloning-a-repository/) it to your local device +2. Link the package to the global module directory: `npm link` +3. Within the module you want to test your local development instance of ms, just link it to the dependencies: `npm link ms`. Instead of the default one from npm, Node.js will now use your clone of ms! + +As always, you can run the tests using: `npm test` diff --git a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/send/HISTORY.md b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/send/HISTORY.md new file mode 100644 index 000000000000..a7397749461a --- /dev/null +++ b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/send/HISTORY.md @@ -0,0 +1,521 @@ +0.18.0 / 2022-03-23 +=================== + + * Fix emitted 416 error missing headers property + * Limit the headers removed for 304 response + * deps: depd@2.0.0 + - Replace internal `eval` usage with `Function` constructor + - Use instance methods on `process` to check for listeners + * deps: destroy@1.2.0 + * deps: http-errors@2.0.0 + - deps: depd@2.0.0 + - deps: statuses@2.0.1 + * deps: on-finished@2.4.1 + * deps: statuses@2.0.1 + +0.17.2 / 2021-12-11 +=================== + + * pref: ignore empty http tokens + * deps: http-errors@1.8.1 + - deps: inherits@2.0.4 + - deps: toidentifier@1.0.1 + - deps: setprototypeof@1.2.0 + * deps: ms@2.1.3 + +0.17.1 / 2019-05-10 +=================== + + * Set stricter CSP header in redirect & error responses + * deps: range-parser@~1.2.1 + +0.17.0 / 2019-05-03 +=================== + + * deps: http-errors@~1.7.2 + - Set constructor name when possible + - Use `toidentifier` module to make class names + - deps: depd@~1.1.2 + - deps: setprototypeof@1.1.1 + - deps: statuses@'>= 1.5.0 < 2' + * deps: mime@1.6.0 + - Add extensions for JPEG-2000 images + - Add new `font/*` types from IANA + - Add WASM mapping + - Update `.bdoc` to `application/bdoc` + - Update `.bmp` to `image/bmp` + - Update `.m4a` to `audio/mp4` + - Update `.rtf` to `application/rtf` + - Update `.wav` to `audio/wav` + - Update `.xml` to `application/xml` + - Update generic extensions to `application/octet-stream`: + `.deb`, `.dll`, `.dmg`, `.exe`, `.iso`, `.msi` + - Use mime-score module to resolve extension conflicts + * deps: ms@2.1.1 + - Add `week`/`w` support + - Fix negative number handling + * deps: statuses@~1.5.0 + * perf: remove redundant `path.normalize` call + +0.16.2 / 2018-02-07 +=================== + + * Fix incorrect end tag in default error & redirects + * deps: depd@~1.1.2 + - perf: remove argument reassignment + * deps: encodeurl@~1.0.2 + - Fix encoding `%` as last character + * deps: statuses@~1.4.0 + +0.16.1 / 2017-09-29 +=================== + + * Fix regression in edge-case behavior for empty `path` + +0.16.0 / 2017-09-27 +=================== + + * Add `immutable` option + * Fix missing `` in default error & redirects + * Use instance methods on steam to check for listeners + * deps: mime@1.4.1 + - Add 70 new types for file extensions + - Set charset as "UTF-8" for .js and .json + * perf: improve path validation speed + +0.15.6 / 2017-09-22 +=================== + + * deps: debug@2.6.9 + * perf: improve `If-Match` token parsing + +0.15.5 / 2017-09-20 +=================== + + * deps: etag@~1.8.1 + - perf: replace regular expression with substring + * deps: fresh@0.5.2 + - Fix handling of modified headers with invalid dates + - perf: improve ETag match loop + - perf: improve `If-None-Match` token parsing + +0.15.4 / 2017-08-05 +=================== + + * deps: debug@2.6.8 + * deps: depd@~1.1.1 + - Remove unnecessary `Buffer` loading + * deps: http-errors@~1.6.2 + - deps: depd@1.1.1 + +0.15.3 / 2017-05-16 +=================== + + * deps: debug@2.6.7 + - deps: ms@2.0.0 + * deps: ms@2.0.0 + +0.15.2 / 2017-04-26 +=================== + + * deps: debug@2.6.4 + - Fix `DEBUG_MAX_ARRAY_LENGTH` + - deps: ms@0.7.3 + * deps: ms@1.0.0 + +0.15.1 / 2017-03-04 +=================== + + * Fix issue when `Date.parse` does not return `NaN` on invalid date + * Fix strict violation in broken environments + +0.15.0 / 2017-02-25 +=================== + + * Support `If-Match` and `If-Unmodified-Since` headers + * Add `res` and `path` arguments to `directory` event + * Remove usage of `res._headers` private field + - Improves compatibility with Node.js 8 nightly + * Send complete HTML document in redirect & error responses + * Set default CSP header in redirect & error responses + * Use `res.getHeaderNames()` when available + * Use `res.headersSent` when available + * deps: debug@2.6.1 + - Allow colors in workers + - Deprecated `DEBUG_FD` environment variable set to `3` or higher + - Fix error when running under React Native + - Use same color for same namespace + - deps: ms@0.7.2 + * deps: etag@~1.8.0 + * deps: fresh@0.5.0 + - Fix false detection of `no-cache` request directive + - Fix incorrect result when `If-None-Match` has both `*` and ETags + - Fix weak `ETag` matching to match spec + - perf: delay reading header values until needed + - perf: enable strict mode + - perf: hoist regular expressions + - perf: remove duplicate conditional + - perf: remove unnecessary boolean coercions + - perf: skip checking modified time if ETag check failed + - perf: skip parsing `If-None-Match` when no `ETag` header + - perf: use `Date.parse` instead of `new Date` + * deps: http-errors@~1.6.1 + - Make `message` property enumerable for `HttpError`s + - deps: setprototypeof@1.0.3 + +0.14.2 / 2017-01-23 +=================== + + * deps: http-errors@~1.5.1 + - deps: inherits@2.0.3 + - deps: setprototypeof@1.0.2 + - deps: statuses@'>= 1.3.1 < 2' + * deps: ms@0.7.2 + * deps: statuses@~1.3.1 + +0.14.1 / 2016-06-09 +=================== + + * Fix redirect error when `path` contains raw non-URL characters + * Fix redirect when `path` starts with multiple forward slashes + +0.14.0 / 2016-06-06 +=================== + + * Add `acceptRanges` option + * Add `cacheControl` option + * Attempt to combine multiple ranges into single range + * Correctly inherit from `Stream` class + * Fix `Content-Range` header in 416 responses when using `start`/`end` options + * Fix `Content-Range` header missing from default 416 responses + * Ignore non-byte `Range` headers + * deps: http-errors@~1.5.0 + - Add `HttpError` export, for `err instanceof createError.HttpError` + - Support new code `421 Misdirected Request` + - Use `setprototypeof` module to replace `__proto__` setting + - deps: inherits@2.0.1 + - deps: statuses@'>= 1.3.0 < 2' + - perf: enable strict mode + * deps: range-parser@~1.2.0 + - Fix incorrectly returning -1 when there is at least one valid range + - perf: remove internal function + * deps: statuses@~1.3.0 + - Add `421 Misdirected Request` + - perf: enable strict mode + * perf: remove argument reassignment + +0.13.2 / 2016-03-05 +=================== + + * Fix invalid `Content-Type` header when `send.mime.default_type` unset + +0.13.1 / 2016-01-16 +=================== + + * deps: depd@~1.1.0 + - Support web browser loading + - perf: enable strict mode + * deps: destroy@~1.0.4 + - perf: enable strict mode + * deps: escape-html@~1.0.3 + - perf: enable strict mode + - perf: optimize string replacement + - perf: use faster string coercion + * deps: range-parser@~1.0.3 + - perf: enable strict mode + +0.13.0 / 2015-06-16 +=================== + + * Allow Node.js HTTP server to set `Date` response header + * Fix incorrectly removing `Content-Location` on 304 response + * Improve the default redirect response headers + * Send appropriate headers on default error response + * Use `http-errors` for standard emitted errors + * Use `statuses` instead of `http` module for status messages + * deps: escape-html@1.0.2 + * deps: etag@~1.7.0 + - Improve stat performance by removing hashing + * deps: fresh@0.3.0 + - Add weak `ETag` matching support + * deps: on-finished@~2.3.0 + - Add defined behavior for HTTP `CONNECT` requests + - Add defined behavior for HTTP `Upgrade` requests + - deps: ee-first@1.1.1 + * perf: enable strict mode + * perf: remove unnecessary array allocations + +0.12.3 / 2015-05-13 +=================== + + * deps: debug@~2.2.0 + - deps: ms@0.7.1 + * deps: depd@~1.0.1 + * deps: etag@~1.6.0 + - Improve support for JXcore + - Support "fake" stats objects in environments without `fs` + * deps: ms@0.7.1 + - Prevent extraordinarily long inputs + * deps: on-finished@~2.2.1 + +0.12.2 / 2015-03-13 +=================== + + * Throw errors early for invalid `extensions` or `index` options + * deps: debug@~2.1.3 + - Fix high intensity foreground color for bold + - deps: ms@0.7.0 + +0.12.1 / 2015-02-17 +=================== + + * Fix regression sending zero-length files + +0.12.0 / 2015-02-16 +=================== + + * Always read the stat size from the file + * Fix mutating passed-in `options` + * deps: mime@1.3.4 + +0.11.1 / 2015-01-20 +=================== + + * Fix `root` path disclosure + +0.11.0 / 2015-01-05 +=================== + + * deps: debug@~2.1.1 + * deps: etag@~1.5.1 + - deps: crc@3.2.1 + * deps: ms@0.7.0 + - Add `milliseconds` + - Add `msecs` + - Add `secs` + - Add `mins` + - Add `hrs` + - Add `yrs` + * deps: on-finished@~2.2.0 + +0.10.1 / 2014-10-22 +=================== + + * deps: on-finished@~2.1.1 + - Fix handling of pipelined requests + +0.10.0 / 2014-10-15 +=================== + + * deps: debug@~2.1.0 + - Implement `DEBUG_FD` env variable support + * deps: depd@~1.0.0 + * deps: etag@~1.5.0 + - Improve string performance + - Slightly improve speed for weak ETags over 1KB + +0.9.3 / 2014-09-24 +================== + + * deps: etag@~1.4.0 + - Support "fake" stats objects + +0.9.2 / 2014-09-15 +================== + + * deps: depd@0.4.5 + * deps: etag@~1.3.1 + * deps: range-parser@~1.0.2 + +0.9.1 / 2014-09-07 +================== + + * deps: fresh@0.2.4 + +0.9.0 / 2014-09-07 +================== + + * Add `lastModified` option + * Use `etag` to generate `ETag` header + * deps: debug@~2.0.0 + +0.8.5 / 2014-09-04 +================== + + * Fix malicious path detection for empty string path + +0.8.4 / 2014-09-04 +================== + + * Fix a path traversal issue when using `root` + +0.8.3 / 2014-08-16 +================== + + * deps: destroy@1.0.3 + - renamed from dethroy + * deps: on-finished@2.1.0 + +0.8.2 / 2014-08-14 +================== + + * Work around `fd` leak in Node.js 0.10 for `fs.ReadStream` + * deps: dethroy@1.0.2 + +0.8.1 / 2014-08-05 +================== + + * Fix `extensions` behavior when file already has extension + +0.8.0 / 2014-08-05 +================== + + * Add `extensions` option + +0.7.4 / 2014-08-04 +================== + + * Fix serving index files without root dir + +0.7.3 / 2014-07-29 +================== + + * Fix incorrect 403 on Windows and Node.js 0.11 + +0.7.2 / 2014-07-27 +================== + + * deps: depd@0.4.4 + - Work-around v8 generating empty stack traces + +0.7.1 / 2014-07-26 +================== + + * deps: depd@0.4.3 + - Fix exception when global `Error.stackTraceLimit` is too low + +0.7.0 / 2014-07-20 +================== + + * Deprecate `hidden` option; use `dotfiles` option + * Add `dotfiles` option + * deps: debug@1.0.4 + * deps: depd@0.4.2 + - Add `TRACE_DEPRECATION` environment variable + - Remove non-standard grey color from color output + - Support `--no-deprecation` argument + - Support `--trace-deprecation` argument + +0.6.0 / 2014-07-11 +================== + + * Deprecate `from` option; use `root` option + * Deprecate `send.etag()` -- use `etag` in `options` + * Deprecate `send.hidden()` -- use `hidden` in `options` + * Deprecate `send.index()` -- use `index` in `options` + * Deprecate `send.maxage()` -- use `maxAge` in `options` + * Deprecate `send.root()` -- use `root` in `options` + * Cap `maxAge` value to 1 year + * deps: debug@1.0.3 + - Add support for multiple wildcards in namespaces + +0.5.0 / 2014-06-28 +================== + + * Accept string for `maxAge` (converted by `ms`) + * Add `headers` event + * Include link in default redirect response + * Use `EventEmitter.listenerCount` to count listeners + +0.4.3 / 2014-06-11 +================== + + * Do not throw un-catchable error on file open race condition + * Use `escape-html` for HTML escaping + * deps: debug@1.0.2 + - fix some debugging output colors on node.js 0.8 + * deps: finished@1.2.2 + * deps: fresh@0.2.2 + +0.4.2 / 2014-06-09 +================== + + * fix "event emitter leak" warnings + * deps: debug@1.0.1 + * deps: finished@1.2.1 + +0.4.1 / 2014-06-02 +================== + + * Send `max-age` in `Cache-Control` in correct format + +0.4.0 / 2014-05-27 +================== + + * Calculate ETag with md5 for reduced collisions + * Fix wrong behavior when index file matches directory + * Ignore stream errors after request ends + - Goodbye `EBADF, read` + * Skip directories in index file search + * deps: debug@0.8.1 + +0.3.0 / 2014-04-24 +================== + + * Fix sending files with dots without root set + * Coerce option types + * Accept API options in options object + * Set etags to "weak" + * Include file path in etag + * Make "Can't set headers after they are sent." catchable + * Send full entity-body for multi range requests + * Default directory access to 403 when index disabled + * Support multiple index paths + * Support "If-Range" header + * Control whether to generate etags + * deps: mime@1.2.11 + +0.2.0 / 2014-01-29 +================== + + * update range-parser and fresh + +0.1.4 / 2013-08-11 +================== + + * update fresh + +0.1.3 / 2013-07-08 +================== + + * Revert "Fix fd leak" + +0.1.2 / 2013-07-03 +================== + + * Fix fd leak + +0.1.0 / 2012-08-25 +================== + + * add options parameter to send() that is passed to fs.createReadStream() [kanongil] + +0.0.4 / 2012-08-16 +================== + + * allow custom "Accept-Ranges" definition + +0.0.3 / 2012-07-16 +================== + + * fix normalization of the root directory. Closes #3 + +0.0.2 / 2012-07-09 +================== + + * add passing of req explicitly for now (YUCK) + +0.0.1 / 2010-01-03 +================== + + * Initial release diff --git a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/send/LICENSE b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/send/LICENSE new file mode 100644 index 000000000000..b6ea1c1fd44f --- /dev/null +++ b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/send/LICENSE @@ -0,0 +1,23 @@ +(The MIT License) + +Copyright (c) 2012 TJ Holowaychuk +Copyright (c) 2014-2022 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/send/README.md b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/send/README.md new file mode 100644 index 000000000000..fadf8383c056 --- /dev/null +++ b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/send/README.md @@ -0,0 +1,327 @@ +# send + +[![NPM Version][npm-version-image]][npm-url] +[![NPM Downloads][npm-downloads-image]][npm-url] +[![Linux Build][github-actions-ci-image]][github-actions-ci-url] +[![Windows Build][appveyor-image]][appveyor-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +Send is a library for streaming files from the file system as a http response +supporting partial responses (Ranges), conditional-GET negotiation (If-Match, +If-Unmodified-Since, If-None-Match, If-Modified-Since), high test coverage, +and granular events which may be leveraged to take appropriate actions in your +application or framework. + +Looking to serve up entire folders mapped to URLs? Try [serve-static](https://www.npmjs.org/package/serve-static). + +## Installation + +This is a [Node.js](https://nodejs.org/en/) module available through the +[npm registry](https://www.npmjs.com/). Installation is done using the +[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): + +```bash +$ npm install send +``` + +## API + +```js +var send = require('send') +``` + +### send(req, path, [options]) + +Create a new `SendStream` for the given path to send to a `res`. The `req` is +the Node.js HTTP request and the `path` is a urlencoded path to send (urlencoded, +not the actual file-system path). + +#### Options + +##### acceptRanges + +Enable or disable accepting ranged requests, defaults to true. +Disabling this will not send `Accept-Ranges` and ignore the contents +of the `Range` request header. + +##### cacheControl + +Enable or disable setting `Cache-Control` response header, defaults to +true. Disabling this will ignore the `immutable` and `maxAge` options. + +##### dotfiles + +Set how "dotfiles" are treated when encountered. A dotfile is a file +or directory that begins with a dot ("."). Note this check is done on +the path itself without checking if the path actually exists on the +disk. If `root` is specified, only the dotfiles above the root are +checked (i.e. the root itself can be within a dotfile when when set +to "deny"). + + - `'allow'` No special treatment for dotfiles. + - `'deny'` Send a 403 for any request for a dotfile. + - `'ignore'` Pretend like the dotfile does not exist and 404. + +The default value is _similar_ to `'ignore'`, with the exception that +this default will not ignore the files within a directory that begins +with a dot, for backward-compatibility. + +##### end + +Byte offset at which the stream ends, defaults to the length of the file +minus 1. The end is inclusive in the stream, meaning `end: 3` will include +the 4th byte in the stream. + +##### etag + +Enable or disable etag generation, defaults to true. + +##### extensions + +If a given file doesn't exist, try appending one of the given extensions, +in the given order. By default, this is disabled (set to `false`). An +example value that will serve extension-less HTML files: `['html', 'htm']`. +This is skipped if the requested file already has an extension. + +##### immutable + +Enable or disable the `immutable` directive in the `Cache-Control` response +header, defaults to `false`. If set to `true`, the `maxAge` option should +also be specified to enable caching. The `immutable` directive will prevent +supported clients from making conditional requests during the life of the +`maxAge` option to check if the file has changed. + +##### index + +By default send supports "index.html" files, to disable this +set `false` or to supply a new index pass a string or an array +in preferred order. + +##### lastModified + +Enable or disable `Last-Modified` header, defaults to true. Uses the file +system's last modified value. + +##### maxAge + +Provide a max-age in milliseconds for http caching, defaults to 0. +This can also be a string accepted by the +[ms](https://www.npmjs.org/package/ms#readme) module. + +##### root + +Serve files relative to `path`. + +##### start + +Byte offset at which the stream starts, defaults to 0. The start is inclusive, +meaning `start: 2` will include the 3rd byte in the stream. + +#### Events + +The `SendStream` is an event emitter and will emit the following events: + + - `error` an error occurred `(err)` + - `directory` a directory was requested `(res, path)` + - `file` a file was requested `(path, stat)` + - `headers` the headers are about to be set on a file `(res, path, stat)` + - `stream` file streaming has started `(stream)` + - `end` streaming has completed + +#### .pipe + +The `pipe` method is used to pipe the response into the Node.js HTTP response +object, typically `send(req, path, options).pipe(res)`. + +### .mime + +The `mime` export is the global instance of of the +[`mime` npm module](https://www.npmjs.com/package/mime). + +This is used to configure the MIME types that are associated with file extensions +as well as other options for how to resolve the MIME type of a file (like the +default type to use for an unknown file extension). + +## Error-handling + +By default when no `error` listeners are present an automatic response will be +made, otherwise you have full control over the response, aka you may show a 5xx +page etc. + +## Caching + +It does _not_ perform internal caching, you should use a reverse proxy cache +such as Varnish for this, or those fancy things called CDNs. If your +application is small enough that it would benefit from single-node memory +caching, it's small enough that it does not need caching at all ;). + +## Debugging + +To enable `debug()` instrumentation output export __DEBUG__: + +``` +$ DEBUG=send node app +``` + +## Running tests + +``` +$ npm install +$ npm test +``` + +## Examples + +### Serve a specific file + +This simple example will send a specific file to all requests. + +```js +var http = require('http') +var send = require('send') + +var server = http.createServer(function onRequest (req, res) { + send(req, '/path/to/index.html') + .pipe(res) +}) + +server.listen(3000) +``` + +### Serve all files from a directory + +This simple example will just serve up all the files in a +given directory as the top-level. For example, a request +`GET /foo.txt` will send back `/www/public/foo.txt`. + +```js +var http = require('http') +var parseUrl = require('parseurl') +var send = require('send') + +var server = http.createServer(function onRequest (req, res) { + send(req, parseUrl(req).pathname, { root: '/www/public' }) + .pipe(res) +}) + +server.listen(3000) +``` + +### Custom file types + +```js +var http = require('http') +var parseUrl = require('parseurl') +var send = require('send') + +// Default unknown types to text/plain +send.mime.default_type = 'text/plain' + +// Add a custom type +send.mime.define({ + 'application/x-my-type': ['x-mt', 'x-mtt'] +}) + +var server = http.createServer(function onRequest (req, res) { + send(req, parseUrl(req).pathname, { root: '/www/public' }) + .pipe(res) +}) + +server.listen(3000) +``` + +### Custom directory index view + +This is a example of serving up a structure of directories with a +custom function to render a listing of a directory. + +```js +var http = require('http') +var fs = require('fs') +var parseUrl = require('parseurl') +var send = require('send') + +// Transfer arbitrary files from within /www/example.com/public/* +// with a custom handler for directory listing +var server = http.createServer(function onRequest (req, res) { + send(req, parseUrl(req).pathname, { index: false, root: '/www/public' }) + .once('directory', directory) + .pipe(res) +}) + +server.listen(3000) + +// Custom directory handler +function directory (res, path) { + var stream = this + + // redirect to trailing slash for consistent url + if (!stream.hasTrailingSlash()) { + return stream.redirect(path) + } + + // get directory list + fs.readdir(path, function onReaddir (err, list) { + if (err) return stream.error(err) + + // render an index for the directory + res.setHeader('Content-Type', 'text/plain; charset=UTF-8') + res.end(list.join('\n') + '\n') + }) +} +``` + +### Serving from a root directory with custom error-handling + +```js +var http = require('http') +var parseUrl = require('parseurl') +var send = require('send') + +var server = http.createServer(function onRequest (req, res) { + // your custom error-handling logic: + function error (err) { + res.statusCode = err.status || 500 + res.end(err.message) + } + + // your custom headers + function headers (res, path, stat) { + // serve all files for download + res.setHeader('Content-Disposition', 'attachment') + } + + // your custom directory handling logic: + function redirect () { + res.statusCode = 301 + res.setHeader('Location', req.url + '/') + res.end('Redirecting to ' + req.url + '/') + } + + // transfer arbitrary files from within + // /www/example.com/public/* + send(req, parseUrl(req).pathname, { root: '/www/public' }) + .on('error', error) + .on('directory', redirect) + .on('headers', headers) + .pipe(res) +}) + +server.listen(3000) +``` + +## License + +[MIT](LICENSE) + +[appveyor-image]: https://badgen.net/appveyor/ci/dougwilson/send/master?label=windows +[appveyor-url]: https://ci.appveyor.com/project/dougwilson/send +[coveralls-image]: https://badgen.net/coveralls/c/github/pillarjs/send/master +[coveralls-url]: https://coveralls.io/r/pillarjs/send?branch=master +[github-actions-ci-image]: https://badgen.net/github/checks/pillarjs/send/master?label=linux +[github-actions-ci-url]: https://github.com/pillarjs/send/actions/workflows/ci.yml +[node-image]: https://badgen.net/npm/node/send +[node-url]: https://nodejs.org/en/download/ +[npm-downloads-image]: https://badgen.net/npm/dm/send +[npm-url]: https://npmjs.org/package/send +[npm-version-image]: https://badgen.net/npm/v/send diff --git a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/send/SECURITY.md b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/send/SECURITY.md new file mode 100644 index 000000000000..46b48f7b0733 --- /dev/null +++ b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/send/SECURITY.md @@ -0,0 +1,24 @@ +# Security Policies and Procedures + +## Reporting a Bug + +The `send` team and community take all security bugs seriously. Thank you +for improving the security of Express. We appreciate your efforts and +responsible disclosure and will make every effort to acknowledge your +contributions. + +Report security bugs by emailing the current owner(s) of `send`. This information +can be found in the npm registry using the command `npm owner ls send`. +If unsure or unable to get the information from the above, open an issue +in the [project issue tracker](https://github.com/pillarjs/send/issues) +asking for the current contact information. + +To ensure the timely response to your report, please ensure that the entirety +of the report is contained within the email body and not solely behind a web +link or an attachment. + +At least one owner will acknowledge your email within 48 hours, and will send a +more detailed response within 48 hours indicating the next steps in handling +your report. After the initial reply to your report, the owners will +endeavor to keep you informed of the progress towards a fix and full +announcement, and may ask for additional information or guidance. diff --git a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/send/index.js b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/send/index.js new file mode 100644 index 000000000000..89afd7e584a5 --- /dev/null +++ b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/send/index.js @@ -0,0 +1,1143 @@ +/*! + * send + * Copyright(c) 2012 TJ Holowaychuk + * Copyright(c) 2014-2022 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module dependencies. + * @private + */ + +var createError = require('http-errors') +var debug = require('debug')('send') +var deprecate = require('depd')('send') +var destroy = require('destroy') +var encodeUrl = require('encodeurl') +var escapeHtml = require('escape-html') +var etag = require('etag') +var fresh = require('fresh') +var fs = require('fs') +var mime = require('mime') +var ms = require('ms') +var onFinished = require('on-finished') +var parseRange = require('range-parser') +var path = require('path') +var statuses = require('statuses') +var Stream = require('stream') +var util = require('util') + +/** + * Path function references. + * @private + */ + +var extname = path.extname +var join = path.join +var normalize = path.normalize +var resolve = path.resolve +var sep = path.sep + +/** + * Regular expression for identifying a bytes Range header. + * @private + */ + +var BYTES_RANGE_REGEXP = /^ *bytes=/ + +/** + * Maximum value allowed for the max age. + * @private + */ + +var MAX_MAXAGE = 60 * 60 * 24 * 365 * 1000 // 1 year + +/** + * Regular expression to match a path with a directory up component. + * @private + */ + +var UP_PATH_REGEXP = /(?:^|[\\/])\.\.(?:[\\/]|$)/ + +/** + * Module exports. + * @public + */ + +module.exports = send +module.exports.mime = mime + +/** + * Return a `SendStream` for `req` and `path`. + * + * @param {object} req + * @param {string} path + * @param {object} [options] + * @return {SendStream} + * @public + */ + +function send (req, path, options) { + return new SendStream(req, path, options) +} + +/** + * Initialize a `SendStream` with the given `path`. + * + * @param {Request} req + * @param {String} path + * @param {object} [options] + * @private + */ + +function SendStream (req, path, options) { + Stream.call(this) + + var opts = options || {} + + this.options = opts + this.path = path + this.req = req + + this._acceptRanges = opts.acceptRanges !== undefined + ? Boolean(opts.acceptRanges) + : true + + this._cacheControl = opts.cacheControl !== undefined + ? Boolean(opts.cacheControl) + : true + + this._etag = opts.etag !== undefined + ? Boolean(opts.etag) + : true + + this._dotfiles = opts.dotfiles !== undefined + ? opts.dotfiles + : 'ignore' + + if (this._dotfiles !== 'ignore' && this._dotfiles !== 'allow' && this._dotfiles !== 'deny') { + throw new TypeError('dotfiles option must be "allow", "deny", or "ignore"') + } + + this._hidden = Boolean(opts.hidden) + + if (opts.hidden !== undefined) { + deprecate('hidden: use dotfiles: \'' + (this._hidden ? 'allow' : 'ignore') + '\' instead') + } + + // legacy support + if (opts.dotfiles === undefined) { + this._dotfiles = undefined + } + + this._extensions = opts.extensions !== undefined + ? normalizeList(opts.extensions, 'extensions option') + : [] + + this._immutable = opts.immutable !== undefined + ? Boolean(opts.immutable) + : false + + this._index = opts.index !== undefined + ? normalizeList(opts.index, 'index option') + : ['index.html'] + + this._lastModified = opts.lastModified !== undefined + ? Boolean(opts.lastModified) + : true + + this._maxage = opts.maxAge || opts.maxage + this._maxage = typeof this._maxage === 'string' + ? ms(this._maxage) + : Number(this._maxage) + this._maxage = !isNaN(this._maxage) + ? Math.min(Math.max(0, this._maxage), MAX_MAXAGE) + : 0 + + this._root = opts.root + ? resolve(opts.root) + : null + + if (!this._root && opts.from) { + this.from(opts.from) + } +} + +/** + * Inherits from `Stream`. + */ + +util.inherits(SendStream, Stream) + +/** + * Enable or disable etag generation. + * + * @param {Boolean} val + * @return {SendStream} + * @api public + */ + +SendStream.prototype.etag = deprecate.function(function etag (val) { + this._etag = Boolean(val) + debug('etag %s', this._etag) + return this +}, 'send.etag: pass etag as option') + +/** + * Enable or disable "hidden" (dot) files. + * + * @param {Boolean} path + * @return {SendStream} + * @api public + */ + +SendStream.prototype.hidden = deprecate.function(function hidden (val) { + this._hidden = Boolean(val) + this._dotfiles = undefined + debug('hidden %s', this._hidden) + return this +}, 'send.hidden: use dotfiles option') + +/** + * Set index `paths`, set to a falsy + * value to disable index support. + * + * @param {String|Boolean|Array} paths + * @return {SendStream} + * @api public + */ + +SendStream.prototype.index = deprecate.function(function index (paths) { + var index = !paths ? [] : normalizeList(paths, 'paths argument') + debug('index %o', paths) + this._index = index + return this +}, 'send.index: pass index as option') + +/** + * Set root `path`. + * + * @param {String} path + * @return {SendStream} + * @api public + */ + +SendStream.prototype.root = function root (path) { + this._root = resolve(String(path)) + debug('root %s', this._root) + return this +} + +SendStream.prototype.from = deprecate.function(SendStream.prototype.root, + 'send.from: pass root as option') + +SendStream.prototype.root = deprecate.function(SendStream.prototype.root, + 'send.root: pass root as option') + +/** + * Set max-age to `maxAge`. + * + * @param {Number} maxAge + * @return {SendStream} + * @api public + */ + +SendStream.prototype.maxage = deprecate.function(function maxage (maxAge) { + this._maxage = typeof maxAge === 'string' + ? ms(maxAge) + : Number(maxAge) + this._maxage = !isNaN(this._maxage) + ? Math.min(Math.max(0, this._maxage), MAX_MAXAGE) + : 0 + debug('max-age %d', this._maxage) + return this +}, 'send.maxage: pass maxAge as option') + +/** + * Emit error with `status`. + * + * @param {number} status + * @param {Error} [err] + * @private + */ + +SendStream.prototype.error = function error (status, err) { + // emit if listeners instead of responding + if (hasListeners(this, 'error')) { + return this.emit('error', createHttpError(status, err)) + } + + var res = this.res + var msg = statuses.message[status] || String(status) + var doc = createHtmlDocument('Error', escapeHtml(msg)) + + // clear existing headers + clearHeaders(res) + + // add error headers + if (err && err.headers) { + setHeaders(res, err.headers) + } + + // send basic response + res.statusCode = status + res.setHeader('Content-Type', 'text/html; charset=UTF-8') + res.setHeader('Content-Length', Buffer.byteLength(doc)) + res.setHeader('Content-Security-Policy', "default-src 'none'") + res.setHeader('X-Content-Type-Options', 'nosniff') + res.end(doc) +} + +/** + * Check if the pathname ends with "/". + * + * @return {boolean} + * @private + */ + +SendStream.prototype.hasTrailingSlash = function hasTrailingSlash () { + return this.path[this.path.length - 1] === '/' +} + +/** + * Check if this is a conditional GET request. + * + * @return {Boolean} + * @api private + */ + +SendStream.prototype.isConditionalGET = function isConditionalGET () { + return this.req.headers['if-match'] || + this.req.headers['if-unmodified-since'] || + this.req.headers['if-none-match'] || + this.req.headers['if-modified-since'] +} + +/** + * Check if the request preconditions failed. + * + * @return {boolean} + * @private + */ + +SendStream.prototype.isPreconditionFailure = function isPreconditionFailure () { + var req = this.req + var res = this.res + + // if-match + var match = req.headers['if-match'] + if (match) { + var etag = res.getHeader('ETag') + return !etag || (match !== '*' && parseTokenList(match).every(function (match) { + return match !== etag && match !== 'W/' + etag && 'W/' + match !== etag + })) + } + + // if-unmodified-since + var unmodifiedSince = parseHttpDate(req.headers['if-unmodified-since']) + if (!isNaN(unmodifiedSince)) { + var lastModified = parseHttpDate(res.getHeader('Last-Modified')) + return isNaN(lastModified) || lastModified > unmodifiedSince + } + + return false +} + +/** + * Strip various content header fields for a change in entity. + * + * @private + */ + +SendStream.prototype.removeContentHeaderFields = function removeContentHeaderFields () { + var res = this.res + + res.removeHeader('Content-Encoding') + res.removeHeader('Content-Language') + res.removeHeader('Content-Length') + res.removeHeader('Content-Range') + res.removeHeader('Content-Type') +} + +/** + * Respond with 304 not modified. + * + * @api private + */ + +SendStream.prototype.notModified = function notModified () { + var res = this.res + debug('not modified') + this.removeContentHeaderFields() + res.statusCode = 304 + res.end() +} + +/** + * Raise error that headers already sent. + * + * @api private + */ + +SendStream.prototype.headersAlreadySent = function headersAlreadySent () { + var err = new Error('Can\'t set headers after they are sent.') + debug('headers already sent') + this.error(500, err) +} + +/** + * Check if the request is cacheable, aka + * responded with 2xx or 304 (see RFC 2616 section 14.2{5,6}). + * + * @return {Boolean} + * @api private + */ + +SendStream.prototype.isCachable = function isCachable () { + var statusCode = this.res.statusCode + return (statusCode >= 200 && statusCode < 300) || + statusCode === 304 +} + +/** + * Handle stat() error. + * + * @param {Error} error + * @private + */ + +SendStream.prototype.onStatError = function onStatError (error) { + switch (error.code) { + case 'ENAMETOOLONG': + case 'ENOENT': + case 'ENOTDIR': + this.error(404, error) + break + default: + this.error(500, error) + break + } +} + +/** + * Check if the cache is fresh. + * + * @return {Boolean} + * @api private + */ + +SendStream.prototype.isFresh = function isFresh () { + return fresh(this.req.headers, { + etag: this.res.getHeader('ETag'), + 'last-modified': this.res.getHeader('Last-Modified') + }) +} + +/** + * Check if the range is fresh. + * + * @return {Boolean} + * @api private + */ + +SendStream.prototype.isRangeFresh = function isRangeFresh () { + var ifRange = this.req.headers['if-range'] + + if (!ifRange) { + return true + } + + // if-range as etag + if (ifRange.indexOf('"') !== -1) { + var etag = this.res.getHeader('ETag') + return Boolean(etag && ifRange.indexOf(etag) !== -1) + } + + // if-range as modified date + var lastModified = this.res.getHeader('Last-Modified') + return parseHttpDate(lastModified) <= parseHttpDate(ifRange) +} + +/** + * Redirect to path. + * + * @param {string} path + * @private + */ + +SendStream.prototype.redirect = function redirect (path) { + var res = this.res + + if (hasListeners(this, 'directory')) { + this.emit('directory', res, path) + return + } + + if (this.hasTrailingSlash()) { + this.error(403) + return + } + + var loc = encodeUrl(collapseLeadingSlashes(this.path + '/')) + var doc = createHtmlDocument('Redirecting', 'Redirecting to ' + + escapeHtml(loc) + '') + + // redirect + res.statusCode = 301 + res.setHeader('Content-Type', 'text/html; charset=UTF-8') + res.setHeader('Content-Length', Buffer.byteLength(doc)) + res.setHeader('Content-Security-Policy', "default-src 'none'") + res.setHeader('X-Content-Type-Options', 'nosniff') + res.setHeader('Location', loc) + res.end(doc) +} + +/** + * Pipe to `res. + * + * @param {Stream} res + * @return {Stream} res + * @api public + */ + +SendStream.prototype.pipe = function pipe (res) { + // root path + var root = this._root + + // references + this.res = res + + // decode the path + var path = decode(this.path) + if (path === -1) { + this.error(400) + return res + } + + // null byte(s) + if (~path.indexOf('\0')) { + this.error(400) + return res + } + + var parts + if (root !== null) { + // normalize + if (path) { + path = normalize('.' + sep + path) + } + + // malicious path + if (UP_PATH_REGEXP.test(path)) { + debug('malicious path "%s"', path) + this.error(403) + return res + } + + // explode path parts + parts = path.split(sep) + + // join / normalize from optional root dir + path = normalize(join(root, path)) + } else { + // ".." is malicious without "root" + if (UP_PATH_REGEXP.test(path)) { + debug('malicious path "%s"', path) + this.error(403) + return res + } + + // explode path parts + parts = normalize(path).split(sep) + + // resolve the path + path = resolve(path) + } + + // dotfile handling + if (containsDotFile(parts)) { + var access = this._dotfiles + + // legacy support + if (access === undefined) { + access = parts[parts.length - 1][0] === '.' + ? (this._hidden ? 'allow' : 'ignore') + : 'allow' + } + + debug('%s dotfile "%s"', access, path) + switch (access) { + case 'allow': + break + case 'deny': + this.error(403) + return res + case 'ignore': + default: + this.error(404) + return res + } + } + + // index file support + if (this._index.length && this.hasTrailingSlash()) { + this.sendIndex(path) + return res + } + + this.sendFile(path) + return res +} + +/** + * Transfer `path`. + * + * @param {String} path + * @api public + */ + +SendStream.prototype.send = function send (path, stat) { + var len = stat.size + var options = this.options + var opts = {} + var res = this.res + var req = this.req + var ranges = req.headers.range + var offset = options.start || 0 + + if (headersSent(res)) { + // impossible to send now + this.headersAlreadySent() + return + } + + debug('pipe "%s"', path) + + // set header fields + this.setHeader(path, stat) + + // set content-type + this.type(path) + + // conditional GET support + if (this.isConditionalGET()) { + if (this.isPreconditionFailure()) { + this.error(412) + return + } + + if (this.isCachable() && this.isFresh()) { + this.notModified() + return + } + } + + // adjust len to start/end options + len = Math.max(0, len - offset) + if (options.end !== undefined) { + var bytes = options.end - offset + 1 + if (len > bytes) len = bytes + } + + // Range support + if (this._acceptRanges && BYTES_RANGE_REGEXP.test(ranges)) { + // parse + ranges = parseRange(len, ranges, { + combine: true + }) + + // If-Range support + if (!this.isRangeFresh()) { + debug('range stale') + ranges = -2 + } + + // unsatisfiable + if (ranges === -1) { + debug('range unsatisfiable') + + // Content-Range + res.setHeader('Content-Range', contentRange('bytes', len)) + + // 416 Requested Range Not Satisfiable + return this.error(416, { + headers: { 'Content-Range': res.getHeader('Content-Range') } + }) + } + + // valid (syntactically invalid/multiple ranges are treated as a regular response) + if (ranges !== -2 && ranges.length === 1) { + debug('range %j', ranges) + + // Content-Range + res.statusCode = 206 + res.setHeader('Content-Range', contentRange('bytes', len, ranges[0])) + + // adjust for requested range + offset += ranges[0].start + len = ranges[0].end - ranges[0].start + 1 + } + } + + // clone options + for (var prop in options) { + opts[prop] = options[prop] + } + + // set read options + opts.start = offset + opts.end = Math.max(offset, offset + len - 1) + + // content-length + res.setHeader('Content-Length', len) + + // HEAD support + if (req.method === 'HEAD') { + res.end() + return + } + + this.stream(path, opts) +} + +/** + * Transfer file for `path`. + * + * @param {String} path + * @api private + */ +SendStream.prototype.sendFile = function sendFile (path) { + var i = 0 + var self = this + + debug('stat "%s"', path) + fs.stat(path, function onstat (err, stat) { + if (err && err.code === 'ENOENT' && !extname(path) && path[path.length - 1] !== sep) { + // not found, check extensions + return next(err) + } + if (err) return self.onStatError(err) + if (stat.isDirectory()) return self.redirect(path) + self.emit('file', path, stat) + self.send(path, stat) + }) + + function next (err) { + if (self._extensions.length <= i) { + return err + ? self.onStatError(err) + : self.error(404) + } + + var p = path + '.' + self._extensions[i++] + + debug('stat "%s"', p) + fs.stat(p, function (err, stat) { + if (err) return next(err) + if (stat.isDirectory()) return next() + self.emit('file', p, stat) + self.send(p, stat) + }) + } +} + +/** + * Transfer index for `path`. + * + * @param {String} path + * @api private + */ +SendStream.prototype.sendIndex = function sendIndex (path) { + var i = -1 + var self = this + + function next (err) { + if (++i >= self._index.length) { + if (err) return self.onStatError(err) + return self.error(404) + } + + var p = join(path, self._index[i]) + + debug('stat "%s"', p) + fs.stat(p, function (err, stat) { + if (err) return next(err) + if (stat.isDirectory()) return next() + self.emit('file', p, stat) + self.send(p, stat) + }) + } + + next() +} + +/** + * Stream `path` to the response. + * + * @param {String} path + * @param {Object} options + * @api private + */ + +SendStream.prototype.stream = function stream (path, options) { + var self = this + var res = this.res + + // pipe + var stream = fs.createReadStream(path, options) + this.emit('stream', stream) + stream.pipe(res) + + // cleanup + function cleanup () { + destroy(stream, true) + } + + // response finished, cleanup + onFinished(res, cleanup) + + // error handling + stream.on('error', function onerror (err) { + // clean up stream early + cleanup() + + // error + self.onStatError(err) + }) + + // end + stream.on('end', function onend () { + self.emit('end') + }) +} + +/** + * Set content-type based on `path` + * if it hasn't been explicitly set. + * + * @param {String} path + * @api private + */ + +SendStream.prototype.type = function type (path) { + var res = this.res + + if (res.getHeader('Content-Type')) return + + var type = mime.lookup(path) + + if (!type) { + debug('no content-type') + return + } + + var charset = mime.charsets.lookup(type) + + debug('content-type %s', type) + res.setHeader('Content-Type', type + (charset ? '; charset=' + charset : '')) +} + +/** + * Set response header fields, most + * fields may be pre-defined. + * + * @param {String} path + * @param {Object} stat + * @api private + */ + +SendStream.prototype.setHeader = function setHeader (path, stat) { + var res = this.res + + this.emit('headers', res, path, stat) + + if (this._acceptRanges && !res.getHeader('Accept-Ranges')) { + debug('accept ranges') + res.setHeader('Accept-Ranges', 'bytes') + } + + if (this._cacheControl && !res.getHeader('Cache-Control')) { + var cacheControl = 'public, max-age=' + Math.floor(this._maxage / 1000) + + if (this._immutable) { + cacheControl += ', immutable' + } + + debug('cache-control %s', cacheControl) + res.setHeader('Cache-Control', cacheControl) + } + + if (this._lastModified && !res.getHeader('Last-Modified')) { + var modified = stat.mtime.toUTCString() + debug('modified %s', modified) + res.setHeader('Last-Modified', modified) + } + + if (this._etag && !res.getHeader('ETag')) { + var val = etag(stat) + debug('etag %s', val) + res.setHeader('ETag', val) + } +} + +/** + * Clear all headers from a response. + * + * @param {object} res + * @private + */ + +function clearHeaders (res) { + var headers = getHeaderNames(res) + + for (var i = 0; i < headers.length; i++) { + res.removeHeader(headers[i]) + } +} + +/** + * Collapse all leading slashes into a single slash + * + * @param {string} str + * @private + */ +function collapseLeadingSlashes (str) { + for (var i = 0; i < str.length; i++) { + if (str[i] !== '/') { + break + } + } + + return i > 1 + ? '/' + str.substr(i) + : str +} + +/** + * Determine if path parts contain a dotfile. + * + * @api private + */ + +function containsDotFile (parts) { + for (var i = 0; i < parts.length; i++) { + var part = parts[i] + if (part.length > 1 && part[0] === '.') { + return true + } + } + + return false +} + +/** + * Create a Content-Range header. + * + * @param {string} type + * @param {number} size + * @param {array} [range] + */ + +function contentRange (type, size, range) { + return type + ' ' + (range ? range.start + '-' + range.end : '*') + '/' + size +} + +/** + * Create a minimal HTML document. + * + * @param {string} title + * @param {string} body + * @private + */ + +function createHtmlDocument (title, body) { + return '\n' + + '\n' + + '\n' + + '\n' + + '' + title + '\n' + + '\n' + + '\n' + + '
' + body + '
\n' + + '\n' + + '\n' +} + +/** + * Create a HttpError object from simple arguments. + * + * @param {number} status + * @param {Error|object} err + * @private + */ + +function createHttpError (status, err) { + if (!err) { + return createError(status) + } + + return err instanceof Error + ? createError(status, err, { expose: false }) + : createError(status, err) +} + +/** + * decodeURIComponent. + * + * Allows V8 to only deoptimize this fn instead of all + * of send(). + * + * @param {String} path + * @api private + */ + +function decode (path) { + try { + return decodeURIComponent(path) + } catch (err) { + return -1 + } +} + +/** + * Get the header names on a respnse. + * + * @param {object} res + * @returns {array[string]} + * @private + */ + +function getHeaderNames (res) { + return typeof res.getHeaderNames !== 'function' + ? Object.keys(res._headers || {}) + : res.getHeaderNames() +} + +/** + * Determine if emitter has listeners of a given type. + * + * The way to do this check is done three different ways in Node.js >= 0.8 + * so this consolidates them into a minimal set using instance methods. + * + * @param {EventEmitter} emitter + * @param {string} type + * @returns {boolean} + * @private + */ + +function hasListeners (emitter, type) { + var count = typeof emitter.listenerCount !== 'function' + ? emitter.listeners(type).length + : emitter.listenerCount(type) + + return count > 0 +} + +/** + * Determine if the response headers have been sent. + * + * @param {object} res + * @returns {boolean} + * @private + */ + +function headersSent (res) { + return typeof res.headersSent !== 'boolean' + ? Boolean(res._header) + : res.headersSent +} + +/** + * Normalize the index option into an array. + * + * @param {boolean|string|array} val + * @param {string} name + * @private + */ + +function normalizeList (val, name) { + var list = [].concat(val || []) + + for (var i = 0; i < list.length; i++) { + if (typeof list[i] !== 'string') { + throw new TypeError(name + ' must be array of strings or false') + } + } + + return list +} + +/** + * Parse an HTTP Date into a number. + * + * @param {string} date + * @private + */ + +function parseHttpDate (date) { + var timestamp = date && Date.parse(date) + + return typeof timestamp === 'number' + ? timestamp + : NaN +} + +/** + * Parse a HTTP token list. + * + * @param {string} str + * @private + */ + +function parseTokenList (str) { + var end = 0 + var list = [] + var start = 0 + + // gather tokens + for (var i = 0, len = str.length; i < len; i++) { + switch (str.charCodeAt(i)) { + case 0x20: /* */ + if (start === end) { + start = end = i + 1 + } + break + case 0x2c: /* , */ + if (start !== end) { + list.push(str.substring(start, end)) + } + start = end = i + 1 + break + default: + end = i + 1 + break + } + } + + // final token + if (start !== end) { + list.push(str.substring(start, end)) + } + + return list +} + +/** + * Set an object of headers on a response. + * + * @param {object} res + * @param {object} headers + * @private + */ + +function setHeaders (res, headers) { + var keys = Object.keys(headers) + + for (var i = 0; i < keys.length; i++) { + var key = keys[i] + res.setHeader(key, headers[key]) + } +} diff --git a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/send/package.json b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/send/package.json new file mode 100644 index 000000000000..7f269d515c8b --- /dev/null +++ b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/send/package.json @@ -0,0 +1,62 @@ +{ + "name": "send", + "description": "Better streaming static file server with Range and conditional-GET support", + "version": "0.18.0", + "author": "TJ Holowaychuk ", + "contributors": [ + "Douglas Christopher Wilson ", + "James Wyatt Cready ", + "Jesús Leganés Combarro " + ], + "license": "MIT", + "repository": "pillarjs/send", + "keywords": [ + "static", + "file", + "server" + ], + "dependencies": { + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "2.4.1", + "range-parser": "~1.2.1", + "statuses": "2.0.1" + }, + "devDependencies": { + "after": "0.8.2", + "eslint": "7.32.0", + "eslint-config-standard": "14.1.1", + "eslint-plugin-import": "2.25.4", + "eslint-plugin-markdown": "2.2.1", + "eslint-plugin-node": "11.1.0", + "eslint-plugin-promise": "5.2.0", + "eslint-plugin-standard": "4.1.0", + "mocha": "9.2.2", + "nyc": "15.1.0", + "supertest": "6.2.2" + }, + "files": [ + "HISTORY.md", + "LICENSE", + "README.md", + "SECURITY.md", + "index.js" + ], + "engines": { + "node": ">= 0.8.0" + }, + "scripts": { + "lint": "eslint .", + "test": "mocha --check-leaks --reporter spec --bail", + "test-ci": "nyc --reporter=lcov --reporter=text npm test", + "test-cov": "nyc --reporter=html --reporter=text npm test" + } +} diff --git a/Modules/Chatroom/chat/node_modules/serve-static/package.json b/Modules/Chatroom/chat/node_modules/serve-static/package.json index 9d935f5d8b3b..47d9789e25cb 100644 --- a/Modules/Chatroom/chat/node_modules/serve-static/package.json +++ b/Modules/Chatroom/chat/node_modules/serve-static/package.json @@ -1,7 +1,7 @@ { "name": "serve-static", "description": "Serve static files", - "version": "1.15.0", + "version": "1.16.0", "author": "Douglas Christopher Wilson ", "license": "MIT", "repository": "expressjs/serve-static", diff --git a/Modules/Chatroom/chat/package-lock.json b/Modules/Chatroom/chat/package-lock.json index 5a5f5425602c..ff57fe338434 100644 --- a/Modules/Chatroom/chat/package-lock.json +++ b/Modules/Chatroom/chat/package-lock.json @@ -9,7 +9,7 @@ "version": "2.0.0", "dependencies": { "async": "^3.2", - "express": "^4.19.2", + "express": "^4.20.0", "mysql": "^2.18.1", "node-mysql": "^0.4.2", "node-schedule": "^2.1.0", @@ -89,9 +89,9 @@ } }, "node_modules/body-parser": { - "version": "1.20.2", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz", - "integrity": "sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==", + "version": "1.20.3", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz", + "integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==", "dependencies": { "bytes": "3.1.2", "content-type": "~1.0.5", @@ -101,7 +101,7 @@ "http-errors": "2.0.0", "iconv-lite": "0.4.24", "on-finished": "2.4.1", - "qs": "6.11.0", + "qs": "6.13.0", "raw-body": "2.5.2", "type-is": "~1.6.18", "unpipe": "1.0.0" @@ -124,6 +124,20 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" }, + "node_modules/body-parser/node_modules/qs": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", + "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", + "dependencies": { + "side-channel": "^1.0.6" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/bytes": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", @@ -437,36 +451,36 @@ } }, "node_modules/express": { - "version": "4.19.2", - "resolved": "https://registry.npmjs.org/express/-/express-4.19.2.tgz", - "integrity": "sha512-5T6nhjsT+EOMzuck8JjBHARTHfMht0POzlA60WV2pMD3gyXw2LZnZ+ueGdNxG+0calOJcWKbpFcuzLZ91YWq9Q==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/express/-/express-4.20.0.tgz", + "integrity": "sha512-pLdae7I6QqShF5PnNTCVn4hI91Dx0Grkn2+IAsMTgMIKuQVte2dN9PeGSSAME2FR8anOhVA62QDIUaWVfEXVLw==", "dependencies": { "accepts": "~1.3.8", "array-flatten": "1.1.1", - "body-parser": "1.20.2", + "body-parser": "1.20.3", "content-disposition": "0.5.4", "content-type": "~1.0.4", "cookie": "0.6.0", "cookie-signature": "1.0.6", "debug": "2.6.9", "depd": "2.0.0", - "encodeurl": "~1.0.2", + "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "etag": "~1.8.1", "finalhandler": "1.2.0", "fresh": "0.5.2", "http-errors": "2.0.0", - "merge-descriptors": "1.0.1", + "merge-descriptors": "1.0.3", "methods": "~1.1.2", "on-finished": "2.4.1", "parseurl": "~1.3.3", - "path-to-regexp": "0.1.7", + "path-to-regexp": "0.1.10", "proxy-addr": "~2.0.7", "qs": "6.11.0", "range-parser": "~1.2.1", "safe-buffer": "5.2.1", - "send": "0.18.0", - "serve-static": "1.15.0", + "send": "0.19.0", + "serve-static": "1.16.0", "setprototypeof": "1.2.0", "statuses": "2.0.1", "type-is": "~1.6.18", @@ -493,6 +507,14 @@ "ms": "2.0.0" } }, + "node_modules/express/node_modules/encodeurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", + "engines": { + "node": ">= 0.8" + } + }, "node_modules/express/node_modules/ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", @@ -738,9 +760,12 @@ } }, "node_modules/merge-descriptors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", - "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==" + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", + "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==", + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } }, "node_modules/methods": { "version": "1.1.2", @@ -849,9 +874,12 @@ } }, "node_modules/object-inspect": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", - "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==", + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz", + "integrity": "sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==", + "engines": { + "node": ">= 0.4" + }, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -884,9 +912,9 @@ } }, "node_modules/path-to-regexp": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", - "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" + "version": "0.1.10", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.10.tgz", + "integrity": "sha512-7lf7qcQidTku0Gu3YDPc8DJ1q7OOucfa/BSsIwjuh56VU7katFvuM8hULfkwB3Fns/rsVF7PwPKVw1sl5KQS9w==" }, "node_modules/process-nextick-args": { "version": "2.0.1", @@ -966,9 +994,9 @@ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, "node_modules/send": { - "version": "0.18.0", - "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", - "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz", + "integrity": "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==", "dependencies": { "debug": "2.6.9", "depd": "2.0.0", @@ -1007,9 +1035,9 @@ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" }, "node_modules/serve-static": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", - "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", + "version": "1.16.0", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.0.tgz", + "integrity": "sha512-pDLK8zwl2eKaYrs8mrPZBJua4hMplRWJ1tIFksVC3FtBEBnl8dxgeHtsaMS8DhS9i4fLObaon6ABoc4/hQGdPA==", "dependencies": { "encodeurl": "~1.0.2", "escape-html": "~1.0.3", @@ -1020,6 +1048,47 @@ "node": ">= 0.8.0" } }, + "node_modules/serve-static/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/serve-static/node_modules/debug/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + }, + "node_modules/serve-static/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + }, + "node_modules/serve-static/node_modules/send": { + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", + "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", + "dependencies": { + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "2.4.1", + "range-parser": "~1.2.1", + "statuses": "2.0.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/set-function-length": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", @@ -1317,9 +1386,9 @@ "integrity": "sha512-t/OYhhJ2SD+YGBQcjY8GzzDHEk9f3nerxjtfa6tlMXfe7frs/WozhvCNoGvpM0P3bNf3Gq5ZRMlGr5f3r4/N8A==" }, "body-parser": { - "version": "1.20.2", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz", - "integrity": "sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==", + "version": "1.20.3", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz", + "integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==", "requires": { "bytes": "3.1.2", "content-type": "~1.0.5", @@ -1329,7 +1398,7 @@ "http-errors": "2.0.0", "iconv-lite": "0.4.24", "on-finished": "2.4.1", - "qs": "6.11.0", + "qs": "6.13.0", "raw-body": "2.5.2", "type-is": "~1.6.18", "unpipe": "1.0.0" @@ -1347,6 +1416,14 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + }, + "qs": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", + "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", + "requires": { + "side-channel": "^1.0.6" + } } } }, @@ -1555,36 +1632,36 @@ "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==" }, "express": { - "version": "4.19.2", - "resolved": "https://registry.npmjs.org/express/-/express-4.19.2.tgz", - "integrity": "sha512-5T6nhjsT+EOMzuck8JjBHARTHfMht0POzlA60WV2pMD3gyXw2LZnZ+ueGdNxG+0calOJcWKbpFcuzLZ91YWq9Q==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/express/-/express-4.20.0.tgz", + "integrity": "sha512-pLdae7I6QqShF5PnNTCVn4hI91Dx0Grkn2+IAsMTgMIKuQVte2dN9PeGSSAME2FR8anOhVA62QDIUaWVfEXVLw==", "requires": { "accepts": "~1.3.8", "array-flatten": "1.1.1", - "body-parser": "1.20.2", + "body-parser": "1.20.3", "content-disposition": "0.5.4", "content-type": "~1.0.4", "cookie": "0.6.0", "cookie-signature": "1.0.6", "debug": "2.6.9", "depd": "2.0.0", - "encodeurl": "~1.0.2", + "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "etag": "~1.8.1", "finalhandler": "1.2.0", "fresh": "0.5.2", "http-errors": "2.0.0", - "merge-descriptors": "1.0.1", + "merge-descriptors": "1.0.3", "methods": "~1.1.2", "on-finished": "2.4.1", "parseurl": "~1.3.3", - "path-to-regexp": "0.1.7", + "path-to-regexp": "0.1.10", "proxy-addr": "~2.0.7", "qs": "6.11.0", "range-parser": "~1.2.1", "safe-buffer": "5.2.1", - "send": "0.18.0", - "serve-static": "1.15.0", + "send": "0.19.0", + "serve-static": "1.16.0", "setprototypeof": "1.2.0", "statuses": "2.0.1", "type-is": "~1.6.18", @@ -1605,6 +1682,11 @@ "ms": "2.0.0" } }, + "encodeurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==" + }, "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", @@ -1777,9 +1859,9 @@ "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==" }, "merge-descriptors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", - "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==" + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", + "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==" }, "methods": { "version": "1.1.2", @@ -1857,9 +1939,9 @@ "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==" }, "object-inspect": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", - "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==" + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz", + "integrity": "sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==" }, "object-keys": { "version": "1.1.1", @@ -1880,9 +1962,9 @@ "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==" }, "path-to-regexp": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", - "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" + "version": "0.1.10", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.10.tgz", + "integrity": "sha512-7lf7qcQidTku0Gu3YDPc8DJ1q7OOucfa/BSsIwjuh56VU7katFvuM8hULfkwB3Fns/rsVF7PwPKVw1sl5KQS9w==" }, "process-nextick-args": { "version": "2.0.1", @@ -1947,9 +2029,9 @@ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, "send": { - "version": "0.18.0", - "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", - "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz", + "integrity": "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==", "requires": { "debug": "2.6.9", "depd": "2.0.0", @@ -1989,14 +2071,56 @@ } }, "serve-static": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", - "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", + "version": "1.16.0", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.0.tgz", + "integrity": "sha512-pDLK8zwl2eKaYrs8mrPZBJua4hMplRWJ1tIFksVC3FtBEBnl8dxgeHtsaMS8DhS9i4fLObaon6ABoc4/hQGdPA==", "requires": { "encodeurl": "~1.0.2", "escape-html": "~1.0.3", "parseurl": "~1.3.3", "send": "0.18.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + }, + "dependencies": { + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + } + } + }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + }, + "send": { + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", + "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", + "requires": { + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "2.4.1", + "range-parser": "~1.2.1", + "statuses": "2.0.1" + } + } } }, "set-function-length": { diff --git a/Modules/Chatroom/chat/package.json b/Modules/Chatroom/chat/package.json index 9ffec9287b4f..01109f2a883f 100644 --- a/Modules/Chatroom/chat/package.json +++ b/Modules/Chatroom/chat/package.json @@ -4,7 +4,7 @@ "version": "2.0.0", "dependencies": { "async": "^3.2", - "express": "^4.19.2", + "express": "^4.20.0", "mysql": "^2.18.1", "node-mysql": "^0.4.2", "node-schedule": "^2.1.0", From 3bb55c6f2fe5553c08db76dd65a1ab69861563f2 Mon Sep 17 00:00:00 2001 From: iszmais <45942348+iszmais@users.noreply.github.com> Date: Tue, 10 Sep 2024 13:04:19 +0200 Subject: [PATCH 037/292] Remove YUI and nodes js from dc (#8032) --- .../DataCollection/classes/class.ilObjDataCollectionGUI.php | 6 ------ 1 file changed, 6 deletions(-) diff --git a/Modules/DataCollection/classes/class.ilObjDataCollectionGUI.php b/Modules/DataCollection/classes/class.ilObjDataCollectionGUI.php index b11c55db75b3..eb7995d2758a 100644 --- a/Modules/DataCollection/classes/class.ilObjDataCollectionGUI.php +++ b/Modules/DataCollection/classes/class.ilObjDataCollectionGUI.php @@ -106,12 +106,6 @@ public function getObjectId(): int private function addJavaScript(): void { - global $DIC; - $DIC->notes()->gui()->initJavascript(); - ilYuiUtil::initConnection(); - ilOverlayGUI::initJavascript(); - // # see https://mantis.ilias.de/view.php?id=26463 - $this->dclUi->addJavaScriptFile("./Services/UIComponent/Modal/js/Modal.js"); $this->dclUi->addJavaScriptFile("Modules/DataCollection/js/datacollection.js"); } From f3e63d549473781cde944723125794b85c188ba7 Mon Sep 17 00:00:00 2001 From: iszmais <45942348+iszmais@users.noreply.github.com> Date: Tue, 10 Sep 2024 14:26:38 +0200 Subject: [PATCH 038/292] fix link shorting (#8036) --- .../classes/Fields/Text/class.ilDclTextRecordRepresentation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/DataCollection/classes/Fields/Text/class.ilDclTextRecordRepresentation.php b/Modules/DataCollection/classes/Fields/Text/class.ilDclTextRecordRepresentation.php index 4c3e05b0f4d6..dfb1ee497a73 100644 --- a/Modules/DataCollection/classes/Fields/Text/class.ilDclTextRecordRepresentation.php +++ b/Modules/DataCollection/classes/Fields/Text/class.ilDclTextRecordRepresentation.php @@ -98,7 +98,7 @@ public function getHTML(bool $link = true, array $options = []): string protected function shortenLink(string $value): string { - $value = preg_replace('/^(https?:\/\/)?(www\.)?(.)/', '', $value); + $value = preg_replace('/^(https?:\/\/)?(www\.)?/', '', $value); $half = (int) ((self::LINK_MAX_LENGTH - 4) / 2); $value = preg_replace('/^(.{' . ($half + 1) . '})(.{4,})(.{' . $half . '})$/', '\1...\3', $value); From fa870ba0c1af581100b1113dac78b1a6f41b3b71 Mon Sep 17 00:00:00 2001 From: Stephan Kergomard Date: Tue, 10 Sep 2024 14:46:07 +0200 Subject: [PATCH 039/292] User: Assign Id Before Logical Operation See: https://mantis.ilias.de/view.php?id=42028 --- Services/User/classes/class.ilUserImportParser.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Services/User/classes/class.ilUserImportParser.php b/Services/User/classes/class.ilUserImportParser.php index 3f799a051df0..fba6b6506e74 100755 --- a/Services/User/classes/class.ilUserImportParser.php +++ b/Services/User/classes/class.ilUserImportParser.php @@ -425,7 +425,7 @@ public function importBeginTag( if (isset($a_attribs["Id"]) && $this->getUserMappingMode() == IL_USER_MAPPING_ID) { if (is_numeric($a_attribs["Id"])) { $this->user_id = $a_attribs["Id"]; - } elseif ($id = ilUtil::__extractId($a_attribs["Id"], IL_INST_ID) > 0) { + } elseif (($id = ilUtil::__extractId($a_attribs["Id"], IL_INST_ID)) > 0) { $this->user_id = $id; } } From bdd885256b1043b296c85c016bcace71cb13c3cc Mon Sep 17 00:00:00 2001 From: iszmais <45942348+iszmais@users.noreply.github.com> Date: Wed, 11 Sep 2024 08:47:55 +0200 Subject: [PATCH 040/292] Fix restore condition on upload rebuild (#7936) --- Services/Form/classes/class.ilPropertyFormGUI.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Services/Form/classes/class.ilPropertyFormGUI.php b/Services/Form/classes/class.ilPropertyFormGUI.php index 014dd208cb2f..7512ba3cb504 100644 --- a/Services/Form/classes/class.ilPropertyFormGUI.php +++ b/Services/Form/classes/class.ilPropertyFormGUI.php @@ -841,11 +841,11 @@ public function getHTMLAsync(): string protected function appendOnloadCode(string $html): string { if (count($this->onload_code) > 0) { - $html.= ""; + $html .= ""; } return $html; } @@ -1030,7 +1030,7 @@ protected function rebuildUploadedFiles(): void $name = $file[7]; if ($idx2 != "") { - if (!isset($_FILES[$field]["tmp_name"][$idx]) || !$_FILES[$field]["tmp_name"][$idx][$idx2]) { + if (!isset($_FILES[$field]["tmp_name"][$idx][$idx2])) { $_FILES[$field]["tmp_name"][$idx][$idx2] = $full_file; $_FILES[$field]["name"][$idx][$idx2] = $name; $_FILES[$field]["type"][$idx][$idx2] = $type; @@ -1039,7 +1039,7 @@ protected function rebuildUploadedFiles(): void $_FILES[$field]["is_upload"][$idx][$idx2] = false; } } elseif ($idx != "") { - if (!isset($_FILES[$field]["tmp_name"][$idx]) || $_FILES[$field]["tmp_name"][$idx]) { + if (!isset($_FILES[$field]["tmp_name"][$idx])) { $_FILES[$field]["tmp_name"][$idx] = $full_file; $_FILES[$field]["name"][$idx] = $name; $_FILES[$field]["type"][$idx] = $type; @@ -1048,7 +1048,7 @@ protected function rebuildUploadedFiles(): void $_FILES[$field]["is_upload"][$idx] = false; } } else { - if (!$_FILES[$field]["tmp_name"]) { + if (!isset($_FILES[$field]["tmp_name"])) { $_FILES[$field]["tmp_name"] = $full_file; $_FILES[$field]["name"] = $name; $_FILES[$field]["type"] = $type; From 15961f78244629862065c5c8afa4e032e4d71dcb Mon Sep 17 00:00:00 2001 From: Alexander Killing Date: Wed, 11 Sep 2024 23:10:39 +0200 Subject: [PATCH 041/292] 41833: Order of style classes is partially ignored in Text(Character) --- .../COPage/classes/class.ilPCParagraphGUI.php | 11 ++++-- .../COPage/classes/class.ilPageObjectGUI.php | 38 +++++++++++++++---- 2 files changed, 38 insertions(+), 11 deletions(-) diff --git a/Services/COPage/classes/class.ilPCParagraphGUI.php b/Services/COPage/classes/class.ilPCParagraphGUI.php index 0411e03b28b1..934db2db8ec8 100755 --- a/Services/COPage/classes/class.ilPCParagraphGUI.php +++ b/Services/COPage/classes/class.ilPCParagraphGUI.php @@ -160,10 +160,15 @@ public static function _getTextCharacteristics( ); $style = new ilObjStyleSheet($a_style_id); - $ti_chars = $style->getCharacteristics("text_inline", false, $a_include_core); + /*$ti_chars = $style->getCharacteristics("text_inline", false, $a_include_core);*/ + $ti_chars = $char_manager->getByTypes(["text_inline", "code_inline"], + false, + false + ); + /** @var Style\Content\Characteristic $v */ foreach ($ti_chars as $k => $v) { - if (!$char_manager->isOutdated("text_inline", $v)) { - $chars[] = $v; + if (!$char_manager->isOutdated("text_inline", $v->getCharacteristic())) { + $chars[] = $v->getCharacteristic(); } } } else { diff --git a/Services/COPage/classes/class.ilPageObjectGUI.php b/Services/COPage/classes/class.ilPageObjectGUI.php index 80f417d976ae..189ac4e43845 100755 --- a/Services/COPage/classes/class.ilPageObjectGUI.php +++ b/Services/COPage/classes/class.ilPageObjectGUI.php @@ -1799,16 +1799,38 @@ public static function getTinyMenu( }; // character styles - $chars = array( - "Comment" => array("code" => "com", "txt" => $f("Comment", "com")), - "Quotation" => array("code" => "quot", "txt" => $f("Quotation", "quot")), - "Accent" => array("code" => "acc", "txt" => $f("Accent", "acc")), - "Code" => array("code" => "code", "txt" => $f("Code", "code")) - ); - foreach (ilPCParagraphGUI::_getTextCharacteristics($a_style_id) as $c) { + $chars = []; + if ($a_style_id === 0) { + $chars = array( + "Comment" => array("code" => "com", "txt" => $f("Comment", "com")), + "Quotation" => array("code" => "quot", "txt" => $f("Quotation", "quot")), + "Accent" => array("code" => "acc", "txt" => $f("Accent", "acc")), + "Code" => array("code" => "code", "txt" => $f("Code", "code")) + ); + } + foreach (ilPCParagraphGUI::_getTextCharacteristics($a_style_id, true) as $c) { + if (in_array($c, ["Strong", "Important", "Emph"])) { + continue; + } if (!isset($chars[$c])) { $title = $char_manager->getPresentationTitle("text_inline", $c); - $chars[$c] = array("code" => "", "txt" => $title); + switch ($c) { + case "CodeInline": + $chars["Code"] = array("code" => "code", "txt" => $f("Code", "code")); + break; + case "Comment": + $chars["Comment"] = array("code" => "com", "txt" => $f("Comment", "com")); + break; + case "Quotation": + $chars["Quotation"] = array("code" => "quot", "txt" => $f("Quotation", "quot")); + break; + case "Accent": + $chars["Accent"] = array("code" => "acc", "txt" => $f("Accent", "acc")); + break; + default: + $chars[$c] = array("code" => "", "txt" => $title); + break; + } } } $char_formats = []; From 11d005314ac08debf3833a30dd88d5e2afefa54c Mon Sep 17 00:00:00 2001 From: Stephan Kergomard Date: Thu, 12 Sep 2024 08:13:17 +0200 Subject: [PATCH 042/292] User: Fix UDF value might be null See: https://mantis.ilias.de/view.php?id=42039 --- Services/User/classes/class.ilObjUser.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Services/User/classes/class.ilObjUser.php b/Services/User/classes/class.ilObjUser.php index 52a4b3d7a5af..fd3a584c09a6 100755 --- a/Services/User/classes/class.ilObjUser.php +++ b/Services/User/classes/class.ilObjUser.php @@ -2978,7 +2978,7 @@ public function updateUserDefinedFields(): void { $udata = new ilUserDefinedData($this->getId()); foreach ($this->user_defined_data as $field => $value) { - if ($field != 'usr_id') { + if ($field !== 'usr_id' && $value !== null) { $udata->set($field, $value); } } From 5f3684115e60ac9de18b11f43ee0558b39da754e Mon Sep 17 00:00:00 2001 From: c-knof <100784517+c-knof@users.noreply.github.com> Date: Thu, 12 Sep 2024 09:06:38 +0200 Subject: [PATCH 043/292] Ensure `ilDB` implements `ilDBInterface` before querying (#8051) Added a check to confirm `ilDB` implements `ilDBInterface` before executing SQL queries in `getInstalledLanguages` and `getInstalledLocalLanguages`. This prevents potential errors if `ilDB` does not have the required interface. --- ...lLanguagesInstalledAndUpdatedObjective.php | 2 +- .../classes/Setup/class.ilSetupLanguage.php | 30 +++++++++---------- 2 files changed, 15 insertions(+), 17 deletions(-) diff --git a/Services/Language/classes/Setup/class.ilLanguagesInstalledAndUpdatedObjective.php b/Services/Language/classes/Setup/class.ilLanguagesInstalledAndUpdatedObjective.php index 2008242e1061..f85796340a43 100644 --- a/Services/Language/classes/Setup/class.ilLanguagesInstalledAndUpdatedObjective.php +++ b/Services/Language/classes/Setup/class.ilLanguagesInstalledAndUpdatedObjective.php @@ -44,7 +44,7 @@ public function getHash(): string */ protected function getInstallLanguages(): array { - return $this->il_setup_language->getInstalledLanguages() ?? ['en']; + return $this->il_setup_language->getInstalledLanguages() ?: ['en']; } /** diff --git a/Services/Language/classes/Setup/class.ilSetupLanguage.php b/Services/Language/classes/Setup/class.ilSetupLanguage.php index 7911a72a28ec..fc4fb3848aa1 100755 --- a/Services/Language/classes/Setup/class.ilSetupLanguage.php +++ b/Services/Language/classes/Setup/class.ilSetupLanguage.php @@ -191,18 +191,17 @@ public function installLanguages(array $a_lang_keys, array $a_local_keys) public function getInstalledLanguages(): array { global $ilDB; - - $arr = array(); - - $query = "SELECT * FROM object_data " . + $arr = []; + if ($ilDB instanceof ilDBInterface) { + $query = "SELECT * FROM object_data " . "WHERE type = " . $ilDB->quote("lng", "text") . " " . "AND " . $ilDB->like("description", "text", "installed%"); - $r = $ilDB->query($query); + $r = $ilDB->query($query); - while ($row = $ilDB->fetchObject($r)) { - $arr[] = $row->title; + while ($row = $ilDB->fetchObject($r)) { + $arr[] = $row->title; + } } - return $arr; } @@ -212,18 +211,17 @@ public function getInstalledLanguages(): array public function getInstalledLocalLanguages(): array { global $ilDB; - - $arr = array(); - - $query = "SELECT * FROM object_data " . + $arr = []; + if ($ilDB instanceof ilDBInterface) { + $query = "SELECT * FROM object_data " . "WHERE type = " . $ilDB->quote("lng", "text") . " " . "AND description = " . $ilDB->quote("installed_local", "text"); - $r = $ilDB->query($query); + $r = $ilDB->query($query); - while ($row = $ilDB->fetchObject($r)) { - $arr[] = $row->title; + while ($row = $ilDB->fetchObject($r)) { + $arr[] = $row->title; + } } - return $arr; } From cbfb9a57fcef22f99c26ec4f1025c3fb5c7a93df Mon Sep 17 00:00:00 2001 From: Stefan Meyer Date: Thu, 12 Sep 2024 12:22:12 +0200 Subject: [PATCH 044/292] 0041980: Participants tab of session broken after notification has been activated --- .../Session/classes/class.ilSessionParticipantsTableGUI.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Modules/Session/classes/class.ilSessionParticipantsTableGUI.php b/Modules/Session/classes/class.ilSessionParticipantsTableGUI.php index f7366ab82db4..abc60cb9e795 100644 --- a/Modules/Session/classes/class.ilSessionParticipantsTableGUI.php +++ b/Modules/Session/classes/class.ilSessionParticipantsTableGUI.php @@ -287,19 +287,19 @@ protected function matchesFilterCriteria(array $a_user_info): bool } switch ($filter) { case 'roles': - if (!in_array($filter_value, $a_user_info['role_ids'])) { + if (!in_array($filter_value, ($a_user_info['role_ids'] ?? []))) { return false; } break; case 'filter_participated': - if (!$a_user_info['participated']) { + if (!($a_user_info['participated'] ?? false)) { return false; } break; case 'filter_registration': - if (!$a_user_info['registered']) { + if (!($a_user_info['registered'] ?? false)) { return false; } break; From 0327d0047dddf1b9ef26d8dbc316fcfddd31a5df Mon Sep 17 00:00:00 2001 From: Pascal Seeland Date: Sun, 9 Jul 2023 12:05:40 +0200 Subject: [PATCH 045/292] Upgrade dflydev/fig-cookies and add wrapping Upgrade dflydev/fig-cookies from 1.0 to 3.0. Add wrapping for the samesite cookie attribute. --- composer.json | 2 +- composer.lock | 30 ++++++++++++++++++------------ src/HTTP/Cookies/Cookie.php | 15 +++++++++++++++ src/HTTP/Cookies/CookieWrapper.php | 15 +++++++++++++++ 4 files changed, 49 insertions(+), 13 deletions(-) diff --git a/composer.json b/composer.json index 50d51c3a2ecb..fa94610484e3 100644 --- a/composer.json +++ b/composer.json @@ -53,7 +53,7 @@ "symfony/yaml": "^5.3", "guzzlehttp/psr7": "1.9.1", "psr/http-message": "^1.0", - "dflydev/fig-cookies": "^1.0", + "dflydev/fig-cookies": "^3.0", "ralouphie/getallheaders": "^2.0", "league/flysystem": "^1.0", "james-heinrich/getid3": "^1.9", diff --git a/composer.lock b/composer.lock index cde8e6869335..81dac60eb4f7 100644 --- a/composer.lock +++ b/composer.lock @@ -56,31 +56,37 @@ }, { "name": "dflydev/fig-cookies", - "version": "v1.0.2", + "version": "v3.0.0", "source": { "type": "git", "url": "https://github.com/dflydev/dflydev-fig-cookies.git", - "reference": "883233c159d00d39e940bd12cfe42c0d23420c1c" + "reference": "ea6934204b1b34ffdf5130dc7e0928d18ced2498" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/dflydev/dflydev-fig-cookies/zipball/883233c159d00d39e940bd12cfe42c0d23420c1c", - "reference": "883233c159d00d39e940bd12cfe42c0d23420c1c", + "url": "https://api.github.com/repos/dflydev/dflydev-fig-cookies/zipball/ea6934204b1b34ffdf5130dc7e0928d18ced2498", + "reference": "ea6934204b1b34ffdf5130dc7e0928d18ced2498", "shasum": "" }, "require": { - "php": ">=5.4", - "psr/http-message": "~1.0" + "ext-pcre": "*", + "php": "^7.2 || ^8.0", + "psr/http-message": "^1" }, "require-dev": { - "codeclimate/php-test-reporter": "~0.1@dev", - "phpunit/phpunit": "~4.5", - "squizlabs/php_codesniffer": "~2.3" + "doctrine/coding-standard": "^8", + "phpstan/extension-installer": "^1.0", + "phpstan/phpstan": "^0.12", + "phpstan/phpstan-phpunit": "^0.12.16", + "phpunit/phpunit": "^7.2.6 || ^9", + "scrutinizer/ocular": "^1.8", + "squizlabs/php_codesniffer": "^3.3", + "vimeo/psalm": "^4.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-main": "3.0.x-dev" } }, "autoload": { @@ -106,9 +112,9 @@ ], "support": { "issues": "https://github.com/dflydev/dflydev-fig-cookies/issues", - "source": "https://github.com/dflydev/dflydev-fig-cookies/tree/master" + "source": "https://github.com/dflydev/dflydev-fig-cookies/tree/v3.0.0" }, - "time": "2016-03-28T09:10:18+00:00" + "time": "2021-01-22T02:53:56+00:00" }, { "name": "enshrined/svg-sanitize", diff --git a/src/HTTP/Cookies/Cookie.php b/src/HTTP/Cookies/Cookie.php index 38e6d2361aef..fa62e728ff32 100644 --- a/src/HTTP/Cookies/Cookie.php +++ b/src/HTTP/Cookies/Cookie.php @@ -28,6 +28,10 @@ */ interface Cookie { + public const SAMESITE_NONE = 'None'; + public const SAMESITE_LAX = 'Lax'; + public const SAMESITE_STRICT = 'Strict'; + /** * Cookie name. */ @@ -76,6 +80,10 @@ public function getSecure(): bool; */ public function getHttpOnly(): bool; + /** + * Cookie samesite + */ + public function getSamesite(): ?string; /** * Sets the cookie value. @@ -150,6 +158,13 @@ public function withSecure(bool $secure = null): Cookie; */ public function withHttpOnly(bool $httpOnly = null): Cookie; + /** + * Sets the samesite attribute. + * + * @param string $sameSite value of the samesite attribute. Valid values are + * @const SAMESITE_LAX, @const SAMESITE_STRICT or @const SAMESITE_NONE + */ + public function withSamesite(string $sameSite): Cookie; /** * Returns the string representation of the object. diff --git a/src/HTTP/Cookies/CookieWrapper.php b/src/HTTP/Cookies/CookieWrapper.php index cbc45f4467fb..46c3218fa2fa 100644 --- a/src/HTTP/Cookies/CookieWrapper.php +++ b/src/HTTP/Cookies/CookieWrapper.php @@ -3,6 +3,7 @@ namespace ILIAS\HTTP\Cookies; use Dflydev\FigCookies\SetCookie; +use Dflydev\FigCookies\Modifier\SameSite; /****************************************************************************** * @@ -101,6 +102,12 @@ public function getHttpOnly(): bool return $this->cookie->getHttpOnly(); } + public function getSamesite(): ?string + { + $samesite = $this->cookie->getSameSite(); + return is_null($samesite) ? null : $samesite->asString(); + } + /** * @inheritDoc */ @@ -200,6 +207,14 @@ public function withHttpOnly(bool $httpOnly = null): Cookie return $clone; } + public function withSamesite(string $sameSite): Cookie + { + $clone = clone $this; + $clone->cookie = $this->cookie->withSameSite(SameSite::fromString($sameSite)); + + return $clone; + } + /** * @inheritDoc */ From 224aae5cfba1fa3abef360a0b019a55b9d476f0b Mon Sep 17 00:00:00 2001 From: Pascal Seeland Date: Sun, 9 Jul 2023 12:18:49 +0200 Subject: [PATCH 046/292] Fix indentation and copyright according to inspection --- Services/Http/classes/class.ilHTTPS.php | 31 +++++++++++---------- Services/Utilities/classes/class.ilUtil.php | 5 ++-- src/HTTP/Cookies/Cookie.php | 23 ++++++++------- src/HTTP/Cookies/CookieWrapper.php | 29 ++++++++++--------- 4 files changed, 49 insertions(+), 39 deletions(-) diff --git a/Services/Http/classes/class.ilHTTPS.php b/Services/Http/classes/class.ilHTTPS.php index e1bd2f193155..206a6f746f57 100755 --- a/Services/Http/classes/class.ilHTTPS.php +++ b/Services/Http/classes/class.ilHTTPS.php @@ -1,17 +1,20 @@ protected_scripts) && - !in_array(strtolower($_GET['cmdClass']), $this->protected_classes) - ) && $_SERVER['HTTPS'] == 'on'; + !in_array(basename($_SERVER['SCRIPT_NAME']), $this->protected_scripts) && + !in_array(strtolower($_GET['cmdClass']), $this->protected_classes) + ) && $_SERVER['HTTPS'] == 'on'; case self::PROTOCOL_HTTPS: return ( - in_array(basename($_SERVER['SCRIPT_NAME']), $this->protected_scripts) || - in_array(strtolower($_GET['cmdClass']), $this->protected_classes) - ) && $_SERVER['HTTPS'] != 'on'; + in_array(basename($_SERVER['SCRIPT_NAME']), $this->protected_scripts) || + in_array(strtolower($_GET['cmdClass']), $this->protected_classes) + ) && $_SERVER['HTTPS'] != 'on'; } return false; diff --git a/Services/Utilities/classes/class.ilUtil.php b/Services/Utilities/classes/class.ilUtil.php index 484da385a595..0373862266d9 100755 --- a/Services/Utilities/classes/class.ilUtil.php +++ b/Services/Utilities/classes/class.ilUtil.php @@ -1,4 +1,5 @@ ", ">", $a_str); // $a_str = ilUtil::unmaskSecureTags($a_str, $allow_array); diff --git a/src/HTTP/Cookies/Cookie.php b/src/HTTP/Cookies/Cookie.php index fa62e728ff32..9e6a1efa9351 100644 --- a/src/HTTP/Cookies/Cookie.php +++ b/src/HTTP/Cookies/Cookie.php @@ -1,20 +1,23 @@ Date: Sun, 9 Jul 2023 12:19:50 +0200 Subject: [PATCH 047/292] Authentication: Use `SameSite` cookie attribute --- Services/Http/classes/class.ilHTTPS.php | 23 +-- .../Init/classes/class.ilInitialisation.php | 133 +++++++++++++----- Services/Init/classes/class.ilStartUpGUI.php | 3 +- Services/Utilities/classes/class.ilUtil.php | 7 + 4 files changed, 121 insertions(+), 45 deletions(-) diff --git a/Services/Http/classes/class.ilHTTPS.php b/Services/Http/classes/class.ilHTTPS.php index 206a6f746f57..486b3e724871 100755 --- a/Services/Http/classes/class.ilHTTPS.php +++ b/Services/Http/classes/class.ilHTTPS.php @@ -87,7 +87,7 @@ private function readProtectedScripts(): void */ public function isDetected(): bool { - if (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == "on") { + if (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] === "on") { return true; } @@ -96,7 +96,7 @@ public function isDetected(): bool /* echo $header_name; echo $_SERVER[$header_name];*/ if (isset($_SERVER[$header_name])) { - if (strcasecmp($_SERVER[$header_name], $this->header_value) == 0) { + if (strcasecmp($_SERVER[$header_name], $this->header_value) === 0) { $_SERVER["HTTPS"] = "on"; return true; } @@ -130,13 +130,14 @@ public function enableSecureCookies(): void define('IL_COOKIE_SECURE', true); } - session_set_cookie_params( - IL_COOKIE_EXPIRE, - IL_COOKIE_PATH, - IL_COOKIE_DOMAIN, - true, - IL_COOKIE_HTTPONLY - ); + session_set_cookie_params([ + 'lifetime' => IL_COOKIE_EXPIRE, + 'path' => IL_COOKIE_PATH, + 'domain' => IL_COOKIE_DOMAIN, + 'secure' => IL_COOKIE_SECURE, + 'httponly' => true, + 'samesite' => (strtolower(session_get_cookie_params()['samesite'] ?? '')) === 'strict' ? session_get_cookie_params()['samesite'] : 'Lax' + ]); } } @@ -163,13 +164,13 @@ private function shouldSwitchProtocol($to_protocol): bool return ( !in_array(basename($_SERVER['SCRIPT_NAME']), $this->protected_scripts) && !in_array(strtolower($_GET['cmdClass']), $this->protected_classes) - ) && $_SERVER['HTTPS'] == 'on'; + ) && $_SERVER['HTTPS'] === 'on'; case self::PROTOCOL_HTTPS: return ( in_array(basename($_SERVER['SCRIPT_NAME']), $this->protected_scripts) || in_array(strtolower($_GET['cmdClass']), $this->protected_classes) - ) && $_SERVER['HTTPS'] != 'on'; + ) && $_SERVER['HTTPS'] !== 'on'; } return false; diff --git a/Services/Init/classes/class.ilInitialisation.php b/Services/Init/classes/class.ilInitialisation.php index cb7e74144922..94cf4ce93170 100644 --- a/Services/Init/classes/class.ilInitialisation.php +++ b/Services/Init/classes/class.ilInitialisation.php @@ -41,6 +41,10 @@ use ILIAS\Filesystem\Definitions\SuffixDefinitions; use ILIAS\FileUpload\Processor\InsecureFilenameSanitizerPreProcessor; use ILIAS\FileUpload\Processor\SVGBlacklistPreProcessor; +use ILIAS\Data\Result; +use ILIAS\Data\Result\Ok; +use ILIAS\Data\Result\Error; +use ILIAS\Refinery\Transformation; require_once("libs/composer/vendor/autoload.php"); @@ -441,37 +445,83 @@ protected static function determineClient(): void if (!$DIC->isDependencyAvailable('iliasIni')) { self::abortAndDie('Fatal Error: ilInitialisation::determineClient called without initialisation of ILIAS ini file object.'); } - $in_unit_tests = defined('IL_PHPUNIT_TEST'); - $context_supports_persitent_session = ilContext::supportsPersistentSessions(); - $can_set_cookie = !$in_unit_tests && $context_supports_persitent_session; - $has_request_client_id = $DIC->http()->wrapper()->query()->has('client_id'); - $has_cookie_client_id = $DIC->http()->cookieJar()->has('ilClientId'); + + // determine the available clientIds (default, request, cookie) $default_client_id = $DIC->iliasIni()->readVariable('clients', 'default'); - // determintaion of client_id: + if ($DIC->http()->wrapper()->query()->has('client_id')) { + $client_id_from_get = $DIC->http()->wrapper()->query()->retrieve( + 'client_id', + self::getClientIdTransformation() + ); + } + if ($DIC->http()->wrapper()->cookie()->has('ilClientId')) { + $client_id_from_cookie = $DIC->http()->wrapper()->cookie()->retrieve( + 'ilClientId', + self::getClientIdTransformation() + ); + } + + // set the clientId by availability: 1. request, 2. cookie, fallback to defined default $client_id_to_use = ''; - // first we try to get the client_id from request - if ($has_request_client_id) { - // @todo refinerey undefined - $client_id_from_get = (string) $_GET['client_id']; - } - // we found a client_id in $GET - if (isset($client_id_from_get) && strlen($client_id_from_get) > 0) { - $client_id_to_use = $_GET['client_id'] = $df->clientId($client_id_from_get)->toString(); - if ($can_set_cookie) { - ilUtil::setCookie('ilClientId', $client_id_to_use); - } - } else { - $client_id_to_use = $default_client_id; - if (!isset($_COOKIE['ilClientId'])) { - ilUtil::setCookie('ilClientId', $client_id_to_use); - } + if (isset($client_id_from_get) && $client_id_from_get !== '') { + $client_id_to_use = $client_id_from_get; + } + + if ($client_id_to_use === '' && isset($client_id_from_cookie)) { + $client_id_to_use = $client_id_from_cookie; } - $client_id_to_use = strlen($client_id_to_use) > 0 ? $client_id_to_use : $default_client_id; + + $client_id_to_use = $client_id_to_use ?: $default_client_id; define('CLIENT_ID', $df->clientId($client_id_to_use)->toString()); } + + /** + * Refinery is not initialized early enough to provide a transformation to be used with the + * \ILIAS\HTTP implementation to retrieve the parameters. Instead, this implementation here will be used. + * + * @return Transformation implementation of a transformation to get the clientId. + */ + private static function getClientIdTransformation(): Transformation + { + return new class () implements Transformation { + /** + * @inheritDoc + */ + public function transform($from): string + { + if (!is_string($from)) { + throw new InvalidArgumentException(__METHOD__ . " the argument is not a string."); + } + return strip_tags($from); + } + + /** + * @inheritDoc + */ + public function applyTo(Result $result): Result + { + return $result->then(function ($value): Result { + try { + return new Ok($this->transform($value)); + } catch (Exception $exception) { + return new Error($exception); + } + }); + } + + /** + * @inheritDoc + */ + public function __invoke($from): string + { + return $this->transform($from); + } + }; + } + /** * This method provides a global instance of class ilIniFile for the * client.ini.php file in variable $ilClientIniFile. @@ -509,8 +559,7 @@ protected static function initClientIniFile(): void // invalid client id / client ini if ($ilClientIniFile->ERROR != "") { $default_client = $ilIliasIniFile->readVariable("clients", "default"); - ilUtil::setCookie("ilClientId", $default_client); - if (CLIENT_ID != "" && CLIENT_ID != $default_client) { + if (CLIENT_ID !== "") { $mess = array("en" => "Client does not exist.", "de" => "Mandant ist ungültig." ); @@ -658,6 +707,15 @@ protected static function setCookieConstants(): void } } + private static function setClientIdCookie(): void + { + if (defined('CLIENT_ID') && + !defined('IL_PHPUNIT_TEST') && + ilContext::supportsPersistentSessions()) { + ilUtil::setCookie('ilClientId', CLIENT_ID); + } + } + /** * set session cookie params */ @@ -672,13 +730,22 @@ protected static function setSessionCookieParams(): void $cookie_secure = !$ilSetting->get('https', '0') && $DIC['https']->isDetected(); define('IL_COOKIE_SECURE', $cookie_secure); // Default Value - session_set_cookie_params( - IL_COOKIE_EXPIRE, - IL_COOKIE_PATH, - IL_COOKIE_DOMAIN, - IL_COOKIE_SECURE, - IL_COOKIE_HTTPONLY - ); + $cookie_parameters = [ + 'lifetime' => IL_COOKIE_EXPIRE, + 'path' => IL_COOKIE_PATH, + 'domain' => IL_COOKIE_DOMAIN, + 'secure' => IL_COOKIE_SECURE, + 'httponly' => IL_COOKIE_HTTPONLY, + ]; + + if ( + $cookie_secure && + (!isset(session_get_cookie_params()['samesite']) || strtolower(session_get_cookie_params()['samesite']) !== 'strict') + ) { + $cookie_parameters['samesite'] = 'Lax'; + } + + session_set_cookie_params($cookie_parameters); } } @@ -1368,6 +1435,8 @@ protected static function initClient(): void unset($tree); self::setSessionCookieParams(); + self::setClientIdCookie(); + self::initRefinery($DIC); (new InitCtrlService())->init($DIC); diff --git a/Services/Init/classes/class.ilStartUpGUI.php b/Services/Init/classes/class.ilStartUpGUI.php index 899f09f6ebbd..5bfe36e80652 100755 --- a/Services/Init/classes/class.ilStartUpGUI.php +++ b/Services/Init/classes/class.ilStartUpGUI.php @@ -1395,11 +1395,10 @@ public function doLogout(): void } // reset cookie - $client_id = CLIENT_ID; ilUtil::setCookie("ilClientId", ""); // redirect and show logout information - $this->ctrl->setParameter($this, 'client_id', $client_id); + $this->ctrl->setParameter($this, 'client_id', CLIENT_ID); $this->ctrl->setParameter($this, 'lang', $user_language); $this->ctrl->redirect($this, 'showLogout'); } diff --git a/Services/Utilities/classes/class.ilUtil.php b/Services/Utilities/classes/class.ilUtil.php index 0373862266d9..892c86cd39ea 100755 --- a/Services/Utilities/classes/class.ilUtil.php +++ b/Services/Utilities/classes/class.ilUtil.php @@ -19,6 +19,7 @@ use ILIAS\FileDelivery\Delivery; use ILIAS\Filesystem\Stream\Streams; use ILIAS\HTTP\Cookies\CookieFactoryImpl; +use ILIAS\HTTP\Cookies\Cookie; /** * Util class @@ -1314,6 +1315,12 @@ public static function setCookie( ->withHttpOnly(defined('IL_COOKIE_HTTPONLY') ? IL_COOKIE_HTTPONLY : false); + if ( + defined('IL_COOKIE_SECURE') && IL_COOKIE_SECURE && + (!isset(session_get_cookie_params()['samesite']) || strtolower(session_get_cookie_params()['samesite']) !== 'strict') + ) { + $cookie = $cookie->withSamesite(Cookie::SAMESITE_LAX); + } $jar = $cookie_jar->with($cookie); $response = $jar->renderIntoResponseHeader($http->response()); $http->saveResponse($response); From 75f86717148eceb7f21cbf570722b883f435b9a8 Mon Sep 17 00:00:00 2001 From: iszmais <45942348+iszmais@users.noreply.github.com> Date: Thu, 12 Sep 2024 16:05:14 +0200 Subject: [PATCH 048/292] Remove dc plugin field if no plugins exists (#8062) --- .../class.ilDclBaseFieldRepresentation.php | 25 ++++++++++--------- .../class.ilDclPluginFieldRepresentation.php | 12 +++------ 2 files changed, 17 insertions(+), 20 deletions(-) diff --git a/Modules/DataCollection/classes/Fields/Base/class.ilDclBaseFieldRepresentation.php b/Modules/DataCollection/classes/Fields/Base/class.ilDclBaseFieldRepresentation.php index f675f259bd1c..759280dc3f02 100644 --- a/Modules/DataCollection/classes/Fields/Base/class.ilDclBaseFieldRepresentation.php +++ b/Modules/DataCollection/classes/Fields/Base/class.ilDclBaseFieldRepresentation.php @@ -1,4 +1,5 @@ buildFieldCreationInput($dcl, $mode); - - if ($mode != 'create' && $this->getField()->getDatatypeId() == ilDclDatatype::INPUTFORMAT_PLUGIN) { - $new_plugin_title = $opt->getTitle(); - $plugin_name = ilDclFieldFactory::getPluginNameFromFieldModel($this->getField()); - if ($plugin_name !== "DclBase") { - $new_plugin_title .= ': ' . $plugin_name; + if ($opt !== null) { + if ($mode != 'create' && $this->getField()->getDatatypeId() == ilDclDatatype::INPUTFORMAT_PLUGIN) { + $new_plugin_title = $opt->getTitle(); + $plugin_name = ilDclFieldFactory::getPluginNameFromFieldModel($this->getField()); + if ($plugin_name !== "DclBase") { + $new_plugin_title .= ': ' . $plugin_name; + } + $opt->setTitle($new_plugin_title); } - $opt->setTitle($new_plugin_title); - } - $form->addOption($opt); + $form->addOption($opt); + } } /** * Build the creation-input-field */ - protected function buildFieldCreationInput(ilObjDataCollection $dcl, string $mode = 'create'): ilRadioOption + protected function buildFieldCreationInput(ilObjDataCollection $dcl, string $mode = 'create'): ?ilRadioOption { $opt = new ilRadioOption( $this->lng->txt('dcl_' . $this->getField()->getDatatype()->getTitle()), diff --git a/Modules/DataCollection/classes/Fields/Plugin/class.ilDclPluginFieldRepresentation.php b/Modules/DataCollection/classes/Fields/Plugin/class.ilDclPluginFieldRepresentation.php index fd7fc756ab4c..3432ef945c54 100644 --- a/Modules/DataCollection/classes/Fields/Plugin/class.ilDclPluginFieldRepresentation.php +++ b/Modules/DataCollection/classes/Fields/Plugin/class.ilDclPluginFieldRepresentation.php @@ -1,4 +1,5 @@ lng->txt('dcl_plugin_no_hooks_available'), - 'prop_' . ilDclBaseFieldModel::PROP_PLUGIN_HOOK_NAME - ); - $opt->addSubItem($plugin_selection); + return null; } } From 757303d22daf21fbf31af8b874ceff1ee87ebfc5 Mon Sep 17 00:00:00 2001 From: mjansen Date: Mon, 9 Sep 2024 08:38:30 +0200 Subject: [PATCH 049/292] HTTP: Fix sending `Set-Cookie` HTTP header See: https://mantis.ilias.de/view.php?id=41226 --- .../Response/Sender/DefaultResponseSenderStrategy.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/HTTP/Response/Sender/DefaultResponseSenderStrategy.php b/src/HTTP/Response/Sender/DefaultResponseSenderStrategy.php index 91e6403d2fde..8fd4f6bb3945 100644 --- a/src/HTTP/Response/Sender/DefaultResponseSenderStrategy.php +++ b/src/HTTP/Response/Sender/DefaultResponseSenderStrategy.php @@ -46,7 +46,14 @@ public function sendResponse(ResponseInterface $response): void //render all headers foreach (array_keys($response->getHeaders()) as $key) { - header("$key: " . $response->getHeaderLine($key)); + // See Mantis #37385. + if (strtolower($key) === 'set-cookie') { + foreach ($response->getHeader($key) as $header) { + header("$key: " . $header, false); + } + } else { + header("$key: " . $response->getHeaderLine($key)); + } } //rewind body stream From 40ea8c2112fe5b9a4b4515ec80340fa1fd3a3e72 Mon Sep 17 00:00:00 2001 From: Lukas Scharmer Date: Fri, 13 Sep 2024 14:00:40 +0200 Subject: [PATCH 050/292] Chatroom: Bump npm package express to v4.21.0 --- .../chat/node_modules/.package-lock.json | 101 +- .../body-parser/node_modules/qs/.editorconfig | 46 - .../body-parser/node_modules/qs/.eslintrc | 38 - .../node_modules/qs/.github/FUNDING.yml | 12 - .../body-parser/node_modules/qs/.nycrc | 13 - .../body-parser/node_modules/qs/CHANGELOG.md | 600 ----- .../body-parser/node_modules/qs/LICENSE.md | 29 - .../body-parser/node_modules/qs/README.md | 709 ------ .../body-parser/node_modules/qs/dist/qs.js | 90 - .../node_modules/qs/lib/formats.js | 23 - .../body-parser/node_modules/qs/lib/index.js | 11 - .../body-parser/node_modules/qs/lib/parse.js | 296 --- .../node_modules/qs/lib/stringify.js | 351 --- .../body-parser/node_modules/qs/lib/utils.js | 265 --- .../body-parser/node_modules/qs/package.json | 91 - .../body-parser/node_modules/qs/test/parse.js | 1170 ---------- .../node_modules/qs/test/stringify.js | 1298 ----------- .../body-parser/node_modules/qs/test/utils.js | 136 -- .../chat/node_modules/express/History.md | 9 + .../chat/node_modules/express/lib/response.js | 1 + .../chat/node_modules/express/package.json | 8 +- .../chat/node_modules/finalhandler/HISTORY.md | 15 + .../chat/node_modules/finalhandler/README.md | 4 +- .../chat/node_modules/finalhandler/index.js | 9 +- .../node_modules/encodeurl}/LICENSE | 3 +- .../node_modules/encodeurl/README.md | 109 + .../node_modules/encodeurl/index.js | 60 + .../node_modules/encodeurl/package.json | 40 + .../node_modules/finalhandler/package.json | 15 +- .../chat/node_modules/qs/.editorconfig | 3 + .../Chatroom/chat/node_modules/qs/.eslintrc | 4 +- .../chat/node_modules/qs/CHANGELOG.md | 64 +- .../Chatroom/chat/node_modules/qs/README.md | 182 +- .../Chatroom/chat/node_modules/qs/dist/qs.js | 2076 +---------------- .../chat/node_modules/qs/lib/parse.js | 59 +- .../chat/node_modules/qs/lib/stringify.js | 81 +- .../chat/node_modules/qs/lib/utils.js | 81 +- .../chat/node_modules/qs/package.json | 38 +- .../qs/test/empty-keys-cases.js | 0 .../chat/node_modules/qs/test/parse.js | 379 ++- .../chat/node_modules/qs/test/stringify.js | 483 +++- .../chat/node_modules/serve-static/HISTORY.md | 10 + .../node_modules/debug/.coveralls.yml | 1 - .../serve-static/node_modules/debug/.eslintrc | 11 - .../node_modules/debug/.npmignore | 9 - .../node_modules/debug/.travis.yml | 14 - .../node_modules/debug/CHANGELOG.md | 362 --- .../serve-static/node_modules/debug/LICENSE | 19 - .../serve-static/node_modules/debug/Makefile | 50 - .../serve-static/node_modules/debug/README.md | 312 --- .../node_modules/debug/component.json | 19 - .../node_modules/debug/karma.conf.js | 70 - .../serve-static/node_modules/debug/node.js | 1 - .../debug/node_modules/ms/index.js | 152 -- .../debug/node_modules/ms/license.md | 21 - .../debug/node_modules/ms/package.json | 37 - .../debug/node_modules/ms/readme.md | 51 - .../node_modules/debug/package.json | 49 - .../node_modules/debug/src/browser.js | 185 -- .../node_modules/debug/src/debug.js | 202 -- .../node_modules/debug/src/index.js | 10 - .../node_modules/debug/src/inspector-log.js | 15 - .../node_modules/debug/src/node.js | 248 -- .../node_modules/encodeurl/LICENSE | 22 + .../node_modules/encodeurl/README.md | 109 + .../node_modules/encodeurl/index.js | 60 + .../node_modules/encodeurl/package.json | 40 + .../serve-static/node_modules/ms/index.js | 162 -- .../serve-static/node_modules/ms/license.md | 21 - .../serve-static/node_modules/ms/package.json | 38 - .../serve-static/node_modules/ms/readme.md | 59 - .../serve-static/node_modules/send/HISTORY.md | 521 ----- .../serve-static/node_modules/send/README.md | 327 --- .../node_modules/send/SECURITY.md | 24 - .../serve-static/node_modules/send/index.js | 1143 --------- .../node_modules/send/package.json | 62 - .../node_modules/serve-static/package.json | 6 +- Modules/Chatroom/chat/package-lock.json | 197 +- Modules/Chatroom/chat/package.json | 2 +- 79 files changed, 1800 insertions(+), 11843 deletions(-) delete mode 100644 Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/.editorconfig delete mode 100644 Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/.eslintrc delete mode 100644 Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/.github/FUNDING.yml delete mode 100644 Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/.nycrc delete mode 100644 Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/CHANGELOG.md delete mode 100644 Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/LICENSE.md delete mode 100644 Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/README.md delete mode 100644 Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/dist/qs.js delete mode 100644 Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/lib/formats.js delete mode 100644 Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/lib/index.js delete mode 100644 Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/lib/parse.js delete mode 100644 Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/lib/stringify.js delete mode 100644 Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/lib/utils.js delete mode 100644 Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/package.json delete mode 100644 Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/test/parse.js delete mode 100644 Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/test/stringify.js delete mode 100644 Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/test/utils.js rename Modules/Chatroom/chat/node_modules/{serve-static/node_modules/send => finalhandler/node_modules/encodeurl}/LICENSE (92%) create mode 100644 Modules/Chatroom/chat/node_modules/finalhandler/node_modules/encodeurl/README.md create mode 100644 Modules/Chatroom/chat/node_modules/finalhandler/node_modules/encodeurl/index.js create mode 100644 Modules/Chatroom/chat/node_modules/finalhandler/node_modules/encodeurl/package.json rename Modules/Chatroom/chat/node_modules/{body-parser/node_modules => }/qs/test/empty-keys-cases.js (100%) delete mode 100644 Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/.coveralls.yml delete mode 100644 Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/.eslintrc delete mode 100644 Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/.npmignore delete mode 100644 Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/.travis.yml delete mode 100644 Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/CHANGELOG.md delete mode 100644 Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/LICENSE delete mode 100644 Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/Makefile delete mode 100644 Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/README.md delete mode 100644 Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/component.json delete mode 100644 Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/karma.conf.js delete mode 100644 Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/node.js delete mode 100644 Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/node_modules/ms/index.js delete mode 100644 Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/node_modules/ms/license.md delete mode 100644 Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/node_modules/ms/package.json delete mode 100644 Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/node_modules/ms/readme.md delete mode 100644 Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/package.json delete mode 100644 Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/src/browser.js delete mode 100644 Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/src/debug.js delete mode 100644 Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/src/index.js delete mode 100644 Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/src/inspector-log.js delete mode 100644 Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/src/node.js create mode 100644 Modules/Chatroom/chat/node_modules/serve-static/node_modules/encodeurl/LICENSE create mode 100644 Modules/Chatroom/chat/node_modules/serve-static/node_modules/encodeurl/README.md create mode 100644 Modules/Chatroom/chat/node_modules/serve-static/node_modules/encodeurl/index.js create mode 100644 Modules/Chatroom/chat/node_modules/serve-static/node_modules/encodeurl/package.json delete mode 100644 Modules/Chatroom/chat/node_modules/serve-static/node_modules/ms/index.js delete mode 100644 Modules/Chatroom/chat/node_modules/serve-static/node_modules/ms/license.md delete mode 100644 Modules/Chatroom/chat/node_modules/serve-static/node_modules/ms/package.json delete mode 100644 Modules/Chatroom/chat/node_modules/serve-static/node_modules/ms/readme.md delete mode 100644 Modules/Chatroom/chat/node_modules/serve-static/node_modules/send/HISTORY.md delete mode 100644 Modules/Chatroom/chat/node_modules/serve-static/node_modules/send/README.md delete mode 100644 Modules/Chatroom/chat/node_modules/serve-static/node_modules/send/SECURITY.md delete mode 100644 Modules/Chatroom/chat/node_modules/serve-static/node_modules/send/index.js delete mode 100644 Modules/Chatroom/chat/node_modules/serve-static/node_modules/send/package.json diff --git a/Modules/Chatroom/chat/node_modules/.package-lock.json b/Modules/Chatroom/chat/node_modules/.package-lock.json index 15a2213b8938..f7ecdf2e0446 100644 --- a/Modules/Chatroom/chat/node_modules/.package-lock.json +++ b/Modules/Chatroom/chat/node_modules/.package-lock.json @@ -109,20 +109,6 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" }, - "node_modules/body-parser/node_modules/qs": { - "version": "6.13.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", - "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", - "dependencies": { - "side-channel": "^1.0.6" - }, - "engines": { - "node": ">=0.6" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/bytes": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", @@ -436,9 +422,9 @@ } }, "node_modules/express": { - "version": "4.20.0", - "resolved": "https://registry.npmjs.org/express/-/express-4.20.0.tgz", - "integrity": "sha512-pLdae7I6QqShF5PnNTCVn4hI91Dx0Grkn2+IAsMTgMIKuQVte2dN9PeGSSAME2FR8anOhVA62QDIUaWVfEXVLw==", + "version": "4.21.0", + "resolved": "https://registry.npmjs.org/express/-/express-4.21.0.tgz", + "integrity": "sha512-VqcNGcj/Id5ZT1LZ/cfihi3ttTn+NJmkli2eZADigjq29qTlWi/hAQ43t/VLPq8+UX06FCEx3ByOYet6ZFblng==", "dependencies": { "accepts": "~1.3.8", "array-flatten": "1.1.1", @@ -452,7 +438,7 @@ "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "etag": "~1.8.1", - "finalhandler": "1.2.0", + "finalhandler": "1.3.1", "fresh": "0.5.2", "http-errors": "2.0.0", "merge-descriptors": "1.0.3", @@ -461,11 +447,11 @@ "parseurl": "~1.3.3", "path-to-regexp": "0.1.10", "proxy-addr": "~2.0.7", - "qs": "6.11.0", + "qs": "6.13.0", "range-parser": "~1.2.1", "safe-buffer": "5.2.1", "send": "0.19.0", - "serve-static": "1.16.0", + "serve-static": "1.16.2", "setprototypeof": "1.2.0", "statuses": "2.0.1", "type-is": "~1.6.18", @@ -533,12 +519,12 @@ } }, "node_modules/finalhandler": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", - "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.1.tgz", + "integrity": "sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ==", "dependencies": { "debug": "2.6.9", - "encodeurl": "~1.0.2", + "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "on-finished": "2.4.1", "parseurl": "~1.3.3", @@ -557,6 +543,14 @@ "ms": "2.0.0" } }, + "node_modules/finalhandler/node_modules/encodeurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", + "engines": { + "node": ">= 0.8" + } + }, "node_modules/finalhandler/node_modules/ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", @@ -919,11 +913,11 @@ } }, "node_modules/qs": { - "version": "6.11.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", - "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", + "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", "dependencies": { - "side-channel": "^1.0.4" + "side-channel": "^1.0.6" }, "engines": { "node": ">=0.6" @@ -1020,58 +1014,25 @@ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" }, "node_modules/serve-static": { - "version": "1.16.0", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.0.tgz", - "integrity": "sha512-pDLK8zwl2eKaYrs8mrPZBJua4hMplRWJ1tIFksVC3FtBEBnl8dxgeHtsaMS8DhS9i4fLObaon6ABoc4/hQGdPA==", + "version": "1.16.2", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.2.tgz", + "integrity": "sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==", "dependencies": { - "encodeurl": "~1.0.2", + "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "parseurl": "~1.3.3", - "send": "0.18.0" + "send": "0.19.0" }, "engines": { "node": ">= 0.8.0" } }, - "node_modules/serve-static/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/serve-static/node_modules/debug/node_modules/ms": { + "node_modules/serve-static/node_modules/encodeurl": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" - }, - "node_modules/serve-static/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" - }, - "node_modules/serve-static/node_modules/send": { - "version": "0.18.0", - "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", - "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", - "dependencies": { - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "1.2.0", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "fresh": "0.5.2", - "http-errors": "2.0.0", - "mime": "1.6.0", - "ms": "2.1.3", - "on-finished": "2.4.1", - "range-parser": "~1.2.1", - "statuses": "2.0.1" - }, + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", "engines": { - "node": ">= 0.8.0" + "node": ">= 0.8" } }, "node_modules/set-function-length": { diff --git a/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/.editorconfig b/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/.editorconfig deleted file mode 100644 index 6adecfbf4cb3..000000000000 --- a/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/.editorconfig +++ /dev/null @@ -1,46 +0,0 @@ -root = true - -[*] -indent_style = space -indent_size = 4 -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true -max_line_length = 160 -quote_type = single - -[test/*] -max_line_length = off - -[LICENSE.md] -indent_size = off - -[*.md] -max_line_length = off - -[*.json] -max_line_length = off - -[Makefile] -max_line_length = off - -[CHANGELOG.md] -indent_style = space -indent_size = 2 - -[LICENSE] -indent_size = 2 -max_line_length = off - -[coverage/**/*] -indent_size = off -indent_style = off -indent = off -max_line_length = off - -[.nycrc] -indent_style = tab - -[tea.yaml] -indent_size = 2 diff --git a/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/.eslintrc b/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/.eslintrc deleted file mode 100644 index b6927611e43b..000000000000 --- a/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/.eslintrc +++ /dev/null @@ -1,38 +0,0 @@ -{ - "root": true, - - "extends": "@ljharb", - - "ignorePatterns": [ - "dist/", - ], - - "rules": { - "complexity": 0, - "consistent-return": 1, - "func-name-matching": 0, - "id-length": [2, { "min": 1, "max": 25, "properties": "never" }], - "indent": [2, 4], - "max-lines-per-function": [2, { "max": 150 }], - "max-params": [2, 18], - "max-statements": [2, 100], - "multiline-comment-style": 0, - "no-continue": 1, - "no-magic-numbers": 0, - "no-restricted-syntax": [2, "BreakStatement", "DebuggerStatement", "ForInStatement", "LabeledStatement", "WithStatement"], - }, - - "overrides": [ - { - "files": "test/**", - "rules": { - "function-paren-newline": 0, - "max-lines-per-function": 0, - "max-statements": 0, - "no-buffer-constructor": 0, - "no-extend-native": 0, - "no-throw-literal": 0, - }, - }, - ], -} diff --git a/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/.github/FUNDING.yml b/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/.github/FUNDING.yml deleted file mode 100644 index 0355f4f5fbec..000000000000 --- a/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/.github/FUNDING.yml +++ /dev/null @@ -1,12 +0,0 @@ -# These are supported funding model platforms - -github: [ljharb] -patreon: # Replace with a single Patreon username -open_collective: # Replace with a single Open Collective username -ko_fi: # Replace with a single Ko-fi username -tidelift: npm/qs -community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry -liberapay: # Replace with a single Liberapay username -issuehunt: # Replace with a single IssueHunt username -otechie: # Replace with a single Otechie username -custom: # Replace with a single custom sponsorship URL diff --git a/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/.nycrc b/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/.nycrc deleted file mode 100644 index 1d57cabe1b64..000000000000 --- a/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/.nycrc +++ /dev/null @@ -1,13 +0,0 @@ -{ - "all": true, - "check-coverage": false, - "reporter": ["text-summary", "text", "html", "json"], - "lines": 86, - "statements": 85.93, - "functions": 82.43, - "branches": 76.06, - "exclude": [ - "coverage", - "dist" - ] -} diff --git a/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/CHANGELOG.md b/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/CHANGELOG.md deleted file mode 100644 index 02a6b504fc9c..000000000000 --- a/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/CHANGELOG.md +++ /dev/null @@ -1,600 +0,0 @@ -## **6.13.0** -- [New] `parse`: add `strictDepth` option (#511) -- [Tests] use `npm audit` instead of `aud` - -## **6.12.3** -- [Fix] `parse`: properly account for `strictNullHandling` when `allowEmptyArrays` -- [meta] fix changelog indentation - -## **6.12.2** -- [Fix] `parse`: parse encoded square brackets (#506) -- [readme] add CII best practices badge - -## **6.12.1** -- [Fix] `parse`: Disable `decodeDotInKeys` by default to restore previous behavior (#501) -- [Performance] `utils`: Optimize performance under large data volumes, reduce memory usage, and speed up processing (#502) -- [Refactor] `utils`: use `+=` -- [Tests] increase coverage - -## **6.12.0** - -- [New] `parse`/`stringify`: add `decodeDotInKeys`/`encodeDotKeys` options (#488) -- [New] `parse`: add `duplicates` option -- [New] `parse`/`stringify`: add `allowEmptyArrays` option to allow [] in object values (#487) -- [Refactor] `parse`/`stringify`: move allowDots config logic to its own variable -- [Refactor] `stringify`: move option-handling code into `normalizeStringifyOptions` -- [readme] update readme, add logos (#484) -- [readme] `stringify`: clarify default `arrayFormat` behavior -- [readme] fix line wrapping -- [readme] remove dead badges -- [Deps] update `side-channel` -- [meta] make the dist build 50% smaller -- [meta] add `sideEffects` flag -- [meta] run build in prepack, not prepublish -- [Tests] `parse`: remove useless tests; add coverage -- [Tests] `stringify`: increase coverage -- [Tests] use `mock-property` -- [Tests] `stringify`: improve coverage -- [Dev Deps] update `@ljharb/eslint-config `, `aud`, `has-override-mistake`, `has-property-descriptors`, `mock-property`, `npmignore`, `object-inspect`, `tape` -- [Dev Deps] pin `glob`, since v10.3.8+ requires a broken `jackspeak` -- [Dev Deps] pin `jackspeak` since 2.1.2+ depends on npm aliases, which kill the install process in npm < 6 - -## **6.11.2** -- [Fix] `parse`: Fix parsing when the global Object prototype is frozen (#473) -- [Tests] add passing test cases with empty keys (#473) - -## **6.11.1** -- [Fix] `stringify`: encode comma values more consistently (#463) -- [readme] add usage of `filter` option for injecting custom serialization, i.e. of custom types (#447) -- [meta] remove extraneous code backticks (#457) -- [meta] fix changelog markdown -- [actions] update checkout action -- [actions] restrict action permissions -- [Dev Deps] update `@ljharb/eslint-config`, `aud`, `object-inspect`, `tape` - -## **6.11.0** -- [New] [Fix] `stringify`: revert 0e903c0; add `commaRoundTrip` option (#442) -- [readme] fix version badge - -## **6.10.5** -- [Fix] `stringify`: with `arrayFormat: comma`, properly include an explicit `[]` on a single-item array (#434) - -## **6.10.4** -- [Fix] `stringify`: with `arrayFormat: comma`, include an explicit `[]` on a single-item array (#441) -- [meta] use `npmignore` to autogenerate an npmignore file -- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `has-symbol`, `object-inspect`, `tape` - -## **6.10.3** -- [Fix] `parse`: ignore `__proto__` keys (#428) -- [Robustness] `stringify`: avoid relying on a global `undefined` (#427) -- [actions] reuse common workflows -- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `object-inspect`, `tape` - -## **6.10.2** -- [Fix] `stringify`: actually fix cyclic references (#426) -- [Fix] `stringify`: avoid encoding arrayformat comma when `encodeValuesOnly = true` (#424) -- [readme] remove travis badge; add github actions/codecov badges; update URLs -- [Docs] add note and links for coercing primitive values (#408) -- [actions] update codecov uploader -- [actions] update workflows -- [Tests] clean up stringify tests slightly -- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `object-inspect`, `safe-publish-latest`, `tape` - -## **6.10.1** -- [Fix] `stringify`: avoid exception on repeated object values (#402) - -## **6.10.0** -- [New] `stringify`: throw on cycles, instead of an infinite loop (#395, #394, #393) -- [New] `parse`: add `allowSparse` option for collapsing arrays with missing indices (#312) -- [meta] fix README.md (#399) -- [meta] only run `npm run dist` in publish, not install -- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `has-symbols`, `tape` -- [Tests] fix tests on node v0.6 -- [Tests] use `ljharb/actions/node/install` instead of `ljharb/actions/node/run` -- [Tests] Revert "[meta] ignore eclint transitive audit warning" - -## **6.9.7** -- [Fix] `parse`: ignore `__proto__` keys (#428) -- [Fix] `stringify`: avoid encoding arrayformat comma when `encodeValuesOnly = true` (#424) -- [Robustness] `stringify`: avoid relying on a global `undefined` (#427) -- [readme] remove travis badge; add github actions/codecov badges; update URLs -- [Docs] add note and links for coercing primitive values (#408) -- [Tests] clean up stringify tests slightly -- [meta] fix README.md (#399) -- Revert "[meta] ignore eclint transitive audit warning" -- [actions] backport actions from main -- [Dev Deps] backport updates from main - -## **6.9.6** -- [Fix] restore `dist` dir; mistakenly removed in d4f6c32 - -## **6.9.5** -- [Fix] `stringify`: do not encode parens for RFC1738 -- [Fix] `stringify`: fix arrayFormat comma with empty array/objects (#350) -- [Refactor] `format`: remove `util.assign` call -- [meta] add "Allow Edits" workflow; update rebase workflow -- [actions] switch Automatic Rebase workflow to `pull_request_target` event -- [Tests] `stringify`: add tests for #378 -- [Tests] migrate tests to Github Actions -- [Tests] run `nyc` on all tests; use `tape` runner -- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `browserify`, `mkdirp`, `object-inspect`, `tape`; add `aud` - -## **6.9.4** -- [Fix] `stringify`: when `arrayFormat` is `comma`, respect `serializeDate` (#364) -- [Refactor] `stringify`: reduce branching (part of #350) -- [Refactor] move `maybeMap` to `utils` -- [Dev Deps] update `browserify`, `tape` - -## **6.9.3** -- [Fix] proper comma parsing of URL-encoded commas (#361) -- [Fix] parses comma delimited array while having percent-encoded comma treated as normal text (#336) - -## **6.9.2** -- [Fix] `parse`: Fix parsing array from object with `comma` true (#359) -- [Fix] `parse`: throw a TypeError instead of an Error for bad charset (#349) -- [meta] ignore eclint transitive audit warning -- [meta] fix indentation in package.json -- [meta] add tidelift marketing copy -- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `object-inspect`, `has-symbols`, `tape`, `mkdirp`, `iconv-lite` -- [actions] add automatic rebasing / merge commit blocking - -## **6.9.1** -- [Fix] `parse`: with comma true, handle field that holds an array of arrays (#335) -- [Fix] `parse`: with comma true, do not split non-string values (#334) -- [meta] add `funding` field -- [Dev Deps] update `eslint`, `@ljharb/eslint-config` -- [Tests] use shared travis-ci config - -## **6.9.0** -- [New] `parse`/`stringify`: Pass extra key/value argument to `decoder` (#333) -- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `evalmd` -- [Tests] `parse`: add passing `arrayFormat` tests -- [Tests] add `posttest` using `npx aud` to run `npm audit` without a lockfile -- [Tests] up to `node` `v12.10`, `v11.15`, `v10.16`, `v8.16` -- [Tests] `Buffer.from` in node v5.0-v5.9 and v4.0-v4.4 requires a TypedArray - -## **6.8.3** -- [Fix] `parse`: ignore `__proto__` keys (#428) -- [Robustness] `stringify`: avoid relying on a global `undefined` (#427) -- [Fix] `stringify`: avoid encoding arrayformat comma when `encodeValuesOnly = true` (#424) -- [readme] remove travis badge; add github actions/codecov badges; update URLs -- [Tests] clean up stringify tests slightly -- [Docs] add note and links for coercing primitive values (#408) -- [meta] fix README.md (#399) -- [actions] backport actions from main -- [Dev Deps] backport updates from main -- [Refactor] `stringify`: reduce branching -- [meta] do not publish workflow files - -## **6.8.2** -- [Fix] proper comma parsing of URL-encoded commas (#361) -- [Fix] parses comma delimited array while having percent-encoded comma treated as normal text (#336) - -## **6.8.1** -- [Fix] `parse`: Fix parsing array from object with `comma` true (#359) -- [Fix] `parse`: throw a TypeError instead of an Error for bad charset (#349) -- [Fix] `parse`: with comma true, handle field that holds an array of arrays (#335) -- [fix] `parse`: with comma true, do not split non-string values (#334) -- [meta] add tidelift marketing copy -- [meta] add `funding` field -- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape`, `safe-publish-latest`, `evalmd`, `has-symbols`, `iconv-lite`, `mkdirp`, `object-inspect` -- [Tests] `parse`: add passing `arrayFormat` tests -- [Tests] use shared travis-ci configs -- [Tests] `Buffer.from` in node v5.0-v5.9 and v4.0-v4.4 requires a TypedArray -- [actions] add automatic rebasing / merge commit blocking - -## **6.8.0** -- [New] add `depth=false` to preserve the original key; [Fix] `depth=0` should preserve the original key (#326) -- [New] [Fix] stringify symbols and bigints -- [Fix] ensure node 0.12 can stringify Symbols -- [Fix] fix for an impossible situation: when the formatter is called with a non-string value -- [Refactor] `formats`: tiny bit of cleanup. -- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `browserify`, `safe-publish-latest`, `iconv-lite`, `tape` -- [Tests] add tests for `depth=0` and `depth=false` behavior, both current and intuitive/intended (#326) -- [Tests] use `eclint` instead of `editorconfig-tools` -- [docs] readme: add security note -- [meta] add github sponsorship -- [meta] add FUNDING.yml -- [meta] Clean up license text so it’s properly detected as BSD-3-Clause - -## **6.7.3** -- [Fix] `parse`: ignore `__proto__` keys (#428) -- [Fix] `stringify`: avoid encoding arrayformat comma when `encodeValuesOnly = true` (#424) -- [Robustness] `stringify`: avoid relying on a global `undefined` (#427) -- [readme] remove travis badge; add github actions/codecov badges; update URLs -- [Docs] add note and links for coercing primitive values (#408) -- [meta] fix README.md (#399) -- [meta] do not publish workflow files -- [actions] backport actions from main -- [Dev Deps] backport updates from main -- [Tests] use `nyc` for coverage -- [Tests] clean up stringify tests slightly - -## **6.7.2** -- [Fix] proper comma parsing of URL-encoded commas (#361) -- [Fix] parses comma delimited array while having percent-encoded comma treated as normal text (#336) - -## **6.7.1** -- [Fix] `parse`: Fix parsing array from object with `comma` true (#359) -- [Fix] `parse`: with comma true, handle field that holds an array of arrays (#335) -- [fix] `parse`: with comma true, do not split non-string values (#334) -- [Fix] `parse`: throw a TypeError instead of an Error for bad charset (#349) -- [Fix] fix for an impossible situation: when the formatter is called with a non-string value -- [Refactor] `formats`: tiny bit of cleanup. -- readme: add security note -- [meta] add tidelift marketing copy -- [meta] add `funding` field -- [meta] add FUNDING.yml -- [meta] Clean up license text so it’s properly detected as BSD-3-Clause -- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape`, `safe-publish-latest`, `evalmd`, `iconv-lite`, `mkdirp`, `object-inspect`, `browserify` -- [Tests] `parse`: add passing `arrayFormat` tests -- [Tests] use shared travis-ci configs -- [Tests] `Buffer.from` in node v5.0-v5.9 and v4.0-v4.4 requires a TypedArray -- [Tests] add tests for `depth=0` and `depth=false` behavior, both current and intuitive/intended -- [Tests] use `eclint` instead of `editorconfig-tools` -- [actions] add automatic rebasing / merge commit blocking - -## **6.7.0** -- [New] `stringify`/`parse`: add `comma` as an `arrayFormat` option (#276, #219) -- [Fix] correctly parse nested arrays (#212) -- [Fix] `utils.merge`: avoid a crash with a null target and a truthy non-array source, also with an array source -- [Robustness] `stringify`: cache `Object.prototype.hasOwnProperty` -- [Refactor] `utils`: `isBuffer`: small tweak; add tests -- [Refactor] use cached `Array.isArray` -- [Refactor] `parse`/`stringify`: make a function to normalize the options -- [Refactor] `utils`: reduce observable [[Get]]s -- [Refactor] `stringify`/`utils`: cache `Array.isArray` -- [Tests] always use `String(x)` over `x.toString()` -- [Tests] fix Buffer tests to work in node < 4.5 and node < 5.10 -- [Tests] temporarily allow coverage to fail - -## **6.6.1** -- [Fix] `parse`: ignore `__proto__` keys (#428) -- [Fix] fix for an impossible situation: when the formatter is called with a non-string value -- [Fix] `utils.merge`: avoid a crash with a null target and an array source -- [Fix] `utils.merge`: avoid a crash with a null target and a truthy non-array source -- [Fix] correctly parse nested arrays -- [Robustness] `stringify`: avoid relying on a global `undefined` (#427) -- [Robustness] `stringify`: cache `Object.prototype.hasOwnProperty` -- [Refactor] `formats`: tiny bit of cleanup. -- [Refactor] `utils`: `isBuffer`: small tweak; add tests -- [Refactor]: `stringify`/`utils`: cache `Array.isArray` -- [Refactor] `utils`: reduce observable [[Get]]s -- [Refactor] use cached `Array.isArray` -- [Refactor] `parse`/`stringify`: make a function to normalize the options -- [readme] remove travis badge; add github actions/codecov badges; update URLs -- [Docs] Clarify the need for "arrayLimit" option -- [meta] fix README.md (#399) -- [meta] do not publish workflow files -- [meta] Clean up license text so it’s properly detected as BSD-3-Clause -- [meta] add FUNDING.yml -- [meta] Fixes typo in CHANGELOG.md -- [actions] backport actions from main -- [Tests] fix Buffer tests to work in node < 4.5 and node < 5.10 -- [Tests] always use `String(x)` over `x.toString()` -- [Dev Deps] backport from main - -## **6.6.0** -- [New] Add support for iso-8859-1, utf8 "sentinel" and numeric entities (#268) -- [New] move two-value combine to a `utils` function (#189) -- [Fix] `stringify`: fix a crash with `strictNullHandling` and a custom `filter`/`serializeDate` (#279) -- [Fix] when `parseArrays` is false, properly handle keys ending in `[]` (#260) -- [Fix] `stringify`: do not crash in an obscure combo of `interpretNumericEntities`, a bad custom `decoder`, & `iso-8859-1` -- [Fix] `utils`: `merge`: fix crash when `source` is a truthy primitive & no options are provided -- [refactor] `stringify`: Avoid arr = arr.concat(...), push to the existing instance (#269) -- [Refactor] `parse`: only need to reassign the var once -- [Refactor] `parse`/`stringify`: clean up `charset` options checking; fix defaults -- [Refactor] add missing defaults -- [Refactor] `parse`: one less `concat` call -- [Refactor] `utils`: `compactQueue`: make it explicitly side-effecting -- [Dev Deps] update `browserify`, `eslint`, `@ljharb/eslint-config`, `iconv-lite`, `safe-publish-latest`, `tape` -- [Tests] up to `node` `v10.10`, `v9.11`, `v8.12`, `v6.14`, `v4.9`; pin included builds to LTS - -## **6.5.3** -- [Fix] `parse`: ignore `__proto__` keys (#428) -- [Fix] `utils.merge`: avoid a crash with a null target and a truthy non-array source -- [Fix] correctly parse nested arrays -- [Fix] `stringify`: fix a crash with `strictNullHandling` and a custom `filter`/`serializeDate` (#279) -- [Fix] `utils`: `merge`: fix crash when `source` is a truthy primitive & no options are provided -- [Fix] when `parseArrays` is false, properly handle keys ending in `[]` -- [Fix] fix for an impossible situation: when the formatter is called with a non-string value -- [Fix] `utils.merge`: avoid a crash with a null target and an array source -- [Refactor] `utils`: reduce observable [[Get]]s -- [Refactor] use cached `Array.isArray` -- [Refactor] `stringify`: Avoid arr = arr.concat(...), push to the existing instance (#269) -- [Refactor] `parse`: only need to reassign the var once -- [Robustness] `stringify`: avoid relying on a global `undefined` (#427) -- [readme] remove travis badge; add github actions/codecov badges; update URLs -- [Docs] Clean up license text so it’s properly detected as BSD-3-Clause -- [Docs] Clarify the need for "arrayLimit" option -- [meta] fix README.md (#399) -- [meta] add FUNDING.yml -- [actions] backport actions from main -- [Tests] always use `String(x)` over `x.toString()` -- [Tests] remove nonexistent tape option -- [Dev Deps] backport from main - -## **6.5.2** -- [Fix] use `safer-buffer` instead of `Buffer` constructor -- [Refactor] utils: `module.exports` one thing, instead of mutating `exports` (#230) -- [Dev Deps] update `browserify`, `eslint`, `iconv-lite`, `safer-buffer`, `tape`, `browserify` - -## **6.5.1** -- [Fix] Fix parsing & compacting very deep objects (#224) -- [Refactor] name utils functions -- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape` -- [Tests] up to `node` `v8.4`; use `nvm install-latest-npm` so newer npm doesn’t break older node -- [Tests] Use precise dist for Node.js 0.6 runtime (#225) -- [Tests] make 0.6 required, now that it’s passing -- [Tests] on `node` `v8.2`; fix npm on node 0.6 - -## **6.5.0** -- [New] add `utils.assign` -- [New] pass default encoder/decoder to custom encoder/decoder functions (#206) -- [New] `parse`/`stringify`: add `ignoreQueryPrefix`/`addQueryPrefix` options, respectively (#213) -- [Fix] Handle stringifying empty objects with addQueryPrefix (#217) -- [Fix] do not mutate `options` argument (#207) -- [Refactor] `parse`: cache index to reuse in else statement (#182) -- [Docs] add various badges to readme (#208) -- [Dev Deps] update `eslint`, `browserify`, `iconv-lite`, `tape` -- [Tests] up to `node` `v8.1`, `v7.10`, `v6.11`; npm v4.6 breaks on node < v1; npm v5+ breaks on node < v4 -- [Tests] add `editorconfig-tools` - -## **6.4.1** -- [Fix] `parse`: ignore `__proto__` keys (#428) -- [Fix] fix for an impossible situation: when the formatter is called with a non-string value -- [Fix] use `safer-buffer` instead of `Buffer` constructor -- [Fix] `utils.merge`: avoid a crash with a null target and an array source -- [Fix] `utils.merge`: avoid a crash with a null target and a truthy non-array source -- [Fix] `stringify`: fix a crash with `strictNullHandling` and a custom `filter`/`serializeDate` (#279) -- [Fix] `utils`: `merge`: fix crash when `source` is a truthy primitive & no options are provided -- [Fix] when `parseArrays` is false, properly handle keys ending in `[]` -- [Robustness] `stringify`: avoid relying on a global `undefined` (#427) -- [Refactor] use cached `Array.isArray` -- [Refactor] `stringify`: Avoid arr = arr.concat(...), push to the existing instance (#269) -- [readme] remove travis badge; add github actions/codecov badges; update URLs -- [Docs] Clarify the need for "arrayLimit" option -- [meta] fix README.md (#399) -- [meta] Clean up license text so it’s properly detected as BSD-3-Clause -- [meta] add FUNDING.yml -- [actions] backport actions from main -- [Tests] remove nonexistent tape option -- [Dev Deps] backport from main - -## **6.4.0** -- [New] `qs.stringify`: add `encodeValuesOnly` option -- [Fix] follow `allowPrototypes` option during merge (#201, #201) -- [Fix] support keys starting with brackets (#202, #200) -- [Fix] chmod a-x -- [Dev Deps] update `eslint` -- [Tests] up to `node` `v7.7`, `v6.10`,` v4.8`; disable osx builds since they block linux builds -- [eslint] reduce warnings - -## **6.3.3** -- [Fix] `parse`: ignore `__proto__` keys (#428) -- [Fix] fix for an impossible situation: when the formatter is called with a non-string value -- [Fix] `utils.merge`: avoid a crash with a null target and an array source -- [Fix] `utils.merge`: avoid a crash with a null target and a truthy non-array source -- [Fix] `stringify`: fix a crash with `strictNullHandling` and a custom `filter`/`serializeDate` (#279) -- [Fix] `utils`: `merge`: fix crash when `source` is a truthy primitive & no options are provided -- [Fix] when `parseArrays` is false, properly handle keys ending in `[]` -- [Robustness] `stringify`: avoid relying on a global `undefined` (#427) -- [Refactor] use cached `Array.isArray` -- [Refactor] `stringify`: Avoid arr = arr.concat(...), push to the existing instance (#269) -- [Docs] Clarify the need for "arrayLimit" option -- [meta] fix README.md (#399) -- [meta] Clean up license text so it’s properly detected as BSD-3-Clause -- [meta] add FUNDING.yml -- [actions] backport actions from main -- [Tests] use `safer-buffer` instead of `Buffer` constructor -- [Tests] remove nonexistent tape option -- [Dev Deps] backport from main - -## **6.3.2** -- [Fix] follow `allowPrototypes` option during merge (#201, #200) -- [Dev Deps] update `eslint` -- [Fix] chmod a-x -- [Fix] support keys starting with brackets (#202, #200) -- [Tests] up to `node` `v7.7`, `v6.10`,` v4.8`; disable osx builds since they block linux builds - -## **6.3.1** -- [Fix] ensure that `allowPrototypes: false` does not ever shadow Object.prototype properties (thanks, @snyk!) -- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `browserify`, `iconv-lite`, `qs-iconv`, `tape` -- [Tests] on all node minors; improve test matrix -- [Docs] document stringify option `allowDots` (#195) -- [Docs] add empty object and array values example (#195) -- [Docs] Fix minor inconsistency/typo (#192) -- [Docs] document stringify option `sort` (#191) -- [Refactor] `stringify`: throw faster with an invalid encoder -- [Refactor] remove unnecessary escapes (#184) -- Remove contributing.md, since `qs` is no longer part of `hapi` (#183) - -## **6.3.0** -- [New] Add support for RFC 1738 (#174, #173) -- [New] `stringify`: Add `serializeDate` option to customize Date serialization (#159) -- [Fix] ensure `utils.merge` handles merging two arrays -- [Refactor] only constructors should be capitalized -- [Refactor] capitalized var names are for constructors only -- [Refactor] avoid using a sparse array -- [Robustness] `formats`: cache `String#replace` -- [Dev Deps] update `browserify`, `eslint`, `@ljharb/eslint-config`; add `safe-publish-latest` -- [Tests] up to `node` `v6.8`, `v4.6`; improve test matrix -- [Tests] flesh out arrayLimit/arrayFormat tests (#107) -- [Tests] skip Object.create tests when null objects are not available -- [Tests] Turn on eslint for test files (#175) - -## **6.2.4** -- [Fix] `parse`: ignore `__proto__` keys (#428) -- [Fix] `utils.merge`: avoid a crash with a null target and an array source -- [Fix] `utils.merge`: avoid a crash with a null target and a truthy non-array source -- [Fix] `utils`: `merge`: fix crash when `source` is a truthy primitive & no options are provided -- [Fix] when `parseArrays` is false, properly handle keys ending in `[]` -- [Robustness] `stringify`: avoid relying on a global `undefined` (#427) -- [Refactor] use cached `Array.isArray` -- [Docs] Clarify the need for "arrayLimit" option -- [meta] fix README.md (#399) -- [meta] Clean up license text so it’s properly detected as BSD-3-Clause -- [meta] add FUNDING.yml -- [actions] backport actions from main -- [Tests] use `safer-buffer` instead of `Buffer` constructor -- [Tests] remove nonexistent tape option -- [Dev Deps] backport from main - -## **6.2.3** -- [Fix] follow `allowPrototypes` option during merge (#201, #200) -- [Fix] chmod a-x -- [Fix] support keys starting with brackets (#202, #200) -- [Tests] up to `node` `v7.7`, `v6.10`,` v4.8`; disable osx builds since they block linux builds - -## **6.2.2** -- [Fix] ensure that `allowPrototypes: false` does not ever shadow Object.prototype properties - -## **6.2.1** -- [Fix] ensure `key[]=x&key[]&key[]=y` results in 3, not 2, values -- [Refactor] Be explicit and use `Object.prototype.hasOwnProperty.call` -- [Tests] remove `parallelshell` since it does not reliably report failures -- [Tests] up to `node` `v6.3`, `v5.12` -- [Dev Deps] update `tape`, `eslint`, `@ljharb/eslint-config`, `qs-iconv` - -## [**6.2.0**](https://github.com/ljharb/qs/issues?milestone=36&state=closed) -- [New] pass Buffers to the encoder/decoder directly (#161) -- [New] add "encoder" and "decoder" options, for custom param encoding/decoding (#160) -- [Fix] fix compacting of nested sparse arrays (#150) - -## **6.1.2** -- [Fix] follow `allowPrototypes` option during merge (#201, #200) -- [Fix] chmod a-x -- [Fix] support keys starting with brackets (#202, #200) -- [Tests] up to `node` `v7.7`, `v6.10`,` v4.8`; disable osx builds since they block linux builds - -## **6.1.1** -- [Fix] ensure that `allowPrototypes: false` does not ever shadow Object.prototype properties - -## [**6.1.0**](https://github.com/ljharb/qs/issues?milestone=35&state=closed) -- [New] allowDots option for `stringify` (#151) -- [Fix] "sort" option should work at a depth of 3 or more (#151) -- [Fix] Restore `dist` directory; will be removed in v7 (#148) - -## **6.0.4** -- [Fix] follow `allowPrototypes` option during merge (#201, #200) -- [Fix] chmod a-x -- [Fix] support keys starting with brackets (#202, #200) -- [Tests] up to `node` `v7.7`, `v6.10`,` v4.8`; disable osx builds since they block linux builds - -## **6.0.3** -- [Fix] ensure that `allowPrototypes: false` does not ever shadow Object.prototype properties -- [Fix] Restore `dist` directory; will be removed in v7 (#148) - -## [**6.0.2**](https://github.com/ljharb/qs/issues?milestone=33&state=closed) -- Revert ES6 requirement and restore support for node down to v0.8. - -## [**6.0.1**](https://github.com/ljharb/qs/issues?milestone=32&state=closed) -- [**#127**](https://github.com/ljharb/qs/pull/127) Fix engines definition in package.json - -## [**6.0.0**](https://github.com/ljharb/qs/issues?milestone=31&state=closed) -- [**#124**](https://github.com/ljharb/qs/issues/124) Use ES6 and drop support for node < v4 - -## **5.2.1** -- [Fix] ensure `key[]=x&key[]&key[]=y` results in 3, not 2, values - -## [**5.2.0**](https://github.com/ljharb/qs/issues?milestone=30&state=closed) -- [**#64**](https://github.com/ljharb/qs/issues/64) Add option to sort object keys in the query string - -## [**5.1.0**](https://github.com/ljharb/qs/issues?milestone=29&state=closed) -- [**#117**](https://github.com/ljharb/qs/issues/117) make URI encoding stringified results optional -- [**#106**](https://github.com/ljharb/qs/issues/106) Add flag `skipNulls` to optionally skip null values in stringify - -## [**5.0.0**](https://github.com/ljharb/qs/issues?milestone=28&state=closed) -- [**#114**](https://github.com/ljharb/qs/issues/114) default allowDots to false -- [**#100**](https://github.com/ljharb/qs/issues/100) include dist to npm - -## [**4.0.0**](https://github.com/ljharb/qs/issues?milestone=26&state=closed) -- [**#98**](https://github.com/ljharb/qs/issues/98) make returning plain objects and allowing prototype overwriting properties optional - -## [**3.1.0**](https://github.com/ljharb/qs/issues?milestone=24&state=closed) -- [**#89**](https://github.com/ljharb/qs/issues/89) Add option to disable "Transform dot notation to bracket notation" - -## [**3.0.0**](https://github.com/ljharb/qs/issues?milestone=23&state=closed) -- [**#80**](https://github.com/ljharb/qs/issues/80) qs.parse silently drops properties -- [**#77**](https://github.com/ljharb/qs/issues/77) Perf boost -- [**#60**](https://github.com/ljharb/qs/issues/60) Add explicit option to disable array parsing -- [**#74**](https://github.com/ljharb/qs/issues/74) Bad parse when turning array into object -- [**#81**](https://github.com/ljharb/qs/issues/81) Add a `filter` option -- [**#68**](https://github.com/ljharb/qs/issues/68) Fixed issue with recursion and passing strings into objects. -- [**#66**](https://github.com/ljharb/qs/issues/66) Add mixed array and object dot notation support Closes: #47 -- [**#76**](https://github.com/ljharb/qs/issues/76) RFC 3986 -- [**#85**](https://github.com/ljharb/qs/issues/85) No equal sign -- [**#84**](https://github.com/ljharb/qs/issues/84) update license attribute - -## [**2.4.1**](https://github.com/ljharb/qs/issues?milestone=20&state=closed) -- [**#73**](https://github.com/ljharb/qs/issues/73) Property 'hasOwnProperty' of object # is not a function - -## [**2.4.0**](https://github.com/ljharb/qs/issues?milestone=19&state=closed) -- [**#70**](https://github.com/ljharb/qs/issues/70) Add arrayFormat option - -## [**2.3.3**](https://github.com/ljharb/qs/issues?milestone=18&state=closed) -- [**#59**](https://github.com/ljharb/qs/issues/59) make sure array indexes are >= 0, closes #57 -- [**#58**](https://github.com/ljharb/qs/issues/58) make qs usable for browser loader - -## [**2.3.2**](https://github.com/ljharb/qs/issues?milestone=17&state=closed) -- [**#55**](https://github.com/ljharb/qs/issues/55) allow merging a string into an object - -## [**2.3.1**](https://github.com/ljharb/qs/issues?milestone=16&state=closed) -- [**#52**](https://github.com/ljharb/qs/issues/52) Return "undefined" and "false" instead of throwing "TypeError". - -## [**2.3.0**](https://github.com/ljharb/qs/issues?milestone=15&state=closed) -- [**#50**](https://github.com/ljharb/qs/issues/50) add option to omit array indices, closes #46 - -## [**2.2.5**](https://github.com/ljharb/qs/issues?milestone=14&state=closed) -- [**#39**](https://github.com/ljharb/qs/issues/39) Is there an alternative to Buffer.isBuffer? -- [**#49**](https://github.com/ljharb/qs/issues/49) refactor utils.merge, fixes #45 -- [**#41**](https://github.com/ljharb/qs/issues/41) avoid browserifying Buffer, for #39 - -## [**2.2.4**](https://github.com/ljharb/qs/issues?milestone=13&state=closed) -- [**#38**](https://github.com/ljharb/qs/issues/38) how to handle object keys beginning with a number - -## [**2.2.3**](https://github.com/ljharb/qs/issues?milestone=12&state=closed) -- [**#37**](https://github.com/ljharb/qs/issues/37) parser discards first empty value in array -- [**#36**](https://github.com/ljharb/qs/issues/36) Update to lab 4.x - -## [**2.2.2**](https://github.com/ljharb/qs/issues?milestone=11&state=closed) -- [**#33**](https://github.com/ljharb/qs/issues/33) Error when plain object in a value -- [**#34**](https://github.com/ljharb/qs/issues/34) use Object.prototype.hasOwnProperty.call instead of obj.hasOwnProperty -- [**#24**](https://github.com/ljharb/qs/issues/24) Changelog? Semver? - -## [**2.2.1**](https://github.com/ljharb/qs/issues?milestone=10&state=closed) -- [**#32**](https://github.com/ljharb/qs/issues/32) account for circular references properly, closes #31 -- [**#31**](https://github.com/ljharb/qs/issues/31) qs.parse stackoverflow on circular objects - -## [**2.2.0**](https://github.com/ljharb/qs/issues?milestone=9&state=closed) -- [**#26**](https://github.com/ljharb/qs/issues/26) Don't use Buffer global if it's not present -- [**#30**](https://github.com/ljharb/qs/issues/30) Bug when merging non-object values into arrays -- [**#29**](https://github.com/ljharb/qs/issues/29) Don't call Utils.clone at the top of Utils.merge -- [**#23**](https://github.com/ljharb/qs/issues/23) Ability to not limit parameters? - -## [**2.1.0**](https://github.com/ljharb/qs/issues?milestone=8&state=closed) -- [**#22**](https://github.com/ljharb/qs/issues/22) Enable using a RegExp as delimiter - -## [**2.0.0**](https://github.com/ljharb/qs/issues?milestone=7&state=closed) -- [**#18**](https://github.com/ljharb/qs/issues/18) Why is there arrayLimit? -- [**#20**](https://github.com/ljharb/qs/issues/20) Configurable parametersLimit -- [**#21**](https://github.com/ljharb/qs/issues/21) make all limits optional, for #18, for #20 - -## [**1.2.2**](https://github.com/ljharb/qs/issues?milestone=6&state=closed) -- [**#19**](https://github.com/ljharb/qs/issues/19) Don't overwrite null values - -## [**1.2.1**](https://github.com/ljharb/qs/issues?milestone=5&state=closed) -- [**#16**](https://github.com/ljharb/qs/issues/16) ignore non-string delimiters -- [**#15**](https://github.com/ljharb/qs/issues/15) Close code block - -## [**1.2.0**](https://github.com/ljharb/qs/issues?milestone=4&state=closed) -- [**#12**](https://github.com/ljharb/qs/issues/12) Add optional delim argument -- [**#13**](https://github.com/ljharb/qs/issues/13) fix #11: flattened keys in array are now correctly parsed - -## [**1.1.0**](https://github.com/ljharb/qs/issues?milestone=3&state=closed) -- [**#7**](https://github.com/ljharb/qs/issues/7) Empty values of a POST array disappear after being submitted -- [**#9**](https://github.com/ljharb/qs/issues/9) Should not omit equals signs (=) when value is null -- [**#6**](https://github.com/ljharb/qs/issues/6) Minor grammar fix in README - -## [**1.0.2**](https://github.com/ljharb/qs/issues?milestone=2&state=closed) -- [**#5**](https://github.com/ljharb/qs/issues/5) array holes incorrectly copied into object on large index diff --git a/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/LICENSE.md b/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/LICENSE.md deleted file mode 100644 index fecf6b6942d1..000000000000 --- a/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/LICENSE.md +++ /dev/null @@ -1,29 +0,0 @@ -BSD 3-Clause License - -Copyright (c) 2014, Nathan LaFreniere and other [contributors](https://github.com/ljharb/qs/graphs/contributors) -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/README.md b/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/README.md deleted file mode 100644 index 1e0d9adc482d..000000000000 --- a/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/README.md +++ /dev/null @@ -1,709 +0,0 @@ -

- qs -

- -# qs [![Version Badge][npm-version-svg]][package-url] - -[![github actions][actions-image]][actions-url] -[![coverage][codecov-image]][codecov-url] -[![License][license-image]][license-url] -[![Downloads][downloads-image]][downloads-url] -[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/9058/badge)](https://bestpractices.coreinfrastructure.org/projects/9058) - -[![npm badge][npm-badge-png]][package-url] - -A querystring parsing and stringifying library with some added security. - -Lead Maintainer: [Jordan Harband](https://github.com/ljharb) - -The **qs** module was originally created and maintained by [TJ Holowaychuk](https://github.com/visionmedia/node-querystring). - -## Usage - -```javascript -var qs = require('qs'); -var assert = require('assert'); - -var obj = qs.parse('a=c'); -assert.deepEqual(obj, { a: 'c' }); - -var str = qs.stringify(obj); -assert.equal(str, 'a=c'); -``` - -### Parsing Objects - -[](#preventEval) -```javascript -qs.parse(string, [options]); -``` - -**qs** allows you to create nested objects within your query strings, by surrounding the name of sub-keys with square brackets `[]`. -For example, the string `'foo[bar]=baz'` converts to: - -```javascript -assert.deepEqual(qs.parse('foo[bar]=baz'), { - foo: { - bar: 'baz' - } -}); -``` - -When using the `plainObjects` option the parsed value is returned as a null object, created via `Object.create(null)` and as such you should be aware that prototype methods will not exist on it and a user may set those names to whatever value they like: - -```javascript -var nullObject = qs.parse('a[hasOwnProperty]=b', { plainObjects: true }); -assert.deepEqual(nullObject, { a: { hasOwnProperty: 'b' } }); -``` - -By default parameters that would overwrite properties on the object prototype are ignored, if you wish to keep the data from those fields either use `plainObjects` as mentioned above, or set `allowPrototypes` to `true` which will allow user input to overwrite those properties. -*WARNING* It is generally a bad idea to enable this option as it can cause problems when attempting to use the properties that have been overwritten. -Always be careful with this option. - -```javascript -var protoObject = qs.parse('a[hasOwnProperty]=b', { allowPrototypes: true }); -assert.deepEqual(protoObject, { a: { hasOwnProperty: 'b' } }); -``` - -URI encoded strings work too: - -```javascript -assert.deepEqual(qs.parse('a%5Bb%5D=c'), { - a: { b: 'c' } -}); -``` - -You can also nest your objects, like `'foo[bar][baz]=foobarbaz'`: - -```javascript -assert.deepEqual(qs.parse('foo[bar][baz]=foobarbaz'), { - foo: { - bar: { - baz: 'foobarbaz' - } - } -}); -``` - -By default, when nesting objects **qs** will only parse up to 5 children deep. -This means if you attempt to parse a string like `'a[b][c][d][e][f][g][h][i]=j'` your resulting object will be: - -```javascript -var expected = { - a: { - b: { - c: { - d: { - e: { - f: { - '[g][h][i]': 'j' - } - } - } - } - } - } -}; -var string = 'a[b][c][d][e][f][g][h][i]=j'; -assert.deepEqual(qs.parse(string), expected); -``` - -This depth can be overridden by passing a `depth` option to `qs.parse(string, [options])`: - -```javascript -var deep = qs.parse('a[b][c][d][e][f][g][h][i]=j', { depth: 1 }); -assert.deepEqual(deep, { a: { b: { '[c][d][e][f][g][h][i]': 'j' } } }); -``` - -You can configure **qs** to throw an error when parsing nested input beyond this depth using the `strictDepth` option (defaulted to false): - -```javascript -try { - qs.parse('a[b][c][d][e][f][g][h][i]=j', { depth: 1, strictDepth: true }); -} catch (err) { - assert(err instanceof RangeError); - assert.strictEqual(err.message, 'Input depth exceeded depth option of 1 and strictDepth is true'); -} -``` - -The depth limit helps mitigate abuse when **qs** is used to parse user input, and it is recommended to keep it a reasonably small number. The strictDepth option adds a layer of protection by throwing an error when the limit is exceeded, allowing you to catch and handle such cases. - -For similar reasons, by default **qs** will only parse up to 1000 parameters. This can be overridden by passing a `parameterLimit` option: - -```javascript -var limited = qs.parse('a=b&c=d', { parameterLimit: 1 }); -assert.deepEqual(limited, { a: 'b' }); -``` - -To bypass the leading question mark, use `ignoreQueryPrefix`: - -```javascript -var prefixed = qs.parse('?a=b&c=d', { ignoreQueryPrefix: true }); -assert.deepEqual(prefixed, { a: 'b', c: 'd' }); -``` - -An optional delimiter can also be passed: - -```javascript -var delimited = qs.parse('a=b;c=d', { delimiter: ';' }); -assert.deepEqual(delimited, { a: 'b', c: 'd' }); -``` - -Delimiters can be a regular expression too: - -```javascript -var regexed = qs.parse('a=b;c=d,e=f', { delimiter: /[;,]/ }); -assert.deepEqual(regexed, { a: 'b', c: 'd', e: 'f' }); -``` - -Option `allowDots` can be used to enable dot notation: - -```javascript -var withDots = qs.parse('a.b=c', { allowDots: true }); -assert.deepEqual(withDots, { a: { b: 'c' } }); -``` - -Option `decodeDotInKeys` can be used to decode dots in keys -Note: it implies `allowDots`, so `parse` will error if you set `decodeDotInKeys` to `true`, and `allowDots` to `false`. - -```javascript -var withDots = qs.parse('name%252Eobj.first=John&name%252Eobj.last=Doe', { decodeDotInKeys: true }); -assert.deepEqual(withDots, { 'name.obj': { first: 'John', last: 'Doe' }}); -``` - -Option `allowEmptyArrays` can be used to allowing empty array values in object -```javascript -var withEmptyArrays = qs.parse('foo[]&bar=baz', { allowEmptyArrays: true }); -assert.deepEqual(withEmptyArrays, { foo: [], bar: 'baz' }); -``` - -Option `duplicates` can be used to change the behavior when duplicate keys are encountered -```javascript -assert.deepEqual(qs.parse('foo=bar&foo=baz'), { foo: ['bar', 'baz'] }); -assert.deepEqual(qs.parse('foo=bar&foo=baz', { duplicates: 'combine' }), { foo: ['bar', 'baz'] }); -assert.deepEqual(qs.parse('foo=bar&foo=baz', { duplicates: 'first' }), { foo: 'bar' }); -assert.deepEqual(qs.parse('foo=bar&foo=baz', { duplicates: 'last' }), { foo: 'baz' }); -``` - -If you have to deal with legacy browsers or services, there's also support for decoding percent-encoded octets as iso-8859-1: - -```javascript -var oldCharset = qs.parse('a=%A7', { charset: 'iso-8859-1' }); -assert.deepEqual(oldCharset, { a: '§' }); -``` - -Some services add an initial `utf8=✓` value to forms so that old Internet Explorer versions are more likely to submit the form as utf-8. -Additionally, the server can check the value against wrong encodings of the checkmark character and detect that a query string or `application/x-www-form-urlencoded` body was *not* sent as utf-8, eg. if the form had an `accept-charset` parameter or the containing page had a different character set. - -**qs** supports this mechanism via the `charsetSentinel` option. -If specified, the `utf8` parameter will be omitted from the returned object. -It will be used to switch to `iso-8859-1`/`utf-8` mode depending on how the checkmark is encoded. - -**Important**: When you specify both the `charset` option and the `charsetSentinel` option, the `charset` will be overridden when the request contains a `utf8` parameter from which the actual charset can be deduced. -In that sense the `charset` will behave as the default charset rather than the authoritative charset. - -```javascript -var detectedAsUtf8 = qs.parse('utf8=%E2%9C%93&a=%C3%B8', { - charset: 'iso-8859-1', - charsetSentinel: true -}); -assert.deepEqual(detectedAsUtf8, { a: 'ø' }); - -// Browsers encode the checkmark as ✓ when submitting as iso-8859-1: -var detectedAsIso8859_1 = qs.parse('utf8=%26%2310003%3B&a=%F8', { - charset: 'utf-8', - charsetSentinel: true -}); -assert.deepEqual(detectedAsIso8859_1, { a: 'ø' }); -``` - -If you want to decode the `&#...;` syntax to the actual character, you can specify the `interpretNumericEntities` option as well: - -```javascript -var detectedAsIso8859_1 = qs.parse('a=%26%239786%3B', { - charset: 'iso-8859-1', - interpretNumericEntities: true -}); -assert.deepEqual(detectedAsIso8859_1, { a: '☺' }); -``` - -It also works when the charset has been detected in `charsetSentinel` mode. - -### Parsing Arrays - -**qs** can also parse arrays using a similar `[]` notation: - -```javascript -var withArray = qs.parse('a[]=b&a[]=c'); -assert.deepEqual(withArray, { a: ['b', 'c'] }); -``` - -You may specify an index as well: - -```javascript -var withIndexes = qs.parse('a[1]=c&a[0]=b'); -assert.deepEqual(withIndexes, { a: ['b', 'c'] }); -``` - -Note that the only difference between an index in an array and a key in an object is that the value between the brackets must be a number to create an array. -When creating arrays with specific indices, **qs** will compact a sparse array to only the existing values preserving their order: - -```javascript -var noSparse = qs.parse('a[1]=b&a[15]=c'); -assert.deepEqual(noSparse, { a: ['b', 'c'] }); -``` - -You may also use `allowSparse` option to parse sparse arrays: - -```javascript -var sparseArray = qs.parse('a[1]=2&a[3]=5', { allowSparse: true }); -assert.deepEqual(sparseArray, { a: [, '2', , '5'] }); -``` - -Note that an empty string is also a value, and will be preserved: - -```javascript -var withEmptyString = qs.parse('a[]=&a[]=b'); -assert.deepEqual(withEmptyString, { a: ['', 'b'] }); - -var withIndexedEmptyString = qs.parse('a[0]=b&a[1]=&a[2]=c'); -assert.deepEqual(withIndexedEmptyString, { a: ['b', '', 'c'] }); -``` - -**qs** will also limit specifying indices in an array to a maximum index of `20`. -Any array members with an index of greater than `20` will instead be converted to an object with the index as the key. -This is needed to handle cases when someone sent, for example, `a[999999999]` and it will take significant time to iterate over this huge array. - -```javascript -var withMaxIndex = qs.parse('a[100]=b'); -assert.deepEqual(withMaxIndex, { a: { '100': 'b' } }); -``` - -This limit can be overridden by passing an `arrayLimit` option: - -```javascript -var withArrayLimit = qs.parse('a[1]=b', { arrayLimit: 0 }); -assert.deepEqual(withArrayLimit, { a: { '1': 'b' } }); -``` - -To disable array parsing entirely, set `parseArrays` to `false`. - -```javascript -var noParsingArrays = qs.parse('a[]=b', { parseArrays: false }); -assert.deepEqual(noParsingArrays, { a: { '0': 'b' } }); -``` - -If you mix notations, **qs** will merge the two items into an object: - -```javascript -var mixedNotation = qs.parse('a[0]=b&a[b]=c'); -assert.deepEqual(mixedNotation, { a: { '0': 'b', b: 'c' } }); -``` - -You can also create arrays of objects: - -```javascript -var arraysOfObjects = qs.parse('a[][b]=c'); -assert.deepEqual(arraysOfObjects, { a: [{ b: 'c' }] }); -``` - -Some people use comma to join array, **qs** can parse it: -```javascript -var arraysOfObjects = qs.parse('a=b,c', { comma: true }) -assert.deepEqual(arraysOfObjects, { a: ['b', 'c'] }) -``` -(_this cannot convert nested objects, such as `a={b:1},{c:d}`_) - -### Parsing primitive/scalar values (numbers, booleans, null, etc) - -By default, all values are parsed as strings. -This behavior will not change and is explained in [issue #91](https://github.com/ljharb/qs/issues/91). - -```javascript -var primitiveValues = qs.parse('a=15&b=true&c=null'); -assert.deepEqual(primitiveValues, { a: '15', b: 'true', c: 'null' }); -``` - -If you wish to auto-convert values which look like numbers, booleans, and other values into their primitive counterparts, you can use the [query-types Express JS middleware](https://github.com/xpepermint/query-types) which will auto-convert all request query parameters. - -### Stringifying - -[](#preventEval) -```javascript -qs.stringify(object, [options]); -``` - -When stringifying, **qs** by default URI encodes output. Objects are stringified as you would expect: - -```javascript -assert.equal(qs.stringify({ a: 'b' }), 'a=b'); -assert.equal(qs.stringify({ a: { b: 'c' } }), 'a%5Bb%5D=c'); -``` - -This encoding can be disabled by setting the `encode` option to `false`: - -```javascript -var unencoded = qs.stringify({ a: { b: 'c' } }, { encode: false }); -assert.equal(unencoded, 'a[b]=c'); -``` - -Encoding can be disabled for keys by setting the `encodeValuesOnly` option to `true`: -```javascript -var encodedValues = qs.stringify( - { a: 'b', c: ['d', 'e=f'], f: [['g'], ['h']] }, - { encodeValuesOnly: true } -); -assert.equal(encodedValues,'a=b&c[0]=d&c[1]=e%3Df&f[0][0]=g&f[1][0]=h'); -``` - -This encoding can also be replaced by a custom encoding method set as `encoder` option: - -```javascript -var encoded = qs.stringify({ a: { b: 'c' } }, { encoder: function (str) { - // Passed in values `a`, `b`, `c` - return // Return encoded string -}}) -``` - -_(Note: the `encoder` option does not apply if `encode` is `false`)_ - -Analogue to the `encoder` there is a `decoder` option for `parse` to override decoding of properties and values: - -```javascript -var decoded = qs.parse('x=z', { decoder: function (str) { - // Passed in values `x`, `z` - return // Return decoded string -}}) -``` - -You can encode keys and values using different logic by using the type argument provided to the encoder: - -```javascript -var encoded = qs.stringify({ a: { b: 'c' } }, { encoder: function (str, defaultEncoder, charset, type) { - if (type === 'key') { - return // Encoded key - } else if (type === 'value') { - return // Encoded value - } -}}) -``` - -The type argument is also provided to the decoder: - -```javascript -var decoded = qs.parse('x=z', { decoder: function (str, defaultDecoder, charset, type) { - if (type === 'key') { - return // Decoded key - } else if (type === 'value') { - return // Decoded value - } -}}) -``` - -Examples beyond this point will be shown as though the output is not URI encoded for clarity. -Please note that the return values in these cases *will* be URI encoded during real usage. - -When arrays are stringified, they follow the `arrayFormat` option, which defaults to `indices`: - -```javascript -qs.stringify({ a: ['b', 'c', 'd'] }); -// 'a[0]=b&a[1]=c&a[2]=d' -``` - -You may override this by setting the `indices` option to `false`, or to be more explicit, the `arrayFormat` option to `repeat`: - -```javascript -qs.stringify({ a: ['b', 'c', 'd'] }, { indices: false }); -// 'a=b&a=c&a=d' -``` - -You may use the `arrayFormat` option to specify the format of the output array: - -```javascript -qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'indices' }) -// 'a[0]=b&a[1]=c' -qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'brackets' }) -// 'a[]=b&a[]=c' -qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'repeat' }) -// 'a=b&a=c' -qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'comma' }) -// 'a=b,c' -``` - -Note: when using `arrayFormat` set to `'comma'`, you can also pass the `commaRoundTrip` option set to `true` or `false`, to append `[]` on single-item arrays, so that they can round trip through a parse. - -When objects are stringified, by default they use bracket notation: - -```javascript -qs.stringify({ a: { b: { c: 'd', e: 'f' } } }); -// 'a[b][c]=d&a[b][e]=f' -``` - -You may override this to use dot notation by setting the `allowDots` option to `true`: - -```javascript -qs.stringify({ a: { b: { c: 'd', e: 'f' } } }, { allowDots: true }); -// 'a.b.c=d&a.b.e=f' -``` - -You may encode the dot notation in the keys of object with option `encodeDotInKeys` by setting it to `true`: -Note: it implies `allowDots`, so `stringify` will error if you set `decodeDotInKeys` to `true`, and `allowDots` to `false`. -Caveat: when `encodeValuesOnly` is `true` as well as `encodeDotInKeys`, only dots in keys and nothing else will be encoded. -```javascript -qs.stringify({ "name.obj": { "first": "John", "last": "Doe" } }, { allowDots: true, encodeDotInKeys: true }) -// 'name%252Eobj.first=John&name%252Eobj.last=Doe' -``` - -You may allow empty array values by setting the `allowEmptyArrays` option to `true`: -```javascript -qs.stringify({ foo: [], bar: 'baz' }, { allowEmptyArrays: true }); -// 'foo[]&bar=baz' -``` - -Empty strings and null values will omit the value, but the equals sign (=) remains in place: - -```javascript -assert.equal(qs.stringify({ a: '' }), 'a='); -``` - -Key with no values (such as an empty object or array) will return nothing: - -```javascript -assert.equal(qs.stringify({ a: [] }), ''); -assert.equal(qs.stringify({ a: {} }), ''); -assert.equal(qs.stringify({ a: [{}] }), ''); -assert.equal(qs.stringify({ a: { b: []} }), ''); -assert.equal(qs.stringify({ a: { b: {}} }), ''); -``` - -Properties that are set to `undefined` will be omitted entirely: - -```javascript -assert.equal(qs.stringify({ a: null, b: undefined }), 'a='); -``` - -The query string may optionally be prepended with a question mark: - -```javascript -assert.equal(qs.stringify({ a: 'b', c: 'd' }, { addQueryPrefix: true }), '?a=b&c=d'); -``` - -The delimiter may be overridden with stringify as well: - -```javascript -assert.equal(qs.stringify({ a: 'b', c: 'd' }, { delimiter: ';' }), 'a=b;c=d'); -``` - -If you only want to override the serialization of `Date` objects, you can provide a `serializeDate` option: - -```javascript -var date = new Date(7); -assert.equal(qs.stringify({ a: date }), 'a=1970-01-01T00:00:00.007Z'.replace(/:/g, '%3A')); -assert.equal( - qs.stringify({ a: date }, { serializeDate: function (d) { return d.getTime(); } }), - 'a=7' -); -``` - -You may use the `sort` option to affect the order of parameter keys: - -```javascript -function alphabeticalSort(a, b) { - return a.localeCompare(b); -} -assert.equal(qs.stringify({ a: 'c', z: 'y', b : 'f' }, { sort: alphabeticalSort }), 'a=c&b=f&z=y'); -``` - -Finally, you can use the `filter` option to restrict which keys will be included in the stringified output. -If you pass a function, it will be called for each key to obtain the replacement value. -Otherwise, if you pass an array, it will be used to select properties and array indices for stringification: - -```javascript -function filterFunc(prefix, value) { - if (prefix == 'b') { - // Return an `undefined` value to omit a property. - return; - } - if (prefix == 'e[f]') { - return value.getTime(); - } - if (prefix == 'e[g][0]') { - return value * 2; - } - return value; -} -qs.stringify({ a: 'b', c: 'd', e: { f: new Date(123), g: [2] } }, { filter: filterFunc }); -// 'a=b&c=d&e[f]=123&e[g][0]=4' -qs.stringify({ a: 'b', c: 'd', e: 'f' }, { filter: ['a', 'e'] }); -// 'a=b&e=f' -qs.stringify({ a: ['b', 'c', 'd'], e: 'f' }, { filter: ['a', 0, 2] }); -// 'a[0]=b&a[2]=d' -``` - -You could also use `filter` to inject custom serialization for user defined types. -Consider you're working with some api that expects query strings of the format for ranges: - -``` -https://domain.com/endpoint?range=30...70 -``` - -For which you model as: - -```javascript -class Range { - constructor(from, to) { - this.from = from; - this.to = to; - } -} -``` - -You could _inject_ a custom serializer to handle values of this type: - -```javascript -qs.stringify( - { - range: new Range(30, 70), - }, - { - filter: (prefix, value) => { - if (value instanceof Range) { - return `${value.from}...${value.to}`; - } - // serialize the usual way - return value; - }, - } -); -// range=30...70 -``` - -### Handling of `null` values - -By default, `null` values are treated like empty strings: - -```javascript -var withNull = qs.stringify({ a: null, b: '' }); -assert.equal(withNull, 'a=&b='); -``` - -Parsing does not distinguish between parameters with and without equal signs. -Both are converted to empty strings. - -```javascript -var equalsInsensitive = qs.parse('a&b='); -assert.deepEqual(equalsInsensitive, { a: '', b: '' }); -``` - -To distinguish between `null` values and empty strings use the `strictNullHandling` flag. In the result string the `null` -values have no `=` sign: - -```javascript -var strictNull = qs.stringify({ a: null, b: '' }, { strictNullHandling: true }); -assert.equal(strictNull, 'a&b='); -``` - -To parse values without `=` back to `null` use the `strictNullHandling` flag: - -```javascript -var parsedStrictNull = qs.parse('a&b=', { strictNullHandling: true }); -assert.deepEqual(parsedStrictNull, { a: null, b: '' }); -``` - -To completely skip rendering keys with `null` values, use the `skipNulls` flag: - -```javascript -var nullsSkipped = qs.stringify({ a: 'b', c: null}, { skipNulls: true }); -assert.equal(nullsSkipped, 'a=b'); -``` - -If you're communicating with legacy systems, you can switch to `iso-8859-1` using the `charset` option: - -```javascript -var iso = qs.stringify({ æ: 'æ' }, { charset: 'iso-8859-1' }); -assert.equal(iso, '%E6=%E6'); -``` - -Characters that don't exist in `iso-8859-1` will be converted to numeric entities, similar to what browsers do: - -```javascript -var numeric = qs.stringify({ a: '☺' }, { charset: 'iso-8859-1' }); -assert.equal(numeric, 'a=%26%239786%3B'); -``` - -You can use the `charsetSentinel` option to announce the character by including an `utf8=✓` parameter with the proper encoding if the checkmark, similar to what Ruby on Rails and others do when submitting forms. - -```javascript -var sentinel = qs.stringify({ a: '☺' }, { charsetSentinel: true }); -assert.equal(sentinel, 'utf8=%E2%9C%93&a=%E2%98%BA'); - -var isoSentinel = qs.stringify({ a: 'æ' }, { charsetSentinel: true, charset: 'iso-8859-1' }); -assert.equal(isoSentinel, 'utf8=%26%2310003%3B&a=%E6'); -``` - -### Dealing with special character sets - -By default the encoding and decoding of characters is done in `utf-8`, and `iso-8859-1` support is also built in via the `charset` parameter. - -If you wish to encode querystrings to a different character set (i.e. -[Shift JIS](https://en.wikipedia.org/wiki/Shift_JIS)) you can use the -[`qs-iconv`](https://github.com/martinheidegger/qs-iconv) library: - -```javascript -var encoder = require('qs-iconv/encoder')('shift_jis'); -var shiftJISEncoded = qs.stringify({ a: 'こんにちは!' }, { encoder: encoder }); -assert.equal(shiftJISEncoded, 'a=%82%B1%82%F1%82%C9%82%BF%82%CD%81I'); -``` - -This also works for decoding of query strings: - -```javascript -var decoder = require('qs-iconv/decoder')('shift_jis'); -var obj = qs.parse('a=%82%B1%82%F1%82%C9%82%BF%82%CD%81I', { decoder: decoder }); -assert.deepEqual(obj, { a: 'こんにちは!' }); -``` - -### RFC 3986 and RFC 1738 space encoding - -RFC3986 used as default option and encodes ' ' to *%20* which is backward compatible. -In the same time, output can be stringified as per RFC1738 with ' ' equal to '+'. - -``` -assert.equal(qs.stringify({ a: 'b c' }), 'a=b%20c'); -assert.equal(qs.stringify({ a: 'b c' }, { format : 'RFC3986' }), 'a=b%20c'); -assert.equal(qs.stringify({ a: 'b c' }, { format : 'RFC1738' }), 'a=b+c'); -``` - -## Security - -Please email [@ljharb](https://github.com/ljharb) or see https://tidelift.com/security if you have a potential security vulnerability to report. - -## qs for enterprise - -Available as part of the Tidelift Subscription - -The maintainers of qs and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. -Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. -[Learn more.](https://tidelift.com/subscription/pkg/npm-qs?utm_source=npm-qs&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) - -[package-url]: https://npmjs.org/package/qs -[npm-version-svg]: https://versionbadg.es/ljharb/qs.svg -[deps-svg]: https://david-dm.org/ljharb/qs.svg -[deps-url]: https://david-dm.org/ljharb/qs -[dev-deps-svg]: https://david-dm.org/ljharb/qs/dev-status.svg -[dev-deps-url]: https://david-dm.org/ljharb/qs#info=devDependencies -[npm-badge-png]: https://nodei.co/npm/qs.png?downloads=true&stars=true -[license-image]: https://img.shields.io/npm/l/qs.svg -[license-url]: LICENSE -[downloads-image]: https://img.shields.io/npm/dm/qs.svg -[downloads-url]: https://npm-stat.com/charts.html?package=qs -[codecov-image]: https://codecov.io/gh/ljharb/qs/branch/main/graphs/badge.svg -[codecov-url]: https://app.codecov.io/gh/ljharb/qs/ -[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/qs -[actions-url]: https://github.com/ljharb/qs/actions - -## Acknowledgements - -qs logo by [NUMI](https://github.com/numi-hq/open-design): - -[NUMI Logo](https://numi.tech/?ref=qs) diff --git a/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/dist/qs.js b/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/dist/qs.js deleted file mode 100644 index 154e72e575b0..000000000000 --- a/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/dist/qs.js +++ /dev/null @@ -1,90 +0,0 @@ -(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Qs = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i-1?e.split(","):e},isoSentinel="utf8=%26%2310003%3B",charsetSentinel="utf8=%E2%9C%93",parseValues=function parseQueryStringValues(e,t){var r={__proto__:null},a=t.ignoreQueryPrefix?e.replace(/^\?/,""):e;a=a.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var i,o=t.parameterLimit===1/0?void 0:t.parameterLimit,l=a.split(t.delimiter,o),s=-1,n=t.charset;if(t.charsetSentinel)for(i=0;i-1&&(c=isArray(c)?[c]:c);var y=has.call(r,p);y&&"combine"===t.duplicates?r[p]=utils.combine(r[p],c):y&&"last"!==t.duplicates||(r[p]=c)}return r},parseObject=function(e,t,r,a){for(var i=a?t:parseArrayValue(t,r),o=e.length-1;o>=0;--o){var l,s=e[o];if("[]"===s&&r.parseArrays)l=r.allowEmptyArrays&&(""===i||r.strictNullHandling&&null===i)?[]:[].concat(i);else{l=r.plainObjects?Object.create(null):{};var n="["===s.charAt(0)&&"]"===s.charAt(s.length-1)?s.slice(1,-1):s,p=r.decodeDotInKeys?n.replace(/%2E/g,"."):n,c=parseInt(p,10);r.parseArrays||""!==p?!isNaN(c)&&s!==p&&String(c)===p&&c>=0&&r.parseArrays&&c<=r.arrayLimit?(l=[])[c]=i:"__proto__"!==p&&(l[p]=i):l={0:i}}i=l}return i},parseKeys=function parseQueryStringKeys(e,t,r,a){if(e){var i=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,o=/(\[[^[\]]*])/g,l=r.depth>0&&/(\[[^[\]]*])/.exec(i),s=l?i.slice(0,l.index):i,n=[];if(s){if(!r.plainObjects&&has.call(Object.prototype,s)&&!r.allowPrototypes)return;n.push(s)}for(var p=0;r.depth>0&&null!==(l=o.exec(i))&&p0?w.join(",")||null:void 0}];else if(isArray(f))E=f;else{var S=Object.keys(w);E=u?S.sort(u):S}var O=l?r.replace(/\./g,"%2E"):r,T=o&&isArray(w)&&1===w.length?O+"[]":O;if(a&&isArray(w)&&0===w.length)return T+"[]";for(var k=0;k0?y+d:""}; - -},{"1":1,"29":29,"5":5}],5:[function(require,module,exports){ -"use strict";var formats=require(1),has=Object.prototype.hasOwnProperty,isArray=Array.isArray,hexTable=function(){for(var e=[],r=0;r<256;++r)e.push("%"+((r<16?"0":"")+r.toString(16)).toUpperCase());return e}(),compactQueue=function compactQueue(e){for(;e.length>1;){var r=e.pop(),t=r.obj[r.prop];if(isArray(t)){for(var o=[],n=0;n=limit?a.slice(i,i+limit):a,p=[],s=0;s=48&&f<=57||f>=65&&f<=90||f>=97&&f<=122||n===formats.RFC1738&&(40===f||41===f)?p[p.length]=u.charAt(s):f<128?p[p.length]=hexTable[f]:f<2048?p[p.length]=hexTable[192|f>>6]+hexTable[128|63&f]:f<55296||f>=57344?p[p.length]=hexTable[224|f>>12]+hexTable[128|f>>6&63]+hexTable[128|63&f]:(s+=1,f=65536+((1023&f)<<10|1023&u.charCodeAt(s)),p[p.length]=hexTable[240|f>>18]+hexTable[128|f>>12&63]+hexTable[128|f>>6&63]+hexTable[128|63&f])}c+=p.join("")}return c},compact=function compact(e){for(var r=[{obj:{o:e},prop:"o"}],t=[],o=0;o-1?callBind(t):t}; - -},{"20":20,"8":8}],20:[function(require,module,exports){ -"use strict";var undefined,$Error=require(12),$EvalError=require(11),$RangeError=require(13),$ReferenceError=require(14),$SyntaxError=require(15),$TypeError=require(16),$URIError=require(17),$Function=Function,getEvalledConstructor=function(r){try{return $Function('"use strict"; return ('+r+").constructor;")()}catch(r){}},$gOPD=Object.getOwnPropertyDescriptor;if($gOPD)try{$gOPD({},"")}catch(r){$gOPD=null}var throwTypeError=function(){throw new $TypeError},ThrowTypeError=$gOPD?function(){try{return throwTypeError}catch(r){try{return $gOPD(arguments,"callee").get}catch(r){return throwTypeError}}}():throwTypeError,hasSymbols=require(24)(),hasProto=require(23)(),getProto=Object.getPrototypeOf||(hasProto?function(r){return r.__proto__}:null),needsEval={},TypedArray="undefined"!=typeof Uint8Array&&getProto?getProto(Uint8Array):undefined,INTRINSICS={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?undefined:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?undefined:ArrayBuffer,"%ArrayIteratorPrototype%":hasSymbols&&getProto?getProto([][Symbol.iterator]()):undefined,"%AsyncFromSyncIteratorPrototype%":undefined,"%AsyncFunction%":needsEval,"%AsyncGenerator%":needsEval,"%AsyncGeneratorFunction%":needsEval,"%AsyncIteratorPrototype%":needsEval,"%Atomics%":"undefined"==typeof Atomics?undefined:Atomics,"%BigInt%":"undefined"==typeof BigInt?undefined:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?undefined:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?undefined:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?undefined:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":$Error,"%eval%":eval,"%EvalError%":$EvalError,"%Float32Array%":"undefined"==typeof Float32Array?undefined:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?undefined:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?undefined:FinalizationRegistry,"%Function%":$Function,"%GeneratorFunction%":needsEval,"%Int8Array%":"undefined"==typeof Int8Array?undefined:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?undefined:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?undefined:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":hasSymbols&&getProto?getProto(getProto([][Symbol.iterator]())):undefined,"%JSON%":"object"==typeof JSON?JSON:undefined,"%Map%":"undefined"==typeof Map?undefined:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&hasSymbols&&getProto?getProto((new Map)[Symbol.iterator]()):undefined,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?undefined:Promise,"%Proxy%":"undefined"==typeof Proxy?undefined:Proxy,"%RangeError%":$RangeError,"%ReferenceError%":$ReferenceError,"%Reflect%":"undefined"==typeof Reflect?undefined:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?undefined:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&hasSymbols&&getProto?getProto((new Set)[Symbol.iterator]()):undefined,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?undefined:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":hasSymbols&&getProto?getProto(""[Symbol.iterator]()):undefined,"%Symbol%":hasSymbols?Symbol:undefined,"%SyntaxError%":$SyntaxError,"%ThrowTypeError%":ThrowTypeError,"%TypedArray%":TypedArray,"%TypeError%":$TypeError,"%Uint8Array%":"undefined"==typeof Uint8Array?undefined:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?undefined:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?undefined:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?undefined:Uint32Array,"%URIError%":$URIError,"%WeakMap%":"undefined"==typeof WeakMap?undefined:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?undefined:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?undefined:WeakSet};if(getProto)try{null.error}catch(r){var errorProto=getProto(getProto(r));INTRINSICS["%Error.prototype%"]=errorProto}var doEval=function doEval(r){var e;if("%AsyncFunction%"===r)e=getEvalledConstructor("async function () {}");else if("%GeneratorFunction%"===r)e=getEvalledConstructor("function* () {}");else if("%AsyncGeneratorFunction%"===r)e=getEvalledConstructor("async function* () {}");else if("%AsyncGenerator%"===r){var t=doEval("%AsyncGeneratorFunction%");t&&(e=t.prototype)}else if("%AsyncIteratorPrototype%"===r){var o=doEval("%AsyncGenerator%");o&&getProto&&(e=getProto(o.prototype))}return INTRINSICS[r]=e,e},LEGACY_ALIASES={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},bind=require(19),hasOwn=require(26),$concat=bind.call(Function.call,Array.prototype.concat),$spliceApply=bind.call(Function.apply,Array.prototype.splice),$replace=bind.call(Function.call,String.prototype.replace),$strSlice=bind.call(Function.call,String.prototype.slice),$exec=bind.call(Function.call,RegExp.prototype.exec),rePropName=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,reEscapeChar=/\\(\\)?/g,stringToPath=function stringToPath(r){var e=$strSlice(r,0,1),t=$strSlice(r,-1);if("%"===e&&"%"!==t)throw new $SyntaxError("invalid intrinsic syntax, expected closing `%`");if("%"===t&&"%"!==e)throw new $SyntaxError("invalid intrinsic syntax, expected opening `%`");var o=[];return $replace(r,rePropName,(function(r,e,t,n){o[o.length]=t?$replace(n,reEscapeChar,"$1"):e||r})),o},getBaseIntrinsic=function getBaseIntrinsic(r,e){var t,o=r;if(hasOwn(LEGACY_ALIASES,o)&&(o="%"+(t=LEGACY_ALIASES[o])[0]+"%"),hasOwn(INTRINSICS,o)){var n=INTRINSICS[o];if(n===needsEval&&(n=doEval(o)),void 0===n&&!e)throw new $TypeError("intrinsic "+r+" exists, but is not available. Please file an issue!");return{alias:t,name:o,value:n}}throw new $SyntaxError("intrinsic "+r+" does not exist!")};module.exports=function GetIntrinsic(r,e){if("string"!=typeof r||0===r.length)throw new $TypeError("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new $TypeError('"allowMissing" argument must be a boolean');if(null===$exec(/^%?[^%]*%?$/,r))throw new $SyntaxError("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var t=stringToPath(r),o=t.length>0?t[0]:"",n=getBaseIntrinsic("%"+o+"%",e),a=n.name,y=n.value,i=!1,p=n.alias;p&&(o=p[0],$spliceApply(t,$concat([0,1],p)));for(var d=1,s=!0;d=t.length){var c=$gOPD(y,f);y=(s=!!c)&&"get"in c&&!("originalValue"in c.get)?c.get:y[f]}else s=hasOwn(y,f),y=y[f];s&&!i&&(INTRINSICS[a]=y)}}return y}; - -},{"11":11,"12":12,"13":13,"14":14,"15":15,"16":16,"17":17,"19":19,"23":23,"24":24,"26":26}],8:[function(require,module,exports){ -"use strict";var bind=require(19),GetIntrinsic=require(20),setFunctionLength=require(28),$TypeError=require(16),$apply=GetIntrinsic("%Function.prototype.apply%"),$call=GetIntrinsic("%Function.prototype.call%"),$reflectApply=GetIntrinsic("%Reflect.apply%",!0)||bind.call($call,$apply),$defineProperty=require(10),$max=GetIntrinsic("%Math.max%");module.exports=function callBind(e){if("function"!=typeof e)throw new $TypeError("a function is required");var n=$reflectApply(bind,$call,arguments);return setFunctionLength(n,1+$max(0,e.length-(arguments.length-1)),!0)};var applyBind=function applyBind(){return $reflectApply(bind,$apply,arguments)};$defineProperty?$defineProperty(module.exports,"apply",{value:applyBind}):module.exports.apply=applyBind; - -},{"10":10,"16":16,"19":19,"20":20,"28":28}],16:[function(require,module,exports){ -"use strict";module.exports=TypeError; - -},{}],19:[function(require,module,exports){ -"use strict";var implementation=require(18);module.exports=Function.prototype.bind||implementation; - -},{"18":18}],10:[function(require,module,exports){ -"use strict";var GetIntrinsic=require(20),$defineProperty=GetIntrinsic("%Object.defineProperty%",!0)||!1;if($defineProperty)try{$defineProperty({},"a",{value:1})}catch(e){$defineProperty=!1}module.exports=$defineProperty; - -},{"20":20}],28:[function(require,module,exports){ -"use strict";var GetIntrinsic=require(20),define=require(9),hasDescriptors=require(22)(),gOPD=require(21),$TypeError=require(16),$floor=GetIntrinsic("%Math.floor%");module.exports=function setFunctionLength(e,r){if("function"!=typeof e)throw new $TypeError("`fn` is not a function");if("number"!=typeof r||r<0||r>4294967295||$floor(r)!==r)throw new $TypeError("`length` must be a positive 32-bit integer");var t=arguments.length>2&&!!arguments[2],i=!0,n=!0;if("length"in e&&gOPD){var o=gOPD(e,"length");o&&!o.configurable&&(i=!1),o&&!o.writable&&(n=!1)}return(i||n||!t)&&(hasDescriptors?define(e,"length",r,!0,!0):define(e,"length",r)),e}; - -},{"16":16,"20":20,"21":21,"22":22,"9":9}],9:[function(require,module,exports){ -"use strict";var $defineProperty=require(10),$SyntaxError=require(15),$TypeError=require(16),gopd=require(21);module.exports=function defineDataProperty(e,r,o){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new $TypeError("`obj` must be an object or a function`");if("string"!=typeof r&&"symbol"!=typeof r)throw new $TypeError("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new $TypeError("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new $TypeError("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new $TypeError("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new $TypeError("`loose`, if provided, must be a boolean");var n=arguments.length>3?arguments[3]:null,l=arguments.length>4?arguments[4]:null,t=arguments.length>5?arguments[5]:null,i=arguments.length>6&&arguments[6],a=!!gopd&&gopd(e,r);if($defineProperty)$defineProperty(e,r,{configurable:null===t&&a?a.configurable:!t,enumerable:null===n&&a?a.enumerable:!n,value:o,writable:null===l&&a?a.writable:!l});else{if(!i&&(n||l||t))throw new $SyntaxError("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");e[r]=o}}; - -},{"10":10,"15":15,"16":16,"21":21}],15:[function(require,module,exports){ -"use strict";module.exports=SyntaxError; - -},{}],21:[function(require,module,exports){ -"use strict";var GetIntrinsic=require(20),$gOPD=GetIntrinsic("%Object.getOwnPropertyDescriptor%",!0);if($gOPD)try{$gOPD([],"length")}catch(t){$gOPD=null}module.exports=$gOPD; - -},{"20":20}],11:[function(require,module,exports){ -"use strict";module.exports=EvalError; - -},{}],12:[function(require,module,exports){ -"use strict";module.exports=Error; - -},{}],13:[function(require,module,exports){ -"use strict";module.exports=RangeError; - -},{}],14:[function(require,module,exports){ -"use strict";module.exports=ReferenceError; - -},{}],17:[function(require,module,exports){ -"use strict";module.exports=URIError; - -},{}],18:[function(require,module,exports){ -"use strict";var ERROR_MESSAGE="Function.prototype.bind called on incompatible ",toStr=Object.prototype.toString,max=Math.max,funcType="[object Function]",concatty=function concatty(t,n){for(var r=[],o=0;o-1e3&&t<1e3||$test.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof t){var n=t<0?-$floor(-t):$floor(t);if(n!==t){var o=String(n),i=$slice.call(e,o.length+1);return $replace.call(o,r,"$&_")+"."+$replace.call($replace.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return $replace.call(e,r,"$&_")}var utilInspect=require(6),inspectCustom=utilInspect.custom,inspectSymbol=isSymbol(inspectCustom)?inspectCustom:null;function wrapQuotes(t,e,r){var n="double"===(r.quoteStyle||e)?'"':"'";return n+t+n}function quote(t){return $replace.call(String(t),/"/g,""")}function isArray(t){return!("[object Array]"!==toStr(t)||toStringTag&&"object"==typeof t&&toStringTag in t)}function isDate(t){return!("[object Date]"!==toStr(t)||toStringTag&&"object"==typeof t&&toStringTag in t)}function isRegExp(t){return!("[object RegExp]"!==toStr(t)||toStringTag&&"object"==typeof t&&toStringTag in t)}function isError(t){return!("[object Error]"!==toStr(t)||toStringTag&&"object"==typeof t&&toStringTag in t)}function isString(t){return!("[object String]"!==toStr(t)||toStringTag&&"object"==typeof t&&toStringTag in t)}function isNumber(t){return!("[object Number]"!==toStr(t)||toStringTag&&"object"==typeof t&&toStringTag in t)}function isBoolean(t){return!("[object Boolean]"!==toStr(t)||toStringTag&&"object"==typeof t&&toStringTag in t)}function isSymbol(t){if(hasShammedSymbols)return t&&"object"==typeof t&&t instanceof Symbol;if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||!symToString)return!1;try{return symToString.call(t),!0}catch(t){}return!1}function isBigInt(t){if(!t||"object"!=typeof t||!bigIntValueOf)return!1;try{return bigIntValueOf.call(t),!0}catch(t){}return!1}module.exports=function inspect_(t,e,r,n){var o=e||{};if(has(o,"quoteStyle")&&"single"!==o.quoteStyle&&"double"!==o.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(has(o,"maxStringLength")&&("number"==typeof o.maxStringLength?o.maxStringLength<0&&o.maxStringLength!==1/0:null!==o.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var i=!has(o,"customInspect")||o.customInspect;if("boolean"!=typeof i&&"symbol"!==i)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(has(o,"indent")&&null!==o.indent&&"\t"!==o.indent&&!(parseInt(o.indent,10)===o.indent&&o.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(has(o,"numericSeparator")&&"boolean"!=typeof o.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var a=o.numericSeparator;if(void 0===t)return"undefined";if(null===t)return"null";if("boolean"==typeof t)return t?"true":"false";if("string"==typeof t)return inspectString(t,o);if("number"==typeof t){if(0===t)return 1/0/t>0?"0":"-0";var c=String(t);return a?addNumericSeparator(t,c):c}if("bigint"==typeof t){var l=String(t)+"n";return a?addNumericSeparator(t,l):l}var p=void 0===o.depth?5:o.depth;if(void 0===r&&(r=0),r>=p&&p>0&&"object"==typeof t)return isArray(t)?"[Array]":"[Object]";var u=getIndent(o,r);if(void 0===n)n=[];else if(indexOf(n,t)>=0)return"[Circular]";function inspect(t,e,i){if(e&&(n=$arrSlice.call(n)).push(e),i){var a={depth:o.depth};return has(o,"quoteStyle")&&(a.quoteStyle=o.quoteStyle),inspect_(t,a,r+1,n)}return inspect_(t,o,r+1,n)}if("function"==typeof t&&!isRegExp(t)){var f=nameOf(t),s=arrObjKeys(t,inspect);return"[Function"+(f?": "+f:" (anonymous)")+"]"+(s.length>0?" { "+$join.call(s,", ")+" }":"")}if(isSymbol(t)){var y=hasShammedSymbols?$replace.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):symToString.call(t);return"object"!=typeof t||hasShammedSymbols?y:markBoxed(y)}if(isElement(t)){for(var S="<"+$toLowerCase.call(String(t.nodeName)),g=t.attributes||[],b=0;b"}if(isArray(t)){if(0===t.length)return"[]";var m=arrObjKeys(t,inspect);return u&&!singleLineValues(m)?"["+indentedJoin(m,u)+"]":"[ "+$join.call(m,", ")+" ]"}if(isError(t)){var h=arrObjKeys(t,inspect);return"cause"in Error.prototype||!("cause"in t)||isEnumerable.call(t,"cause")?0===h.length?"["+String(t)+"]":"{ ["+String(t)+"] "+$join.call(h,", ")+" }":"{ ["+String(t)+"] "+$join.call($concat.call("[cause]: "+inspect(t.cause),h),", ")+" }"}if("object"==typeof t&&i){if(inspectSymbol&&"function"==typeof t[inspectSymbol]&&utilInspect)return utilInspect(t,{depth:p-r});if("symbol"!==i&&"function"==typeof t.inspect)return t.inspect()}if(isMap(t)){var d=[];return mapForEach&&mapForEach.call(t,(function(e,r){d.push(inspect(r,t,!0)+" => "+inspect(e,t))})),collectionOf("Map",mapSize.call(t),d,u)}if(isSet(t)){var j=[];return setForEach&&setForEach.call(t,(function(e){j.push(inspect(e,t))})),collectionOf("Set",setSize.call(t),j,u)}if(isWeakMap(t))return weakCollectionOf("WeakMap");if(isWeakSet(t))return weakCollectionOf("WeakSet");if(isWeakRef(t))return weakCollectionOf("WeakRef");if(isNumber(t))return markBoxed(inspect(Number(t)));if(isBigInt(t))return markBoxed(inspect(bigIntValueOf.call(t)));if(isBoolean(t))return markBoxed(booleanValueOf.call(t));if(isString(t))return markBoxed(inspect(String(t)));if("undefined"!=typeof window&&t===window)return"{ [object Window] }";if("undefined"!=typeof globalThis&&t===globalThis||"undefined"!=typeof global&&t===global)return"{ [object globalThis] }";if(!isDate(t)&&!isRegExp(t)){var O=arrObjKeys(t,inspect),w=gPO?gPO(t)===Object.prototype:t instanceof Object||t.constructor===Object,$=t instanceof Object?"":"null prototype",k=!w&&toStringTag&&Object(t)===t&&toStringTag in t?$slice.call(toStr(t),8,-1):$?"Object":"",v=(w||"function"!=typeof t.constructor?"":t.constructor.name?t.constructor.name+" ":"")+(k||$?"["+$join.call($concat.call([],k||[],$||[]),": ")+"] ":"");return 0===O.length?v+"{}":u?v+"{"+indentedJoin(O,u)+"}":v+"{ "+$join.call(O,", ")+" }"}return String(t)};var hasOwn=Object.prototype.hasOwnProperty||function(t){return t in this};function has(t,e){return hasOwn.call(t,e)}function toStr(t){return objectToString.call(t)}function nameOf(t){if(t.name)return t.name;var e=$match.call(functionToString.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}function indexOf(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;re.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return inspectString($slice.call(t,0,e.maxStringLength),e)+n}return wrapQuotes($replace.call($replace.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,lowbyte),"single",e)}function lowbyte(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+$toUpperCase.call(e.toString(16))}function markBoxed(t){return"Object("+t+")"}function weakCollectionOf(t){return t+" { ? }"}function collectionOf(t,e,r,n){return t+" ("+e+") {"+(n?indentedJoin(r,n):$join.call(r,", "))+"}"}function singleLineValues(t){for(var e=0;e=0)return!1;return!0}function getIndent(t,e){var r;if("\t"===t.indent)r="\t";else{if(!("number"==typeof t.indent&&t.indent>0))return null;r=$join.call(Array(t.indent+1)," ")}return{base:r,prev:$join.call(Array(e+1),r)}}function indentedJoin(t,e){if(0===t.length)return"";var r="\n"+e.prev+e.base;return r+$join.call(t,","+r)+"\n"+e.prev}function arrObjKeys(t,e){var r=isArray(t),n=[];if(r){n.length=t.length;for(var o=0;o -1) { - return val.split(','); - } - - return val; -}; - -// This is what browsers will submit when the ✓ character occurs in an -// application/x-www-form-urlencoded body and the encoding of the page containing -// the form is iso-8859-1, or when the submitted form has an accept-charset -// attribute of iso-8859-1. Presumably also with other charsets that do not contain -// the ✓ character, such as us-ascii. -var isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('✓') - -// These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded. -var charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓') - -var parseValues = function parseQueryStringValues(str, options) { - var obj = { __proto__: null }; - - var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str; - cleanStr = cleanStr.replace(/%5B/gi, '[').replace(/%5D/gi, ']'); - var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit; - var parts = cleanStr.split(options.delimiter, limit); - var skipIndex = -1; // Keep track of where the utf8 sentinel was found - var i; - - var charset = options.charset; - if (options.charsetSentinel) { - for (i = 0; i < parts.length; ++i) { - if (parts[i].indexOf('utf8=') === 0) { - if (parts[i] === charsetSentinel) { - charset = 'utf-8'; - } else if (parts[i] === isoSentinel) { - charset = 'iso-8859-1'; - } - skipIndex = i; - i = parts.length; // The eslint settings do not allow break; - } - } - } - - for (i = 0; i < parts.length; ++i) { - if (i === skipIndex) { - continue; - } - var part = parts[i]; - - var bracketEqualsPos = part.indexOf(']='); - var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1; - - var key, val; - if (pos === -1) { - key = options.decoder(part, defaults.decoder, charset, 'key'); - val = options.strictNullHandling ? null : ''; - } else { - key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key'); - val = utils.maybeMap( - parseArrayValue(part.slice(pos + 1), options), - function (encodedVal) { - return options.decoder(encodedVal, defaults.decoder, charset, 'value'); - } - ); - } - - if (val && options.interpretNumericEntities && charset === 'iso-8859-1') { - val = interpretNumericEntities(val); - } - - if (part.indexOf('[]=') > -1) { - val = isArray(val) ? [val] : val; - } - - var existing = has.call(obj, key); - if (existing && options.duplicates === 'combine') { - obj[key] = utils.combine(obj[key], val); - } else if (!existing || options.duplicates === 'last') { - obj[key] = val; - } - } - - return obj; -}; - -var parseObject = function (chain, val, options, valuesParsed) { - var leaf = valuesParsed ? val : parseArrayValue(val, options); - - for (var i = chain.length - 1; i >= 0; --i) { - var obj; - var root = chain[i]; - - if (root === '[]' && options.parseArrays) { - obj = options.allowEmptyArrays && (leaf === '' || (options.strictNullHandling && leaf === null)) - ? [] - : [].concat(leaf); - } else { - obj = options.plainObjects ? Object.create(null) : {}; - var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root; - var decodedRoot = options.decodeDotInKeys ? cleanRoot.replace(/%2E/g, '.') : cleanRoot; - var index = parseInt(decodedRoot, 10); - if (!options.parseArrays && decodedRoot === '') { - obj = { 0: leaf }; - } else if ( - !isNaN(index) - && root !== decodedRoot - && String(index) === decodedRoot - && index >= 0 - && (options.parseArrays && index <= options.arrayLimit) - ) { - obj = []; - obj[index] = leaf; - } else if (decodedRoot !== '__proto__') { - obj[decodedRoot] = leaf; - } - } - - leaf = obj; - } - - return leaf; -}; - -var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) { - if (!givenKey) { - return; - } - - // Transform dot notation to bracket notation - var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey; - - // The regex chunks - - var brackets = /(\[[^[\]]*])/; - var child = /(\[[^[\]]*])/g; - - // Get the parent - - var segment = options.depth > 0 && brackets.exec(key); - var parent = segment ? key.slice(0, segment.index) : key; - - // Stash the parent if it exists - - var keys = []; - if (parent) { - // If we aren't using plain objects, optionally prefix keys that would overwrite object prototype properties - if (!options.plainObjects && has.call(Object.prototype, parent)) { - if (!options.allowPrototypes) { - return; - } - } - - keys.push(parent); - } - - // Loop through children appending to the array until we hit depth - - var i = 0; - while (options.depth > 0 && (segment = child.exec(key)) !== null && i < options.depth) { - i += 1; - if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) { - if (!options.allowPrototypes) { - return; - } - } - keys.push(segment[1]); - } - - // If there's a remainder, check strictDepth option for throw, else just add whatever is left - - if (segment) { - if (options.strictDepth === true) { - throw new RangeError('Input depth exceeded depth option of ' + options.depth + ' and strictDepth is true'); - } - keys.push('[' + key.slice(segment.index) + ']'); - } - - return parseObject(keys, val, options, valuesParsed); -}; - -var normalizeParseOptions = function normalizeParseOptions(opts) { - if (!opts) { - return defaults; - } - - if (typeof opts.allowEmptyArrays !== 'undefined' && typeof opts.allowEmptyArrays !== 'boolean') { - throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided'); - } - - if (typeof opts.decodeDotInKeys !== 'undefined' && typeof opts.decodeDotInKeys !== 'boolean') { - throw new TypeError('`decodeDotInKeys` option can only be `true` or `false`, when provided'); - } - - if (opts.decoder !== null && typeof opts.decoder !== 'undefined' && typeof opts.decoder !== 'function') { - throw new TypeError('Decoder has to be a function.'); - } - - if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') { - throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined'); - } - var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset; - - var duplicates = typeof opts.duplicates === 'undefined' ? defaults.duplicates : opts.duplicates; - - if (duplicates !== 'combine' && duplicates !== 'first' && duplicates !== 'last') { - throw new TypeError('The duplicates option must be either combine, first, or last'); - } - - var allowDots = typeof opts.allowDots === 'undefined' ? opts.decodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots; - - return { - allowDots: allowDots, - allowEmptyArrays: typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays, - allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes, - allowSparse: typeof opts.allowSparse === 'boolean' ? opts.allowSparse : defaults.allowSparse, - arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit, - charset: charset, - charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel, - comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma, - decodeDotInKeys: typeof opts.decodeDotInKeys === 'boolean' ? opts.decodeDotInKeys : defaults.decodeDotInKeys, - decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder, - delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter, - // eslint-disable-next-line no-implicit-coercion, no-extra-parens - depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults.depth, - duplicates: duplicates, - ignoreQueryPrefix: opts.ignoreQueryPrefix === true, - interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities, - parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit, - parseArrays: opts.parseArrays !== false, - plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects, - strictDepth: typeof opts.strictDepth === 'boolean' ? !!opts.strictDepth : defaults.strictDepth, - strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling - }; -}; - -module.exports = function (str, opts) { - var options = normalizeParseOptions(opts); - - if (str === '' || str === null || typeof str === 'undefined') { - return options.plainObjects ? Object.create(null) : {}; - } - - var tempObj = typeof str === 'string' ? parseValues(str, options) : str; - var obj = options.plainObjects ? Object.create(null) : {}; - - // Iterate over the keys and setup the new object - - var keys = Object.keys(tempObj); - for (var i = 0; i < keys.length; ++i) { - var key = keys[i]; - var newObj = parseKeys(key, tempObj[key], options, typeof str === 'string'); - obj = utils.merge(obj, newObj, options); - } - - if (options.allowSparse === true) { - return obj; - } - - return utils.compact(obj); -}; diff --git a/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/lib/stringify.js b/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/lib/stringify.js deleted file mode 100644 index 9b934d69b7f7..000000000000 --- a/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/lib/stringify.js +++ /dev/null @@ -1,351 +0,0 @@ -'use strict'; - -var getSideChannel = require('side-channel'); -var utils = require('./utils'); -var formats = require('./formats'); -var has = Object.prototype.hasOwnProperty; - -var arrayPrefixGenerators = { - brackets: function brackets(prefix) { - return prefix + '[]'; - }, - comma: 'comma', - indices: function indices(prefix, key) { - return prefix + '[' + key + ']'; - }, - repeat: function repeat(prefix) { - return prefix; - } -}; - -var isArray = Array.isArray; -var push = Array.prototype.push; -var pushToArray = function (arr, valueOrArray) { - push.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]); -}; - -var toISO = Date.prototype.toISOString; - -var defaultFormat = formats['default']; -var defaults = { - addQueryPrefix: false, - allowDots: false, - allowEmptyArrays: false, - arrayFormat: 'indices', - charset: 'utf-8', - charsetSentinel: false, - delimiter: '&', - encode: true, - encodeDotInKeys: false, - encoder: utils.encode, - encodeValuesOnly: false, - format: defaultFormat, - formatter: formats.formatters[defaultFormat], - // deprecated - indices: false, - serializeDate: function serializeDate(date) { - return toISO.call(date); - }, - skipNulls: false, - strictNullHandling: false -}; - -var isNonNullishPrimitive = function isNonNullishPrimitive(v) { - return typeof v === 'string' - || typeof v === 'number' - || typeof v === 'boolean' - || typeof v === 'symbol' - || typeof v === 'bigint'; -}; - -var sentinel = {}; - -var stringify = function stringify( - object, - prefix, - generateArrayPrefix, - commaRoundTrip, - allowEmptyArrays, - strictNullHandling, - skipNulls, - encodeDotInKeys, - encoder, - filter, - sort, - allowDots, - serializeDate, - format, - formatter, - encodeValuesOnly, - charset, - sideChannel -) { - var obj = object; - - var tmpSc = sideChannel; - var step = 0; - var findFlag = false; - while ((tmpSc = tmpSc.get(sentinel)) !== void undefined && !findFlag) { - // Where object last appeared in the ref tree - var pos = tmpSc.get(object); - step += 1; - if (typeof pos !== 'undefined') { - if (pos === step) { - throw new RangeError('Cyclic object value'); - } else { - findFlag = true; // Break while - } - } - if (typeof tmpSc.get(sentinel) === 'undefined') { - step = 0; - } - } - - if (typeof filter === 'function') { - obj = filter(prefix, obj); - } else if (obj instanceof Date) { - obj = serializeDate(obj); - } else if (generateArrayPrefix === 'comma' && isArray(obj)) { - obj = utils.maybeMap(obj, function (value) { - if (value instanceof Date) { - return serializeDate(value); - } - return value; - }); - } - - if (obj === null) { - if (strictNullHandling) { - return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder, charset, 'key', format) : prefix; - } - - obj = ''; - } - - if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) { - if (encoder) { - var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset, 'key', format); - return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder, charset, 'value', format))]; - } - return [formatter(prefix) + '=' + formatter(String(obj))]; - } - - var values = []; - - if (typeof obj === 'undefined') { - return values; - } - - var objKeys; - if (generateArrayPrefix === 'comma' && isArray(obj)) { - // we need to join elements in - if (encodeValuesOnly && encoder) { - obj = utils.maybeMap(obj, encoder); - } - objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : void undefined }]; - } else if (isArray(filter)) { - objKeys = filter; - } else { - var keys = Object.keys(obj); - objKeys = sort ? keys.sort(sort) : keys; - } - - var encodedPrefix = encodeDotInKeys ? prefix.replace(/\./g, '%2E') : prefix; - - var adjustedPrefix = commaRoundTrip && isArray(obj) && obj.length === 1 ? encodedPrefix + '[]' : encodedPrefix; - - if (allowEmptyArrays && isArray(obj) && obj.length === 0) { - return adjustedPrefix + '[]'; - } - - for (var j = 0; j < objKeys.length; ++j) { - var key = objKeys[j]; - var value = typeof key === 'object' && typeof key.value !== 'undefined' ? key.value : obj[key]; - - if (skipNulls && value === null) { - continue; - } - - var encodedKey = allowDots && encodeDotInKeys ? key.replace(/\./g, '%2E') : key; - var keyPrefix = isArray(obj) - ? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(adjustedPrefix, encodedKey) : adjustedPrefix - : adjustedPrefix + (allowDots ? '.' + encodedKey : '[' + encodedKey + ']'); - - sideChannel.set(object, step); - var valueSideChannel = getSideChannel(); - valueSideChannel.set(sentinel, sideChannel); - pushToArray(values, stringify( - value, - keyPrefix, - generateArrayPrefix, - commaRoundTrip, - allowEmptyArrays, - strictNullHandling, - skipNulls, - encodeDotInKeys, - generateArrayPrefix === 'comma' && encodeValuesOnly && isArray(obj) ? null : encoder, - filter, - sort, - allowDots, - serializeDate, - format, - formatter, - encodeValuesOnly, - charset, - valueSideChannel - )); - } - - return values; -}; - -var normalizeStringifyOptions = function normalizeStringifyOptions(opts) { - if (!opts) { - return defaults; - } - - if (typeof opts.allowEmptyArrays !== 'undefined' && typeof opts.allowEmptyArrays !== 'boolean') { - throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided'); - } - - if (typeof opts.encodeDotInKeys !== 'undefined' && typeof opts.encodeDotInKeys !== 'boolean') { - throw new TypeError('`encodeDotInKeys` option can only be `true` or `false`, when provided'); - } - - if (opts.encoder !== null && typeof opts.encoder !== 'undefined' && typeof opts.encoder !== 'function') { - throw new TypeError('Encoder has to be a function.'); - } - - var charset = opts.charset || defaults.charset; - if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') { - throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined'); - } - - var format = formats['default']; - if (typeof opts.format !== 'undefined') { - if (!has.call(formats.formatters, opts.format)) { - throw new TypeError('Unknown format option provided.'); - } - format = opts.format; - } - var formatter = formats.formatters[format]; - - var filter = defaults.filter; - if (typeof opts.filter === 'function' || isArray(opts.filter)) { - filter = opts.filter; - } - - var arrayFormat; - if (opts.arrayFormat in arrayPrefixGenerators) { - arrayFormat = opts.arrayFormat; - } else if ('indices' in opts) { - arrayFormat = opts.indices ? 'indices' : 'repeat'; - } else { - arrayFormat = defaults.arrayFormat; - } - - if ('commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') { - throw new TypeError('`commaRoundTrip` must be a boolean, or absent'); - } - - var allowDots = typeof opts.allowDots === 'undefined' ? opts.encodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots; - - return { - addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults.addQueryPrefix, - allowDots: allowDots, - allowEmptyArrays: typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays, - arrayFormat: arrayFormat, - charset: charset, - charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel, - commaRoundTrip: opts.commaRoundTrip, - delimiter: typeof opts.delimiter === 'undefined' ? defaults.delimiter : opts.delimiter, - encode: typeof opts.encode === 'boolean' ? opts.encode : defaults.encode, - encodeDotInKeys: typeof opts.encodeDotInKeys === 'boolean' ? opts.encodeDotInKeys : defaults.encodeDotInKeys, - encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults.encoder, - encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults.encodeValuesOnly, - filter: filter, - format: format, - formatter: formatter, - serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults.serializeDate, - skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults.skipNulls, - sort: typeof opts.sort === 'function' ? opts.sort : null, - strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling - }; -}; - -module.exports = function (object, opts) { - var obj = object; - var options = normalizeStringifyOptions(opts); - - var objKeys; - var filter; - - if (typeof options.filter === 'function') { - filter = options.filter; - obj = filter('', obj); - } else if (isArray(options.filter)) { - filter = options.filter; - objKeys = filter; - } - - var keys = []; - - if (typeof obj !== 'object' || obj === null) { - return ''; - } - - var generateArrayPrefix = arrayPrefixGenerators[options.arrayFormat]; - var commaRoundTrip = generateArrayPrefix === 'comma' && options.commaRoundTrip; - - if (!objKeys) { - objKeys = Object.keys(obj); - } - - if (options.sort) { - objKeys.sort(options.sort); - } - - var sideChannel = getSideChannel(); - for (var i = 0; i < objKeys.length; ++i) { - var key = objKeys[i]; - - if (options.skipNulls && obj[key] === null) { - continue; - } - pushToArray(keys, stringify( - obj[key], - key, - generateArrayPrefix, - commaRoundTrip, - options.allowEmptyArrays, - options.strictNullHandling, - options.skipNulls, - options.encodeDotInKeys, - options.encode ? options.encoder : null, - options.filter, - options.sort, - options.allowDots, - options.serializeDate, - options.format, - options.formatter, - options.encodeValuesOnly, - options.charset, - sideChannel - )); - } - - var joined = keys.join(options.delimiter); - var prefix = options.addQueryPrefix === true ? '?' : ''; - - if (options.charsetSentinel) { - if (options.charset === 'iso-8859-1') { - // encodeURIComponent('✓'), the "numeric entity" representation of a checkmark - prefix += 'utf8=%26%2310003%3B&'; - } else { - // encodeURIComponent('✓') - prefix += 'utf8=%E2%9C%93&'; - } - } - - return joined.length > 0 ? prefix + joined : ''; -}; diff --git a/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/lib/utils.js b/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/lib/utils.js deleted file mode 100644 index 7c860f1b160a..000000000000 --- a/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/lib/utils.js +++ /dev/null @@ -1,265 +0,0 @@ -'use strict'; - -var formats = require('./formats'); - -var has = Object.prototype.hasOwnProperty; -var isArray = Array.isArray; - -var hexTable = (function () { - var array = []; - for (var i = 0; i < 256; ++i) { - array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase()); - } - - return array; -}()); - -var compactQueue = function compactQueue(queue) { - while (queue.length > 1) { - var item = queue.pop(); - var obj = item.obj[item.prop]; - - if (isArray(obj)) { - var compacted = []; - - for (var j = 0; j < obj.length; ++j) { - if (typeof obj[j] !== 'undefined') { - compacted.push(obj[j]); - } - } - - item.obj[item.prop] = compacted; - } - } -}; - -var arrayToObject = function arrayToObject(source, options) { - var obj = options && options.plainObjects ? Object.create(null) : {}; - for (var i = 0; i < source.length; ++i) { - if (typeof source[i] !== 'undefined') { - obj[i] = source[i]; - } - } - - return obj; -}; - -var merge = function merge(target, source, options) { - /* eslint no-param-reassign: 0 */ - if (!source) { - return target; - } - - if (typeof source !== 'object') { - if (isArray(target)) { - target.push(source); - } else if (target && typeof target === 'object') { - if ((options && (options.plainObjects || options.allowPrototypes)) || !has.call(Object.prototype, source)) { - target[source] = true; - } - } else { - return [target, source]; - } - - return target; - } - - if (!target || typeof target !== 'object') { - return [target].concat(source); - } - - var mergeTarget = target; - if (isArray(target) && !isArray(source)) { - mergeTarget = arrayToObject(target, options); - } - - if (isArray(target) && isArray(source)) { - source.forEach(function (item, i) { - if (has.call(target, i)) { - var targetItem = target[i]; - if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') { - target[i] = merge(targetItem, item, options); - } else { - target.push(item); - } - } else { - target[i] = item; - } - }); - return target; - } - - return Object.keys(source).reduce(function (acc, key) { - var value = source[key]; - - if (has.call(acc, key)) { - acc[key] = merge(acc[key], value, options); - } else { - acc[key] = value; - } - return acc; - }, mergeTarget); -}; - -var assign = function assignSingleSource(target, source) { - return Object.keys(source).reduce(function (acc, key) { - acc[key] = source[key]; - return acc; - }, target); -}; - -var decode = function (str, decoder, charset) { - var strWithoutPlus = str.replace(/\+/g, ' '); - if (charset === 'iso-8859-1') { - // unescape never throws, no try...catch needed: - return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape); - } - // utf-8 - try { - return decodeURIComponent(strWithoutPlus); - } catch (e) { - return strWithoutPlus; - } -}; - -var limit = 1024; - -/* eslint operator-linebreak: [2, "before"] */ - -var encode = function encode(str, defaultEncoder, charset, kind, format) { - // This code was originally written by Brian White (mscdex) for the io.js core querystring library. - // It has been adapted here for stricter adherence to RFC 3986 - if (str.length === 0) { - return str; - } - - var string = str; - if (typeof str === 'symbol') { - string = Symbol.prototype.toString.call(str); - } else if (typeof str !== 'string') { - string = String(str); - } - - if (charset === 'iso-8859-1') { - return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) { - return '%26%23' + parseInt($0.slice(2), 16) + '%3B'; - }); - } - - var out = ''; - for (var j = 0; j < string.length; j += limit) { - var segment = string.length >= limit ? string.slice(j, j + limit) : string; - var arr = []; - - for (var i = 0; i < segment.length; ++i) { - var c = segment.charCodeAt(i); - if ( - c === 0x2D // - - || c === 0x2E // . - || c === 0x5F // _ - || c === 0x7E // ~ - || (c >= 0x30 && c <= 0x39) // 0-9 - || (c >= 0x41 && c <= 0x5A) // a-z - || (c >= 0x61 && c <= 0x7A) // A-Z - || (format === formats.RFC1738 && (c === 0x28 || c === 0x29)) // ( ) - ) { - arr[arr.length] = segment.charAt(i); - continue; - } - - if (c < 0x80) { - arr[arr.length] = hexTable[c]; - continue; - } - - if (c < 0x800) { - arr[arr.length] = hexTable[0xC0 | (c >> 6)] - + hexTable[0x80 | (c & 0x3F)]; - continue; - } - - if (c < 0xD800 || c >= 0xE000) { - arr[arr.length] = hexTable[0xE0 | (c >> 12)] - + hexTable[0x80 | ((c >> 6) & 0x3F)] - + hexTable[0x80 | (c & 0x3F)]; - continue; - } - - i += 1; - c = 0x10000 + (((c & 0x3FF) << 10) | (segment.charCodeAt(i) & 0x3FF)); - - arr[arr.length] = hexTable[0xF0 | (c >> 18)] - + hexTable[0x80 | ((c >> 12) & 0x3F)] - + hexTable[0x80 | ((c >> 6) & 0x3F)] - + hexTable[0x80 | (c & 0x3F)]; - } - - out += arr.join(''); - } - - return out; -}; - -var compact = function compact(value) { - var queue = [{ obj: { o: value }, prop: 'o' }]; - var refs = []; - - for (var i = 0; i < queue.length; ++i) { - var item = queue[i]; - var obj = item.obj[item.prop]; - - var keys = Object.keys(obj); - for (var j = 0; j < keys.length; ++j) { - var key = keys[j]; - var val = obj[key]; - if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) { - queue.push({ obj: obj, prop: key }); - refs.push(val); - } - } - } - - compactQueue(queue); - - return value; -}; - -var isRegExp = function isRegExp(obj) { - return Object.prototype.toString.call(obj) === '[object RegExp]'; -}; - -var isBuffer = function isBuffer(obj) { - if (!obj || typeof obj !== 'object') { - return false; - } - - return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj)); -}; - -var combine = function combine(a, b) { - return [].concat(a, b); -}; - -var maybeMap = function maybeMap(val, fn) { - if (isArray(val)) { - var mapped = []; - for (var i = 0; i < val.length; i += 1) { - mapped.push(fn(val[i])); - } - return mapped; - } - return fn(val); -}; - -module.exports = { - arrayToObject: arrayToObject, - assign: assign, - combine: combine, - compact: compact, - decode: decode, - encode: encode, - isBuffer: isBuffer, - isRegExp: isRegExp, - maybeMap: maybeMap, - merge: merge -}; diff --git a/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/package.json b/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/package.json deleted file mode 100644 index 6dae052173fd..000000000000 --- a/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/package.json +++ /dev/null @@ -1,91 +0,0 @@ -{ - "name": "qs", - "description": "A querystring parser that supports nesting and arrays, with a depth limit", - "homepage": "https://github.com/ljharb/qs", - "version": "6.13.0", - "repository": { - "type": "git", - "url": "https://github.com/ljharb/qs.git" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - }, - "main": "lib/index.js", - "sideEffects": false, - "contributors": [ - { - "name": "Jordan Harband", - "email": "ljharb@gmail.com", - "url": "http://ljharb.codes" - } - ], - "keywords": [ - "querystring", - "qs", - "query", - "url", - "parse", - "stringify" - ], - "engines": { - "node": ">=0.6" - }, - "dependencies": { - "side-channel": "^1.0.6" - }, - "devDependencies": { - "@browserify/envify": "^6.0.0", - "@browserify/uglifyify": "^6.0.0", - "@ljharb/eslint-config": "^21.1.1", - "browserify": "^16.5.2", - "bundle-collapser": "^1.4.0", - "common-shakeify": "~1.0.0", - "eclint": "^2.8.1", - "es-value-fixtures": "^1.4.2", - "eslint": "=8.8.0", - "evalmd": "^0.0.19", - "for-each": "^0.3.3", - "glob": "=10.3.7", - "has-override-mistake": "^1.0.1", - "has-property-descriptors": "^1.0.2", - "has-symbols": "^1.0.3", - "iconv-lite": "^0.5.1", - "in-publish": "^2.0.1", - "jackspeak": "=2.1.1", - "mkdirp": "^0.5.5", - "mock-property": "^1.0.3", - "module-deps": "^6.2.3", - "npmignore": "^0.3.1", - "nyc": "^10.3.2", - "object-inspect": "^1.13.2", - "qs-iconv": "^1.0.4", - "safe-publish-latest": "^2.0.0", - "safer-buffer": "^2.1.2", - "tape": "^5.8.1", - "unassertify": "^3.0.1" - }, - "scripts": { - "prepack": "npmignore --auto --commentLines=autogenerated && npm run dist", - "prepublishOnly": "safe-publish-latest", - "prepublish": "not-in-publish || npm run prepublishOnly", - "pretest": "npm run --silent readme && npm run --silent lint", - "test": "npm run tests-only", - "tests-only": "nyc tape 'test/**/*.js'", - "posttest": "npx npm@'>=10.2' audit --production", - "readme": "evalmd README.md", - "postlint": "eclint check $(git ls-files | xargs find 2> /dev/null | grep -vE 'node_modules|\\.git' | grep -v dist/)", - "lint": "eslint --ext=js,mjs .", - "dist": "mkdirp dist && browserify --standalone Qs -g unassertify -g @browserify/envify -g [@browserify/uglifyify --mangle.keep_fnames --compress.keep_fnames --format.indent_level=1 --compress.arrows=false --compress.passes=4 --compress.typeofs=false] -p common-shakeify -p bundle-collapser/plugin lib/index.js > dist/qs.js" - }, - "license": "BSD-3-Clause", - "publishConfig": { - "ignore": [ - "!dist/*", - "bower.json", - "component.json", - ".github/workflows", - "logos", - "tea.yaml" - ] - } -} diff --git a/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/test/parse.js b/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/test/parse.js deleted file mode 100644 index 8a2f487c8d47..000000000000 --- a/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/test/parse.js +++ /dev/null @@ -1,1170 +0,0 @@ -'use strict'; - -var test = require('tape'); -var hasPropertyDescriptors = require('has-property-descriptors')(); -var iconv = require('iconv-lite'); -var mockProperty = require('mock-property'); -var hasOverrideMistake = require('has-override-mistake')(); -var SaferBuffer = require('safer-buffer').Buffer; -var v = require('es-value-fixtures'); -var inspect = require('object-inspect'); -var emptyTestCases = require('./empty-keys-cases').emptyTestCases; - -var qs = require('../'); -var utils = require('../lib/utils'); - -test('parse()', function (t) { - t.test('parses a simple string', function (st) { - st.deepEqual(qs.parse('0=foo'), { 0: 'foo' }); - st.deepEqual(qs.parse('foo=c++'), { foo: 'c ' }); - st.deepEqual(qs.parse('a[>=]=23'), { a: { '>=': '23' } }); - st.deepEqual(qs.parse('a[<=>]==23'), { a: { '<=>': '=23' } }); - st.deepEqual(qs.parse('a[==]=23'), { a: { '==': '23' } }); - st.deepEqual(qs.parse('foo', { strictNullHandling: true }), { foo: null }); - st.deepEqual(qs.parse('foo'), { foo: '' }); - st.deepEqual(qs.parse('foo='), { foo: '' }); - st.deepEqual(qs.parse('foo=bar'), { foo: 'bar' }); - st.deepEqual(qs.parse(' foo = bar = baz '), { ' foo ': ' bar = baz ' }); - st.deepEqual(qs.parse('foo=bar=baz'), { foo: 'bar=baz' }); - st.deepEqual(qs.parse('foo=bar&bar=baz'), { foo: 'bar', bar: 'baz' }); - st.deepEqual(qs.parse('foo2=bar2&baz2='), { foo2: 'bar2', baz2: '' }); - st.deepEqual(qs.parse('foo=bar&baz', { strictNullHandling: true }), { foo: 'bar', baz: null }); - st.deepEqual(qs.parse('foo=bar&baz'), { foo: 'bar', baz: '' }); - st.deepEqual(qs.parse('cht=p3&chd=t:60,40&chs=250x100&chl=Hello|World'), { - cht: 'p3', - chd: 't:60,40', - chs: '250x100', - chl: 'Hello|World' - }); - st.end(); - }); - - t.test('comma: false', function (st) { - st.deepEqual(qs.parse('a[]=b&a[]=c'), { a: ['b', 'c'] }); - st.deepEqual(qs.parse('a[0]=b&a[1]=c'), { a: ['b', 'c'] }); - st.deepEqual(qs.parse('a=b,c'), { a: 'b,c' }); - st.deepEqual(qs.parse('a=b&a=c'), { a: ['b', 'c'] }); - st.end(); - }); - - t.test('comma: true', function (st) { - st.deepEqual(qs.parse('a[]=b&a[]=c', { comma: true }), { a: ['b', 'c'] }); - st.deepEqual(qs.parse('a[0]=b&a[1]=c', { comma: true }), { a: ['b', 'c'] }); - st.deepEqual(qs.parse('a=b,c', { comma: true }), { a: ['b', 'c'] }); - st.deepEqual(qs.parse('a=b&a=c', { comma: true }), { a: ['b', 'c'] }); - st.end(); - }); - - t.test('allows enabling dot notation', function (st) { - st.deepEqual(qs.parse('a.b=c'), { 'a.b': 'c' }); - st.deepEqual(qs.parse('a.b=c', { allowDots: true }), { a: { b: 'c' } }); - - st.end(); - }); - - t.test('decode dot keys correctly', function (st) { - st.deepEqual( - qs.parse('name%252Eobj.first=John&name%252Eobj.last=Doe', { allowDots: false, decodeDotInKeys: false }), - { 'name%2Eobj.first': 'John', 'name%2Eobj.last': 'Doe' }, - 'with allowDots false and decodeDotInKeys false' - ); - st.deepEqual( - qs.parse('name.obj.first=John&name.obj.last=Doe', { allowDots: true, decodeDotInKeys: false }), - { name: { obj: { first: 'John', last: 'Doe' } } }, - 'with allowDots false and decodeDotInKeys false' - ); - st.deepEqual( - qs.parse('name%252Eobj.first=John&name%252Eobj.last=Doe', { allowDots: true, decodeDotInKeys: false }), - { 'name%2Eobj': { first: 'John', last: 'Doe' } }, - 'with allowDots true and decodeDotInKeys false' - ); - st.deepEqual( - qs.parse('name%252Eobj.first=John&name%252Eobj.last=Doe', { allowDots: true, decodeDotInKeys: true }), - { 'name.obj': { first: 'John', last: 'Doe' } }, - 'with allowDots true and decodeDotInKeys true' - ); - - st.deepEqual( - qs.parse( - 'name%252Eobj%252Esubobject.first%252Egodly%252Ename=John&name%252Eobj%252Esubobject.last=Doe', - { allowDots: false, decodeDotInKeys: false } - ), - { 'name%2Eobj%2Esubobject.first%2Egodly%2Ename': 'John', 'name%2Eobj%2Esubobject.last': 'Doe' }, - 'with allowDots false and decodeDotInKeys false' - ); - st.deepEqual( - qs.parse( - 'name.obj.subobject.first.godly.name=John&name.obj.subobject.last=Doe', - { allowDots: true, decodeDotInKeys: false } - ), - { name: { obj: { subobject: { first: { godly: { name: 'John' } }, last: 'Doe' } } } }, - 'with allowDots true and decodeDotInKeys false' - ); - st.deepEqual( - qs.parse( - 'name%252Eobj%252Esubobject.first%252Egodly%252Ename=John&name%252Eobj%252Esubobject.last=Doe', - { allowDots: true, decodeDotInKeys: true } - ), - { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, - 'with allowDots true and decodeDotInKeys true' - ); - st.deepEqual( - qs.parse('name%252Eobj.first=John&name%252Eobj.last=Doe'), - { 'name%2Eobj.first': 'John', 'name%2Eobj.last': 'Doe' }, - 'with allowDots and decodeDotInKeys undefined' - ); - - st.end(); - }); - - t.test('should decode dot in key of object, and allow enabling dot notation when decodeDotInKeys is set to true and allowDots is undefined', function (st) { - st.deepEqual( - qs.parse( - 'name%252Eobj%252Esubobject.first%252Egodly%252Ename=John&name%252Eobj%252Esubobject.last=Doe', - { decodeDotInKeys: true } - ), - { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, - 'with allowDots undefined and decodeDotInKeys true' - ); - - st.end(); - }); - - t.test('should throw when decodeDotInKeys is not of type boolean', function (st) { - st['throws']( - function () { qs.parse('foo[]&bar=baz', { decodeDotInKeys: 'foobar' }); }, - TypeError - ); - - st['throws']( - function () { qs.parse('foo[]&bar=baz', { decodeDotInKeys: 0 }); }, - TypeError - ); - st['throws']( - function () { qs.parse('foo[]&bar=baz', { decodeDotInKeys: NaN }); }, - TypeError - ); - - st['throws']( - function () { qs.parse('foo[]&bar=baz', { decodeDotInKeys: null }); }, - TypeError - ); - - st.end(); - }); - - t.test('allows empty arrays in obj values', function (st) { - st.deepEqual(qs.parse('foo[]&bar=baz', { allowEmptyArrays: true }), { foo: [], bar: 'baz' }); - st.deepEqual(qs.parse('foo[]&bar=baz', { allowEmptyArrays: false }), { foo: [''], bar: 'baz' }); - - st.end(); - }); - - t.test('should throw when allowEmptyArrays is not of type boolean', function (st) { - st['throws']( - function () { qs.parse('foo[]&bar=baz', { allowEmptyArrays: 'foobar' }); }, - TypeError - ); - - st['throws']( - function () { qs.parse('foo[]&bar=baz', { allowEmptyArrays: 0 }); }, - TypeError - ); - st['throws']( - function () { qs.parse('foo[]&bar=baz', { allowEmptyArrays: NaN }); }, - TypeError - ); - - st['throws']( - function () { qs.parse('foo[]&bar=baz', { allowEmptyArrays: null }); }, - TypeError - ); - - st.end(); - }); - - t.test('allowEmptyArrays + strictNullHandling', function (st) { - st.deepEqual( - qs.parse('testEmptyArray[]', { strictNullHandling: true, allowEmptyArrays: true }), - { testEmptyArray: [] } - ); - - st.end(); - }); - - t.deepEqual(qs.parse('a[b]=c'), { a: { b: 'c' } }, 'parses a single nested string'); - t.deepEqual(qs.parse('a[b][c]=d'), { a: { b: { c: 'd' } } }, 'parses a double nested string'); - t.deepEqual( - qs.parse('a[b][c][d][e][f][g][h]=i'), - { a: { b: { c: { d: { e: { f: { '[g][h]': 'i' } } } } } } }, - 'defaults to a depth of 5' - ); - - t.test('only parses one level when depth = 1', function (st) { - st.deepEqual(qs.parse('a[b][c]=d', { depth: 1 }), { a: { b: { '[c]': 'd' } } }); - st.deepEqual(qs.parse('a[b][c][d]=e', { depth: 1 }), { a: { b: { '[c][d]': 'e' } } }); - st.end(); - }); - - t.test('uses original key when depth = 0', function (st) { - st.deepEqual(qs.parse('a[0]=b&a[1]=c', { depth: 0 }), { 'a[0]': 'b', 'a[1]': 'c' }); - st.deepEqual(qs.parse('a[0][0]=b&a[0][1]=c&a[1]=d&e=2', { depth: 0 }), { 'a[0][0]': 'b', 'a[0][1]': 'c', 'a[1]': 'd', e: '2' }); - st.end(); - }); - - t.test('uses original key when depth = false', function (st) { - st.deepEqual(qs.parse('a[0]=b&a[1]=c', { depth: false }), { 'a[0]': 'b', 'a[1]': 'c' }); - st.deepEqual(qs.parse('a[0][0]=b&a[0][1]=c&a[1]=d&e=2', { depth: false }), { 'a[0][0]': 'b', 'a[0][1]': 'c', 'a[1]': 'd', e: '2' }); - st.end(); - }); - - t.deepEqual(qs.parse('a=b&a=c'), { a: ['b', 'c'] }, 'parses a simple array'); - - t.test('parses an explicit array', function (st) { - st.deepEqual(qs.parse('a[]=b'), { a: ['b'] }); - st.deepEqual(qs.parse('a[]=b&a[]=c'), { a: ['b', 'c'] }); - st.deepEqual(qs.parse('a[]=b&a[]=c&a[]=d'), { a: ['b', 'c', 'd'] }); - st.end(); - }); - - t.test('parses a mix of simple and explicit arrays', function (st) { - st.deepEqual(qs.parse('a=b&a[]=c'), { a: ['b', 'c'] }); - st.deepEqual(qs.parse('a[]=b&a=c'), { a: ['b', 'c'] }); - st.deepEqual(qs.parse('a[0]=b&a=c'), { a: ['b', 'c'] }); - st.deepEqual(qs.parse('a=b&a[0]=c'), { a: ['b', 'c'] }); - - st.deepEqual(qs.parse('a[1]=b&a=c', { arrayLimit: 20 }), { a: ['b', 'c'] }); - st.deepEqual(qs.parse('a[]=b&a=c', { arrayLimit: 0 }), { a: ['b', 'c'] }); - st.deepEqual(qs.parse('a[]=b&a=c'), { a: ['b', 'c'] }); - - st.deepEqual(qs.parse('a=b&a[1]=c', { arrayLimit: 20 }), { a: ['b', 'c'] }); - st.deepEqual(qs.parse('a=b&a[]=c', { arrayLimit: 0 }), { a: ['b', 'c'] }); - st.deepEqual(qs.parse('a=b&a[]=c'), { a: ['b', 'c'] }); - - st.end(); - }); - - t.test('parses a nested array', function (st) { - st.deepEqual(qs.parse('a[b][]=c&a[b][]=d'), { a: { b: ['c', 'd'] } }); - st.deepEqual(qs.parse('a[>=]=25'), { a: { '>=': '25' } }); - st.end(); - }); - - t.test('allows to specify array indices', function (st) { - st.deepEqual(qs.parse('a[1]=c&a[0]=b&a[2]=d'), { a: ['b', 'c', 'd'] }); - st.deepEqual(qs.parse('a[1]=c&a[0]=b'), { a: ['b', 'c'] }); - st.deepEqual(qs.parse('a[1]=c', { arrayLimit: 20 }), { a: ['c'] }); - st.deepEqual(qs.parse('a[1]=c', { arrayLimit: 0 }), { a: { 1: 'c' } }); - st.deepEqual(qs.parse('a[1]=c'), { a: ['c'] }); - st.end(); - }); - - t.test('limits specific array indices to arrayLimit', function (st) { - st.deepEqual(qs.parse('a[20]=a', { arrayLimit: 20 }), { a: ['a'] }); - st.deepEqual(qs.parse('a[21]=a', { arrayLimit: 20 }), { a: { 21: 'a' } }); - - st.deepEqual(qs.parse('a[20]=a'), { a: ['a'] }); - st.deepEqual(qs.parse('a[21]=a'), { a: { 21: 'a' } }); - st.end(); - }); - - t.deepEqual(qs.parse('a[12b]=c'), { a: { '12b': 'c' } }, 'supports keys that begin with a number'); - - t.test('supports encoded = signs', function (st) { - st.deepEqual(qs.parse('he%3Dllo=th%3Dere'), { 'he=llo': 'th=ere' }); - st.end(); - }); - - t.test('is ok with url encoded strings', function (st) { - st.deepEqual(qs.parse('a[b%20c]=d'), { a: { 'b c': 'd' } }); - st.deepEqual(qs.parse('a[b]=c%20d'), { a: { b: 'c d' } }); - st.end(); - }); - - t.test('allows brackets in the value', function (st) { - st.deepEqual(qs.parse('pets=["tobi"]'), { pets: '["tobi"]' }); - st.deepEqual(qs.parse('operators=[">=", "<="]'), { operators: '[">=", "<="]' }); - st.end(); - }); - - t.test('allows empty values', function (st) { - st.deepEqual(qs.parse(''), {}); - st.deepEqual(qs.parse(null), {}); - st.deepEqual(qs.parse(undefined), {}); - st.end(); - }); - - t.test('transforms arrays to objects', function (st) { - st.deepEqual(qs.parse('foo[0]=bar&foo[bad]=baz'), { foo: { 0: 'bar', bad: 'baz' } }); - st.deepEqual(qs.parse('foo[bad]=baz&foo[0]=bar'), { foo: { bad: 'baz', 0: 'bar' } }); - st.deepEqual(qs.parse('foo[bad]=baz&foo[]=bar'), { foo: { bad: 'baz', 0: 'bar' } }); - st.deepEqual(qs.parse('foo[]=bar&foo[bad]=baz'), { foo: { 0: 'bar', bad: 'baz' } }); - st.deepEqual(qs.parse('foo[bad]=baz&foo[]=bar&foo[]=foo'), { foo: { bad: 'baz', 0: 'bar', 1: 'foo' } }); - st.deepEqual(qs.parse('foo[0][a]=a&foo[0][b]=b&foo[1][a]=aa&foo[1][b]=bb'), { foo: [{ a: 'a', b: 'b' }, { a: 'aa', b: 'bb' }] }); - - st.deepEqual(qs.parse('a[]=b&a[t]=u&a[hasOwnProperty]=c', { allowPrototypes: false }), { a: { 0: 'b', t: 'u' } }); - st.deepEqual(qs.parse('a[]=b&a[t]=u&a[hasOwnProperty]=c', { allowPrototypes: true }), { a: { 0: 'b', t: 'u', hasOwnProperty: 'c' } }); - st.deepEqual(qs.parse('a[]=b&a[hasOwnProperty]=c&a[x]=y', { allowPrototypes: false }), { a: { 0: 'b', x: 'y' } }); - st.deepEqual(qs.parse('a[]=b&a[hasOwnProperty]=c&a[x]=y', { allowPrototypes: true }), { a: { 0: 'b', hasOwnProperty: 'c', x: 'y' } }); - st.end(); - }); - - t.test('transforms arrays to objects (dot notation)', function (st) { - st.deepEqual(qs.parse('foo[0].baz=bar&fool.bad=baz', { allowDots: true }), { foo: [{ baz: 'bar' }], fool: { bad: 'baz' } }); - st.deepEqual(qs.parse('foo[0].baz=bar&fool.bad.boo=baz', { allowDots: true }), { foo: [{ baz: 'bar' }], fool: { bad: { boo: 'baz' } } }); - st.deepEqual(qs.parse('foo[0][0].baz=bar&fool.bad=baz', { allowDots: true }), { foo: [[{ baz: 'bar' }]], fool: { bad: 'baz' } }); - st.deepEqual(qs.parse('foo[0].baz[0]=15&foo[0].bar=2', { allowDots: true }), { foo: [{ baz: ['15'], bar: '2' }] }); - st.deepEqual(qs.parse('foo[0].baz[0]=15&foo[0].baz[1]=16&foo[0].bar=2', { allowDots: true }), { foo: [{ baz: ['15', '16'], bar: '2' }] }); - st.deepEqual(qs.parse('foo.bad=baz&foo[0]=bar', { allowDots: true }), { foo: { bad: 'baz', 0: 'bar' } }); - st.deepEqual(qs.parse('foo.bad=baz&foo[]=bar', { allowDots: true }), { foo: { bad: 'baz', 0: 'bar' } }); - st.deepEqual(qs.parse('foo[]=bar&foo.bad=baz', { allowDots: true }), { foo: { 0: 'bar', bad: 'baz' } }); - st.deepEqual(qs.parse('foo.bad=baz&foo[]=bar&foo[]=foo', { allowDots: true }), { foo: { bad: 'baz', 0: 'bar', 1: 'foo' } }); - st.deepEqual(qs.parse('foo[0].a=a&foo[0].b=b&foo[1].a=aa&foo[1].b=bb', { allowDots: true }), { foo: [{ a: 'a', b: 'b' }, { a: 'aa', b: 'bb' }] }); - st.end(); - }); - - t.test('correctly prunes undefined values when converting an array to an object', function (st) { - st.deepEqual(qs.parse('a[2]=b&a[99999999]=c'), { a: { 2: 'b', 99999999: 'c' } }); - st.end(); - }); - - t.test('supports malformed uri characters', function (st) { - st.deepEqual(qs.parse('{%:%}', { strictNullHandling: true }), { '{%:%}': null }); - st.deepEqual(qs.parse('{%:%}='), { '{%:%}': '' }); - st.deepEqual(qs.parse('foo=%:%}'), { foo: '%:%}' }); - st.end(); - }); - - t.test('doesn\'t produce empty keys', function (st) { - st.deepEqual(qs.parse('_r=1&'), { _r: '1' }); - st.end(); - }); - - t.test('cannot access Object prototype', function (st) { - qs.parse('constructor[prototype][bad]=bad'); - qs.parse('bad[constructor][prototype][bad]=bad'); - st.equal(typeof Object.prototype.bad, 'undefined'); - st.end(); - }); - - t.test('parses arrays of objects', function (st) { - st.deepEqual(qs.parse('a[][b]=c'), { a: [{ b: 'c' }] }); - st.deepEqual(qs.parse('a[0][b]=c'), { a: [{ b: 'c' }] }); - st.end(); - }); - - t.test('allows for empty strings in arrays', function (st) { - st.deepEqual(qs.parse('a[]=b&a[]=&a[]=c'), { a: ['b', '', 'c'] }); - - st.deepEqual( - qs.parse('a[0]=b&a[1]&a[2]=c&a[19]=', { strictNullHandling: true, arrayLimit: 20 }), - { a: ['b', null, 'c', ''] }, - 'with arrayLimit 20 + array indices: null then empty string works' - ); - st.deepEqual( - qs.parse('a[]=b&a[]&a[]=c&a[]=', { strictNullHandling: true, arrayLimit: 0 }), - { a: ['b', null, 'c', ''] }, - 'with arrayLimit 0 + array brackets: null then empty string works' - ); - - st.deepEqual( - qs.parse('a[0]=b&a[1]=&a[2]=c&a[19]', { strictNullHandling: true, arrayLimit: 20 }), - { a: ['b', '', 'c', null] }, - 'with arrayLimit 20 + array indices: empty string then null works' - ); - st.deepEqual( - qs.parse('a[]=b&a[]=&a[]=c&a[]', { strictNullHandling: true, arrayLimit: 0 }), - { a: ['b', '', 'c', null] }, - 'with arrayLimit 0 + array brackets: empty string then null works' - ); - - st.deepEqual( - qs.parse('a[]=&a[]=b&a[]=c'), - { a: ['', 'b', 'c'] }, - 'array brackets: empty strings work' - ); - st.end(); - }); - - t.test('compacts sparse arrays', function (st) { - st.deepEqual(qs.parse('a[10]=1&a[2]=2', { arrayLimit: 20 }), { a: ['2', '1'] }); - st.deepEqual(qs.parse('a[1][b][2][c]=1', { arrayLimit: 20 }), { a: [{ b: [{ c: '1' }] }] }); - st.deepEqual(qs.parse('a[1][2][3][c]=1', { arrayLimit: 20 }), { a: [[[{ c: '1' }]]] }); - st.deepEqual(qs.parse('a[1][2][3][c][1]=1', { arrayLimit: 20 }), { a: [[[{ c: ['1'] }]]] }); - st.end(); - }); - - t.test('parses sparse arrays', function (st) { - /* eslint no-sparse-arrays: 0 */ - st.deepEqual(qs.parse('a[4]=1&a[1]=2', { allowSparse: true }), { a: [, '2', , , '1'] }); - st.deepEqual(qs.parse('a[1][b][2][c]=1', { allowSparse: true }), { a: [, { b: [, , { c: '1' }] }] }); - st.deepEqual(qs.parse('a[1][2][3][c]=1', { allowSparse: true }), { a: [, [, , [, , , { c: '1' }]]] }); - st.deepEqual(qs.parse('a[1][2][3][c][1]=1', { allowSparse: true }), { a: [, [, , [, , , { c: [, '1'] }]]] }); - st.end(); - }); - - t.test('parses semi-parsed strings', function (st) { - st.deepEqual(qs.parse({ 'a[b]': 'c' }), { a: { b: 'c' } }); - st.deepEqual(qs.parse({ 'a[b]': 'c', 'a[d]': 'e' }), { a: { b: 'c', d: 'e' } }); - st.end(); - }); - - t.test('parses buffers correctly', function (st) { - var b = SaferBuffer.from('test'); - st.deepEqual(qs.parse({ a: b }), { a: b }); - st.end(); - }); - - t.test('parses jquery-param strings', function (st) { - // readable = 'filter[0][]=int1&filter[0][]==&filter[0][]=77&filter[]=and&filter[2][]=int2&filter[2][]==&filter[2][]=8' - var encoded = 'filter%5B0%5D%5B%5D=int1&filter%5B0%5D%5B%5D=%3D&filter%5B0%5D%5B%5D=77&filter%5B%5D=and&filter%5B2%5D%5B%5D=int2&filter%5B2%5D%5B%5D=%3D&filter%5B2%5D%5B%5D=8'; - var expected = { filter: [['int1', '=', '77'], 'and', ['int2', '=', '8']] }; - st.deepEqual(qs.parse(encoded), expected); - st.end(); - }); - - t.test('continues parsing when no parent is found', function (st) { - st.deepEqual(qs.parse('[]=&a=b'), { 0: '', a: 'b' }); - st.deepEqual(qs.parse('[]&a=b', { strictNullHandling: true }), { 0: null, a: 'b' }); - st.deepEqual(qs.parse('[foo]=bar'), { foo: 'bar' }); - st.end(); - }); - - t.test('does not error when parsing a very long array', function (st) { - var str = 'a[]=a'; - while (Buffer.byteLength(str) < 128 * 1024) { - str = str + '&' + str; - } - - st.doesNotThrow(function () { - qs.parse(str); - }); - - st.end(); - }); - - t.test('should not throw when a native prototype has an enumerable property', function (st) { - st.intercept(Object.prototype, 'crash', { value: '' }); - st.intercept(Array.prototype, 'crash', { value: '' }); - - st.doesNotThrow(qs.parse.bind(null, 'a=b')); - st.deepEqual(qs.parse('a=b'), { a: 'b' }); - st.doesNotThrow(qs.parse.bind(null, 'a[][b]=c')); - st.deepEqual(qs.parse('a[][b]=c'), { a: [{ b: 'c' }] }); - - st.end(); - }); - - t.test('parses a string with an alternative string delimiter', function (st) { - st.deepEqual(qs.parse('a=b;c=d', { delimiter: ';' }), { a: 'b', c: 'd' }); - st.end(); - }); - - t.test('parses a string with an alternative RegExp delimiter', function (st) { - st.deepEqual(qs.parse('a=b; c=d', { delimiter: /[;,] */ }), { a: 'b', c: 'd' }); - st.end(); - }); - - t.test('does not use non-splittable objects as delimiters', function (st) { - st.deepEqual(qs.parse('a=b&c=d', { delimiter: true }), { a: 'b', c: 'd' }); - st.end(); - }); - - t.test('allows overriding parameter limit', function (st) { - st.deepEqual(qs.parse('a=b&c=d', { parameterLimit: 1 }), { a: 'b' }); - st.end(); - }); - - t.test('allows setting the parameter limit to Infinity', function (st) { - st.deepEqual(qs.parse('a=b&c=d', { parameterLimit: Infinity }), { a: 'b', c: 'd' }); - st.end(); - }); - - t.test('allows overriding array limit', function (st) { - st.deepEqual(qs.parse('a[0]=b', { arrayLimit: -1 }), { a: { 0: 'b' } }); - st.deepEqual(qs.parse('a[0]=b', { arrayLimit: 0 }), { a: ['b'] }); - - st.deepEqual(qs.parse('a[-1]=b', { arrayLimit: -1 }), { a: { '-1': 'b' } }); - st.deepEqual(qs.parse('a[-1]=b', { arrayLimit: 0 }), { a: { '-1': 'b' } }); - - st.deepEqual(qs.parse('a[0]=b&a[1]=c', { arrayLimit: -1 }), { a: { 0: 'b', 1: 'c' } }); - st.deepEqual(qs.parse('a[0]=b&a[1]=c', { arrayLimit: 0 }), { a: { 0: 'b', 1: 'c' } }); - - st.end(); - }); - - t.test('allows disabling array parsing', function (st) { - var indices = qs.parse('a[0]=b&a[1]=c', { parseArrays: false }); - st.deepEqual(indices, { a: { 0: 'b', 1: 'c' } }); - st.equal(Array.isArray(indices.a), false, 'parseArrays:false, indices case is not an array'); - - var emptyBrackets = qs.parse('a[]=b', { parseArrays: false }); - st.deepEqual(emptyBrackets, { a: { 0: 'b' } }); - st.equal(Array.isArray(emptyBrackets.a), false, 'parseArrays:false, empty brackets case is not an array'); - - st.end(); - }); - - t.test('allows for query string prefix', function (st) { - st.deepEqual(qs.parse('?foo=bar', { ignoreQueryPrefix: true }), { foo: 'bar' }); - st.deepEqual(qs.parse('foo=bar', { ignoreQueryPrefix: true }), { foo: 'bar' }); - st.deepEqual(qs.parse('?foo=bar', { ignoreQueryPrefix: false }), { '?foo': 'bar' }); - - st.end(); - }); - - t.test('parses an object', function (st) { - var input = { - 'user[name]': { 'pop[bob]': 3 }, - 'user[email]': null - }; - - var expected = { - user: { - name: { 'pop[bob]': 3 }, - email: null - } - }; - - var result = qs.parse(input); - - st.deepEqual(result, expected); - st.end(); - }); - - t.test('parses string with comma as array divider', function (st) { - st.deepEqual(qs.parse('foo=bar,tee', { comma: true }), { foo: ['bar', 'tee'] }); - st.deepEqual(qs.parse('foo[bar]=coffee,tee', { comma: true }), { foo: { bar: ['coffee', 'tee'] } }); - st.deepEqual(qs.parse('foo=', { comma: true }), { foo: '' }); - st.deepEqual(qs.parse('foo', { comma: true }), { foo: '' }); - st.deepEqual(qs.parse('foo', { comma: true, strictNullHandling: true }), { foo: null }); - - // test cases inversed from from stringify tests - st.deepEqual(qs.parse('a[0]=c'), { a: ['c'] }); - st.deepEqual(qs.parse('a[]=c'), { a: ['c'] }); - st.deepEqual(qs.parse('a[]=c', { comma: true }), { a: ['c'] }); - - st.deepEqual(qs.parse('a[0]=c&a[1]=d'), { a: ['c', 'd'] }); - st.deepEqual(qs.parse('a[]=c&a[]=d'), { a: ['c', 'd'] }); - st.deepEqual(qs.parse('a=c,d', { comma: true }), { a: ['c', 'd'] }); - - st.end(); - }); - - t.test('parses values with comma as array divider', function (st) { - st.deepEqual(qs.parse({ foo: 'bar,tee' }, { comma: false }), { foo: 'bar,tee' }); - st.deepEqual(qs.parse({ foo: 'bar,tee' }, { comma: true }), { foo: ['bar', 'tee'] }); - st.end(); - }); - - t.test('use number decoder, parses string that has one number with comma option enabled', function (st) { - var decoder = function (str, defaultDecoder, charset, type) { - if (!isNaN(Number(str))) { - return parseFloat(str); - } - return defaultDecoder(str, defaultDecoder, charset, type); - }; - - st.deepEqual(qs.parse('foo=1', { comma: true, decoder: decoder }), { foo: 1 }); - st.deepEqual(qs.parse('foo=0', { comma: true, decoder: decoder }), { foo: 0 }); - - st.end(); - }); - - t.test('parses brackets holds array of arrays when having two parts of strings with comma as array divider', function (st) { - st.deepEqual(qs.parse('foo[]=1,2,3&foo[]=4,5,6', { comma: true }), { foo: [['1', '2', '3'], ['4', '5', '6']] }); - st.deepEqual(qs.parse('foo[]=1,2,3&foo[]=', { comma: true }), { foo: [['1', '2', '3'], ''] }); - st.deepEqual(qs.parse('foo[]=1,2,3&foo[]=,', { comma: true }), { foo: [['1', '2', '3'], ['', '']] }); - st.deepEqual(qs.parse('foo[]=1,2,3&foo[]=a', { comma: true }), { foo: [['1', '2', '3'], 'a'] }); - - st.end(); - }); - - t.test('parses url-encoded brackets holds array of arrays when having two parts of strings with comma as array divider', function (st) { - st.deepEqual(qs.parse('foo%5B%5D=1,2,3&foo%5B%5D=4,5,6', { comma: true }), { foo: [['1', '2', '3'], ['4', '5', '6']] }); - st.deepEqual(qs.parse('foo%5B%5D=1,2,3&foo%5B%5D=', { comma: true }), { foo: [['1', '2', '3'], ''] }); - st.deepEqual(qs.parse('foo%5B%5D=1,2,3&foo%5B%5D=,', { comma: true }), { foo: [['1', '2', '3'], ['', '']] }); - st.deepEqual(qs.parse('foo%5B%5D=1,2,3&foo%5B%5D=a', { comma: true }), { foo: [['1', '2', '3'], 'a'] }); - - st.end(); - }); - - t.test('parses comma delimited array while having percent-encoded comma treated as normal text', function (st) { - st.deepEqual(qs.parse('foo=a%2Cb', { comma: true }), { foo: 'a,b' }); - st.deepEqual(qs.parse('foo=a%2C%20b,d', { comma: true }), { foo: ['a, b', 'd'] }); - st.deepEqual(qs.parse('foo=a%2C%20b,c%2C%20d', { comma: true }), { foo: ['a, b', 'c, d'] }); - - st.end(); - }); - - t.test('parses an object in dot notation', function (st) { - var input = { - 'user.name': { 'pop[bob]': 3 }, - 'user.email.': null - }; - - var expected = { - user: { - name: { 'pop[bob]': 3 }, - email: null - } - }; - - var result = qs.parse(input, { allowDots: true }); - - st.deepEqual(result, expected); - st.end(); - }); - - t.test('parses an object and not child values', function (st) { - var input = { - 'user[name]': { 'pop[bob]': { test: 3 } }, - 'user[email]': null - }; - - var expected = { - user: { - name: { 'pop[bob]': { test: 3 } }, - email: null - } - }; - - var result = qs.parse(input); - - st.deepEqual(result, expected); - st.end(); - }); - - t.test('does not blow up when Buffer global is missing', function (st) { - var restore = mockProperty(global, 'Buffer', { 'delete': true }); - - var result = qs.parse('a=b&c=d'); - - restore(); - - st.deepEqual(result, { a: 'b', c: 'd' }); - st.end(); - }); - - t.test('does not crash when parsing circular references', function (st) { - var a = {}; - a.b = a; - - var parsed; - - st.doesNotThrow(function () { - parsed = qs.parse({ 'foo[bar]': 'baz', 'foo[baz]': a }); - }); - - st.equal('foo' in parsed, true, 'parsed has "foo" property'); - st.equal('bar' in parsed.foo, true); - st.equal('baz' in parsed.foo, true); - st.equal(parsed.foo.bar, 'baz'); - st.deepEqual(parsed.foo.baz, a); - st.end(); - }); - - t.test('does not crash when parsing deep objects', function (st) { - var parsed; - var str = 'foo'; - - for (var i = 0; i < 5000; i++) { - str += '[p]'; - } - - str += '=bar'; - - st.doesNotThrow(function () { - parsed = qs.parse(str, { depth: 5000 }); - }); - - st.equal('foo' in parsed, true, 'parsed has "foo" property'); - - var depth = 0; - var ref = parsed.foo; - while ((ref = ref.p)) { - depth += 1; - } - - st.equal(depth, 5000, 'parsed is 5000 properties deep'); - - st.end(); - }); - - t.test('parses null objects correctly', { skip: !Object.create }, function (st) { - var a = Object.create(null); - a.b = 'c'; - - st.deepEqual(qs.parse(a), { b: 'c' }); - var result = qs.parse({ a: a }); - st.equal('a' in result, true, 'result has "a" property'); - st.deepEqual(result.a, a); - st.end(); - }); - - t.test('parses dates correctly', function (st) { - var now = new Date(); - st.deepEqual(qs.parse({ a: now }), { a: now }); - st.end(); - }); - - t.test('parses regular expressions correctly', function (st) { - var re = /^test$/; - st.deepEqual(qs.parse({ a: re }), { a: re }); - st.end(); - }); - - t.test('does not allow overwriting prototype properties', function (st) { - st.deepEqual(qs.parse('a[hasOwnProperty]=b', { allowPrototypes: false }), {}); - st.deepEqual(qs.parse('hasOwnProperty=b', { allowPrototypes: false }), {}); - - st.deepEqual( - qs.parse('toString', { allowPrototypes: false }), - {}, - 'bare "toString" results in {}' - ); - - st.end(); - }); - - t.test('can allow overwriting prototype properties', function (st) { - st.deepEqual(qs.parse('a[hasOwnProperty]=b', { allowPrototypes: true }), { a: { hasOwnProperty: 'b' } }); - st.deepEqual(qs.parse('hasOwnProperty=b', { allowPrototypes: true }), { hasOwnProperty: 'b' }); - - st.deepEqual( - qs.parse('toString', { allowPrototypes: true }), - { toString: '' }, - 'bare "toString" results in { toString: "" }' - ); - - st.end(); - }); - - t.test('does not crash when the global Object prototype is frozen', { skip: !hasPropertyDescriptors || !hasOverrideMistake }, function (st) { - // We can't actually freeze the global Object prototype as that will interfere with other tests, and once an object is frozen, it - // can't be unfrozen. Instead, we add a new non-writable property to simulate this. - st.teardown(mockProperty(Object.prototype, 'frozenProp', { value: 'foo', nonWritable: true, nonEnumerable: true })); - - st['throws']( - function () { - var obj = {}; - obj.frozenProp = 'bar'; - }, - // node < 6 has a different error message - /^TypeError: Cannot assign to read only property 'frozenProp' of (?:object '#'|#)/, - 'regular assignment of an inherited non-writable property throws' - ); - - var parsed; - st.doesNotThrow( - function () { - parsed = qs.parse('frozenProp', { allowPrototypes: false }); - }, - 'parsing a nonwritable Object.prototype property does not throw' - ); - - st.deepEqual(parsed, {}, 'bare "frozenProp" results in {}'); - - st.end(); - }); - - t.test('params starting with a closing bracket', function (st) { - st.deepEqual(qs.parse(']=toString'), { ']': 'toString' }); - st.deepEqual(qs.parse(']]=toString'), { ']]': 'toString' }); - st.deepEqual(qs.parse(']hello]=toString'), { ']hello]': 'toString' }); - st.end(); - }); - - t.test('params starting with a starting bracket', function (st) { - st.deepEqual(qs.parse('[=toString'), { '[': 'toString' }); - st.deepEqual(qs.parse('[[=toString'), { '[[': 'toString' }); - st.deepEqual(qs.parse('[hello[=toString'), { '[hello[': 'toString' }); - st.end(); - }); - - t.test('add keys to objects', function (st) { - st.deepEqual( - qs.parse('a[b]=c&a=d'), - { a: { b: 'c', d: true } }, - 'can add keys to objects' - ); - - st.deepEqual( - qs.parse('a[b]=c&a=toString'), - { a: { b: 'c' } }, - 'can not overwrite prototype' - ); - - st.deepEqual( - qs.parse('a[b]=c&a=toString', { allowPrototypes: true }), - { a: { b: 'c', toString: true } }, - 'can overwrite prototype with allowPrototypes true' - ); - - st.deepEqual( - qs.parse('a[b]=c&a=toString', { plainObjects: true }), - { __proto__: null, a: { __proto__: null, b: 'c', toString: true } }, - 'can overwrite prototype with plainObjects true' - ); - - st.end(); - }); - - t.test('dunder proto is ignored', function (st) { - var payload = 'categories[__proto__]=login&categories[__proto__]&categories[length]=42'; - var result = qs.parse(payload, { allowPrototypes: true }); - - st.deepEqual( - result, - { - categories: { - length: '42' - } - }, - 'silent [[Prototype]] payload' - ); - - var plainResult = qs.parse(payload, { allowPrototypes: true, plainObjects: true }); - - st.deepEqual( - plainResult, - { - __proto__: null, - categories: { - __proto__: null, - length: '42' - } - }, - 'silent [[Prototype]] payload: plain objects' - ); - - var query = qs.parse('categories[__proto__]=cats&categories[__proto__]=dogs&categories[some][json]=toInject', { allowPrototypes: true }); - - st.notOk(Array.isArray(query.categories), 'is not an array'); - st.notOk(query.categories instanceof Array, 'is not instanceof an array'); - st.deepEqual(query.categories, { some: { json: 'toInject' } }); - st.equal(JSON.stringify(query.categories), '{"some":{"json":"toInject"}}', 'stringifies as a non-array'); - - st.deepEqual( - qs.parse('foo[__proto__][hidden]=value&foo[bar]=stuffs', { allowPrototypes: true }), - { - foo: { - bar: 'stuffs' - } - }, - 'hidden values' - ); - - st.deepEqual( - qs.parse('foo[__proto__][hidden]=value&foo[bar]=stuffs', { allowPrototypes: true, plainObjects: true }), - { - __proto__: null, - foo: { - __proto__: null, - bar: 'stuffs' - } - }, - 'hidden values: plain objects' - ); - - st.end(); - }); - - t.test('can return null objects', { skip: !Object.create }, function (st) { - var expected = Object.create(null); - expected.a = Object.create(null); - expected.a.b = 'c'; - expected.a.hasOwnProperty = 'd'; - st.deepEqual(qs.parse('a[b]=c&a[hasOwnProperty]=d', { plainObjects: true }), expected); - st.deepEqual(qs.parse(null, { plainObjects: true }), Object.create(null)); - var expectedArray = Object.create(null); - expectedArray.a = Object.create(null); - expectedArray.a[0] = 'b'; - expectedArray.a.c = 'd'; - st.deepEqual(qs.parse('a[]=b&a[c]=d', { plainObjects: true }), expectedArray); - st.end(); - }); - - t.test('can parse with custom encoding', function (st) { - st.deepEqual(qs.parse('%8c%a7=%91%e5%8d%e3%95%7b', { - decoder: function (str) { - var reg = /%([0-9A-F]{2})/ig; - var result = []; - var parts = reg.exec(str); - while (parts) { - result.push(parseInt(parts[1], 16)); - parts = reg.exec(str); - } - return String(iconv.decode(SaferBuffer.from(result), 'shift_jis')); - } - }), { 県: '大阪府' }); - st.end(); - }); - - t.test('receives the default decoder as a second argument', function (st) { - st.plan(1); - qs.parse('a', { - decoder: function (str, defaultDecoder) { - st.equal(defaultDecoder, utils.decode); - } - }); - st.end(); - }); - - t.test('throws error with wrong decoder', function (st) { - st['throws'](function () { - qs.parse({}, { decoder: 'string' }); - }, new TypeError('Decoder has to be a function.')); - st.end(); - }); - - t.test('does not mutate the options argument', function (st) { - var options = {}; - qs.parse('a[b]=true', options); - st.deepEqual(options, {}); - st.end(); - }); - - t.test('throws if an invalid charset is specified', function (st) { - st['throws'](function () { - qs.parse('a=b', { charset: 'foobar' }); - }, new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined')); - st.end(); - }); - - t.test('parses an iso-8859-1 string if asked to', function (st) { - st.deepEqual(qs.parse('%A2=%BD', { charset: 'iso-8859-1' }), { '¢': '½' }); - st.end(); - }); - - var urlEncodedCheckmarkInUtf8 = '%E2%9C%93'; - var urlEncodedOSlashInUtf8 = '%C3%B8'; - var urlEncodedNumCheckmark = '%26%2310003%3B'; - var urlEncodedNumSmiley = '%26%239786%3B'; - - t.test('prefers an utf-8 charset specified by the utf8 sentinel to a default charset of iso-8859-1', function (st) { - st.deepEqual(qs.parse('utf8=' + urlEncodedCheckmarkInUtf8 + '&' + urlEncodedOSlashInUtf8 + '=' + urlEncodedOSlashInUtf8, { charsetSentinel: true, charset: 'iso-8859-1' }), { ø: 'ø' }); - st.end(); - }); - - t.test('prefers an iso-8859-1 charset specified by the utf8 sentinel to a default charset of utf-8', function (st) { - st.deepEqual(qs.parse('utf8=' + urlEncodedNumCheckmark + '&' + urlEncodedOSlashInUtf8 + '=' + urlEncodedOSlashInUtf8, { charsetSentinel: true, charset: 'utf-8' }), { 'ø': 'ø' }); - st.end(); - }); - - t.test('does not require the utf8 sentinel to be defined before the parameters whose decoding it affects', function (st) { - st.deepEqual(qs.parse('a=' + urlEncodedOSlashInUtf8 + '&utf8=' + urlEncodedNumCheckmark, { charsetSentinel: true, charset: 'utf-8' }), { a: 'ø' }); - st.end(); - }); - - t.test('should ignore an utf8 sentinel with an unknown value', function (st) { - st.deepEqual(qs.parse('utf8=foo&' + urlEncodedOSlashInUtf8 + '=' + urlEncodedOSlashInUtf8, { charsetSentinel: true, charset: 'utf-8' }), { ø: 'ø' }); - st.end(); - }); - - t.test('uses the utf8 sentinel to switch to utf-8 when no default charset is given', function (st) { - st.deepEqual(qs.parse('utf8=' + urlEncodedCheckmarkInUtf8 + '&' + urlEncodedOSlashInUtf8 + '=' + urlEncodedOSlashInUtf8, { charsetSentinel: true }), { ø: 'ø' }); - st.end(); - }); - - t.test('uses the utf8 sentinel to switch to iso-8859-1 when no default charset is given', function (st) { - st.deepEqual(qs.parse('utf8=' + urlEncodedNumCheckmark + '&' + urlEncodedOSlashInUtf8 + '=' + urlEncodedOSlashInUtf8, { charsetSentinel: true }), { 'ø': 'ø' }); - st.end(); - }); - - t.test('interprets numeric entities in iso-8859-1 when `interpretNumericEntities`', function (st) { - st.deepEqual(qs.parse('foo=' + urlEncodedNumSmiley, { charset: 'iso-8859-1', interpretNumericEntities: true }), { foo: '☺' }); - st.end(); - }); - - t.test('handles a custom decoder returning `null`, in the `iso-8859-1` charset, when `interpretNumericEntities`', function (st) { - st.deepEqual(qs.parse('foo=&bar=' + urlEncodedNumSmiley, { - charset: 'iso-8859-1', - decoder: function (str, defaultDecoder, charset) { - return str ? defaultDecoder(str, defaultDecoder, charset) : null; - }, - interpretNumericEntities: true - }), { foo: null, bar: '☺' }); - st.end(); - }); - - t.test('does not interpret numeric entities in iso-8859-1 when `interpretNumericEntities` is absent', function (st) { - st.deepEqual(qs.parse('foo=' + urlEncodedNumSmiley, { charset: 'iso-8859-1' }), { foo: '☺' }); - st.end(); - }); - - t.test('does not interpret numeric entities when the charset is utf-8, even when `interpretNumericEntities`', function (st) { - st.deepEqual(qs.parse('foo=' + urlEncodedNumSmiley, { charset: 'utf-8', interpretNumericEntities: true }), { foo: '☺' }); - st.end(); - }); - - t.test('does not interpret %uXXXX syntax in iso-8859-1 mode', function (st) { - st.deepEqual(qs.parse('%u263A=%u263A', { charset: 'iso-8859-1' }), { '%u263A': '%u263A' }); - st.end(); - }); - - t.test('allows for decoding keys and values differently', function (st) { - var decoder = function (str, defaultDecoder, charset, type) { - if (type === 'key') { - return defaultDecoder(str, defaultDecoder, charset, type).toLowerCase(); - } - if (type === 'value') { - return defaultDecoder(str, defaultDecoder, charset, type).toUpperCase(); - } - throw 'this should never happen! type: ' + type; - }; - - st.deepEqual(qs.parse('KeY=vAlUe', { decoder: decoder }), { key: 'VALUE' }); - st.end(); - }); - - t.end(); -}); - -test('parses empty keys', function (t) { - emptyTestCases.forEach(function (testCase) { - t.test('skips empty string key with ' + testCase.input, function (st) { - st.deepEqual(qs.parse(testCase.input), testCase.noEmptyKeys); - - st.end(); - }); - }); -}); - -test('`duplicates` option', function (t) { - v.nonStrings.concat('not a valid option').forEach(function (invalidOption) { - if (typeof invalidOption !== 'undefined') { - t['throws']( - function () { qs.parse('', { duplicates: invalidOption }); }, - TypeError, - 'throws on invalid option: ' + inspect(invalidOption) - ); - } - }); - - t.deepEqual( - qs.parse('foo=bar&foo=baz'), - { foo: ['bar', 'baz'] }, - 'duplicates: default, combine' - ); - - t.deepEqual( - qs.parse('foo=bar&foo=baz', { duplicates: 'combine' }), - { foo: ['bar', 'baz'] }, - 'duplicates: combine' - ); - - t.deepEqual( - qs.parse('foo=bar&foo=baz', { duplicates: 'first' }), - { foo: 'bar' }, - 'duplicates: first' - ); - - t.deepEqual( - qs.parse('foo=bar&foo=baz', { duplicates: 'last' }), - { foo: 'baz' }, - 'duplicates: last' - ); - - t.end(); -}); - -test('qs strictDepth option - throw cases', function (t) { - t.test('throws an exception when depth exceeds the limit with strictDepth: true', function (st) { - st['throws']( - function () { - qs.parse('a[b][c][d][e][f][g][h][i]=j', { depth: 1, strictDepth: true }); - }, - RangeError, - 'Should throw RangeError' - ); - st.end(); - }); - - t.test('throws an exception for multiple nested arrays with strictDepth: true', function (st) { - st['throws']( - function () { - qs.parse('a[0][1][2][3][4]=b', { depth: 3, strictDepth: true }); - }, - RangeError, - 'Should throw RangeError' - ); - st.end(); - }); - - t.test('throws an exception for nested objects and arrays with strictDepth: true', function (st) { - st['throws']( - function () { - qs.parse('a[b][c][0][d][e]=f', { depth: 3, strictDepth: true }); - }, - RangeError, - 'Should throw RangeError' - ); - st.end(); - }); - - t.test('throws an exception for different types of values with strictDepth: true', function (st) { - st['throws']( - function () { - qs.parse('a[b][c][d][e]=true&a[b][c][d][f]=42', { depth: 3, strictDepth: true }); - }, - RangeError, - 'Should throw RangeError' - ); - st.end(); - }); - -}); - -test('qs strictDepth option - non-throw cases', function (t) { - t.test('when depth is 0 and strictDepth true, do not throw', function (st) { - st.doesNotThrow( - function () { - qs.parse('a[b][c][d][e]=true&a[b][c][d][f]=42', { depth: 0, strictDepth: true }); - }, - RangeError, - 'Should not throw RangeError' - ); - st.end(); - }); - - t.test('parses successfully when depth is within the limit with strictDepth: true', function (st) { - st.doesNotThrow( - function () { - var result = qs.parse('a[b]=c', { depth: 1, strictDepth: true }); - st.deepEqual(result, { a: { b: 'c' } }, 'Should parse correctly'); - } - ); - st.end(); - }); - - t.test('does not throw an exception when depth exceeds the limit with strictDepth: false', function (st) { - st.doesNotThrow( - function () { - var result = qs.parse('a[b][c][d][e][f][g][h][i]=j', { depth: 1 }); - st.deepEqual(result, { a: { b: { '[c][d][e][f][g][h][i]': 'j' } } }, 'Should parse with depth limit'); - } - ); - st.end(); - }); - - t.test('parses successfully when depth is within the limit with strictDepth: false', function (st) { - st.doesNotThrow( - function () { - var result = qs.parse('a[b]=c', { depth: 1 }); - st.deepEqual(result, { a: { b: 'c' } }, 'Should parse correctly'); - } - ); - st.end(); - }); - - t.test('does not throw when depth is exactly at the limit with strictDepth: true', function (st) { - st.doesNotThrow( - function () { - var result = qs.parse('a[b][c]=d', { depth: 2, strictDepth: true }); - st.deepEqual(result, { a: { b: { c: 'd' } } }, 'Should parse correctly'); - } - ); - st.end(); - }); -}); diff --git a/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/test/stringify.js b/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/test/stringify.js deleted file mode 100644 index 12b1c71d6dc3..000000000000 --- a/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/test/stringify.js +++ /dev/null @@ -1,1298 +0,0 @@ -'use strict'; - -var test = require('tape'); -var qs = require('../'); -var utils = require('../lib/utils'); -var iconv = require('iconv-lite'); -var SaferBuffer = require('safer-buffer').Buffer; -var hasSymbols = require('has-symbols'); -var mockProperty = require('mock-property'); -var emptyTestCases = require('./empty-keys-cases').emptyTestCases; -var hasBigInt = typeof BigInt === 'function'; - -test('stringify()', function (t) { - t.test('stringifies a querystring object', function (st) { - st.equal(qs.stringify({ a: 'b' }), 'a=b'); - st.equal(qs.stringify({ a: 1 }), 'a=1'); - st.equal(qs.stringify({ a: 1, b: 2 }), 'a=1&b=2'); - st.equal(qs.stringify({ a: 'A_Z' }), 'a=A_Z'); - st.equal(qs.stringify({ a: '€' }), 'a=%E2%82%AC'); - st.equal(qs.stringify({ a: '' }), 'a=%EE%80%80'); - st.equal(qs.stringify({ a: 'א' }), 'a=%D7%90'); - st.equal(qs.stringify({ a: '𐐷' }), 'a=%F0%90%90%B7'); - st.end(); - }); - - t.test('stringifies falsy values', function (st) { - st.equal(qs.stringify(undefined), ''); - st.equal(qs.stringify(null), ''); - st.equal(qs.stringify(null, { strictNullHandling: true }), ''); - st.equal(qs.stringify(false), ''); - st.equal(qs.stringify(0), ''); - st.end(); - }); - - t.test('stringifies symbols', { skip: !hasSymbols() }, function (st) { - st.equal(qs.stringify(Symbol.iterator), ''); - st.equal(qs.stringify([Symbol.iterator]), '0=Symbol%28Symbol.iterator%29'); - st.equal(qs.stringify({ a: Symbol.iterator }), 'a=Symbol%28Symbol.iterator%29'); - st.equal( - qs.stringify({ a: [Symbol.iterator] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), - 'a[]=Symbol%28Symbol.iterator%29' - ); - st.end(); - }); - - t.test('stringifies bigints', { skip: !hasBigInt }, function (st) { - var three = BigInt(3); - var encodeWithN = function (value, defaultEncoder, charset) { - var result = defaultEncoder(value, defaultEncoder, charset); - return typeof value === 'bigint' ? result + 'n' : result; - }; - st.equal(qs.stringify(three), ''); - st.equal(qs.stringify([three]), '0=3'); - st.equal(qs.stringify([three], { encoder: encodeWithN }), '0=3n'); - st.equal(qs.stringify({ a: three }), 'a=3'); - st.equal(qs.stringify({ a: three }, { encoder: encodeWithN }), 'a=3n'); - st.equal( - qs.stringify({ a: [three] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), - 'a[]=3' - ); - st.equal( - qs.stringify({ a: [three] }, { encodeValuesOnly: true, encoder: encodeWithN, arrayFormat: 'brackets' }), - 'a[]=3n' - ); - st.end(); - }); - - t.test('encodes dot in key of object when encodeDotInKeys and allowDots is provided', function (st) { - st.equal( - qs.stringify( - { 'name.obj': { first: 'John', last: 'Doe' } }, - { allowDots: false, encodeDotInKeys: false } - ), - 'name.obj%5Bfirst%5D=John&name.obj%5Blast%5D=Doe', - 'with allowDots false and encodeDotInKeys false' - ); - st.equal( - qs.stringify( - { 'name.obj': { first: 'John', last: 'Doe' } }, - { allowDots: true, encodeDotInKeys: false } - ), - 'name.obj.first=John&name.obj.last=Doe', - 'with allowDots true and encodeDotInKeys false' - ); - st.equal( - qs.stringify( - { 'name.obj': { first: 'John', last: 'Doe' } }, - { allowDots: false, encodeDotInKeys: true } - ), - 'name%252Eobj%5Bfirst%5D=John&name%252Eobj%5Blast%5D=Doe', - 'with allowDots false and encodeDotInKeys true' - ); - st.equal( - qs.stringify( - { 'name.obj': { first: 'John', last: 'Doe' } }, - { allowDots: true, encodeDotInKeys: true } - ), - 'name%252Eobj.first=John&name%252Eobj.last=Doe', - 'with allowDots true and encodeDotInKeys true' - ); - - st.equal( - qs.stringify( - { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, - { allowDots: false, encodeDotInKeys: false } - ), - 'name.obj.subobject%5Bfirst.godly.name%5D=John&name.obj.subobject%5Blast%5D=Doe', - 'with allowDots false and encodeDotInKeys false' - ); - st.equal( - qs.stringify( - { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, - { allowDots: true, encodeDotInKeys: false } - ), - 'name.obj.subobject.first.godly.name=John&name.obj.subobject.last=Doe', - 'with allowDots false and encodeDotInKeys false' - ); - st.equal( - qs.stringify( - { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, - { allowDots: false, encodeDotInKeys: true } - ), - 'name%252Eobj%252Esubobject%5Bfirst.godly.name%5D=John&name%252Eobj%252Esubobject%5Blast%5D=Doe', - 'with allowDots false and encodeDotInKeys true' - ); - st.equal( - qs.stringify( - { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, - { allowDots: true, encodeDotInKeys: true } - ), - 'name%252Eobj%252Esubobject.first%252Egodly%252Ename=John&name%252Eobj%252Esubobject.last=Doe', - 'with allowDots true and encodeDotInKeys true' - ); - - st.end(); - }); - - t.test('should encode dot in key of object, and automatically set allowDots to `true` when encodeDotInKeys is true and allowDots in undefined', function (st) { - st.equal( - qs.stringify( - { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, - { encodeDotInKeys: true } - ), - 'name%252Eobj%252Esubobject.first%252Egodly%252Ename=John&name%252Eobj%252Esubobject.last=Doe', - 'with allowDots undefined and encodeDotInKeys true' - ); - st.end(); - }); - - t.test('should encode dot in key of object when encodeDotInKeys and allowDots is provided, and nothing else when encodeValuesOnly is provided', function (st) { - st.equal( - qs.stringify({ 'name.obj': { first: 'John', last: 'Doe' } }, { - encodeDotInKeys: true, allowDots: true, encodeValuesOnly: true - }), - 'name%2Eobj.first=John&name%2Eobj.last=Doe' - ); - - st.equal( - qs.stringify({ 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, { allowDots: true, encodeDotInKeys: true, encodeValuesOnly: true }), - 'name%2Eobj%2Esubobject.first%2Egodly%2Ename=John&name%2Eobj%2Esubobject.last=Doe' - ); - - st.end(); - }); - - t.test('throws when `commaRoundTrip` is not a boolean', function (st) { - st['throws']( - function () { qs.stringify({}, { commaRoundTrip: 'not a boolean' }); }, - TypeError, - 'throws when `commaRoundTrip` is not a boolean' - ); - - st.end(); - }); - - t.test('throws when `encodeDotInKeys` is not a boolean', function (st) { - st['throws']( - function () { qs.stringify({ a: [], b: 'zz' }, { encodeDotInKeys: 'foobar' }); }, - TypeError - ); - - st['throws']( - function () { qs.stringify({ a: [], b: 'zz' }, { encodeDotInKeys: 0 }); }, - TypeError - ); - - st['throws']( - function () { qs.stringify({ a: [], b: 'zz' }, { encodeDotInKeys: NaN }); }, - TypeError - ); - - st['throws']( - function () { qs.stringify({ a: [], b: 'zz' }, { encodeDotInKeys: null }); }, - TypeError - ); - - st.end(); - }); - - t.test('adds query prefix', function (st) { - st.equal(qs.stringify({ a: 'b' }, { addQueryPrefix: true }), '?a=b'); - st.end(); - }); - - t.test('with query prefix, outputs blank string given an empty object', function (st) { - st.equal(qs.stringify({}, { addQueryPrefix: true }), ''); - st.end(); - }); - - t.test('stringifies nested falsy values', function (st) { - st.equal(qs.stringify({ a: { b: { c: null } } }), 'a%5Bb%5D%5Bc%5D='); - st.equal(qs.stringify({ a: { b: { c: null } } }, { strictNullHandling: true }), 'a%5Bb%5D%5Bc%5D'); - st.equal(qs.stringify({ a: { b: { c: false } } }), 'a%5Bb%5D%5Bc%5D=false'); - st.end(); - }); - - t.test('stringifies a nested object', function (st) { - st.equal(qs.stringify({ a: { b: 'c' } }), 'a%5Bb%5D=c'); - st.equal(qs.stringify({ a: { b: { c: { d: 'e' } } } }), 'a%5Bb%5D%5Bc%5D%5Bd%5D=e'); - st.end(); - }); - - t.test('`allowDots` option: stringifies a nested object with dots notation', function (st) { - st.equal(qs.stringify({ a: { b: 'c' } }, { allowDots: true }), 'a.b=c'); - st.equal(qs.stringify({ a: { b: { c: { d: 'e' } } } }, { allowDots: true }), 'a.b.c.d=e'); - st.end(); - }); - - t.test('stringifies an array value', function (st) { - st.equal( - qs.stringify({ a: ['b', 'c', 'd'] }, { arrayFormat: 'indices' }), - 'a%5B0%5D=b&a%5B1%5D=c&a%5B2%5D=d', - 'indices => indices' - ); - st.equal( - qs.stringify({ a: ['b', 'c', 'd'] }, { arrayFormat: 'brackets' }), - 'a%5B%5D=b&a%5B%5D=c&a%5B%5D=d', - 'brackets => brackets' - ); - st.equal( - qs.stringify({ a: ['b', 'c', 'd'] }, { arrayFormat: 'comma' }), - 'a=b%2Cc%2Cd', - 'comma => comma' - ); - st.equal( - qs.stringify({ a: ['b', 'c', 'd'] }, { arrayFormat: 'comma', commaRoundTrip: true }), - 'a=b%2Cc%2Cd', - 'comma round trip => comma' - ); - st.equal( - qs.stringify({ a: ['b', 'c', 'd'] }), - 'a%5B0%5D=b&a%5B1%5D=c&a%5B2%5D=d', - 'default => indices' - ); - st.end(); - }); - - t.test('`skipNulls` option', function (st) { - st.equal( - qs.stringify({ a: 'b', c: null }, { skipNulls: true }), - 'a=b', - 'omits nulls when asked' - ); - - st.equal( - qs.stringify({ a: { b: 'c', d: null } }, { skipNulls: true }), - 'a%5Bb%5D=c', - 'omits nested nulls when asked' - ); - - st.end(); - }); - - t.test('omits array indices when asked', function (st) { - st.equal(qs.stringify({ a: ['b', 'c', 'd'] }, { indices: false }), 'a=b&a=c&a=d'); - - st.end(); - }); - - t.test('omits object key/value pair when value is empty array', function (st) { - st.equal(qs.stringify({ a: [], b: 'zz' }), 'b=zz'); - - st.end(); - }); - - t.test('should not omit object key/value pair when value is empty array and when asked', function (st) { - st.equal(qs.stringify({ a: [], b: 'zz' }), 'b=zz'); - st.equal(qs.stringify({ a: [], b: 'zz' }, { allowEmptyArrays: false }), 'b=zz'); - st.equal(qs.stringify({ a: [], b: 'zz' }, { allowEmptyArrays: true }), 'a[]&b=zz'); - - st.end(); - }); - - t.test('should throw when allowEmptyArrays is not of type boolean', function (st) { - st['throws']( - function () { qs.stringify({ a: [], b: 'zz' }, { allowEmptyArrays: 'foobar' }); }, - TypeError - ); - - st['throws']( - function () { qs.stringify({ a: [], b: 'zz' }, { allowEmptyArrays: 0 }); }, - TypeError - ); - - st['throws']( - function () { qs.stringify({ a: [], b: 'zz' }, { allowEmptyArrays: NaN }); }, - TypeError - ); - - st['throws']( - function () { qs.stringify({ a: [], b: 'zz' }, { allowEmptyArrays: null }); }, - TypeError - ); - - st.end(); - }); - - t.test('allowEmptyArrays + strictNullHandling', function (st) { - st.equal( - qs.stringify( - { testEmptyArray: [] }, - { strictNullHandling: true, allowEmptyArrays: true } - ), - 'testEmptyArray[]' - ); - - st.end(); - }); - - t.test('stringifies an array value with one item vs multiple items', function (st) { - st.test('non-array item', function (s2t) { - s2t.equal(qs.stringify({ a: 'c' }, { encodeValuesOnly: true, arrayFormat: 'indices' }), 'a=c'); - s2t.equal(qs.stringify({ a: 'c' }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a=c'); - s2t.equal(qs.stringify({ a: 'c' }, { encodeValuesOnly: true, arrayFormat: 'comma' }), 'a=c'); - s2t.equal(qs.stringify({ a: 'c' }, { encodeValuesOnly: true }), 'a=c'); - - s2t.end(); - }); - - st.test('array with a single item', function (s2t) { - s2t.equal(qs.stringify({ a: ['c'] }, { encodeValuesOnly: true, arrayFormat: 'indices' }), 'a[0]=c'); - s2t.equal(qs.stringify({ a: ['c'] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a[]=c'); - s2t.equal(qs.stringify({ a: ['c'] }, { encodeValuesOnly: true, arrayFormat: 'comma' }), 'a=c'); - s2t.equal(qs.stringify({ a: ['c'] }, { encodeValuesOnly: true, arrayFormat: 'comma', commaRoundTrip: true }), 'a[]=c'); // so it parses back as an array - s2t.equal(qs.stringify({ a: ['c'] }, { encodeValuesOnly: true }), 'a[0]=c'); - - s2t.end(); - }); - - st.test('array with multiple items', function (s2t) { - s2t.equal(qs.stringify({ a: ['c', 'd'] }, { encodeValuesOnly: true, arrayFormat: 'indices' }), 'a[0]=c&a[1]=d'); - s2t.equal(qs.stringify({ a: ['c', 'd'] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a[]=c&a[]=d'); - s2t.equal(qs.stringify({ a: ['c', 'd'] }, { encodeValuesOnly: true, arrayFormat: 'comma' }), 'a=c,d'); - s2t.equal(qs.stringify({ a: ['c', 'd'] }, { encodeValuesOnly: true, arrayFormat: 'comma', commaRoundTrip: true }), 'a=c,d'); - s2t.equal(qs.stringify({ a: ['c', 'd'] }, { encodeValuesOnly: true }), 'a[0]=c&a[1]=d'); - - s2t.end(); - }); - - st.test('array with multiple items with a comma inside', function (s2t) { - s2t.equal(qs.stringify({ a: ['c,d', 'e'] }, { encodeValuesOnly: true, arrayFormat: 'comma' }), 'a=c%2Cd,e'); - s2t.equal(qs.stringify({ a: ['c,d', 'e'] }, { arrayFormat: 'comma' }), 'a=c%2Cd%2Ce'); - - s2t.equal(qs.stringify({ a: ['c,d', 'e'] }, { encodeValuesOnly: true, arrayFormat: 'comma', commaRoundTrip: true }), 'a=c%2Cd,e'); - s2t.equal(qs.stringify({ a: ['c,d', 'e'] }, { arrayFormat: 'comma', commaRoundTrip: true }), 'a=c%2Cd%2Ce'); - - s2t.end(); - }); - - st.end(); - }); - - t.test('stringifies a nested array value', function (st) { - st.equal(qs.stringify({ a: { b: ['c', 'd'] } }, { encodeValuesOnly: true, arrayFormat: 'indices' }), 'a[b][0]=c&a[b][1]=d'); - st.equal(qs.stringify({ a: { b: ['c', 'd'] } }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a[b][]=c&a[b][]=d'); - st.equal(qs.stringify({ a: { b: ['c', 'd'] } }, { encodeValuesOnly: true, arrayFormat: 'comma' }), 'a[b]=c,d'); - st.equal(qs.stringify({ a: { b: ['c', 'd'] } }, { encodeValuesOnly: true }), 'a[b][0]=c&a[b][1]=d'); - st.end(); - }); - - t.test('stringifies comma and empty array values', function (st) { - st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: false, arrayFormat: 'indices' }), 'a[0]=,&a[1]=&a[2]=c,d%'); - st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: false, arrayFormat: 'brackets' }), 'a[]=,&a[]=&a[]=c,d%'); - st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: false, arrayFormat: 'comma' }), 'a=,,,c,d%'); - st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: false, arrayFormat: 'repeat' }), 'a=,&a=&a=c,d%'); - - st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: true, arrayFormat: 'indices' }), 'a[0]=%2C&a[1]=&a[2]=c%2Cd%25'); - st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a[]=%2C&a[]=&a[]=c%2Cd%25'); - st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: true, arrayFormat: 'comma' }), 'a=%2C,,c%2Cd%25'); - st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: true, arrayFormat: 'repeat' }), 'a=%2C&a=&a=c%2Cd%25'); - - st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: false, arrayFormat: 'indices' }), 'a%5B0%5D=%2C&a%5B1%5D=&a%5B2%5D=c%2Cd%25'); - st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: false, arrayFormat: 'brackets' }), 'a%5B%5D=%2C&a%5B%5D=&a%5B%5D=c%2Cd%25'); - st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: false, arrayFormat: 'comma' }), 'a=%2C%2C%2Cc%2Cd%25'); - st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: false, arrayFormat: 'repeat' }), 'a=%2C&a=&a=c%2Cd%25'); - - st.end(); - }); - - t.test('stringifies comma and empty non-array values', function (st) { - st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: false, arrayFormat: 'indices' }), 'a=,&b=&c=c,d%'); - st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: false, arrayFormat: 'brackets' }), 'a=,&b=&c=c,d%'); - st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: false, arrayFormat: 'comma' }), 'a=,&b=&c=c,d%'); - st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: false, arrayFormat: 'repeat' }), 'a=,&b=&c=c,d%'); - - st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: true, encodeValuesOnly: true, arrayFormat: 'indices' }), 'a=%2C&b=&c=c%2Cd%25'); - st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: true, encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a=%2C&b=&c=c%2Cd%25'); - st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: true, encodeValuesOnly: true, arrayFormat: 'comma' }), 'a=%2C&b=&c=c%2Cd%25'); - st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: true, encodeValuesOnly: true, arrayFormat: 'repeat' }), 'a=%2C&b=&c=c%2Cd%25'); - - st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: true, encodeValuesOnly: false, arrayFormat: 'indices' }), 'a=%2C&b=&c=c%2Cd%25'); - st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: true, encodeValuesOnly: false, arrayFormat: 'brackets' }), 'a=%2C&b=&c=c%2Cd%25'); - st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: true, encodeValuesOnly: false, arrayFormat: 'comma' }), 'a=%2C&b=&c=c%2Cd%25'); - st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: true, encodeValuesOnly: false, arrayFormat: 'repeat' }), 'a=%2C&b=&c=c%2Cd%25'); - - st.end(); - }); - - t.test('stringifies a nested array value with dots notation', function (st) { - st.equal( - qs.stringify( - { a: { b: ['c', 'd'] } }, - { allowDots: true, encodeValuesOnly: true, arrayFormat: 'indices' } - ), - 'a.b[0]=c&a.b[1]=d', - 'indices: stringifies with dots + indices' - ); - st.equal( - qs.stringify( - { a: { b: ['c', 'd'] } }, - { allowDots: true, encodeValuesOnly: true, arrayFormat: 'brackets' } - ), - 'a.b[]=c&a.b[]=d', - 'brackets: stringifies with dots + brackets' - ); - st.equal( - qs.stringify( - { a: { b: ['c', 'd'] } }, - { allowDots: true, encodeValuesOnly: true, arrayFormat: 'comma' } - ), - 'a.b=c,d', - 'comma: stringifies with dots + comma' - ); - st.equal( - qs.stringify( - { a: { b: ['c', 'd'] } }, - { allowDots: true, encodeValuesOnly: true } - ), - 'a.b[0]=c&a.b[1]=d', - 'default: stringifies with dots + indices' - ); - st.end(); - }); - - t.test('stringifies an object inside an array', function (st) { - st.equal( - qs.stringify({ a: [{ b: 'c' }] }, { arrayFormat: 'indices', encodeValuesOnly: true }), - 'a[0][b]=c', - 'indices => indices' - ); - st.equal( - qs.stringify({ a: [{ b: 'c' }] }, { arrayFormat: 'repeat', encodeValuesOnly: true }), - 'a[b]=c', - 'repeat => repeat' - ); - st.equal( - qs.stringify({ a: [{ b: 'c' }] }, { arrayFormat: 'brackets', encodeValuesOnly: true }), - 'a[][b]=c', - 'brackets => brackets' - ); - st.equal( - qs.stringify({ a: [{ b: 'c' }] }, { encodeValuesOnly: true }), - 'a[0][b]=c', - 'default => indices' - ); - - st.equal( - qs.stringify({ a: [{ b: { c: [1] } }] }, { arrayFormat: 'indices', encodeValuesOnly: true }), - 'a[0][b][c][0]=1', - 'indices => indices' - ); - st.equal( - qs.stringify({ a: [{ b: { c: [1] } }] }, { arrayFormat: 'repeat', encodeValuesOnly: true }), - 'a[b][c]=1', - 'repeat => repeat' - ); - st.equal( - qs.stringify({ a: [{ b: { c: [1] } }] }, { arrayFormat: 'brackets', encodeValuesOnly: true }), - 'a[][b][c][]=1', - 'brackets => brackets' - ); - st.equal( - qs.stringify({ a: [{ b: { c: [1] } }] }, { encodeValuesOnly: true }), - 'a[0][b][c][0]=1', - 'default => indices' - ); - - st.end(); - }); - - t.test('stringifies an array with mixed objects and primitives', function (st) { - st.equal( - qs.stringify({ a: [{ b: 1 }, 2, 3] }, { encodeValuesOnly: true, arrayFormat: 'indices' }), - 'a[0][b]=1&a[1]=2&a[2]=3', - 'indices => indices' - ); - st.equal( - qs.stringify({ a: [{ b: 1 }, 2, 3] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), - 'a[][b]=1&a[]=2&a[]=3', - 'brackets => brackets' - ); - st.equal( - qs.stringify({ a: [{ b: 1 }, 2, 3] }, { encodeValuesOnly: true, arrayFormat: 'comma' }), - '???', - 'brackets => brackets', - { skip: 'TODO: figure out what this should do' } - ); - st.equal( - qs.stringify({ a: [{ b: 1 }, 2, 3] }, { encodeValuesOnly: true }), - 'a[0][b]=1&a[1]=2&a[2]=3', - 'default => indices' - ); - - st.end(); - }); - - t.test('stringifies an object inside an array with dots notation', function (st) { - st.equal( - qs.stringify( - { a: [{ b: 'c' }] }, - { allowDots: true, encode: false, arrayFormat: 'indices' } - ), - 'a[0].b=c', - 'indices => indices' - ); - st.equal( - qs.stringify( - { a: [{ b: 'c' }] }, - { allowDots: true, encode: false, arrayFormat: 'brackets' } - ), - 'a[].b=c', - 'brackets => brackets' - ); - st.equal( - qs.stringify( - { a: [{ b: 'c' }] }, - { allowDots: true, encode: false } - ), - 'a[0].b=c', - 'default => indices' - ); - - st.equal( - qs.stringify( - { a: [{ b: { c: [1] } }] }, - { allowDots: true, encode: false, arrayFormat: 'indices' } - ), - 'a[0].b.c[0]=1', - 'indices => indices' - ); - st.equal( - qs.stringify( - { a: [{ b: { c: [1] } }] }, - { allowDots: true, encode: false, arrayFormat: 'brackets' } - ), - 'a[].b.c[]=1', - 'brackets => brackets' - ); - st.equal( - qs.stringify( - { a: [{ b: { c: [1] } }] }, - { allowDots: true, encode: false } - ), - 'a[0].b.c[0]=1', - 'default => indices' - ); - - st.end(); - }); - - t.test('does not omit object keys when indices = false', function (st) { - st.equal(qs.stringify({ a: [{ b: 'c' }] }, { indices: false }), 'a%5Bb%5D=c'); - st.end(); - }); - - t.test('uses indices notation for arrays when indices=true', function (st) { - st.equal(qs.stringify({ a: ['b', 'c'] }, { indices: true }), 'a%5B0%5D=b&a%5B1%5D=c'); - st.end(); - }); - - t.test('uses indices notation for arrays when no arrayFormat is specified', function (st) { - st.equal(qs.stringify({ a: ['b', 'c'] }), 'a%5B0%5D=b&a%5B1%5D=c'); - st.end(); - }); - - t.test('uses indices notation for arrays when arrayFormat=indices', function (st) { - st.equal(qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'indices' }), 'a%5B0%5D=b&a%5B1%5D=c'); - st.end(); - }); - - t.test('uses repeat notation for arrays when arrayFormat=repeat', function (st) { - st.equal(qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'repeat' }), 'a=b&a=c'); - st.end(); - }); - - t.test('uses brackets notation for arrays when arrayFormat=brackets', function (st) { - st.equal(qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'brackets' }), 'a%5B%5D=b&a%5B%5D=c'); - st.end(); - }); - - t.test('stringifies a complicated object', function (st) { - st.equal(qs.stringify({ a: { b: 'c', d: 'e' } }), 'a%5Bb%5D=c&a%5Bd%5D=e'); - st.end(); - }); - - t.test('stringifies an empty value', function (st) { - st.equal(qs.stringify({ a: '' }), 'a='); - st.equal(qs.stringify({ a: null }, { strictNullHandling: true }), 'a'); - - st.equal(qs.stringify({ a: '', b: '' }), 'a=&b='); - st.equal(qs.stringify({ a: null, b: '' }, { strictNullHandling: true }), 'a&b='); - - st.equal(qs.stringify({ a: { b: '' } }), 'a%5Bb%5D='); - st.equal(qs.stringify({ a: { b: null } }, { strictNullHandling: true }), 'a%5Bb%5D'); - st.equal(qs.stringify({ a: { b: null } }, { strictNullHandling: false }), 'a%5Bb%5D='); - - st.end(); - }); - - t.test('stringifies an empty array in different arrayFormat', function (st) { - st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false }), 'b[0]=&c=c'); - // arrayFormat default - st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'indices' }), 'b[0]=&c=c'); - st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'brackets' }), 'b[]=&c=c'); - st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'repeat' }), 'b=&c=c'); - st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'comma' }), 'b=&c=c'); - st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'comma', commaRoundTrip: true }), 'b[]=&c=c'); - // with strictNullHandling - st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'indices', strictNullHandling: true }), 'b[0]&c=c'); - st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'brackets', strictNullHandling: true }), 'b[]&c=c'); - st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'repeat', strictNullHandling: true }), 'b&c=c'); - st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'comma', strictNullHandling: true }), 'b&c=c'); - st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'comma', strictNullHandling: true, commaRoundTrip: true }), 'b[]&c=c'); - // with skipNulls - st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'indices', skipNulls: true }), 'c=c'); - st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'brackets', skipNulls: true }), 'c=c'); - st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'repeat', skipNulls: true }), 'c=c'); - st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'comma', skipNulls: true }), 'c=c'); - - st.end(); - }); - - t.test('stringifies a null object', { skip: !Object.create }, function (st) { - var obj = Object.create(null); - obj.a = 'b'; - st.equal(qs.stringify(obj), 'a=b'); - st.end(); - }); - - t.test('returns an empty string for invalid input', function (st) { - st.equal(qs.stringify(undefined), ''); - st.equal(qs.stringify(false), ''); - st.equal(qs.stringify(null), ''); - st.equal(qs.stringify(''), ''); - st.end(); - }); - - t.test('stringifies an object with a null object as a child', { skip: !Object.create }, function (st) { - var obj = { a: Object.create(null) }; - - obj.a.b = 'c'; - st.equal(qs.stringify(obj), 'a%5Bb%5D=c'); - st.end(); - }); - - t.test('drops keys with a value of undefined', function (st) { - st.equal(qs.stringify({ a: undefined }), ''); - - st.equal(qs.stringify({ a: { b: undefined, c: null } }, { strictNullHandling: true }), 'a%5Bc%5D'); - st.equal(qs.stringify({ a: { b: undefined, c: null } }, { strictNullHandling: false }), 'a%5Bc%5D='); - st.equal(qs.stringify({ a: { b: undefined, c: '' } }), 'a%5Bc%5D='); - st.end(); - }); - - t.test('url encodes values', function (st) { - st.equal(qs.stringify({ a: 'b c' }), 'a=b%20c'); - st.end(); - }); - - t.test('stringifies a date', function (st) { - var now = new Date(); - var str = 'a=' + encodeURIComponent(now.toISOString()); - st.equal(qs.stringify({ a: now }), str); - st.end(); - }); - - t.test('stringifies the weird object from qs', function (st) { - st.equal(qs.stringify({ 'my weird field': '~q1!2"\'w$5&7/z8)?' }), 'my%20weird%20field=~q1%212%22%27w%245%267%2Fz8%29%3F'); - st.end(); - }); - - t.test('skips properties that are part of the object prototype', function (st) { - st.intercept(Object.prototype, 'crash', { value: 'test' }); - - st.equal(qs.stringify({ a: 'b' }), 'a=b'); - st.equal(qs.stringify({ a: { b: 'c' } }), 'a%5Bb%5D=c'); - - st.end(); - }); - - t.test('stringifies boolean values', function (st) { - st.equal(qs.stringify({ a: true }), 'a=true'); - st.equal(qs.stringify({ a: { b: true } }), 'a%5Bb%5D=true'); - st.equal(qs.stringify({ b: false }), 'b=false'); - st.equal(qs.stringify({ b: { c: false } }), 'b%5Bc%5D=false'); - st.end(); - }); - - t.test('stringifies buffer values', function (st) { - st.equal(qs.stringify({ a: SaferBuffer.from('test') }), 'a=test'); - st.equal(qs.stringify({ a: { b: SaferBuffer.from('test') } }), 'a%5Bb%5D=test'); - st.end(); - }); - - t.test('stringifies an object using an alternative delimiter', function (st) { - st.equal(qs.stringify({ a: 'b', c: 'd' }, { delimiter: ';' }), 'a=b;c=d'); - st.end(); - }); - - t.test('does not blow up when Buffer global is missing', function (st) { - var restore = mockProperty(global, 'Buffer', { 'delete': true }); - - var result = qs.stringify({ a: 'b', c: 'd' }); - - restore(); - - st.equal(result, 'a=b&c=d'); - st.end(); - }); - - t.test('does not crash when parsing circular references', function (st) { - var a = {}; - a.b = a; - - st['throws']( - function () { qs.stringify({ 'foo[bar]': 'baz', 'foo[baz]': a }); }, - /RangeError: Cyclic object value/, - 'cyclic values throw' - ); - - var circular = { - a: 'value' - }; - circular.a = circular; - st['throws']( - function () { qs.stringify(circular); }, - /RangeError: Cyclic object value/, - 'cyclic values throw' - ); - - var arr = ['a']; - st.doesNotThrow( - function () { qs.stringify({ x: arr, y: arr }); }, - 'non-cyclic values do not throw' - ); - - st.end(); - }); - - t.test('non-circular duplicated references can still work', function (st) { - var hourOfDay = { - 'function': 'hour_of_day' - }; - - var p1 = { - 'function': 'gte', - arguments: [hourOfDay, 0] - }; - var p2 = { - 'function': 'lte', - arguments: [hourOfDay, 23] - }; - - st.equal( - qs.stringify({ filters: { $and: [p1, p2] } }, { encodeValuesOnly: true, arrayFormat: 'indices' }), - 'filters[$and][0][function]=gte&filters[$and][0][arguments][0][function]=hour_of_day&filters[$and][0][arguments][1]=0&filters[$and][1][function]=lte&filters[$and][1][arguments][0][function]=hour_of_day&filters[$and][1][arguments][1]=23' - ); - st.equal( - qs.stringify({ filters: { $and: [p1, p2] } }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), - 'filters[$and][][function]=gte&filters[$and][][arguments][][function]=hour_of_day&filters[$and][][arguments][]=0&filters[$and][][function]=lte&filters[$and][][arguments][][function]=hour_of_day&filters[$and][][arguments][]=23' - ); - st.equal( - qs.stringify({ filters: { $and: [p1, p2] } }, { encodeValuesOnly: true, arrayFormat: 'repeat' }), - 'filters[$and][function]=gte&filters[$and][arguments][function]=hour_of_day&filters[$and][arguments]=0&filters[$and][function]=lte&filters[$and][arguments][function]=hour_of_day&filters[$and][arguments]=23' - ); - - st.end(); - }); - - t.test('selects properties when filter=array', function (st) { - st.equal(qs.stringify({ a: 'b' }, { filter: ['a'] }), 'a=b'); - st.equal(qs.stringify({ a: 1 }, { filter: [] }), ''); - - st.equal( - qs.stringify( - { a: { b: [1, 2, 3, 4], c: 'd' }, c: 'f' }, - { filter: ['a', 'b', 0, 2], arrayFormat: 'indices' } - ), - 'a%5Bb%5D%5B0%5D=1&a%5Bb%5D%5B2%5D=3', - 'indices => indices' - ); - st.equal( - qs.stringify( - { a: { b: [1, 2, 3, 4], c: 'd' }, c: 'f' }, - { filter: ['a', 'b', 0, 2], arrayFormat: 'brackets' } - ), - 'a%5Bb%5D%5B%5D=1&a%5Bb%5D%5B%5D=3', - 'brackets => brackets' - ); - st.equal( - qs.stringify( - { a: { b: [1, 2, 3, 4], c: 'd' }, c: 'f' }, - { filter: ['a', 'b', 0, 2] } - ), - 'a%5Bb%5D%5B0%5D=1&a%5Bb%5D%5B2%5D=3', - 'default => indices' - ); - - st.end(); - }); - - t.test('supports custom representations when filter=function', function (st) { - var calls = 0; - var obj = { a: 'b', c: 'd', e: { f: new Date(1257894000000) } }; - var filterFunc = function (prefix, value) { - calls += 1; - if (calls === 1) { - st.equal(prefix, '', 'prefix is empty'); - st.equal(value, obj); - } else if (prefix === 'c') { - return void 0; - } else if (value instanceof Date) { - st.equal(prefix, 'e[f]'); - return value.getTime(); - } - return value; - }; - - st.equal(qs.stringify(obj, { filter: filterFunc }), 'a=b&e%5Bf%5D=1257894000000'); - st.equal(calls, 5); - st.end(); - }); - - t.test('can disable uri encoding', function (st) { - st.equal(qs.stringify({ a: 'b' }, { encode: false }), 'a=b'); - st.equal(qs.stringify({ a: { b: 'c' } }, { encode: false }), 'a[b]=c'); - st.equal(qs.stringify({ a: 'b', c: null }, { strictNullHandling: true, encode: false }), 'a=b&c'); - st.end(); - }); - - t.test('can sort the keys', function (st) { - var sort = function (a, b) { - return a.localeCompare(b); - }; - st.equal(qs.stringify({ a: 'c', z: 'y', b: 'f' }, { sort: sort }), 'a=c&b=f&z=y'); - st.equal(qs.stringify({ a: 'c', z: { j: 'a', i: 'b' }, b: 'f' }, { sort: sort }), 'a=c&b=f&z%5Bi%5D=b&z%5Bj%5D=a'); - st.end(); - }); - - t.test('can sort the keys at depth 3 or more too', function (st) { - var sort = function (a, b) { - return a.localeCompare(b); - }; - st.equal( - qs.stringify( - { a: 'a', z: { zj: { zjb: 'zjb', zja: 'zja' }, zi: { zib: 'zib', zia: 'zia' } }, b: 'b' }, - { sort: sort, encode: false } - ), - 'a=a&b=b&z[zi][zia]=zia&z[zi][zib]=zib&z[zj][zja]=zja&z[zj][zjb]=zjb' - ); - st.equal( - qs.stringify( - { a: 'a', z: { zj: { zjb: 'zjb', zja: 'zja' }, zi: { zib: 'zib', zia: 'zia' } }, b: 'b' }, - { sort: null, encode: false } - ), - 'a=a&z[zj][zjb]=zjb&z[zj][zja]=zja&z[zi][zib]=zib&z[zi][zia]=zia&b=b' - ); - st.end(); - }); - - t.test('can stringify with custom encoding', function (st) { - st.equal(qs.stringify({ 県: '大阪府', '': '' }, { - encoder: function (str) { - if (str.length === 0) { - return ''; - } - var buf = iconv.encode(str, 'shiftjis'); - var result = []; - for (var i = 0; i < buf.length; ++i) { - result.push(buf.readUInt8(i).toString(16)); - } - return '%' + result.join('%'); - } - }), '%8c%a7=%91%e5%8d%e3%95%7b&='); - st.end(); - }); - - t.test('receives the default encoder as a second argument', function (st) { - st.plan(8); - - qs.stringify({ a: 1, b: new Date(), c: true, d: [1] }, { - encoder: function (str) { - st.match(typeof str, /^(?:string|number|boolean)$/); - return ''; - } - }); - - st.end(); - }); - - t.test('receives the default encoder as a second argument', function (st) { - st.plan(2); - - qs.stringify({ a: 1 }, { - encoder: function (str, defaultEncoder) { - st.equal(defaultEncoder, utils.encode); - } - }); - - st.end(); - }); - - t.test('throws error with wrong encoder', function (st) { - st['throws'](function () { - qs.stringify({}, { encoder: 'string' }); - }, new TypeError('Encoder has to be a function.')); - st.end(); - }); - - t.test('can use custom encoder for a buffer object', { skip: typeof Buffer === 'undefined' }, function (st) { - st.equal(qs.stringify({ a: SaferBuffer.from([1]) }, { - encoder: function (buffer) { - if (typeof buffer === 'string') { - return buffer; - } - return String.fromCharCode(buffer.readUInt8(0) + 97); - } - }), 'a=b'); - - st.equal(qs.stringify({ a: SaferBuffer.from('a b') }, { - encoder: function (buffer) { - return buffer; - } - }), 'a=a b'); - st.end(); - }); - - t.test('serializeDate option', function (st) { - var date = new Date(); - st.equal( - qs.stringify({ a: date }), - 'a=' + date.toISOString().replace(/:/g, '%3A'), - 'default is toISOString' - ); - - var mutatedDate = new Date(); - mutatedDate.toISOString = function () { - throw new SyntaxError(); - }; - st['throws'](function () { - mutatedDate.toISOString(); - }, SyntaxError); - st.equal( - qs.stringify({ a: mutatedDate }), - 'a=' + Date.prototype.toISOString.call(mutatedDate).replace(/:/g, '%3A'), - 'toISOString works even when method is not locally present' - ); - - var specificDate = new Date(6); - st.equal( - qs.stringify( - { a: specificDate }, - { serializeDate: function (d) { return d.getTime() * 7; } } - ), - 'a=42', - 'custom serializeDate function called' - ); - - st.equal( - qs.stringify( - { a: [date] }, - { - serializeDate: function (d) { return d.getTime(); }, - arrayFormat: 'comma' - } - ), - 'a=' + date.getTime(), - 'works with arrayFormat comma' - ); - st.equal( - qs.stringify( - { a: [date] }, - { - serializeDate: function (d) { return d.getTime(); }, - arrayFormat: 'comma', - commaRoundTrip: true - } - ), - 'a%5B%5D=' + date.getTime(), - 'works with arrayFormat comma' - ); - - st.end(); - }); - - t.test('RFC 1738 serialization', function (st) { - st.equal(qs.stringify({ a: 'b c' }, { format: qs.formats.RFC1738 }), 'a=b+c'); - st.equal(qs.stringify({ 'a b': 'c d' }, { format: qs.formats.RFC1738 }), 'a+b=c+d'); - st.equal(qs.stringify({ 'a b': SaferBuffer.from('a b') }, { format: qs.formats.RFC1738 }), 'a+b=a+b'); - - st.equal(qs.stringify({ 'foo(ref)': 'bar' }, { format: qs.formats.RFC1738 }), 'foo(ref)=bar'); - - st.end(); - }); - - t.test('RFC 3986 spaces serialization', function (st) { - st.equal(qs.stringify({ a: 'b c' }, { format: qs.formats.RFC3986 }), 'a=b%20c'); - st.equal(qs.stringify({ 'a b': 'c d' }, { format: qs.formats.RFC3986 }), 'a%20b=c%20d'); - st.equal(qs.stringify({ 'a b': SaferBuffer.from('a b') }, { format: qs.formats.RFC3986 }), 'a%20b=a%20b'); - - st.end(); - }); - - t.test('Backward compatibility to RFC 3986', function (st) { - st.equal(qs.stringify({ a: 'b c' }), 'a=b%20c'); - st.equal(qs.stringify({ 'a b': SaferBuffer.from('a b') }), 'a%20b=a%20b'); - - st.end(); - }); - - t.test('Edge cases and unknown formats', function (st) { - ['UFO1234', false, 1234, null, {}, []].forEach(function (format) { - st['throws']( - function () { - qs.stringify({ a: 'b c' }, { format: format }); - }, - new TypeError('Unknown format option provided.') - ); - }); - st.end(); - }); - - t.test('encodeValuesOnly', function (st) { - st.equal( - qs.stringify( - { a: 'b', c: ['d', 'e=f'], f: [['g'], ['h']] }, - { encodeValuesOnly: true, arrayFormat: 'indices' } - ), - 'a=b&c[0]=d&c[1]=e%3Df&f[0][0]=g&f[1][0]=h', - 'encodeValuesOnly + indices' - ); - st.equal( - qs.stringify( - { a: 'b', c: ['d', 'e=f'], f: [['g'], ['h']] }, - { encodeValuesOnly: true, arrayFormat: 'brackets' } - ), - 'a=b&c[]=d&c[]=e%3Df&f[][]=g&f[][]=h', - 'encodeValuesOnly + brackets' - ); - st.equal( - qs.stringify( - { a: 'b', c: ['d', 'e=f'], f: [['g'], ['h']] }, - { encodeValuesOnly: true, arrayFormat: 'repeat' } - ), - 'a=b&c=d&c=e%3Df&f=g&f=h', - 'encodeValuesOnly + repeat' - ); - - st.equal( - qs.stringify( - { a: 'b', c: ['d', 'e'], f: [['g'], ['h']] }, - { arrayFormat: 'indices' } - ), - 'a=b&c%5B0%5D=d&c%5B1%5D=e&f%5B0%5D%5B0%5D=g&f%5B1%5D%5B0%5D=h', - 'no encodeValuesOnly + indices' - ); - st.equal( - qs.stringify( - { a: 'b', c: ['d', 'e'], f: [['g'], ['h']] }, - { arrayFormat: 'brackets' } - ), - 'a=b&c%5B%5D=d&c%5B%5D=e&f%5B%5D%5B%5D=g&f%5B%5D%5B%5D=h', - 'no encodeValuesOnly + brackets' - ); - st.equal( - qs.stringify( - { a: 'b', c: ['d', 'e'], f: [['g'], ['h']] }, - { arrayFormat: 'repeat' } - ), - 'a=b&c=d&c=e&f=g&f=h', - 'no encodeValuesOnly + repeat' - ); - - st.end(); - }); - - t.test('encodeValuesOnly - strictNullHandling', function (st) { - st.equal( - qs.stringify( - { a: { b: null } }, - { encodeValuesOnly: true, strictNullHandling: true } - ), - 'a[b]' - ); - st.end(); - }); - - t.test('throws if an invalid charset is specified', function (st) { - st['throws'](function () { - qs.stringify({ a: 'b' }, { charset: 'foobar' }); - }, new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined')); - st.end(); - }); - - t.test('respects a charset of iso-8859-1', function (st) { - st.equal(qs.stringify({ æ: 'æ' }, { charset: 'iso-8859-1' }), '%E6=%E6'); - st.end(); - }); - - t.test('encodes unrepresentable chars as numeric entities in iso-8859-1 mode', function (st) { - st.equal(qs.stringify({ a: '☺' }, { charset: 'iso-8859-1' }), 'a=%26%239786%3B'); - st.end(); - }); - - t.test('respects an explicit charset of utf-8 (the default)', function (st) { - st.equal(qs.stringify({ a: 'æ' }, { charset: 'utf-8' }), 'a=%C3%A6'); - st.end(); - }); - - t.test('`charsetSentinel` option', function (st) { - st.equal( - qs.stringify({ a: 'æ' }, { charsetSentinel: true, charset: 'utf-8' }), - 'utf8=%E2%9C%93&a=%C3%A6', - 'adds the right sentinel when instructed to and the charset is utf-8' - ); - - st.equal( - qs.stringify({ a: 'æ' }, { charsetSentinel: true, charset: 'iso-8859-1' }), - 'utf8=%26%2310003%3B&a=%E6', - 'adds the right sentinel when instructed to and the charset is iso-8859-1' - ); - - st.end(); - }); - - t.test('does not mutate the options argument', function (st) { - var options = {}; - qs.stringify({}, options); - st.deepEqual(options, {}); - st.end(); - }); - - t.test('strictNullHandling works with custom filter', function (st) { - var filter = function (prefix, value) { - return value; - }; - - var options = { strictNullHandling: true, filter: filter }; - st.equal(qs.stringify({ key: null }, options), 'key'); - st.end(); - }); - - t.test('strictNullHandling works with null serializeDate', function (st) { - var serializeDate = function () { - return null; - }; - var options = { strictNullHandling: true, serializeDate: serializeDate }; - var date = new Date(); - st.equal(qs.stringify({ key: date }, options), 'key'); - st.end(); - }); - - t.test('allows for encoding keys and values differently', function (st) { - var encoder = function (str, defaultEncoder, charset, type) { - if (type === 'key') { - return defaultEncoder(str, defaultEncoder, charset, type).toLowerCase(); - } - if (type === 'value') { - return defaultEncoder(str, defaultEncoder, charset, type).toUpperCase(); - } - throw 'this should never happen! type: ' + type; - }; - - st.deepEqual(qs.stringify({ KeY: 'vAlUe' }, { encoder: encoder }), 'key=VALUE'); - st.end(); - }); - - t.test('objects inside arrays', function (st) { - var obj = { a: { b: { c: 'd', e: 'f' } } }; - var withArray = { a: { b: [{ c: 'd', e: 'f' }] } }; - - st.equal(qs.stringify(obj, { encode: false }), 'a[b][c]=d&a[b][e]=f', 'no array, no arrayFormat'); - st.equal(qs.stringify(obj, { encode: false, arrayFormat: 'brackets' }), 'a[b][c]=d&a[b][e]=f', 'no array, bracket'); - st.equal(qs.stringify(obj, { encode: false, arrayFormat: 'indices' }), 'a[b][c]=d&a[b][e]=f', 'no array, indices'); - st.equal(qs.stringify(obj, { encode: false, arrayFormat: 'repeat' }), 'a[b][c]=d&a[b][e]=f', 'no array, repeat'); - st.equal(qs.stringify(obj, { encode: false, arrayFormat: 'comma' }), 'a[b][c]=d&a[b][e]=f', 'no array, comma'); - - st.equal(qs.stringify(withArray, { encode: false }), 'a[b][0][c]=d&a[b][0][e]=f', 'array, no arrayFormat'); - st.equal(qs.stringify(withArray, { encode: false, arrayFormat: 'brackets' }), 'a[b][][c]=d&a[b][][e]=f', 'array, bracket'); - st.equal(qs.stringify(withArray, { encode: false, arrayFormat: 'indices' }), 'a[b][0][c]=d&a[b][0][e]=f', 'array, indices'); - st.equal(qs.stringify(withArray, { encode: false, arrayFormat: 'repeat' }), 'a[b][c]=d&a[b][e]=f', 'array, repeat'); - st.equal( - qs.stringify(withArray, { encode: false, arrayFormat: 'comma' }), - '???', - 'array, comma', - { skip: 'TODO: figure out what this should do' } - ); - - st.end(); - }); - - t.test('stringifies sparse arrays', function (st) { - /* eslint no-sparse-arrays: 0 */ - st.equal(qs.stringify({ a: [, '2', , , '1'] }, { encodeValuesOnly: true, arrayFormat: 'indices' }), 'a[1]=2&a[4]=1'); - st.equal(qs.stringify({ a: [, '2', , , '1'] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a[]=2&a[]=1'); - st.equal(qs.stringify({ a: [, '2', , , '1'] }, { encodeValuesOnly: true, arrayFormat: 'repeat' }), 'a=2&a=1'); - - st.equal(qs.stringify({ a: [, { b: [, , { c: '1' }] }] }, { encodeValuesOnly: true, arrayFormat: 'indices' }), 'a[1][b][2][c]=1'); - st.equal(qs.stringify({ a: [, { b: [, , { c: '1' }] }] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a[][b][][c]=1'); - st.equal(qs.stringify({ a: [, { b: [, , { c: '1' }] }] }, { encodeValuesOnly: true, arrayFormat: 'repeat' }), 'a[b][c]=1'); - - st.equal(qs.stringify({ a: [, [, , [, , , { c: '1' }]]] }, { encodeValuesOnly: true, arrayFormat: 'indices' }), 'a[1][2][3][c]=1'); - st.equal(qs.stringify({ a: [, [, , [, , , { c: '1' }]]] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a[][][][c]=1'); - st.equal(qs.stringify({ a: [, [, , [, , , { c: '1' }]]] }, { encodeValuesOnly: true, arrayFormat: 'repeat' }), 'a[c]=1'); - - st.equal(qs.stringify({ a: [, [, , [, , , { c: [, '1'] }]]] }, { encodeValuesOnly: true, arrayFormat: 'indices' }), 'a[1][2][3][c][1]=1'); - st.equal(qs.stringify({ a: [, [, , [, , , { c: [, '1'] }]]] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a[][][][c][]=1'); - st.equal(qs.stringify({ a: [, [, , [, , , { c: [, '1'] }]]] }, { encodeValuesOnly: true, arrayFormat: 'repeat' }), 'a[c]=1'); - - st.end(); - }); - - t.test('encodes a very long string', function (st) { - var chars = []; - var expected = []; - for (var i = 0; i < 5e3; i++) { - chars.push(' ' + i); - - expected.push('%20' + i); - } - - var obj = { - foo: chars.join('') - }; - - st.equal( - qs.stringify(obj, { arrayFormat: 'bracket', charset: 'utf-8' }), - 'foo=' + expected.join('') - ); - - st.end(); - }); - - t.end(); -}); - -test('stringifies empty keys', function (t) { - emptyTestCases.forEach(function (testCase) { - t.test('stringifies an object with empty string key with ' + testCase.input, function (st) { - st.deepEqual( - qs.stringify(testCase.withEmptyKeys, { encode: false, arrayFormat: 'indices' }), - testCase.stringifyOutput.indices, - 'test case: ' + testCase.input + ', indices' - ); - st.deepEqual( - qs.stringify(testCase.withEmptyKeys, { encode: false, arrayFormat: 'brackets' }), - testCase.stringifyOutput.brackets, - 'test case: ' + testCase.input + ', brackets' - ); - st.deepEqual( - qs.stringify(testCase.withEmptyKeys, { encode: false, arrayFormat: 'repeat' }), - testCase.stringifyOutput.repeat, - 'test case: ' + testCase.input + ', repeat' - ); - - st.end(); - }); - }); - - t.test('edge case with object/arrays', function (st) { - st.deepEqual(qs.stringify({ '': { '': [2, 3] } }, { encode: false }), '[][0]=2&[][1]=3'); - st.deepEqual(qs.stringify({ '': { '': [2, 3], a: 2 } }, { encode: false }), '[][0]=2&[][1]=3&[a]=2'); - st.deepEqual(qs.stringify({ '': { '': [2, 3] } }, { encode: false, arrayFormat: 'indices' }), '[][0]=2&[][1]=3'); - st.deepEqual(qs.stringify({ '': { '': [2, 3], a: 2 } }, { encode: false, arrayFormat: 'indices' }), '[][0]=2&[][1]=3&[a]=2'); - - st.end(); - }); -}); diff --git a/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/test/utils.js b/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/test/utils.js deleted file mode 100644 index aa84dfdc62be..000000000000 --- a/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/test/utils.js +++ /dev/null @@ -1,136 +0,0 @@ -'use strict'; - -var test = require('tape'); -var inspect = require('object-inspect'); -var SaferBuffer = require('safer-buffer').Buffer; -var forEach = require('for-each'); -var utils = require('../lib/utils'); - -test('merge()', function (t) { - t.deepEqual(utils.merge(null, true), [null, true], 'merges true into null'); - - t.deepEqual(utils.merge(null, [42]), [null, 42], 'merges null into an array'); - - t.deepEqual(utils.merge({ a: 'b' }, { a: 'c' }), { a: ['b', 'c'] }, 'merges two objects with the same key'); - - var oneMerged = utils.merge({ foo: 'bar' }, { foo: { first: '123' } }); - t.deepEqual(oneMerged, { foo: ['bar', { first: '123' }] }, 'merges a standalone and an object into an array'); - - var twoMerged = utils.merge({ foo: ['bar', { first: '123' }] }, { foo: { second: '456' } }); - t.deepEqual(twoMerged, { foo: { 0: 'bar', 1: { first: '123' }, second: '456' } }, 'merges a standalone and two objects into an array'); - - var sandwiched = utils.merge({ foo: ['bar', { first: '123', second: '456' }] }, { foo: 'baz' }); - t.deepEqual(sandwiched, { foo: ['bar', { first: '123', second: '456' }, 'baz'] }, 'merges an object sandwiched by two standalones into an array'); - - var nestedArrays = utils.merge({ foo: ['baz'] }, { foo: ['bar', 'xyzzy'] }); - t.deepEqual(nestedArrays, { foo: ['baz', 'bar', 'xyzzy'] }); - - var noOptionsNonObjectSource = utils.merge({ foo: 'baz' }, 'bar'); - t.deepEqual(noOptionsNonObjectSource, { foo: 'baz', bar: true }); - - t.test( - 'avoids invoking array setters unnecessarily', - { skip: typeof Object.defineProperty !== 'function' }, - function (st) { - var setCount = 0; - var getCount = 0; - var observed = []; - Object.defineProperty(observed, 0, { - get: function () { - getCount += 1; - return { bar: 'baz' }; - }, - set: function () { setCount += 1; } - }); - utils.merge(observed, [null]); - st.equal(setCount, 0); - st.equal(getCount, 1); - observed[0] = observed[0]; // eslint-disable-line no-self-assign - st.equal(setCount, 1); - st.equal(getCount, 2); - st.end(); - } - ); - - t.end(); -}); - -test('assign()', function (t) { - var target = { a: 1, b: 2 }; - var source = { b: 3, c: 4 }; - var result = utils.assign(target, source); - - t.equal(result, target, 'returns the target'); - t.deepEqual(target, { a: 1, b: 3, c: 4 }, 'target and source are merged'); - t.deepEqual(source, { b: 3, c: 4 }, 'source is untouched'); - - t.end(); -}); - -test('combine()', function (t) { - t.test('both arrays', function (st) { - var a = [1]; - var b = [2]; - var combined = utils.combine(a, b); - - st.deepEqual(a, [1], 'a is not mutated'); - st.deepEqual(b, [2], 'b is not mutated'); - st.notEqual(a, combined, 'a !== combined'); - st.notEqual(b, combined, 'b !== combined'); - st.deepEqual(combined, [1, 2], 'combined is a + b'); - - st.end(); - }); - - t.test('one array, one non-array', function (st) { - var aN = 1; - var a = [aN]; - var bN = 2; - var b = [bN]; - - var combinedAnB = utils.combine(aN, b); - st.deepEqual(b, [bN], 'b is not mutated'); - st.notEqual(aN, combinedAnB, 'aN + b !== aN'); - st.notEqual(a, combinedAnB, 'aN + b !== a'); - st.notEqual(bN, combinedAnB, 'aN + b !== bN'); - st.notEqual(b, combinedAnB, 'aN + b !== b'); - st.deepEqual([1, 2], combinedAnB, 'first argument is array-wrapped when not an array'); - - var combinedABn = utils.combine(a, bN); - st.deepEqual(a, [aN], 'a is not mutated'); - st.notEqual(aN, combinedABn, 'a + bN !== aN'); - st.notEqual(a, combinedABn, 'a + bN !== a'); - st.notEqual(bN, combinedABn, 'a + bN !== bN'); - st.notEqual(b, combinedABn, 'a + bN !== b'); - st.deepEqual([1, 2], combinedABn, 'second argument is array-wrapped when not an array'); - - st.end(); - }); - - t.test('neither is an array', function (st) { - var combined = utils.combine(1, 2); - st.notEqual(1, combined, '1 + 2 !== 1'); - st.notEqual(2, combined, '1 + 2 !== 2'); - st.deepEqual([1, 2], combined, 'both arguments are array-wrapped when not an array'); - - st.end(); - }); - - t.end(); -}); - -test('isBuffer()', function (t) { - forEach([null, undefined, true, false, '', 'abc', 42, 0, NaN, {}, [], function () {}, /a/g], function (x) { - t.equal(utils.isBuffer(x), false, inspect(x) + ' is not a buffer'); - }); - - var fakeBuffer = { constructor: Buffer }; - t.equal(utils.isBuffer(fakeBuffer), false, 'fake buffer is not a buffer'); - - var saferBuffer = SaferBuffer.from('abc'); - t.equal(utils.isBuffer(saferBuffer), true, 'SaferBuffer instance is a buffer'); - - var buffer = Buffer.from && Buffer.alloc ? Buffer.from('abc') : new Buffer('abc'); - t.equal(utils.isBuffer(buffer), true, 'real Buffer instance is a buffer'); - t.end(); -}); diff --git a/Modules/Chatroom/chat/node_modules/express/History.md b/Modules/Chatroom/chat/node_modules/express/History.md index 887a38f182db..178e718fc36a 100644 --- a/Modules/Chatroom/chat/node_modules/express/History.md +++ b/Modules/Chatroom/chat/node_modules/express/History.md @@ -1,3 +1,12 @@ +4.21.0 / 2024-09-11 +========== + + * Deprecate `res.location("back")` and `res.redirect("back")` magic string + * deps: serve-static@1.16.2 + * includes send@0.19.0 + * deps: finalhandler@1.3.1 + * deps: qs@6.13.0 + 4.20.0 / 2024-09-10 ========== * deps: serve-static@0.16.0 diff --git a/Modules/Chatroom/chat/node_modules/express/lib/response.js b/Modules/Chatroom/chat/node_modules/express/lib/response.js index 76b6b54a3b8f..2b654f4c6629 100644 --- a/Modules/Chatroom/chat/node_modules/express/lib/response.js +++ b/Modules/Chatroom/chat/node_modules/express/lib/response.js @@ -916,6 +916,7 @@ res.location = function location(url) { // "back" is an alias for the referrer if (url === 'back') { + deprecate('res.location("back"): use res.location(req.get("Referrer") || "/") and refer to https://dub.sh/security-redirect for best practices'); loc = this.req.get('Referrer') || '/'; } else { loc = String(url); diff --git a/Modules/Chatroom/chat/node_modules/express/package.json b/Modules/Chatroom/chat/node_modules/express/package.json index bffa70a6f1c5..f9b43a69e5a8 100644 --- a/Modules/Chatroom/chat/node_modules/express/package.json +++ b/Modules/Chatroom/chat/node_modules/express/package.json @@ -1,7 +1,7 @@ { "name": "express", "description": "Fast, unopinionated, minimalist web framework", - "version": "4.20.0", + "version": "4.21.0", "author": "TJ Holowaychuk ", "contributors": [ "Aaron Heckmann ", @@ -40,7 +40,7 @@ "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "etag": "~1.8.1", - "finalhandler": "1.2.0", + "finalhandler": "1.3.1", "fresh": "0.5.2", "http-errors": "2.0.0", "merge-descriptors": "1.0.3", @@ -49,11 +49,11 @@ "parseurl": "~1.3.3", "path-to-regexp": "0.1.10", "proxy-addr": "~2.0.7", - "qs": "6.11.0", + "qs": "6.13.0", "range-parser": "~1.2.1", "safe-buffer": "5.2.1", "send": "0.19.0", - "serve-static": "1.16.0", + "serve-static": "1.16.2", "setprototypeof": "1.2.0", "statuses": "2.0.1", "type-is": "~1.6.18", diff --git a/Modules/Chatroom/chat/node_modules/finalhandler/HISTORY.md b/Modules/Chatroom/chat/node_modules/finalhandler/HISTORY.md index ec2d38b5d406..7faa4f0afc70 100644 --- a/Modules/Chatroom/chat/node_modules/finalhandler/HISTORY.md +++ b/Modules/Chatroom/chat/node_modules/finalhandler/HISTORY.md @@ -1,3 +1,18 @@ +v1.3.1 / 2024-09-11 +================== + + * deps: encodeurl@~2.0.0 + +v1.3.0 / 2024-09-03 +================== + + * ignore status message for HTTP/2 (#53) + +v1.2.1 / 2024-09-02 +================== + + * Gracefully handle when handling an error and socket is null + 1.2.0 / 2022-03-22 ================== diff --git a/Modules/Chatroom/chat/node_modules/finalhandler/README.md b/Modules/Chatroom/chat/node_modules/finalhandler/README.md index 81f10ef3d6a3..6244a13eb656 100644 --- a/Modules/Chatroom/chat/node_modules/finalhandler/README.md +++ b/Modules/Chatroom/chat/node_modules/finalhandler/README.md @@ -143,5 +143,5 @@ function logerror (err) { [coveralls-url]: https://coveralls.io/r/pillarjs/finalhandler?branch=master [downloads-image]: https://img.shields.io/npm/dm/finalhandler.svg [downloads-url]: https://npmjs.org/package/finalhandler -[github-actions-ci-image]: https://img.shields.io/github/workflow/status/pillarjs/finalhandler/ci/master?label=ci -[github-actions-ci-url]: https://github.com/jshttp/pillarjs/finalhandler?query=workflow%3Aci +[github-actions-ci-image]: https://github.com/pillarjs/finalhandler/actions/workflows/ci.yml/badge.svg +[github-actions-ci-url]: https://github.com/pillarjs/finalhandler/actions/workflows/ci.yml diff --git a/Modules/Chatroom/chat/node_modules/finalhandler/index.js b/Modules/Chatroom/chat/node_modules/finalhandler/index.js index f628e42fa473..ec34be90d153 100644 --- a/Modules/Chatroom/chat/node_modules/finalhandler/index.js +++ b/Modules/Chatroom/chat/node_modules/finalhandler/index.js @@ -125,7 +125,9 @@ function finalhandler (req, res, options) { // cannot actually respond if (headersSent(res)) { debug('cannot %d after headers sent', status) - req.socket.destroy() + if (req.socket) { + req.socket.destroy() + } return } @@ -276,7 +278,10 @@ function send (req, res, status, headers, message) { // response status res.statusCode = status - res.statusMessage = statuses.message[status] + + if (req.httpVersionMajor < 2) { + res.statusMessage = statuses.message[status] + } // remove any content headers res.removeHeader('Content-Encoding') diff --git a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/send/LICENSE b/Modules/Chatroom/chat/node_modules/finalhandler/node_modules/encodeurl/LICENSE similarity index 92% rename from Modules/Chatroom/chat/node_modules/serve-static/node_modules/send/LICENSE rename to Modules/Chatroom/chat/node_modules/finalhandler/node_modules/encodeurl/LICENSE index b6ea1c1fd44f..8812229bc59b 100644 --- a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/send/LICENSE +++ b/Modules/Chatroom/chat/node_modules/finalhandler/node_modules/encodeurl/LICENSE @@ -1,7 +1,6 @@ (The MIT License) -Copyright (c) 2012 TJ Holowaychuk -Copyright (c) 2014-2022 Douglas Christopher Wilson +Copyright (c) 2016 Douglas Christopher Wilson Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff --git a/Modules/Chatroom/chat/node_modules/finalhandler/node_modules/encodeurl/README.md b/Modules/Chatroom/chat/node_modules/finalhandler/node_modules/encodeurl/README.md new file mode 100644 index 000000000000..3842493ec68e --- /dev/null +++ b/Modules/Chatroom/chat/node_modules/finalhandler/node_modules/encodeurl/README.md @@ -0,0 +1,109 @@ +# Encode URL + +Encode a URL to a percent-encoded form, excluding already-encoded sequences. + +## Installation + +```sh +npm install encodeurl +``` + +## API + +```js +var encodeUrl = require('encodeurl') +``` + +### encodeUrl(url) + +Encode a URL to a percent-encoded form, excluding already-encoded sequences. + +This function accepts a URL and encodes all the non-URL code points (as UTF-8 byte sequences). It will not encode the "%" character unless it is not part of a valid sequence (`%20` will be left as-is, but `%foo` will be encoded as `%25foo`). + +This encode is meant to be "safe" and does not throw errors. It will try as hard as it can to properly encode the given URL, including replacing any raw, unpaired surrogate pairs with the Unicode replacement character prior to encoding. + +## Examples + +### Encode a URL containing user-controlled data + +```js +var encodeUrl = require('encodeurl') +var escapeHtml = require('escape-html') + +http.createServer(function onRequest (req, res) { + // get encoded form of inbound url + var url = encodeUrl(req.url) + + // create html message + var body = '

Location ' + escapeHtml(url) + ' not found

' + + // send a 404 + res.statusCode = 404 + res.setHeader('Content-Type', 'text/html; charset=UTF-8') + res.setHeader('Content-Length', String(Buffer.byteLength(body, 'utf-8'))) + res.end(body, 'utf-8') +}) +``` + +### Encode a URL for use in a header field + +```js +var encodeUrl = require('encodeurl') +var escapeHtml = require('escape-html') +var url = require('url') + +http.createServer(function onRequest (req, res) { + // parse inbound url + var href = url.parse(req) + + // set new host for redirect + href.host = 'localhost' + href.protocol = 'https:' + href.slashes = true + + // create location header + var location = encodeUrl(url.format(href)) + + // create html message + var body = '

Redirecting to new site: ' + escapeHtml(location) + '

' + + // send a 301 + res.statusCode = 301 + res.setHeader('Content-Type', 'text/html; charset=UTF-8') + res.setHeader('Content-Length', String(Buffer.byteLength(body, 'utf-8'))) + res.setHeader('Location', location) + res.end(body, 'utf-8') +}) +``` + +## Similarities + +This function is _similar_ to the intrinsic function `encodeURI`. However, it will not encode: + +* The `\`, `^`, or `|` characters +* The `%` character when it's part of a valid sequence +* `[` and `]` (for IPv6 hostnames) +* Replaces raw, unpaired surrogate pairs with the Unicode replacement character + +As a result, the encoding aligns closely with the behavior in the [WHATWG URL specification][whatwg-url]. However, this package only encodes strings and does not do any URL parsing or formatting. + +It is expected that any output from `new URL(url)` will not change when used with this package, as the output has already been encoded. Additionally, if we were to encode before `new URL(url)`, we do not expect the before and after encoded formats to be parsed any differently. + +## Testing + +```sh +$ npm test +$ npm run lint +``` + +## References + +- [RFC 3986: Uniform Resource Identifier (URI): Generic Syntax][rfc-3986] +- [WHATWG URL Living Standard][whatwg-url] + +[rfc-3986]: https://tools.ietf.org/html/rfc3986 +[whatwg-url]: https://url.spec.whatwg.org/ + +## License + +[MIT](LICENSE) diff --git a/Modules/Chatroom/chat/node_modules/finalhandler/node_modules/encodeurl/index.js b/Modules/Chatroom/chat/node_modules/finalhandler/node_modules/encodeurl/index.js new file mode 100644 index 000000000000..a49ee5a0b621 --- /dev/null +++ b/Modules/Chatroom/chat/node_modules/finalhandler/node_modules/encodeurl/index.js @@ -0,0 +1,60 @@ +/*! + * encodeurl + * Copyright(c) 2016 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module exports. + * @public + */ + +module.exports = encodeUrl + +/** + * RegExp to match non-URL code points, *after* encoding (i.e. not including "%") + * and including invalid escape sequences. + * @private + */ + +var ENCODE_CHARS_REGEXP = /(?:[^\x21\x23-\x3B\x3D\x3F-\x5F\x61-\x7A\x7C\x7E]|%(?:[^0-9A-Fa-f]|[0-9A-Fa-f][^0-9A-Fa-f]|$))+/g + +/** + * RegExp to match unmatched surrogate pair. + * @private + */ + +var UNMATCHED_SURROGATE_PAIR_REGEXP = /(^|[^\uD800-\uDBFF])[\uDC00-\uDFFF]|[\uD800-\uDBFF]([^\uDC00-\uDFFF]|$)/g + +/** + * String to replace unmatched surrogate pair with. + * @private + */ + +var UNMATCHED_SURROGATE_PAIR_REPLACE = '$1\uFFFD$2' + +/** + * Encode a URL to a percent-encoded form, excluding already-encoded sequences. + * + * This function will take an already-encoded URL and encode all the non-URL + * code points. This function will not encode the "%" character unless it is + * not part of a valid sequence (`%20` will be left as-is, but `%foo` will + * be encoded as `%25foo`). + * + * This encode is meant to be "safe" and does not throw errors. It will try as + * hard as it can to properly encode the given URL, including replacing any raw, + * unpaired surrogate pairs with the Unicode replacement character prior to + * encoding. + * + * @param {string} url + * @return {string} + * @public + */ + +function encodeUrl (url) { + return String(url) + .replace(UNMATCHED_SURROGATE_PAIR_REGEXP, UNMATCHED_SURROGATE_PAIR_REPLACE) + .replace(ENCODE_CHARS_REGEXP, encodeURI) +} diff --git a/Modules/Chatroom/chat/node_modules/finalhandler/node_modules/encodeurl/package.json b/Modules/Chatroom/chat/node_modules/finalhandler/node_modules/encodeurl/package.json new file mode 100644 index 000000000000..313382214599 --- /dev/null +++ b/Modules/Chatroom/chat/node_modules/finalhandler/node_modules/encodeurl/package.json @@ -0,0 +1,40 @@ +{ + "name": "encodeurl", + "description": "Encode a URL to a percent-encoded form, excluding already-encoded sequences", + "version": "2.0.0", + "contributors": [ + "Douglas Christopher Wilson " + ], + "license": "MIT", + "keywords": [ + "encode", + "encodeurl", + "url" + ], + "repository": "pillarjs/encodeurl", + "devDependencies": { + "eslint": "5.11.1", + "eslint-config-standard": "12.0.0", + "eslint-plugin-import": "2.14.0", + "eslint-plugin-node": "7.0.1", + "eslint-plugin-promise": "4.0.1", + "eslint-plugin-standard": "4.0.0", + "istanbul": "0.4.5", + "mocha": "2.5.3" + }, + "files": [ + "LICENSE", + "HISTORY.md", + "README.md", + "index.js" + ], + "engines": { + "node": ">= 0.8" + }, + "scripts": { + "lint": "eslint .", + "test": "mocha --reporter spec --bail --check-leaks test/", + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", + "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" + } +} diff --git a/Modules/Chatroom/chat/node_modules/finalhandler/package.json b/Modules/Chatroom/chat/node_modules/finalhandler/package.json index 16bf11ed7c1b..2363eb4dac2f 100644 --- a/Modules/Chatroom/chat/node_modules/finalhandler/package.json +++ b/Modules/Chatroom/chat/node_modules/finalhandler/package.json @@ -1,13 +1,13 @@ { "name": "finalhandler", "description": "Node.js final http responder", - "version": "1.2.0", + "version": "1.3.1", "author": "Douglas Christopher Wilson ", "license": "MIT", "repository": "pillarjs/finalhandler", "dependencies": { "debug": "2.6.9", - "encodeurl": "~1.0.2", + "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "on-finished": "2.4.1", "parseurl": "~1.3.3", @@ -17,16 +17,16 @@ "devDependencies": { "eslint": "7.32.0", "eslint-config-standard": "14.1.1", - "eslint-plugin-import": "2.25.4", + "eslint-plugin-import": "2.26.0", "eslint-plugin-markdown": "2.2.1", "eslint-plugin-node": "11.1.0", "eslint-plugin-promise": "5.2.0", "eslint-plugin-standard": "4.1.0", - "mocha": "9.2.2", + "mocha": "10.0.0", "nyc": "15.1.0", "readable-stream": "2.3.6", "safe-buffer": "5.2.1", - "supertest": "6.2.2" + "supertest": "6.2.4" }, "files": [ "LICENSE", @@ -39,8 +39,9 @@ }, "scripts": { "lint": "eslint .", - "test": "mocha --reporter spec --bail --check-leaks test/", + "test": "mocha --reporter spec --check-leaks test/", "test-ci": "nyc --reporter=lcovonly --reporter=text npm test", - "test-cov": "nyc --reporter=html --reporter=text npm test" + "test-cov": "nyc --reporter=html --reporter=text npm test", + "test-inspect": "mocha --reporter spec --inspect --inspect-brk test/" } } diff --git a/Modules/Chatroom/chat/node_modules/qs/.editorconfig b/Modules/Chatroom/chat/node_modules/qs/.editorconfig index 2f084445078a..6adecfbf4cb3 100644 --- a/Modules/Chatroom/chat/node_modules/qs/.editorconfig +++ b/Modules/Chatroom/chat/node_modules/qs/.editorconfig @@ -41,3 +41,6 @@ max_line_length = off [.nycrc] indent_style = tab + +[tea.yaml] +indent_size = 2 diff --git a/Modules/Chatroom/chat/node_modules/qs/.eslintrc b/Modules/Chatroom/chat/node_modules/qs/.eslintrc index 35220cd9113c..b6927611e43b 100644 --- a/Modules/Chatroom/chat/node_modules/qs/.eslintrc +++ b/Modules/Chatroom/chat/node_modules/qs/.eslintrc @@ -14,8 +14,8 @@ "id-length": [2, { "min": 1, "max": 25, "properties": "never" }], "indent": [2, 4], "max-lines-per-function": [2, { "max": 150 }], - "max-params": [2, 16], - "max-statements": [2, 53], + "max-params": [2, 18], + "max-statements": [2, 100], "multiline-comment-style": 0, "no-continue": 1, "no-magic-numbers": 0, diff --git a/Modules/Chatroom/chat/node_modules/qs/CHANGELOG.md b/Modules/Chatroom/chat/node_modules/qs/CHANGELOG.md index 37b1d3f04e97..02a6b504fc9c 100644 --- a/Modules/Chatroom/chat/node_modules/qs/CHANGELOG.md +++ b/Modules/Chatroom/chat/node_modules/qs/CHANGELOG.md @@ -1,4 +1,58 @@ -## **6.11.0 +## **6.13.0** +- [New] `parse`: add `strictDepth` option (#511) +- [Tests] use `npm audit` instead of `aud` + +## **6.12.3** +- [Fix] `parse`: properly account for `strictNullHandling` when `allowEmptyArrays` +- [meta] fix changelog indentation + +## **6.12.2** +- [Fix] `parse`: parse encoded square brackets (#506) +- [readme] add CII best practices badge + +## **6.12.1** +- [Fix] `parse`: Disable `decodeDotInKeys` by default to restore previous behavior (#501) +- [Performance] `utils`: Optimize performance under large data volumes, reduce memory usage, and speed up processing (#502) +- [Refactor] `utils`: use `+=` +- [Tests] increase coverage + +## **6.12.0** + +- [New] `parse`/`stringify`: add `decodeDotInKeys`/`encodeDotKeys` options (#488) +- [New] `parse`: add `duplicates` option +- [New] `parse`/`stringify`: add `allowEmptyArrays` option to allow [] in object values (#487) +- [Refactor] `parse`/`stringify`: move allowDots config logic to its own variable +- [Refactor] `stringify`: move option-handling code into `normalizeStringifyOptions` +- [readme] update readme, add logos (#484) +- [readme] `stringify`: clarify default `arrayFormat` behavior +- [readme] fix line wrapping +- [readme] remove dead badges +- [Deps] update `side-channel` +- [meta] make the dist build 50% smaller +- [meta] add `sideEffects` flag +- [meta] run build in prepack, not prepublish +- [Tests] `parse`: remove useless tests; add coverage +- [Tests] `stringify`: increase coverage +- [Tests] use `mock-property` +- [Tests] `stringify`: improve coverage +- [Dev Deps] update `@ljharb/eslint-config `, `aud`, `has-override-mistake`, `has-property-descriptors`, `mock-property`, `npmignore`, `object-inspect`, `tape` +- [Dev Deps] pin `glob`, since v10.3.8+ requires a broken `jackspeak` +- [Dev Deps] pin `jackspeak` since 2.1.2+ depends on npm aliases, which kill the install process in npm < 6 + +## **6.11.2** +- [Fix] `parse`: Fix parsing when the global Object prototype is frozen (#473) +- [Tests] add passing test cases with empty keys (#473) + +## **6.11.1** +- [Fix] `stringify`: encode comma values more consistently (#463) +- [readme] add usage of `filter` option for injecting custom serialization, i.e. of custom types (#447) +- [meta] remove extraneous code backticks (#457) +- [meta] fix changelog markdown +- [actions] update checkout action +- [actions] restrict action permissions +- [Dev Deps] update `@ljharb/eslint-config`, `aud`, `object-inspect`, `tape` + +## **6.11.0** - [New] [Fix] `stringify`: revert 0e903c0; add `commaRoundTrip` option (#442) - [readme] fix version badge @@ -238,7 +292,7 @@ ## **6.5.3** - [Fix] `parse`: ignore `__proto__` keys (#428) -- [Fix]` `utils.merge`: avoid a crash with a null target and a truthy non-array source +- [Fix] `utils.merge`: avoid a crash with a null target and a truthy non-array source - [Fix] correctly parse nested arrays - [Fix] `stringify`: fix a crash with `strictNullHandling` and a custom `filter`/`serializeDate` (#279) - [Fix] `utils`: `merge`: fix crash when `source` is a truthy primitive & no options are provided @@ -291,7 +345,7 @@ - [Fix] fix for an impossible situation: when the formatter is called with a non-string value - [Fix] use `safer-buffer` instead of `Buffer` constructor - [Fix] `utils.merge`: avoid a crash with a null target and an array source -- [Fix]` `utils.merge`: avoid a crash with a null target and a truthy non-array source +- [Fix] `utils.merge`: avoid a crash with a null target and a truthy non-array source - [Fix] `stringify`: fix a crash with `strictNullHandling` and a custom `filter`/`serializeDate` (#279) - [Fix] `utils`: `merge`: fix crash when `source` is a truthy primitive & no options are provided - [Fix] when `parseArrays` is false, properly handle keys ending in `[]` @@ -320,7 +374,7 @@ - [Fix] `parse`: ignore `__proto__` keys (#428) - [Fix] fix for an impossible situation: when the formatter is called with a non-string value - [Fix] `utils.merge`: avoid a crash with a null target and an array source -- [Fix]` `utils.merge`: avoid a crash with a null target and a truthy non-array source +- [Fix] `utils.merge`: avoid a crash with a null target and a truthy non-array source - [Fix] `stringify`: fix a crash with `strictNullHandling` and a custom `filter`/`serializeDate` (#279) - [Fix] `utils`: `merge`: fix crash when `source` is a truthy primitive & no options are provided - [Fix] when `parseArrays` is false, properly handle keys ending in `[]` @@ -407,7 +461,7 @@ - [New] add "encoder" and "decoder" options, for custom param encoding/decoding (#160) - [Fix] fix compacting of nested sparse arrays (#150) -## **6.1.2 +## **6.1.2** - [Fix] follow `allowPrototypes` option during merge (#201, #200) - [Fix] chmod a-x - [Fix] support keys starting with brackets (#202, #200) diff --git a/Modules/Chatroom/chat/node_modules/qs/README.md b/Modules/Chatroom/chat/node_modules/qs/README.md index 11be8531dd58..1e0d9adc482d 100644 --- a/Modules/Chatroom/chat/node_modules/qs/README.md +++ b/Modules/Chatroom/chat/node_modules/qs/README.md @@ -1,11 +1,14 @@ +

+ qs +

+ # qs [![Version Badge][npm-version-svg]][package-url] [![github actions][actions-image]][actions-url] [![coverage][codecov-image]][codecov-url] -[![dependency status][deps-svg]][deps-url] -[![dev dependency status][dev-deps-svg]][dev-deps-url] [![License][license-image]][license-url] [![Downloads][downloads-image]][downloads-url] +[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/9058/badge)](https://bestpractices.coreinfrastructure.org/projects/9058) [![npm badge][npm-badge-png]][package-url] @@ -53,7 +56,9 @@ var nullObject = qs.parse('a[hasOwnProperty]=b', { plainObjects: true }); assert.deepEqual(nullObject, { a: { hasOwnProperty: 'b' } }); ``` -By default parameters that would overwrite properties on the object prototype are ignored, if you wish to keep the data from those fields either use `plainObjects` as mentioned above, or set `allowPrototypes` to `true` which will allow user input to overwrite those properties. *WARNING* It is generally a bad idea to enable this option as it can cause problems when attempting to use the properties that have been overwritten. Always be careful with this option. +By default parameters that would overwrite properties on the object prototype are ignored, if you wish to keep the data from those fields either use `plainObjects` as mentioned above, or set `allowPrototypes` to `true` which will allow user input to overwrite those properties. +*WARNING* It is generally a bad idea to enable this option as it can cause problems when attempting to use the properties that have been overwritten. +Always be careful with this option. ```javascript var protoObject = qs.parse('a[hasOwnProperty]=b', { allowPrototypes: true }); @@ -80,8 +85,8 @@ assert.deepEqual(qs.parse('foo[bar][baz]=foobarbaz'), { }); ``` -By default, when nesting objects **qs** will only parse up to 5 children deep. This means if you attempt to parse a string like -`'a[b][c][d][e][f][g][h][i]=j'` your resulting object will be: +By default, when nesting objects **qs** will only parse up to 5 children deep. +This means if you attempt to parse a string like `'a[b][c][d][e][f][g][h][i]=j'` your resulting object will be: ```javascript var expected = { @@ -110,7 +115,18 @@ var deep = qs.parse('a[b][c][d][e][f][g][h][i]=j', { depth: 1 }); assert.deepEqual(deep, { a: { b: { '[c][d][e][f][g][h][i]': 'j' } } }); ``` -The depth limit helps mitigate abuse when **qs** is used to parse user input, and it is recommended to keep it a reasonably small number. +You can configure **qs** to throw an error when parsing nested input beyond this depth using the `strictDepth` option (defaulted to false): + +```javascript +try { + qs.parse('a[b][c][d][e][f][g][h][i]=j', { depth: 1, strictDepth: true }); +} catch (err) { + assert(err instanceof RangeError); + assert.strictEqual(err.message, 'Input depth exceeded depth option of 1 and strictDepth is true'); +} +``` + +The depth limit helps mitigate abuse when **qs** is used to parse user input, and it is recommended to keep it a reasonably small number. The strictDepth option adds a layer of protection by throwing an error when the limit is exceeded, allowing you to catch and handle such cases. For similar reasons, by default **qs** will only parse up to 1000 parameters. This can be overridden by passing a `parameterLimit` option: @@ -147,32 +163,44 @@ var withDots = qs.parse('a.b=c', { allowDots: true }); assert.deepEqual(withDots, { a: { b: 'c' } }); ``` -If you have to deal with legacy browsers or services, there's -also support for decoding percent-encoded octets as iso-8859-1: +Option `decodeDotInKeys` can be used to decode dots in keys +Note: it implies `allowDots`, so `parse` will error if you set `decodeDotInKeys` to `true`, and `allowDots` to `false`. + +```javascript +var withDots = qs.parse('name%252Eobj.first=John&name%252Eobj.last=Doe', { decodeDotInKeys: true }); +assert.deepEqual(withDots, { 'name.obj': { first: 'John', last: 'Doe' }}); +``` + +Option `allowEmptyArrays` can be used to allowing empty array values in object +```javascript +var withEmptyArrays = qs.parse('foo[]&bar=baz', { allowEmptyArrays: true }); +assert.deepEqual(withEmptyArrays, { foo: [], bar: 'baz' }); +``` + +Option `duplicates` can be used to change the behavior when duplicate keys are encountered +```javascript +assert.deepEqual(qs.parse('foo=bar&foo=baz'), { foo: ['bar', 'baz'] }); +assert.deepEqual(qs.parse('foo=bar&foo=baz', { duplicates: 'combine' }), { foo: ['bar', 'baz'] }); +assert.deepEqual(qs.parse('foo=bar&foo=baz', { duplicates: 'first' }), { foo: 'bar' }); +assert.deepEqual(qs.parse('foo=bar&foo=baz', { duplicates: 'last' }), { foo: 'baz' }); +``` + +If you have to deal with legacy browsers or services, there's also support for decoding percent-encoded octets as iso-8859-1: ```javascript var oldCharset = qs.parse('a=%A7', { charset: 'iso-8859-1' }); assert.deepEqual(oldCharset, { a: '§' }); ``` -Some services add an initial `utf8=✓` value to forms so that old -Internet Explorer versions are more likely to submit the form as -utf-8. Additionally, the server can check the value against wrong -encodings of the checkmark character and detect that a query string -or `application/x-www-form-urlencoded` body was *not* sent as -utf-8, eg. if the form had an `accept-charset` parameter or the -containing page had a different character set. +Some services add an initial `utf8=✓` value to forms so that old Internet Explorer versions are more likely to submit the form as utf-8. +Additionally, the server can check the value against wrong encodings of the checkmark character and detect that a query string or `application/x-www-form-urlencoded` body was *not* sent as utf-8, eg. if the form had an `accept-charset` parameter or the containing page had a different character set. **qs** supports this mechanism via the `charsetSentinel` option. -If specified, the `utf8` parameter will be omitted from the -returned object. It will be used to switch to `iso-8859-1`/`utf-8` -mode depending on how the checkmark is encoded. +If specified, the `utf8` parameter will be omitted from the returned object. +It will be used to switch to `iso-8859-1`/`utf-8` mode depending on how the checkmark is encoded. -**Important**: When you specify both the `charset` option and the -`charsetSentinel` option, the `charset` will be overridden when -the request contains a `utf8` parameter from which the actual -charset can be deduced. In that sense the `charset` will behave -as the default charset rather than the authoritative charset. +**Important**: When you specify both the `charset` option and the `charsetSentinel` option, the `charset` will be overridden when the request contains a `utf8` parameter from which the actual charset can be deduced. +In that sense the `charset` will behave as the default charset rather than the authoritative charset. ```javascript var detectedAsUtf8 = qs.parse('utf8=%E2%9C%93&a=%C3%B8', { @@ -189,8 +217,7 @@ var detectedAsIso8859_1 = qs.parse('utf8=%26%2310003%3B&a=%F8', { assert.deepEqual(detectedAsIso8859_1, { a: 'ø' }); ``` -If you want to decode the `&#...;` syntax to the actual character, -you can specify the `interpretNumericEntities` option as well: +If you want to decode the `&#...;` syntax to the actual character, you can specify the `interpretNumericEntities` option as well: ```javascript var detectedAsIso8859_1 = qs.parse('a=%26%239786%3B', { @@ -200,8 +227,7 @@ var detectedAsIso8859_1 = qs.parse('a=%26%239786%3B', { assert.deepEqual(detectedAsIso8859_1, { a: '☺' }); ``` -It also works when the charset has been detected in `charsetSentinel` -mode. +It also works when the charset has been detected in `charsetSentinel` mode. ### Parsing Arrays @@ -219,9 +245,8 @@ var withIndexes = qs.parse('a[1]=c&a[0]=b'); assert.deepEqual(withIndexes, { a: ['b', 'c'] }); ``` -Note that the only difference between an index in an array and a key in an object is that the value between the brackets must be a number -to create an array. When creating arrays with specific indices, **qs** will compact a sparse array to only the existing values preserving -their order: +Note that the only difference between an index in an array and a key in an object is that the value between the brackets must be a number to create an array. +When creating arrays with specific indices, **qs** will compact a sparse array to only the existing values preserving their order: ```javascript var noSparse = qs.parse('a[1]=b&a[15]=c'); @@ -245,8 +270,9 @@ var withIndexedEmptyString = qs.parse('a[0]=b&a[1]=&a[2]=c'); assert.deepEqual(withIndexedEmptyString, { a: ['b', '', 'c'] }); ``` -**qs** will also limit specifying indices in an array to a maximum index of `20`. Any array members with an index of greater than `20` will -instead be converted to an object with the index as the key. This is needed to handle cases when someone sent, for example, `a[999999999]` and it will take significant time to iterate over this huge array. +**qs** will also limit specifying indices in an array to a maximum index of `20`. +Any array members with an index of greater than `20` will instead be converted to an object with the index as the key. +This is needed to handle cases when someone sent, for example, `a[999999999]` and it will take significant time to iterate over this huge array. ```javascript var withMaxIndex = qs.parse('a[100]=b'); @@ -290,7 +316,8 @@ assert.deepEqual(arraysOfObjects, { a: ['b', 'c'] }) ### Parsing primitive/scalar values (numbers, booleans, null, etc) -By default, all values are parsed as strings. This behavior will not change and is explained in [issue #91](https://github.com/ljharb/qs/issues/91). +By default, all values are parsed as strings. +This behavior will not change and is explained in [issue #91](https://github.com/ljharb/qs/issues/91). ```javascript var primitiveValues = qs.parse('a=15&b=true&c=null'); @@ -373,16 +400,17 @@ var decoded = qs.parse('x=z', { decoder: function (str, defaultDecoder, charset, }}) ``` -Examples beyond this point will be shown as though the output is not URI encoded for clarity. Please note that the return values in these cases *will* be URI encoded during real usage. +Examples beyond this point will be shown as though the output is not URI encoded for clarity. +Please note that the return values in these cases *will* be URI encoded during real usage. -When arrays are stringified, by default they are given explicit indices: +When arrays are stringified, they follow the `arrayFormat` option, which defaults to `indices`: ```javascript qs.stringify({ a: ['b', 'c', 'd'] }); // 'a[0]=b&a[1]=c&a[2]=d' ``` -You may override this by setting the `indices` option to `false`: +You may override this by setting the `indices` option to `false`, or to be more explicit, the `arrayFormat` option to `repeat`: ```javascript qs.stringify({ a: ['b', 'c', 'd'] }, { indices: false }); @@ -418,6 +446,20 @@ qs.stringify({ a: { b: { c: 'd', e: 'f' } } }, { allowDots: true }); // 'a.b.c=d&a.b.e=f' ``` +You may encode the dot notation in the keys of object with option `encodeDotInKeys` by setting it to `true`: +Note: it implies `allowDots`, so `stringify` will error if you set `decodeDotInKeys` to `true`, and `allowDots` to `false`. +Caveat: when `encodeValuesOnly` is `true` as well as `encodeDotInKeys`, only dots in keys and nothing else will be encoded. +```javascript +qs.stringify({ "name.obj": { "first": "John", "last": "Doe" } }, { allowDots: true, encodeDotInKeys: true }) +// 'name%252Eobj.first=John&name%252Eobj.last=Doe' +``` + +You may allow empty array values by setting the `allowEmptyArrays` option to `true`: +```javascript +qs.stringify({ foo: [], bar: 'baz' }, { allowEmptyArrays: true }); +// 'foo[]&bar=baz' +``` + Empty strings and null values will omit the value, but the equals sign (=) remains in place: ```javascript @@ -473,8 +515,8 @@ assert.equal(qs.stringify({ a: 'c', z: 'y', b : 'f' }, { sort: alphabeticalSort ``` Finally, you can use the `filter` option to restrict which keys will be included in the stringified output. -If you pass a function, it will be called for each key to obtain the replacement value. Otherwise, if you -pass an array, it will be used to select properties and array indices for stringification: +If you pass a function, it will be called for each key to obtain the replacement value. +Otherwise, if you pass an array, it will be used to select properties and array indices for stringification: ```javascript function filterFunc(prefix, value) { @@ -498,6 +540,44 @@ qs.stringify({ a: ['b', 'c', 'd'], e: 'f' }, { filter: ['a', 0, 2] }); // 'a[0]=b&a[2]=d' ``` +You could also use `filter` to inject custom serialization for user defined types. +Consider you're working with some api that expects query strings of the format for ranges: + +``` +https://domain.com/endpoint?range=30...70 +``` + +For which you model as: + +```javascript +class Range { + constructor(from, to) { + this.from = from; + this.to = to; + } +} +``` + +You could _inject_ a custom serializer to handle values of this type: + +```javascript +qs.stringify( + { + range: new Range(30, 70), + }, + { + filter: (prefix, value) => { + if (value instanceof Range) { + return `${value.from}...${value.to}`; + } + // serialize the usual way + return value; + }, + } +); +// range=30...70 +``` + ### Handling of `null` values By default, `null` values are treated like empty strings: @@ -507,7 +587,8 @@ var withNull = qs.stringify({ a: null, b: '' }); assert.equal(withNull, 'a=&b='); ``` -Parsing does not distinguish between parameters with and without equal signs. Both are converted to empty strings. +Parsing does not distinguish between parameters with and without equal signs. +Both are converted to empty strings. ```javascript var equalsInsensitive = qs.parse('a&b='); @@ -536,25 +617,21 @@ var nullsSkipped = qs.stringify({ a: 'b', c: null}, { skipNulls: true }); assert.equal(nullsSkipped, 'a=b'); ``` -If you're communicating with legacy systems, you can switch to `iso-8859-1` -using the `charset` option: +If you're communicating with legacy systems, you can switch to `iso-8859-1` using the `charset` option: ```javascript var iso = qs.stringify({ æ: 'æ' }, { charset: 'iso-8859-1' }); assert.equal(iso, '%E6=%E6'); ``` -Characters that don't exist in `iso-8859-1` will be converted to numeric -entities, similar to what browsers do: +Characters that don't exist in `iso-8859-1` will be converted to numeric entities, similar to what browsers do: ```javascript var numeric = qs.stringify({ a: '☺' }, { charset: 'iso-8859-1' }); assert.equal(numeric, 'a=%26%239786%3B'); ``` -You can use the `charsetSentinel` option to announce the character by -including an `utf8=✓` parameter with the proper encoding if the checkmark, -similar to what Ruby on Rails and others do when submitting forms. +You can use the `charsetSentinel` option to announce the character by including an `utf8=✓` parameter with the proper encoding if the checkmark, similar to what Ruby on Rails and others do when submitting forms. ```javascript var sentinel = qs.stringify({ a: '☺' }, { charsetSentinel: true }); @@ -566,8 +643,7 @@ assert.equal(isoSentinel, 'utf8=%26%2310003%3B&a=%E6'); ### Dealing with special character sets -By default the encoding and decoding of characters is done in `utf-8`, -and `iso-8859-1` support is also built in via the `charset` parameter. +By default the encoding and decoding of characters is done in `utf-8`, and `iso-8859-1` support is also built in via the `charset` parameter. If you wish to encode querystrings to a different character set (i.e. [Shift JIS](https://en.wikipedia.org/wiki/Shift_JIS)) you can use the @@ -606,7 +682,9 @@ Please email [@ljharb](https://github.com/ljharb) or see https://tidelift.com/se Available as part of the Tidelift Subscription -The maintainers of qs and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-qs?utm_source=npm-qs&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) +The maintainers of qs and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. +Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. +[Learn more.](https://tidelift.com/subscription/pkg/npm-qs?utm_source=npm-qs&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) [package-url]: https://npmjs.org/package/qs [npm-version-svg]: https://versionbadg.es/ljharb/qs.svg @@ -623,3 +701,9 @@ The maintainers of qs and thousands of other packages are working with Tidelift [codecov-url]: https://app.codecov.io/gh/ljharb/qs/ [actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/qs [actions-url]: https://github.com/ljharb/qs/actions + +## Acknowledgements + +qs logo by [NUMI](https://github.com/numi-hq/open-design): + +[NUMI Logo](https://numi.tech/?ref=qs) diff --git a/Modules/Chatroom/chat/node_modules/qs/dist/qs.js b/Modules/Chatroom/chat/node_modules/qs/dist/qs.js index 1c620a48d38d..154e72e575b0 100644 --- a/Modules/Chatroom/chat/node_modules/qs/dist/qs.js +++ b/Modules/Chatroom/chat/node_modules/qs/dist/qs.js @@ -1,2054 +1,90 @@ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Qs = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i -1) { - return val.split(','); - } - - return val; -}; - -// This is what browsers will submit when the ✓ character occurs in an -// application/x-www-form-urlencoded body and the encoding of the page containing -// the form is iso-8859-1, or when the submitted form has an accept-charset -// attribute of iso-8859-1. Presumably also with other charsets that do not contain -// the ✓ character, such as us-ascii. -var isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('✓') - -// These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded. -var charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓') - -var parseValues = function parseQueryStringValues(str, options) { - var obj = {}; - var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str; - var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit; - var parts = cleanStr.split(options.delimiter, limit); - var skipIndex = -1; // Keep track of where the utf8 sentinel was found - var i; - - var charset = options.charset; - if (options.charsetSentinel) { - for (i = 0; i < parts.length; ++i) { - if (parts[i].indexOf('utf8=') === 0) { - if (parts[i] === charsetSentinel) { - charset = 'utf-8'; - } else if (parts[i] === isoSentinel) { - charset = 'iso-8859-1'; - } - skipIndex = i; - i = parts.length; // The eslint settings do not allow break; - } - } - } - - for (i = 0; i < parts.length; ++i) { - if (i === skipIndex) { - continue; - } - var part = parts[i]; - - var bracketEqualsPos = part.indexOf(']='); - var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1; - - var key, val; - if (pos === -1) { - key = options.decoder(part, defaults.decoder, charset, 'key'); - val = options.strictNullHandling ? null : ''; - } else { - key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key'); - val = utils.maybeMap( - parseArrayValue(part.slice(pos + 1), options), - function (encodedVal) { - return options.decoder(encodedVal, defaults.decoder, charset, 'value'); - } - ); - } - - if (val && options.interpretNumericEntities && charset === 'iso-8859-1') { - val = interpretNumericEntities(val); - } - - if (part.indexOf('[]=') > -1) { - val = isArray(val) ? [val] : val; - } - - if (has.call(obj, key)) { - obj[key] = utils.combine(obj[key], val); - } else { - obj[key] = val; - } - } - - return obj; -}; - -var parseObject = function (chain, val, options, valuesParsed) { - var leaf = valuesParsed ? val : parseArrayValue(val, options); - - for (var i = chain.length - 1; i >= 0; --i) { - var obj; - var root = chain[i]; - - if (root === '[]' && options.parseArrays) { - obj = [].concat(leaf); - } else { - obj = options.plainObjects ? Object.create(null) : {}; - var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root; - var index = parseInt(cleanRoot, 10); - if (!options.parseArrays && cleanRoot === '') { - obj = { 0: leaf }; - } else if ( - !isNaN(index) - && root !== cleanRoot - && String(index) === cleanRoot - && index >= 0 - && (options.parseArrays && index <= options.arrayLimit) - ) { - obj = []; - obj[index] = leaf; - } else if (cleanRoot !== '__proto__') { - obj[cleanRoot] = leaf; - } - } - - leaf = obj; - } - - return leaf; -}; - -var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) { - if (!givenKey) { - return; - } - - // Transform dot notation to bracket notation - var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey; - - // The regex chunks - - var brackets = /(\[[^[\]]*])/; - var child = /(\[[^[\]]*])/g; - - // Get the parent - - var segment = options.depth > 0 && brackets.exec(key); - var parent = segment ? key.slice(0, segment.index) : key; - - // Stash the parent if it exists - - var keys = []; - if (parent) { - // If we aren't using plain objects, optionally prefix keys that would overwrite object prototype properties - if (!options.plainObjects && has.call(Object.prototype, parent)) { - if (!options.allowPrototypes) { - return; - } - } - - keys.push(parent); - } - - // Loop through children appending to the array until we hit depth - - var i = 0; - while (options.depth > 0 && (segment = child.exec(key)) !== null && i < options.depth) { - i += 1; - if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) { - if (!options.allowPrototypes) { - return; - } - } - keys.push(segment[1]); - } - - // If there's a remainder, just add whatever is left - - if (segment) { - keys.push('[' + key.slice(segment.index) + ']'); - } - - return parseObject(keys, val, options, valuesParsed); -}; - -var normalizeParseOptions = function normalizeParseOptions(opts) { - if (!opts) { - return defaults; - } - - if (opts.decoder !== null && opts.decoder !== undefined && typeof opts.decoder !== 'function') { - throw new TypeError('Decoder has to be a function.'); - } - - if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') { - throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined'); - } - var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset; - - return { - allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots, - allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes, - allowSparse: typeof opts.allowSparse === 'boolean' ? opts.allowSparse : defaults.allowSparse, - arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit, - charset: charset, - charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel, - comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma, - decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder, - delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter, - // eslint-disable-next-line no-implicit-coercion, no-extra-parens - depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults.depth, - ignoreQueryPrefix: opts.ignoreQueryPrefix === true, - interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities, - parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit, - parseArrays: opts.parseArrays !== false, - plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects, - strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling - }; -}; - -module.exports = function (str, opts) { - var options = normalizeParseOptions(opts); - - if (str === '' || str === null || typeof str === 'undefined') { - return options.plainObjects ? Object.create(null) : {}; - } - - var tempObj = typeof str === 'string' ? parseValues(str, options) : str; - var obj = options.plainObjects ? Object.create(null) : {}; - - // Iterate over the keys and setup the new object - - var keys = Object.keys(tempObj); - for (var i = 0; i < keys.length; ++i) { - var key = keys[i]; - var newObj = parseKeys(key, tempObj[key], options, typeof str === 'string'); - obj = utils.merge(obj, newObj, options); - } - - if (options.allowSparse === true) { - return obj; - } - - return utils.compact(obj); -}; - -},{"./utils":5}],4:[function(require,module,exports){ -'use strict'; - -var getSideChannel = require('side-channel'); -var utils = require('./utils'); -var formats = require('./formats'); -var has = Object.prototype.hasOwnProperty; - -var arrayPrefixGenerators = { - brackets: function brackets(prefix) { - return prefix + '[]'; - }, - comma: 'comma', - indices: function indices(prefix, key) { - return prefix + '[' + key + ']'; - }, - repeat: function repeat(prefix) { - return prefix; - } -}; - -var isArray = Array.isArray; -var split = String.prototype.split; -var push = Array.prototype.push; -var pushToArray = function (arr, valueOrArray) { - push.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]); -}; - -var toISO = Date.prototype.toISOString; - -var defaultFormat = formats['default']; -var defaults = { - addQueryPrefix: false, - allowDots: false, - charset: 'utf-8', - charsetSentinel: false, - delimiter: '&', - encode: true, - encoder: utils.encode, - encodeValuesOnly: false, - format: defaultFormat, - formatter: formats.formatters[defaultFormat], - // deprecated - indices: false, - serializeDate: function serializeDate(date) { - return toISO.call(date); - }, - skipNulls: false, - strictNullHandling: false -}; - -var isNonNullishPrimitive = function isNonNullishPrimitive(v) { - return typeof v === 'string' - || typeof v === 'number' - || typeof v === 'boolean' - || typeof v === 'symbol' - || typeof v === 'bigint'; -}; - -var sentinel = {}; - -var stringify = function stringify( - object, - prefix, - generateArrayPrefix, - commaRoundTrip, - strictNullHandling, - skipNulls, - encoder, - filter, - sort, - allowDots, - serializeDate, - format, - formatter, - encodeValuesOnly, - charset, - sideChannel -) { - var obj = object; - - var tmpSc = sideChannel; - var step = 0; - var findFlag = false; - while ((tmpSc = tmpSc.get(sentinel)) !== void undefined && !findFlag) { - // Where object last appeared in the ref tree - var pos = tmpSc.get(object); - step += 1; - if (typeof pos !== 'undefined') { - if (pos === step) { - throw new RangeError('Cyclic object value'); - } else { - findFlag = true; // Break while - } - } - if (typeof tmpSc.get(sentinel) === 'undefined') { - step = 0; - } - } - - if (typeof filter === 'function') { - obj = filter(prefix, obj); - } else if (obj instanceof Date) { - obj = serializeDate(obj); - } else if (generateArrayPrefix === 'comma' && isArray(obj)) { - obj = utils.maybeMap(obj, function (value) { - if (value instanceof Date) { - return serializeDate(value); - } - return value; - }); - } - - if (obj === null) { - if (strictNullHandling) { - return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder, charset, 'key', format) : prefix; - } - - obj = ''; - } - - if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) { - if (encoder) { - var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset, 'key', format); - if (generateArrayPrefix === 'comma' && encodeValuesOnly) { - var valuesArray = split.call(String(obj), ','); - var valuesJoined = ''; - for (var i = 0; i < valuesArray.length; ++i) { - valuesJoined += (i === 0 ? '' : ',') + formatter(encoder(valuesArray[i], defaults.encoder, charset, 'value', format)); - } - return [formatter(keyValue) + (commaRoundTrip && isArray(obj) && valuesArray.length === 1 ? '[]' : '') + '=' + valuesJoined]; - } - return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder, charset, 'value', format))]; - } - return [formatter(prefix) + '=' + formatter(String(obj))]; - } - - var values = []; - - if (typeof obj === 'undefined') { - return values; - } - - var objKeys; - if (generateArrayPrefix === 'comma' && isArray(obj)) { - // we need to join elements in - objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : void undefined }]; - } else if (isArray(filter)) { - objKeys = filter; - } else { - var keys = Object.keys(obj); - objKeys = sort ? keys.sort(sort) : keys; - } - - var adjustedPrefix = commaRoundTrip && isArray(obj) && obj.length === 1 ? prefix + '[]' : prefix; - - for (var j = 0; j < objKeys.length; ++j) { - var key = objKeys[j]; - var value = typeof key === 'object' && typeof key.value !== 'undefined' ? key.value : obj[key]; - - if (skipNulls && value === null) { - continue; - } - - var keyPrefix = isArray(obj) - ? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(adjustedPrefix, key) : adjustedPrefix - : adjustedPrefix + (allowDots ? '.' + key : '[' + key + ']'); - - sideChannel.set(object, step); - var valueSideChannel = getSideChannel(); - valueSideChannel.set(sentinel, sideChannel); - pushToArray(values, stringify( - value, - keyPrefix, - generateArrayPrefix, - commaRoundTrip, - strictNullHandling, - skipNulls, - encoder, - filter, - sort, - allowDots, - serializeDate, - format, - formatter, - encodeValuesOnly, - charset, - valueSideChannel - )); - } - - return values; -}; - -var normalizeStringifyOptions = function normalizeStringifyOptions(opts) { - if (!opts) { - return defaults; - } - - if (opts.encoder !== null && typeof opts.encoder !== 'undefined' && typeof opts.encoder !== 'function') { - throw new TypeError('Encoder has to be a function.'); - } - - var charset = opts.charset || defaults.charset; - if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') { - throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined'); - } - - var format = formats['default']; - if (typeof opts.format !== 'undefined') { - if (!has.call(formats.formatters, opts.format)) { - throw new TypeError('Unknown format option provided.'); - } - format = opts.format; - } - var formatter = formats.formatters[format]; - - var filter = defaults.filter; - if (typeof opts.filter === 'function' || isArray(opts.filter)) { - filter = opts.filter; - } - - return { - addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults.addQueryPrefix, - allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots, - charset: charset, - charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel, - delimiter: typeof opts.delimiter === 'undefined' ? defaults.delimiter : opts.delimiter, - encode: typeof opts.encode === 'boolean' ? opts.encode : defaults.encode, - encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults.encoder, - encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults.encodeValuesOnly, - filter: filter, - format: format, - formatter: formatter, - serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults.serializeDate, - skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults.skipNulls, - sort: typeof opts.sort === 'function' ? opts.sort : null, - strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling - }; -}; - -module.exports = function (object, opts) { - var obj = object; - var options = normalizeStringifyOptions(opts); - - var objKeys; - var filter; - - if (typeof options.filter === 'function') { - filter = options.filter; - obj = filter('', obj); - } else if (isArray(options.filter)) { - filter = options.filter; - objKeys = filter; - } - - var keys = []; - - if (typeof obj !== 'object' || obj === null) { - return ''; - } - - var arrayFormat; - if (opts && opts.arrayFormat in arrayPrefixGenerators) { - arrayFormat = opts.arrayFormat; - } else if (opts && 'indices' in opts) { - arrayFormat = opts.indices ? 'indices' : 'repeat'; - } else { - arrayFormat = 'indices'; - } - - var generateArrayPrefix = arrayPrefixGenerators[arrayFormat]; - if (opts && 'commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') { - throw new TypeError('`commaRoundTrip` must be a boolean, or absent'); - } - var commaRoundTrip = generateArrayPrefix === 'comma' && opts && opts.commaRoundTrip; - - if (!objKeys) { - objKeys = Object.keys(obj); - } - - if (options.sort) { - objKeys.sort(options.sort); - } - - var sideChannel = getSideChannel(); - for (var i = 0; i < objKeys.length; ++i) { - var key = objKeys[i]; - - if (options.skipNulls && obj[key] === null) { - continue; - } - pushToArray(keys, stringify( - obj[key], - key, - generateArrayPrefix, - commaRoundTrip, - options.strictNullHandling, - options.skipNulls, - options.encode ? options.encoder : null, - options.filter, - options.sort, - options.allowDots, - options.serializeDate, - options.format, - options.formatter, - options.encodeValuesOnly, - options.charset, - sideChannel - )); - } - - var joined = keys.join(options.delimiter); - var prefix = options.addQueryPrefix === true ? '?' : ''; - - if (options.charsetSentinel) { - if (options.charset === 'iso-8859-1') { - // encodeURIComponent('✓'), the "numeric entity" representation of a checkmark - prefix += 'utf8=%26%2310003%3B&'; - } else { - // encodeURIComponent('✓') - prefix += 'utf8=%E2%9C%93&'; - } - } - - return joined.length > 0 ? prefix + joined : ''; -}; - -},{"./formats":1,"./utils":5,"side-channel":16}],5:[function(require,module,exports){ -'use strict'; - -var formats = require('./formats'); - -var has = Object.prototype.hasOwnProperty; -var isArray = Array.isArray; - -var hexTable = (function () { - var array = []; - for (var i = 0; i < 256; ++i) { - array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase()); - } - - return array; -}()); - -var compactQueue = function compactQueue(queue) { - while (queue.length > 1) { - var item = queue.pop(); - var obj = item.obj[item.prop]; - - if (isArray(obj)) { - var compacted = []; - - for (var j = 0; j < obj.length; ++j) { - if (typeof obj[j] !== 'undefined') { - compacted.push(obj[j]); - } - } - - item.obj[item.prop] = compacted; - } - } -}; - -var arrayToObject = function arrayToObject(source, options) { - var obj = options && options.plainObjects ? Object.create(null) : {}; - for (var i = 0; i < source.length; ++i) { - if (typeof source[i] !== 'undefined') { - obj[i] = source[i]; - } - } - - return obj; -}; - -var merge = function merge(target, source, options) { - /* eslint no-param-reassign: 0 */ - if (!source) { - return target; - } - - if (typeof source !== 'object') { - if (isArray(target)) { - target.push(source); - } else if (target && typeof target === 'object') { - if ((options && (options.plainObjects || options.allowPrototypes)) || !has.call(Object.prototype, source)) { - target[source] = true; - } - } else { - return [target, source]; - } - - return target; - } - - if (!target || typeof target !== 'object') { - return [target].concat(source); - } - - var mergeTarget = target; - if (isArray(target) && !isArray(source)) { - mergeTarget = arrayToObject(target, options); - } - - if (isArray(target) && isArray(source)) { - source.forEach(function (item, i) { - if (has.call(target, i)) { - var targetItem = target[i]; - if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') { - target[i] = merge(targetItem, item, options); - } else { - target.push(item); - } - } else { - target[i] = item; - } - }); - return target; - } - - return Object.keys(source).reduce(function (acc, key) { - var value = source[key]; - - if (has.call(acc, key)) { - acc[key] = merge(acc[key], value, options); - } else { - acc[key] = value; - } - return acc; - }, mergeTarget); -}; - -var assign = function assignSingleSource(target, source) { - return Object.keys(source).reduce(function (acc, key) { - acc[key] = source[key]; - return acc; - }, target); -}; +"use strict";var stringify=require(4),parse=require(3),formats=require(1);module.exports={formats:formats,parse:parse,stringify:stringify}; -var decode = function (str, decoder, charset) { - var strWithoutPlus = str.replace(/\+/g, ' '); - if (charset === 'iso-8859-1') { - // unescape never throws, no try...catch needed: - return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape); - } - // utf-8 - try { - return decodeURIComponent(strWithoutPlus); - } catch (e) { - return strWithoutPlus; - } -}; +},{"1":1,"3":3,"4":4}],3:[function(require,module,exports){ +"use strict";var utils=require(5),has=Object.prototype.hasOwnProperty,isArray=Array.isArray,defaults={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:utils.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1},interpretNumericEntities=function(e){return e.replace(/&#(\d+);/g,(function(e,t){return String.fromCharCode(parseInt(t,10))}))},parseArrayValue=function(e,t){return e&&"string"==typeof e&&t.comma&&e.indexOf(",")>-1?e.split(","):e},isoSentinel="utf8=%26%2310003%3B",charsetSentinel="utf8=%E2%9C%93",parseValues=function parseQueryStringValues(e,t){var r={__proto__:null},a=t.ignoreQueryPrefix?e.replace(/^\?/,""):e;a=a.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var i,o=t.parameterLimit===1/0?void 0:t.parameterLimit,l=a.split(t.delimiter,o),s=-1,n=t.charset;if(t.charsetSentinel)for(i=0;i-1&&(c=isArray(c)?[c]:c);var y=has.call(r,p);y&&"combine"===t.duplicates?r[p]=utils.combine(r[p],c):y&&"last"!==t.duplicates||(r[p]=c)}return r},parseObject=function(e,t,r,a){for(var i=a?t:parseArrayValue(t,r),o=e.length-1;o>=0;--o){var l,s=e[o];if("[]"===s&&r.parseArrays)l=r.allowEmptyArrays&&(""===i||r.strictNullHandling&&null===i)?[]:[].concat(i);else{l=r.plainObjects?Object.create(null):{};var n="["===s.charAt(0)&&"]"===s.charAt(s.length-1)?s.slice(1,-1):s,p=r.decodeDotInKeys?n.replace(/%2E/g,"."):n,c=parseInt(p,10);r.parseArrays||""!==p?!isNaN(c)&&s!==p&&String(c)===p&&c>=0&&r.parseArrays&&c<=r.arrayLimit?(l=[])[c]=i:"__proto__"!==p&&(l[p]=i):l={0:i}}i=l}return i},parseKeys=function parseQueryStringKeys(e,t,r,a){if(e){var i=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,o=/(\[[^[\]]*])/g,l=r.depth>0&&/(\[[^[\]]*])/.exec(i),s=l?i.slice(0,l.index):i,n=[];if(s){if(!r.plainObjects&&has.call(Object.prototype,s)&&!r.allowPrototypes)return;n.push(s)}for(var p=0;r.depth>0&&null!==(l=o.exec(i))&&p0?w.join(",")||null:void 0}];else if(isArray(f))E=f;else{var S=Object.keys(w);E=u?S.sort(u):S}var O=l?r.replace(/\./g,"%2E"):r,T=o&&isArray(w)&&1===w.length?O+"[]":O;if(a&&isArray(w)&&0===w.length)return T+"[]";for(var k=0;k0?y+d:""}; - var string = str; - if (typeof str === 'symbol') { - string = Symbol.prototype.toString.call(str); - } else if (typeof str !== 'string') { - string = String(str); - } +},{"1":1,"29":29,"5":5}],5:[function(require,module,exports){ +"use strict";var formats=require(1),has=Object.prototype.hasOwnProperty,isArray=Array.isArray,hexTable=function(){for(var e=[],r=0;r<256;++r)e.push("%"+((r<16?"0":"")+r.toString(16)).toUpperCase());return e}(),compactQueue=function compactQueue(e){for(;e.length>1;){var r=e.pop(),t=r.obj[r.prop];if(isArray(t)){for(var o=[],n=0;n=limit?a.slice(i,i+limit):a,p=[],s=0;s=48&&f<=57||f>=65&&f<=90||f>=97&&f<=122||n===formats.RFC1738&&(40===f||41===f)?p[p.length]=u.charAt(s):f<128?p[p.length]=hexTable[f]:f<2048?p[p.length]=hexTable[192|f>>6]+hexTable[128|63&f]:f<55296||f>=57344?p[p.length]=hexTable[224|f>>12]+hexTable[128|f>>6&63]+hexTable[128|63&f]:(s+=1,f=65536+((1023&f)<<10|1023&u.charCodeAt(s)),p[p.length]=hexTable[240|f>>18]+hexTable[128|f>>12&63]+hexTable[128|f>>6&63]+hexTable[128|63&f])}c+=p.join("")}return c},compact=function compact(e){for(var r=[{obj:{o:e},prop:"o"}],t=[],o=0;o= 0x30 && c <= 0x39) // 0-9 - || (c >= 0x41 && c <= 0x5A) // a-z - || (c >= 0x61 && c <= 0x7A) // A-Z - || (format === formats.RFC1738 && (c === 0x28 || c === 0x29)) // ( ) - ) { - out += string.charAt(i); - continue; - } - - if (c < 0x80) { - out = out + hexTable[c]; - continue; - } - - if (c < 0x800) { - out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]); - continue; - } - - if (c < 0xD800 || c >= 0xE000) { - out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]); - continue; - } - - i += 1; - c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF)); - /* eslint operator-linebreak: [2, "before"] */ - out += hexTable[0xF0 | (c >> 18)] - + hexTable[0x80 | ((c >> 12) & 0x3F)] - + hexTable[0x80 | ((c >> 6) & 0x3F)] - + hexTable[0x80 | (c & 0x3F)]; - } - - return out; -}; - -var compact = function compact(value) { - var queue = [{ obj: { o: value }, prop: 'o' }]; - var refs = []; - - for (var i = 0; i < queue.length; ++i) { - var item = queue[i]; - var obj = item.obj[item.prop]; - - var keys = Object.keys(obj); - for (var j = 0; j < keys.length; ++j) { - var key = keys[j]; - var val = obj[key]; - if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) { - queue.push({ obj: obj, prop: key }); - refs.push(val); - } - } - } - - compactQueue(queue); - - return value; -}; - -var isRegExp = function isRegExp(obj) { - return Object.prototype.toString.call(obj) === '[object RegExp]'; -}; - -var isBuffer = function isBuffer(obj) { - if (!obj || typeof obj !== 'object') { - return false; - } - - return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj)); -}; - -var combine = function combine(a, b) { - return [].concat(a, b); -}; - -var maybeMap = function maybeMap(val, fn) { - if (isArray(val)) { - var mapped = []; - for (var i = 0; i < val.length; i += 1) { - mapped.push(fn(val[i])); - } - return mapped; - } - return fn(val); -}; - -module.exports = { - arrayToObject: arrayToObject, - assign: assign, - combine: combine, - compact: compact, - decode: decode, - encode: encode, - isBuffer: isBuffer, - isRegExp: isRegExp, - maybeMap: maybeMap, - merge: merge -}; - -},{"./formats":1}],6:[function(require,module,exports){ +},{"16":16,"20":20,"27":27,"7":7}],6:[function(require,module,exports){ },{}],7:[function(require,module,exports){ -'use strict'; - -var GetIntrinsic = require('get-intrinsic'); - -var callBind = require('./'); - -var $indexOf = callBind(GetIntrinsic('String.prototype.indexOf')); - -module.exports = function callBoundIntrinsic(name, allowMissing) { - var intrinsic = GetIntrinsic(name, !!allowMissing); - if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) { - return callBind(intrinsic); - } - return intrinsic; -}; - -},{"./":8,"get-intrinsic":11}],8:[function(require,module,exports){ -'use strict'; - -var bind = require('function-bind'); -var GetIntrinsic = require('get-intrinsic'); - -var $apply = GetIntrinsic('%Function.prototype.apply%'); -var $call = GetIntrinsic('%Function.prototype.call%'); -var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply); - -var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true); -var $defineProperty = GetIntrinsic('%Object.defineProperty%', true); -var $max = GetIntrinsic('%Math.max%'); - -if ($defineProperty) { - try { - $defineProperty({}, 'a', { value: 1 }); - } catch (e) { - // IE 8 has a broken defineProperty - $defineProperty = null; - } -} - -module.exports = function callBind(originalFunction) { - var func = $reflectApply(bind, $call, arguments); - if ($gOPD && $defineProperty) { - var desc = $gOPD(func, 'length'); - if (desc.configurable) { - // original length, plus the receiver, minus any additional arguments (after the receiver) - $defineProperty( - func, - 'length', - { value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) } - ); - } - } - return func; -}; - -var applyBind = function applyBind() { - return $reflectApply(bind, $apply, arguments); -}; - -if ($defineProperty) { - $defineProperty(module.exports, 'apply', { value: applyBind }); -} else { - module.exports.apply = applyBind; -} - -},{"function-bind":10,"get-intrinsic":11}],9:[function(require,module,exports){ -'use strict'; - -/* eslint no-invalid-this: 1 */ - -var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible '; -var slice = Array.prototype.slice; -var toStr = Object.prototype.toString; -var funcType = '[object Function]'; - -module.exports = function bind(that) { - var target = this; - if (typeof target !== 'function' || toStr.call(target) !== funcType) { - throw new TypeError(ERROR_MESSAGE + target); - } - var args = slice.call(arguments, 1); - - var bound; - var binder = function () { - if (this instanceof bound) { - var result = target.apply( - this, - args.concat(slice.call(arguments)) - ); - if (Object(result) === result) { - return result; - } - return this; - } else { - return target.apply( - that, - args.concat(slice.call(arguments)) - ); - } - }; - - var boundLength = Math.max(0, target.length - args.length); - var boundArgs = []; - for (var i = 0; i < boundLength; i++) { - boundArgs.push('$' + i); - } - - bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder); - - if (target.prototype) { - var Empty = function Empty() {}; - Empty.prototype = target.prototype; - bound.prototype = new Empty(); - Empty.prototype = null; - } - - return bound; -}; - -},{}],10:[function(require,module,exports){ -'use strict'; - -var implementation = require('./implementation'); - -module.exports = Function.prototype.bind || implementation; - -},{"./implementation":9}],11:[function(require,module,exports){ -'use strict'; - -var undefined; - -var $SyntaxError = SyntaxError; -var $Function = Function; -var $TypeError = TypeError; - -// eslint-disable-next-line consistent-return -var getEvalledConstructor = function (expressionSyntax) { - try { - return $Function('"use strict"; return (' + expressionSyntax + ').constructor;')(); - } catch (e) {} -}; - -var $gOPD = Object.getOwnPropertyDescriptor; -if ($gOPD) { - try { - $gOPD({}, ''); - } catch (e) { - $gOPD = null; // this is IE 8, which has a broken gOPD - } -} - -var throwTypeError = function () { - throw new $TypeError(); -}; -var ThrowTypeError = $gOPD - ? (function () { - try { - // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties - arguments.callee; // IE 8 does not throw here - return throwTypeError; - } catch (calleeThrows) { - try { - // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '') - return $gOPD(arguments, 'callee').get; - } catch (gOPDthrows) { - return throwTypeError; - } - } - }()) - : throwTypeError; - -var hasSymbols = require('has-symbols')(); - -var getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto - -var needsEval = {}; - -var TypedArray = typeof Uint8Array === 'undefined' ? undefined : getProto(Uint8Array); - -var INTRINSICS = { - '%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError, - '%Array%': Array, - '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer, - '%ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined, - '%AsyncFromSyncIteratorPrototype%': undefined, - '%AsyncFunction%': needsEval, - '%AsyncGenerator%': needsEval, - '%AsyncGeneratorFunction%': needsEval, - '%AsyncIteratorPrototype%': needsEval, - '%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics, - '%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt, - '%Boolean%': Boolean, - '%DataView%': typeof DataView === 'undefined' ? undefined : DataView, - '%Date%': Date, - '%decodeURI%': decodeURI, - '%decodeURIComponent%': decodeURIComponent, - '%encodeURI%': encodeURI, - '%encodeURIComponent%': encodeURIComponent, - '%Error%': Error, - '%eval%': eval, // eslint-disable-line no-eval - '%EvalError%': EvalError, - '%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array, - '%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array, - '%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry, - '%Function%': $Function, - '%GeneratorFunction%': needsEval, - '%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array, - '%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array, - '%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array, - '%isFinite%': isFinite, - '%isNaN%': isNaN, - '%IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined, - '%JSON%': typeof JSON === 'object' ? JSON : undefined, - '%Map%': typeof Map === 'undefined' ? undefined : Map, - '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined : getProto(new Map()[Symbol.iterator]()), - '%Math%': Math, - '%Number%': Number, - '%Object%': Object, - '%parseFloat%': parseFloat, - '%parseInt%': parseInt, - '%Promise%': typeof Promise === 'undefined' ? undefined : Promise, - '%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy, - '%RangeError%': RangeError, - '%ReferenceError%': ReferenceError, - '%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect, - '%RegExp%': RegExp, - '%Set%': typeof Set === 'undefined' ? undefined : Set, - '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined : getProto(new Set()[Symbol.iterator]()), - '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer, - '%String%': String, - '%StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined, - '%Symbol%': hasSymbols ? Symbol : undefined, - '%SyntaxError%': $SyntaxError, - '%ThrowTypeError%': ThrowTypeError, - '%TypedArray%': TypedArray, - '%TypeError%': $TypeError, - '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array, - '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray, - '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array, - '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array, - '%URIError%': URIError, - '%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap, - '%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef, - '%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet -}; - -var doEval = function doEval(name) { - var value; - if (name === '%AsyncFunction%') { - value = getEvalledConstructor('async function () {}'); - } else if (name === '%GeneratorFunction%') { - value = getEvalledConstructor('function* () {}'); - } else if (name === '%AsyncGeneratorFunction%') { - value = getEvalledConstructor('async function* () {}'); - } else if (name === '%AsyncGenerator%') { - var fn = doEval('%AsyncGeneratorFunction%'); - if (fn) { - value = fn.prototype; - } - } else if (name === '%AsyncIteratorPrototype%') { - var gen = doEval('%AsyncGenerator%'); - if (gen) { - value = getProto(gen.prototype); - } - } - - INTRINSICS[name] = value; - - return value; -}; - -var LEGACY_ALIASES = { - '%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'], - '%ArrayPrototype%': ['Array', 'prototype'], - '%ArrayProto_entries%': ['Array', 'prototype', 'entries'], - '%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'], - '%ArrayProto_keys%': ['Array', 'prototype', 'keys'], - '%ArrayProto_values%': ['Array', 'prototype', 'values'], - '%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'], - '%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'], - '%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'], - '%BooleanPrototype%': ['Boolean', 'prototype'], - '%DataViewPrototype%': ['DataView', 'prototype'], - '%DatePrototype%': ['Date', 'prototype'], - '%ErrorPrototype%': ['Error', 'prototype'], - '%EvalErrorPrototype%': ['EvalError', 'prototype'], - '%Float32ArrayPrototype%': ['Float32Array', 'prototype'], - '%Float64ArrayPrototype%': ['Float64Array', 'prototype'], - '%FunctionPrototype%': ['Function', 'prototype'], - '%Generator%': ['GeneratorFunction', 'prototype'], - '%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'], - '%Int8ArrayPrototype%': ['Int8Array', 'prototype'], - '%Int16ArrayPrototype%': ['Int16Array', 'prototype'], - '%Int32ArrayPrototype%': ['Int32Array', 'prototype'], - '%JSONParse%': ['JSON', 'parse'], - '%JSONStringify%': ['JSON', 'stringify'], - '%MapPrototype%': ['Map', 'prototype'], - '%NumberPrototype%': ['Number', 'prototype'], - '%ObjectPrototype%': ['Object', 'prototype'], - '%ObjProto_toString%': ['Object', 'prototype', 'toString'], - '%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'], - '%PromisePrototype%': ['Promise', 'prototype'], - '%PromiseProto_then%': ['Promise', 'prototype', 'then'], - '%Promise_all%': ['Promise', 'all'], - '%Promise_reject%': ['Promise', 'reject'], - '%Promise_resolve%': ['Promise', 'resolve'], - '%RangeErrorPrototype%': ['RangeError', 'prototype'], - '%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'], - '%RegExpPrototype%': ['RegExp', 'prototype'], - '%SetPrototype%': ['Set', 'prototype'], - '%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'], - '%StringPrototype%': ['String', 'prototype'], - '%SymbolPrototype%': ['Symbol', 'prototype'], - '%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'], - '%TypedArrayPrototype%': ['TypedArray', 'prototype'], - '%TypeErrorPrototype%': ['TypeError', 'prototype'], - '%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'], - '%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'], - '%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'], - '%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'], - '%URIErrorPrototype%': ['URIError', 'prototype'], - '%WeakMapPrototype%': ['WeakMap', 'prototype'], - '%WeakSetPrototype%': ['WeakSet', 'prototype'] -}; - -var bind = require('function-bind'); -var hasOwn = require('has'); -var $concat = bind.call(Function.call, Array.prototype.concat); -var $spliceApply = bind.call(Function.apply, Array.prototype.splice); -var $replace = bind.call(Function.call, String.prototype.replace); -var $strSlice = bind.call(Function.call, String.prototype.slice); +"use strict";var GetIntrinsic=require(20),callBind=require(8),$indexOf=callBind(GetIntrinsic("String.prototype.indexOf"));module.exports=function callBoundIntrinsic(i,n){var t=GetIntrinsic(i,!!n);return"function"==typeof t&&$indexOf(i,".prototype.")>-1?callBind(t):t}; -/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */ -var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g; -var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */ -var stringToPath = function stringToPath(string) { - var first = $strSlice(string, 0, 1); - var last = $strSlice(string, -1); - if (first === '%' && last !== '%') { - throw new $SyntaxError('invalid intrinsic syntax, expected closing `%`'); - } else if (last === '%' && first !== '%') { - throw new $SyntaxError('invalid intrinsic syntax, expected opening `%`'); - } - var result = []; - $replace(string, rePropName, function (match, number, quote, subString) { - result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match; - }); - return result; -}; -/* end adaptation */ +},{"20":20,"8":8}],20:[function(require,module,exports){ +"use strict";var undefined,$Error=require(12),$EvalError=require(11),$RangeError=require(13),$ReferenceError=require(14),$SyntaxError=require(15),$TypeError=require(16),$URIError=require(17),$Function=Function,getEvalledConstructor=function(r){try{return $Function('"use strict"; return ('+r+").constructor;")()}catch(r){}},$gOPD=Object.getOwnPropertyDescriptor;if($gOPD)try{$gOPD({},"")}catch(r){$gOPD=null}var throwTypeError=function(){throw new $TypeError},ThrowTypeError=$gOPD?function(){try{return throwTypeError}catch(r){try{return $gOPD(arguments,"callee").get}catch(r){return throwTypeError}}}():throwTypeError,hasSymbols=require(24)(),hasProto=require(23)(),getProto=Object.getPrototypeOf||(hasProto?function(r){return r.__proto__}:null),needsEval={},TypedArray="undefined"!=typeof Uint8Array&&getProto?getProto(Uint8Array):undefined,INTRINSICS={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?undefined:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?undefined:ArrayBuffer,"%ArrayIteratorPrototype%":hasSymbols&&getProto?getProto([][Symbol.iterator]()):undefined,"%AsyncFromSyncIteratorPrototype%":undefined,"%AsyncFunction%":needsEval,"%AsyncGenerator%":needsEval,"%AsyncGeneratorFunction%":needsEval,"%AsyncIteratorPrototype%":needsEval,"%Atomics%":"undefined"==typeof Atomics?undefined:Atomics,"%BigInt%":"undefined"==typeof BigInt?undefined:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?undefined:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?undefined:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?undefined:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":$Error,"%eval%":eval,"%EvalError%":$EvalError,"%Float32Array%":"undefined"==typeof Float32Array?undefined:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?undefined:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?undefined:FinalizationRegistry,"%Function%":$Function,"%GeneratorFunction%":needsEval,"%Int8Array%":"undefined"==typeof Int8Array?undefined:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?undefined:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?undefined:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":hasSymbols&&getProto?getProto(getProto([][Symbol.iterator]())):undefined,"%JSON%":"object"==typeof JSON?JSON:undefined,"%Map%":"undefined"==typeof Map?undefined:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&hasSymbols&&getProto?getProto((new Map)[Symbol.iterator]()):undefined,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?undefined:Promise,"%Proxy%":"undefined"==typeof Proxy?undefined:Proxy,"%RangeError%":$RangeError,"%ReferenceError%":$ReferenceError,"%Reflect%":"undefined"==typeof Reflect?undefined:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?undefined:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&hasSymbols&&getProto?getProto((new Set)[Symbol.iterator]()):undefined,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?undefined:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":hasSymbols&&getProto?getProto(""[Symbol.iterator]()):undefined,"%Symbol%":hasSymbols?Symbol:undefined,"%SyntaxError%":$SyntaxError,"%ThrowTypeError%":ThrowTypeError,"%TypedArray%":TypedArray,"%TypeError%":$TypeError,"%Uint8Array%":"undefined"==typeof Uint8Array?undefined:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?undefined:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?undefined:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?undefined:Uint32Array,"%URIError%":$URIError,"%WeakMap%":"undefined"==typeof WeakMap?undefined:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?undefined:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?undefined:WeakSet};if(getProto)try{null.error}catch(r){var errorProto=getProto(getProto(r));INTRINSICS["%Error.prototype%"]=errorProto}var doEval=function doEval(r){var e;if("%AsyncFunction%"===r)e=getEvalledConstructor("async function () {}");else if("%GeneratorFunction%"===r)e=getEvalledConstructor("function* () {}");else if("%AsyncGeneratorFunction%"===r)e=getEvalledConstructor("async function* () {}");else if("%AsyncGenerator%"===r){var t=doEval("%AsyncGeneratorFunction%");t&&(e=t.prototype)}else if("%AsyncIteratorPrototype%"===r){var o=doEval("%AsyncGenerator%");o&&getProto&&(e=getProto(o.prototype))}return INTRINSICS[r]=e,e},LEGACY_ALIASES={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},bind=require(19),hasOwn=require(26),$concat=bind.call(Function.call,Array.prototype.concat),$spliceApply=bind.call(Function.apply,Array.prototype.splice),$replace=bind.call(Function.call,String.prototype.replace),$strSlice=bind.call(Function.call,String.prototype.slice),$exec=bind.call(Function.call,RegExp.prototype.exec),rePropName=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,reEscapeChar=/\\(\\)?/g,stringToPath=function stringToPath(r){var e=$strSlice(r,0,1),t=$strSlice(r,-1);if("%"===e&&"%"!==t)throw new $SyntaxError("invalid intrinsic syntax, expected closing `%`");if("%"===t&&"%"!==e)throw new $SyntaxError("invalid intrinsic syntax, expected opening `%`");var o=[];return $replace(r,rePropName,(function(r,e,t,n){o[o.length]=t?$replace(n,reEscapeChar,"$1"):e||r})),o},getBaseIntrinsic=function getBaseIntrinsic(r,e){var t,o=r;if(hasOwn(LEGACY_ALIASES,o)&&(o="%"+(t=LEGACY_ALIASES[o])[0]+"%"),hasOwn(INTRINSICS,o)){var n=INTRINSICS[o];if(n===needsEval&&(n=doEval(o)),void 0===n&&!e)throw new $TypeError("intrinsic "+r+" exists, but is not available. Please file an issue!");return{alias:t,name:o,value:n}}throw new $SyntaxError("intrinsic "+r+" does not exist!")};module.exports=function GetIntrinsic(r,e){if("string"!=typeof r||0===r.length)throw new $TypeError("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new $TypeError('"allowMissing" argument must be a boolean');if(null===$exec(/^%?[^%]*%?$/,r))throw new $SyntaxError("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var t=stringToPath(r),o=t.length>0?t[0]:"",n=getBaseIntrinsic("%"+o+"%",e),a=n.name,y=n.value,i=!1,p=n.alias;p&&(o=p[0],$spliceApply(t,$concat([0,1],p)));for(var d=1,s=!0;d=t.length){var c=$gOPD(y,f);y=(s=!!c)&&"get"in c&&!("originalValue"in c.get)?c.get:y[f]}else s=hasOwn(y,f),y=y[f];s&&!i&&(INTRINSICS[a]=y)}}return y}; -var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) { - var intrinsicName = name; - var alias; - if (hasOwn(LEGACY_ALIASES, intrinsicName)) { - alias = LEGACY_ALIASES[intrinsicName]; - intrinsicName = '%' + alias[0] + '%'; - } +},{"11":11,"12":12,"13":13,"14":14,"15":15,"16":16,"17":17,"19":19,"23":23,"24":24,"26":26}],8:[function(require,module,exports){ +"use strict";var bind=require(19),GetIntrinsic=require(20),setFunctionLength=require(28),$TypeError=require(16),$apply=GetIntrinsic("%Function.prototype.apply%"),$call=GetIntrinsic("%Function.prototype.call%"),$reflectApply=GetIntrinsic("%Reflect.apply%",!0)||bind.call($call,$apply),$defineProperty=require(10),$max=GetIntrinsic("%Math.max%");module.exports=function callBind(e){if("function"!=typeof e)throw new $TypeError("a function is required");var n=$reflectApply(bind,$call,arguments);return setFunctionLength(n,1+$max(0,e.length-(arguments.length-1)),!0)};var applyBind=function applyBind(){return $reflectApply(bind,$apply,arguments)};$defineProperty?$defineProperty(module.exports,"apply",{value:applyBind}):module.exports.apply=applyBind; - if (hasOwn(INTRINSICS, intrinsicName)) { - var value = INTRINSICS[intrinsicName]; - if (value === needsEval) { - value = doEval(intrinsicName); - } - if (typeof value === 'undefined' && !allowMissing) { - throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!'); - } +},{"10":10,"16":16,"19":19,"20":20,"28":28}],16:[function(require,module,exports){ +"use strict";module.exports=TypeError; - return { - alias: alias, - name: intrinsicName, - value: value - }; - } +},{}],19:[function(require,module,exports){ +"use strict";var implementation=require(18);module.exports=Function.prototype.bind||implementation; - throw new $SyntaxError('intrinsic ' + name + ' does not exist!'); -}; +},{"18":18}],10:[function(require,module,exports){ +"use strict";var GetIntrinsic=require(20),$defineProperty=GetIntrinsic("%Object.defineProperty%",!0)||!1;if($defineProperty)try{$defineProperty({},"a",{value:1})}catch(e){$defineProperty=!1}module.exports=$defineProperty; -module.exports = function GetIntrinsic(name, allowMissing) { - if (typeof name !== 'string' || name.length === 0) { - throw new $TypeError('intrinsic name must be a non-empty string'); - } - if (arguments.length > 1 && typeof allowMissing !== 'boolean') { - throw new $TypeError('"allowMissing" argument must be a boolean'); - } +},{"20":20}],28:[function(require,module,exports){ +"use strict";var GetIntrinsic=require(20),define=require(9),hasDescriptors=require(22)(),gOPD=require(21),$TypeError=require(16),$floor=GetIntrinsic("%Math.floor%");module.exports=function setFunctionLength(e,r){if("function"!=typeof e)throw new $TypeError("`fn` is not a function");if("number"!=typeof r||r<0||r>4294967295||$floor(r)!==r)throw new $TypeError("`length` must be a positive 32-bit integer");var t=arguments.length>2&&!!arguments[2],i=!0,n=!0;if("length"in e&&gOPD){var o=gOPD(e,"length");o&&!o.configurable&&(i=!1),o&&!o.writable&&(n=!1)}return(i||n||!t)&&(hasDescriptors?define(e,"length",r,!0,!0):define(e,"length",r)),e}; - var parts = stringToPath(name); - var intrinsicBaseName = parts.length > 0 ? parts[0] : ''; +},{"16":16,"20":20,"21":21,"22":22,"9":9}],9:[function(require,module,exports){ +"use strict";var $defineProperty=require(10),$SyntaxError=require(15),$TypeError=require(16),gopd=require(21);module.exports=function defineDataProperty(e,r,o){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new $TypeError("`obj` must be an object or a function`");if("string"!=typeof r&&"symbol"!=typeof r)throw new $TypeError("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new $TypeError("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new $TypeError("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new $TypeError("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new $TypeError("`loose`, if provided, must be a boolean");var n=arguments.length>3?arguments[3]:null,l=arguments.length>4?arguments[4]:null,t=arguments.length>5?arguments[5]:null,i=arguments.length>6&&arguments[6],a=!!gopd&&gopd(e,r);if($defineProperty)$defineProperty(e,r,{configurable:null===t&&a?a.configurable:!t,enumerable:null===n&&a?a.enumerable:!n,value:o,writable:null===l&&a?a.writable:!l});else{if(!i&&(n||l||t))throw new $SyntaxError("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");e[r]=o}}; - var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing); - var intrinsicRealName = intrinsic.name; - var value = intrinsic.value; - var skipFurtherCaching = false; +},{"10":10,"15":15,"16":16,"21":21}],15:[function(require,module,exports){ +"use strict";module.exports=SyntaxError; - var alias = intrinsic.alias; - if (alias) { - intrinsicBaseName = alias[0]; - $spliceApply(parts, $concat([0, 1], alias)); - } +},{}],21:[function(require,module,exports){ +"use strict";var GetIntrinsic=require(20),$gOPD=GetIntrinsic("%Object.getOwnPropertyDescriptor%",!0);if($gOPD)try{$gOPD([],"length")}catch(t){$gOPD=null}module.exports=$gOPD; - for (var i = 1, isOwn = true; i < parts.length; i += 1) { - var part = parts[i]; - var first = $strSlice(part, 0, 1); - var last = $strSlice(part, -1); - if ( - ( - (first === '"' || first === "'" || first === '`') - || (last === '"' || last === "'" || last === '`') - ) - && first !== last - ) { - throw new $SyntaxError('property names with quotes must have matching quotes'); - } - if (part === 'constructor' || !isOwn) { - skipFurtherCaching = true; - } +},{"20":20}],11:[function(require,module,exports){ +"use strict";module.exports=EvalError; - intrinsicBaseName += '.' + part; - intrinsicRealName = '%' + intrinsicBaseName + '%'; +},{}],12:[function(require,module,exports){ +"use strict";module.exports=Error; - if (hasOwn(INTRINSICS, intrinsicRealName)) { - value = INTRINSICS[intrinsicRealName]; - } else if (value != null) { - if (!(part in value)) { - if (!allowMissing) { - throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.'); - } - return void undefined; - } - if ($gOPD && (i + 1) >= parts.length) { - var desc = $gOPD(value, part); - isOwn = !!desc; - - // By convention, when a data property is converted to an accessor - // property to emulate a data property that does not suffer from - // the override mistake, that accessor's getter is marked with - // an `originalValue` property. Here, when we detect this, we - // uphold the illusion by pretending to see that original data - // property, i.e., returning the value rather than the getter - // itself. - if (isOwn && 'get' in desc && !('originalValue' in desc.get)) { - value = desc.get; - } else { - value = value[part]; - } - } else { - isOwn = hasOwn(value, part); - value = value[part]; - } - - if (isOwn && !skipFurtherCaching) { - INTRINSICS[intrinsicRealName] = value; - } - } - } - return value; -}; - -},{"function-bind":10,"has":14,"has-symbols":12}],12:[function(require,module,exports){ -'use strict'; - -var origSymbol = typeof Symbol !== 'undefined' && Symbol; -var hasSymbolSham = require('./shams'); - -module.exports = function hasNativeSymbols() { - if (typeof origSymbol !== 'function') { return false; } - if (typeof Symbol !== 'function') { return false; } - if (typeof origSymbol('foo') !== 'symbol') { return false; } - if (typeof Symbol('bar') !== 'symbol') { return false; } - - return hasSymbolSham(); -}; - -},{"./shams":13}],13:[function(require,module,exports){ -'use strict'; - -/* eslint complexity: [2, 18], max-statements: [2, 33] */ -module.exports = function hasSymbols() { - if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; } - if (typeof Symbol.iterator === 'symbol') { return true; } - - var obj = {}; - var sym = Symbol('test'); - var symObj = Object(sym); - if (typeof sym === 'string') { return false; } - - if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; } - if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; } - - // temp disabled per https://github.com/ljharb/object.assign/issues/17 - // if (sym instanceof Symbol) { return false; } - // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4 - // if (!(symObj instanceof Symbol)) { return false; } - - // if (typeof Symbol.prototype.toString !== 'function') { return false; } - // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; } - - var symVal = 42; - obj[sym] = symVal; - for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop - if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; } - - if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; } - - var syms = Object.getOwnPropertySymbols(obj); - if (syms.length !== 1 || syms[0] !== sym) { return false; } - - if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; } - - if (typeof Object.getOwnPropertyDescriptor === 'function') { - var descriptor = Object.getOwnPropertyDescriptor(obj, sym); - if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; } - } - - return true; -}; +},{}],13:[function(require,module,exports){ +"use strict";module.exports=RangeError; },{}],14:[function(require,module,exports){ -'use strict'; - -var bind = require('function-bind'); - -module.exports = bind.call(Function.call, Object.prototype.hasOwnProperty); - -},{"function-bind":10}],15:[function(require,module,exports){ -var hasMap = typeof Map === 'function' && Map.prototype; -var mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null; -var mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null; -var mapForEach = hasMap && Map.prototype.forEach; -var hasSet = typeof Set === 'function' && Set.prototype; -var setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, 'size') : null; -var setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === 'function' ? setSizeDescriptor.get : null; -var setForEach = hasSet && Set.prototype.forEach; -var hasWeakMap = typeof WeakMap === 'function' && WeakMap.prototype; -var weakMapHas = hasWeakMap ? WeakMap.prototype.has : null; -var hasWeakSet = typeof WeakSet === 'function' && WeakSet.prototype; -var weakSetHas = hasWeakSet ? WeakSet.prototype.has : null; -var hasWeakRef = typeof WeakRef === 'function' && WeakRef.prototype; -var weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null; -var booleanValueOf = Boolean.prototype.valueOf; -var objectToString = Object.prototype.toString; -var functionToString = Function.prototype.toString; -var $match = String.prototype.match; -var $slice = String.prototype.slice; -var $replace = String.prototype.replace; -var $toUpperCase = String.prototype.toUpperCase; -var $toLowerCase = String.prototype.toLowerCase; -var $test = RegExp.prototype.test; -var $concat = Array.prototype.concat; -var $join = Array.prototype.join; -var $arrSlice = Array.prototype.slice; -var $floor = Math.floor; -var bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null; -var gOPS = Object.getOwnPropertySymbols; -var symToString = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? Symbol.prototype.toString : null; -var hasShammedSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'object'; -// ie, `has-tostringtag/shams -var toStringTag = typeof Symbol === 'function' && Symbol.toStringTag && (typeof Symbol.toStringTag === hasShammedSymbols ? 'object' : 'symbol') - ? Symbol.toStringTag - : null; -var isEnumerable = Object.prototype.propertyIsEnumerable; - -var gPO = (typeof Reflect === 'function' ? Reflect.getPrototypeOf : Object.getPrototypeOf) || ( - [].__proto__ === Array.prototype // eslint-disable-line no-proto - ? function (O) { - return O.__proto__; // eslint-disable-line no-proto - } - : null -); - -function addNumericSeparator(num, str) { - if ( - num === Infinity - || num === -Infinity - || num !== num - || (num && num > -1000 && num < 1000) - || $test.call(/e/, str) - ) { - return str; - } - var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g; - if (typeof num === 'number') { - var int = num < 0 ? -$floor(-num) : $floor(num); // trunc(num) - if (int !== num) { - var intStr = String(int); - var dec = $slice.call(str, intStr.length + 1); - return $replace.call(intStr, sepRegex, '$&_') + '.' + $replace.call($replace.call(dec, /([0-9]{3})/g, '$&_'), /_$/, ''); - } - } - return $replace.call(str, sepRegex, '$&_'); -} - -var utilInspect = require('./util.inspect'); -var inspectCustom = utilInspect.custom; -var inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null; - -module.exports = function inspect_(obj, options, depth, seen) { - var opts = options || {}; - - if (has(opts, 'quoteStyle') && (opts.quoteStyle !== 'single' && opts.quoteStyle !== 'double')) { - throw new TypeError('option "quoteStyle" must be "single" or "double"'); - } - if ( - has(opts, 'maxStringLength') && (typeof opts.maxStringLength === 'number' - ? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity - : opts.maxStringLength !== null - ) - ) { - throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`'); - } - var customInspect = has(opts, 'customInspect') ? opts.customInspect : true; - if (typeof customInspect !== 'boolean' && customInspect !== 'symbol') { - throw new TypeError('option "customInspect", if provided, must be `true`, `false`, or `\'symbol\'`'); - } - - if ( - has(opts, 'indent') - && opts.indent !== null - && opts.indent !== '\t' - && !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0) - ) { - throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`'); - } - if (has(opts, 'numericSeparator') && typeof opts.numericSeparator !== 'boolean') { - throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`'); - } - var numericSeparator = opts.numericSeparator; - - if (typeof obj === 'undefined') { - return 'undefined'; - } - if (obj === null) { - return 'null'; - } - if (typeof obj === 'boolean') { - return obj ? 'true' : 'false'; - } - - if (typeof obj === 'string') { - return inspectString(obj, opts); - } - if (typeof obj === 'number') { - if (obj === 0) { - return Infinity / obj > 0 ? '0' : '-0'; - } - var str = String(obj); - return numericSeparator ? addNumericSeparator(obj, str) : str; - } - if (typeof obj === 'bigint') { - var bigIntStr = String(obj) + 'n'; - return numericSeparator ? addNumericSeparator(obj, bigIntStr) : bigIntStr; - } - - var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth; - if (typeof depth === 'undefined') { depth = 0; } - if (depth >= maxDepth && maxDepth > 0 && typeof obj === 'object') { - return isArray(obj) ? '[Array]' : '[Object]'; - } - - var indent = getIndent(opts, depth); - - if (typeof seen === 'undefined') { - seen = []; - } else if (indexOf(seen, obj) >= 0) { - return '[Circular]'; - } - - function inspect(value, from, noIndent) { - if (from) { - seen = $arrSlice.call(seen); - seen.push(from); - } - if (noIndent) { - var newOpts = { - depth: opts.depth - }; - if (has(opts, 'quoteStyle')) { - newOpts.quoteStyle = opts.quoteStyle; - } - return inspect_(value, newOpts, depth + 1, seen); - } - return inspect_(value, opts, depth + 1, seen); - } - - if (typeof obj === 'function' && !isRegExp(obj)) { // in older engines, regexes are callable - var name = nameOf(obj); - var keys = arrObjKeys(obj, inspect); - return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + $join.call(keys, ', ') + ' }' : ''); - } - if (isSymbol(obj)) { - var symString = hasShammedSymbols ? $replace.call(String(obj), /^(Symbol\(.*\))_[^)]*$/, '$1') : symToString.call(obj); - return typeof obj === 'object' && !hasShammedSymbols ? markBoxed(symString) : symString; - } - if (isElement(obj)) { - var s = '<' + $toLowerCase.call(String(obj.nodeName)); - var attrs = obj.attributes || []; - for (var i = 0; i < attrs.length; i++) { - s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts); - } - s += '>'; - if (obj.childNodes && obj.childNodes.length) { s += '...'; } - s += ''; - return s; - } - if (isArray(obj)) { - if (obj.length === 0) { return '[]'; } - var xs = arrObjKeys(obj, inspect); - if (indent && !singleLineValues(xs)) { - return '[' + indentedJoin(xs, indent) + ']'; - } - return '[ ' + $join.call(xs, ', ') + ' ]'; - } - if (isError(obj)) { - var parts = arrObjKeys(obj, inspect); - if (!('cause' in Error.prototype) && 'cause' in obj && !isEnumerable.call(obj, 'cause')) { - return '{ [' + String(obj) + '] ' + $join.call($concat.call('[cause]: ' + inspect(obj.cause), parts), ', ') + ' }'; - } - if (parts.length === 0) { return '[' + String(obj) + ']'; } - return '{ [' + String(obj) + '] ' + $join.call(parts, ', ') + ' }'; - } - if (typeof obj === 'object' && customInspect) { - if (inspectSymbol && typeof obj[inspectSymbol] === 'function' && utilInspect) { - return utilInspect(obj, { depth: maxDepth - depth }); - } else if (customInspect !== 'symbol' && typeof obj.inspect === 'function') { - return obj.inspect(); - } - } - if (isMap(obj)) { - var mapParts = []; - mapForEach.call(obj, function (value, key) { - mapParts.push(inspect(key, obj, true) + ' => ' + inspect(value, obj)); - }); - return collectionOf('Map', mapSize.call(obj), mapParts, indent); - } - if (isSet(obj)) { - var setParts = []; - setForEach.call(obj, function (value) { - setParts.push(inspect(value, obj)); - }); - return collectionOf('Set', setSize.call(obj), setParts, indent); - } - if (isWeakMap(obj)) { - return weakCollectionOf('WeakMap'); - } - if (isWeakSet(obj)) { - return weakCollectionOf('WeakSet'); - } - if (isWeakRef(obj)) { - return weakCollectionOf('WeakRef'); - } - if (isNumber(obj)) { - return markBoxed(inspect(Number(obj))); - } - if (isBigInt(obj)) { - return markBoxed(inspect(bigIntValueOf.call(obj))); - } - if (isBoolean(obj)) { - return markBoxed(booleanValueOf.call(obj)); - } - if (isString(obj)) { - return markBoxed(inspect(String(obj))); - } - if (!isDate(obj) && !isRegExp(obj)) { - var ys = arrObjKeys(obj, inspect); - var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object; - var protoTag = obj instanceof Object ? '' : 'null prototype'; - var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? 'Object' : ''; - var constructorTag = isPlainObject || typeof obj.constructor !== 'function' ? '' : obj.constructor.name ? obj.constructor.name + ' ' : ''; - var tag = constructorTag + (stringTag || protoTag ? '[' + $join.call($concat.call([], stringTag || [], protoTag || []), ': ') + '] ' : ''); - if (ys.length === 0) { return tag + '{}'; } - if (indent) { - return tag + '{' + indentedJoin(ys, indent) + '}'; - } - return tag + '{ ' + $join.call(ys, ', ') + ' }'; - } - return String(obj); -}; - -function wrapQuotes(s, defaultStyle, opts) { - var quoteChar = (opts.quoteStyle || defaultStyle) === 'double' ? '"' : "'"; - return quoteChar + s + quoteChar; -} - -function quote(s) { - return $replace.call(String(s), /"/g, '"'); -} - -function isArray(obj) { return toStr(obj) === '[object Array]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); } -function isDate(obj) { return toStr(obj) === '[object Date]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); } -function isRegExp(obj) { return toStr(obj) === '[object RegExp]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); } -function isError(obj) { return toStr(obj) === '[object Error]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); } -function isString(obj) { return toStr(obj) === '[object String]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); } -function isNumber(obj) { return toStr(obj) === '[object Number]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); } -function isBoolean(obj) { return toStr(obj) === '[object Boolean]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); } - -// Symbol and BigInt do have Symbol.toStringTag by spec, so that can't be used to eliminate false positives -function isSymbol(obj) { - if (hasShammedSymbols) { - return obj && typeof obj === 'object' && obj instanceof Symbol; - } - if (typeof obj === 'symbol') { - return true; - } - if (!obj || typeof obj !== 'object' || !symToString) { - return false; - } - try { - symToString.call(obj); - return true; - } catch (e) {} - return false; -} - -function isBigInt(obj) { - if (!obj || typeof obj !== 'object' || !bigIntValueOf) { - return false; - } - try { - bigIntValueOf.call(obj); - return true; - } catch (e) {} - return false; -} - -var hasOwn = Object.prototype.hasOwnProperty || function (key) { return key in this; }; -function has(obj, key) { - return hasOwn.call(obj, key); -} - -function toStr(obj) { - return objectToString.call(obj); -} - -function nameOf(f) { - if (f.name) { return f.name; } - var m = $match.call(functionToString.call(f), /^function\s*([\w$]+)/); - if (m) { return m[1]; } - return null; -} - -function indexOf(xs, x) { - if (xs.indexOf) { return xs.indexOf(x); } - for (var i = 0, l = xs.length; i < l; i++) { - if (xs[i] === x) { return i; } - } - return -1; -} - -function isMap(x) { - if (!mapSize || !x || typeof x !== 'object') { - return false; - } - try { - mapSize.call(x); - try { - setSize.call(x); - } catch (s) { - return true; - } - return x instanceof Map; // core-js workaround, pre-v2.5.0 - } catch (e) {} - return false; -} - -function isWeakMap(x) { - if (!weakMapHas || !x || typeof x !== 'object') { - return false; - } - try { - weakMapHas.call(x, weakMapHas); - try { - weakSetHas.call(x, weakSetHas); - } catch (s) { - return true; - } - return x instanceof WeakMap; // core-js workaround, pre-v2.5.0 - } catch (e) {} - return false; -} - -function isWeakRef(x) { - if (!weakRefDeref || !x || typeof x !== 'object') { - return false; - } - try { - weakRefDeref.call(x); - return true; - } catch (e) {} - return false; -} - -function isSet(x) { - if (!setSize || !x || typeof x !== 'object') { - return false; - } - try { - setSize.call(x); - try { - mapSize.call(x); - } catch (m) { - return true; - } - return x instanceof Set; // core-js workaround, pre-v2.5.0 - } catch (e) {} - return false; -} - -function isWeakSet(x) { - if (!weakSetHas || !x || typeof x !== 'object') { - return false; - } - try { - weakSetHas.call(x, weakSetHas); - try { - weakMapHas.call(x, weakMapHas); - } catch (s) { - return true; - } - return x instanceof WeakSet; // core-js workaround, pre-v2.5.0 - } catch (e) {} - return false; -} - -function isElement(x) { - if (!x || typeof x !== 'object') { return false; } - if (typeof HTMLElement !== 'undefined' && x instanceof HTMLElement) { - return true; - } - return typeof x.nodeName === 'string' && typeof x.getAttribute === 'function'; -} - -function inspectString(str, opts) { - if (str.length > opts.maxStringLength) { - var remaining = str.length - opts.maxStringLength; - var trailer = '... ' + remaining + ' more character' + (remaining > 1 ? 's' : ''); - return inspectString($slice.call(str, 0, opts.maxStringLength), opts) + trailer; - } - // eslint-disable-next-line no-control-regex - var s = $replace.call($replace.call(str, /(['\\])/g, '\\$1'), /[\x00-\x1f]/g, lowbyte); - return wrapQuotes(s, 'single', opts); -} - -function lowbyte(c) { - var n = c.charCodeAt(0); - var x = { - 8: 'b', - 9: 't', - 10: 'n', - 12: 'f', - 13: 'r' - }[n]; - if (x) { return '\\' + x; } - return '\\x' + (n < 0x10 ? '0' : '') + $toUpperCase.call(n.toString(16)); -} - -function markBoxed(str) { - return 'Object(' + str + ')'; -} - -function weakCollectionOf(type) { - return type + ' { ? }'; -} - -function collectionOf(type, size, entries, indent) { - var joinedEntries = indent ? indentedJoin(entries, indent) : $join.call(entries, ', '); - return type + ' (' + size + ') {' + joinedEntries + '}'; -} - -function singleLineValues(xs) { - for (var i = 0; i < xs.length; i++) { - if (indexOf(xs[i], '\n') >= 0) { - return false; - } - } - return true; -} - -function getIndent(opts, depth) { - var baseIndent; - if (opts.indent === '\t') { - baseIndent = '\t'; - } else if (typeof opts.indent === 'number' && opts.indent > 0) { - baseIndent = $join.call(Array(opts.indent + 1), ' '); - } else { - return null; - } - return { - base: baseIndent, - prev: $join.call(Array(depth + 1), baseIndent) - }; -} - -function indentedJoin(xs, indent) { - if (xs.length === 0) { return ''; } - var lineJoiner = '\n' + indent.prev + indent.base; - return lineJoiner + $join.call(xs, ',' + lineJoiner) + '\n' + indent.prev; -} - -function arrObjKeys(obj, inspect) { - var isArr = isArray(obj); - var xs = []; - if (isArr) { - xs.length = obj.length; - for (var i = 0; i < obj.length; i++) { - xs[i] = has(obj, i) ? inspect(obj[i], obj) : ''; - } - } - var syms = typeof gOPS === 'function' ? gOPS(obj) : []; - var symMap; - if (hasShammedSymbols) { - symMap = {}; - for (var k = 0; k < syms.length; k++) { - symMap['$' + syms[k]] = syms[k]; - } - } +"use strict";module.exports=ReferenceError; - for (var key in obj) { // eslint-disable-line no-restricted-syntax - if (!has(obj, key)) { continue; } // eslint-disable-line no-restricted-syntax, no-continue - if (isArr && String(Number(key)) === key && key < obj.length) { continue; } // eslint-disable-line no-restricted-syntax, no-continue - if (hasShammedSymbols && symMap['$' + key] instanceof Symbol) { - // this is to prevent shammed Symbols, which are stored as strings, from being included in the string key section - continue; // eslint-disable-line no-restricted-syntax, no-continue - } else if ($test.call(/[^\w$]/, key)) { - xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj)); - } else { - xs.push(key + ': ' + inspect(obj[key], obj)); - } - } - if (typeof gOPS === 'function') { - for (var j = 0; j < syms.length; j++) { - if (isEnumerable.call(obj, syms[j])) { - xs.push('[' + inspect(syms[j]) + ']: ' + inspect(obj[syms[j]], obj)); - } - } - } - return xs; -} +},{}],17:[function(require,module,exports){ +"use strict";module.exports=URIError; -},{"./util.inspect":6}],16:[function(require,module,exports){ -'use strict'; +},{}],18:[function(require,module,exports){ +"use strict";var ERROR_MESSAGE="Function.prototype.bind called on incompatible ",toStr=Object.prototype.toString,max=Math.max,funcType="[object Function]",concatty=function concatty(t,n){for(var r=[],o=0;o-1e3&&t<1e3||$test.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof t){var n=t<0?-$floor(-t):$floor(t);if(n!==t){var o=String(n),i=$slice.call(e,o.length+1);return $replace.call(o,r,"$&_")+"."+$replace.call($replace.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return $replace.call(e,r,"$&_")}var utilInspect=require(6),inspectCustom=utilInspect.custom,inspectSymbol=isSymbol(inspectCustom)?inspectCustom:null;function wrapQuotes(t,e,r){var n="double"===(r.quoteStyle||e)?'"':"'";return n+t+n}function quote(t){return $replace.call(String(t),/"/g,""")}function isArray(t){return!("[object Array]"!==toStr(t)||toStringTag&&"object"==typeof t&&toStringTag in t)}function isDate(t){return!("[object Date]"!==toStr(t)||toStringTag&&"object"==typeof t&&toStringTag in t)}function isRegExp(t){return!("[object RegExp]"!==toStr(t)||toStringTag&&"object"==typeof t&&toStringTag in t)}function isError(t){return!("[object Error]"!==toStr(t)||toStringTag&&"object"==typeof t&&toStringTag in t)}function isString(t){return!("[object String]"!==toStr(t)||toStringTag&&"object"==typeof t&&toStringTag in t)}function isNumber(t){return!("[object Number]"!==toStr(t)||toStringTag&&"object"==typeof t&&toStringTag in t)}function isBoolean(t){return!("[object Boolean]"!==toStr(t)||toStringTag&&"object"==typeof t&&toStringTag in t)}function isSymbol(t){if(hasShammedSymbols)return t&&"object"==typeof t&&t instanceof Symbol;if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||!symToString)return!1;try{return symToString.call(t),!0}catch(t){}return!1}function isBigInt(t){if(!t||"object"!=typeof t||!bigIntValueOf)return!1;try{return bigIntValueOf.call(t),!0}catch(t){}return!1}module.exports=function inspect_(t,e,r,n){var o=e||{};if(has(o,"quoteStyle")&&"single"!==o.quoteStyle&&"double"!==o.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(has(o,"maxStringLength")&&("number"==typeof o.maxStringLength?o.maxStringLength<0&&o.maxStringLength!==1/0:null!==o.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var i=!has(o,"customInspect")||o.customInspect;if("boolean"!=typeof i&&"symbol"!==i)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(has(o,"indent")&&null!==o.indent&&"\t"!==o.indent&&!(parseInt(o.indent,10)===o.indent&&o.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(has(o,"numericSeparator")&&"boolean"!=typeof o.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var a=o.numericSeparator;if(void 0===t)return"undefined";if(null===t)return"null";if("boolean"==typeof t)return t?"true":"false";if("string"==typeof t)return inspectString(t,o);if("number"==typeof t){if(0===t)return 1/0/t>0?"0":"-0";var c=String(t);return a?addNumericSeparator(t,c):c}if("bigint"==typeof t){var l=String(t)+"n";return a?addNumericSeparator(t,l):l}var p=void 0===o.depth?5:o.depth;if(void 0===r&&(r=0),r>=p&&p>0&&"object"==typeof t)return isArray(t)?"[Array]":"[Object]";var u=getIndent(o,r);if(void 0===n)n=[];else if(indexOf(n,t)>=0)return"[Circular]";function inspect(t,e,i){if(e&&(n=$arrSlice.call(n)).push(e),i){var a={depth:o.depth};return has(o,"quoteStyle")&&(a.quoteStyle=o.quoteStyle),inspect_(t,a,r+1,n)}return inspect_(t,o,r+1,n)}if("function"==typeof t&&!isRegExp(t)){var f=nameOf(t),s=arrObjKeys(t,inspect);return"[Function"+(f?": "+f:" (anonymous)")+"]"+(s.length>0?" { "+$join.call(s,", ")+" }":"")}if(isSymbol(t)){var y=hasShammedSymbols?$replace.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):symToString.call(t);return"object"!=typeof t||hasShammedSymbols?y:markBoxed(y)}if(isElement(t)){for(var S="<"+$toLowerCase.call(String(t.nodeName)),g=t.attributes||[],b=0;b"}if(isArray(t)){if(0===t.length)return"[]";var m=arrObjKeys(t,inspect);return u&&!singleLineValues(m)?"["+indentedJoin(m,u)+"]":"[ "+$join.call(m,", ")+" ]"}if(isError(t)){var h=arrObjKeys(t,inspect);return"cause"in Error.prototype||!("cause"in t)||isEnumerable.call(t,"cause")?0===h.length?"["+String(t)+"]":"{ ["+String(t)+"] "+$join.call(h,", ")+" }":"{ ["+String(t)+"] "+$join.call($concat.call("[cause]: "+inspect(t.cause),h),", ")+" }"}if("object"==typeof t&&i){if(inspectSymbol&&"function"==typeof t[inspectSymbol]&&utilInspect)return utilInspect(t,{depth:p-r});if("symbol"!==i&&"function"==typeof t.inspect)return t.inspect()}if(isMap(t)){var d=[];return mapForEach&&mapForEach.call(t,(function(e,r){d.push(inspect(r,t,!0)+" => "+inspect(e,t))})),collectionOf("Map",mapSize.call(t),d,u)}if(isSet(t)){var j=[];return setForEach&&setForEach.call(t,(function(e){j.push(inspect(e,t))})),collectionOf("Set",setSize.call(t),j,u)}if(isWeakMap(t))return weakCollectionOf("WeakMap");if(isWeakSet(t))return weakCollectionOf("WeakSet");if(isWeakRef(t))return weakCollectionOf("WeakRef");if(isNumber(t))return markBoxed(inspect(Number(t)));if(isBigInt(t))return markBoxed(inspect(bigIntValueOf.call(t)));if(isBoolean(t))return markBoxed(booleanValueOf.call(t));if(isString(t))return markBoxed(inspect(String(t)));if("undefined"!=typeof window&&t===window)return"{ [object Window] }";if("undefined"!=typeof globalThis&&t===globalThis||"undefined"!=typeof global&&t===global)return"{ [object globalThis] }";if(!isDate(t)&&!isRegExp(t)){var O=arrObjKeys(t,inspect),w=gPO?gPO(t)===Object.prototype:t instanceof Object||t.constructor===Object,$=t instanceof Object?"":"null prototype",k=!w&&toStringTag&&Object(t)===t&&toStringTag in t?$slice.call(toStr(t),8,-1):$?"Object":"",v=(w||"function"!=typeof t.constructor?"":t.constructor.name?t.constructor.name+" ":"")+(k||$?"["+$join.call($concat.call([],k||[],$||[]),": ")+"] ":"");return 0===O.length?v+"{}":u?v+"{"+indentedJoin(O,u)+"}":v+"{ "+$join.call(O,", ")+" }"}return String(t)};var hasOwn=Object.prototype.hasOwnProperty||function(t){return t in this};function has(t,e){return hasOwn.call(t,e)}function toStr(t){return objectToString.call(t)}function nameOf(t){if(t.name)return t.name;var e=$match.call(functionToString.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}function indexOf(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;re.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return inspectString($slice.call(t,0,e.maxStringLength),e)+n}return wrapQuotes($replace.call($replace.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,lowbyte),"single",e)}function lowbyte(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+$toUpperCase.call(e.toString(16))}function markBoxed(t){return"Object("+t+")"}function weakCollectionOf(t){return t+" { ? }"}function collectionOf(t,e,r,n){return t+" ("+e+") {"+(n?indentedJoin(r,n):$join.call(r,", "))+"}"}function singleLineValues(t){for(var e=0;e=0)return!1;return!0}function getIndent(t,e){var r;if("\t"===t.indent)r="\t";else{if(!("number"==typeof t.indent&&t.indent>0))return null;r=$join.call(Array(t.indent+1)," ")}return{base:r,prev:$join.call(Array(e+1),r)}}function indentedJoin(t,e){if(0===t.length)return"";var r="\n"+e.prev+e.base;return r+$join.call(t,","+r)+"\n"+e.prev}function arrObjKeys(t,e){var r=isArray(t),n=[];if(r){n.length=t.length;for(var o=0;o= 0 && (options.parseArrays && index <= options.arrayLimit) ) { obj = []; obj[index] = leaf; - } else if (cleanRoot !== '__proto__') { - obj[cleanRoot] = leaf; + } else if (decodedRoot !== '__proto__') { + obj[decodedRoot] = leaf; } } @@ -192,9 +202,12 @@ var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesPars keys.push(segment[1]); } - // If there's a remainder, just add whatever is left + // If there's a remainder, check strictDepth option for throw, else just add whatever is left if (segment) { + if (options.strictDepth === true) { + throw new RangeError('Input depth exceeded depth option of ' + options.depth + ' and strictDepth is true'); + } keys.push('[' + key.slice(segment.index) + ']'); } @@ -206,7 +219,15 @@ var normalizeParseOptions = function normalizeParseOptions(opts) { return defaults; } - if (opts.decoder !== null && opts.decoder !== undefined && typeof opts.decoder !== 'function') { + if (typeof opts.allowEmptyArrays !== 'undefined' && typeof opts.allowEmptyArrays !== 'boolean') { + throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided'); + } + + if (typeof opts.decodeDotInKeys !== 'undefined' && typeof opts.decodeDotInKeys !== 'boolean') { + throw new TypeError('`decodeDotInKeys` option can only be `true` or `false`, when provided'); + } + + if (opts.decoder !== null && typeof opts.decoder !== 'undefined' && typeof opts.decoder !== 'function') { throw new TypeError('Decoder has to be a function.'); } @@ -215,23 +236,35 @@ var normalizeParseOptions = function normalizeParseOptions(opts) { } var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset; + var duplicates = typeof opts.duplicates === 'undefined' ? defaults.duplicates : opts.duplicates; + + if (duplicates !== 'combine' && duplicates !== 'first' && duplicates !== 'last') { + throw new TypeError('The duplicates option must be either combine, first, or last'); + } + + var allowDots = typeof opts.allowDots === 'undefined' ? opts.decodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots; + return { - allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots, + allowDots: allowDots, + allowEmptyArrays: typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays, allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes, allowSparse: typeof opts.allowSparse === 'boolean' ? opts.allowSparse : defaults.allowSparse, arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit, charset: charset, charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel, comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma, + decodeDotInKeys: typeof opts.decodeDotInKeys === 'boolean' ? opts.decodeDotInKeys : defaults.decodeDotInKeys, decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder, delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter, // eslint-disable-next-line no-implicit-coercion, no-extra-parens depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults.depth, + duplicates: duplicates, ignoreQueryPrefix: opts.ignoreQueryPrefix === true, interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities, parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit, parseArrays: opts.parseArrays !== false, plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects, + strictDepth: typeof opts.strictDepth === 'boolean' ? !!opts.strictDepth : defaults.strictDepth, strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling }; }; diff --git a/Modules/Chatroom/chat/node_modules/qs/lib/stringify.js b/Modules/Chatroom/chat/node_modules/qs/lib/stringify.js index 48ec0306b8a0..9b934d69b7f7 100644 --- a/Modules/Chatroom/chat/node_modules/qs/lib/stringify.js +++ b/Modules/Chatroom/chat/node_modules/qs/lib/stringify.js @@ -19,7 +19,6 @@ var arrayPrefixGenerators = { }; var isArray = Array.isArray; -var split = String.prototype.split; var push = Array.prototype.push; var pushToArray = function (arr, valueOrArray) { push.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]); @@ -31,10 +30,13 @@ var defaultFormat = formats['default']; var defaults = { addQueryPrefix: false, allowDots: false, + allowEmptyArrays: false, + arrayFormat: 'indices', charset: 'utf-8', charsetSentinel: false, delimiter: '&', encode: true, + encodeDotInKeys: false, encoder: utils.encode, encodeValuesOnly: false, format: defaultFormat, @@ -63,8 +65,10 @@ var stringify = function stringify( prefix, generateArrayPrefix, commaRoundTrip, + allowEmptyArrays, strictNullHandling, skipNulls, + encodeDotInKeys, encoder, filter, sort, @@ -121,14 +125,6 @@ var stringify = function stringify( if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) { if (encoder) { var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset, 'key', format); - if (generateArrayPrefix === 'comma' && encodeValuesOnly) { - var valuesArray = split.call(String(obj), ','); - var valuesJoined = ''; - for (var i = 0; i < valuesArray.length; ++i) { - valuesJoined += (i === 0 ? '' : ',') + formatter(encoder(valuesArray[i], defaults.encoder, charset, 'value', format)); - } - return [formatter(keyValue) + (commaRoundTrip && isArray(obj) && valuesArray.length === 1 ? '[]' : '') + '=' + valuesJoined]; - } return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder, charset, 'value', format))]; } return [formatter(prefix) + '=' + formatter(String(obj))]; @@ -143,6 +139,9 @@ var stringify = function stringify( var objKeys; if (generateArrayPrefix === 'comma' && isArray(obj)) { // we need to join elements in + if (encodeValuesOnly && encoder) { + obj = utils.maybeMap(obj, encoder); + } objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : void undefined }]; } else if (isArray(filter)) { objKeys = filter; @@ -151,7 +150,13 @@ var stringify = function stringify( objKeys = sort ? keys.sort(sort) : keys; } - var adjustedPrefix = commaRoundTrip && isArray(obj) && obj.length === 1 ? prefix + '[]' : prefix; + var encodedPrefix = encodeDotInKeys ? prefix.replace(/\./g, '%2E') : prefix; + + var adjustedPrefix = commaRoundTrip && isArray(obj) && obj.length === 1 ? encodedPrefix + '[]' : encodedPrefix; + + if (allowEmptyArrays && isArray(obj) && obj.length === 0) { + return adjustedPrefix + '[]'; + } for (var j = 0; j < objKeys.length; ++j) { var key = objKeys[j]; @@ -161,9 +166,10 @@ var stringify = function stringify( continue; } + var encodedKey = allowDots && encodeDotInKeys ? key.replace(/\./g, '%2E') : key; var keyPrefix = isArray(obj) - ? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(adjustedPrefix, key) : adjustedPrefix - : adjustedPrefix + (allowDots ? '.' + key : '[' + key + ']'); + ? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(adjustedPrefix, encodedKey) : adjustedPrefix + : adjustedPrefix + (allowDots ? '.' + encodedKey : '[' + encodedKey + ']'); sideChannel.set(object, step); var valueSideChannel = getSideChannel(); @@ -173,9 +179,11 @@ var stringify = function stringify( keyPrefix, generateArrayPrefix, commaRoundTrip, + allowEmptyArrays, strictNullHandling, skipNulls, - encoder, + encodeDotInKeys, + generateArrayPrefix === 'comma' && encodeValuesOnly && isArray(obj) ? null : encoder, filter, sort, allowDots, @@ -196,6 +204,14 @@ var normalizeStringifyOptions = function normalizeStringifyOptions(opts) { return defaults; } + if (typeof opts.allowEmptyArrays !== 'undefined' && typeof opts.allowEmptyArrays !== 'boolean') { + throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided'); + } + + if (typeof opts.encodeDotInKeys !== 'undefined' && typeof opts.encodeDotInKeys !== 'boolean') { + throw new TypeError('`encodeDotInKeys` option can only be `true` or `false`, when provided'); + } + if (opts.encoder !== null && typeof opts.encoder !== 'undefined' && typeof opts.encoder !== 'function') { throw new TypeError('Encoder has to be a function.'); } @@ -219,13 +235,32 @@ var normalizeStringifyOptions = function normalizeStringifyOptions(opts) { filter = opts.filter; } + var arrayFormat; + if (opts.arrayFormat in arrayPrefixGenerators) { + arrayFormat = opts.arrayFormat; + } else if ('indices' in opts) { + arrayFormat = opts.indices ? 'indices' : 'repeat'; + } else { + arrayFormat = defaults.arrayFormat; + } + + if ('commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') { + throw new TypeError('`commaRoundTrip` must be a boolean, or absent'); + } + + var allowDots = typeof opts.allowDots === 'undefined' ? opts.encodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots; + return { addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults.addQueryPrefix, - allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots, + allowDots: allowDots, + allowEmptyArrays: typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays, + arrayFormat: arrayFormat, charset: charset, charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel, + commaRoundTrip: opts.commaRoundTrip, delimiter: typeof opts.delimiter === 'undefined' ? defaults.delimiter : opts.delimiter, encode: typeof opts.encode === 'boolean' ? opts.encode : defaults.encode, + encodeDotInKeys: typeof opts.encodeDotInKeys === 'boolean' ? opts.encodeDotInKeys : defaults.encodeDotInKeys, encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults.encoder, encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults.encodeValuesOnly, filter: filter, @@ -259,20 +294,8 @@ module.exports = function (object, opts) { return ''; } - var arrayFormat; - if (opts && opts.arrayFormat in arrayPrefixGenerators) { - arrayFormat = opts.arrayFormat; - } else if (opts && 'indices' in opts) { - arrayFormat = opts.indices ? 'indices' : 'repeat'; - } else { - arrayFormat = 'indices'; - } - - var generateArrayPrefix = arrayPrefixGenerators[arrayFormat]; - if (opts && 'commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') { - throw new TypeError('`commaRoundTrip` must be a boolean, or absent'); - } - var commaRoundTrip = generateArrayPrefix === 'comma' && opts && opts.commaRoundTrip; + var generateArrayPrefix = arrayPrefixGenerators[options.arrayFormat]; + var commaRoundTrip = generateArrayPrefix === 'comma' && options.commaRoundTrip; if (!objKeys) { objKeys = Object.keys(obj); @@ -294,8 +317,10 @@ module.exports = function (object, opts) { key, generateArrayPrefix, commaRoundTrip, + options.allowEmptyArrays, options.strictNullHandling, options.skipNulls, + options.encodeDotInKeys, options.encode ? options.encoder : null, options.filter, options.sort, diff --git a/Modules/Chatroom/chat/node_modules/qs/lib/utils.js b/Modules/Chatroom/chat/node_modules/qs/lib/utils.js index 1e545381131a..7c860f1b160a 100644 --- a/Modules/Chatroom/chat/node_modules/qs/lib/utils.js +++ b/Modules/Chatroom/chat/node_modules/qs/lib/utils.js @@ -122,6 +122,10 @@ var decode = function (str, decoder, charset) { } }; +var limit = 1024; + +/* eslint operator-linebreak: [2, "before"] */ + var encode = function encode(str, defaultEncoder, charset, kind, format) { // This code was originally written by Brian White (mscdex) for the io.js core querystring library. // It has been adapted here for stricter adherence to RFC 3986 @@ -143,45 +147,54 @@ var encode = function encode(str, defaultEncoder, charset, kind, format) { } var out = ''; - for (var i = 0; i < string.length; ++i) { - var c = string.charCodeAt(i); - - if ( - c === 0x2D // - - || c === 0x2E // . - || c === 0x5F // _ - || c === 0x7E // ~ - || (c >= 0x30 && c <= 0x39) // 0-9 - || (c >= 0x41 && c <= 0x5A) // a-z - || (c >= 0x61 && c <= 0x7A) // A-Z - || (format === formats.RFC1738 && (c === 0x28 || c === 0x29)) // ( ) - ) { - out += string.charAt(i); - continue; - } + for (var j = 0; j < string.length; j += limit) { + var segment = string.length >= limit ? string.slice(j, j + limit) : string; + var arr = []; + + for (var i = 0; i < segment.length; ++i) { + var c = segment.charCodeAt(i); + if ( + c === 0x2D // - + || c === 0x2E // . + || c === 0x5F // _ + || c === 0x7E // ~ + || (c >= 0x30 && c <= 0x39) // 0-9 + || (c >= 0x41 && c <= 0x5A) // a-z + || (c >= 0x61 && c <= 0x7A) // A-Z + || (format === formats.RFC1738 && (c === 0x28 || c === 0x29)) // ( ) + ) { + arr[arr.length] = segment.charAt(i); + continue; + } - if (c < 0x80) { - out = out + hexTable[c]; - continue; - } + if (c < 0x80) { + arr[arr.length] = hexTable[c]; + continue; + } - if (c < 0x800) { - out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]); - continue; - } + if (c < 0x800) { + arr[arr.length] = hexTable[0xC0 | (c >> 6)] + + hexTable[0x80 | (c & 0x3F)]; + continue; + } + + if (c < 0xD800 || c >= 0xE000) { + arr[arr.length] = hexTable[0xE0 | (c >> 12)] + + hexTable[0x80 | ((c >> 6) & 0x3F)] + + hexTable[0x80 | (c & 0x3F)]; + continue; + } + + i += 1; + c = 0x10000 + (((c & 0x3FF) << 10) | (segment.charCodeAt(i) & 0x3FF)); - if (c < 0xD800 || c >= 0xE000) { - out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]); - continue; + arr[arr.length] = hexTable[0xF0 | (c >> 18)] + + hexTable[0x80 | ((c >> 12) & 0x3F)] + + hexTable[0x80 | ((c >> 6) & 0x3F)] + + hexTable[0x80 | (c & 0x3F)]; } - i += 1; - c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF)); - /* eslint operator-linebreak: [2, "before"] */ - out += hexTable[0xF0 | (c >> 18)] - + hexTable[0x80 | ((c >> 12) & 0x3F)] - + hexTable[0x80 | ((c >> 6) & 0x3F)] - + hexTable[0x80 | (c & 0x3F)]; + out += arr.join(''); } return out; diff --git a/Modules/Chatroom/chat/node_modules/qs/package.json b/Modules/Chatroom/chat/node_modules/qs/package.json index 2ff42f375b87..6dae052173fd 100644 --- a/Modules/Chatroom/chat/node_modules/qs/package.json +++ b/Modules/Chatroom/chat/node_modules/qs/package.json @@ -2,7 +2,7 @@ "name": "qs", "description": "A querystring parser that supports nesting and arrays, with a depth limit", "homepage": "https://github.com/ljharb/qs", - "version": "6.11.0", + "version": "6.13.0", "repository": { "type": "git", "url": "https://github.com/ljharb/qs.git" @@ -11,6 +11,7 @@ "url": "https://github.com/sponsors/ljharb" }, "main": "lib/index.js", + "sideEffects": false, "contributors": [ { "name": "Jordan Harband", @@ -30,40 +31,51 @@ "node": ">=0.6" }, "dependencies": { - "side-channel": "^1.0.4" + "side-channel": "^1.0.6" }, "devDependencies": { - "@ljharb/eslint-config": "^21.0.0", - "aud": "^2.0.0", + "@browserify/envify": "^6.0.0", + "@browserify/uglifyify": "^6.0.0", + "@ljharb/eslint-config": "^21.1.1", "browserify": "^16.5.2", + "bundle-collapser": "^1.4.0", + "common-shakeify": "~1.0.0", "eclint": "^2.8.1", + "es-value-fixtures": "^1.4.2", "eslint": "=8.8.0", "evalmd": "^0.0.19", "for-each": "^0.3.3", + "glob": "=10.3.7", + "has-override-mistake": "^1.0.1", + "has-property-descriptors": "^1.0.2", "has-symbols": "^1.0.3", "iconv-lite": "^0.5.1", "in-publish": "^2.0.1", + "jackspeak": "=2.1.1", "mkdirp": "^0.5.5", - "npmignore": "^0.3.0", + "mock-property": "^1.0.3", + "module-deps": "^6.2.3", + "npmignore": "^0.3.1", "nyc": "^10.3.2", - "object-inspect": "^1.12.2", + "object-inspect": "^1.13.2", "qs-iconv": "^1.0.4", "safe-publish-latest": "^2.0.0", "safer-buffer": "^2.1.2", - "tape": "^5.5.3" + "tape": "^5.8.1", + "unassertify": "^3.0.1" }, "scripts": { - "prepack": "npmignore --auto --commentLines=autogenerated", - "prepublishOnly": "safe-publish-latest && npm run dist", + "prepack": "npmignore --auto --commentLines=autogenerated && npm run dist", + "prepublishOnly": "safe-publish-latest", "prepublish": "not-in-publish || npm run prepublishOnly", "pretest": "npm run --silent readme && npm run --silent lint", "test": "npm run tests-only", "tests-only": "nyc tape 'test/**/*.js'", - "posttest": "aud --production", + "posttest": "npx npm@'>=10.2' audit --production", "readme": "evalmd README.md", "postlint": "eclint check $(git ls-files | xargs find 2> /dev/null | grep -vE 'node_modules|\\.git' | grep -v dist/)", "lint": "eslint --ext=js,mjs .", - "dist": "mkdirp dist && browserify --standalone Qs lib/index.js > dist/qs.js" + "dist": "mkdirp dist && browserify --standalone Qs -g unassertify -g @browserify/envify -g [@browserify/uglifyify --mangle.keep_fnames --compress.keep_fnames --format.indent_level=1 --compress.arrows=false --compress.passes=4 --compress.typeofs=false] -p common-shakeify -p bundle-collapser/plugin lib/index.js > dist/qs.js" }, "license": "BSD-3-Clause", "publishConfig": { @@ -71,7 +83,9 @@ "!dist/*", "bower.json", "component.json", - ".github/workflows" + ".github/workflows", + "logos", + "tea.yaml" ] } } diff --git a/Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/test/empty-keys-cases.js b/Modules/Chatroom/chat/node_modules/qs/test/empty-keys-cases.js similarity index 100% rename from Modules/Chatroom/chat/node_modules/body-parser/node_modules/qs/test/empty-keys-cases.js rename to Modules/Chatroom/chat/node_modules/qs/test/empty-keys-cases.js diff --git a/Modules/Chatroom/chat/node_modules/qs/test/parse.js b/Modules/Chatroom/chat/node_modules/qs/test/parse.js index 7d7b4dd8aea1..8a2f487c8d47 100644 --- a/Modules/Chatroom/chat/node_modules/qs/test/parse.js +++ b/Modules/Chatroom/chat/node_modules/qs/test/parse.js @@ -1,10 +1,17 @@ 'use strict'; var test = require('tape'); -var qs = require('../'); -var utils = require('../lib/utils'); +var hasPropertyDescriptors = require('has-property-descriptors')(); var iconv = require('iconv-lite'); +var mockProperty = require('mock-property'); +var hasOverrideMistake = require('has-override-mistake')(); var SaferBuffer = require('safer-buffer').Buffer; +var v = require('es-value-fixtures'); +var inspect = require('object-inspect'); +var emptyTestCases = require('./empty-keys-cases').emptyTestCases; + +var qs = require('../'); +var utils = require('../lib/utils'); test('parse()', function (t) { t.test('parses a simple string', function (st) { @@ -32,41 +39,156 @@ test('parse()', function (t) { st.end(); }); - t.test('arrayFormat: brackets allows only explicit arrays', function (st) { - st.deepEqual(qs.parse('a[]=b&a[]=c', { arrayFormat: 'brackets' }), { a: ['b', 'c'] }); - st.deepEqual(qs.parse('a[0]=b&a[1]=c', { arrayFormat: 'brackets' }), { a: ['b', 'c'] }); - st.deepEqual(qs.parse('a=b,c', { arrayFormat: 'brackets' }), { a: 'b,c' }); - st.deepEqual(qs.parse('a=b&a=c', { arrayFormat: 'brackets' }), { a: ['b', 'c'] }); + t.test('comma: false', function (st) { + st.deepEqual(qs.parse('a[]=b&a[]=c'), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a[0]=b&a[1]=c'), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a=b,c'), { a: 'b,c' }); + st.deepEqual(qs.parse('a=b&a=c'), { a: ['b', 'c'] }); st.end(); }); - t.test('arrayFormat: indices allows only indexed arrays', function (st) { - st.deepEqual(qs.parse('a[]=b&a[]=c', { arrayFormat: 'indices' }), { a: ['b', 'c'] }); - st.deepEqual(qs.parse('a[0]=b&a[1]=c', { arrayFormat: 'indices' }), { a: ['b', 'c'] }); - st.deepEqual(qs.parse('a=b,c', { arrayFormat: 'indices' }), { a: 'b,c' }); - st.deepEqual(qs.parse('a=b&a=c', { arrayFormat: 'indices' }), { a: ['b', 'c'] }); + t.test('comma: true', function (st) { + st.deepEqual(qs.parse('a[]=b&a[]=c', { comma: true }), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a[0]=b&a[1]=c', { comma: true }), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a=b,c', { comma: true }), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a=b&a=c', { comma: true }), { a: ['b', 'c'] }); + st.end(); + }); + + t.test('allows enabling dot notation', function (st) { + st.deepEqual(qs.parse('a.b=c'), { 'a.b': 'c' }); + st.deepEqual(qs.parse('a.b=c', { allowDots: true }), { a: { b: 'c' } }); + st.end(); }); - t.test('arrayFormat: comma allows only comma-separated arrays', function (st) { - st.deepEqual(qs.parse('a[]=b&a[]=c', { arrayFormat: 'comma' }), { a: ['b', 'c'] }); - st.deepEqual(qs.parse('a[0]=b&a[1]=c', { arrayFormat: 'comma' }), { a: ['b', 'c'] }); - st.deepEqual(qs.parse('a=b,c', { arrayFormat: 'comma' }), { a: 'b,c' }); - st.deepEqual(qs.parse('a=b&a=c', { arrayFormat: 'comma' }), { a: ['b', 'c'] }); + t.test('decode dot keys correctly', function (st) { + st.deepEqual( + qs.parse('name%252Eobj.first=John&name%252Eobj.last=Doe', { allowDots: false, decodeDotInKeys: false }), + { 'name%2Eobj.first': 'John', 'name%2Eobj.last': 'Doe' }, + 'with allowDots false and decodeDotInKeys false' + ); + st.deepEqual( + qs.parse('name.obj.first=John&name.obj.last=Doe', { allowDots: true, decodeDotInKeys: false }), + { name: { obj: { first: 'John', last: 'Doe' } } }, + 'with allowDots false and decodeDotInKeys false' + ); + st.deepEqual( + qs.parse('name%252Eobj.first=John&name%252Eobj.last=Doe', { allowDots: true, decodeDotInKeys: false }), + { 'name%2Eobj': { first: 'John', last: 'Doe' } }, + 'with allowDots true and decodeDotInKeys false' + ); + st.deepEqual( + qs.parse('name%252Eobj.first=John&name%252Eobj.last=Doe', { allowDots: true, decodeDotInKeys: true }), + { 'name.obj': { first: 'John', last: 'Doe' } }, + 'with allowDots true and decodeDotInKeys true' + ); + + st.deepEqual( + qs.parse( + 'name%252Eobj%252Esubobject.first%252Egodly%252Ename=John&name%252Eobj%252Esubobject.last=Doe', + { allowDots: false, decodeDotInKeys: false } + ), + { 'name%2Eobj%2Esubobject.first%2Egodly%2Ename': 'John', 'name%2Eobj%2Esubobject.last': 'Doe' }, + 'with allowDots false and decodeDotInKeys false' + ); + st.deepEqual( + qs.parse( + 'name.obj.subobject.first.godly.name=John&name.obj.subobject.last=Doe', + { allowDots: true, decodeDotInKeys: false } + ), + { name: { obj: { subobject: { first: { godly: { name: 'John' } }, last: 'Doe' } } } }, + 'with allowDots true and decodeDotInKeys false' + ); + st.deepEqual( + qs.parse( + 'name%252Eobj%252Esubobject.first%252Egodly%252Ename=John&name%252Eobj%252Esubobject.last=Doe', + { allowDots: true, decodeDotInKeys: true } + ), + { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, + 'with allowDots true and decodeDotInKeys true' + ); + st.deepEqual( + qs.parse('name%252Eobj.first=John&name%252Eobj.last=Doe'), + { 'name%2Eobj.first': 'John', 'name%2Eobj.last': 'Doe' }, + 'with allowDots and decodeDotInKeys undefined' + ); + st.end(); }); - t.test('arrayFormat: repeat allows only repeated values', function (st) { - st.deepEqual(qs.parse('a[]=b&a[]=c', { arrayFormat: 'repeat' }), { a: ['b', 'c'] }); - st.deepEqual(qs.parse('a[0]=b&a[1]=c', { arrayFormat: 'repeat' }), { a: ['b', 'c'] }); - st.deepEqual(qs.parse('a=b,c', { arrayFormat: 'repeat' }), { a: 'b,c' }); - st.deepEqual(qs.parse('a=b&a=c', { arrayFormat: 'repeat' }), { a: ['b', 'c'] }); + t.test('should decode dot in key of object, and allow enabling dot notation when decodeDotInKeys is set to true and allowDots is undefined', function (st) { + st.deepEqual( + qs.parse( + 'name%252Eobj%252Esubobject.first%252Egodly%252Ename=John&name%252Eobj%252Esubobject.last=Doe', + { decodeDotInKeys: true } + ), + { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, + 'with allowDots undefined and decodeDotInKeys true' + ); + st.end(); }); - t.test('allows enabling dot notation', function (st) { - st.deepEqual(qs.parse('a.b=c'), { 'a.b': 'c' }); - st.deepEqual(qs.parse('a.b=c', { allowDots: true }), { a: { b: 'c' } }); + t.test('should throw when decodeDotInKeys is not of type boolean', function (st) { + st['throws']( + function () { qs.parse('foo[]&bar=baz', { decodeDotInKeys: 'foobar' }); }, + TypeError + ); + + st['throws']( + function () { qs.parse('foo[]&bar=baz', { decodeDotInKeys: 0 }); }, + TypeError + ); + st['throws']( + function () { qs.parse('foo[]&bar=baz', { decodeDotInKeys: NaN }); }, + TypeError + ); + + st['throws']( + function () { qs.parse('foo[]&bar=baz', { decodeDotInKeys: null }); }, + TypeError + ); + + st.end(); + }); + + t.test('allows empty arrays in obj values', function (st) { + st.deepEqual(qs.parse('foo[]&bar=baz', { allowEmptyArrays: true }), { foo: [], bar: 'baz' }); + st.deepEqual(qs.parse('foo[]&bar=baz', { allowEmptyArrays: false }), { foo: [''], bar: 'baz' }); + + st.end(); + }); + + t.test('should throw when allowEmptyArrays is not of type boolean', function (st) { + st['throws']( + function () { qs.parse('foo[]&bar=baz', { allowEmptyArrays: 'foobar' }); }, + TypeError + ); + + st['throws']( + function () { qs.parse('foo[]&bar=baz', { allowEmptyArrays: 0 }); }, + TypeError + ); + st['throws']( + function () { qs.parse('foo[]&bar=baz', { allowEmptyArrays: NaN }); }, + TypeError + ); + + st['throws']( + function () { qs.parse('foo[]&bar=baz', { allowEmptyArrays: null }); }, + TypeError + ); + + st.end(); + }); + + t.test('allowEmptyArrays + strictNullHandling', function (st) { + st.deepEqual( + qs.parse('testEmptyArray[]', { strictNullHandling: true, allowEmptyArrays: true }), + { testEmptyArray: [] } + ); + st.end(); }); @@ -322,14 +444,14 @@ test('parse()', function (t) { }); t.test('should not throw when a native prototype has an enumerable property', function (st) { - Object.prototype.crash = ''; - Array.prototype.crash = ''; + st.intercept(Object.prototype, 'crash', { value: '' }); + st.intercept(Array.prototype, 'crash', { value: '' }); + st.doesNotThrow(qs.parse.bind(null, 'a=b')); st.deepEqual(qs.parse('a=b'), { a: 'b' }); st.doesNotThrow(qs.parse.bind(null, 'a[][b]=c')); st.deepEqual(qs.parse('a[][b]=c'), { a: [{ b: 'c' }] }); - delete Object.prototype.crash; - delete Array.prototype.crash; + st.end(); }); @@ -360,8 +482,14 @@ test('parse()', function (t) { t.test('allows overriding array limit', function (st) { st.deepEqual(qs.parse('a[0]=b', { arrayLimit: -1 }), { a: { 0: 'b' } }); + st.deepEqual(qs.parse('a[0]=b', { arrayLimit: 0 }), { a: ['b'] }); + st.deepEqual(qs.parse('a[-1]=b', { arrayLimit: -1 }), { a: { '-1': 'b' } }); + st.deepEqual(qs.parse('a[-1]=b', { arrayLimit: 0 }), { a: { '-1': 'b' } }); + + st.deepEqual(qs.parse('a[0]=b&a[1]=c', { arrayLimit: -1 }), { a: { 0: 'b', 1: 'c' } }); st.deepEqual(qs.parse('a[0]=b&a[1]=c', { arrayLimit: 0 }), { a: { 0: 'b', 1: 'c' } }); + st.end(); }); @@ -452,6 +580,15 @@ test('parse()', function (t) { st.end(); }); + t.test('parses url-encoded brackets holds array of arrays when having two parts of strings with comma as array divider', function (st) { + st.deepEqual(qs.parse('foo%5B%5D=1,2,3&foo%5B%5D=4,5,6', { comma: true }), { foo: [['1', '2', '3'], ['4', '5', '6']] }); + st.deepEqual(qs.parse('foo%5B%5D=1,2,3&foo%5B%5D=', { comma: true }), { foo: [['1', '2', '3'], ''] }); + st.deepEqual(qs.parse('foo%5B%5D=1,2,3&foo%5B%5D=,', { comma: true }), { foo: [['1', '2', '3'], ['', '']] }); + st.deepEqual(qs.parse('foo%5B%5D=1,2,3&foo%5B%5D=a', { comma: true }), { foo: [['1', '2', '3'], 'a'] }); + + st.end(); + }); + t.test('parses comma delimited array while having percent-encoded comma treated as normal text', function (st) { st.deepEqual(qs.parse('foo=a%2Cb', { comma: true }), { foo: 'a,b' }); st.deepEqual(qs.parse('foo=a%2C%20b,d', { comma: true }), { foo: ['a, b', 'd'] }); @@ -499,10 +636,12 @@ test('parse()', function (t) { }); t.test('does not blow up when Buffer global is missing', function (st) { - var tempBuffer = global.Buffer; - delete global.Buffer; + var restore = mockProperty(global, 'Buffer', { 'delete': true }); + var result = qs.parse('a=b&c=d'); - global.Buffer = tempBuffer; + + restore(); + st.deepEqual(result, { a: 'b', c: 'd' }); st.end(); }); @@ -601,6 +740,34 @@ test('parse()', function (t) { st.end(); }); + t.test('does not crash when the global Object prototype is frozen', { skip: !hasPropertyDescriptors || !hasOverrideMistake }, function (st) { + // We can't actually freeze the global Object prototype as that will interfere with other tests, and once an object is frozen, it + // can't be unfrozen. Instead, we add a new non-writable property to simulate this. + st.teardown(mockProperty(Object.prototype, 'frozenProp', { value: 'foo', nonWritable: true, nonEnumerable: true })); + + st['throws']( + function () { + var obj = {}; + obj.frozenProp = 'bar'; + }, + // node < 6 has a different error message + /^TypeError: Cannot assign to read only property 'frozenProp' of (?:object '#'|#)/, + 'regular assignment of an inherited non-writable property throws' + ); + + var parsed; + st.doesNotThrow( + function () { + parsed = qs.parse('frozenProp', { allowPrototypes: false }); + }, + 'parsing a nonwritable Object.prototype property does not throw' + ); + + st.deepEqual(parsed, {}, 'bare "frozenProp" results in {}'); + + st.end(); + }); + t.test('params starting with a closing bracket', function (st) { st.deepEqual(qs.parse(']=toString'), { ']': 'toString' }); st.deepEqual(qs.parse(']]=toString'), { ']]': 'toString' }); @@ -853,3 +1020,151 @@ test('parse()', function (t) { t.end(); }); + +test('parses empty keys', function (t) { + emptyTestCases.forEach(function (testCase) { + t.test('skips empty string key with ' + testCase.input, function (st) { + st.deepEqual(qs.parse(testCase.input), testCase.noEmptyKeys); + + st.end(); + }); + }); +}); + +test('`duplicates` option', function (t) { + v.nonStrings.concat('not a valid option').forEach(function (invalidOption) { + if (typeof invalidOption !== 'undefined') { + t['throws']( + function () { qs.parse('', { duplicates: invalidOption }); }, + TypeError, + 'throws on invalid option: ' + inspect(invalidOption) + ); + } + }); + + t.deepEqual( + qs.parse('foo=bar&foo=baz'), + { foo: ['bar', 'baz'] }, + 'duplicates: default, combine' + ); + + t.deepEqual( + qs.parse('foo=bar&foo=baz', { duplicates: 'combine' }), + { foo: ['bar', 'baz'] }, + 'duplicates: combine' + ); + + t.deepEqual( + qs.parse('foo=bar&foo=baz', { duplicates: 'first' }), + { foo: 'bar' }, + 'duplicates: first' + ); + + t.deepEqual( + qs.parse('foo=bar&foo=baz', { duplicates: 'last' }), + { foo: 'baz' }, + 'duplicates: last' + ); + + t.end(); +}); + +test('qs strictDepth option - throw cases', function (t) { + t.test('throws an exception when depth exceeds the limit with strictDepth: true', function (st) { + st['throws']( + function () { + qs.parse('a[b][c][d][e][f][g][h][i]=j', { depth: 1, strictDepth: true }); + }, + RangeError, + 'Should throw RangeError' + ); + st.end(); + }); + + t.test('throws an exception for multiple nested arrays with strictDepth: true', function (st) { + st['throws']( + function () { + qs.parse('a[0][1][2][3][4]=b', { depth: 3, strictDepth: true }); + }, + RangeError, + 'Should throw RangeError' + ); + st.end(); + }); + + t.test('throws an exception for nested objects and arrays with strictDepth: true', function (st) { + st['throws']( + function () { + qs.parse('a[b][c][0][d][e]=f', { depth: 3, strictDepth: true }); + }, + RangeError, + 'Should throw RangeError' + ); + st.end(); + }); + + t.test('throws an exception for different types of values with strictDepth: true', function (st) { + st['throws']( + function () { + qs.parse('a[b][c][d][e]=true&a[b][c][d][f]=42', { depth: 3, strictDepth: true }); + }, + RangeError, + 'Should throw RangeError' + ); + st.end(); + }); + +}); + +test('qs strictDepth option - non-throw cases', function (t) { + t.test('when depth is 0 and strictDepth true, do not throw', function (st) { + st.doesNotThrow( + function () { + qs.parse('a[b][c][d][e]=true&a[b][c][d][f]=42', { depth: 0, strictDepth: true }); + }, + RangeError, + 'Should not throw RangeError' + ); + st.end(); + }); + + t.test('parses successfully when depth is within the limit with strictDepth: true', function (st) { + st.doesNotThrow( + function () { + var result = qs.parse('a[b]=c', { depth: 1, strictDepth: true }); + st.deepEqual(result, { a: { b: 'c' } }, 'Should parse correctly'); + } + ); + st.end(); + }); + + t.test('does not throw an exception when depth exceeds the limit with strictDepth: false', function (st) { + st.doesNotThrow( + function () { + var result = qs.parse('a[b][c][d][e][f][g][h][i]=j', { depth: 1 }); + st.deepEqual(result, { a: { b: { '[c][d][e][f][g][h][i]': 'j' } } }, 'Should parse with depth limit'); + } + ); + st.end(); + }); + + t.test('parses successfully when depth is within the limit with strictDepth: false', function (st) { + st.doesNotThrow( + function () { + var result = qs.parse('a[b]=c', { depth: 1 }); + st.deepEqual(result, { a: { b: 'c' } }, 'Should parse correctly'); + } + ); + st.end(); + }); + + t.test('does not throw when depth is exactly at the limit with strictDepth: true', function (st) { + st.doesNotThrow( + function () { + var result = qs.parse('a[b][c]=d', { depth: 2, strictDepth: true }); + st.deepEqual(result, { a: { b: { c: 'd' } } }, 'Should parse correctly'); + } + ); + st.end(); + }); +}); diff --git a/Modules/Chatroom/chat/node_modules/qs/test/stringify.js b/Modules/Chatroom/chat/node_modules/qs/test/stringify.js index f0cdfefadca4..12b1c71d6dc3 100644 --- a/Modules/Chatroom/chat/node_modules/qs/test/stringify.js +++ b/Modules/Chatroom/chat/node_modules/qs/test/stringify.js @@ -6,6 +6,8 @@ var utils = require('../lib/utils'); var iconv = require('iconv-lite'); var SaferBuffer = require('safer-buffer').Buffer; var hasSymbols = require('has-symbols'); +var mockProperty = require('mock-property'); +var emptyTestCases = require('./empty-keys-cases').emptyTestCases; var hasBigInt = typeof BigInt === 'function'; test('stringify()', function (t) { @@ -63,6 +65,138 @@ test('stringify()', function (t) { st.end(); }); + t.test('encodes dot in key of object when encodeDotInKeys and allowDots is provided', function (st) { + st.equal( + qs.stringify( + { 'name.obj': { first: 'John', last: 'Doe' } }, + { allowDots: false, encodeDotInKeys: false } + ), + 'name.obj%5Bfirst%5D=John&name.obj%5Blast%5D=Doe', + 'with allowDots false and encodeDotInKeys false' + ); + st.equal( + qs.stringify( + { 'name.obj': { first: 'John', last: 'Doe' } }, + { allowDots: true, encodeDotInKeys: false } + ), + 'name.obj.first=John&name.obj.last=Doe', + 'with allowDots true and encodeDotInKeys false' + ); + st.equal( + qs.stringify( + { 'name.obj': { first: 'John', last: 'Doe' } }, + { allowDots: false, encodeDotInKeys: true } + ), + 'name%252Eobj%5Bfirst%5D=John&name%252Eobj%5Blast%5D=Doe', + 'with allowDots false and encodeDotInKeys true' + ); + st.equal( + qs.stringify( + { 'name.obj': { first: 'John', last: 'Doe' } }, + { allowDots: true, encodeDotInKeys: true } + ), + 'name%252Eobj.first=John&name%252Eobj.last=Doe', + 'with allowDots true and encodeDotInKeys true' + ); + + st.equal( + qs.stringify( + { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, + { allowDots: false, encodeDotInKeys: false } + ), + 'name.obj.subobject%5Bfirst.godly.name%5D=John&name.obj.subobject%5Blast%5D=Doe', + 'with allowDots false and encodeDotInKeys false' + ); + st.equal( + qs.stringify( + { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, + { allowDots: true, encodeDotInKeys: false } + ), + 'name.obj.subobject.first.godly.name=John&name.obj.subobject.last=Doe', + 'with allowDots false and encodeDotInKeys false' + ); + st.equal( + qs.stringify( + { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, + { allowDots: false, encodeDotInKeys: true } + ), + 'name%252Eobj%252Esubobject%5Bfirst.godly.name%5D=John&name%252Eobj%252Esubobject%5Blast%5D=Doe', + 'with allowDots false and encodeDotInKeys true' + ); + st.equal( + qs.stringify( + { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, + { allowDots: true, encodeDotInKeys: true } + ), + 'name%252Eobj%252Esubobject.first%252Egodly%252Ename=John&name%252Eobj%252Esubobject.last=Doe', + 'with allowDots true and encodeDotInKeys true' + ); + + st.end(); + }); + + t.test('should encode dot in key of object, and automatically set allowDots to `true` when encodeDotInKeys is true and allowDots in undefined', function (st) { + st.equal( + qs.stringify( + { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, + { encodeDotInKeys: true } + ), + 'name%252Eobj%252Esubobject.first%252Egodly%252Ename=John&name%252Eobj%252Esubobject.last=Doe', + 'with allowDots undefined and encodeDotInKeys true' + ); + st.end(); + }); + + t.test('should encode dot in key of object when encodeDotInKeys and allowDots is provided, and nothing else when encodeValuesOnly is provided', function (st) { + st.equal( + qs.stringify({ 'name.obj': { first: 'John', last: 'Doe' } }, { + encodeDotInKeys: true, allowDots: true, encodeValuesOnly: true + }), + 'name%2Eobj.first=John&name%2Eobj.last=Doe' + ); + + st.equal( + qs.stringify({ 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, { allowDots: true, encodeDotInKeys: true, encodeValuesOnly: true }), + 'name%2Eobj%2Esubobject.first%2Egodly%2Ename=John&name%2Eobj%2Esubobject.last=Doe' + ); + + st.end(); + }); + + t.test('throws when `commaRoundTrip` is not a boolean', function (st) { + st['throws']( + function () { qs.stringify({}, { commaRoundTrip: 'not a boolean' }); }, + TypeError, + 'throws when `commaRoundTrip` is not a boolean' + ); + + st.end(); + }); + + t.test('throws when `encodeDotInKeys` is not a boolean', function (st) { + st['throws']( + function () { qs.stringify({ a: [], b: 'zz' }, { encodeDotInKeys: 'foobar' }); }, + TypeError + ); + + st['throws']( + function () { qs.stringify({ a: [], b: 'zz' }, { encodeDotInKeys: 0 }); }, + TypeError + ); + + st['throws']( + function () { qs.stringify({ a: [], b: 'zz' }, { encodeDotInKeys: NaN }); }, + TypeError + ); + + st['throws']( + function () { qs.stringify({ a: [], b: 'zz' }, { encodeDotInKeys: null }); }, + TypeError + ); + + st.end(); + }); + t.test('adds query prefix', function (st) { st.equal(qs.stringify({ a: 'b' }, { addQueryPrefix: true }), '?a=b'); st.end(); @@ -86,7 +220,7 @@ test('stringify()', function (t) { st.end(); }); - t.test('stringifies a nested object with dots notation', function (st) { + t.test('`allowDots` option: stringifies a nested object with dots notation', function (st) { st.equal(qs.stringify({ a: { b: 'c' } }, { allowDots: true }), 'a.b=c'); st.equal(qs.stringify({ a: { b: { c: { d: 'e' } } } }, { allowDots: true }), 'a.b.c.d=e'); st.end(); @@ -108,6 +242,11 @@ test('stringify()', function (t) { 'a=b%2Cc%2Cd', 'comma => comma' ); + st.equal( + qs.stringify({ a: ['b', 'c', 'd'] }, { arrayFormat: 'comma', commaRoundTrip: true }), + 'a=b%2Cc%2Cd', + 'comma round trip => comma' + ); st.equal( qs.stringify({ a: ['b', 'c', 'd'] }), 'a%5B0%5D=b&a%5B1%5D=c&a%5B2%5D=d', @@ -116,18 +255,75 @@ test('stringify()', function (t) { st.end(); }); - t.test('omits nulls when asked', function (st) { - st.equal(qs.stringify({ a: 'b', c: null }, { skipNulls: true }), 'a=b'); - st.end(); - }); + t.test('`skipNulls` option', function (st) { + st.equal( + qs.stringify({ a: 'b', c: null }, { skipNulls: true }), + 'a=b', + 'omits nulls when asked' + ); + + st.equal( + qs.stringify({ a: { b: 'c', d: null } }, { skipNulls: true }), + 'a%5Bb%5D=c', + 'omits nested nulls when asked' + ); - t.test('omits nested nulls when asked', function (st) { - st.equal(qs.stringify({ a: { b: 'c', d: null } }, { skipNulls: true }), 'a%5Bb%5D=c'); st.end(); }); t.test('omits array indices when asked', function (st) { st.equal(qs.stringify({ a: ['b', 'c', 'd'] }, { indices: false }), 'a=b&a=c&a=d'); + + st.end(); + }); + + t.test('omits object key/value pair when value is empty array', function (st) { + st.equal(qs.stringify({ a: [], b: 'zz' }), 'b=zz'); + + st.end(); + }); + + t.test('should not omit object key/value pair when value is empty array and when asked', function (st) { + st.equal(qs.stringify({ a: [], b: 'zz' }), 'b=zz'); + st.equal(qs.stringify({ a: [], b: 'zz' }, { allowEmptyArrays: false }), 'b=zz'); + st.equal(qs.stringify({ a: [], b: 'zz' }, { allowEmptyArrays: true }), 'a[]&b=zz'); + + st.end(); + }); + + t.test('should throw when allowEmptyArrays is not of type boolean', function (st) { + st['throws']( + function () { qs.stringify({ a: [], b: 'zz' }, { allowEmptyArrays: 'foobar' }); }, + TypeError + ); + + st['throws']( + function () { qs.stringify({ a: [], b: 'zz' }, { allowEmptyArrays: 0 }); }, + TypeError + ); + + st['throws']( + function () { qs.stringify({ a: [], b: 'zz' }, { allowEmptyArrays: NaN }); }, + TypeError + ); + + st['throws']( + function () { qs.stringify({ a: [], b: 'zz' }, { allowEmptyArrays: null }); }, + TypeError + ); + + st.end(); + }); + + t.test('allowEmptyArrays + strictNullHandling', function (st) { + st.equal( + qs.stringify( + { testEmptyArray: [] }, + { strictNullHandling: true, allowEmptyArrays: true } + ), + 'testEmptyArray[]' + ); + st.end(); }); @@ -155,11 +351,22 @@ test('stringify()', function (t) { s2t.equal(qs.stringify({ a: ['c', 'd'] }, { encodeValuesOnly: true, arrayFormat: 'indices' }), 'a[0]=c&a[1]=d'); s2t.equal(qs.stringify({ a: ['c', 'd'] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a[]=c&a[]=d'); s2t.equal(qs.stringify({ a: ['c', 'd'] }, { encodeValuesOnly: true, arrayFormat: 'comma' }), 'a=c,d'); + s2t.equal(qs.stringify({ a: ['c', 'd'] }, { encodeValuesOnly: true, arrayFormat: 'comma', commaRoundTrip: true }), 'a=c,d'); s2t.equal(qs.stringify({ a: ['c', 'd'] }, { encodeValuesOnly: true }), 'a[0]=c&a[1]=d'); s2t.end(); }); + st.test('array with multiple items with a comma inside', function (s2t) { + s2t.equal(qs.stringify({ a: ['c,d', 'e'] }, { encodeValuesOnly: true, arrayFormat: 'comma' }), 'a=c%2Cd,e'); + s2t.equal(qs.stringify({ a: ['c,d', 'e'] }, { arrayFormat: 'comma' }), 'a=c%2Cd%2Ce'); + + s2t.equal(qs.stringify({ a: ['c,d', 'e'] }, { encodeValuesOnly: true, arrayFormat: 'comma', commaRoundTrip: true }), 'a=c%2Cd,e'); + s2t.equal(qs.stringify({ a: ['c,d', 'e'] }, { arrayFormat: 'comma', commaRoundTrip: true }), 'a=c%2Cd%2Ce'); + + s2t.end(); + }); + st.end(); }); @@ -171,6 +378,44 @@ test('stringify()', function (t) { st.end(); }); + t.test('stringifies comma and empty array values', function (st) { + st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: false, arrayFormat: 'indices' }), 'a[0]=,&a[1]=&a[2]=c,d%'); + st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: false, arrayFormat: 'brackets' }), 'a[]=,&a[]=&a[]=c,d%'); + st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: false, arrayFormat: 'comma' }), 'a=,,,c,d%'); + st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: false, arrayFormat: 'repeat' }), 'a=,&a=&a=c,d%'); + + st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: true, arrayFormat: 'indices' }), 'a[0]=%2C&a[1]=&a[2]=c%2Cd%25'); + st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a[]=%2C&a[]=&a[]=c%2Cd%25'); + st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: true, arrayFormat: 'comma' }), 'a=%2C,,c%2Cd%25'); + st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: true, arrayFormat: 'repeat' }), 'a=%2C&a=&a=c%2Cd%25'); + + st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: false, arrayFormat: 'indices' }), 'a%5B0%5D=%2C&a%5B1%5D=&a%5B2%5D=c%2Cd%25'); + st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: false, arrayFormat: 'brackets' }), 'a%5B%5D=%2C&a%5B%5D=&a%5B%5D=c%2Cd%25'); + st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: false, arrayFormat: 'comma' }), 'a=%2C%2C%2Cc%2Cd%25'); + st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: false, arrayFormat: 'repeat' }), 'a=%2C&a=&a=c%2Cd%25'); + + st.end(); + }); + + t.test('stringifies comma and empty non-array values', function (st) { + st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: false, arrayFormat: 'indices' }), 'a=,&b=&c=c,d%'); + st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: false, arrayFormat: 'brackets' }), 'a=,&b=&c=c,d%'); + st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: false, arrayFormat: 'comma' }), 'a=,&b=&c=c,d%'); + st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: false, arrayFormat: 'repeat' }), 'a=,&b=&c=c,d%'); + + st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: true, encodeValuesOnly: true, arrayFormat: 'indices' }), 'a=%2C&b=&c=c%2Cd%25'); + st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: true, encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a=%2C&b=&c=c%2Cd%25'); + st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: true, encodeValuesOnly: true, arrayFormat: 'comma' }), 'a=%2C&b=&c=c%2Cd%25'); + st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: true, encodeValuesOnly: true, arrayFormat: 'repeat' }), 'a=%2C&b=&c=c%2Cd%25'); + + st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: true, encodeValuesOnly: false, arrayFormat: 'indices' }), 'a=%2C&b=&c=c%2Cd%25'); + st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: true, encodeValuesOnly: false, arrayFormat: 'brackets' }), 'a=%2C&b=&c=c%2Cd%25'); + st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: true, encodeValuesOnly: false, arrayFormat: 'comma' }), 'a=%2C&b=&c=c%2Cd%25'); + st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: true, encodeValuesOnly: false, arrayFormat: 'repeat' }), 'a=%2C&b=&c=c%2Cd%25'); + + st.end(); + }); + t.test('stringifies a nested array value with dots notation', function (st) { st.equal( qs.stringify( @@ -209,36 +454,44 @@ test('stringify()', function (t) { t.test('stringifies an object inside an array', function (st) { st.equal( - qs.stringify({ a: [{ b: 'c' }] }, { arrayFormat: 'indices' }), - 'a%5B0%5D%5Bb%5D=c', // a[0][b]=c - 'indices => brackets' + qs.stringify({ a: [{ b: 'c' }] }, { arrayFormat: 'indices', encodeValuesOnly: true }), + 'a[0][b]=c', + 'indices => indices' + ); + st.equal( + qs.stringify({ a: [{ b: 'c' }] }, { arrayFormat: 'repeat', encodeValuesOnly: true }), + 'a[b]=c', + 'repeat => repeat' ); st.equal( - qs.stringify({ a: [{ b: 'c' }] }, { arrayFormat: 'brackets' }), - 'a%5B%5D%5Bb%5D=c', // a[][b]=c + qs.stringify({ a: [{ b: 'c' }] }, { arrayFormat: 'brackets', encodeValuesOnly: true }), + 'a[][b]=c', 'brackets => brackets' ); st.equal( - qs.stringify({ a: [{ b: 'c' }] }), - 'a%5B0%5D%5Bb%5D=c', + qs.stringify({ a: [{ b: 'c' }] }, { encodeValuesOnly: true }), + 'a[0][b]=c', 'default => indices' ); st.equal( - qs.stringify({ a: [{ b: { c: [1] } }] }, { arrayFormat: 'indices' }), - 'a%5B0%5D%5Bb%5D%5Bc%5D%5B0%5D=1', + qs.stringify({ a: [{ b: { c: [1] } }] }, { arrayFormat: 'indices', encodeValuesOnly: true }), + 'a[0][b][c][0]=1', 'indices => indices' ); - st.equal( - qs.stringify({ a: [{ b: { c: [1] } }] }, { arrayFormat: 'brackets' }), - 'a%5B%5D%5Bb%5D%5Bc%5D%5B%5D=1', + qs.stringify({ a: [{ b: { c: [1] } }] }, { arrayFormat: 'repeat', encodeValuesOnly: true }), + 'a[b][c]=1', + 'repeat => repeat' + ); + st.equal( + qs.stringify({ a: [{ b: { c: [1] } }] }, { arrayFormat: 'brackets', encodeValuesOnly: true }), + 'a[][b][c][]=1', 'brackets => brackets' ); - st.equal( - qs.stringify({ a: [{ b: { c: [1] } }] }), - 'a%5B0%5D%5Bb%5D%5Bc%5D%5B0%5D=1', + qs.stringify({ a: [{ b: { c: [1] } }] }, { encodeValuesOnly: true }), + 'a[0][b][c][0]=1', 'default => indices' ); @@ -340,17 +593,17 @@ test('stringify()', function (t) { st.end(); }); - t.test('uses indices notation for arrays when no arrayFormat=indices', function (st) { + t.test('uses indices notation for arrays when arrayFormat=indices', function (st) { st.equal(qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'indices' }), 'a%5B0%5D=b&a%5B1%5D=c'); st.end(); }); - t.test('uses repeat notation for arrays when no arrayFormat=repeat', function (st) { + t.test('uses repeat notation for arrays when arrayFormat=repeat', function (st) { st.equal(qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'repeat' }), 'a=b&a=c'); st.end(); }); - t.test('uses brackets notation for arrays when no arrayFormat=brackets', function (st) { + t.test('uses brackets notation for arrays when arrayFormat=brackets', function (st) { st.equal(qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'brackets' }), 'a%5B%5D=b&a%5B%5D=c'); st.end(); }); @@ -447,10 +700,11 @@ test('stringify()', function (t) { }); t.test('skips properties that are part of the object prototype', function (st) { - Object.prototype.crash = 'test'; + st.intercept(Object.prototype, 'crash', { value: 'test' }); + st.equal(qs.stringify({ a: 'b' }), 'a=b'); st.equal(qs.stringify({ a: { b: 'c' } }), 'a%5Bb%5D=c'); - delete Object.prototype.crash; + st.end(); }); @@ -474,10 +728,12 @@ test('stringify()', function (t) { }); t.test('does not blow up when Buffer global is missing', function (st) { - var tempBuffer = global.Buffer; - delete global.Buffer; + var restore = mockProperty(global, 'Buffer', { 'delete': true }); + var result = qs.stringify({ a: 'b', c: 'd' }); - global.Buffer = tempBuffer; + + restore(); + st.equal(result, 'a=b&c=d'); st.end(); }); @@ -526,9 +782,17 @@ test('stringify()', function (t) { }; st.equal( - qs.stringify({ filters: { $and: [p1, p2] } }, { encodeValuesOnly: true }), + qs.stringify({ filters: { $and: [p1, p2] } }, { encodeValuesOnly: true, arrayFormat: 'indices' }), 'filters[$and][0][function]=gte&filters[$and][0][arguments][0][function]=hour_of_day&filters[$and][0][arguments][1]=0&filters[$and][1][function]=lte&filters[$and][1][arguments][0][function]=hour_of_day&filters[$and][1][arguments][1]=23' ); + st.equal( + qs.stringify({ filters: { $and: [p1, p2] } }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), + 'filters[$and][][function]=gte&filters[$and][][arguments][][function]=hour_of_day&filters[$and][][arguments][]=0&filters[$and][][function]=lte&filters[$and][][arguments][][function]=hour_of_day&filters[$and][][arguments][]=23' + ); + st.equal( + qs.stringify({ filters: { $and: [p1, p2] } }, { encodeValuesOnly: true, arrayFormat: 'repeat' }), + 'filters[$and][function]=gte&filters[$and][arguments][function]=hour_of_day&filters[$and][arguments]=0&filters[$and][function]=lte&filters[$and][arguments][function]=hour_of_day&filters[$and][arguments]=23' + ); st.end(); }); @@ -641,13 +905,28 @@ test('stringify()', function (t) { st.end(); }); + t.test('receives the default encoder as a second argument', function (st) { + st.plan(8); + + qs.stringify({ a: 1, b: new Date(), c: true, d: [1] }, { + encoder: function (str) { + st.match(typeof str, /^(?:string|number|boolean)$/); + return ''; + } + }); + + st.end(); + }); + t.test('receives the default encoder as a second argument', function (st) { st.plan(2); + qs.stringify({ a: 1 }, { encoder: function (str, defaultEncoder) { st.equal(defaultEncoder, utils.encode); } }); + st.end(); }); @@ -775,16 +1054,53 @@ test('stringify()', function (t) { st.equal( qs.stringify( { a: 'b', c: ['d', 'e=f'], f: [['g'], ['h']] }, - { encodeValuesOnly: true } + { encodeValuesOnly: true, arrayFormat: 'indices' } + ), + 'a=b&c[0]=d&c[1]=e%3Df&f[0][0]=g&f[1][0]=h', + 'encodeValuesOnly + indices' + ); + st.equal( + qs.stringify( + { a: 'b', c: ['d', 'e=f'], f: [['g'], ['h']] }, + { encodeValuesOnly: true, arrayFormat: 'brackets' } + ), + 'a=b&c[]=d&c[]=e%3Df&f[][]=g&f[][]=h', + 'encodeValuesOnly + brackets' + ); + st.equal( + qs.stringify( + { a: 'b', c: ['d', 'e=f'], f: [['g'], ['h']] }, + { encodeValuesOnly: true, arrayFormat: 'repeat' } ), - 'a=b&c[0]=d&c[1]=e%3Df&f[0][0]=g&f[1][0]=h' + 'a=b&c=d&c=e%3Df&f=g&f=h', + 'encodeValuesOnly + repeat' ); + st.equal( qs.stringify( - { a: 'b', c: ['d', 'e'], f: [['g'], ['h']] } + { a: 'b', c: ['d', 'e'], f: [['g'], ['h']] }, + { arrayFormat: 'indices' } ), - 'a=b&c%5B0%5D=d&c%5B1%5D=e&f%5B0%5D%5B0%5D=g&f%5B1%5D%5B0%5D=h' + 'a=b&c%5B0%5D=d&c%5B1%5D=e&f%5B0%5D%5B0%5D=g&f%5B1%5D%5B0%5D=h', + 'no encodeValuesOnly + indices' ); + st.equal( + qs.stringify( + { a: 'b', c: ['d', 'e'], f: [['g'], ['h']] }, + { arrayFormat: 'brackets' } + ), + 'a=b&c%5B%5D=d&c%5B%5D=e&f%5B%5D%5B%5D=g&f%5B%5D%5B%5D=h', + 'no encodeValuesOnly + brackets' + ); + st.equal( + qs.stringify( + { a: 'b', c: ['d', 'e'], f: [['g'], ['h']] }, + { arrayFormat: 'repeat' } + ), + 'a=b&c=d&c=e&f=g&f=h', + 'no encodeValuesOnly + repeat' + ); + st.end(); }); @@ -821,13 +1137,19 @@ test('stringify()', function (t) { st.end(); }); - t.test('adds the right sentinel when instructed to and the charset is utf-8', function (st) { - st.equal(qs.stringify({ a: 'æ' }, { charsetSentinel: true, charset: 'utf-8' }), 'utf8=%E2%9C%93&a=%C3%A6'); - st.end(); - }); + t.test('`charsetSentinel` option', function (st) { + st.equal( + qs.stringify({ a: 'æ' }, { charsetSentinel: true, charset: 'utf-8' }), + 'utf8=%E2%9C%93&a=%C3%A6', + 'adds the right sentinel when instructed to and the charset is utf-8' + ); + + st.equal( + qs.stringify({ a: 'æ' }, { charsetSentinel: true, charset: 'iso-8859-1' }), + 'utf8=%26%2310003%3B&a=%E6', + 'adds the right sentinel when instructed to and the charset is iso-8859-1' + ); - t.test('adds the right sentinel when instructed to and the charset is iso-8859-1', function (st) { - st.equal(qs.stringify({ a: 'æ' }, { charsetSentinel: true, charset: 'iso-8859-1' }), 'utf8=%26%2310003%3B&a=%E6'); st.end(); }); @@ -878,13 +1200,15 @@ test('stringify()', function (t) { var withArray = { a: { b: [{ c: 'd', e: 'f' }] } }; st.equal(qs.stringify(obj, { encode: false }), 'a[b][c]=d&a[b][e]=f', 'no array, no arrayFormat'); - st.equal(qs.stringify(obj, { encode: false, arrayFormat: 'bracket' }), 'a[b][c]=d&a[b][e]=f', 'no array, bracket'); + st.equal(qs.stringify(obj, { encode: false, arrayFormat: 'brackets' }), 'a[b][c]=d&a[b][e]=f', 'no array, bracket'); st.equal(qs.stringify(obj, { encode: false, arrayFormat: 'indices' }), 'a[b][c]=d&a[b][e]=f', 'no array, indices'); + st.equal(qs.stringify(obj, { encode: false, arrayFormat: 'repeat' }), 'a[b][c]=d&a[b][e]=f', 'no array, repeat'); st.equal(qs.stringify(obj, { encode: false, arrayFormat: 'comma' }), 'a[b][c]=d&a[b][e]=f', 'no array, comma'); st.equal(qs.stringify(withArray, { encode: false }), 'a[b][0][c]=d&a[b][0][e]=f', 'array, no arrayFormat'); - st.equal(qs.stringify(withArray, { encode: false, arrayFormat: 'bracket' }), 'a[b][0][c]=d&a[b][0][e]=f', 'array, bracket'); + st.equal(qs.stringify(withArray, { encode: false, arrayFormat: 'brackets' }), 'a[b][][c]=d&a[b][][e]=f', 'array, bracket'); st.equal(qs.stringify(withArray, { encode: false, arrayFormat: 'indices' }), 'a[b][0][c]=d&a[b][0][e]=f', 'array, indices'); + st.equal(qs.stringify(withArray, { encode: false, arrayFormat: 'repeat' }), 'a[b][c]=d&a[b][e]=f', 'array, repeat'); st.equal( qs.stringify(withArray, { encode: false, arrayFormat: 'comma' }), '???', @@ -897,13 +1221,78 @@ test('stringify()', function (t) { t.test('stringifies sparse arrays', function (st) { /* eslint no-sparse-arrays: 0 */ - st.equal(qs.stringify({ a: [, '2', , , '1'] }, { encodeValuesOnly: true }), 'a[1]=2&a[4]=1'); - st.equal(qs.stringify({ a: [, { b: [, , { c: '1' }] }] }, { encodeValuesOnly: true }), 'a[1][b][2][c]=1'); - st.equal(qs.stringify({ a: [, [, , [, , , { c: '1' }]]] }, { encodeValuesOnly: true }), 'a[1][2][3][c]=1'); - st.equal(qs.stringify({ a: [, [, , [, , , { c: [, '1'] }]]] }, { encodeValuesOnly: true }), 'a[1][2][3][c][1]=1'); + st.equal(qs.stringify({ a: [, '2', , , '1'] }, { encodeValuesOnly: true, arrayFormat: 'indices' }), 'a[1]=2&a[4]=1'); + st.equal(qs.stringify({ a: [, '2', , , '1'] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a[]=2&a[]=1'); + st.equal(qs.stringify({ a: [, '2', , , '1'] }, { encodeValuesOnly: true, arrayFormat: 'repeat' }), 'a=2&a=1'); + + st.equal(qs.stringify({ a: [, { b: [, , { c: '1' }] }] }, { encodeValuesOnly: true, arrayFormat: 'indices' }), 'a[1][b][2][c]=1'); + st.equal(qs.stringify({ a: [, { b: [, , { c: '1' }] }] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a[][b][][c]=1'); + st.equal(qs.stringify({ a: [, { b: [, , { c: '1' }] }] }, { encodeValuesOnly: true, arrayFormat: 'repeat' }), 'a[b][c]=1'); + + st.equal(qs.stringify({ a: [, [, , [, , , { c: '1' }]]] }, { encodeValuesOnly: true, arrayFormat: 'indices' }), 'a[1][2][3][c]=1'); + st.equal(qs.stringify({ a: [, [, , [, , , { c: '1' }]]] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a[][][][c]=1'); + st.equal(qs.stringify({ a: [, [, , [, , , { c: '1' }]]] }, { encodeValuesOnly: true, arrayFormat: 'repeat' }), 'a[c]=1'); + + st.equal(qs.stringify({ a: [, [, , [, , , { c: [, '1'] }]]] }, { encodeValuesOnly: true, arrayFormat: 'indices' }), 'a[1][2][3][c][1]=1'); + st.equal(qs.stringify({ a: [, [, , [, , , { c: [, '1'] }]]] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a[][][][c][]=1'); + st.equal(qs.stringify({ a: [, [, , [, , , { c: [, '1'] }]]] }, { encodeValuesOnly: true, arrayFormat: 'repeat' }), 'a[c]=1'); + + st.end(); + }); + + t.test('encodes a very long string', function (st) { + var chars = []; + var expected = []; + for (var i = 0; i < 5e3; i++) { + chars.push(' ' + i); + + expected.push('%20' + i); + } + + var obj = { + foo: chars.join('') + }; + + st.equal( + qs.stringify(obj, { arrayFormat: 'bracket', charset: 'utf-8' }), + 'foo=' + expected.join('') + ); st.end(); }); t.end(); }); + +test('stringifies empty keys', function (t) { + emptyTestCases.forEach(function (testCase) { + t.test('stringifies an object with empty string key with ' + testCase.input, function (st) { + st.deepEqual( + qs.stringify(testCase.withEmptyKeys, { encode: false, arrayFormat: 'indices' }), + testCase.stringifyOutput.indices, + 'test case: ' + testCase.input + ', indices' + ); + st.deepEqual( + qs.stringify(testCase.withEmptyKeys, { encode: false, arrayFormat: 'brackets' }), + testCase.stringifyOutput.brackets, + 'test case: ' + testCase.input + ', brackets' + ); + st.deepEqual( + qs.stringify(testCase.withEmptyKeys, { encode: false, arrayFormat: 'repeat' }), + testCase.stringifyOutput.repeat, + 'test case: ' + testCase.input + ', repeat' + ); + + st.end(); + }); + }); + + t.test('edge case with object/arrays', function (st) { + st.deepEqual(qs.stringify({ '': { '': [2, 3] } }, { encode: false }), '[][0]=2&[][1]=3'); + st.deepEqual(qs.stringify({ '': { '': [2, 3], a: 2 } }, { encode: false }), '[][0]=2&[][1]=3&[a]=2'); + st.deepEqual(qs.stringify({ '': { '': [2, 3] } }, { encode: false, arrayFormat: 'indices' }), '[][0]=2&[][1]=3'); + st.deepEqual(qs.stringify({ '': { '': [2, 3], a: 2 } }, { encode: false, arrayFormat: 'indices' }), '[][0]=2&[][1]=3&[a]=2'); + + st.end(); + }); +}); diff --git a/Modules/Chatroom/chat/node_modules/serve-static/HISTORY.md b/Modules/Chatroom/chat/node_modules/serve-static/HISTORY.md index fde1d72da068..dccf667866f2 100644 --- a/Modules/Chatroom/chat/node_modules/serve-static/HISTORY.md +++ b/Modules/Chatroom/chat/node_modules/serve-static/HISTORY.md @@ -1,3 +1,13 @@ +1.16.2 / 2024-09-11 +=================== + +* deps: encodeurl@~2.0.0 + +1.16.1 / 2024-09-11 +=================== + +* deps: send@0.19.0 + 1.16.0 / 2024-09-10 =================== diff --git a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/.coveralls.yml b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/.coveralls.yml deleted file mode 100644 index 20a706858179..000000000000 --- a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/.coveralls.yml +++ /dev/null @@ -1 +0,0 @@ -repo_token: SIAeZjKYlHK74rbcFvNHMUzjRiMpflxve diff --git a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/.eslintrc b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/.eslintrc deleted file mode 100644 index 8a37ae2c2e5a..000000000000 --- a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/.eslintrc +++ /dev/null @@ -1,11 +0,0 @@ -{ - "env": { - "browser": true, - "node": true - }, - "rules": { - "no-console": 0, - "no-empty": [1, { "allowEmptyCatch": true }] - }, - "extends": "eslint:recommended" -} diff --git a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/.npmignore b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/.npmignore deleted file mode 100644 index 5f60eecc84e2..000000000000 --- a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/.npmignore +++ /dev/null @@ -1,9 +0,0 @@ -support -test -examples -example -*.sock -dist -yarn.lock -coverage -bower.json diff --git a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/.travis.yml b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/.travis.yml deleted file mode 100644 index 6c6090c3b09f..000000000000 --- a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/.travis.yml +++ /dev/null @@ -1,14 +0,0 @@ - -language: node_js -node_js: - - "6" - - "5" - - "4" - -install: - - make node_modules - -script: - - make lint - - make test - - make coveralls diff --git a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/CHANGELOG.md b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/CHANGELOG.md deleted file mode 100644 index eadaa189517b..000000000000 --- a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/CHANGELOG.md +++ /dev/null @@ -1,362 +0,0 @@ - -2.6.9 / 2017-09-22 -================== - - * remove ReDoS regexp in %o formatter (#504) - -2.6.8 / 2017-05-18 -================== - - * Fix: Check for undefined on browser globals (#462, @marbemac) - -2.6.7 / 2017-05-16 -================== - - * Fix: Update ms to 2.0.0 to fix regular expression denial of service vulnerability (#458, @hubdotcom) - * Fix: Inline extend function in node implementation (#452, @dougwilson) - * Docs: Fix typo (#455, @msasad) - -2.6.5 / 2017-04-27 -================== - - * Fix: null reference check on window.documentElement.style.WebkitAppearance (#447, @thebigredgeek) - * Misc: clean up browser reference checks (#447, @thebigredgeek) - * Misc: add npm-debug.log to .gitignore (@thebigredgeek) - - -2.6.4 / 2017-04-20 -================== - - * Fix: bug that would occure if process.env.DEBUG is a non-string value. (#444, @LucianBuzzo) - * Chore: ignore bower.json in npm installations. (#437, @joaovieira) - * Misc: update "ms" to v0.7.3 (@tootallnate) - -2.6.3 / 2017-03-13 -================== - - * Fix: Electron reference to `process.env.DEBUG` (#431, @paulcbetts) - * Docs: Changelog fix (@thebigredgeek) - -2.6.2 / 2017-03-10 -================== - - * Fix: DEBUG_MAX_ARRAY_LENGTH (#420, @slavaGanzin) - * Docs: Add backers and sponsors from Open Collective (#422, @piamancini) - * Docs: Add Slackin invite badge (@tootallnate) - -2.6.1 / 2017-02-10 -================== - - * Fix: Module's `export default` syntax fix for IE8 `Expected identifier` error - * Fix: Whitelist DEBUG_FD for values 1 and 2 only (#415, @pi0) - * Fix: IE8 "Expected identifier" error (#414, @vgoma) - * Fix: Namespaces would not disable once enabled (#409, @musikov) - -2.6.0 / 2016-12-28 -================== - - * Fix: added better null pointer checks for browser useColors (@thebigredgeek) - * Improvement: removed explicit `window.debug` export (#404, @tootallnate) - * Improvement: deprecated `DEBUG_FD` environment variable (#405, @tootallnate) - -2.5.2 / 2016-12-25 -================== - - * Fix: reference error on window within webworkers (#393, @KlausTrainer) - * Docs: fixed README typo (#391, @lurch) - * Docs: added notice about v3 api discussion (@thebigredgeek) - -2.5.1 / 2016-12-20 -================== - - * Fix: babel-core compatibility - -2.5.0 / 2016-12-20 -================== - - * Fix: wrong reference in bower file (@thebigredgeek) - * Fix: webworker compatibility (@thebigredgeek) - * Fix: output formatting issue (#388, @kribblo) - * Fix: babel-loader compatibility (#383, @escwald) - * Misc: removed built asset from repo and publications (@thebigredgeek) - * Misc: moved source files to /src (#378, @yamikuronue) - * Test: added karma integration and replaced babel with browserify for browser tests (#378, @yamikuronue) - * Test: coveralls integration (#378, @yamikuronue) - * Docs: simplified language in the opening paragraph (#373, @yamikuronue) - -2.4.5 / 2016-12-17 -================== - - * Fix: `navigator` undefined in Rhino (#376, @jochenberger) - * Fix: custom log function (#379, @hsiliev) - * Improvement: bit of cleanup + linting fixes (@thebigredgeek) - * Improvement: rm non-maintainted `dist/` dir (#375, @freewil) - * Docs: simplified language in the opening paragraph. (#373, @yamikuronue) - -2.4.4 / 2016-12-14 -================== - - * Fix: work around debug being loaded in preload scripts for electron (#368, @paulcbetts) - -2.4.3 / 2016-12-14 -================== - - * Fix: navigation.userAgent error for react native (#364, @escwald) - -2.4.2 / 2016-12-14 -================== - - * Fix: browser colors (#367, @tootallnate) - * Misc: travis ci integration (@thebigredgeek) - * Misc: added linting and testing boilerplate with sanity check (@thebigredgeek) - -2.4.1 / 2016-12-13 -================== - - * Fix: typo that broke the package (#356) - -2.4.0 / 2016-12-13 -================== - - * Fix: bower.json references unbuilt src entry point (#342, @justmatt) - * Fix: revert "handle regex special characters" (@tootallnate) - * Feature: configurable util.inspect()`options for NodeJS (#327, @tootallnate) - * Feature: %O`(big O) pretty-prints objects (#322, @tootallnate) - * Improvement: allow colors in workers (#335, @botverse) - * Improvement: use same color for same namespace. (#338, @lchenay) - -2.3.3 / 2016-11-09 -================== - - * Fix: Catch `JSON.stringify()` errors (#195, Jovan Alleyne) - * Fix: Returning `localStorage` saved values (#331, Levi Thomason) - * Improvement: Don't create an empty object when no `process` (Nathan Rajlich) - -2.3.2 / 2016-11-09 -================== - - * Fix: be super-safe in index.js as well (@TooTallNate) - * Fix: should check whether process exists (Tom Newby) - -2.3.1 / 2016-11-09 -================== - - * Fix: Added electron compatibility (#324, @paulcbetts) - * Improvement: Added performance optimizations (@tootallnate) - * Readme: Corrected PowerShell environment variable example (#252, @gimre) - * Misc: Removed yarn lock file from source control (#321, @fengmk2) - -2.3.0 / 2016-11-07 -================== - - * Fix: Consistent placement of ms diff at end of output (#215, @gorangajic) - * Fix: Escaping of regex special characters in namespace strings (#250, @zacronos) - * Fix: Fixed bug causing crash on react-native (#282, @vkarpov15) - * Feature: Enabled ES6+ compatible import via default export (#212 @bucaran) - * Feature: Added %O formatter to reflect Chrome's console.log capability (#279, @oncletom) - * Package: Update "ms" to 0.7.2 (#315, @DevSide) - * Package: removed superfluous version property from bower.json (#207 @kkirsche) - * Readme: fix USE_COLORS to DEBUG_COLORS - * Readme: Doc fixes for format string sugar (#269, @mlucool) - * Readme: Updated docs for DEBUG_FD and DEBUG_COLORS environment variables (#232, @mattlyons0) - * Readme: doc fixes for PowerShell (#271 #243, @exoticknight @unreadable) - * Readme: better docs for browser support (#224, @matthewmueller) - * Tooling: Added yarn integration for development (#317, @thebigredgeek) - * Misc: Renamed History.md to CHANGELOG.md (@thebigredgeek) - * Misc: Added license file (#226 #274, @CantemoInternal @sdaitzman) - * Misc: Updated contributors (@thebigredgeek) - -2.2.0 / 2015-05-09 -================== - - * package: update "ms" to v0.7.1 (#202, @dougwilson) - * README: add logging to file example (#193, @DanielOchoa) - * README: fixed a typo (#191, @amir-s) - * browser: expose `storage` (#190, @stephenmathieson) - * Makefile: add a `distclean` target (#189, @stephenmathieson) - -2.1.3 / 2015-03-13 -================== - - * Updated stdout/stderr example (#186) - * Updated example/stdout.js to match debug current behaviour - * Renamed example/stderr.js to stdout.js - * Update Readme.md (#184) - * replace high intensity foreground color for bold (#182, #183) - -2.1.2 / 2015-03-01 -================== - - * dist: recompile - * update "ms" to v0.7.0 - * package: update "browserify" to v9.0.3 - * component: fix "ms.js" repo location - * changed bower package name - * updated documentation about using debug in a browser - * fix: security error on safari (#167, #168, @yields) - -2.1.1 / 2014-12-29 -================== - - * browser: use `typeof` to check for `console` existence - * browser: check for `console.log` truthiness (fix IE 8/9) - * browser: add support for Chrome apps - * Readme: added Windows usage remarks - * Add `bower.json` to properly support bower install - -2.1.0 / 2014-10-15 -================== - - * node: implement `DEBUG_FD` env variable support - * package: update "browserify" to v6.1.0 - * package: add "license" field to package.json (#135, @panuhorsmalahti) - -2.0.0 / 2014-09-01 -================== - - * package: update "browserify" to v5.11.0 - * node: use stderr rather than stdout for logging (#29, @stephenmathieson) - -1.0.4 / 2014-07-15 -================== - - * dist: recompile - * example: remove `console.info()` log usage - * example: add "Content-Type" UTF-8 header to browser example - * browser: place %c marker after the space character - * browser: reset the "content" color via `color: inherit` - * browser: add colors support for Firefox >= v31 - * debug: prefer an instance `log()` function over the global one (#119) - * Readme: update documentation about styled console logs for FF v31 (#116, @wryk) - -1.0.3 / 2014-07-09 -================== - - * Add support for multiple wildcards in namespaces (#122, @seegno) - * browser: fix lint - -1.0.2 / 2014-06-10 -================== - - * browser: update color palette (#113, @gscottolson) - * common: make console logging function configurable (#108, @timoxley) - * node: fix %o colors on old node <= 0.8.x - * Makefile: find node path using shell/which (#109, @timoxley) - -1.0.1 / 2014-06-06 -================== - - * browser: use `removeItem()` to clear localStorage - * browser, node: don't set DEBUG if namespaces is undefined (#107, @leedm777) - * package: add "contributors" section - * node: fix comment typo - * README: list authors - -1.0.0 / 2014-06-04 -================== - - * make ms diff be global, not be scope - * debug: ignore empty strings in enable() - * node: make DEBUG_COLORS able to disable coloring - * *: export the `colors` array - * npmignore: don't publish the `dist` dir - * Makefile: refactor to use browserify - * package: add "browserify" as a dev dependency - * Readme: add Web Inspector Colors section - * node: reset terminal color for the debug content - * node: map "%o" to `util.inspect()` - * browser: map "%j" to `JSON.stringify()` - * debug: add custom "formatters" - * debug: use "ms" module for humanizing the diff - * Readme: add "bash" syntax highlighting - * browser: add Firebug color support - * browser: add colors for WebKit browsers - * node: apply log to `console` - * rewrite: abstract common logic for Node & browsers - * add .jshintrc file - -0.8.1 / 2014-04-14 -================== - - * package: re-add the "component" section - -0.8.0 / 2014-03-30 -================== - - * add `enable()` method for nodejs. Closes #27 - * change from stderr to stdout - * remove unnecessary index.js file - -0.7.4 / 2013-11-13 -================== - - * remove "browserify" key from package.json (fixes something in browserify) - -0.7.3 / 2013-10-30 -================== - - * fix: catch localStorage security error when cookies are blocked (Chrome) - * add debug(err) support. Closes #46 - * add .browser prop to package.json. Closes #42 - -0.7.2 / 2013-02-06 -================== - - * fix package.json - * fix: Mobile Safari (private mode) is broken with debug - * fix: Use unicode to send escape character to shell instead of octal to work with strict mode javascript - -0.7.1 / 2013-02-05 -================== - - * add repository URL to package.json - * add DEBUG_COLORED to force colored output - * add browserify support - * fix component. Closes #24 - -0.7.0 / 2012-05-04 -================== - - * Added .component to package.json - * Added debug.component.js build - -0.6.0 / 2012-03-16 -================== - - * Added support for "-" prefix in DEBUG [Vinay Pulim] - * Added `.enabled` flag to the node version [TooTallNate] - -0.5.0 / 2012-02-02 -================== - - * Added: humanize diffs. Closes #8 - * Added `debug.disable()` to the CS variant - * Removed padding. Closes #10 - * Fixed: persist client-side variant again. Closes #9 - -0.4.0 / 2012-02-01 -================== - - * Added browser variant support for older browsers [TooTallNate] - * Added `debug.enable('project:*')` to browser variant [TooTallNate] - * Added padding to diff (moved it to the right) - -0.3.0 / 2012-01-26 -================== - - * Added millisecond diff when isatty, otherwise UTC string - -0.2.0 / 2012-01-22 -================== - - * Added wildcard support - -0.1.0 / 2011-12-02 -================== - - * Added: remove colors unless stderr isatty [TooTallNate] - -0.0.1 / 2010-01-03 -================== - - * Initial release diff --git a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/LICENSE b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/LICENSE deleted file mode 100644 index 658c933d2825..000000000000 --- a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -(The MIT License) - -Copyright (c) 2014 TJ Holowaychuk - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software -and associated documentation files (the 'Software'), to deal in the Software without restriction, -including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, -and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial -portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT -LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - diff --git a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/Makefile b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/Makefile deleted file mode 100644 index 584da8bf938e..000000000000 --- a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/Makefile +++ /dev/null @@ -1,50 +0,0 @@ -# get Makefile directory name: http://stackoverflow.com/a/5982798/376773 -THIS_MAKEFILE_PATH:=$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)) -THIS_DIR:=$(shell cd $(dir $(THIS_MAKEFILE_PATH));pwd) - -# BIN directory -BIN := $(THIS_DIR)/node_modules/.bin - -# Path -PATH := node_modules/.bin:$(PATH) -SHELL := /bin/bash - -# applications -NODE ?= $(shell which node) -YARN ?= $(shell which yarn) -PKG ?= $(if $(YARN),$(YARN),$(NODE) $(shell which npm)) -BROWSERIFY ?= $(NODE) $(BIN)/browserify - -.FORCE: - -install: node_modules - -node_modules: package.json - @NODE_ENV= $(PKG) install - @touch node_modules - -lint: .FORCE - eslint browser.js debug.js index.js node.js - -test-node: .FORCE - istanbul cover node_modules/mocha/bin/_mocha -- test/**.js - -test-browser: .FORCE - mkdir -p dist - - @$(BROWSERIFY) \ - --standalone debug \ - . > dist/debug.js - - karma start --single-run - rimraf dist - -test: .FORCE - concurrently \ - "make test-node" \ - "make test-browser" - -coveralls: - cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js - -.PHONY: all install clean distclean diff --git a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/README.md b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/README.md deleted file mode 100644 index f67be6b317c1..000000000000 --- a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/README.md +++ /dev/null @@ -1,312 +0,0 @@ -# debug -[![Build Status](https://travis-ci.org/visionmedia/debug.svg?branch=master)](https://travis-ci.org/visionmedia/debug) [![Coverage Status](https://coveralls.io/repos/github/visionmedia/debug/badge.svg?branch=master)](https://coveralls.io/github/visionmedia/debug?branch=master) [![Slack](https://visionmedia-community-slackin.now.sh/badge.svg)](https://visionmedia-community-slackin.now.sh/) [![OpenCollective](https://opencollective.com/debug/backers/badge.svg)](#backers) -[![OpenCollective](https://opencollective.com/debug/sponsors/badge.svg)](#sponsors) - - - -A tiny node.js debugging utility modelled after node core's debugging technique. - -**Discussion around the V3 API is under way [here](https://github.com/visionmedia/debug/issues/370)** - -## Installation - -```bash -$ npm install debug -``` - -## Usage - -`debug` exposes a function; simply pass this function the name of your module, and it will return a decorated version of `console.error` for you to pass debug statements to. This will allow you to toggle the debug output for different parts of your module as well as the module as a whole. - -Example _app.js_: - -```js -var debug = require('debug')('http') - , http = require('http') - , name = 'My App'; - -// fake app - -debug('booting %s', name); - -http.createServer(function(req, res){ - debug(req.method + ' ' + req.url); - res.end('hello\n'); -}).listen(3000, function(){ - debug('listening'); -}); - -// fake worker of some kind - -require('./worker'); -``` - -Example _worker.js_: - -```js -var debug = require('debug')('worker'); - -setInterval(function(){ - debug('doing some work'); -}, 1000); -``` - - The __DEBUG__ environment variable is then used to enable these based on space or comma-delimited names. Here are some examples: - - ![debug http and worker](http://f.cl.ly/items/18471z1H402O24072r1J/Screenshot.png) - - ![debug worker](http://f.cl.ly/items/1X413v1a3M0d3C2c1E0i/Screenshot.png) - -#### Windows note - - On Windows the environment variable is set using the `set` command. - - ```cmd - set DEBUG=*,-not_this - ``` - - Note that PowerShell uses different syntax to set environment variables. - - ```cmd - $env:DEBUG = "*,-not_this" - ``` - -Then, run the program to be debugged as usual. - -## Millisecond diff - - When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls. - - ![](http://f.cl.ly/items/2i3h1d3t121M2Z1A3Q0N/Screenshot.png) - - When stdout is not a TTY, `Date#toUTCString()` is used, making it more useful for logging the debug information as shown below: - - ![](http://f.cl.ly/items/112H3i0e0o0P0a2Q2r11/Screenshot.png) - -## Conventions - - If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser". - -## Wildcards - - The `*` character may be used as a wildcard. Suppose for example your library has debuggers named "connect:bodyParser", "connect:compress", "connect:session", instead of listing all three with `DEBUG=connect:bodyParser,connect:compress,connect:session`, you may simply do `DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`. - - You can also exclude specific debuggers by prefixing them with a "-" character. For example, `DEBUG=*,-connect:*` would include all debuggers except those starting with "connect:". - -## Environment Variables - - When running through Node.js, you can set a few environment variables that will - change the behavior of the debug logging: - -| Name | Purpose | -|-----------|-------------------------------------------------| -| `DEBUG` | Enables/disables specific debugging namespaces. | -| `DEBUG_COLORS`| Whether or not to use colors in the debug output. | -| `DEBUG_DEPTH` | Object inspection depth. | -| `DEBUG_SHOW_HIDDEN` | Shows hidden properties on inspected objects. | - - - __Note:__ The environment variables beginning with `DEBUG_` end up being - converted into an Options object that gets used with `%o`/`%O` formatters. - See the Node.js documentation for - [`util.inspect()`](https://nodejs.org/api/util.html#util_util_inspect_object_options) - for the complete list. - -## Formatters - - - Debug uses [printf-style](https://wikipedia.org/wiki/Printf_format_string) formatting. Below are the officially supported formatters: - -| Formatter | Representation | -|-----------|----------------| -| `%O` | Pretty-print an Object on multiple lines. | -| `%o` | Pretty-print an Object all on a single line. | -| `%s` | String. | -| `%d` | Number (both integer and float). | -| `%j` | JSON. Replaced with the string '[Circular]' if the argument contains circular references. | -| `%%` | Single percent sign ('%'). This does not consume an argument. | - -### Custom formatters - - You can add custom formatters by extending the `debug.formatters` object. For example, if you wanted to add support for rendering a Buffer as hex with `%h`, you could do something like: - -```js -const createDebug = require('debug') -createDebug.formatters.h = (v) => { - return v.toString('hex') -} - -// …elsewhere -const debug = createDebug('foo') -debug('this is hex: %h', new Buffer('hello world')) -// foo this is hex: 68656c6c6f20776f726c6421 +0ms -``` - -## Browser support - You can build a browser-ready script using [browserify](https://github.com/substack/node-browserify), - or just use the [browserify-as-a-service](https://wzrd.in/) [build](https://wzrd.in/standalone/debug@latest), - if you don't want to build it yourself. - - Debug's enable state is currently persisted by `localStorage`. - Consider the situation shown below where you have `worker:a` and `worker:b`, - and wish to debug both. You can enable this using `localStorage.debug`: - -```js -localStorage.debug = 'worker:*' -``` - -And then refresh the page. - -```js -a = debug('worker:a'); -b = debug('worker:b'); - -setInterval(function(){ - a('doing some work'); -}, 1000); - -setInterval(function(){ - b('doing some work'); -}, 1200); -``` - -#### Web Inspector Colors - - Colors are also enabled on "Web Inspectors" that understand the `%c` formatting - option. These are WebKit web inspectors, Firefox ([since version - 31](https://hacks.mozilla.org/2014/05/editable-box-model-multiple-selection-sublime-text-keys-much-more-firefox-developer-tools-episode-31/)) - and the Firebug plugin for Firefox (any version). - - Colored output looks something like: - - ![](https://cloud.githubusercontent.com/assets/71256/3139768/b98c5fd8-e8ef-11e3-862a-f7253b6f47c6.png) - - -## Output streams - - By default `debug` will log to stderr, however this can be configured per-namespace by overriding the `log` method: - -Example _stdout.js_: - -```js -var debug = require('debug'); -var error = debug('app:error'); - -// by default stderr is used -error('goes to stderr!'); - -var log = debug('app:log'); -// set this namespace to log via console.log -log.log = console.log.bind(console); // don't forget to bind to console! -log('goes to stdout'); -error('still goes to stderr!'); - -// set all output to go via console.info -// overrides all per-namespace log settings -debug.log = console.info.bind(console); -error('now goes to stdout via console.info'); -log('still goes to stdout, but via console.info now'); -``` - - -## Authors - - - TJ Holowaychuk - - Nathan Rajlich - - Andrew Rhyne - -## Backers - -Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/debug#backer)] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -## Sponsors - -Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://opencollective.com/debug#sponsor)] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -## License - -(The MIT License) - -Copyright (c) 2014-2016 TJ Holowaychuk <tj@vision-media.ca> - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/component.json b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/component.json deleted file mode 100644 index 9de26410f0d0..000000000000 --- a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/component.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "debug", - "repo": "visionmedia/debug", - "description": "small debugging utility", - "version": "2.6.9", - "keywords": [ - "debug", - "log", - "debugger" - ], - "main": "src/browser.js", - "scripts": [ - "src/browser.js", - "src/debug.js" - ], - "dependencies": { - "rauchg/ms.js": "0.7.1" - } -} diff --git a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/karma.conf.js b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/karma.conf.js deleted file mode 100644 index 103a82d15bd7..000000000000 --- a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/karma.conf.js +++ /dev/null @@ -1,70 +0,0 @@ -// Karma configuration -// Generated on Fri Dec 16 2016 13:09:51 GMT+0000 (UTC) - -module.exports = function(config) { - config.set({ - - // base path that will be used to resolve all patterns (eg. files, exclude) - basePath: '', - - - // frameworks to use - // available frameworks: https://npmjs.org/browse/keyword/karma-adapter - frameworks: ['mocha', 'chai', 'sinon'], - - - // list of files / patterns to load in the browser - files: [ - 'dist/debug.js', - 'test/*spec.js' - ], - - - // list of files to exclude - exclude: [ - 'src/node.js' - ], - - - // preprocess matching files before serving them to the browser - // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor - preprocessors: { - }, - - // test results reporter to use - // possible values: 'dots', 'progress' - // available reporters: https://npmjs.org/browse/keyword/karma-reporter - reporters: ['progress'], - - - // web server port - port: 9876, - - - // enable / disable colors in the output (reporters and logs) - colors: true, - - - // level of logging - // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG - logLevel: config.LOG_INFO, - - - // enable / disable watching file and executing tests whenever any file changes - autoWatch: true, - - - // start these browsers - // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher - browsers: ['PhantomJS'], - - - // Continuous Integration mode - // if true, Karma captures browsers, runs the tests and exits - singleRun: false, - - // Concurrency level - // how many browser should be started simultaneous - concurrency: Infinity - }) -} diff --git a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/node.js b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/node.js deleted file mode 100644 index 7fc36fe6dbec..000000000000 --- a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/node.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./src/node'); diff --git a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/node_modules/ms/index.js b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/node_modules/ms/index.js deleted file mode 100644 index 6a522b16b3a3..000000000000 --- a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/node_modules/ms/index.js +++ /dev/null @@ -1,152 +0,0 @@ -/** - * Helpers. - */ - -var s = 1000; -var m = s * 60; -var h = m * 60; -var d = h * 24; -var y = d * 365.25; - -/** - * Parse or format the given `val`. - * - * Options: - * - * - `long` verbose formatting [false] - * - * @param {String|Number} val - * @param {Object} [options] - * @throws {Error} throw an error if val is not a non-empty string or a number - * @return {String|Number} - * @api public - */ - -module.exports = function(val, options) { - options = options || {}; - var type = typeof val; - if (type === 'string' && val.length > 0) { - return parse(val); - } else if (type === 'number' && isNaN(val) === false) { - return options.long ? fmtLong(val) : fmtShort(val); - } - throw new Error( - 'val is not a non-empty string or a valid number. val=' + - JSON.stringify(val) - ); -}; - -/** - * Parse the given `str` and return milliseconds. - * - * @param {String} str - * @return {Number} - * @api private - */ - -function parse(str) { - str = String(str); - if (str.length > 100) { - return; - } - var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec( - str - ); - if (!match) { - return; - } - var n = parseFloat(match[1]); - var type = (match[2] || 'ms').toLowerCase(); - switch (type) { - case 'years': - case 'year': - case 'yrs': - case 'yr': - case 'y': - return n * y; - case 'days': - case 'day': - case 'd': - return n * d; - case 'hours': - case 'hour': - case 'hrs': - case 'hr': - case 'h': - return n * h; - case 'minutes': - case 'minute': - case 'mins': - case 'min': - case 'm': - return n * m; - case 'seconds': - case 'second': - case 'secs': - case 'sec': - case 's': - return n * s; - case 'milliseconds': - case 'millisecond': - case 'msecs': - case 'msec': - case 'ms': - return n; - default: - return undefined; - } -} - -/** - * Short format for `ms`. - * - * @param {Number} ms - * @return {String} - * @api private - */ - -function fmtShort(ms) { - if (ms >= d) { - return Math.round(ms / d) + 'd'; - } - if (ms >= h) { - return Math.round(ms / h) + 'h'; - } - if (ms >= m) { - return Math.round(ms / m) + 'm'; - } - if (ms >= s) { - return Math.round(ms / s) + 's'; - } - return ms + 'ms'; -} - -/** - * Long format for `ms`. - * - * @param {Number} ms - * @return {String} - * @api private - */ - -function fmtLong(ms) { - return plural(ms, d, 'day') || - plural(ms, h, 'hour') || - plural(ms, m, 'minute') || - plural(ms, s, 'second') || - ms + ' ms'; -} - -/** - * Pluralization helper. - */ - -function plural(ms, n, name) { - if (ms < n) { - return; - } - if (ms < n * 1.5) { - return Math.floor(ms / n) + ' ' + name; - } - return Math.ceil(ms / n) + ' ' + name + 's'; -} diff --git a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/node_modules/ms/license.md b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/node_modules/ms/license.md deleted file mode 100644 index 69b61253a389..000000000000 --- a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/node_modules/ms/license.md +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2016 Zeit, Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/node_modules/ms/package.json b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/node_modules/ms/package.json deleted file mode 100644 index 6a31c81fac43..000000000000 --- a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/node_modules/ms/package.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "name": "ms", - "version": "2.0.0", - "description": "Tiny milisecond conversion utility", - "repository": "zeit/ms", - "main": "./index", - "files": [ - "index.js" - ], - "scripts": { - "precommit": "lint-staged", - "lint": "eslint lib/* bin/*", - "test": "mocha tests.js" - }, - "eslintConfig": { - "extends": "eslint:recommended", - "env": { - "node": true, - "es6": true - } - }, - "lint-staged": { - "*.js": [ - "npm run lint", - "prettier --single-quote --write", - "git add" - ] - }, - "license": "MIT", - "devDependencies": { - "eslint": "3.19.0", - "expect.js": "0.3.1", - "husky": "0.13.3", - "lint-staged": "3.4.1", - "mocha": "3.4.1" - } -} diff --git a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/node_modules/ms/readme.md b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/node_modules/ms/readme.md deleted file mode 100644 index 84a9974cccd8..000000000000 --- a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/node_modules/ms/readme.md +++ /dev/null @@ -1,51 +0,0 @@ -# ms - -[![Build Status](https://travis-ci.org/zeit/ms.svg?branch=master)](https://travis-ci.org/zeit/ms) -[![Slack Channel](http://zeit-slackin.now.sh/badge.svg)](https://zeit.chat/) - -Use this package to easily convert various time formats to milliseconds. - -## Examples - -```js -ms('2 days') // 172800000 -ms('1d') // 86400000 -ms('10h') // 36000000 -ms('2.5 hrs') // 9000000 -ms('2h') // 7200000 -ms('1m') // 60000 -ms('5s') // 5000 -ms('1y') // 31557600000 -ms('100') // 100 -``` - -### Convert from milliseconds - -```js -ms(60000) // "1m" -ms(2 * 60000) // "2m" -ms(ms('10 hours')) // "10h" -``` - -### Time format written-out - -```js -ms(60000, { long: true }) // "1 minute" -ms(2 * 60000, { long: true }) // "2 minutes" -ms(ms('10 hours'), { long: true }) // "10 hours" -``` - -## Features - -- Works both in [node](https://nodejs.org) and in the browser. -- If a number is supplied to `ms`, a string with a unit is returned. -- If a string that contains the number is supplied, it returns it as a number (e.g.: it returns `100` for `'100'`). -- If you pass a string with a number and a valid unit, the number of equivalent ms is returned. - -## Caught a bug? - -1. [Fork](https://help.github.com/articles/fork-a-repo/) this repository to your own GitHub account and then [clone](https://help.github.com/articles/cloning-a-repository/) it to your local device -2. Link the package to the global module directory: `npm link` -3. Within the module you want to test your local development instance of ms, just link it to the dependencies: `npm link ms`. Instead of the default one from npm, node will now use your clone of ms! - -As always, you can run the tests using: `npm test` diff --git a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/package.json b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/package.json deleted file mode 100644 index dc787ba76781..000000000000 --- a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/package.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "name": "debug", - "version": "2.6.9", - "repository": { - "type": "git", - "url": "git://github.com/visionmedia/debug.git" - }, - "description": "small debugging utility", - "keywords": [ - "debug", - "log", - "debugger" - ], - "author": "TJ Holowaychuk ", - "contributors": [ - "Nathan Rajlich (http://n8.io)", - "Andrew Rhyne " - ], - "license": "MIT", - "dependencies": { - "ms": "2.0.0" - }, - "devDependencies": { - "browserify": "9.0.3", - "chai": "^3.5.0", - "concurrently": "^3.1.0", - "coveralls": "^2.11.15", - "eslint": "^3.12.1", - "istanbul": "^0.4.5", - "karma": "^1.3.0", - "karma-chai": "^0.1.0", - "karma-mocha": "^1.3.0", - "karma-phantomjs-launcher": "^1.0.2", - "karma-sinon": "^1.0.5", - "mocha": "^3.2.0", - "mocha-lcov-reporter": "^1.2.0", - "rimraf": "^2.5.4", - "sinon": "^1.17.6", - "sinon-chai": "^2.8.0" - }, - "main": "./src/index.js", - "browser": "./src/browser.js", - "component": { - "scripts": { - "debug/index.js": "browser.js", - "debug/debug.js": "debug.js" - } - } -} diff --git a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/src/browser.js b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/src/browser.js deleted file mode 100644 index 710692493450..000000000000 --- a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/src/browser.js +++ /dev/null @@ -1,185 +0,0 @@ -/** - * This is the web browser implementation of `debug()`. - * - * Expose `debug()` as the module. - */ - -exports = module.exports = require('./debug'); -exports.log = log; -exports.formatArgs = formatArgs; -exports.save = save; -exports.load = load; -exports.useColors = useColors; -exports.storage = 'undefined' != typeof chrome - && 'undefined' != typeof chrome.storage - ? chrome.storage.local - : localstorage(); - -/** - * Colors. - */ - -exports.colors = [ - 'lightseagreen', - 'forestgreen', - 'goldenrod', - 'dodgerblue', - 'darkorchid', - 'crimson' -]; - -/** - * Currently only WebKit-based Web Inspectors, Firefox >= v31, - * and the Firebug extension (any Firefox version) are known - * to support "%c" CSS customizations. - * - * TODO: add a `localStorage` variable to explicitly enable/disable colors - */ - -function useColors() { - // NB: In an Electron preload script, document will be defined but not fully - // initialized. Since we know we're in Chrome, we'll just detect this case - // explicitly - if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') { - return true; - } - - // is webkit? http://stackoverflow.com/a/16459606/376773 - // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 - return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) || - // is firebug? http://stackoverflow.com/a/398120/376773 - (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) || - // is firefox >= v31? - // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages - (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) || - // double check webkit in userAgent just in case we are in a worker - (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)); -} - -/** - * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. - */ - -exports.formatters.j = function(v) { - try { - return JSON.stringify(v); - } catch (err) { - return '[UnexpectedJSONParseError]: ' + err.message; - } -}; - - -/** - * Colorize log arguments if enabled. - * - * @api public - */ - -function formatArgs(args) { - var useColors = this.useColors; - - args[0] = (useColors ? '%c' : '') - + this.namespace - + (useColors ? ' %c' : ' ') - + args[0] - + (useColors ? '%c ' : ' ') - + '+' + exports.humanize(this.diff); - - if (!useColors) return; - - var c = 'color: ' + this.color; - args.splice(1, 0, c, 'color: inherit') - - // the final "%c" is somewhat tricky, because there could be other - // arguments passed either before or after the %c, so we need to - // figure out the correct index to insert the CSS into - var index = 0; - var lastC = 0; - args[0].replace(/%[a-zA-Z%]/g, function(match) { - if ('%%' === match) return; - index++; - if ('%c' === match) { - // we only are interested in the *last* %c - // (the user may have provided their own) - lastC = index; - } - }); - - args.splice(lastC, 0, c); -} - -/** - * Invokes `console.log()` when available. - * No-op when `console.log` is not a "function". - * - * @api public - */ - -function log() { - // this hackery is required for IE8/9, where - // the `console.log` function doesn't have 'apply' - return 'object' === typeof console - && console.log - && Function.prototype.apply.call(console.log, console, arguments); -} - -/** - * Save `namespaces`. - * - * @param {String} namespaces - * @api private - */ - -function save(namespaces) { - try { - if (null == namespaces) { - exports.storage.removeItem('debug'); - } else { - exports.storage.debug = namespaces; - } - } catch(e) {} -} - -/** - * Load `namespaces`. - * - * @return {String} returns the previously persisted debug modes - * @api private - */ - -function load() { - var r; - try { - r = exports.storage.debug; - } catch(e) {} - - // If debug isn't set in LS, and we're in Electron, try to load $DEBUG - if (!r && typeof process !== 'undefined' && 'env' in process) { - r = process.env.DEBUG; - } - - return r; -} - -/** - * Enable namespaces listed in `localStorage.debug` initially. - */ - -exports.enable(load()); - -/** - * Localstorage attempts to return the localstorage. - * - * This is necessary because safari throws - * when a user disables cookies/localstorage - * and you attempt to access it. - * - * @return {LocalStorage} - * @api private - */ - -function localstorage() { - try { - return window.localStorage; - } catch (e) {} -} diff --git a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/src/debug.js b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/src/debug.js deleted file mode 100644 index 6a5e3fc94c3a..000000000000 --- a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/src/debug.js +++ /dev/null @@ -1,202 +0,0 @@ - -/** - * This is the common logic for both the Node.js and web browser - * implementations of `debug()`. - * - * Expose `debug()` as the module. - */ - -exports = module.exports = createDebug.debug = createDebug['default'] = createDebug; -exports.coerce = coerce; -exports.disable = disable; -exports.enable = enable; -exports.enabled = enabled; -exports.humanize = require('ms'); - -/** - * The currently active debug mode names, and names to skip. - */ - -exports.names = []; -exports.skips = []; - -/** - * Map of special "%n" handling functions, for the debug "format" argument. - * - * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". - */ - -exports.formatters = {}; - -/** - * Previous log timestamp. - */ - -var prevTime; - -/** - * Select a color. - * @param {String} namespace - * @return {Number} - * @api private - */ - -function selectColor(namespace) { - var hash = 0, i; - - for (i in namespace) { - hash = ((hash << 5) - hash) + namespace.charCodeAt(i); - hash |= 0; // Convert to 32bit integer - } - - return exports.colors[Math.abs(hash) % exports.colors.length]; -} - -/** - * Create a debugger with the given `namespace`. - * - * @param {String} namespace - * @return {Function} - * @api public - */ - -function createDebug(namespace) { - - function debug() { - // disabled? - if (!debug.enabled) return; - - var self = debug; - - // set `diff` timestamp - var curr = +new Date(); - var ms = curr - (prevTime || curr); - self.diff = ms; - self.prev = prevTime; - self.curr = curr; - prevTime = curr; - - // turn the `arguments` into a proper Array - var args = new Array(arguments.length); - for (var i = 0; i < args.length; i++) { - args[i] = arguments[i]; - } - - args[0] = exports.coerce(args[0]); - - if ('string' !== typeof args[0]) { - // anything else let's inspect with %O - args.unshift('%O'); - } - - // apply any `formatters` transformations - var index = 0; - args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) { - // if we encounter an escaped % then don't increase the array index - if (match === '%%') return match; - index++; - var formatter = exports.formatters[format]; - if ('function' === typeof formatter) { - var val = args[index]; - match = formatter.call(self, val); - - // now we need to remove `args[index]` since it's inlined in the `format` - args.splice(index, 1); - index--; - } - return match; - }); - - // apply env-specific formatting (colors, etc.) - exports.formatArgs.call(self, args); - - var logFn = debug.log || exports.log || console.log.bind(console); - logFn.apply(self, args); - } - - debug.namespace = namespace; - debug.enabled = exports.enabled(namespace); - debug.useColors = exports.useColors(); - debug.color = selectColor(namespace); - - // env-specific initialization logic for debug instances - if ('function' === typeof exports.init) { - exports.init(debug); - } - - return debug; -} - -/** - * Enables a debug mode by namespaces. This can include modes - * separated by a colon and wildcards. - * - * @param {String} namespaces - * @api public - */ - -function enable(namespaces) { - exports.save(namespaces); - - exports.names = []; - exports.skips = []; - - var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); - var len = split.length; - - for (var i = 0; i < len; i++) { - if (!split[i]) continue; // ignore empty strings - namespaces = split[i].replace(/\*/g, '.*?'); - if (namespaces[0] === '-') { - exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); - } else { - exports.names.push(new RegExp('^' + namespaces + '$')); - } - } -} - -/** - * Disable debug output. - * - * @api public - */ - -function disable() { - exports.enable(''); -} - -/** - * Returns true if the given mode name is enabled, false otherwise. - * - * @param {String} name - * @return {Boolean} - * @api public - */ - -function enabled(name) { - var i, len; - for (i = 0, len = exports.skips.length; i < len; i++) { - if (exports.skips[i].test(name)) { - return false; - } - } - for (i = 0, len = exports.names.length; i < len; i++) { - if (exports.names[i].test(name)) { - return true; - } - } - return false; -} - -/** - * Coerce `val`. - * - * @param {Mixed} val - * @return {Mixed} - * @api private - */ - -function coerce(val) { - if (val instanceof Error) return val.stack || val.message; - return val; -} diff --git a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/src/index.js b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/src/index.js deleted file mode 100644 index e12cf4d58c9f..000000000000 --- a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/src/index.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * Detect Electron renderer process, which is node, but we should - * treat as a browser. - */ - -if (typeof process !== 'undefined' && process.type === 'renderer') { - module.exports = require('./browser.js'); -} else { - module.exports = require('./node.js'); -} diff --git a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/src/inspector-log.js b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/src/inspector-log.js deleted file mode 100644 index 60ea6c04aafd..000000000000 --- a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/src/inspector-log.js +++ /dev/null @@ -1,15 +0,0 @@ -module.exports = inspectorLog; - -// black hole -const nullStream = new (require('stream').Writable)(); -nullStream._write = () => {}; - -/** - * Outputs a `console.log()` to the Node.js Inspector console *only*. - */ -function inspectorLog() { - const stdout = console._stdout; - console._stdout = nullStream; - console.log.apply(console, arguments); - console._stdout = stdout; -} diff --git a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/src/node.js b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/src/node.js deleted file mode 100644 index b15109c905a4..000000000000 --- a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/debug/src/node.js +++ /dev/null @@ -1,248 +0,0 @@ -/** - * Module dependencies. - */ - -var tty = require('tty'); -var util = require('util'); - -/** - * This is the Node.js implementation of `debug()`. - * - * Expose `debug()` as the module. - */ - -exports = module.exports = require('./debug'); -exports.init = init; -exports.log = log; -exports.formatArgs = formatArgs; -exports.save = save; -exports.load = load; -exports.useColors = useColors; - -/** - * Colors. - */ - -exports.colors = [6, 2, 3, 4, 5, 1]; - -/** - * Build up the default `inspectOpts` object from the environment variables. - * - * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js - */ - -exports.inspectOpts = Object.keys(process.env).filter(function (key) { - return /^debug_/i.test(key); -}).reduce(function (obj, key) { - // camel-case - var prop = key - .substring(6) - .toLowerCase() - .replace(/_([a-z])/g, function (_, k) { return k.toUpperCase() }); - - // coerce string value into JS value - var val = process.env[key]; - if (/^(yes|on|true|enabled)$/i.test(val)) val = true; - else if (/^(no|off|false|disabled)$/i.test(val)) val = false; - else if (val === 'null') val = null; - else val = Number(val); - - obj[prop] = val; - return obj; -}, {}); - -/** - * The file descriptor to write the `debug()` calls to. - * Set the `DEBUG_FD` env variable to override with another value. i.e.: - * - * $ DEBUG_FD=3 node script.js 3>debug.log - */ - -var fd = parseInt(process.env.DEBUG_FD, 10) || 2; - -if (1 !== fd && 2 !== fd) { - util.deprecate(function(){}, 'except for stderr(2) and stdout(1), any other usage of DEBUG_FD is deprecated. Override debug.log if you want to use a different log function (https://git.io/debug_fd)')() -} - -var stream = 1 === fd ? process.stdout : - 2 === fd ? process.stderr : - createWritableStdioStream(fd); - -/** - * Is stdout a TTY? Colored output is enabled when `true`. - */ - -function useColors() { - return 'colors' in exports.inspectOpts - ? Boolean(exports.inspectOpts.colors) - : tty.isatty(fd); -} - -/** - * Map %o to `util.inspect()`, all on a single line. - */ - -exports.formatters.o = function(v) { - this.inspectOpts.colors = this.useColors; - return util.inspect(v, this.inspectOpts) - .split('\n').map(function(str) { - return str.trim() - }).join(' '); -}; - -/** - * Map %o to `util.inspect()`, allowing multiple lines if needed. - */ - -exports.formatters.O = function(v) { - this.inspectOpts.colors = this.useColors; - return util.inspect(v, this.inspectOpts); -}; - -/** - * Adds ANSI color escape codes if enabled. - * - * @api public - */ - -function formatArgs(args) { - var name = this.namespace; - var useColors = this.useColors; - - if (useColors) { - var c = this.color; - var prefix = ' \u001b[3' + c + ';1m' + name + ' ' + '\u001b[0m'; - - args[0] = prefix + args[0].split('\n').join('\n' + prefix); - args.push('\u001b[3' + c + 'm+' + exports.humanize(this.diff) + '\u001b[0m'); - } else { - args[0] = new Date().toUTCString() - + ' ' + name + ' ' + args[0]; - } -} - -/** - * Invokes `util.format()` with the specified arguments and writes to `stream`. - */ - -function log() { - return stream.write(util.format.apply(util, arguments) + '\n'); -} - -/** - * Save `namespaces`. - * - * @param {String} namespaces - * @api private - */ - -function save(namespaces) { - if (null == namespaces) { - // If you set a process.env field to null or undefined, it gets cast to the - // string 'null' or 'undefined'. Just delete instead. - delete process.env.DEBUG; - } else { - process.env.DEBUG = namespaces; - } -} - -/** - * Load `namespaces`. - * - * @return {String} returns the previously persisted debug modes - * @api private - */ - -function load() { - return process.env.DEBUG; -} - -/** - * Copied from `node/src/node.js`. - * - * XXX: It's lame that node doesn't expose this API out-of-the-box. It also - * relies on the undocumented `tty_wrap.guessHandleType()` which is also lame. - */ - -function createWritableStdioStream (fd) { - var stream; - var tty_wrap = process.binding('tty_wrap'); - - // Note stream._type is used for test-module-load-list.js - - switch (tty_wrap.guessHandleType(fd)) { - case 'TTY': - stream = new tty.WriteStream(fd); - stream._type = 'tty'; - - // Hack to have stream not keep the event loop alive. - // See https://github.com/joyent/node/issues/1726 - if (stream._handle && stream._handle.unref) { - stream._handle.unref(); - } - break; - - case 'FILE': - var fs = require('fs'); - stream = new fs.SyncWriteStream(fd, { autoClose: false }); - stream._type = 'fs'; - break; - - case 'PIPE': - case 'TCP': - var net = require('net'); - stream = new net.Socket({ - fd: fd, - readable: false, - writable: true - }); - - // FIXME Should probably have an option in net.Socket to create a - // stream from an existing fd which is writable only. But for now - // we'll just add this hack and set the `readable` member to false. - // Test: ./node test/fixtures/echo.js < /etc/passwd - stream.readable = false; - stream.read = null; - stream._type = 'pipe'; - - // FIXME Hack to have stream not keep the event loop alive. - // See https://github.com/joyent/node/issues/1726 - if (stream._handle && stream._handle.unref) { - stream._handle.unref(); - } - break; - - default: - // Probably an error on in uv_guess_handle() - throw new Error('Implement me. Unknown stream file type!'); - } - - // For supporting legacy API we put the FD here. - stream.fd = fd; - - stream._isStdio = true; - - return stream; -} - -/** - * Init logic for `debug` instances. - * - * Create a new `inspectOpts` object in case `useColors` is set - * differently for a particular `debug` instance. - */ - -function init (debug) { - debug.inspectOpts = {}; - - var keys = Object.keys(exports.inspectOpts); - for (var i = 0; i < keys.length; i++) { - debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]]; - } -} - -/** - * Enable namespaces listed in `process.env.DEBUG` initially. - */ - -exports.enable(load()); diff --git a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/encodeurl/LICENSE b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/encodeurl/LICENSE new file mode 100644 index 000000000000..8812229bc59b --- /dev/null +++ b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/encodeurl/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2016 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/encodeurl/README.md b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/encodeurl/README.md new file mode 100644 index 000000000000..3842493ec68e --- /dev/null +++ b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/encodeurl/README.md @@ -0,0 +1,109 @@ +# Encode URL + +Encode a URL to a percent-encoded form, excluding already-encoded sequences. + +## Installation + +```sh +npm install encodeurl +``` + +## API + +```js +var encodeUrl = require('encodeurl') +``` + +### encodeUrl(url) + +Encode a URL to a percent-encoded form, excluding already-encoded sequences. + +This function accepts a URL and encodes all the non-URL code points (as UTF-8 byte sequences). It will not encode the "%" character unless it is not part of a valid sequence (`%20` will be left as-is, but `%foo` will be encoded as `%25foo`). + +This encode is meant to be "safe" and does not throw errors. It will try as hard as it can to properly encode the given URL, including replacing any raw, unpaired surrogate pairs with the Unicode replacement character prior to encoding. + +## Examples + +### Encode a URL containing user-controlled data + +```js +var encodeUrl = require('encodeurl') +var escapeHtml = require('escape-html') + +http.createServer(function onRequest (req, res) { + // get encoded form of inbound url + var url = encodeUrl(req.url) + + // create html message + var body = '

Location ' + escapeHtml(url) + ' not found

' + + // send a 404 + res.statusCode = 404 + res.setHeader('Content-Type', 'text/html; charset=UTF-8') + res.setHeader('Content-Length', String(Buffer.byteLength(body, 'utf-8'))) + res.end(body, 'utf-8') +}) +``` + +### Encode a URL for use in a header field + +```js +var encodeUrl = require('encodeurl') +var escapeHtml = require('escape-html') +var url = require('url') + +http.createServer(function onRequest (req, res) { + // parse inbound url + var href = url.parse(req) + + // set new host for redirect + href.host = 'localhost' + href.protocol = 'https:' + href.slashes = true + + // create location header + var location = encodeUrl(url.format(href)) + + // create html message + var body = '

Redirecting to new site: ' + escapeHtml(location) + '

' + + // send a 301 + res.statusCode = 301 + res.setHeader('Content-Type', 'text/html; charset=UTF-8') + res.setHeader('Content-Length', String(Buffer.byteLength(body, 'utf-8'))) + res.setHeader('Location', location) + res.end(body, 'utf-8') +}) +``` + +## Similarities + +This function is _similar_ to the intrinsic function `encodeURI`. However, it will not encode: + +* The `\`, `^`, or `|` characters +* The `%` character when it's part of a valid sequence +* `[` and `]` (for IPv6 hostnames) +* Replaces raw, unpaired surrogate pairs with the Unicode replacement character + +As a result, the encoding aligns closely with the behavior in the [WHATWG URL specification][whatwg-url]. However, this package only encodes strings and does not do any URL parsing or formatting. + +It is expected that any output from `new URL(url)` will not change when used with this package, as the output has already been encoded. Additionally, if we were to encode before `new URL(url)`, we do not expect the before and after encoded formats to be parsed any differently. + +## Testing + +```sh +$ npm test +$ npm run lint +``` + +## References + +- [RFC 3986: Uniform Resource Identifier (URI): Generic Syntax][rfc-3986] +- [WHATWG URL Living Standard][whatwg-url] + +[rfc-3986]: https://tools.ietf.org/html/rfc3986 +[whatwg-url]: https://url.spec.whatwg.org/ + +## License + +[MIT](LICENSE) diff --git a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/encodeurl/index.js b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/encodeurl/index.js new file mode 100644 index 000000000000..a49ee5a0b621 --- /dev/null +++ b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/encodeurl/index.js @@ -0,0 +1,60 @@ +/*! + * encodeurl + * Copyright(c) 2016 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module exports. + * @public + */ + +module.exports = encodeUrl + +/** + * RegExp to match non-URL code points, *after* encoding (i.e. not including "%") + * and including invalid escape sequences. + * @private + */ + +var ENCODE_CHARS_REGEXP = /(?:[^\x21\x23-\x3B\x3D\x3F-\x5F\x61-\x7A\x7C\x7E]|%(?:[^0-9A-Fa-f]|[0-9A-Fa-f][^0-9A-Fa-f]|$))+/g + +/** + * RegExp to match unmatched surrogate pair. + * @private + */ + +var UNMATCHED_SURROGATE_PAIR_REGEXP = /(^|[^\uD800-\uDBFF])[\uDC00-\uDFFF]|[\uD800-\uDBFF]([^\uDC00-\uDFFF]|$)/g + +/** + * String to replace unmatched surrogate pair with. + * @private + */ + +var UNMATCHED_SURROGATE_PAIR_REPLACE = '$1\uFFFD$2' + +/** + * Encode a URL to a percent-encoded form, excluding already-encoded sequences. + * + * This function will take an already-encoded URL and encode all the non-URL + * code points. This function will not encode the "%" character unless it is + * not part of a valid sequence (`%20` will be left as-is, but `%foo` will + * be encoded as `%25foo`). + * + * This encode is meant to be "safe" and does not throw errors. It will try as + * hard as it can to properly encode the given URL, including replacing any raw, + * unpaired surrogate pairs with the Unicode replacement character prior to + * encoding. + * + * @param {string} url + * @return {string} + * @public + */ + +function encodeUrl (url) { + return String(url) + .replace(UNMATCHED_SURROGATE_PAIR_REGEXP, UNMATCHED_SURROGATE_PAIR_REPLACE) + .replace(ENCODE_CHARS_REGEXP, encodeURI) +} diff --git a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/encodeurl/package.json b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/encodeurl/package.json new file mode 100644 index 000000000000..313382214599 --- /dev/null +++ b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/encodeurl/package.json @@ -0,0 +1,40 @@ +{ + "name": "encodeurl", + "description": "Encode a URL to a percent-encoded form, excluding already-encoded sequences", + "version": "2.0.0", + "contributors": [ + "Douglas Christopher Wilson " + ], + "license": "MIT", + "keywords": [ + "encode", + "encodeurl", + "url" + ], + "repository": "pillarjs/encodeurl", + "devDependencies": { + "eslint": "5.11.1", + "eslint-config-standard": "12.0.0", + "eslint-plugin-import": "2.14.0", + "eslint-plugin-node": "7.0.1", + "eslint-plugin-promise": "4.0.1", + "eslint-plugin-standard": "4.0.0", + "istanbul": "0.4.5", + "mocha": "2.5.3" + }, + "files": [ + "LICENSE", + "HISTORY.md", + "README.md", + "index.js" + ], + "engines": { + "node": ">= 0.8" + }, + "scripts": { + "lint": "eslint .", + "test": "mocha --reporter spec --bail --check-leaks test/", + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", + "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" + } +} diff --git a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/ms/index.js b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/ms/index.js deleted file mode 100644 index ea734fb73820..000000000000 --- a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/ms/index.js +++ /dev/null @@ -1,162 +0,0 @@ -/** - * Helpers. - */ - -var s = 1000; -var m = s * 60; -var h = m * 60; -var d = h * 24; -var w = d * 7; -var y = d * 365.25; - -/** - * Parse or format the given `val`. - * - * Options: - * - * - `long` verbose formatting [false] - * - * @param {String|Number} val - * @param {Object} [options] - * @throws {Error} throw an error if val is not a non-empty string or a number - * @return {String|Number} - * @api public - */ - -module.exports = function (val, options) { - options = options || {}; - var type = typeof val; - if (type === 'string' && val.length > 0) { - return parse(val); - } else if (type === 'number' && isFinite(val)) { - return options.long ? fmtLong(val) : fmtShort(val); - } - throw new Error( - 'val is not a non-empty string or a valid number. val=' + - JSON.stringify(val) - ); -}; - -/** - * Parse the given `str` and return milliseconds. - * - * @param {String} str - * @return {Number} - * @api private - */ - -function parse(str) { - str = String(str); - if (str.length > 100) { - return; - } - var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( - str - ); - if (!match) { - return; - } - var n = parseFloat(match[1]); - var type = (match[2] || 'ms').toLowerCase(); - switch (type) { - case 'years': - case 'year': - case 'yrs': - case 'yr': - case 'y': - return n * y; - case 'weeks': - case 'week': - case 'w': - return n * w; - case 'days': - case 'day': - case 'd': - return n * d; - case 'hours': - case 'hour': - case 'hrs': - case 'hr': - case 'h': - return n * h; - case 'minutes': - case 'minute': - case 'mins': - case 'min': - case 'm': - return n * m; - case 'seconds': - case 'second': - case 'secs': - case 'sec': - case 's': - return n * s; - case 'milliseconds': - case 'millisecond': - case 'msecs': - case 'msec': - case 'ms': - return n; - default: - return undefined; - } -} - -/** - * Short format for `ms`. - * - * @param {Number} ms - * @return {String} - * @api private - */ - -function fmtShort(ms) { - var msAbs = Math.abs(ms); - if (msAbs >= d) { - return Math.round(ms / d) + 'd'; - } - if (msAbs >= h) { - return Math.round(ms / h) + 'h'; - } - if (msAbs >= m) { - return Math.round(ms / m) + 'm'; - } - if (msAbs >= s) { - return Math.round(ms / s) + 's'; - } - return ms + 'ms'; -} - -/** - * Long format for `ms`. - * - * @param {Number} ms - * @return {String} - * @api private - */ - -function fmtLong(ms) { - var msAbs = Math.abs(ms); - if (msAbs >= d) { - return plural(ms, msAbs, d, 'day'); - } - if (msAbs >= h) { - return plural(ms, msAbs, h, 'hour'); - } - if (msAbs >= m) { - return plural(ms, msAbs, m, 'minute'); - } - if (msAbs >= s) { - return plural(ms, msAbs, s, 'second'); - } - return ms + ' ms'; -} - -/** - * Pluralization helper. - */ - -function plural(ms, msAbs, n, name) { - var isPlural = msAbs >= n * 1.5; - return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : ''); -} diff --git a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/ms/license.md b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/ms/license.md deleted file mode 100644 index fa5d39b6213f..000000000000 --- a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/ms/license.md +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2020 Vercel, Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/ms/package.json b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/ms/package.json deleted file mode 100644 index 49971890df8e..000000000000 --- a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/ms/package.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "name": "ms", - "version": "2.1.3", - "description": "Tiny millisecond conversion utility", - "repository": "vercel/ms", - "main": "./index", - "files": [ - "index.js" - ], - "scripts": { - "precommit": "lint-staged", - "lint": "eslint lib/* bin/*", - "test": "mocha tests.js" - }, - "eslintConfig": { - "extends": "eslint:recommended", - "env": { - "node": true, - "es6": true - } - }, - "lint-staged": { - "*.js": [ - "npm run lint", - "prettier --single-quote --write", - "git add" - ] - }, - "license": "MIT", - "devDependencies": { - "eslint": "4.18.2", - "expect.js": "0.3.1", - "husky": "0.14.3", - "lint-staged": "5.0.0", - "mocha": "4.0.1", - "prettier": "2.0.5" - } -} diff --git a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/ms/readme.md b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/ms/readme.md deleted file mode 100644 index 0fc1abb3b8e3..000000000000 --- a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/ms/readme.md +++ /dev/null @@ -1,59 +0,0 @@ -# ms - -![CI](https://github.com/vercel/ms/workflows/CI/badge.svg) - -Use this package to easily convert various time formats to milliseconds. - -## Examples - -```js -ms('2 days') // 172800000 -ms('1d') // 86400000 -ms('10h') // 36000000 -ms('2.5 hrs') // 9000000 -ms('2h') // 7200000 -ms('1m') // 60000 -ms('5s') // 5000 -ms('1y') // 31557600000 -ms('100') // 100 -ms('-3 days') // -259200000 -ms('-1h') // -3600000 -ms('-200') // -200 -``` - -### Convert from Milliseconds - -```js -ms(60000) // "1m" -ms(2 * 60000) // "2m" -ms(-3 * 60000) // "-3m" -ms(ms('10 hours')) // "10h" -``` - -### Time Format Written-Out - -```js -ms(60000, { long: true }) // "1 minute" -ms(2 * 60000, { long: true }) // "2 minutes" -ms(-3 * 60000, { long: true }) // "-3 minutes" -ms(ms('10 hours'), { long: true }) // "10 hours" -``` - -## Features - -- Works both in [Node.js](https://nodejs.org) and in the browser -- If a number is supplied to `ms`, a string with a unit is returned -- If a string that contains the number is supplied, it returns it as a number (e.g.: it returns `100` for `'100'`) -- If you pass a string with a number and a valid unit, the number of equivalent milliseconds is returned - -## Related Packages - -- [ms.macro](https://github.com/knpwrs/ms.macro) - Run `ms` as a macro at build-time. - -## Caught a Bug? - -1. [Fork](https://help.github.com/articles/fork-a-repo/) this repository to your own GitHub account and then [clone](https://help.github.com/articles/cloning-a-repository/) it to your local device -2. Link the package to the global module directory: `npm link` -3. Within the module you want to test your local development instance of ms, just link it to the dependencies: `npm link ms`. Instead of the default one from npm, Node.js will now use your clone of ms! - -As always, you can run the tests using: `npm test` diff --git a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/send/HISTORY.md b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/send/HISTORY.md deleted file mode 100644 index a7397749461a..000000000000 --- a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/send/HISTORY.md +++ /dev/null @@ -1,521 +0,0 @@ -0.18.0 / 2022-03-23 -=================== - - * Fix emitted 416 error missing headers property - * Limit the headers removed for 304 response - * deps: depd@2.0.0 - - Replace internal `eval` usage with `Function` constructor - - Use instance methods on `process` to check for listeners - * deps: destroy@1.2.0 - * deps: http-errors@2.0.0 - - deps: depd@2.0.0 - - deps: statuses@2.0.1 - * deps: on-finished@2.4.1 - * deps: statuses@2.0.1 - -0.17.2 / 2021-12-11 -=================== - - * pref: ignore empty http tokens - * deps: http-errors@1.8.1 - - deps: inherits@2.0.4 - - deps: toidentifier@1.0.1 - - deps: setprototypeof@1.2.0 - * deps: ms@2.1.3 - -0.17.1 / 2019-05-10 -=================== - - * Set stricter CSP header in redirect & error responses - * deps: range-parser@~1.2.1 - -0.17.0 / 2019-05-03 -=================== - - * deps: http-errors@~1.7.2 - - Set constructor name when possible - - Use `toidentifier` module to make class names - - deps: depd@~1.1.2 - - deps: setprototypeof@1.1.1 - - deps: statuses@'>= 1.5.0 < 2' - * deps: mime@1.6.0 - - Add extensions for JPEG-2000 images - - Add new `font/*` types from IANA - - Add WASM mapping - - Update `.bdoc` to `application/bdoc` - - Update `.bmp` to `image/bmp` - - Update `.m4a` to `audio/mp4` - - Update `.rtf` to `application/rtf` - - Update `.wav` to `audio/wav` - - Update `.xml` to `application/xml` - - Update generic extensions to `application/octet-stream`: - `.deb`, `.dll`, `.dmg`, `.exe`, `.iso`, `.msi` - - Use mime-score module to resolve extension conflicts - * deps: ms@2.1.1 - - Add `week`/`w` support - - Fix negative number handling - * deps: statuses@~1.5.0 - * perf: remove redundant `path.normalize` call - -0.16.2 / 2018-02-07 -=================== - - * Fix incorrect end tag in default error & redirects - * deps: depd@~1.1.2 - - perf: remove argument reassignment - * deps: encodeurl@~1.0.2 - - Fix encoding `%` as last character - * deps: statuses@~1.4.0 - -0.16.1 / 2017-09-29 -=================== - - * Fix regression in edge-case behavior for empty `path` - -0.16.0 / 2017-09-27 -=================== - - * Add `immutable` option - * Fix missing `` in default error & redirects - * Use instance methods on steam to check for listeners - * deps: mime@1.4.1 - - Add 70 new types for file extensions - - Set charset as "UTF-8" for .js and .json - * perf: improve path validation speed - -0.15.6 / 2017-09-22 -=================== - - * deps: debug@2.6.9 - * perf: improve `If-Match` token parsing - -0.15.5 / 2017-09-20 -=================== - - * deps: etag@~1.8.1 - - perf: replace regular expression with substring - * deps: fresh@0.5.2 - - Fix handling of modified headers with invalid dates - - perf: improve ETag match loop - - perf: improve `If-None-Match` token parsing - -0.15.4 / 2017-08-05 -=================== - - * deps: debug@2.6.8 - * deps: depd@~1.1.1 - - Remove unnecessary `Buffer` loading - * deps: http-errors@~1.6.2 - - deps: depd@1.1.1 - -0.15.3 / 2017-05-16 -=================== - - * deps: debug@2.6.7 - - deps: ms@2.0.0 - * deps: ms@2.0.0 - -0.15.2 / 2017-04-26 -=================== - - * deps: debug@2.6.4 - - Fix `DEBUG_MAX_ARRAY_LENGTH` - - deps: ms@0.7.3 - * deps: ms@1.0.0 - -0.15.1 / 2017-03-04 -=================== - - * Fix issue when `Date.parse` does not return `NaN` on invalid date - * Fix strict violation in broken environments - -0.15.0 / 2017-02-25 -=================== - - * Support `If-Match` and `If-Unmodified-Since` headers - * Add `res` and `path` arguments to `directory` event - * Remove usage of `res._headers` private field - - Improves compatibility with Node.js 8 nightly - * Send complete HTML document in redirect & error responses - * Set default CSP header in redirect & error responses - * Use `res.getHeaderNames()` when available - * Use `res.headersSent` when available - * deps: debug@2.6.1 - - Allow colors in workers - - Deprecated `DEBUG_FD` environment variable set to `3` or higher - - Fix error when running under React Native - - Use same color for same namespace - - deps: ms@0.7.2 - * deps: etag@~1.8.0 - * deps: fresh@0.5.0 - - Fix false detection of `no-cache` request directive - - Fix incorrect result when `If-None-Match` has both `*` and ETags - - Fix weak `ETag` matching to match spec - - perf: delay reading header values until needed - - perf: enable strict mode - - perf: hoist regular expressions - - perf: remove duplicate conditional - - perf: remove unnecessary boolean coercions - - perf: skip checking modified time if ETag check failed - - perf: skip parsing `If-None-Match` when no `ETag` header - - perf: use `Date.parse` instead of `new Date` - * deps: http-errors@~1.6.1 - - Make `message` property enumerable for `HttpError`s - - deps: setprototypeof@1.0.3 - -0.14.2 / 2017-01-23 -=================== - - * deps: http-errors@~1.5.1 - - deps: inherits@2.0.3 - - deps: setprototypeof@1.0.2 - - deps: statuses@'>= 1.3.1 < 2' - * deps: ms@0.7.2 - * deps: statuses@~1.3.1 - -0.14.1 / 2016-06-09 -=================== - - * Fix redirect error when `path` contains raw non-URL characters - * Fix redirect when `path` starts with multiple forward slashes - -0.14.0 / 2016-06-06 -=================== - - * Add `acceptRanges` option - * Add `cacheControl` option - * Attempt to combine multiple ranges into single range - * Correctly inherit from `Stream` class - * Fix `Content-Range` header in 416 responses when using `start`/`end` options - * Fix `Content-Range` header missing from default 416 responses - * Ignore non-byte `Range` headers - * deps: http-errors@~1.5.0 - - Add `HttpError` export, for `err instanceof createError.HttpError` - - Support new code `421 Misdirected Request` - - Use `setprototypeof` module to replace `__proto__` setting - - deps: inherits@2.0.1 - - deps: statuses@'>= 1.3.0 < 2' - - perf: enable strict mode - * deps: range-parser@~1.2.0 - - Fix incorrectly returning -1 when there is at least one valid range - - perf: remove internal function - * deps: statuses@~1.3.0 - - Add `421 Misdirected Request` - - perf: enable strict mode - * perf: remove argument reassignment - -0.13.2 / 2016-03-05 -=================== - - * Fix invalid `Content-Type` header when `send.mime.default_type` unset - -0.13.1 / 2016-01-16 -=================== - - * deps: depd@~1.1.0 - - Support web browser loading - - perf: enable strict mode - * deps: destroy@~1.0.4 - - perf: enable strict mode - * deps: escape-html@~1.0.3 - - perf: enable strict mode - - perf: optimize string replacement - - perf: use faster string coercion - * deps: range-parser@~1.0.3 - - perf: enable strict mode - -0.13.0 / 2015-06-16 -=================== - - * Allow Node.js HTTP server to set `Date` response header - * Fix incorrectly removing `Content-Location` on 304 response - * Improve the default redirect response headers - * Send appropriate headers on default error response - * Use `http-errors` for standard emitted errors - * Use `statuses` instead of `http` module for status messages - * deps: escape-html@1.0.2 - * deps: etag@~1.7.0 - - Improve stat performance by removing hashing - * deps: fresh@0.3.0 - - Add weak `ETag` matching support - * deps: on-finished@~2.3.0 - - Add defined behavior for HTTP `CONNECT` requests - - Add defined behavior for HTTP `Upgrade` requests - - deps: ee-first@1.1.1 - * perf: enable strict mode - * perf: remove unnecessary array allocations - -0.12.3 / 2015-05-13 -=================== - - * deps: debug@~2.2.0 - - deps: ms@0.7.1 - * deps: depd@~1.0.1 - * deps: etag@~1.6.0 - - Improve support for JXcore - - Support "fake" stats objects in environments without `fs` - * deps: ms@0.7.1 - - Prevent extraordinarily long inputs - * deps: on-finished@~2.2.1 - -0.12.2 / 2015-03-13 -=================== - - * Throw errors early for invalid `extensions` or `index` options - * deps: debug@~2.1.3 - - Fix high intensity foreground color for bold - - deps: ms@0.7.0 - -0.12.1 / 2015-02-17 -=================== - - * Fix regression sending zero-length files - -0.12.0 / 2015-02-16 -=================== - - * Always read the stat size from the file - * Fix mutating passed-in `options` - * deps: mime@1.3.4 - -0.11.1 / 2015-01-20 -=================== - - * Fix `root` path disclosure - -0.11.0 / 2015-01-05 -=================== - - * deps: debug@~2.1.1 - * deps: etag@~1.5.1 - - deps: crc@3.2.1 - * deps: ms@0.7.0 - - Add `milliseconds` - - Add `msecs` - - Add `secs` - - Add `mins` - - Add `hrs` - - Add `yrs` - * deps: on-finished@~2.2.0 - -0.10.1 / 2014-10-22 -=================== - - * deps: on-finished@~2.1.1 - - Fix handling of pipelined requests - -0.10.0 / 2014-10-15 -=================== - - * deps: debug@~2.1.0 - - Implement `DEBUG_FD` env variable support - * deps: depd@~1.0.0 - * deps: etag@~1.5.0 - - Improve string performance - - Slightly improve speed for weak ETags over 1KB - -0.9.3 / 2014-09-24 -================== - - * deps: etag@~1.4.0 - - Support "fake" stats objects - -0.9.2 / 2014-09-15 -================== - - * deps: depd@0.4.5 - * deps: etag@~1.3.1 - * deps: range-parser@~1.0.2 - -0.9.1 / 2014-09-07 -================== - - * deps: fresh@0.2.4 - -0.9.0 / 2014-09-07 -================== - - * Add `lastModified` option - * Use `etag` to generate `ETag` header - * deps: debug@~2.0.0 - -0.8.5 / 2014-09-04 -================== - - * Fix malicious path detection for empty string path - -0.8.4 / 2014-09-04 -================== - - * Fix a path traversal issue when using `root` - -0.8.3 / 2014-08-16 -================== - - * deps: destroy@1.0.3 - - renamed from dethroy - * deps: on-finished@2.1.0 - -0.8.2 / 2014-08-14 -================== - - * Work around `fd` leak in Node.js 0.10 for `fs.ReadStream` - * deps: dethroy@1.0.2 - -0.8.1 / 2014-08-05 -================== - - * Fix `extensions` behavior when file already has extension - -0.8.0 / 2014-08-05 -================== - - * Add `extensions` option - -0.7.4 / 2014-08-04 -================== - - * Fix serving index files without root dir - -0.7.3 / 2014-07-29 -================== - - * Fix incorrect 403 on Windows and Node.js 0.11 - -0.7.2 / 2014-07-27 -================== - - * deps: depd@0.4.4 - - Work-around v8 generating empty stack traces - -0.7.1 / 2014-07-26 -================== - - * deps: depd@0.4.3 - - Fix exception when global `Error.stackTraceLimit` is too low - -0.7.0 / 2014-07-20 -================== - - * Deprecate `hidden` option; use `dotfiles` option - * Add `dotfiles` option - * deps: debug@1.0.4 - * deps: depd@0.4.2 - - Add `TRACE_DEPRECATION` environment variable - - Remove non-standard grey color from color output - - Support `--no-deprecation` argument - - Support `--trace-deprecation` argument - -0.6.0 / 2014-07-11 -================== - - * Deprecate `from` option; use `root` option - * Deprecate `send.etag()` -- use `etag` in `options` - * Deprecate `send.hidden()` -- use `hidden` in `options` - * Deprecate `send.index()` -- use `index` in `options` - * Deprecate `send.maxage()` -- use `maxAge` in `options` - * Deprecate `send.root()` -- use `root` in `options` - * Cap `maxAge` value to 1 year - * deps: debug@1.0.3 - - Add support for multiple wildcards in namespaces - -0.5.0 / 2014-06-28 -================== - - * Accept string for `maxAge` (converted by `ms`) - * Add `headers` event - * Include link in default redirect response - * Use `EventEmitter.listenerCount` to count listeners - -0.4.3 / 2014-06-11 -================== - - * Do not throw un-catchable error on file open race condition - * Use `escape-html` for HTML escaping - * deps: debug@1.0.2 - - fix some debugging output colors on node.js 0.8 - * deps: finished@1.2.2 - * deps: fresh@0.2.2 - -0.4.2 / 2014-06-09 -================== - - * fix "event emitter leak" warnings - * deps: debug@1.0.1 - * deps: finished@1.2.1 - -0.4.1 / 2014-06-02 -================== - - * Send `max-age` in `Cache-Control` in correct format - -0.4.0 / 2014-05-27 -================== - - * Calculate ETag with md5 for reduced collisions - * Fix wrong behavior when index file matches directory - * Ignore stream errors after request ends - - Goodbye `EBADF, read` - * Skip directories in index file search - * deps: debug@0.8.1 - -0.3.0 / 2014-04-24 -================== - - * Fix sending files with dots without root set - * Coerce option types - * Accept API options in options object - * Set etags to "weak" - * Include file path in etag - * Make "Can't set headers after they are sent." catchable - * Send full entity-body for multi range requests - * Default directory access to 403 when index disabled - * Support multiple index paths - * Support "If-Range" header - * Control whether to generate etags - * deps: mime@1.2.11 - -0.2.0 / 2014-01-29 -================== - - * update range-parser and fresh - -0.1.4 / 2013-08-11 -================== - - * update fresh - -0.1.3 / 2013-07-08 -================== - - * Revert "Fix fd leak" - -0.1.2 / 2013-07-03 -================== - - * Fix fd leak - -0.1.0 / 2012-08-25 -================== - - * add options parameter to send() that is passed to fs.createReadStream() [kanongil] - -0.0.4 / 2012-08-16 -================== - - * allow custom "Accept-Ranges" definition - -0.0.3 / 2012-07-16 -================== - - * fix normalization of the root directory. Closes #3 - -0.0.2 / 2012-07-09 -================== - - * add passing of req explicitly for now (YUCK) - -0.0.1 / 2010-01-03 -================== - - * Initial release diff --git a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/send/README.md b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/send/README.md deleted file mode 100644 index fadf8383c056..000000000000 --- a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/send/README.md +++ /dev/null @@ -1,327 +0,0 @@ -# send - -[![NPM Version][npm-version-image]][npm-url] -[![NPM Downloads][npm-downloads-image]][npm-url] -[![Linux Build][github-actions-ci-image]][github-actions-ci-url] -[![Windows Build][appveyor-image]][appveyor-url] -[![Test Coverage][coveralls-image]][coveralls-url] - -Send is a library for streaming files from the file system as a http response -supporting partial responses (Ranges), conditional-GET negotiation (If-Match, -If-Unmodified-Since, If-None-Match, If-Modified-Since), high test coverage, -and granular events which may be leveraged to take appropriate actions in your -application or framework. - -Looking to serve up entire folders mapped to URLs? Try [serve-static](https://www.npmjs.org/package/serve-static). - -## Installation - -This is a [Node.js](https://nodejs.org/en/) module available through the -[npm registry](https://www.npmjs.com/). Installation is done using the -[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): - -```bash -$ npm install send -``` - -## API - -```js -var send = require('send') -``` - -### send(req, path, [options]) - -Create a new `SendStream` for the given path to send to a `res`. The `req` is -the Node.js HTTP request and the `path` is a urlencoded path to send (urlencoded, -not the actual file-system path). - -#### Options - -##### acceptRanges - -Enable or disable accepting ranged requests, defaults to true. -Disabling this will not send `Accept-Ranges` and ignore the contents -of the `Range` request header. - -##### cacheControl - -Enable or disable setting `Cache-Control` response header, defaults to -true. Disabling this will ignore the `immutable` and `maxAge` options. - -##### dotfiles - -Set how "dotfiles" are treated when encountered. A dotfile is a file -or directory that begins with a dot ("."). Note this check is done on -the path itself without checking if the path actually exists on the -disk. If `root` is specified, only the dotfiles above the root are -checked (i.e. the root itself can be within a dotfile when when set -to "deny"). - - - `'allow'` No special treatment for dotfiles. - - `'deny'` Send a 403 for any request for a dotfile. - - `'ignore'` Pretend like the dotfile does not exist and 404. - -The default value is _similar_ to `'ignore'`, with the exception that -this default will not ignore the files within a directory that begins -with a dot, for backward-compatibility. - -##### end - -Byte offset at which the stream ends, defaults to the length of the file -minus 1. The end is inclusive in the stream, meaning `end: 3` will include -the 4th byte in the stream. - -##### etag - -Enable or disable etag generation, defaults to true. - -##### extensions - -If a given file doesn't exist, try appending one of the given extensions, -in the given order. By default, this is disabled (set to `false`). An -example value that will serve extension-less HTML files: `['html', 'htm']`. -This is skipped if the requested file already has an extension. - -##### immutable - -Enable or disable the `immutable` directive in the `Cache-Control` response -header, defaults to `false`. If set to `true`, the `maxAge` option should -also be specified to enable caching. The `immutable` directive will prevent -supported clients from making conditional requests during the life of the -`maxAge` option to check if the file has changed. - -##### index - -By default send supports "index.html" files, to disable this -set `false` or to supply a new index pass a string or an array -in preferred order. - -##### lastModified - -Enable or disable `Last-Modified` header, defaults to true. Uses the file -system's last modified value. - -##### maxAge - -Provide a max-age in milliseconds for http caching, defaults to 0. -This can also be a string accepted by the -[ms](https://www.npmjs.org/package/ms#readme) module. - -##### root - -Serve files relative to `path`. - -##### start - -Byte offset at which the stream starts, defaults to 0. The start is inclusive, -meaning `start: 2` will include the 3rd byte in the stream. - -#### Events - -The `SendStream` is an event emitter and will emit the following events: - - - `error` an error occurred `(err)` - - `directory` a directory was requested `(res, path)` - - `file` a file was requested `(path, stat)` - - `headers` the headers are about to be set on a file `(res, path, stat)` - - `stream` file streaming has started `(stream)` - - `end` streaming has completed - -#### .pipe - -The `pipe` method is used to pipe the response into the Node.js HTTP response -object, typically `send(req, path, options).pipe(res)`. - -### .mime - -The `mime` export is the global instance of of the -[`mime` npm module](https://www.npmjs.com/package/mime). - -This is used to configure the MIME types that are associated with file extensions -as well as other options for how to resolve the MIME type of a file (like the -default type to use for an unknown file extension). - -## Error-handling - -By default when no `error` listeners are present an automatic response will be -made, otherwise you have full control over the response, aka you may show a 5xx -page etc. - -## Caching - -It does _not_ perform internal caching, you should use a reverse proxy cache -such as Varnish for this, or those fancy things called CDNs. If your -application is small enough that it would benefit from single-node memory -caching, it's small enough that it does not need caching at all ;). - -## Debugging - -To enable `debug()` instrumentation output export __DEBUG__: - -``` -$ DEBUG=send node app -``` - -## Running tests - -``` -$ npm install -$ npm test -``` - -## Examples - -### Serve a specific file - -This simple example will send a specific file to all requests. - -```js -var http = require('http') -var send = require('send') - -var server = http.createServer(function onRequest (req, res) { - send(req, '/path/to/index.html') - .pipe(res) -}) - -server.listen(3000) -``` - -### Serve all files from a directory - -This simple example will just serve up all the files in a -given directory as the top-level. For example, a request -`GET /foo.txt` will send back `/www/public/foo.txt`. - -```js -var http = require('http') -var parseUrl = require('parseurl') -var send = require('send') - -var server = http.createServer(function onRequest (req, res) { - send(req, parseUrl(req).pathname, { root: '/www/public' }) - .pipe(res) -}) - -server.listen(3000) -``` - -### Custom file types - -```js -var http = require('http') -var parseUrl = require('parseurl') -var send = require('send') - -// Default unknown types to text/plain -send.mime.default_type = 'text/plain' - -// Add a custom type -send.mime.define({ - 'application/x-my-type': ['x-mt', 'x-mtt'] -}) - -var server = http.createServer(function onRequest (req, res) { - send(req, parseUrl(req).pathname, { root: '/www/public' }) - .pipe(res) -}) - -server.listen(3000) -``` - -### Custom directory index view - -This is a example of serving up a structure of directories with a -custom function to render a listing of a directory. - -```js -var http = require('http') -var fs = require('fs') -var parseUrl = require('parseurl') -var send = require('send') - -// Transfer arbitrary files from within /www/example.com/public/* -// with a custom handler for directory listing -var server = http.createServer(function onRequest (req, res) { - send(req, parseUrl(req).pathname, { index: false, root: '/www/public' }) - .once('directory', directory) - .pipe(res) -}) - -server.listen(3000) - -// Custom directory handler -function directory (res, path) { - var stream = this - - // redirect to trailing slash for consistent url - if (!stream.hasTrailingSlash()) { - return stream.redirect(path) - } - - // get directory list - fs.readdir(path, function onReaddir (err, list) { - if (err) return stream.error(err) - - // render an index for the directory - res.setHeader('Content-Type', 'text/plain; charset=UTF-8') - res.end(list.join('\n') + '\n') - }) -} -``` - -### Serving from a root directory with custom error-handling - -```js -var http = require('http') -var parseUrl = require('parseurl') -var send = require('send') - -var server = http.createServer(function onRequest (req, res) { - // your custom error-handling logic: - function error (err) { - res.statusCode = err.status || 500 - res.end(err.message) - } - - // your custom headers - function headers (res, path, stat) { - // serve all files for download - res.setHeader('Content-Disposition', 'attachment') - } - - // your custom directory handling logic: - function redirect () { - res.statusCode = 301 - res.setHeader('Location', req.url + '/') - res.end('Redirecting to ' + req.url + '/') - } - - // transfer arbitrary files from within - // /www/example.com/public/* - send(req, parseUrl(req).pathname, { root: '/www/public' }) - .on('error', error) - .on('directory', redirect) - .on('headers', headers) - .pipe(res) -}) - -server.listen(3000) -``` - -## License - -[MIT](LICENSE) - -[appveyor-image]: https://badgen.net/appveyor/ci/dougwilson/send/master?label=windows -[appveyor-url]: https://ci.appveyor.com/project/dougwilson/send -[coveralls-image]: https://badgen.net/coveralls/c/github/pillarjs/send/master -[coveralls-url]: https://coveralls.io/r/pillarjs/send?branch=master -[github-actions-ci-image]: https://badgen.net/github/checks/pillarjs/send/master?label=linux -[github-actions-ci-url]: https://github.com/pillarjs/send/actions/workflows/ci.yml -[node-image]: https://badgen.net/npm/node/send -[node-url]: https://nodejs.org/en/download/ -[npm-downloads-image]: https://badgen.net/npm/dm/send -[npm-url]: https://npmjs.org/package/send -[npm-version-image]: https://badgen.net/npm/v/send diff --git a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/send/SECURITY.md b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/send/SECURITY.md deleted file mode 100644 index 46b48f7b0733..000000000000 --- a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/send/SECURITY.md +++ /dev/null @@ -1,24 +0,0 @@ -# Security Policies and Procedures - -## Reporting a Bug - -The `send` team and community take all security bugs seriously. Thank you -for improving the security of Express. We appreciate your efforts and -responsible disclosure and will make every effort to acknowledge your -contributions. - -Report security bugs by emailing the current owner(s) of `send`. This information -can be found in the npm registry using the command `npm owner ls send`. -If unsure or unable to get the information from the above, open an issue -in the [project issue tracker](https://github.com/pillarjs/send/issues) -asking for the current contact information. - -To ensure the timely response to your report, please ensure that the entirety -of the report is contained within the email body and not solely behind a web -link or an attachment. - -At least one owner will acknowledge your email within 48 hours, and will send a -more detailed response within 48 hours indicating the next steps in handling -your report. After the initial reply to your report, the owners will -endeavor to keep you informed of the progress towards a fix and full -announcement, and may ask for additional information or guidance. diff --git a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/send/index.js b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/send/index.js deleted file mode 100644 index 89afd7e584a5..000000000000 --- a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/send/index.js +++ /dev/null @@ -1,1143 +0,0 @@ -/*! - * send - * Copyright(c) 2012 TJ Holowaychuk - * Copyright(c) 2014-2022 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * Module dependencies. - * @private - */ - -var createError = require('http-errors') -var debug = require('debug')('send') -var deprecate = require('depd')('send') -var destroy = require('destroy') -var encodeUrl = require('encodeurl') -var escapeHtml = require('escape-html') -var etag = require('etag') -var fresh = require('fresh') -var fs = require('fs') -var mime = require('mime') -var ms = require('ms') -var onFinished = require('on-finished') -var parseRange = require('range-parser') -var path = require('path') -var statuses = require('statuses') -var Stream = require('stream') -var util = require('util') - -/** - * Path function references. - * @private - */ - -var extname = path.extname -var join = path.join -var normalize = path.normalize -var resolve = path.resolve -var sep = path.sep - -/** - * Regular expression for identifying a bytes Range header. - * @private - */ - -var BYTES_RANGE_REGEXP = /^ *bytes=/ - -/** - * Maximum value allowed for the max age. - * @private - */ - -var MAX_MAXAGE = 60 * 60 * 24 * 365 * 1000 // 1 year - -/** - * Regular expression to match a path with a directory up component. - * @private - */ - -var UP_PATH_REGEXP = /(?:^|[\\/])\.\.(?:[\\/]|$)/ - -/** - * Module exports. - * @public - */ - -module.exports = send -module.exports.mime = mime - -/** - * Return a `SendStream` for `req` and `path`. - * - * @param {object} req - * @param {string} path - * @param {object} [options] - * @return {SendStream} - * @public - */ - -function send (req, path, options) { - return new SendStream(req, path, options) -} - -/** - * Initialize a `SendStream` with the given `path`. - * - * @param {Request} req - * @param {String} path - * @param {object} [options] - * @private - */ - -function SendStream (req, path, options) { - Stream.call(this) - - var opts = options || {} - - this.options = opts - this.path = path - this.req = req - - this._acceptRanges = opts.acceptRanges !== undefined - ? Boolean(opts.acceptRanges) - : true - - this._cacheControl = opts.cacheControl !== undefined - ? Boolean(opts.cacheControl) - : true - - this._etag = opts.etag !== undefined - ? Boolean(opts.etag) - : true - - this._dotfiles = opts.dotfiles !== undefined - ? opts.dotfiles - : 'ignore' - - if (this._dotfiles !== 'ignore' && this._dotfiles !== 'allow' && this._dotfiles !== 'deny') { - throw new TypeError('dotfiles option must be "allow", "deny", or "ignore"') - } - - this._hidden = Boolean(opts.hidden) - - if (opts.hidden !== undefined) { - deprecate('hidden: use dotfiles: \'' + (this._hidden ? 'allow' : 'ignore') + '\' instead') - } - - // legacy support - if (opts.dotfiles === undefined) { - this._dotfiles = undefined - } - - this._extensions = opts.extensions !== undefined - ? normalizeList(opts.extensions, 'extensions option') - : [] - - this._immutable = opts.immutable !== undefined - ? Boolean(opts.immutable) - : false - - this._index = opts.index !== undefined - ? normalizeList(opts.index, 'index option') - : ['index.html'] - - this._lastModified = opts.lastModified !== undefined - ? Boolean(opts.lastModified) - : true - - this._maxage = opts.maxAge || opts.maxage - this._maxage = typeof this._maxage === 'string' - ? ms(this._maxage) - : Number(this._maxage) - this._maxage = !isNaN(this._maxage) - ? Math.min(Math.max(0, this._maxage), MAX_MAXAGE) - : 0 - - this._root = opts.root - ? resolve(opts.root) - : null - - if (!this._root && opts.from) { - this.from(opts.from) - } -} - -/** - * Inherits from `Stream`. - */ - -util.inherits(SendStream, Stream) - -/** - * Enable or disable etag generation. - * - * @param {Boolean} val - * @return {SendStream} - * @api public - */ - -SendStream.prototype.etag = deprecate.function(function etag (val) { - this._etag = Boolean(val) - debug('etag %s', this._etag) - return this -}, 'send.etag: pass etag as option') - -/** - * Enable or disable "hidden" (dot) files. - * - * @param {Boolean} path - * @return {SendStream} - * @api public - */ - -SendStream.prototype.hidden = deprecate.function(function hidden (val) { - this._hidden = Boolean(val) - this._dotfiles = undefined - debug('hidden %s', this._hidden) - return this -}, 'send.hidden: use dotfiles option') - -/** - * Set index `paths`, set to a falsy - * value to disable index support. - * - * @param {String|Boolean|Array} paths - * @return {SendStream} - * @api public - */ - -SendStream.prototype.index = deprecate.function(function index (paths) { - var index = !paths ? [] : normalizeList(paths, 'paths argument') - debug('index %o', paths) - this._index = index - return this -}, 'send.index: pass index as option') - -/** - * Set root `path`. - * - * @param {String} path - * @return {SendStream} - * @api public - */ - -SendStream.prototype.root = function root (path) { - this._root = resolve(String(path)) - debug('root %s', this._root) - return this -} - -SendStream.prototype.from = deprecate.function(SendStream.prototype.root, - 'send.from: pass root as option') - -SendStream.prototype.root = deprecate.function(SendStream.prototype.root, - 'send.root: pass root as option') - -/** - * Set max-age to `maxAge`. - * - * @param {Number} maxAge - * @return {SendStream} - * @api public - */ - -SendStream.prototype.maxage = deprecate.function(function maxage (maxAge) { - this._maxage = typeof maxAge === 'string' - ? ms(maxAge) - : Number(maxAge) - this._maxage = !isNaN(this._maxage) - ? Math.min(Math.max(0, this._maxage), MAX_MAXAGE) - : 0 - debug('max-age %d', this._maxage) - return this -}, 'send.maxage: pass maxAge as option') - -/** - * Emit error with `status`. - * - * @param {number} status - * @param {Error} [err] - * @private - */ - -SendStream.prototype.error = function error (status, err) { - // emit if listeners instead of responding - if (hasListeners(this, 'error')) { - return this.emit('error', createHttpError(status, err)) - } - - var res = this.res - var msg = statuses.message[status] || String(status) - var doc = createHtmlDocument('Error', escapeHtml(msg)) - - // clear existing headers - clearHeaders(res) - - // add error headers - if (err && err.headers) { - setHeaders(res, err.headers) - } - - // send basic response - res.statusCode = status - res.setHeader('Content-Type', 'text/html; charset=UTF-8') - res.setHeader('Content-Length', Buffer.byteLength(doc)) - res.setHeader('Content-Security-Policy', "default-src 'none'") - res.setHeader('X-Content-Type-Options', 'nosniff') - res.end(doc) -} - -/** - * Check if the pathname ends with "/". - * - * @return {boolean} - * @private - */ - -SendStream.prototype.hasTrailingSlash = function hasTrailingSlash () { - return this.path[this.path.length - 1] === '/' -} - -/** - * Check if this is a conditional GET request. - * - * @return {Boolean} - * @api private - */ - -SendStream.prototype.isConditionalGET = function isConditionalGET () { - return this.req.headers['if-match'] || - this.req.headers['if-unmodified-since'] || - this.req.headers['if-none-match'] || - this.req.headers['if-modified-since'] -} - -/** - * Check if the request preconditions failed. - * - * @return {boolean} - * @private - */ - -SendStream.prototype.isPreconditionFailure = function isPreconditionFailure () { - var req = this.req - var res = this.res - - // if-match - var match = req.headers['if-match'] - if (match) { - var etag = res.getHeader('ETag') - return !etag || (match !== '*' && parseTokenList(match).every(function (match) { - return match !== etag && match !== 'W/' + etag && 'W/' + match !== etag - })) - } - - // if-unmodified-since - var unmodifiedSince = parseHttpDate(req.headers['if-unmodified-since']) - if (!isNaN(unmodifiedSince)) { - var lastModified = parseHttpDate(res.getHeader('Last-Modified')) - return isNaN(lastModified) || lastModified > unmodifiedSince - } - - return false -} - -/** - * Strip various content header fields for a change in entity. - * - * @private - */ - -SendStream.prototype.removeContentHeaderFields = function removeContentHeaderFields () { - var res = this.res - - res.removeHeader('Content-Encoding') - res.removeHeader('Content-Language') - res.removeHeader('Content-Length') - res.removeHeader('Content-Range') - res.removeHeader('Content-Type') -} - -/** - * Respond with 304 not modified. - * - * @api private - */ - -SendStream.prototype.notModified = function notModified () { - var res = this.res - debug('not modified') - this.removeContentHeaderFields() - res.statusCode = 304 - res.end() -} - -/** - * Raise error that headers already sent. - * - * @api private - */ - -SendStream.prototype.headersAlreadySent = function headersAlreadySent () { - var err = new Error('Can\'t set headers after they are sent.') - debug('headers already sent') - this.error(500, err) -} - -/** - * Check if the request is cacheable, aka - * responded with 2xx or 304 (see RFC 2616 section 14.2{5,6}). - * - * @return {Boolean} - * @api private - */ - -SendStream.prototype.isCachable = function isCachable () { - var statusCode = this.res.statusCode - return (statusCode >= 200 && statusCode < 300) || - statusCode === 304 -} - -/** - * Handle stat() error. - * - * @param {Error} error - * @private - */ - -SendStream.prototype.onStatError = function onStatError (error) { - switch (error.code) { - case 'ENAMETOOLONG': - case 'ENOENT': - case 'ENOTDIR': - this.error(404, error) - break - default: - this.error(500, error) - break - } -} - -/** - * Check if the cache is fresh. - * - * @return {Boolean} - * @api private - */ - -SendStream.prototype.isFresh = function isFresh () { - return fresh(this.req.headers, { - etag: this.res.getHeader('ETag'), - 'last-modified': this.res.getHeader('Last-Modified') - }) -} - -/** - * Check if the range is fresh. - * - * @return {Boolean} - * @api private - */ - -SendStream.prototype.isRangeFresh = function isRangeFresh () { - var ifRange = this.req.headers['if-range'] - - if (!ifRange) { - return true - } - - // if-range as etag - if (ifRange.indexOf('"') !== -1) { - var etag = this.res.getHeader('ETag') - return Boolean(etag && ifRange.indexOf(etag) !== -1) - } - - // if-range as modified date - var lastModified = this.res.getHeader('Last-Modified') - return parseHttpDate(lastModified) <= parseHttpDate(ifRange) -} - -/** - * Redirect to path. - * - * @param {string} path - * @private - */ - -SendStream.prototype.redirect = function redirect (path) { - var res = this.res - - if (hasListeners(this, 'directory')) { - this.emit('directory', res, path) - return - } - - if (this.hasTrailingSlash()) { - this.error(403) - return - } - - var loc = encodeUrl(collapseLeadingSlashes(this.path + '/')) - var doc = createHtmlDocument('Redirecting', 'Redirecting to ' + - escapeHtml(loc) + '') - - // redirect - res.statusCode = 301 - res.setHeader('Content-Type', 'text/html; charset=UTF-8') - res.setHeader('Content-Length', Buffer.byteLength(doc)) - res.setHeader('Content-Security-Policy', "default-src 'none'") - res.setHeader('X-Content-Type-Options', 'nosniff') - res.setHeader('Location', loc) - res.end(doc) -} - -/** - * Pipe to `res. - * - * @param {Stream} res - * @return {Stream} res - * @api public - */ - -SendStream.prototype.pipe = function pipe (res) { - // root path - var root = this._root - - // references - this.res = res - - // decode the path - var path = decode(this.path) - if (path === -1) { - this.error(400) - return res - } - - // null byte(s) - if (~path.indexOf('\0')) { - this.error(400) - return res - } - - var parts - if (root !== null) { - // normalize - if (path) { - path = normalize('.' + sep + path) - } - - // malicious path - if (UP_PATH_REGEXP.test(path)) { - debug('malicious path "%s"', path) - this.error(403) - return res - } - - // explode path parts - parts = path.split(sep) - - // join / normalize from optional root dir - path = normalize(join(root, path)) - } else { - // ".." is malicious without "root" - if (UP_PATH_REGEXP.test(path)) { - debug('malicious path "%s"', path) - this.error(403) - return res - } - - // explode path parts - parts = normalize(path).split(sep) - - // resolve the path - path = resolve(path) - } - - // dotfile handling - if (containsDotFile(parts)) { - var access = this._dotfiles - - // legacy support - if (access === undefined) { - access = parts[parts.length - 1][0] === '.' - ? (this._hidden ? 'allow' : 'ignore') - : 'allow' - } - - debug('%s dotfile "%s"', access, path) - switch (access) { - case 'allow': - break - case 'deny': - this.error(403) - return res - case 'ignore': - default: - this.error(404) - return res - } - } - - // index file support - if (this._index.length && this.hasTrailingSlash()) { - this.sendIndex(path) - return res - } - - this.sendFile(path) - return res -} - -/** - * Transfer `path`. - * - * @param {String} path - * @api public - */ - -SendStream.prototype.send = function send (path, stat) { - var len = stat.size - var options = this.options - var opts = {} - var res = this.res - var req = this.req - var ranges = req.headers.range - var offset = options.start || 0 - - if (headersSent(res)) { - // impossible to send now - this.headersAlreadySent() - return - } - - debug('pipe "%s"', path) - - // set header fields - this.setHeader(path, stat) - - // set content-type - this.type(path) - - // conditional GET support - if (this.isConditionalGET()) { - if (this.isPreconditionFailure()) { - this.error(412) - return - } - - if (this.isCachable() && this.isFresh()) { - this.notModified() - return - } - } - - // adjust len to start/end options - len = Math.max(0, len - offset) - if (options.end !== undefined) { - var bytes = options.end - offset + 1 - if (len > bytes) len = bytes - } - - // Range support - if (this._acceptRanges && BYTES_RANGE_REGEXP.test(ranges)) { - // parse - ranges = parseRange(len, ranges, { - combine: true - }) - - // If-Range support - if (!this.isRangeFresh()) { - debug('range stale') - ranges = -2 - } - - // unsatisfiable - if (ranges === -1) { - debug('range unsatisfiable') - - // Content-Range - res.setHeader('Content-Range', contentRange('bytes', len)) - - // 416 Requested Range Not Satisfiable - return this.error(416, { - headers: { 'Content-Range': res.getHeader('Content-Range') } - }) - } - - // valid (syntactically invalid/multiple ranges are treated as a regular response) - if (ranges !== -2 && ranges.length === 1) { - debug('range %j', ranges) - - // Content-Range - res.statusCode = 206 - res.setHeader('Content-Range', contentRange('bytes', len, ranges[0])) - - // adjust for requested range - offset += ranges[0].start - len = ranges[0].end - ranges[0].start + 1 - } - } - - // clone options - for (var prop in options) { - opts[prop] = options[prop] - } - - // set read options - opts.start = offset - opts.end = Math.max(offset, offset + len - 1) - - // content-length - res.setHeader('Content-Length', len) - - // HEAD support - if (req.method === 'HEAD') { - res.end() - return - } - - this.stream(path, opts) -} - -/** - * Transfer file for `path`. - * - * @param {String} path - * @api private - */ -SendStream.prototype.sendFile = function sendFile (path) { - var i = 0 - var self = this - - debug('stat "%s"', path) - fs.stat(path, function onstat (err, stat) { - if (err && err.code === 'ENOENT' && !extname(path) && path[path.length - 1] !== sep) { - // not found, check extensions - return next(err) - } - if (err) return self.onStatError(err) - if (stat.isDirectory()) return self.redirect(path) - self.emit('file', path, stat) - self.send(path, stat) - }) - - function next (err) { - if (self._extensions.length <= i) { - return err - ? self.onStatError(err) - : self.error(404) - } - - var p = path + '.' + self._extensions[i++] - - debug('stat "%s"', p) - fs.stat(p, function (err, stat) { - if (err) return next(err) - if (stat.isDirectory()) return next() - self.emit('file', p, stat) - self.send(p, stat) - }) - } -} - -/** - * Transfer index for `path`. - * - * @param {String} path - * @api private - */ -SendStream.prototype.sendIndex = function sendIndex (path) { - var i = -1 - var self = this - - function next (err) { - if (++i >= self._index.length) { - if (err) return self.onStatError(err) - return self.error(404) - } - - var p = join(path, self._index[i]) - - debug('stat "%s"', p) - fs.stat(p, function (err, stat) { - if (err) return next(err) - if (stat.isDirectory()) return next() - self.emit('file', p, stat) - self.send(p, stat) - }) - } - - next() -} - -/** - * Stream `path` to the response. - * - * @param {String} path - * @param {Object} options - * @api private - */ - -SendStream.prototype.stream = function stream (path, options) { - var self = this - var res = this.res - - // pipe - var stream = fs.createReadStream(path, options) - this.emit('stream', stream) - stream.pipe(res) - - // cleanup - function cleanup () { - destroy(stream, true) - } - - // response finished, cleanup - onFinished(res, cleanup) - - // error handling - stream.on('error', function onerror (err) { - // clean up stream early - cleanup() - - // error - self.onStatError(err) - }) - - // end - stream.on('end', function onend () { - self.emit('end') - }) -} - -/** - * Set content-type based on `path` - * if it hasn't been explicitly set. - * - * @param {String} path - * @api private - */ - -SendStream.prototype.type = function type (path) { - var res = this.res - - if (res.getHeader('Content-Type')) return - - var type = mime.lookup(path) - - if (!type) { - debug('no content-type') - return - } - - var charset = mime.charsets.lookup(type) - - debug('content-type %s', type) - res.setHeader('Content-Type', type + (charset ? '; charset=' + charset : '')) -} - -/** - * Set response header fields, most - * fields may be pre-defined. - * - * @param {String} path - * @param {Object} stat - * @api private - */ - -SendStream.prototype.setHeader = function setHeader (path, stat) { - var res = this.res - - this.emit('headers', res, path, stat) - - if (this._acceptRanges && !res.getHeader('Accept-Ranges')) { - debug('accept ranges') - res.setHeader('Accept-Ranges', 'bytes') - } - - if (this._cacheControl && !res.getHeader('Cache-Control')) { - var cacheControl = 'public, max-age=' + Math.floor(this._maxage / 1000) - - if (this._immutable) { - cacheControl += ', immutable' - } - - debug('cache-control %s', cacheControl) - res.setHeader('Cache-Control', cacheControl) - } - - if (this._lastModified && !res.getHeader('Last-Modified')) { - var modified = stat.mtime.toUTCString() - debug('modified %s', modified) - res.setHeader('Last-Modified', modified) - } - - if (this._etag && !res.getHeader('ETag')) { - var val = etag(stat) - debug('etag %s', val) - res.setHeader('ETag', val) - } -} - -/** - * Clear all headers from a response. - * - * @param {object} res - * @private - */ - -function clearHeaders (res) { - var headers = getHeaderNames(res) - - for (var i = 0; i < headers.length; i++) { - res.removeHeader(headers[i]) - } -} - -/** - * Collapse all leading slashes into a single slash - * - * @param {string} str - * @private - */ -function collapseLeadingSlashes (str) { - for (var i = 0; i < str.length; i++) { - if (str[i] !== '/') { - break - } - } - - return i > 1 - ? '/' + str.substr(i) - : str -} - -/** - * Determine if path parts contain a dotfile. - * - * @api private - */ - -function containsDotFile (parts) { - for (var i = 0; i < parts.length; i++) { - var part = parts[i] - if (part.length > 1 && part[0] === '.') { - return true - } - } - - return false -} - -/** - * Create a Content-Range header. - * - * @param {string} type - * @param {number} size - * @param {array} [range] - */ - -function contentRange (type, size, range) { - return type + ' ' + (range ? range.start + '-' + range.end : '*') + '/' + size -} - -/** - * Create a minimal HTML document. - * - * @param {string} title - * @param {string} body - * @private - */ - -function createHtmlDocument (title, body) { - return '\n' + - '\n' + - '\n' + - '\n' + - '' + title + '\n' + - '\n' + - '\n' + - '
' + body + '
\n' + - '\n' + - '\n' -} - -/** - * Create a HttpError object from simple arguments. - * - * @param {number} status - * @param {Error|object} err - * @private - */ - -function createHttpError (status, err) { - if (!err) { - return createError(status) - } - - return err instanceof Error - ? createError(status, err, { expose: false }) - : createError(status, err) -} - -/** - * decodeURIComponent. - * - * Allows V8 to only deoptimize this fn instead of all - * of send(). - * - * @param {String} path - * @api private - */ - -function decode (path) { - try { - return decodeURIComponent(path) - } catch (err) { - return -1 - } -} - -/** - * Get the header names on a respnse. - * - * @param {object} res - * @returns {array[string]} - * @private - */ - -function getHeaderNames (res) { - return typeof res.getHeaderNames !== 'function' - ? Object.keys(res._headers || {}) - : res.getHeaderNames() -} - -/** - * Determine if emitter has listeners of a given type. - * - * The way to do this check is done three different ways in Node.js >= 0.8 - * so this consolidates them into a minimal set using instance methods. - * - * @param {EventEmitter} emitter - * @param {string} type - * @returns {boolean} - * @private - */ - -function hasListeners (emitter, type) { - var count = typeof emitter.listenerCount !== 'function' - ? emitter.listeners(type).length - : emitter.listenerCount(type) - - return count > 0 -} - -/** - * Determine if the response headers have been sent. - * - * @param {object} res - * @returns {boolean} - * @private - */ - -function headersSent (res) { - return typeof res.headersSent !== 'boolean' - ? Boolean(res._header) - : res.headersSent -} - -/** - * Normalize the index option into an array. - * - * @param {boolean|string|array} val - * @param {string} name - * @private - */ - -function normalizeList (val, name) { - var list = [].concat(val || []) - - for (var i = 0; i < list.length; i++) { - if (typeof list[i] !== 'string') { - throw new TypeError(name + ' must be array of strings or false') - } - } - - return list -} - -/** - * Parse an HTTP Date into a number. - * - * @param {string} date - * @private - */ - -function parseHttpDate (date) { - var timestamp = date && Date.parse(date) - - return typeof timestamp === 'number' - ? timestamp - : NaN -} - -/** - * Parse a HTTP token list. - * - * @param {string} str - * @private - */ - -function parseTokenList (str) { - var end = 0 - var list = [] - var start = 0 - - // gather tokens - for (var i = 0, len = str.length; i < len; i++) { - switch (str.charCodeAt(i)) { - case 0x20: /* */ - if (start === end) { - start = end = i + 1 - } - break - case 0x2c: /* , */ - if (start !== end) { - list.push(str.substring(start, end)) - } - start = end = i + 1 - break - default: - end = i + 1 - break - } - } - - // final token - if (start !== end) { - list.push(str.substring(start, end)) - } - - return list -} - -/** - * Set an object of headers on a response. - * - * @param {object} res - * @param {object} headers - * @private - */ - -function setHeaders (res, headers) { - var keys = Object.keys(headers) - - for (var i = 0; i < keys.length; i++) { - var key = keys[i] - res.setHeader(key, headers[key]) - } -} diff --git a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/send/package.json b/Modules/Chatroom/chat/node_modules/serve-static/node_modules/send/package.json deleted file mode 100644 index 7f269d515c8b..000000000000 --- a/Modules/Chatroom/chat/node_modules/serve-static/node_modules/send/package.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "name": "send", - "description": "Better streaming static file server with Range and conditional-GET support", - "version": "0.18.0", - "author": "TJ Holowaychuk ", - "contributors": [ - "Douglas Christopher Wilson ", - "James Wyatt Cready ", - "Jesús Leganés Combarro " - ], - "license": "MIT", - "repository": "pillarjs/send", - "keywords": [ - "static", - "file", - "server" - ], - "dependencies": { - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "1.2.0", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "fresh": "0.5.2", - "http-errors": "2.0.0", - "mime": "1.6.0", - "ms": "2.1.3", - "on-finished": "2.4.1", - "range-parser": "~1.2.1", - "statuses": "2.0.1" - }, - "devDependencies": { - "after": "0.8.2", - "eslint": "7.32.0", - "eslint-config-standard": "14.1.1", - "eslint-plugin-import": "2.25.4", - "eslint-plugin-markdown": "2.2.1", - "eslint-plugin-node": "11.1.0", - "eslint-plugin-promise": "5.2.0", - "eslint-plugin-standard": "4.1.0", - "mocha": "9.2.2", - "nyc": "15.1.0", - "supertest": "6.2.2" - }, - "files": [ - "HISTORY.md", - "LICENSE", - "README.md", - "SECURITY.md", - "index.js" - ], - "engines": { - "node": ">= 0.8.0" - }, - "scripts": { - "lint": "eslint .", - "test": "mocha --check-leaks --reporter spec --bail", - "test-ci": "nyc --reporter=lcov --reporter=text npm test", - "test-cov": "nyc --reporter=html --reporter=text npm test" - } -} diff --git a/Modules/Chatroom/chat/node_modules/serve-static/package.json b/Modules/Chatroom/chat/node_modules/serve-static/package.json index 47d9789e25cb..49d7542351e8 100644 --- a/Modules/Chatroom/chat/node_modules/serve-static/package.json +++ b/Modules/Chatroom/chat/node_modules/serve-static/package.json @@ -1,15 +1,15 @@ { "name": "serve-static", "description": "Serve static files", - "version": "1.16.0", + "version": "1.16.2", "author": "Douglas Christopher Wilson ", "license": "MIT", "repository": "expressjs/serve-static", "dependencies": { - "encodeurl": "~1.0.2", + "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "parseurl": "~1.3.3", - "send": "0.18.0" + "send": "0.19.0" }, "devDependencies": { "eslint": "7.32.0", diff --git a/Modules/Chatroom/chat/package-lock.json b/Modules/Chatroom/chat/package-lock.json index ff57fe338434..3271ddebd234 100644 --- a/Modules/Chatroom/chat/package-lock.json +++ b/Modules/Chatroom/chat/package-lock.json @@ -9,7 +9,7 @@ "version": "2.0.0", "dependencies": { "async": "^3.2", - "express": "^4.20.0", + "express": "^4.21.0", "mysql": "^2.18.1", "node-mysql": "^0.4.2", "node-schedule": "^2.1.0", @@ -124,20 +124,6 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" }, - "node_modules/body-parser/node_modules/qs": { - "version": "6.13.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", - "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", - "dependencies": { - "side-channel": "^1.0.6" - }, - "engines": { - "node": ">=0.6" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/bytes": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", @@ -451,9 +437,9 @@ } }, "node_modules/express": { - "version": "4.20.0", - "resolved": "https://registry.npmjs.org/express/-/express-4.20.0.tgz", - "integrity": "sha512-pLdae7I6QqShF5PnNTCVn4hI91Dx0Grkn2+IAsMTgMIKuQVte2dN9PeGSSAME2FR8anOhVA62QDIUaWVfEXVLw==", + "version": "4.21.0", + "resolved": "https://registry.npmjs.org/express/-/express-4.21.0.tgz", + "integrity": "sha512-VqcNGcj/Id5ZT1LZ/cfihi3ttTn+NJmkli2eZADigjq29qTlWi/hAQ43t/VLPq8+UX06FCEx3ByOYet6ZFblng==", "dependencies": { "accepts": "~1.3.8", "array-flatten": "1.1.1", @@ -467,7 +453,7 @@ "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "etag": "~1.8.1", - "finalhandler": "1.2.0", + "finalhandler": "1.3.1", "fresh": "0.5.2", "http-errors": "2.0.0", "merge-descriptors": "1.0.3", @@ -476,11 +462,11 @@ "parseurl": "~1.3.3", "path-to-regexp": "0.1.10", "proxy-addr": "~2.0.7", - "qs": "6.11.0", + "qs": "6.13.0", "range-parser": "~1.2.1", "safe-buffer": "5.2.1", "send": "0.19.0", - "serve-static": "1.16.0", + "serve-static": "1.16.2", "setprototypeof": "1.2.0", "statuses": "2.0.1", "type-is": "~1.6.18", @@ -548,12 +534,12 @@ } }, "node_modules/finalhandler": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", - "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.1.tgz", + "integrity": "sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ==", "dependencies": { "debug": "2.6.9", - "encodeurl": "~1.0.2", + "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "on-finished": "2.4.1", "parseurl": "~1.3.3", @@ -572,6 +558,14 @@ "ms": "2.0.0" } }, + "node_modules/finalhandler/node_modules/encodeurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", + "engines": { + "node": ">= 0.8" + } + }, "node_modules/finalhandler/node_modules/ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", @@ -934,11 +928,11 @@ } }, "node_modules/qs": { - "version": "6.11.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", - "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", + "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", "dependencies": { - "side-channel": "^1.0.4" + "side-channel": "^1.0.6" }, "engines": { "node": ">=0.6" @@ -1035,58 +1029,25 @@ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" }, "node_modules/serve-static": { - "version": "1.16.0", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.0.tgz", - "integrity": "sha512-pDLK8zwl2eKaYrs8mrPZBJua4hMplRWJ1tIFksVC3FtBEBnl8dxgeHtsaMS8DhS9i4fLObaon6ABoc4/hQGdPA==", + "version": "1.16.2", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.2.tgz", + "integrity": "sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==", "dependencies": { - "encodeurl": "~1.0.2", + "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "parseurl": "~1.3.3", - "send": "0.18.0" + "send": "0.19.0" }, "engines": { "node": ">= 0.8.0" } }, - "node_modules/serve-static/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/serve-static/node_modules/debug/node_modules/ms": { + "node_modules/serve-static/node_modules/encodeurl": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" - }, - "node_modules/serve-static/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" - }, - "node_modules/serve-static/node_modules/send": { - "version": "0.18.0", - "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", - "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", - "dependencies": { - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "1.2.0", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "fresh": "0.5.2", - "http-errors": "2.0.0", - "mime": "1.6.0", - "ms": "2.1.3", - "on-finished": "2.4.1", - "range-parser": "~1.2.1", - "statuses": "2.0.1" - }, + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", "engines": { - "node": ">= 0.8.0" + "node": ">= 0.8" } }, "node_modules/set-function-length": { @@ -1416,14 +1377,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" - }, - "qs": { - "version": "6.13.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", - "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", - "requires": { - "side-channel": "^1.0.6" - } } } }, @@ -1632,9 +1585,9 @@ "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==" }, "express": { - "version": "4.20.0", - "resolved": "https://registry.npmjs.org/express/-/express-4.20.0.tgz", - "integrity": "sha512-pLdae7I6QqShF5PnNTCVn4hI91Dx0Grkn2+IAsMTgMIKuQVte2dN9PeGSSAME2FR8anOhVA62QDIUaWVfEXVLw==", + "version": "4.21.0", + "resolved": "https://registry.npmjs.org/express/-/express-4.21.0.tgz", + "integrity": "sha512-VqcNGcj/Id5ZT1LZ/cfihi3ttTn+NJmkli2eZADigjq29qTlWi/hAQ43t/VLPq8+UX06FCEx3ByOYet6ZFblng==", "requires": { "accepts": "~1.3.8", "array-flatten": "1.1.1", @@ -1648,7 +1601,7 @@ "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "etag": "~1.8.1", - "finalhandler": "1.2.0", + "finalhandler": "1.3.1", "fresh": "0.5.2", "http-errors": "2.0.0", "merge-descriptors": "1.0.3", @@ -1657,11 +1610,11 @@ "parseurl": "~1.3.3", "path-to-regexp": "0.1.10", "proxy-addr": "~2.0.7", - "qs": "6.11.0", + "qs": "6.13.0", "range-parser": "~1.2.1", "safe-buffer": "5.2.1", "send": "0.19.0", - "serve-static": "1.16.0", + "serve-static": "1.16.2", "setprototypeof": "1.2.0", "statuses": "2.0.1", "type-is": "~1.6.18", @@ -1705,12 +1658,12 @@ "integrity": "sha1-Ys8SAjTGg3hdkCNIqADvPgzCC8A=" }, "finalhandler": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", - "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.1.tgz", + "integrity": "sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ==", "requires": { "debug": "2.6.9", - "encodeurl": "~1.0.2", + "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "on-finished": "2.4.1", "parseurl": "~1.3.3", @@ -1726,6 +1679,11 @@ "ms": "2.0.0" } }, + "encodeurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==" + }, "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", @@ -1981,11 +1939,11 @@ } }, "qs": { - "version": "6.11.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", - "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", + "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", "requires": { - "side-channel": "^1.0.4" + "side-channel": "^1.0.6" } }, "range-parser": { @@ -2071,55 +2029,20 @@ } }, "serve-static": { - "version": "1.16.0", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.0.tgz", - "integrity": "sha512-pDLK8zwl2eKaYrs8mrPZBJua4hMplRWJ1tIFksVC3FtBEBnl8dxgeHtsaMS8DhS9i4fLObaon6ABoc4/hQGdPA==", + "version": "1.16.2", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.2.tgz", + "integrity": "sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==", "requires": { - "encodeurl": "~1.0.2", + "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "parseurl": "~1.3.3", - "send": "0.18.0" + "send": "0.19.0" }, "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "requires": { - "ms": "2.0.0" - }, - "dependencies": { - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" - } - } - }, - "ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" - }, - "send": { - "version": "0.18.0", - "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", - "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", - "requires": { - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "1.2.0", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "fresh": "0.5.2", - "http-errors": "2.0.0", - "mime": "1.6.0", - "ms": "2.1.3", - "on-finished": "2.4.1", - "range-parser": "~1.2.1", - "statuses": "2.0.1" - } + "encodeurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==" } } }, diff --git a/Modules/Chatroom/chat/package.json b/Modules/Chatroom/chat/package.json index 01109f2a883f..c5141b32cd34 100644 --- a/Modules/Chatroom/chat/package.json +++ b/Modules/Chatroom/chat/package.json @@ -4,7 +4,7 @@ "version": "2.0.0", "dependencies": { "async": "^3.2", - "express": "^4.20.0", + "express": "^4.21.0", "mysql": "^2.18.1", "node-mysql": "^0.4.2", "node-schedule": "^2.1.0", From f1019c7bddb8e5796988054a13bf12b81f545f83 Mon Sep 17 00:00:00 2001 From: iszmais <45942348+iszmais@users.noreply.github.com> Date: Mon, 16 Sep 2024 10:48:39 +0200 Subject: [PATCH 051/292] CI: Fix php-cs-fixer config (#8071) --- CI/PHP-CS-Fixer/code-format.php_cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CI/PHP-CS-Fixer/code-format.php_cs b/CI/PHP-CS-Fixer/code-format.php_cs index 343c0610a853..136786ff70bb 100644 --- a/CI/PHP-CS-Fixer/code-format.php_cs +++ b/CI/PHP-CS-Fixer/code-format.php_cs @@ -24,6 +24,6 @@ return (new PhpCsFixer\Config()) 'strict_param' => false, 'cast_spaces' => true, 'concat_space' => ['spacing' => 'one'], - 'function_typehint_space' => true + 'type_declaration_spaces' => true ]) ->setFinder($finder); From 4679c37b9511a244829c48ecbbdafc886b380f10 Mon Sep 17 00:00:00 2001 From: mjansen Date: Mon, 16 Sep 2024 13:30:33 +0200 Subject: [PATCH 052/292] Search: Fix PHP type when calling `ilSearchAutoComplete::checkObjectPermission` --- Services/Search/classes/class.ilSearchAutoComplete.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Services/Search/classes/class.ilSearchAutoComplete.php b/Services/Search/classes/class.ilSearchAutoComplete.php index 4115b6f8bf1a..fd99e72fef9a 100644 --- a/Services/Search/classes/class.ilSearchAutoComplete.php +++ b/Services/Search/classes/class.ilSearchAutoComplete.php @@ -114,7 +114,7 @@ public static function getList(string $a_str): string $rec["keyword"] = '"' . $rec["keyword"] . '"'; } if (!in_array($rec["keyword"], $list) && !in_array($rec["rbac_id"], $checked)) { - if (ilSearchAutoComplete::checkObjectPermission($rec["rbac_id"])) { + if (ilSearchAutoComplete::checkObjectPermission((int) $rec["rbac_id"])) { $list[] = $lim . $rec["keyword"]; $cnt++; } From 5e1951511b7d29928902c186e77606296fbbc149 Mon Sep 17 00:00:00 2001 From: Thomas Famula Date: Tue, 17 Sep 2024 13:41:23 +0200 Subject: [PATCH 053/292] 42084: Competence view for Staff is faulty --- .../Skills/class.ilMStListCompetencesSkills.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Services/MyStaff/classes/ListCompetences/Skills/class.ilMStListCompetencesSkills.php b/Services/MyStaff/classes/ListCompetences/Skills/class.ilMStListCompetencesSkills.php index 5f52ba47b454..fcd354c6cc83 100644 --- a/Services/MyStaff/classes/ListCompetences/Skills/class.ilMStListCompetencesSkills.php +++ b/Services/MyStaff/classes/ListCompetences/Skills/class.ilMStListCompetencesSkills.php @@ -46,14 +46,14 @@ final public function getData(array $options): ListFetcherResult //Permission Filter $operation_access = ilOrgUnitOperation::OP_VIEW_COMPETENCES; - $select = 'SELECT sktree.title as skill_title, skill_node_id, ulvl.trigger_obj_id, user_id, login, firstname, lastname, email, lvl.title as skill_level'; + $select = 'SELECT sktree.title as skill_title, skill_node_id, ulvl.trigger_obj_id, ulvl.user_id, login, firstname, lastname, email, lvl.title as skill_level'; $query = $select . ' FROM skl_personal_skill sk ' . ' INNER JOIN usr_data ud ON ud.usr_id = sk.user_id ' . ' INNER JOIN skl_tree_node sktree ON sktree.obj_id = sk.skill_node_id ' . - ' INNER JOIN (SELECT trigger_obj_id, skill_id, MAX(level_id) AS level_id ' . - ' FROM skl_user_has_level WHERE self_eval = 0 GROUP BY skill_id) ulvl ON sk.skill_node_id = ulvl.skill_id ' . + ' INNER JOIN (SELECT user_id, trigger_obj_id, skill_id, MAX(level_id) AS level_id ' . + ' FROM skl_user_has_level WHERE self_eval = 0 GROUP BY skill_id, user_id) ulvl ON sk.skill_node_id = ulvl.skill_id AND sk.user_id = ulvl.user_id ' . ' INNER JOIN skl_level lvl ON lvl.id = ulvl.level_id ' . ' WHERE '; From c5084e3202771695f61071a56e3d97d36e0ea9c5 Mon Sep 17 00:00:00 2001 From: mjansen Date: Fri, 6 Sep 2024 11:49:36 +0200 Subject: [PATCH 054/292] Registration: Interpret code as invalid if absolute expiration date is reached See: https://mantis.ilias.de/view.php?id=34021 --- .../classes/class.ilRegistrationCode.php | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/Services/Registration/classes/class.ilRegistrationCode.php b/Services/Registration/classes/class.ilRegistrationCode.php index ad94adcc95ad..b89022a6a1ed 100644 --- a/Services/Registration/classes/class.ilRegistrationCode.php +++ b/Services/Registration/classes/class.ilRegistrationCode.php @@ -246,13 +246,29 @@ public static function isValidRegistrationCode(string $a_code): bool $ilDB = $DIC->database(); - $query = 'SELECT code_id FROM reg_registration_codes ' . + $query = 'SELECT alimit, alimitdt FROM reg_registration_codes ' . 'WHERE used = ' . $ilDB->quote(0, 'integer') . ' ' . 'AND reg_enabled = ' . $ilDB->quote(1, 'integer') . ' ' . 'AND code = ' . $ilDB->quote($a_code, 'text'); $res = $ilDB->query($query); + if ($ilDB->numRows($res) !== 1) { + return false; + } + + $is_valid = true; + + $row = $ilDB->fetchAssoc($res); + if ($row['alimit'] === 'absolute') { + $clock_factory = (new \ILIAS\Data\Factory())->clock(); + $right_interval = new DateTimeImmutable( + $row['alimitdt'], + $clock_factory->system()->now()->getTimezone() + ); + + $is_valid = $right_interval >= $clock_factory->system()->now(); + } - return (bool) $res->numRows(); + return $is_valid; } public static function useCode(string $code): bool From 6ef2c88bc9757a8bf9207273758cd1d4c8a2f087 Mon Sep 17 00:00:00 2001 From: Alex Killing Date: Wed, 18 Sep 2024 17:17:25 +0200 Subject: [PATCH 055/292] 41063: Error for categories with references to deleted objects --- .../classes/class.ilObjCategoryReferenceListGUI.php | 2 +- .../classes/class.ilObjCourseReferenceListGUI.php | 2 +- .../GroupReference/classes/class.ilObjGroupReferenceListGUI.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Modules/CategoryReference/classes/class.ilObjCategoryReferenceListGUI.php b/Modules/CategoryReference/classes/class.ilObjCategoryReferenceListGUI.php index 760b84c50afb..3dfcc6bf394b 100644 --- a/Modules/CategoryReference/classes/class.ilObjCategoryReferenceListGUI.php +++ b/Modules/CategoryReference/classes/class.ilObjCategoryReferenceListGUI.php @@ -111,7 +111,7 @@ public function initItem( $target_title = ilContainerReference::_lookupTitle($obj_id); $target_description = ilObject::_lookupDescription($target_obj_id); - $this->deleted = $tree->isDeleted($target_ref_id); + $this->deleted = !$target_ref_id || $tree->isDeleted($target_ref_id); parent::initItem($target_ref_id, $target_obj_id, $type, $target_title, $target_description); diff --git a/Modules/CourseReference/classes/class.ilObjCourseReferenceListGUI.php b/Modules/CourseReference/classes/class.ilObjCourseReferenceListGUI.php index 3dba9e2d1568..d6ed122c26bd 100644 --- a/Modules/CourseReference/classes/class.ilObjCourseReferenceListGUI.php +++ b/Modules/CourseReference/classes/class.ilObjCourseReferenceListGUI.php @@ -128,7 +128,7 @@ public function initItem( $target_title = ilContainerReference::_lookupTitle($obj_id); $target_description = ilObject::_lookupDescription($target_obj_id); - $this->deleted = $tree->isDeleted($target_ref_id); + $this->deleted = !$target_ref_id || $tree->isDeleted($target_ref_id); $ilBench->start("ilObjCourseListGUI", "1000_checkAllConditions"); $this->conditions_ok = ilConditionHandler::_checkAllConditionsOfTarget($target_ref_id, $target_obj_id); diff --git a/Modules/GroupReference/classes/class.ilObjGroupReferenceListGUI.php b/Modules/GroupReference/classes/class.ilObjGroupReferenceListGUI.php index 672832ebbd4f..c72263528a61 100644 --- a/Modules/GroupReference/classes/class.ilObjGroupReferenceListGUI.php +++ b/Modules/GroupReference/classes/class.ilObjGroupReferenceListGUI.php @@ -117,7 +117,7 @@ public function initItem( $target_title = ilContainerReference::_lookupTitle($obj_id); $target_description = ilObject::_lookupDescription($target_obj_id); - $this->deleted = $tree->isDeleted($target_ref_id); + $this->deleted = !$target_ref_id || $tree->isDeleted($target_ref_id); $this->conditions_ok = ilConditionHandler::_checkAllConditionsOfTarget($target_ref_id, $target_obj_id); From d10900dcf3b7aa9e4517de7abe252c5c619e11a9 Mon Sep 17 00:00:00 2001 From: Michael Jansen Date: Wed, 18 Sep 2024 17:37:57 +0200 Subject: [PATCH 056/292] MediaObject: Make `WAC` checking instance more robust against indeterminable usages (#8013) See: https://mantis.ilias.de/view.php?id=41981 --- .../classes/class.ilObjMediaObjectAccess.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/Services/MediaObjects/classes/class.ilObjMediaObjectAccess.php b/Services/MediaObjects/classes/class.ilObjMediaObjectAccess.php index 75ecd7b20be4..57915fb47083 100644 --- a/Services/MediaObjects/classes/class.ilObjMediaObjectAccess.php +++ b/Services/MediaObjects/classes/class.ilObjMediaObjectAccess.php @@ -25,6 +25,7 @@ class ilObjMediaObjectAccess implements ilWACCheckingClass protected ilObjectDataCache $obj_data_cache; protected ilObjUser $user; protected ilAccessHandler $access; + protected ilLogger $logger; public function __construct() { @@ -33,6 +34,7 @@ public function __construct() $this->obj_data_cache = $DIC["ilObjDataCache"]; $this->user = $DIC->user(); $this->access = $DIC->access(); + $this->logger = $DIC->logger()->mob(); } public function canBeDelivered(ilWACPath $ilWACPath): bool @@ -69,11 +71,20 @@ protected function checkAccessMob( return true; } break; - + default: - if ($this->checkAccessMobUsage($usage, $oid)) { + if ($oid !== null && $this->checkAccessMobUsage($usage, $oid)) { return true; } + + if ($oid === null) { + $this->logger->error( + sprintf( + "Could not determine parent obj_id for usage: %s", + json_encode($usage, JSON_THROW_ON_ERROR | JSON_PRETTY_PRINT) + ) + ); + } break; } } From d3e02a782bf2f9f9b8dabf71cbab32e917327e82 Mon Sep 17 00:00:00 2001 From: mjansen Date: Thu, 19 Sep 2024 11:45:02 +0200 Subject: [PATCH 057/292] OnScreenChat: Log error in case no main bar item is active --- Services/OnScreenChat/js/onscreenchat.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Services/OnScreenChat/js/onscreenchat.js b/Services/OnScreenChat/js/onscreenchat.js index e582efb95827..64549b065bab 100644 --- a/Services/OnScreenChat/js/onscreenchat.js +++ b/Services/OnScreenChat/js/onscreenchat.js @@ -418,6 +418,11 @@ let xhr = new XMLHttpRequest(); xhr.open('GET', getConfig().renderConversationItemsURL + '&ids=' + conversationIds); xhr.onload = function () { + if (getModule().menuCollector === undefined) { + console.error("No menu collector found in the UI, please ensure the main bar item is enabled in the ILIAS administration!"); + return; + } + if (xhr.status === 200) { getModule().menuCollector.innerHTML = xhr.responseText; getModule().menuCollector.querySelectorAll('script').forEach(element => { @@ -430,7 +435,7 @@ .on('click', '[data-id]', $scope.il.OnScreenChatJQueryTriggers.triggers.menuItemClicked) .on('click', '[data-id] .close', $scope.il.OnScreenChatJQueryTriggers.triggers.menuItemRemovalRequest); } else { - il.OnScreenChat.menuCollector.innerHTML = ''; + getModule().menuCollector.innerHTML = ''; console.error(xhr.status + ': ' + xhr.responseText); } }; From c2bc51816be0b4db3de70d4e36df1f27fe87160b Mon Sep 17 00:00:00 2001 From: Alex Killing Date: Fri, 20 Sep 2024 10:49:25 +0200 Subject: [PATCH 058/292] added int cast --- .../classes/class.ilObjCategoryReferenceListGUI.php | 2 +- .../classes/class.ilObjCourseReferenceListGUI.php | 2 +- .../GroupReference/classes/class.ilObjGroupReferenceListGUI.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Modules/CategoryReference/classes/class.ilObjCategoryReferenceListGUI.php b/Modules/CategoryReference/classes/class.ilObjCategoryReferenceListGUI.php index 3dfcc6bf394b..61d7a6879f33 100644 --- a/Modules/CategoryReference/classes/class.ilObjCategoryReferenceListGUI.php +++ b/Modules/CategoryReference/classes/class.ilObjCategoryReferenceListGUI.php @@ -113,7 +113,7 @@ public function initItem( $this->deleted = !$target_ref_id || $tree->isDeleted($target_ref_id); - parent::initItem($target_ref_id, $target_obj_id, $type, $target_title, $target_description); + parent::initItem((int) $target_ref_id, $target_obj_id, $type, $target_title, $target_description); // general commands array $this->commands = ilObjCategoryReferenceAccess::_getCommands($this->reference_ref_id); diff --git a/Modules/CourseReference/classes/class.ilObjCourseReferenceListGUI.php b/Modules/CourseReference/classes/class.ilObjCourseReferenceListGUI.php index d6ed122c26bd..96ab446c96cf 100644 --- a/Modules/CourseReference/classes/class.ilObjCourseReferenceListGUI.php +++ b/Modules/CourseReference/classes/class.ilObjCourseReferenceListGUI.php @@ -135,7 +135,7 @@ public function initItem( $ilBench->stop("ilObjCourseListGUI", "1000_checkAllConditions"); - parent::initItem($target_ref_id, $target_obj_id, $type, $target_title, $target_description); + parent::initItem((int) $target_ref_id, $target_obj_id, $type, $target_title, $target_description); // general commands array include_once('./Modules/CourseReference/classes/class.ilObjCourseReferenceAccess.php'); diff --git a/Modules/GroupReference/classes/class.ilObjGroupReferenceListGUI.php b/Modules/GroupReference/classes/class.ilObjGroupReferenceListGUI.php index c72263528a61..222b84a1d7f7 100644 --- a/Modules/GroupReference/classes/class.ilObjGroupReferenceListGUI.php +++ b/Modules/GroupReference/classes/class.ilObjGroupReferenceListGUI.php @@ -122,7 +122,7 @@ public function initItem( $this->conditions_ok = ilConditionHandler::_checkAllConditionsOfTarget($target_ref_id, $target_obj_id); - parent::initItem($target_ref_id, $target_obj_id, $type, $target_title, $target_description); + parent::initItem((int) $target_ref_id, $target_obj_id, $type, $target_title, $target_description); // general commands array include_once('./Modules/GroupReference/classes/class.ilObjGroupReferenceAccess.php'); From 396d0b5390b1b954be7b13be2ae68b345ccffeef Mon Sep 17 00:00:00 2001 From: Alex Killing Date: Fri, 20 Sep 2024 10:57:29 +0200 Subject: [PATCH 059/292] added int cast --- .../classes/class.ilObjCourseReferenceListGUI.php | 2 +- .../GroupReference/classes/class.ilObjGroupReferenceListGUI.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Modules/CourseReference/classes/class.ilObjCourseReferenceListGUI.php b/Modules/CourseReference/classes/class.ilObjCourseReferenceListGUI.php index 96ab446c96cf..6f01c5168bc0 100644 --- a/Modules/CourseReference/classes/class.ilObjCourseReferenceListGUI.php +++ b/Modules/CourseReference/classes/class.ilObjCourseReferenceListGUI.php @@ -131,7 +131,7 @@ public function initItem( $this->deleted = !$target_ref_id || $tree->isDeleted($target_ref_id); $ilBench->start("ilObjCourseListGUI", "1000_checkAllConditions"); - $this->conditions_ok = ilConditionHandler::_checkAllConditionsOfTarget($target_ref_id, $target_obj_id); + $this->conditions_ok = ilConditionHandler::_checkAllConditionsOfTarget((int) $target_ref_id, (int) $target_obj_id); $ilBench->stop("ilObjCourseListGUI", "1000_checkAllConditions"); diff --git a/Modules/GroupReference/classes/class.ilObjGroupReferenceListGUI.php b/Modules/GroupReference/classes/class.ilObjGroupReferenceListGUI.php index 222b84a1d7f7..d0a91bb14a6d 100644 --- a/Modules/GroupReference/classes/class.ilObjGroupReferenceListGUI.php +++ b/Modules/GroupReference/classes/class.ilObjGroupReferenceListGUI.php @@ -119,7 +119,7 @@ public function initItem( $this->deleted = !$target_ref_id || $tree->isDeleted($target_ref_id); - $this->conditions_ok = ilConditionHandler::_checkAllConditionsOfTarget($target_ref_id, $target_obj_id); + $this->conditions_ok = ilConditionHandler::_checkAllConditionsOfTarget((int) $target_ref_id, (int) $target_obj_id); parent::initItem((int) $target_ref_id, $target_obj_id, $type, $target_title, $target_description); From 5bc5222427e2222430b7ef0a74e5fb74927d1fd1 Mon Sep 17 00:00:00 2001 From: Alex Killing Date: Fri, 20 Sep 2024 11:47:48 +0200 Subject: [PATCH 060/292] 41936: LearningModules after Update ILIAS 7 to ILIAS 8: setting Comments cannot be deactivated --- .../class.NoteSettingsDBRepository.php | 2 +- Services/Notes/Setup/class.Agent.php | 38 +++++++++ .../Setup/class.ilNotesDBUpdateSteps.php | 80 +++++++++++++++++++ 3 files changed, 119 insertions(+), 1 deletion(-) create mode 100644 Services/Notes/Setup/class.Agent.php create mode 100644 Services/Notes/Setup/class.ilNotesDBUpdateSteps.php diff --git a/Services/Notes/Settings/class.NoteSettingsDBRepository.php b/Services/Notes/Settings/class.NoteSettingsDBRepository.php index 6f47ba9a98e4..b32a936b6f69 100644 --- a/Services/Notes/Settings/class.NoteSettingsDBRepository.php +++ b/Services/Notes/Settings/class.NoteSettingsDBRepository.php @@ -93,7 +93,7 @@ public function activateComments( [ "rep_obj_id" => ["integer", $obj_id], "obj_id" => ["integer", $sub_obj_id], - "obj_type" => ["integer", $obj_type], + "obj_type" => ["string", $obj_type], ], [ "activated" => ["integer", (int) $a_activate] diff --git a/Services/Notes/Setup/class.Agent.php b/Services/Notes/Setup/class.Agent.php new file mode 100644 index 000000000000..7630a376a722 --- /dev/null +++ b/Services/Notes/Setup/class.Agent.php @@ -0,0 +1,38 @@ +db = $db; + } + + public function step_1(): void + { + $db = $this->db; + $set1 = $db->queryF( + "SELECT * FROM note_settings " . + " WHERE obj_type = %s AND obj_id = %s", + ["text", "integer"], + ["0", "0"] + ); + while ($rec1 = $db->fetchAssoc($set1)) { + // get type + $set2 = $db->queryF( + "SELECT type FROM object_data " . + " WHERE obj_id = %s ", + ["integer"], + [$rec1["rep_obj_id"]] + ); + if ($rec2 = $db->fetchAssoc($set2)) { + + // get activation with current query + $set3 = $db->query( + "SELECT rep_obj_id FROM note_settings " . + " WHERE rep_obj_id = " . $db->quote($rec1["rep_obj_id"], "integer") . + " AND activated = " . $db->quote(1, "integer") + ); + $active = 0; + if ($db->fetchAssoc($set3)) { + $active = 1; + } + $db->replace( + "note_settings", + [ + "rep_obj_id" => ["integer", $rec1["rep_obj_id"]], + "obj_id" => ["integer", $rec1["obj_id"]] + ], + [ + "obj_type" => ["text", $rec2["type"]], + "activated" => ["integer", $active], + ] + ); + $db->manipulateF( + "DELETE FROM note_settings WHERE " . + " rep_obj_id = %s AND obj_id = %s AND obj_type = %s", + ["integer", "integer", "text"], + [$rec1["rep_obj_id"], $rec1["obj_id"], $rec1["obj_type"]] + ); + + } + } + } +} From 1a9c3e36dfd2cdc4a8e032830363599eb26efef4 Mon Sep 17 00:00:00 2001 From: mjansen Date: Wed, 21 Aug 2024 14:18:14 +0200 Subject: [PATCH 061/292] MyStaff: Check feature activation before expensive database operations See: https://mantis.ilias.de/view.php?id=31352 --- .../classes/Provider/StaffMainBarProvider.php | 4 ++++ .../MyStaff/classes/class.ilMyStaffAccess.php | 23 ++++++++++++++----- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/Services/MyStaff/classes/Provider/StaffMainBarProvider.php b/Services/MyStaff/classes/Provider/StaffMainBarProvider.php index 791e5906b3b5..e9fc34e520b8 100644 --- a/Services/MyStaff/classes/Provider/StaffMainBarProvider.php +++ b/Services/MyStaff/classes/Provider/StaffMainBarProvider.php @@ -54,6 +54,10 @@ final public function getStaticTopItems(): array */ final public function getStaticSubItems(): array { + if (!ilMyStaffAccess::isMyStaffActive()) { + return []; + } + $this->dic->language()->loadLanguageModule('mst'); $dic = $this->dic; $items = []; diff --git a/Services/MyStaff/classes/class.ilMyStaffAccess.php b/Services/MyStaff/classes/class.ilMyStaffAccess.php index 49e36300f8bb..17113b2e2c9c 100644 --- a/Services/MyStaff/classes/class.ilMyStaffAccess.php +++ b/Services/MyStaff/classes/class.ilMyStaffAccess.php @@ -56,6 +56,10 @@ public static function getInstance(): self if (self::$instance === null) { self::$instance = new self(); + if (!self::isMyStaffActive()) { + return self::$instance; + } + self::$instance->dropTempTable(self::TMP_DEFAULT_TABLE_NAME_PREFIX_IL_OBJ_SPEC_PERMISSIONS . "_" . self::ACCESS_ENROLMENTS_ORG_UNIT_OPERATION . "_" . self::COURSE_CONTEXT); self::$instance->dropTempTable(self::TMP_DEFAULT_TABLE_NAME_PREFIX_IL_OBJ_DEFAULT_PERMISSIONS . "_" . self::ACCESS_ENROLMENTS_ORG_UNIT_OPERATION @@ -75,11 +79,18 @@ public function __construct() { } + public static function isMyStaffActive(): bool + { + global $DIC; + + return (bool) $DIC->settings()->get('enable_my_staff'); + } + public function hasCurrentUserAccessToMyStaff(): bool { global $DIC; - if (!$DIC->settings()->get("enable_my_staff")) { + if (!self::isMyStaffActive()) { return false; } @@ -110,7 +121,7 @@ public function hasCurrentUserAccessToCertificates(): bool { global $DIC; - if (!$DIC->settings()->get("enable_my_staff")) { + if (!self::isMyStaffActive()) { return false; } @@ -156,7 +167,7 @@ public function hasCurrentUserAccessToTalks(): bool { global $DIC; - if (!$DIC->settings()->get("enable_my_staff")) { + if (!self::isMyStaffActive()) { return false; } @@ -197,7 +208,7 @@ public function hasCurrentUserAccessToCompetences(): bool { global $DIC; - if (!$DIC->settings()->get("enable_my_staff")) { + if (!self::isMyStaffActive()) { return false; } @@ -253,7 +264,7 @@ public function hasCurrentUserAccessToCourseMemberships(): bool { global $DIC; - if (!$DIC->settings()->get("enable_my_staff")) { + if (!self::isMyStaffActive()) { return false; } @@ -274,7 +285,7 @@ public function hasCurrentUserAccessToUser(int $usr_id = 0): bool { global $DIC; - if (!$DIC->settings()->get("enable_my_staff")) { + if (!self::isMyStaffActive()) { return false; } From a7b757f6664577743712b255ee715041bd732913 Mon Sep 17 00:00:00 2001 From: Michael Jansen Date: Mon, 23 Sep 2024 12:18:40 +0200 Subject: [PATCH 062/292] Exercise: Fix uninitialised GUI services (#8097) See: https://mantis.ilias.de/view.php?id=41992 --- .../Exercise/Service/classes/class.InternalGUIService.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Modules/Exercise/Service/classes/class.InternalGUIService.php b/Modules/Exercise/Service/classes/class.InternalGUIService.php index 751b1b4f0dd6..8e8f7f4d35d8 100644 --- a/Modules/Exercise/Service/classes/class.InternalGUIService.php +++ b/Modules/Exercise/Service/classes/class.InternalGUIService.php @@ -32,12 +32,11 @@ class InternalGUIService { use GlobalDICGUIServices; - protected \ILIAS\Exercise\InternalDataService $data_service; - protected \ILIAS\Exercise\InternalDomainService $domain_service; + protected InternalDataService $data_service; + protected InternalDomainService $domain_service; protected \ilLanguage $lng; protected \ilCtrl $ctrl; protected \ilToolbarGUI $toolbar; - protected UIServices $ui; protected HTTP\Services $http; protected Refinery\Factory $refinery; @@ -98,7 +97,7 @@ public function getRandomAssignmentGUI(\ilObjExercise $exc = null): \ilExcRandom $exc = $this->request()->getExercise(); } return new \ilExcRandomAssignmentGUI( - $this->ui, + $this->ui(), $this->toolbar, $this->lng, $this->ctrl, From 0595346fe541b6db100b523c9a6086803684bb48 Mon Sep 17 00:00:00 2001 From: Alex Killing Date: Mon, 23 Sep 2024 12:34:46 +0200 Subject: [PATCH 063/292] fixed random assignments --- .../Service/classes/class.InternalDomainService.php | 8 +++++++- .../Exercise/Service/classes/class.InternalGUIService.php | 8 ++++---- .../Exercise/Service/classes/class.InternalService.php | 1 + 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/Modules/Exercise/Service/classes/class.InternalDomainService.php b/Modules/Exercise/Service/classes/class.InternalDomainService.php index b88f08f6adb1..f864ef18ca1c 100644 --- a/Modules/Exercise/Service/classes/class.InternalDomainService.php +++ b/Modules/Exercise/Service/classes/class.InternalDomainService.php @@ -20,17 +20,22 @@ namespace ILIAS\Exercise; +use ILIAS\Repository\GlobalDICDomainServices; +use ILIAS\DI\Container; + /** * Exercise domain service (business logic) * @author Alexander Killing */ class InternalDomainService { + use GlobalDICDomainServices; protected InternalDataService $data; protected InternalRepoService $repo; protected Assignment\DomainService $assignment_service; public function __construct( + Container $DIC, InternalDataService $data, InternalRepoService $repo ) { @@ -40,9 +45,10 @@ public function __construct( $this, $repo ); + $this->initDomainServices($DIC); } - public function refinery():\ILIAS\Refinery\Factory + public function refinery(): \ILIAS\Refinery\Factory { global $DIC; return $DIC->refinery(); diff --git a/Modules/Exercise/Service/classes/class.InternalGUIService.php b/Modules/Exercise/Service/classes/class.InternalGUIService.php index 8e8f7f4d35d8..745cb544b72d 100644 --- a/Modules/Exercise/Service/classes/class.InternalGUIService.php +++ b/Modules/Exercise/Service/classes/class.InternalGUIService.php @@ -98,10 +98,10 @@ public function getRandomAssignmentGUI(\ilObjExercise $exc = null): \ilExcRandom } return new \ilExcRandomAssignmentGUI( $this->ui(), - $this->toolbar, - $this->lng, - $this->ctrl, - $this->service->domain()->assignment()->randomAssignments($exc) + $this->toolbar(), + $this->domain_service->lng(), + $this->ctrl(), + $this->domain_service->assignment()->randomAssignments($exc) ); } diff --git a/Modules/Exercise/Service/classes/class.InternalService.php b/Modules/Exercise/Service/classes/class.InternalService.php index 41a2435fb804..e8113a88a855 100644 --- a/Modules/Exercise/Service/classes/class.InternalService.php +++ b/Modules/Exercise/Service/classes/class.InternalService.php @@ -62,6 +62,7 @@ public function __construct() $this->db ); $this->domain = new InternalDomainService( + $this->DIC, $this->data, $this->repo ); From 31eb75a226f9c36f19691fd3dfb569e1e43d3e2b Mon Sep 17 00:00:00 2001 From: mjansen Date: Mon, 23 Sep 2024 16:22:09 +0200 Subject: [PATCH 064/292] Auth: Fix type case in "Session Statistics" See: https://mantis.ilias.de/view.php?id=39736 --- Services/Authentication/classes/class.ilSessionStatistics.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Services/Authentication/classes/class.ilSessionStatistics.php b/Services/Authentication/classes/class.ilSessionStatistics.php index e6372fdc90d8..50d1a55c3931 100644 --- a/Services/Authentication/classes/class.ilSessionStatistics.php +++ b/Services/Authentication/classes/class.ilSessionStatistics.php @@ -455,7 +455,7 @@ public static function getMaxedOutDuration(int $a_from, int $a_to): ?int $res = $ilDB->query($sql); $row = $ilDB->fetchAssoc($res); if ($row["dur"]) { - return $row["dur"]; + return (int) $row["dur"]; } //TODO check if return null as timestamp causes issues return null; From b030d309971906029078a81e65306e8bec035023 Mon Sep 17 00:00:00 2001 From: iszmais <45942348+iszmais@users.noreply.github.com> Date: Mon, 23 Sep 2024 18:05:58 +0200 Subject: [PATCH 065/292] dc fix cloned properties from ILIAS 7- (#8098) --- .../classes/Setup/class.ilDataCollectionDBUpdateSteps80.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Modules/DataCollection/classes/Setup/class.ilDataCollectionDBUpdateSteps80.php b/Modules/DataCollection/classes/Setup/class.ilDataCollectionDBUpdateSteps80.php index eb4d4d46bcee..f3a7d15e4e74 100644 --- a/Modules/DataCollection/classes/Setup/class.ilDataCollectionDBUpdateSteps80.php +++ b/Modules/DataCollection/classes/Setup/class.ilDataCollectionDBUpdateSteps80.php @@ -140,4 +140,9 @@ public function step_9(): void [ilDclDatatype::INPUTFORMAT_TEXT] ); } + + public function step_10(): void + { + $this->db->manipulate('UPDATE il_dcl_field_prop SET value = "" WHERE value IS NULL'); + } } From 7940388c054060851f99976358c6e42d663daf6a Mon Sep 17 00:00:00 2001 From: Nils Haagen Date: Tue, 24 Sep 2024 12:08:33 +0200 Subject: [PATCH 066/292] LSO: 42026, init class vars in import --- .../Xml/class.ilLearningSequenceXMLParser.php | 32 +++++++------------ 1 file changed, 11 insertions(+), 21 deletions(-) diff --git a/Modules/LearningSequence/classes/Xml/class.ilLearningSequenceXMLParser.php b/Modules/LearningSequence/classes/Xml/class.ilLearningSequenceXMLParser.php index cec259a43866..2d0f255ecfde 100644 --- a/Modules/LearningSequence/classes/Xml/class.ilLearningSequenceXMLParser.php +++ b/Modules/LearningSequence/classes/Xml/class.ilLearningSequenceXMLParser.php @@ -1,7 +1,5 @@ obj = $obj; - $this->storing = false; $this->setXMLContent($xml); - - $this->object = array(); - $this->ls_item_data = array(); - $this->settings = array(); - $this->lp_settings = array(); - $this->lp_settings["lp_item_ref_ids"] = array(); - $this->counter = 0; + $this->lp_settings["lp_item_ref_ids"] = []; } /** @@ -178,7 +168,7 @@ protected function endStoreCData(): void protected function storeData(): void { if ($this->storing) { - $this->ls_item_data[$this->counter][$this->actual_name] = $this->cdata ?? ""; + $this->ls_item_data[$this->counter][$this->actual_name] = $this->cdata; } } } From 828b4c76e4f1b0888e46b974530d23ea30972c8d Mon Sep 17 00:00:00 2001 From: mjansen Date: Wed, 25 Sep 2024 12:32:06 +0200 Subject: [PATCH 067/292] Forum: Add default for max. notification age and fix query --- .../classes/class.ilForumCronNotification.php | 104 +++++++++++++----- 1 file changed, 74 insertions(+), 30 deletions(-) diff --git a/Modules/Forum/classes/class.ilForumCronNotification.php b/Modules/Forum/classes/class.ilForumCronNotification.php index 01e12e18f7bc..c058b7cf1f69 100644 --- a/Modules/Forum/classes/class.ilForumCronNotification.php +++ b/Modules/Forum/classes/class.ilForumCronNotification.php @@ -26,10 +26,11 @@ class ilForumCronNotification extends ilCronJob { private const KEEP_ALIVE_CHUNK_SIZE = 25; + private const DEFAULT_MAX_NOTIFICATION_AGE_IN_DAYS = 30; /** @var ilForumCronNotificationDataProvider[] */ private static array $providerObject = []; - /** @var int[] */ + /** @var int[] */ private static array $deleted_ids_cache = []; /** @var array */ private static array $ref_ids_by_obj_id = []; @@ -133,6 +134,14 @@ public function run(): ilCronJobResult $this->num_sent_messages = 0; $cj_start_date = date('Y-m-d H:i:s'); + if ((string) $this->settings->get('max_notification_age', '') === '') { + $this->logger->info(sprintf( + 'No maximum notification age set, %s days will be used to determine the ' . + 'left interval when querying the relevant forum events.', + self::DEFAULT_MAX_NOTIFICATION_AGE_IN_DAYS + )); + } + if ($last_run_datetime !== null && checkdate( (int) date('m', strtotime($last_run_datetime)), @@ -141,10 +150,10 @@ public function run(): ilCronJobResult )) { $threshold = max( strtotime($last_run_datetime), - strtotime('-' . (int) $this->settings->get('max_notification_age') . ' days') + strtotime('-' . (int) $this->settings->get('max_notification_age', (string) self::DEFAULT_MAX_NOTIFICATION_AGE_IN_DAYS) . ' days') ); } else { - $threshold = strtotime('-' . (int) $this->settings->get('max_notification_age') . ' days'); + $threshold = strtotime('-' . (int) $this->settings->get('max_notification_age', (string) self::DEFAULT_MAX_NOTIFICATION_AGE_IN_DAYS) . ' days'); } $this->logger->info(sprintf('Threshold for forum event determination is: %s', date('Y-m-d H:i:s', $threshold))); @@ -181,10 +190,13 @@ public function run(): ilCronJobResult return $result; } + /** + * @return list + */ protected function getRefIdsByObjId(int $a_obj_id): array { if (!array_key_exists($a_obj_id, self::$ref_ids_by_obj_id)) { - self::$ref_ids_by_obj_id[$a_obj_id] = ilObject::_getAllReferences($a_obj_id); + self::$ref_ids_by_obj_id[$a_obj_id] = array_values(ilObject::_getAllReferences($a_obj_id)); } return self::$ref_ids_by_obj_id[$a_obj_id]; @@ -227,11 +239,13 @@ public function sendCronForumNotification(ilDBStatement $res, int $notification_ $ref_id = $this->getFirstAccessibleRefIdBUserAndObjId((int) $row['user_id'], (int) $row['obj_id']); if ($ref_id < 1) { - $this->logger->debug(sprintf( - 'The recipient with id %s has no "read" permission for object with id %s', - $row['user_id'], - $row['obj_id'] - )); + $this->logger->debug( + sprintf( + 'The recipient with id %s has no "read" permission for object with id %s', + $row['user_id'], + $row['obj_id'] + ) + ); continue; } @@ -274,12 +288,14 @@ public function sendCronForumNotification(ilDBStatement $res, int $notification_ $recipients = array_unique($provider->getCronRecipients()); - $this->logger->info(sprintf( - 'Trying to send forum notifications for posting id "%s", type "%s" and recipients: %s', - $provider->getPostId(), - $notification_type, - implode(', ', $recipients) - )); + $this->logger->info( + sprintf( + 'Trying to send forum notifications for posting id "%s", type "%s" and recipients: %s', + $provider->getPostId(), + $notification_type, + implode(', ', $recipients) + ) + ); $mailNotification = new ilForumMailNotification($provider, $this->logger); $mailNotification->setIsCronjob(true); @@ -327,6 +343,9 @@ public function existsProviderObject(int $provider_id, int $notification_type): return isset(self::$providerObject[$provider_id . '_' . $notification_type]); } + /** + * @param array $row + */ private function addProviderObject(int $provider_id, array $row, int $notification_type): void { $tmp_provider = new ilForumCronNotificationDataProvider($row, $notification_type, $this->notificationCache); @@ -365,14 +384,22 @@ public function addCustomSettingsToForm(ilPropertyFormGUI $a_form): void { $this->lng->loadLanguageModule('forum'); - $max_notification_age = new ilNumberInputGUI($this->lng->txt('frm_max_notification_age'), 'max_notification_age'); + $max_notification_age = new ilNumberInputGUI( + $this->lng->txt('frm_max_notification_age'), + 'max_notification_age' + ); $max_notification_age->setSize(5); $max_notification_age->setSuffix($this->lng->txt('frm_max_notification_age_unit')); $max_notification_age->setRequired(true); $max_notification_age->allowDecimals(false); $max_notification_age->setMinValue(1); $max_notification_age->setInfo($this->lng->txt('frm_max_notification_age_info')); - $max_notification_age->setValue($this->settings->get('max_notification_age', '')); + $max_notification_age->setValue( + $this->settings->get( + 'max_notification_age', + (string) self::DEFAULT_MAX_NOTIFICATION_AGE_IN_DAYS + ) + ); $a_form->addItem($max_notification_age); } @@ -403,7 +430,7 @@ private function sendNotificationForNewPosts(string $threshold_date): void (frm_posts.pos_date >= %s AND frm_posts.pos_date = frm_posts.pos_activation_date) OR (frm_posts.pos_activation_date >= %s AND frm_posts.pos_date < frm_posts.pos_activation_date) ) '; - $types = ['integer', 'timestamp', 'timestamp']; + $types = [ilDBConstants::T_INTEGER, ilDBConstants::T_TIMESTAMP, ilDBConstants::T_TIMESTAMP]; $values = [1, $threshold_date, $threshold_date]; $res = $this->ilDB->queryF( @@ -425,7 +452,12 @@ private function sendNotificationForUpdatedPosts(string $threshold_date): void frm_notification.interested_events & %s AND frm_posts.pos_cens = %s AND frm_posts.pos_status = %s AND (frm_posts.pos_update > frm_posts.pos_date AND frm_posts.pos_update >= %s) '; - $types = ['integer', 'integer', 'integer', 'timestamp']; + $types = [ + ilDBConstants::T_INTEGER, + ilDBConstants::T_INTEGER, + ilDBConstants::T_INTEGER, + ilDBConstants::T_TIMESTAMP + ]; $values = [ilForumNotificationEvents::UPDATED, 0, 1, $threshold_date]; $res = $this->ilDB->queryF( @@ -447,7 +479,12 @@ private function sendNotificationForCensoredPosts(string $threshold_date): void frm_notification.interested_events & %s AND frm_posts.pos_cens = %s AND frm_posts.pos_status = %s AND (frm_posts.pos_cens_date >= %s AND frm_posts.pos_cens_date > frm_posts.pos_activation_date ) '; - $types = ['integer', 'integer', 'integer', 'timestamp']; + $types = [ + ilDBConstants::T_INTEGER, + ilDBConstants::T_INTEGER, + ilDBConstants::T_INTEGER, + ilDBConstants::T_TIMESTAMP + ]; $values = [ilForumNotificationEvents::CENSORED, 1, 1, $threshold_date]; $res = $this->ilDB->queryF( @@ -469,7 +506,12 @@ private function sendNotificationForUncensoredPosts(string $threshold_date): voi frm_notification.interested_events & %s AND frm_posts.pos_cens = %s AND frm_posts.pos_status = %s AND (frm_posts.pos_cens_date >= %s AND frm_posts.pos_cens_date > frm_posts.pos_activation_date ) '; - $types = ['integer', 'integer', 'integer', 'timestamp']; + $types = [ + ilDBConstants::T_INTEGER, + ilDBConstants::T_INTEGER, + ilDBConstants::T_INTEGER, + ilDBConstants::T_TIMESTAMP + ]; $values = [ilForumNotificationEvents::UNCENSORED, 0, 1, $threshold_date]; $res = $this->ilDB->queryF( @@ -489,7 +531,7 @@ private function sendNotificationForDeletedThreads(): void { $res = $this->ilDB->queryF( $this->createSelectOfDeletionNotificationsSql(), - ['integer', 'integer'], + [ilDBConstants::T_INTEGER, ilDBConstants::T_INTEGER], [1, ilForumNotificationEvents::THREAD_DELETED] ); @@ -505,7 +547,7 @@ private function sendNotificationForDeletedPosts(): void { $res = $this->ilDB->queryF( $this->createSelectOfDeletionNotificationsSql(), - ['integer', 'integer'], + [ilDBConstants::T_INTEGER, ilDBConstants::T_INTEGER], [0, ilForumNotificationEvents::POST_DELETED] ); @@ -540,12 +582,14 @@ private function sendDeleteNotifications( $this->logger->info(sprintf('Sending notifications for %s "%s" events ...', $numRows, $actionDescription)); $this->sendCronForumNotification($res, $notificationType); if (count(self::$deleted_ids_cache) > 0) { - $this->ilDB->manipulate('DELETE FROM frm_posts_deleted WHERE ' . $this->ilDB->in( - 'deleted_id', - self::$deleted_ids_cache, - false, - 'integer' - )); + $this->ilDB->manipulate( + 'DELETE FROM frm_posts_deleted WHERE ' . $this->ilDB->in( + 'deleted_id', + self::$deleted_ids_cache, + false, + ilDBConstants::T_INTEGER + ) + ); $this->logger->info('Deleted obsolete entries of table "' . $action . '" ...'); } $this->logger->info(sprintf('Sent notifications for %s ...', $actionDescription)); @@ -568,7 +612,7 @@ private function createForumPostSql(string $condition): string AND ((frm_threads.thr_top_fk = frm_data.top_pk AND frm_data.top_frm_fk = frm_notification.frm_id) OR (frm_threads.thr_pk = frm_notification.thread_id AND frm_data.top_pk = frm_threads.thr_top_fk) ) - AND frm_posts.pos_display_user_id != frm_notification.user_id + AND frm_posts.pos_author_id != frm_notification.user_id AND frm_posts_tree.pos_fk = frm_posts.pos_pk AND frm_posts_tree.parent_pos != 0 ORDER BY frm_posts.pos_date ASC'; } From 25d09dc14d2cc89e2de1a1fde54581213f1d521e Mon Sep 17 00:00:00 2001 From: Thibeau Fuhrer Date: Wed, 25 Sep 2024 12:46:35 +0200 Subject: [PATCH 068/292] [FIX] update rollup npm package to v3.29.5 --- node_modules/.package-lock.json | 9 +- node_modules/rollup/CHANGELOG.md | 6618 ++-- node_modules/rollup/LICENSE.md | 266 +- node_modules/rollup/README.md | 45 +- node_modules/rollup/dist/bin/rollup | 2505 +- node_modules/rollup/dist/es/rollup.browser.js | 7 +- node_modules/rollup/dist/es/rollup.js | 9 +- node_modules/rollup/dist/es/shared/rollup.js | 24800 +++++++++------ node_modules/rollup/dist/es/shared/watch.js | 6859 ++-- node_modules/rollup/dist/loadConfigFile.js | 14 +- node_modules/rollup/dist/rollup.browser.js | 8 +- .../rollup/dist/rollup.browser.js.map | 1 + node_modules/rollup/dist/rollup.d.ts | 484 +- node_modules/rollup/dist/rollup.js | 12 +- node_modules/rollup/dist/shared/index.js | 5935 ++-- .../rollup/dist/shared/loadConfigFile.js | 424 +- .../rollup/dist/shared/mergeOptions.js | 51 +- node_modules/rollup/dist/shared/rollup.js | 25866 +++++++++------- node_modules/rollup/dist/shared/watch-cli.js | 624 +- node_modules/rollup/dist/shared/watch.js | 683 +- node_modules/rollup/package.json | 175 +- package-lock.json | 56 +- package.json | 4 +- 23 files changed, 41611 insertions(+), 33844 deletions(-) create mode 100644 node_modules/rollup/dist/rollup.browser.js.map diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json index 7d8bba58977d..adc3c1b14fd8 100644 --- a/node_modules/.package-lock.json +++ b/node_modules/.package-lock.json @@ -4355,9 +4355,10 @@ } }, "node_modules/rollup": { - "version": "2.18.0", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.18.0.tgz", - "integrity": "sha512-LhuQQp3WpnHo3HlKCRrdMXpB6jdLsGOoXXSfMjbv74s5VdV3WZhkYJT0Z6w/EH3UgPH+g/S9T4GJrKW/5iD8TA==", + "version": "2.79.1", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.79.1.tgz", + "integrity": "sha512-uKxbd0IhMZOhjAiD5oAFp7BqvkA4Dv47qpOCtaNvng4HBwdbWtdOh8f5nZNuk2rp51PMGk3bzfWu5oayNEuYnw==", + "license": "MIT", "bin": { "rollup": "dist/bin/rollup" }, @@ -4365,7 +4366,7 @@ "node": ">=10.0.0" }, "optionalDependencies": { - "fsevents": "~2.1.2" + "fsevents": "~2.3.2" } }, "node_modules/rollup-plugin-sourcemaps": { diff --git a/node_modules/rollup/CHANGELOG.md b/node_modules/rollup/CHANGELOG.md index ae81d7b96f2a..23a887be8c40 100644 --- a/node_modules/rollup/CHANGELOG.md +++ b/node_modules/rollup/CHANGELOG.md @@ -1,1997 +1,4864 @@ # rollup changelog +## 2.79.1 + +_2022-09-22_ + +### Bug Fixes + +- Avoid massive performance degradation when creating thousands of chunks (#4643) + +### Pull Requests + +- [#4639](https://github.com/rollup/rollup/pull/4639): fix: typo docs and contributors link in CONTRIBUTING.md (@takurinton) +- [#4641](https://github.com/rollup/rollup/pull/4641): Update type definition of resolveId (@ivanjonas) +- [#4643](https://github.com/rollup/rollup/pull/4643): Improve performance of chunk naming collision check (@lukastaegert) + +## 2.79.0 + +_2022-08-31_ + +### Features + +- Add `amd.forceJsExtensionForImports` to enforce using `.js` extensions for relative AMD imports (#4607) + +### Pull Requests + +- [#4607](https://github.com/rollup/rollup/pull/4607): add option to keep extensions for amd (@wh1tevs) + +## 2.78.1 + +_2022-08-19_ + +### Bug Fixes + +- Avoid inferring "arguments" as name for a default export placeholder variable (#4613) + +### Pull Requests + +- [#4613](https://github.com/rollup/rollup/pull/4613): Prevent using arguments for generated variable names (@lukastaegert) + +## 2.78.0 + +_2022-08-14_ + +### Features + +- Support writing plugin hooks as objects with a "handler" property (#4600) +- Allow changing execution order per plugin hook (#4600) +- Add flag to execute plugins in async parallel hooks sequentially (#4600) + +### Pull Requests + +- [#4600](https://github.com/rollup/rollup/pull/4600): Allow using objects as hooks to change execution order (@lukastaegert) + +## 2.77.3 + +_2022-08-11_ + +### Bug Fixes + +- Correctly resolve preserveModulesRoot in Vite (#4591) + +### Pull Requests + +- [#4591](https://github.com/rollup/rollup/pull/4591): resolve currentPath (@cleverpp) + +## 2.77.2 + +_2022-07-27_ + +### Bug Fixes + +- Avoid a rendering failure when mixing outputs with inlined and non-inlined dynamic imports (#4589) + +### Pull Requests + +- [#4589](https://github.com/rollup/rollup/pull/4589): Handle generating non-inlined imports after inlined ones (@lukastaegert) + +## 2.77.1 + +_2022-07-26_ + +### Bug Fixes + +- Ensure IIFE output generates a global variable when generating ES5 (#4588) + +### Pull Requests + +- [#4577](https://github.com/rollup/rollup/pull/4577): broken link removed (@Jawad-H) +- [#4580](https://github.com/rollup/rollup/pull/4580): Update dependencies (@lukastaegert) +- [#4584](https://github.com/rollup/rollup/pull/4584): Documentation clarity and syntax improvements (@berniegp) +- [#4588](https://github.com/rollup/rollup/pull/4588): Use var for IIFE (@lukastaegert) + +## 2.77.0 + +_2022-07-15_ + +### Features + +- Introduce `maxParallelFileOps` to limit both read and write operations, default to 20 and replaces `maxParallelFileRead` (#4570) + +### Bug Fixes + +- Avoid including variables referenced from return statements that are never reached (#4573) + +### Pull Requests + +- [#4570](https://github.com/rollup/rollup/pull/4570): Introduce maxParallelFileOps to limit parallel writes (@lukastaegert) +- [#4572](https://github.com/rollup/rollup/pull/4572): Document more ways to read package.json in ESM (@berniegp) +- [#4573](https://github.com/rollup/rollup/pull/4573): Do not include unused return expressions (@lukastaegert) + +## 2.76.0 + +_2022-07-08_ + +### Features + +- Allow setting a `sourcmapBaseUrl` for absolute paths in sourcemaps (#4527) + +### Bug Fixes + +- Support absolute CLI plugin paths on Windows (#4533) + +### Pull Requests + +- [#4527](https://github.com/rollup/rollup/pull/4527): Add sourcemapBaseUrl option (@nickgarlis) +- [#4533](https://github.com/rollup/rollup/pull/4533): Add support for absolute plugin paths (@ygoe) +- [#4538](https://github.com/rollup/rollup/pull/4538): chore: Included githubactions in the dependabot config (@naveensrinivasan) +- [#4546](https://github.com/rollup/rollup/pull/4546): Adapt Node versions on CI to prepare for v3 (@lukastaegert) +- [#4556](https://github.com/rollup/rollup/pull/4556): Improve error message for invalid patterns (@DysphoricUnicorn) +- [#4559](https://github.com/rollup/rollup/pull/4559): Update dependencies (@lukastaegert) +- [#4560](https://github.com/rollup/rollup/pull/4560): Bump peter-evans/create-or-update-comment from 1 to 2 (@dependabot) +- [#4561](https://github.com/rollup/rollup/pull/4561): Bump peter-evans/find-comment from 1 to 2 (@dependabot) +- [#4562](https://github.com/rollup/rollup/pull/4562): Bump codecov/codecov-action from 1 to 3 (@dependabot) + +## 2.75.7 + +_2022-06-20_ + +### Bug Fixes + +- Mark Array.prototype.group/groupToMap as side effect free. (#4531) + +### Pull Requests + +- [#4523](https://github.com/rollup/rollup/pull/4523): chore: remove source map workaround, bump deps (@dnalborczyk) +- [#4525](https://github.com/rollup/rollup/pull/4525): Add regression tests for instanceof (@lukastaegert) +- [#4528](https://github.com/rollup/rollup/pull/4528): chore: Set permissions for GitHub actions (@naveensrinivasan) +- [#4531](https://github.com/rollup/rollup/pull/4531): fix: rename Array.prototype.group/groupToMap (@dnalborczyk) +- [#4535](https://github.com/rollup/rollup/pull/4535): chore: bump resolve from 1.22.0 to 1.22.1 (@pos777) + +## 2.75.6 + +_2022-06-07_ + +### Bug Fixes + +- Properly deoptimize "this" when using member expressions with getters/setters in for loops and update expressions (#4522) + +### Pull Requests + +- [#4522](https://github.com/rollup/rollup/pull/4522): Refactor side effect handling for property interactions (@lukastaegert) + +## 2.75.5 + +_2022-06-01_ + +### Bug Fixes + +- Avoid crashes when using logical expressions for unused constructor arguments (#4519) +- Fix missing parameter defaults for calls from try statements and functions returned by functions (#4520) + +### Pull Requests + +- [#4519](https://github.com/rollup/rollup/pull/4519): Try to make logical expression deoptimization more robust (@lukastaegert) +- [#4520](https://github.com/rollup/rollup/pull/4520): Roll back parameter default tree shaking (@lukastaegert) + +## 2.75.4 + +_2022-05-31_ + +### Bug Fixes + +- Ensure parameter defaults are retained when a function is used as an object property (#4516) + +### Pull Requests + +- [#4516](https://github.com/rollup/rollup/pull/4516): Deoptimize parameter defaults when referenced from object/array/class literals (@lukastaegert) + +## 2.75.3 + +_2022-05-29_ + +### Bug Fixes + +- Retain parameter defaults for functions that are defaults themselves (#4515) +- Track mutations for objects as default values (#4515) + +### Pull Requests + +- [#4515](https://github.com/rollup/rollup/pull/4515): Ensure parameter defaults are deoptimized (@lukastaegert) + +## 2.75.1 + +_2022-05-28_ + +### Pull Requests + +- [#4513](https://github.com/rollup/rollup/pull/4513): Update link to node polyfill repo (@lukastaegert) + +## 2.75.0 + +_2022-05-27_ + +### Features + +- Re-implement default parameter tree-shaking for top-level functions (#4510) +- Do not consider calling string methods like `.trim()` on template literals a side effect (#4511) + +### Pull Requests + +- [#4510](https://github.com/rollup/rollup/pull/4510): Tree-shake parameter defaults (replaces #4498) (@lukastaegert) +- [#4511](https://github.com/rollup/rollup/pull/4511): Tree-shake side-effect-free string methods on template literals (@lukastaegert) + +## 2.74.1 + +_2022-05-19_ + +### Bug Fixes + +- Revert #4498 until some issues are understood and resolved + +## 2.74.0 + +_2022-05-19_ + +### Features + +- Remove unneeded default values for function parameters (#4498) + +### Bug Fixes + +- Use a consistent mechanism to resolve the config file to avoid issues on Windows (#4501) +- Avoid an inaccurate warning about an event emitter leak for complicated builds (#4502) +- Ensure that reexporting values from other chunks via dynamic imports does not reference non-imported variables (#4499) + +### Pull Requests + +- [#4498](https://github.com/rollup/rollup/pull/4498): Tree shake parameter defaults (@lukastaegert) +- [#4499](https://github.com/rollup/rollup/pull/4499): Ensure reexports are available for namespaces (@lukastaegert) +- [#4501](https://github.com/rollup/rollup/pull/4501): fix: config path problem on windows (@pos777) +- [#4502](https://github.com/rollup/rollup/pull/4502): Avoid maximum listeners exceeded warning (@lukastaegert) + +## 2.73.0 + +_2022-05-13_ + +### Features + +- Do not treat Object.defineProperty/ies as side effect when called on an unused object (#4493) +- Do not assume that assigning a property can create a getter with side effects (#4493) +- Do not treat string.prototype.replace(All) as side effect when used with two literals (#4493) + +### Bug Fixes + +- Detect side effects when manually declaring getters on functions (#4493) + +### Pull Requests + +- [#4493](https://github.com/rollup/rollup/pull/4493): Handle getters on functions and improve property deoptimization (@lukastaegert) +- [#4494](https://github.com/rollup/rollup/pull/4494): Do not treat string.replace as side effect when used with a literal (@lukastaegert) +- [#4495](https://github.com/rollup/rollup/pull/4495): Update docs for --configPlugin using typescript (@Jimmydalecleveland) + +## 2.72.1 + +_2022-05-07_ + +### Bug Fixes + +- Improve tree-shaking of classes with super classes in certain scenarios (#4489) + +### Pull Requests + +- [#4489](https://github.com/rollup/rollup/pull/4489): Do not deoptimize entire super class when adding a property (@lukastaegert) + +## 2.72.0 + +_2022-05-05_ + +### Features + +- Add CLI hooks to run external commands at certain points in watch mode (#4457) + +### Bug Fixes + +- Fix an issue that could accidentally treat relevant assignments as side effect free (#4486) + +### Pull Requests + +- [#4457](https://github.com/rollup/rollup/pull/4457): feat: CLI event hook flags (@Harris-Miller) +- [#4486](https://github.com/rollup/rollup/pull/4486): Fix reassignment tracking (@lukastaegert) + +## 2.71.1 + +_2022-04-30_ + +### Bug Fixes + +- Allow importing loadConfigFile without extension (#4483) + +### Pull Requests + +- [#4483](https://github.com/rollup/rollup/pull/4483): Add exports exception for loadConfigFile (@lukastaegert) + +## 2.71.0 + +_2022-04-30_ + +## Features + +- Mark `Object.hasOwn` as pure (#4482) + +### Bug Fixes + +- Prevent infinite recursion and display proper warning for recursive reexports (#4472) +- Fix type issue in TypeScript nightly (#4471) + +### Pull Requests + +- [#4467](https://github.com/rollup/rollup/pull/4467): docs: update deprecated option in tools.md (@kimjh96) +- [#4471](https://github.com/rollup/rollup/pull/4471): Fix: tsc did not build (@frank-dspeed) +- [#4472](https://github.com/rollup/rollup/pull/4472): Throw proper error when indirectly reexporting a recursive binding (@lukastaegert) +- [#4475](https://github.com/rollup/rollup/pull/4475): chore: bump deps (#4475) (@dnalborczyk) +- [#4477](https://github.com/rollup/rollup/pull/4477): chore: bump github actions (@dnalborczyk) +- [#4478](https://github.com/rollup/rollup/pull/4478): ci: test with node.js v18, remove v17 (@dnalborczyk) +- [#4479](https://github.com/rollup/rollup/pull/4479): chore(repo): replace `git.io` in the issue template (@SukkaW) +- [#4482](https://github.com/rollup/rollup/pull/4482): feat: add Object.hasOwn as pure function (@dnalborczyk) + +## 2.70.2 + +_2022-04-15_ + +### Bug Fixes + +- Do not enforce undefined return values in TypeScript types (#4463) + +### Pull Requests + +- [#4463](https://github.com/rollup/rollup/pull/4463): use void for options hook instead of undefined (@ycmjason) + +## 2.70.1 + +_2022-03-14_ + +### Bug Fixes + +- Handle unfinished hook action errors as regular errors and avoid console logging (#4434) +- Allow access to "dist" folder in a Node 17 compatible way (#4436) + +### Pull Requests + +- [#4434](https://github.com/rollup/rollup/pull/4434): Track unfinished hook actions as regular errors (@lukastaegert) +- [#4436](https://github.com/rollup/rollup/pull/4436): Update package.json (@frank-dspeed) + +## 2.70.0 + +_2022-03-07_ + +### Features + +- Make the `watchChange` and `closeWatcher` hooks asynchronous and make Rollup wait for these hooks before continuing (#4427) + +### Bug Fixes + +- Do not abort watch mode for errors in `watchChange` but display them properly (#4427) + +### Pull Requests + +- [#4427](https://github.com/rollup/rollup/pull/4427): Do not abort watch mode on errors in watchChange (@lukastaegert) + +## 2.69.2 + +_2022-03-06_ + +### Bug Fixes + +- Mark `Object.entries` and `Object.fromEntries` as pure (#4429) +- Make sure new properties on Array.prototype and Object.prototype are not evaluated as "undefined" (#4428) + +### Pull Requests + +- [#4428](https://github.com/rollup/rollup/pull/4428): Treat unknown prototype props as unknown (@lukastaegert) +- [#4429](https://github.com/rollup/rollup/pull/4429): Treat unknown prototype props as unknown (@869288142) + +## 2.69.1 + +_2022-03-04_ + +### Bug Fixes + +- Approximate source position instead of ignoring it when using a low-resolution source map in a transform hook (#4334) + +### Pull Requests + +- [#4334](https://github.com/rollup/rollup/pull/4334): fix(sourcemap): fall back to low-resolution line mapping (@aleclarson and @lukastaegert) + +## 2.69.0 + +_2022-03-02_ + +### Features + +- Introduce new `output.generatedCode.symbols` to control the usage of Symbols in Rollup-generated code (#4378) +- soft-deprecate `output.namespaceToStringTag` in favor of `output.generatedCode.symbols` (#4378) + +### Bug Fixes + +- Properly handle `./` and `../` as external dependencies (#4419) +- Make generated "Module" namespace toStringTag non-enumerable for correct Object.assign/spread behaviour (#4378) +- Add file name to error when top-level-await is used in disallowed formats (#4421) + +### Pull Requests + +- [#4378](https://github.com/rollup/rollup/pull/4378): Make namespace @@toStringTag "Module" non-enumerable (@dnalborczyk and @lukastaegert) +- [#4413](https://github.com/rollup/rollup/pull/4413): refactor: some code and type fixes (@dnalborczyk) +- [#4418](https://github.com/rollup/rollup/pull/4418): chore: bump deps (@dnalborczyk) +- [#4419](https://github.com/rollup/rollup/pull/4419): Properly handle upper directories as external dependencies (@lukastaegert) +- [#4421](https://github.com/rollup/rollup/pull/4421): Improve the error prompt and output the error file name (@caoxiemeihao) +- [#4423](https://github.com/rollup/rollup/pull/4423): Update 999-big-list-of-options.md (@leoj3n) + +## 2.68.0 + +_2022-02-22_ + +### Features + +- provide information about cached import resolutions in `shouldTransformCachedModule` (#4414) +- Add "types" field to Rollup's package exports (#4416) + +### Pull Requests + +- [#4410](https://github.com/rollup/rollup/pull/4410): refactor: use map for declarations and name suggestions (@dnalborczyk) +- [#4411](https://github.com/rollup/rollup/pull/4411): refactor: use map for namespace reexports by name (@dnalborczyk) +- [#4412](https://github.com/rollup/rollup/pull/4412): refactor: use includes where appropriate (@dnalborczyk) +- [#4414](https://github.com/rollup/rollup/pull/4414): Add resolved sources to shouldTransformCachedModule (@lukastaegert) +- [#4416](https://github.com/rollup/rollup/pull/4416): Add Typescript 4.5 nodenext node12 module resolution support (@frank-dspeed) + +## 2.67.3 + +_2022-02-18_ + +### Bug Fixes + +- Do not swallow other errors when unfinished hook actions are detected (#4409) +- Add additional information to output when there are unfinished hook actions (#4409) + +### Pull Requests + +- [#4399](https://github.com/rollup/rollup/pull/4399): docs: remove const (@TrickyPi) +- [#4401](https://github.com/rollup/rollup/pull/4401): Improve test stability by getting independent of module id ordering in more places (@lukastaegert) +- [#4403](https://github.com/rollup/rollup/pull/4403): fix: remove unnecessary property descriptor spread (@dnalborczyk) +- [#4404](https://github.com/rollup/rollup/pull/4404): refactor: use map for import descriptions + re-export descriptions (@dnalborczyk) +- [#4405](https://github.com/rollup/rollup/pull/4405): refactor: module exports to map (@dnalborczyk) +- [#4406](https://github.com/rollup/rollup/pull/4406): Fix a typo in 'Direct plugin communication' code example (@younesmln) +- [#4407](https://github.com/rollup/rollup/pull/4407): Document how resolveId is cached (@lukastaegert) +- [#4409](https://github.com/rollup/rollup/pull/4409): Print ids for unfinished moduleParsed and shouldTransformCachedModule hooks (@lukastaegert) + +## 2.67.2 + +_2022-02-10_ + +### Bug Fixes + +- Ensure consistent order between manual chunks to fix hashing issues (#4397) + +### Pull Requests + +- [#4390](https://github.com/rollup/rollup/pull/4390): refactor: add @types/estree explicitly, fix dynamic type imports (@dnalborczyk) +- [#4391](https://github.com/rollup/rollup/pull/4391): chore: remove acorn-walk ambient type definitions (@dnalborczyk) +- [#4397](https://github.com/rollup/rollup/pull/4397): Sort manual chunks generated via a function by name (@lukastaegert) + +## 2.67.1 + +_2022-02-07_ + +### Bug Fixes + +- Make chunk file and variable names more deterministic when emitting chunks (#4386) +- Improve default module resolver performance by using non-blocking IO (#4386) + +### Pull Requests + +- [#4373](https://github.com/rollup/rollup/pull/4373): fix: even more types (@dnalborczyk) +- [#4382](https://github.com/rollup/rollup/pull/4382): Update contribution tut link desc (@lemredd) +- [#4383](https://github.com/rollup/rollup/pull/4383): chore: bump deps (@dnalborczyk) +- [#4384](https://github.com/rollup/rollup/pull/4384): chore: move "wait" to utils + re-use (@dnalborczyk) +- [#4385](https://github.com/rollup/rollup/pull/4385): refactor: convert watch tests to async functions (@dnalborczyk) +- [#4386](https://github.com/rollup/rollup/pull/4386): refactor: use fs.promises in resolve id, Part 4 (@dnalborczyk and @lukastaegert) +- [#4389](https://github.com/rollup/rollup/pull/4389): refactor: use fs.promises in generate license file, rollup config, Part 5 (@dnalborczyk) + +## 2.67.0 + +_2022-02-02_ + +### Features + +- Improve side effect detection when using Array.prototype.groupBy/groupByToMap (#4360) +- Allow changing `moduleSideEffects` at any time during the build (#4379) +- Soft-deprecate `ModuleInfo.hasModuleSideEffects` in favour of `ModuleInfo.moduleSideEffects` (#4379) + +### Bug Fixes + +- Do not include queries and hashes in generated file names when preserving modules (#4374) + +### Pull Requests + +- [#4319](https://github.com/rollup/rollup/pull/4319): refactor: use fs, fs-extra, remove sander (@dnalborczyk) +- [#4360](https://github.com/rollup/rollup/pull/4360): feat: add Array.prototype.groupBy/groupByToMap (@dnalborczyk) +- [#4361](https://github.com/rollup/rollup/pull/4361): fix: more types (@dnalborczyk) +- [#4369](https://github.com/rollup/rollup/pull/4369): fix: remove acorn-walk patch (@dnalborczyk) +- [#4371](https://github.com/rollup/rollup/pull/4371): refactor: use fs.promises in cli/run (@dnalborczyk) +- [#4372](https://github.com/rollup/rollup/pull/4372): refactor: use fs.promises in module loader (@dnalborczyk) +- [#4374](https://github.com/rollup/rollup/pull/4374): Ignore queries and hashes in file names when preserving modules (@lukastaegert) +- [#4375](https://github.com/rollup/rollup/pull/4375): Fix typo in \_config.js (@eltociear) +- [#4376](https://github.com/rollup/rollup/pull/4376): refactor: fs.promises, move mkdir to writeoutputfile, Part 3 (@dnalborczyk) +- [#4379](https://github.com/rollup/rollup/pull/4379): Deprecate hasModuleSideEffects in favor of moduleSideEffects and ensure it is mutable on ModuleInfo (@lukastaegert) + +## 2.66.1 + +_2022-01-25_ + +### Bug Fixes + +- Only warn for conflicting names in namespace reexports if it actually causes problems (#4363) +- Only allow explicit exports or reexports as synthetic namespaces and hide them from namespace reexports (#4364) + +### Pull Requests + +- [#4362](https://github.com/rollup/rollup/pull/4362): refactor: convert exportsByName object to map (@dnalborczyk) +- [#4363](https://github.com/rollup/rollup/pull/4363): Do not warn unnecessarily for namespace conflicts (@lukastaegert) +- [#4364](https://github.com/rollup/rollup/pull/4364): Do not expose synthetic namespace export in entries and namespaces (@lukastaegert) + +## 2.66.0 + +_2022-01-22_ + +### Features + +- Note if a module has a default export in ModuleInfo to allow writing better proxy modules (#4356) +- Add option to wait until all imported ids have been resolved when awaiting `this.load` (#4358) + +### Pull Requests + +- [#4356](https://github.com/rollup/rollup/pull/4356): Add hasDefaultExport to ModuleInfo (@lukastaegert) +- [#4358](https://github.com/rollup/rollup/pull/4358): Add "resolveDependencies" option to "this.load" (@lukastaegert) + +## 2.65.0 + +_2022-01-21_ + +### Features + +- Add complete import resolution objects to ModuleInfo for use in `this.load` (#4354) + +### Bug Fixes + +- Use correct context in plugin hooks with `perf: true` (#4357) + +### Pull Requests + +- [#4351](https://github.com/rollup/rollup/pull/4351): refactor: re-use source mapping url (@dnalborczyk) +- [#4352](https://github.com/rollup/rollup/pull/4352): refactor: replace require-relative with built-in require.resolve (@dnalborczyk) +- [#4353](https://github.com/rollup/rollup/pull/4353): chore: bump deps (@dnalborczyk) +- [#4354](https://github.com/rollup/rollup/pull/4354): Add importedIdResolutions to moduleInfo (@lukastaegert) +- [#4355](https://github.com/rollup/rollup/pull/4355): chore: remove external from config (@dnalborczyk) +- [#4357](https://github.com/rollup/rollup/pull/4357): fix: timed plugin context (@dnalborczyk) + +## 2.64.0 + +_2022-01-14_ + +### Features + +- Allow inspecting cached modules and forcing them to be transformed again via shouldTransformCachedModule (#4320) +- Do not wait for the config file to be parsed in watch mode if it is updated before that (#4344) + +### Bug Fixes + +- Do not mutate objects returned as `meta` from the resolveId hook (#4347) + +### Pull Requests + +- [#4326](https://github.com/rollup/rollup/pull/4326): refactor: type fixes (@dnalborczyk) +- [#4339](https://github.com/rollup/rollup/pull/4339): More watch test stabilization (@lukastaegert) +- [#4340](https://github.com/rollup/rollup/pull/4340): refactor: performance timers for node.js and browser (@dnalborczyk) +- [#4341](https://github.com/rollup/rollup/pull/4341): Implement shouldTransformCachedModule hook (@lukastaegert) +- [#4344](https://github.com/rollup/rollup/pull/4344): Directly restart Rollup when config file change is detected in watch mode (@lukastaegert) +- [#4347](https://github.com/rollup/rollup/pull/4347): Create a shallow copy when returning meta from resolveId (@lukastaegert) + +## 2.63.0 + +_2022-01-04_ + +### Features + +- Report a helpful error if rollup exits due to an empty event loop when using `this.load` (#4320) +- Allow directly mutating ModuleInfo.meta for modules and never replace this object (#4328) +- Detect additional side effect free array prototype methods (#4332) + +### Bug Fixes + +- Do not watch if CLI watch options are specified but `--watch` is missing (#4335) + +### Pull Requests + +- [#4320](https://github.com/rollup/rollup/pull/4320): Detect unfulfilled async hook actions and report error on exit (@kzc) +- [#4328](https://github.com/rollup/rollup/pull/4328): Make initial ModuleInfo.meta mutable and maintain object identity (@lukastaegert) +- [#4318](https://github.com/rollup/rollup/pull/4318): Stabilize watch tests (@lukastaegert) +- [#4331](https://github.com/rollup/rollup/pull/4331): Improve JS docs example (@lukastaegert) +- [#4332](https://github.com/rollup/rollup/pull/4332): add support for Array.prototype.findLast,findLastIndex (@dnalborczyk) +- [#4333](https://github.com/rollup/rollup/pull/4333): convert utils.transform to async function (@dnalborczyk) +- [#4335](https://github.com/rollup/rollup/pull/4335): Do not watch unless --watch is specified explicitly (@lukastaegert) +- [#4338](https://github.com/rollup/rollup/pull/4338): Add build delay for plugin event test (@lukastaegert) + +## 2.62.0 + +_2021-12-24_ + +### Features + +- Mark additional string prototype methods as side-effect-free and correct typings of existing ones (#4299) +- Mark additional array prototype methods as side-effect-free and correct typings of existing ones (#4309) +- Expose if a module is included after tree-shaking in its ModuleInfo (#4305) + +### Bug Fixes + +- Fix how fsevents is included to improve watch mode on MacOS (#4312) + +### Pull Requests + +- [#4299](https://github.com/rollup/rollup/pull/4299): Add additional string prototype methods (@dnalborczyk) +- [#4300](https://github.com/rollup/rollup/pull/4300): Bump deps, fix expected test result for core-js (@dnalborczyk) +- [#4302](https://github.com/rollup/rollup/pull/4302): Replace type assertion with type guard (@dnalborczyk) +- [#4304](https://github.com/rollup/rollup/pull/4304): Re-use reserved names set (@dnalborczyk) +- [#4305](https://github.com/rollup/rollup/pull/4305): Expose isIncluded in module info (@william57m) +- [#4306](https://github.com/rollup/rollup/pull/4306): Fix git line breaks on windows (@dnalborczyk) +- [#4307](https://github.com/rollup/rollup/pull/4307): Add macos to pipeline (@dnalborczyk) +- [#4309](https://github.com/rollup/rollup/pull/4309): Add additional array prototype methods (@dnalborczyk) +- [#4311](https://github.com/rollup/rollup/pull/4311): Add Deno instructions to docs (@jespertheend) +- [#4312](https://github.com/rollup/rollup/pull/4312): fsevents integration (@dnalborczyk) +- [#4313](https://github.com/rollup/rollup/pull/4313): Remove non-existing static functions from known globals (@dnalborczyk) + +## 2.61.1 + +_2021-12-11_ + +### Bug Fixes + +- Only resolve this.load once the code of the module is available (#4296) + +### Pull Requests + +- [#4296](https://github.com/rollup/rollup/pull/4296): Make sure this.load waits for modules that are already loading (@lukastaegert) +- [#4298](https://github.com/rollup/rollup/pull/4298): use set for reserved words (@dnalborczyk) + +## 2.61.0 + +_2021-12-09_ + +### Features + +- Support ergonomic brand checks for private fields (#4293) + +### Bug Fixes + +- Improve handling of directory creation on systems with restrictive open files limit (#4288) + +### Pull Requests + +- [#4288](https://github.com/rollup/rollup/pull/4288): modifymkdirpath (@mgrabowski84) +- [#4293](https://github.com/rollup/rollup/pull/4293): bump deps (@dnalborczyk) + +## 2.60.2 + +_2021-11-30_ + +### Bug Fixes + +- Produce correct output when dynamic import paths contain quotes (#4286) + +### Pull Requests + +- [#4286](https://github.com/rollup/rollup/pull/4286): Escape dynamic import paths (@danielroe) + +## 2.60.1 + +_2021-11-22_ + +### Bug Fixes + +- Make sure virtual files have proper file extensions when preserving modules (#4270) + +### Pull Requests + +- [#4270](https://github.com/rollup/rollup/pull/4270): Use entryFileNames when generating filenames for virtual modules (@BPScott) + +## 2.60.0 + +_2021-11-11_ + +### Features + +- Add `this.load` context function to load, transform and parse modules without adding them to the graph (#4234) +- Sanitize non-url-safe characters in generated chunk names by default (#4262) +- Support ESM plugins via command line (#4265) + +### Pull Requests + +- [#4234](https://github.com/rollup/rollup/pull/4234): Plugin context function for pre-loading modules (@lukastaegert) +- [#4262](https://github.com/rollup/rollup/pull/4262): exclude invalid URL chars (@danielroe) +- [#4265](https://github.com/rollup/rollup/pull/4265): support loading ESM plugins from the CLI via --plugin (@kzc) + +## 2.59.0 + +_2021-11-01_ + +### Features + +- Support static class initialization blocks (#4249) + +### Bug Fixes + +- Fix an issue with the CommonJS plugin when module.exports has inherited properties (#4256) + +### Pull Requests + +- [#4236](https://github.com/rollup/rollup/pull/4236): typescript bug class field initialization order (@dnalborczyk) +- [#4249](https://github.com/rollup/rollup/pull/4249): Support for class static initialization block (@dnalborczyk and @lukastaegert) +- [#4256](https://github.com/rollup/rollup/pull/4256): Skip inherited properties in synthetic namespaces (@lukastaegert) + +## 2.58.3 + +_2021-10-25_ + +### Bug Fixes + +- Republish 2.58.1 with npm 6 as files were missing + +## 2.58.2 + +_2021-10-25_ + +### Bug Fixes + +- Republish 2.58.1 as files were missing + +## 2.58.1 + +_2021-10-25_ + +### Bug Fixes + +- Fix an issue with the CommonJS plugin when module.exports is falsy (#4247) + +### Pull Requests + +- [#4247](https://github.com/rollup/rollup/pull/4247): Handle falsy synthetic namespaces (@lukastaegert) + +## 2.58.0 + +_2021-10-01_ + +### Features + +- Add a flag to more reliably identify entry points in the `resolveId` hook (#4230) + +### Pull Requests + +- [#4230](https://github.com/rollup/rollup/pull/4230): Add isEntry flag to resolveId and this.resolve (@lukastaegert) +- [#4233](https://github.com/rollup/rollup/pull/4233): Remove unused rollup-plugin-typescript ambient module types (@dnalborczyk) +- [#4235](https://github.com/rollup/rollup/pull/4235): Update dependencies (@lukastaegert) + +## 2.57.0 + +_2021-09-22_ + +### Features + +- Add `generatedCode` option to allow Rollup to use es2015 features for smaller output and more efficient helpers (#4215) +- Improve AMD and SystemJS parsing performance by wrapping relevant functions in parentheses (#4215) +- Using `preferConst` will now show a warning with `strictDeprecations: true` (#4215) + +### Bug Fixes + +- Improve ES3 syntax compatibility by more consequently quoting reserved words as props in generated code (#4215) +- Do not use `Object.assign` in generated code to ensure ES5 compatibility without the need for polyfills (#4215) +- Support live-bindings in dynamic namespace objects that contain reexported external or synthetic namespaces (#4215) +- Use correct "this" binding in dynamic import expressions for CommonJS and AMD (#4215) +- Properly handle `shimMissingExports` for exports that are only used internally (#4215) +- Prevent unhandled rejection for failed module parsing (#4228) + +### Pull Requests + +- [#4212](https://github.com/rollup/rollup/pull/4212): chore: remove unused ambient types (@dnalborczyk) +- [#4215](https://github.com/rollup/rollup/pull/4215): Use ES2015 features in generated code snippets (@lukastaegert) +- [#4219](https://github.com/rollup/rollup/pull/4219): chore: bump rollup typescript, remove unused micromatch (@dnalborczyk) +- [#4220](https://github.com/rollup/rollup/pull/4220): chore: use forceConsistentCasingInFileNames in ts-config (@dnalborczyk) +- [#4224](https://github.com/rollup/rollup/pull/4224): prepare for useDefineForClassFields (@dnalborczyk) +- [#4228](https://github.com/rollup/rollup/pull/4228): fix: prevent UnhandledPromiseRejectionWarning when module resolution/parsing fails (@kherock) + +## 2.56.3 + +_2021-08-23_ + +### Bug Fixes + +- Make sure moduleInfo contains complete information about imported ids in the moduleParsed hook (#4208) + +### Pull Requests + +- [#4208](https://github.com/rollup/rollup/pull/4208): `ModuleInfo.importedIds` will return null if `resolvedIds[source]` is undefined (@FoxDaxian and @lukastaegert) + +## 2.56.2 + +_2021-08-10_ + +### Bug Fixes + +- Check if after simplification, an object pattern would become an expression statement or arrow function return value (#4204) + +### Pull Requests + +- [#4204](https://github.com/rollup/rollup/pull/4204): Do not create invalid code when simplifying object pattern assignments (@lukastaegert) + +## 2.56.1 + +_2021-08-08_ + +### Bug Fixes + +- Fix rendering of SystemJS export declarations initialized with a simplifiable expression (#4202) + +### Pull Requests + +- [#4202](https://github.com/rollup/rollup/pull/4202): Fix incorrect rendering of export declarations in SystemJS (@lukastaegert) + +## 2.56.0 + +_2021-08-05_ + +### Features + +- Create more efficient code for SystemJS exports (#4199) +- Extend `maxParallelFileReads` option to also throttle plugin load hooks (#4200) + +### Bug Fixes + +- Return correct value for postfix update expressions of exported variables (#4194) + +### Pull Requests + +- [#4199](https://github.com/rollup/rollup/pull/4199): Refine SystemJS export rendering (@lukastaegert) +- [#4200](https://github.com/rollup/rollup/pull/4200): Restrict parallel execution of load hook (@schummar) + +## 2.55.1 + +_2021-07-29_ + +### Bug Fixes + +- Improve CLI warning message for unused external imports (#4194) + +### Pull Requests + +- [#4194](https://github.com/rollup/rollup/pull/4194): Align batch warning for UNUSED_EXTERNAL_IMPORT to individual warning (@benmccann) + +## 2.55.0 + +_2021-07-28_ + +### Features + +- Support default export live-bindings when generating ESM output (#4182) + +### Bug Fixes + +- Always write `["default"]` as computed property when used as named export (#4182) +- Do not mask default export TDZ errors (#4182) + +### Pull Requests + +- [#4182](https://github.com/rollup/rollup/pull/4182): Use mutable bindings for default exports (@lukastaegert) + +## 2.54.0 + +_2021-07-25_ + +### Features + +- Extend UMD import.meta.url polyfill to support web workers (#4186) + +### Bug Fixes + +- Resolve an issue where certain uses of classes could lead to an infinite recursion (#4189) + +### Pull Requests + +- [#4186](https://github.com/rollup/rollup/pull/4186): Fix UMD import.meta.url inside web workers (@ceifa) +- [#4188](https://github.com/rollup/rollup/pull/4188): Fix typo in renderHelpers.ts (@eltociear) +- [#4189](https://github.com/rollup/rollup/pull/4189): Move long path recursion prevention to MemberExpression (@lukastaegert) +- [#4190](https://github.com/rollup/rollup/pull/4190): Stop recommending node-builtins (@curran) + +## 2.53.3 + +_2021-07-21_ + +### Bug Fixes + +- Solve an issue that could lead to severe memory issues and crashes when there are a lot of hoisted variables (#4183) + +### Pull Requests + +- [#4183](https://github.com/rollup/rollup/pull/4183): Avoid memory issues with hoisted variables (@lukastaegert) + +## 2.53.2 + +_2021-07-15_ + +### Bug Fixes + +- Identify additional TDZ situations in functions that are run more than once (#4177) +- Fix a scoping issue when a variable inside a catch scope matches the scope parameter's name (#4178) + +### Pull Requests + +- [#4177](https://github.com/rollup/rollup/pull/4177): Fix additional let/var init bugs (@kzc) +- [#4178](https://github.com/rollup/rollup/pull/4178): Correctly create outside variable when shadowed by catch parameter (@lukastaegert) + +## 2.53.1 + +_2021-07-11_ + +### Bug Fixes + +- Do not omit namespace reexports when `treeshake` is `false` (#4175) + +### Pull Requests + +- [#4175](https://github.com/rollup/rollup/pull/4175): Generate namespace objects when not tree-shaking (@lukastaegert) + +## 2.53.0 + +_2021-07-09_ + +### Features + +- Add `maxParallelFileReads` option to limit read operations with a default of 20 (#4170) + +### Pull Requests + +- [#4170](https://github.com/rollup/rollup/pull/4170): Limit parallel file reads to prevent "EMFILE: too many open files" error (@schummar) + +## 2.52.8 + +_2021-07-07_ + +### Bug Fixes + +- Automatically handle many use `var` before declaration and TDZ access scenarios correctly without the need for `treeshake.correctVarValueBeforeDeclaration` (#4148) + +### Pull Requests + +- [#4148](https://github.com/rollup/rollup/pull/4148): Fix var/const/let variable use before declaration (@kzc and @lukastaegert) + +## 2.52.7 + +_2021-07-02_ + +### Bug Fixes + +- Fix an issue where reassignments where not tracked through async function returns (#4163) + +### Pull Requests + +- [#4163](https://github.com/rollup/rollup/pull/4163): Deoptimize return values of async functions (@lukastaegert) + +## 2.52.6 + +_2021-07-01_ + +### Bug Fixes + +- Fix an issue where reassignments where not tracked through an await expression (#4162) + +### Pull Requests + +- [#4162](https://github.com/rollup/rollup/pull/4162): doptimize awaited expressions (@lukastaegert) + +## 2.52.5 + +_2021-07-01_ + +### Bug Fixes + +- Properly display parser errors not tied to a code location (#4160) + +### Pull Requests + +- [#4160](https://github.com/rollup/rollup/pull/4160): fix: max stack call error is caught on locate (@semoal) + +## 2.52.4 + +_2021-06-30_ + +### Bug Fixes + +- Fix an error when external namespaces are reexported across several files (#4159) + +### Pull Requests + +- [#4159](https://github.com/rollup/rollup/pull/4159): Properly handle double reexports from external namespaces (@lukastaegert) + +## 2.52.3 + +_2021-06-25_ + +### Bug Fixes + +- Fix an issue where code was wrongly removed when using vars in nested scopes (#4149) + +### Pull Requests + +- [#4149](https://github.com/rollup/rollup/pull/4149): Make sure the initializer of hoisted variables is deoptimized (@lukastaegert) + +## 2.52.2 + +_2021-06-21_ + +### Bug Fixes + +- Support falsy plugins in types (#4144) +- Do not require return value in renderChunkHook type (#4144) + +### Pull Requests + +- [#4144](https://github.com/rollup/rollup/pull/4144): Use TypeScript config and improve some types (@lukastaegert) + +## 2.52.1 + +_2021-06-17_ + +### Bug Fixes + +- Fix a memory leak in watch mode (#4142) + +### Pull Requests + +- [#4142](https://github.com/rollup/rollup/pull/4142): Make array and object prototype singletons immutable for now (@lukastaegert) + +## 2.52.0 + +_2021-06-16_ + +### Features + +- Add `--configPlugin` CLI option to apply plugins to the config file for e.g. TypeScript configs (#3835) +- Add "safest" and "smallest" presets to tree-shaking options for easier configuration (#4131) +- Add `treeshake.correctVarValueBeforeDeclaration` option to deoptimize `var` declarations (#4139) + +### Pull Requests + +- [#3835](https://github.com/rollup/rollup/pull/3835): Add typescript config support (@TheRealSyler) +- [#4131](https://github.com/rollup/rollup/pull/4131): Add presets to the tree-shaking options (@lukastaegert) +- [#4139](https://github.com/rollup/rollup/pull/4139): Add option to deoptimize var declarations for tree-shaking (@lukastaegert) +- [#4141](https://github.com/rollup/rollup/pull/4141): Update dependencies (@lukastaegert) + +## 2.51.2 + +_2021-06-11_ + +### Bug Fixes + +- Include modules imported from no-treeshake modules even if they would be empty (#4138) + +### Pull Requests + +- [#4138](https://github.com/rollup/rollup/pull/4138): Include all dependencies from modules with no-treeshake (@lukastaegert) + +## 2.51.1 + +_2021-06-08_ + +### Bug Fixes + +- Fix error when using `defineConfig` (#4134) + +### Pull Requests + +- [#4134](https://github.com/rollup/rollup/pull/4134): export `rollup.defineConfig` at runtime (@mshrtsr) + +## 2.51.0 + +_2021-06-06_ + +### Features + +- Add a helper for IntelliSense support in config files (#4127) + +### Bug Fixes + +- Improve performance when generating source maps (#4122) + +### Pull Requests + +- [#4122](https://github.com/rollup/rollup/pull/4122): User Map to optimize performance (@izevo) +- [#4127](https://github.com/rollup/rollup/pull/4127): Export defineConfig defines the auxiliary function of the configuration (@rxliuli) + +## 2.50.6 + +_2021-06-03_ + +### Bug Fixes + +- Do not consider the object spread operator as side effect when `propertyReadSideEffects` are false (#4119) +- Detect side effects when returning thenables from async arrow functions (#4120) + +### Pull Requests + +- [#4119](https://github.com/rollup/rollup/pull/4119): Respect propertyReadSideEffects in spread elements (@lukastaegert) +- [#4120](https://github.com/rollup/rollup/pull/4120): Detect async arrow thenable side effects (@lukastaegert) + +## 2.50.5 + +_2021-05-30_ + +### Bug Fixes + +- Detect side effects when accessing thenables (#4115) + +### Pull Requests + +- [#4114](https://github.com/rollup/rollup/pull/4114): use `colorette` instead of `turbocolor` (@ryuever) +- [#4115](https://github.com/rollup/rollup/pull/4115): Tracks side effects of thenables (@lukastaegert) + +## 2.50.4 + +_2021-05-29_ + +### Bug Fixes + +- Fix a situation where tree-shaking would stop including nodes prematurely (#4111) +- Track mutations and accessor side effects when using `__proto__` in an object literal (#4112) +- Check for getter effects when spreading an object (#4113) + +### Pull Requests + +- [#4111](https://github.com/rollup/rollup/pull/4111): Always request a new tree-shaking pass when deoptimizations of a node are first included (@lukastaegert) +- [#4112](https://github.com/rollup/rollup/pull/4112): Actually set the prototype when using a **proto** property (@lukastaegert) +- [#4113](https://github.com/rollup/rollup/pull/4113): Track access side effects when using object spread operator (@lukastaegert) + +## 2.50.3 + +_2021-05-28_ + +### Bug Fixes + +- Wrap parentheses around leading elements in simplified sequence expressions if this would otherwise lead to invalid code (#4110) +- Do not associate block soped variables in catch clauses with the clause parameter (#4108) +- Do not associate hoisted variables in catch clauses with outside variables if they match the parameter (#4108) +- Use correct "this" context for tagged template literal member expressions in simplified sequences (#4110) + +### Pull Requests + +- [#4108](https://github.com/rollup/rollup/pull/4108): Correctly handle catch declarations (@lukastaegert) +- [#4110](https://github.com/rollup/rollup/pull/4110): Invalid sequence expression simplification (@lukastaegert) + +## 2.50.2 + +_2021-05-27_ + +### Bug Fixes + +- Avoid unnecessary side effects when using methods like `.filter` and `.map` (#4103) +- Avoid crash when a module with moduleSideEffects no-treeshake imports a tree-shaken module (#4104) + +### Pull Requests + +- [#4103](https://github.com/rollup/rollup/pull/4103): Do not track side-effect-free array methods as side effects (@lukastaegert) +- [#4104](https://github.com/rollup/rollup/pull/4104): Fix crash when using inlineDynamicImports with no-treeshake (@lukastaegert) + +## 2.50.1 + +_2021-05-26_ + +### Bug Fixes + +- Do not associate pure annotations in simplified expressions with wrong elements (#4095) +- Prevent invalid code when simplified conditionals start with an IIFE function expression (#4099) + +### Pull Requests + +- [#4095](https://github.com/rollup/rollup/pull/4095): Correctly associate pure annotations and remove invalid ones (@lukastaegert) +- [#4099](https://github.com/rollup/rollup/pull/4099): Wrap leading function expression iifes in conditionals (@lukastaegert) + +## 2.50.0 + +_2021-05-25_ + +### Features + +- Only include last elements of comma expressions if they are used or have side effects (#4087) + +### Bug Fixes + +- Prevent a crash that could occur when calling object methods (#4091) + +### Pull Requests + +- [#4085](https://github.com/rollup/rollup/pull/4085): Switch to ESLint (@lukastaegert) +- [#4087](https://github.com/rollup/rollup/pull/4087): Drop unused last sequence element (@lukastaegert) +- [#4091](https://github.com/rollup/rollup/pull/4091): Prevent crash for recursive "this" deoptimization (@lukastaegert) + +## 2.49.0 + +_2021-05-23_ + +### Features + +- Detect side-effect-free static class methods and properties (#4018) +- Detect side-effect-free array elements (#4018) +- Do not apply deoptimizations from dead code (#4018) + +### Bug Fixes + +- Handle side effect detection for getters and setters added in untracked code (#4018) +- Track "this" mutations for methods, getters and setters (#4018) + +### Pull Requests + +- [#4018](https://github.com/rollup/rollup/pull/4018): Class method effects (@marijnh and @lukastaegert) + +## 2.48.0 + +_2021-05-15_ + +### Features + +- Add replacement to conditionally insert asset extensions in `entryFileNames` when preserving modules (#4077) + +### Bug Fixes + +- Fix crash when dynamically assigning to namespace members (#4070) +- Do not associate pure annotations in front of a semi-colon or comma with succeeding code (#4068) + +### Pull Requests + +- [#4068](https://github.com/rollup/rollup/pull/4068): ignore invalid trailing pure annotations (@kzc) +- [#4070](https://github.com/rollup/rollup/pull/4070): undefined `deoptimizePath` when the first element is empty string (@si3nloong) +- [#4071](https://github.com/rollup/rollup/pull/4071): add node.js v16 support (@dnalborczyk) +- [#4077](https://github.com/rollup/rollup/pull/4077): Add assetExtname replacement in entryFileNames (@BPScott) +- [#4080](https://github.com/rollup/rollup/pull/4080): Added Rollup logo in README.md (@priyanshurav) +- [#4081](https://github.com/rollup/rollup/pull/4081): fix comment regarding invalid annotation handling (@kzc) + +## 2.47.0 + +_2021-05-04_ + +### Features + +- Warn about ambiguous imports from combined external namespace reexports (#4064) +- In case of combined namespace reexports, always prefer local exports over external namespaces (#4064) +- Treat conflicting names in local namespace reexports as undefined (#4064) + +### Pull Requests + +- [#4064](https://github.com/rollup/rollup/pull/4064): Prefer locally defined exports and reexports over external namespaces (@lukastaegert) + +## 2.46.0 + +_2021-04-29_ + +### Features + +- Add option to disable file name sanitation (#4058) +- Add information about importers to unused external import warning (#4054) + +### Pull Requests + +- [#4042](https://github.com/rollup/rollup/pull/4042): Use Github actions only (@lukastaegert) +- [#4045](https://github.com/rollup/rollup/pull/4045): Fix REPL artefact branch reference (@lukastaegert) +- [#4046](https://github.com/rollup/rollup/pull/4046): Use codecov action for coverage (@lukastaegert) +- [#4054](https://github.com/rollup/rollup/pull/4054): Add to `UNUSED_EXTERNAL_IMPORT` warning information about the origin of the problem (@cawa-93) +- [#4058](https://github.com/rollup/rollup/pull/4058): Add sanitizeFileName option (@guybedford) + +## 2.45.2 + +_2021-04-13_ + +### Bug Fixes + +- Do not user a dynamic entry file name for naming a manual chunk (#4040) + +### Pull Requests + +- [#4040](https://github.com/rollup/rollup/pull/4040): Prioritize manual chunk name over dynamic entry id (@lukastaegert) + +## 2.45.1 + +_2021-04-10_ + +### Bug Fixes + +- Handle falsy return values from async plugin options hooks (#4039) + +### Pull Requests + +- [#4039](https://github.com/rollup/rollup/pull/4039): Do not fail when returning null or undefined from an async options hook (@lukastaegert) + +## 2.45.0 + +_2021-04-09_ + +### Features + +- Support private class instance methods and accessors (#4034) + +### Pull Requests + +- [#4034](https://github.com/rollup/rollup/pull/4034): feat: add support for private class methods (@dnalborczyk) + +## 2.44.0 + +_2021-03-29_ + +### Features + +- Add a new option `makeAbsoluteExternalsRelative` to opt out of renormalizing absolute external ids to relative ids (#4021) +- Extend the `resolveId` plugin hook to allow forcing or preventing renormalization of absolute external ids (#4021) +- Make the rendered code of individual modules available in the generated bundle (#4028) + +### Bug Fixes + +- Handle objects with `__proto__` properties correctly (#4019) + +### Pull Requests + +- [#4019](https://github.com/rollup/rollup/pull/4019): Deoptimize ObjectExpression when a `__proto__` property is present (@marijnh) +- [#4021](https://github.com/rollup/rollup/pull/4021): Improve absolute path handling (@lukastaegert) +- [#4026](https://github.com/rollup/rollup/pull/4026): chore: fix vscode launch config (change tdd to bdd) (@jameslahm) +- [#4027](https://github.com/rollup/rollup/pull/4027): Post comment for PRs from forks (@lukastaegert) +- [#4028](https://github.com/rollup/rollup/pull/4028): Expose rendered module code to generateBundle hook (@btd) + +## 2.43.1 + +_2021-03-28_ + +### Bug Fixes + +- Prevent infinite recursions in certain scenarios when calling object properties (#4025) + +### Pull Requests + +- [#4025](https://github.com/rollup/rollup/pull/4025): Handle recursive this mutation detection (@lukastaegert) + +## 2.43.0 + +_2021-03-27_ + +### Features + +- Track side effects of function properties in objects for better tree-shaking (#4011) + +### Pull Requests + +- [#4011](https://github.com/rollup/rollup/pull/4011): Disable pessimistic object deoptimization for calls when the called function doesn't ref this (@marijnh) +- [#4012](https://github.com/rollup/rollup/pull/4012): fix `sourcemap` reference in docs (@tjenkinson) +- [#4015](https://github.com/rollup/rollup/pull/4015): Use SIGTERM instead of SIGINT to kill test child processes in tests (@marijnh) + +## 2.42.4 + +_2021-03-24_ + +### Bug Fixes + +- Do not discard plugin return values when using perf option (#4010) + +### Pull Requests + +- [#4010](https://github.com/rollup/rollup/pull/4010): Return hook result inside promise with async timer end (@SuperOleg39) + +## 2.42.3 + +_2021-03-22_ + +### Bug Fixes + +- Do not ignore `#__PURE__` comments in front of optional chaining expressions (#4007) + +### Pull Requests + +- [#4007](https://github.com/rollup/rollup/pull/4007): Tree-shake pure call expressions with optional chaining (@lukastaegert) + +## 2.42.2 + +_2021-03-22_ + +### Bug Fixes + +- Use correct import.meta.url in relative imports from transpiled config files (#4005) + +### Pull Requests + +- [#4005](https://github.com/rollup/rollup/pull/4005): Use correct import.meta.url in config files (@lukastaegert) + +## 2.42.1 + +_2021-03-20_ + +### Bug Fixes + +- Do not produce unhandled Promise rejections when plugins throw while using the `perf` option (#4004) + +### Pull Requests + +- [#4004](https://github.com/rollup/rollup/pull/4004): Fixed unhandled promise rejections (@gluck) + +## 2.42.0 + +_2021-03-19_ + +### Features + +- Prevent infinite loops when several plugins are using `this.resolve` in their resolveId hook (#4000) + +### Pull Requests + +- [#4000](https://github.com/rollup/rollup/pull/4000): Break infinite loops in this.resolve (@lukastaegert) + +## 2.41.5 + +_2021-03-18_ + +### Bug Fixes + +- Make sure unused property accesses of external namespaces can be tree-shaken (#4001) + +### Pull Requests + +- [#4001](https://github.com/rollup/rollup/pull/4001): Do not count accessing members of an external namespace as side-effects (@lukastaegert) + +## 2.41.4 + +_2021-03-16_ + +### Bug Fixes + +- Do not replace external namespace imports with individual named imports to avoid changing behaviour with regard to missing exports (#3999) + +### Pull Requests + +- [#3999](https://github.com/rollup/rollup/pull/3999): Allow to safely probe external namespaces (@lukastaegert) + +## 2.41.3 + +_2021-03-16_ + +### Bug Fixes + +- Always retain arguments passed to empty object pattern parameters (#3998) + +### Pull Requests + +- [#3998](https://github.com/rollup/rollup/pull/3998): Do not create invalid code if a function argument is an empty object pattern (@lukastaegert) + +## 2.41.3 + +_2021-03-16_ + +### Bug Fixes + +- Always retain arguments passed to empty object pattern parameters (#3998) + +### Pull Requests + +- [#3998](https://github.com/rollup/rollup/pull/3998): Do not create invalid code if a function argument is an empty object pattern (@lukastaegert) + +## 2.41.2 + +_2021-03-12_ + +### Bug Fixes + +- Also remove sourcemaps comments if plugins return a pre-made ast (#3987) + +### Pull Requests + +- [#3987](https://github.com/rollup/rollup/pull/3987): Change removal of sourcemap comment (@yannayl) + +## 2.41.1 + +_2021-03-11_ + +### Pull Requests + +- [#3990](https://github.com/rollup/rollup/pull/3990): Add browser sourcemap and remove log (@lukastaegert) + +## 2.41.0 + +_2021-03-09_ + +### Features + +- Add option to `treeshake.propertyReadSideEffects` to keep all property accesses (#3985) + +### Bug Fixes + +- Also respect pure comment annotations when a plugin provides an AST in the transform hook provided they use this.parse (#3981) + +### Pull Requests + +- [#3981](https://github.com/rollup/rollup/pull/3981): Move pure comment annotation to Graph.contextParse (@yannayl) +- [#3985](https://github.com/rollup/rollup/pull/3985): implement --treeshake.propertyReadSideEffects=always to handle getters with side effects (@kzc) + +## 2.40.0 + +_2021-02-26_ + +### Features + +- Make sure that entry point variable names take precedence over variable names in dependencies when deconflicting (#3977) + +### Bug Fixes + +- Replace `:` in generated file names to prevent invalid files on Windows (#3972) + +### Pull Requests + +- [#3972](https://github.com/rollup/rollup/pull/3972): Don't allow `:` in file names (@lukastaegert) +- [#3976](https://github.com/rollup/rollup/pull/3976): Add soft breaks to guide to improve mobile experience (@lukastaegert) +- [#3977](https://github.com/rollup/rollup/pull/3977): Reverse module deconflicting order (@lukastaegert) + +## 2.39.1 + +_2021-02-23_ + +### Bug Fixes + +- Make sure local variables named Symbol, Object or Promise do not conflict with code generated by Rollup (#3971) + +### Pull Requests + +- [#3964](https://github.com/rollup/rollup/pull/3964): Remove extra word (@jamonholmgren) +- [#3971](https://github.com/rollup/rollup/pull/3971): Avoid conflicts with local variables named Symbol, Object, Promise (@lukastaegert) + +## 2.39.0 + +_2021-02-12_ + +### Features + +- Add "validate" option to verify generated chunks are valid JavaScript (#3952) + +### Bug Fixes + +- Always add exports properties for uninitialized named exports (#3957) +- Allow using an external namespace reexport together with named exports (#3959) +- Avoid invalid generated code in certain scenarios with SystemJS exports (#3960) + +### Pull Requests + +- [#3952](https://github.com/rollup/rollup/pull/3952): implement `validate` output option and `--validate` CLI option (@kzc) +- [#3956](https://github.com/rollup/rollup/pull/3956): Update dependencies, fix fsevents issue (@lukastaegert) +- [#3957](https://github.com/rollup/rollup/pull/3957): Make sure uninitialised exports turn up via .hasOwnProperty for non-ES formats (@lukastaegert) +- [#3959](https://github.com/rollup/rollup/pull/3959): Allow overriding individual exports of reexported external namespaces (@lukastaegert) +- [#3960](https://github.com/rollup/rollup/pull/3960): Make sure system exports are valid JavaScript (@lukastaegert) + +## 2.38.5 + +_2021-02-05_ + +### Bug Fixes + +- Prevent invalid code when simplifying assignments and delcarations (#3951) +- Prevent behaviour-changing line-breaks when simplifying assignments in return statements (#3951) +- Slightly improve white-space rendering when simplifying certain expressions (#3951) + +### Pull Requests + +- [#3951](https://github.com/rollup/rollup/pull/3951): Wrap simplified assignments if necessary (@lukastaegert) + +## 2.38.4 + +_2021-02-02_ + +### Bug Fixes + +- Do not change logic when tree-shaking declarations in if statements or loops (#3947) + +### Pull Requests + +- [#3947](https://github.com/rollup/rollup/pull/3947): Do not tear apart declarations in loop or if bodies (@lukastaegert) + +## 2.38.3 + +_2021-02-01_ + +### Bug Fixes + +- Prevent an unexpected live-binding when default exporting a synthetic named export (#3946) + +### Pull Requests + +- [#3945](https://github.com/rollup/rollup/pull/3945): Upgrade chokidar and fsevents for Apple M1 compatibility (@threepointone) +- [#3946](https://github.com/rollup/rollup/pull/3946): Make sure default exports snapshot synthetic named exports (@lukastaegert) + +## 2.38.2 + +_2021-01-31_ + +### Bug Fixes + +- Do not generate invalid code for partially tree-shaken declarations in for loops (#3943) +- Always include function bodies of functions in side-effect-free modules (#3944) + +### Pull Requests + +- [#3943](https://github.com/rollup/rollup/pull/3943): Do not partially tree-shake unused declarations in for loops (@lukastaegert) +- [#3944](https://github.com/rollup/rollup/pull/3944): Correctly include functions with side effects from side-effect-free modules (@lukastaegert) + +## 2.38.1 + +_2021-01-28_ + +### Bug Fixes + +- Fix internal error when resolving a missing entry point in the browser build (#3935) + +### Pull Requests + +- [#3935](https://github.com/rollup/rollup/pull/3935): fix: remove isolated resolve() for compat with browser distribution (@cmorten and @lukastaegert) +- [#3936](https://github.com/rollup/rollup/pull/3936): Ensure test after() callback is always executed (@Benjamin-Dobell) +- [#3937](https://github.com/rollup/rollup/pull/3937): Modernize references to other software (@ludofischer) + +## 2.38.0 + +_2021-01-22_ + +### Features + +- Entirely remove declared variables that only have an initializer side effect (#3933) + +### Pull Requests + +- [#3933](https://github.com/rollup/rollup/pull/3933): Tree-shake unused declarations while keeping initializer side-effects (@lukastaegert) + +## 2.37.1 + +_2021-01-20_ + +### Pull Requests + +- [#3929](https://github.com/rollup/rollup/pull/3929): Deduplicate acorn import (@lukastaegert) + +## 2.37.0 + +_2021-01-19_ + +### Features + +- Always check modules for side effects that only indirectly reexport a used variable (#3840) +- Warn if a circular dependency would cause wrong execution order when preserving modules (#3840) + +### Bug Fixes + +- Allow consuming synthetic exports via modules that reexport a namespace (#3894) +- Do not crash for circular default reexports (#3840) +- Do not crash for circular synthetic namespaces (#3840) +- Improve circular dependency execution order in certain scenarios (#3840) + +### Pull Requests + +- [#3840](https://github.com/rollup/rollup/pull/3840): Improve circular dependency execution order (@lukastaegert) +- [#3894](https://github.com/rollup/rollup/pull/3894): Always respect synthetic namespaces in namespace reexport (@lukastaegert) + +## 2.36.2 + +_2021-01-16_ + +### Bug Fixes + +- Fix an issue where invalid code was generated for unused assignments with side effects (#3926) + +### Pull Requests + +- [#3926](https://github.com/rollup/rollup/pull/3926): Correctly simplify assignments with parentheses (@lukastaegert) + +## 2.36.1 + +_2021-01-06_ + +### Bug Fixes + +- Solve issues that result in invalid code when partially removing assignments (#3921) + +### Pull Requests + +- [#3921](https://github.com/rollup/rollup/pull/3921): Prevent invalid code when removing assignment target of side-effectful object expression (@lukastaegert) + +## 2.36.0 + +_2021-01-05_ + +### Features + +- Support partial tree-shaking of chained assignments and unused assignment targets (#3919) + +### Pull Requests + +- [#3919](https://github.com/rollup/rollup/pull/3919): Treeshake chained assignment expressions (@lukastaegert) + +## 2.35.1 + +_2020-12-14_ + +### Bug Fixes + +- Allow closing the bundle when watching in case of generate errors by adding the bundle to the error event (#3909) +- Automatically close all bundles on generate errors when watching and using the CLI (#3909) +- Try to create remaining bundles when watching and one of them throws (#3909) + +### Pull Requests + +- [#3909](https://github.com/rollup/rollup/pull/3909): Forward bundle through watch error events (@lukastaegert) + +## 2.35.0 + +_2020-12-14_ + +### Features + +- Add `closeBundle` hook that is triggered by `bundle.close()` in the JS API (#3883) + +### Pull Requests + +- [#3883](https://github.com/rollup/rollup/pull/3883): Revert pattern to folder export (@intrnl) + +## 2.34.2 + +_2020-12-06_ + +### Bug Fixes + +- Revert pattern export change (#3898) + +### Pull Requests + +- [#3898](https://github.com/rollup/rollup/pull/3898): Revert pattern to folder export (@lukastaegert) + +## 2.34.1 + +_2020-12-03_ + +### Bug Fixes + +- Avoid Node deprecation warning by using a pattern export for nested Rollup files (#3896) + +### Pull Requests + +- [#3887](https://github.com/rollup/rollup/pull/3887): Run memory leak test on all systems (@lukastaegert) +- [#3892](https://github.com/rollup/rollup/pull/3892): Add pull_request to windows github actions (@shellscape) +- [#3893](https://github.com/rollup/rollup/pull/3893): Update dependencies (@lukastaegert) +- [#3896](https://github.com/rollup/rollup/pull/3896): Replace deprecated folder package export with pattern export (@lukastaegert) + +## 2.34.0 + +_2020-11-29_ + +### Features + +- Support RequireJS comaptible AMD ids in code-splitting builds via amd.autoId (#3867) +- Allow adding an AMD id base path (#3867) + +### Bug Fixes + +- Warn when using an constant AMD id in a code-splitting build (#3867) + +### Pull Requests + +- [#3867](https://github.com/rollup/rollup/pull/3867): Implement amd.autoId/amd.basePath options (@tjenkinson) + +## 2.33.3 + +_2020-11-18_ + +### Bug Fixes + +- Do not use `.js` extension when importing AMD files from a UMD bundle (#3872) + +### Pull Requests + +- [#3861](https://github.com/rollup/rollup/pull/3861): Update chat/support links (@shellscape) +- [#3872](https://github.com/rollup/rollup/pull/3872): Also removeExtensionFromRelativeAmdId in UMD finaliser (@tjenkinson) + +## 2.33.2 + +_2020-11-14_ + +### Bug Fixes + +- Fix an issue where statements were ignored after a conditional return in a labeled statement (#3871) + +### Pull Requests + +- [#3871](https://github.com/rollup/rollup/pull/3871): Correctly track label usage in try statements (@Amareis) + +## 2.33.1 + +_2020-11-02_ + +### Bug Fixes + +- Add `syntheticNamedExports` to `this.getModuleInfo` to align with documentation (#3847) + +### Pull Requests + +- [#3847](https://github.com/rollup/rollup/pull/3847): Expose syntheticNamedExports to ModuleInfo (@Amareis) +- [#3852](https://github.com/rollup/rollup/pull/3852): Fix typo on docs (@jpsc) + +## 2.33.0 + +_2020-11-01_ + +### Features + +- Add parameter to "watchChange" hook to denote if a change was an addition, update or deletion (#3841) +- Add "closeWatcher" hook to allow plugins to clean up resources when the watcher is closed (#3841) +- Add "this.getWatchFiles" function to plugin context to get the current set of watched files (#3841) + +### Pull Requests + +- [#3841](https://github.com/rollup/rollup/pull/3841): Improved watcher hooks (@Amareis) +- [#3848](https://github.com/rollup/rollup/pull/3848): Add options hook to asyncpluginhooks (@intrnl) + +## 2.32.1 + +_2020-10-21_ + +### Bug Fixes + +- Print warning location for plugin warnings if only `loc` is supplied (#3824) + +### Pull Requests + +- [#3824](https://github.com/rollup/rollup/pull/3824): plugin warnings not showing warning.loc (@luciotato) + +## 2.32.0 + +_2020-10-16_ + +### Features + +- Extend `preserveEntrySignatures` with a value `"exports-only"` to allow extension only if an entry does not have exports (#3823) + +### Pull Requests + +- [#3823](https://github.com/rollup/rollup/pull/3823): Add "exports-only" option to preserveSignature (@lukastaegert) + +## 2.31.0 + +_2020-10-15_ + +### Features + +- When using the `output.moduleToStringTag` option, also add the tag to entries with exports and simulated external namespaces (#3822) +- Add the `__esModule` interop marker to IIFE global variables unless `output.esModule` is turned off (#3822) + +### Pull Requests + +- [#3822](https://github.com/rollup/rollup/pull/3822): Add module toStringTag to entries and interop namespaces (@lukastaegert) + +## 2.30.0 + +_2020-10-13_ + +### Features + +- Add `moduleParsed` hook that is called for each module once code and AST are available (#3813) +- Include code and AST in `this.getModuleInfo` (#3813) + +### Bug Fixes + +- Provide the original Acorn AST instead of the internal one when resolving dynamic imports that contain non-trivial expressions (#3813) + +### Pull Requests + +- [#3813](https://github.com/rollup/rollup/pull/3813): Add moduleParsed plugin hook (@lukastaegert) +- [#3815](https://github.com/rollup/rollup/pull/3815): Docs: wile => while (@tjenkinson) +- [#3817](https://github.com/rollup/rollup/pull/3817): Docs: fix code snippet (@codefrau) +- [#3818](https://github.com/rollup/rollup/pull/3818): Update documentation on configuring Babel, removing the section on passing '{"modules": false}' as that is no longer needed since Babel 7 (@Robin-Hoodie) + +## 2.29.0 + +_2020-10-08_ + +### Features + +- Allow passing custom options to other plugins via `this.resolve` (#3807) +- Allow attaching custom meta information to modules when resolving, loading or transforming (#3807) +- Do not throw but return `null` when using `this.getModuleInfo` for an unknown id (#3807) + +### Bug Fixes + +- Trigger build in watch mode when files are added to a watched directory (#3812) +- Make `code` optional when transforming modules (#3807) + +### Pull Requests + +- [#3807](https://github.com/rollup/rollup/pull/3807): Implement new APIs for inter-plugin communication (@lukastaegert) +- [#3808](https://github.com/rollup/rollup/pull/3808): Document that the default value of --format is 'es' (@jameshfisher) +- [#3812](https://github.com/rollup/rollup/pull/3812): Watch: listen for new files added to a directory (@dmitrage) + +## 2.28.2 + +_2020-09-24_ + +### Bug Fixes + +- Fix a source of possible variable name conflicts when using preserveModules with SystemJS (#3796) + +### Pull Requests + +- [#3792](https://github.com/rollup/rollup/pull/3792): add documentation for output.PreserveModulesRoot (@davidroeca) +- [#3796](https://github.com/rollup/rollup/pull/3796): Fix SystemJS default variable conflict (@lukastaegert) + +## 2.28.1 + +_2020-09-21_ + +### Bug Fixes + +- Fix a path slash issue when using the preserveModulesRoot option on Windows (#3791) + +### Pull Requests + +- [#3791](https://github.com/rollup/rollup/pull/3791): Fix preserveModulesRoot path on Windows (@lukastaegert) + +## 2.28.0 + +_2020-09-21_ + +### Features + +- Add an option to treat modules at a given path as located at root when preserving modules (#3786) + +### Pull Requests + +- [#3786](https://github.com/rollup/rollup/pull/3786): Add preserveModulesRoot config option (@davidroeca) + +## 2.27.1 + +_2020-09-17_ + +### Bug Fixes + +- Do not fail when using ES module imports in symlinked config files (#3783) + +### Pull Requests + +- [#3783](https://github.com/rollup/rollup/pull/3783): Handle loading symlinked config files (@lukastaegert) + +## 2.27.0 + +_2020-09-16_ + +### Features + +- Support specifying a file extension when reading from stdin (#3775) + +### Bug Fixes + +- Do not break logic if a branch with hoisted variables is tree-shaken in an else-if statement (#3782) + +### Pull Requests + +- [#3770](https://github.com/rollup/rollup/pull/3770): Docs: Exception for babel plugin and commonjs plugin (@jsk7) +- [#3775](https://github.com/rollup/rollup/pull/3775): add ability to specify stdin file extension via --stdin=ext (@kzc) +- [#3782](https://github.com/rollup/rollup/pull/3782): Handle hoisted variables in dead branches of nested if statements (@lukastaegert) + +## 2.26.11 + +_2020-09-08_ + +### Bug Fixes + +- Do not fail for unknown nodes as if statement branches (#3769) + +### Pull Requests + +- [#3769](https://github.com/rollup/rollup/pull/3769): Handle debugger statements as if-statement branches (@lukastaegert) + +## 2.26.10 + +_2020-09-04_ + +### Bug Fixes + +- Do not create invalid code when simplifying expressions in return statements that contain line comments (#3762) + +### Pull Requests + +- [#3757](https://github.com/rollup/rollup/pull/3757): Fix api docs loadconfigfile (@maxwell8888) +- [#3762](https://github.com/rollup/rollup/pull/3762): Handle line-comments when removing line-breaks to prevent ASI (@lukastaegert) + +## 2.26.9 + +_2020-09-01_ + +### Bug Fixes + +- Add regular expression support to watch include/exclude types (#3754) + +### Pull Requests + +- [#3754](https://github.com/rollup/rollup/pull/3754): Add RegExp to the include and exclude fields of the WatcherOptions type (@dagda1) +- [#3756](https://github.com/rollup/rollup/pull/3756): Update FAQ: I think it was meant "external" instead of "other-entry.js" (@madacol) + +## 2.26.8 + +_2020-08-29_ + +### Bug Fixes + +- Make sure that both unresolved and resolved ids are passed to the `external` option in all cases (#3753) + +### Pull Requests + +- [#3753](https://github.com/rollup/rollup/pull/3753): Also pass resolved ids to external if they use the object for (@lukastaegert) + +## 2.26.7 + +_2020-08-28_ + +### Bug Fixes + +- Avoid invalid code when rendering hoisted variable declarations from dead branches (#3752) +- Mark the `options` parameter of `this.parse` as optional for TypeScript plugins (#3750) + +### Pull Requests + +- [#3750](https://github.com/rollup/rollup/pull/3750): Make `options` of `PluginContext#parse` optional (@intrnl) +- [#3752](https://github.com/rollup/rollup/pull/3752): Extract hoisted variables from dead branches (@lukastaegert) + +## 2.26.6 + +_2020-08-27_ + +### Bug Fixes + +- Avoid conflicts between the namespace of synthetic named exports and local variables (#3747) + +### Pull Requests + +- [#3747](https://github.com/rollup/rollup/pull/3747): Properly deconflict synthetic named exports (@lukastaegert) + +## 2.26.5 + +_2020-08-22_ + +### Bug Fixes + +- Use correctly deconflicted variable names for reexported namespaces in ES formats (#3742) + +### Pull Requests + +- [#3742](https://github.com/rollup/rollup/pull/3742): Avoid variable name conflict when reexporting several namespaces from a chunk (@lukastaegert) + +## 2.26.4 + +_2020-08-19_ + +### Bug Fixes + +- Fix a situation where invalid code was rendered when dynamically importing a module with synthetic named exports when preserving modules (#3738) +- Create a proper namespace object when in a non-es format, a namespace is imported from a chunk with `default` export mode (#3738) +- Use the same variable when in a chunk, a namespace is both imported and reexported as a binding (#3738) +- Do not include the synthetic namespace in static entry points unless it is actually used (#3738) +- Make sure the chunking of one output does not interfere with the namespace objects of another output (#3738) + +### Pull Requests + +- [#3738](https://github.com/rollup/rollup/pull/3738): Improve synthetic entry handling (@lukastaegert) + +## 2.26.3 + +_2020-08-16_ + +### Bug Fixes + +- Fix a situation where line-breaks in a nested simplified conditional expression could result in broken code (#3734) + +### Pull Requests + +- [#3734](https://github.com/rollup/rollup/pull/3734): Prevent ASI when simplifying a nested logical expression (@lukastaegert) + +## 2.26.2 + +_2020-08-16_ + +### Bug Fixes + +- Fix a situation where line-breaks in a simplified conditional expression could result in broken code (#3732) + +### Pull Requests + +- [#3732](https://github.com/rollup/rollup/pull/3732): Prevent unintended ASI for nested conditionals (@lukastaegert) + +## 2.26.1 + +_2020-08-16_ + +### Bug Fixes + +- Correctly render external namespace imports when only generating SystemJS output (#3731) + +### Pull Requests + +- [#3731](https://github.com/rollup/rollup/pull/3731): Render system namespace import (@sastan and @lukastaegert) + +## 2.26.0 + +_2020-08-15_ + +### Features + +- Add a new entry `importedBindings` to the bundle information to list bindings per dependency (#3722) + +### Bug Fixes + +- Do not render an invalid UMD wrapper when no bindings are imported from a dependency (#3724) +- Avoid situations where removing the `else` branch from an `if` statement might catch the `else` branch from another one (#3725) + +### Pull Requests + +- [#3722](https://github.com/rollup/rollup/pull/3722): Add import specifiers to bundle information (@lukastaegert) +- [#3724](https://github.com/rollup/rollup/pull/3724): Fix missing variables for UMD and IIFE builds (@lukastaegert) +- [#3725](https://github.com/rollup/rollup/pull/3725): Do not entirely remove else branch if another else branch might accidentally be referenced (@lukastaegert) + +## 2.25.0 + +_2020-08-14_ + +### Features + +- Add `--failAfterWarnings` CLI flag that will complete builds with warnings but return an error at the end (#3712) + +### Pull Requests + +- [#3712](https://github.com/rollup/rollup/pull/3712): Implement `--failAfterWarnings` flag (@tjenkinson) + +## 2.24.0 + +_2020-08-13_ + +### Features + +- Allow defining interop per dependency via a function (#3710) +- Support interop "auto" as a more compatible version of "true" (#3710) +- Support interop "default" and "esModule" to avoid unnecessary interop helpers (#3710) +- Support interop "defaultOnly" for simplified helpers and Node ESM interop compatible output (#3710) +- Respect interop option for external dynamic imports (#3710) +- Support live-bindings for external default imports in non-ES formats unless "externalLiveBindings" is "false" (#3710) +- Use shared default interop helpers for AMD, UMD and IIFE formats (#3710) +- Avoid unnecessarily deconflicted module variables in non-ES formats (#3710) +- Freeze generated interop namespace objects (#3710) +- Always mark interop helpers as pure (#3710) +- Avoid default export interop if there is already an interop namespace object (#3710) +- Sort all `require` statements to the top in CommonJS output for easier back-transpilation to ES modules by other tools (#3710) + +### Bug Fixes + +- Handle accessing `super` in static class fields (#3720) +- Deconflict the names of helper variables introduced for interop (#3710) +- Generate proper namespace objects for static namespace imports in non-ES formats (#3710) +- Do not add unused interop helpers when using the renderDynamicImport hook (#3710) + +### Pull Requests + +- [#3710](https://github.com/rollup/rollup/pull/3710): Rework interop handling (@lukastaegert) +- [#3720](https://github.com/rollup/rollup/pull/3720): Handle super in static class fields (@lukastaegert) + +## 2.23.1 + +_2020-08-07_ + +### Bug Fixes + +- Fix an issue where dynamically importing an entry point could return a malformed namespace for CJS and AMD formats (#3709) + +### Pull Requests + +- [#3709](https://github.com/rollup/rollup/pull/3709): Properly construct namespace when dynamically importing chunks with facades in default export mode (@lukastaegert) + +## 2.23.0 + +_2020-07-23_ + +### Features + +- Handle environments with only globalThis in UMD output (#3691) + +### Pull Requests + +- [#3691](https://github.com/rollup/rollup/pull/3691): Check for globalThis in UMD wrapper (@lukastaegert) + +## 2.22.2 + +_2020-07-21_ + +### Bug Fixes + +- Always generate correct exports when an implicit entry is reexporting from another module (#3688) + +### Pull Requests + +- [#3688](https://github.com/rollup/rollup/pull/3688): Include all relevant modules to generate reexports for implicit dependencies (@lukastaegert) + +## 2.22.1 + +_2020-07-18_ + +### Bug Fixes + +- Remove unused arguments when calling a conditional expression (#3680) + +### Pull Requests + +- [#3680](https://github.com/rollup/rollup/pull/3680): Allow tree-shaking of arguments of functions that are returned by conditional expressions (@lukastaegert) + +## 2.22.0 + +_2020-07-18_ + +### Features + +- Allow resolving synthetic named exports via an arbitrary export name (#3657) +- Display a warning when the user does not explicitly select an export mode and would generate a chunk with default export mode when targeting CommonJS (#3657) + +### Pull Requests + +- [#3657](https://github.com/rollup/rollup/pull/3657): Add basic support for using a non-default export for syntheticNamedExports (@lukastaegert) +- [#3659](https://github.com/rollup/rollup/pull/3659): Warn when implicitly using default export mode (@lukastaegert) + +## 2.21.0 + +_2020-07-07_ + +### Features + +- Allow plugins to disable tree-shaking for individual modules to ensure even empty modules are associated with chunks (#3663) + +### Pull Requests + +- [#3663](https://github.com/rollup/rollup/pull/3663): Disable treeshaking per module (@lukastaegert) + +## 2.20.0 + +_2020-07-06_ + +### Features + +- Support using a function to generate different chunk and asset naming patterns per chunk or asset (#3658) +- Add `referencedFiles` property to the chunk info in generateBundle to list referenced assets (#3661) + +### Pull Requests + +- [#3658](https://github.com/rollup/rollup/pull/3658): Add ability to use a function that returns a pattern string in all places where you could use a pattern string before (@frank-dspeed) +- [#3661](https://github.com/rollup/rollup/pull/3661): Add referenced files to bundle (@lukastaegert) + +## 2.19.0 + +_2020-07-05_ + +### Features + +- Allow plugins to return a Promise in the options hook (#3660) + +### Pull Requests + +- [#3660](https://github.com/rollup/rollup/pull/3660): Make options hooks async (@TomerAberbach) + +## 2.18.2 + +_2020-07-02_ + +### Bug Fixes + +- Do not remove spread element args when the corresponding positional parameter is unused (#3652) + +### Pull Requests + +- [#3652](https://github.com/rollup/rollup/pull/3652): Do not tree-shake arguments that contain a spread element (@lukastaegert) + +## 2.18.1 + +_2020-06-26_ + +### Bug Fixes + +- Make sure synthetic exports are present when a module is imported dynamically (#3648) +- Strip the `rollup-plugin-` prefix off the plugin name when looking for the plugin export in a CLI plugin without a default export (#3647) +- Convert plugin names with dashes to camel case when looking for the plugin export in a CLI plugin without a default export (#3647) + +### Pull Requests + +- [#3647](https://github.com/rollup/rollup/pull/3647): Strip rollup-plugin prefix to find named plugin exports, throw when export cannot be found (@lukastaegert) +- [#3648](https://github.com/rollup/rollup/pull/3648): Always create a dynamic namespace object when a module with synthetic named exports is imported dynamically (@lukastaegert) + ## 2.18.0 -*2020-06-22* + +_2020-06-22_ ### Features -* `inlineDynamicImports`, `manualChunks` and `preserveModules` can now be used as output options (#3645) -* Use sourcemaps for certain warnings that reference source code locations (#3645) + +- `inlineDynamicImports`, `manualChunks` and `preserveModules` can now be used as output options (#3645) +- Use sourcemaps for certain warnings that reference source code locations (#3645) ### Bug Fixes -* `this.getFileName` will now always return the correct file name for chunks when multiple outputs are created (#3645) + +- `this.getFileName` will now always return the correct file name for chunks when multiple outputs are created (#3645) ### Pull Requests -* [#3645](https://github.com/rollup/rollup/pull/3645): Per output chunking (@lukastaegert) + +- [#3645](https://github.com/rollup/rollup/pull/3645): Per output chunking (@lukastaegert) ## 2.17.1 -*2020-06-19* + +_2020-06-19_ ### Bug Fixes -* Properly resolve accessing properties of namespace members again (#3643) + +- Properly resolve accessing properties of namespace members again (#3643) ### Pull Requests -* [#3643](https://github.com/rollup/rollup/pull/3643): Fix accessing nested properties of namespaces (@lukastaegert) + +- [#3643](https://github.com/rollup/rollup/pull/3643): Fix accessing nested properties of namespaces (@lukastaegert) ## 2.17.0 -*2020-06-17* + +_2020-06-17_ ### Features -* When importing Rollup via package.exports, always fall back to the browser ESM build for non-Node environments (#3634) -* Create more efficient code when handling namespace mutations (#3637) + +- When importing Rollup via package.exports, always fall back to the browser ESM build for non-Node environments (#3634) +- Create more efficient code when handling namespace mutations (#3637) ### Bug Fixes -* Fix a severe performance regression when the same module is imported by a lot of modules (#3641) -* Properly escape special characters in imports (#3638) + +- Fix a severe performance regression when the same module is imported by a lot of modules (#3641) +- Properly escape special characters in imports (#3638) ### Pull Requests -* [#3634](https://github.com/rollup/rollup/pull/3634): Set browser build in exports (@guybedford) -* [#3637](https://github.com/rollup/rollup/pull/3637): Do not include the whole namespace when illegally mutating a namespace (@lukastaegert) -* [#3638](https://github.com/rollup/rollup/pull/3638): Support backslash escaping, retain exact newline escaping (@guybedford) -* [#3641](https://github.com/rollup/rollup/pull/3641): Fix performance regression when a file is imported by many importers (@lukastaegert) + +- [#3634](https://github.com/rollup/rollup/pull/3634): Set browser build in exports (@guybedford) +- [#3637](https://github.com/rollup/rollup/pull/3637): Do not include the whole namespace when illegally mutating a namespace (@lukastaegert) +- [#3638](https://github.com/rollup/rollup/pull/3638): Support backslash escaping, retain exact newline escaping (@guybedford) +- [#3641](https://github.com/rollup/rollup/pull/3641): Fix performance regression when a file is imported by many importers (@lukastaegert) ## 2.16.1 -*2020-06-13* + +_2020-06-13_ ### Bug Fixes -* Do not produce invalid code when an external or chunk id contain quotes or line-breaks (#3632) -* Do not fail but emit a warning when mutating a namespace object (#3633) + +- Do not produce invalid code when an external or chunk id contain quotes or line-breaks (#3632) +- Do not fail but emit a warning when mutating a namespace object (#3633) ### Pull Requests -* [#3632](https://github.com/rollup/rollup/pull/3632): Handle single quote escaping in ids (@guybedford) -* [#3633](https://github.com/rollup/rollup/pull/3633): Turn namespace assignment error into a warning (@guybedford) + +- [#3632](https://github.com/rollup/rollup/pull/3632): Handle single quote escaping in ids (@guybedford) +- [#3633](https://github.com/rollup/rollup/pull/3633): Turn namespace assignment error into a warning (@guybedford) ## 2.16.0 -*2020-06-12* + +_2020-06-12_ ### Features -* Add support for numeric separators (#3626) -* Switch to finalized ESTree optional chaining AST (#3628) + +- Add support for numeric separators (#3626) +- Switch to finalized ESTree optional chaining AST (#3628) ### Pull Requests -* [#3626](https://github.com/rollup/rollup/pull/3626): Support numeric separator (@TrySound) -* [#3628](https://github.com/rollup/rollup/pull/3628): Acorn 7.3.0 upgrade (@guybedford) -* [#3631](https://github.com/rollup/rollup/pull/3631): Improve discoverability of `manualChunks` for code splitting (@zlamma) + +- [#3626](https://github.com/rollup/rollup/pull/3626): Support numeric separator (@TrySound) +- [#3628](https://github.com/rollup/rollup/pull/3628): Acorn 7.3.0 upgrade (@guybedford) +- [#3631](https://github.com/rollup/rollup/pull/3631): Improve discoverability of `manualChunks` for code splitting (@zlamma) ## 2.15.0 -*2020-06-08* + +_2020-06-08_ ### Features -* Allow to skip watching some configs via `watch: false` (#3620) -* Provide the resolved sourcemap path to `sourcemapPathTransform` (#3617) + +- Allow to skip watching some configs via `watch: false` (#3620) +- Provide the resolved sourcemap path to `sourcemapPathTransform` (#3617) ### Pull Requests -* [#3617](https://github.com/rollup/rollup/pull/3617): Update sourcemapPathTransform to also take the path to the sourcemap file as a second argument (@dgoldstein0) -* [#3620](https://github.com/rollup/rollup/pull/3620): Rollup watch only one config in exported array (@luwol03) + +- [#3617](https://github.com/rollup/rollup/pull/3617): Update sourcemapPathTransform to also take the path to the sourcemap file as a second argument (@dgoldstein0) +- [#3620](https://github.com/rollup/rollup/pull/3620): Rollup watch only one config in exported array (@luwol03) ## 2.14.0 -*2020-06-07* + +_2020-06-07_ ### Features -* Make `this.meta.watchMode` available for plugins to detect watch mode (#3616) + +- Make `this.meta.watchMode` available for plugins to detect watch mode (#3616) ### Bug Fixes -* Handle exporting the same binding with different names in SystemJS (#3575) + +- Handle exporting the same binding with different names in SystemJS (#3575) ### Pull Requests -* [#3575](https://github.com/rollup/rollup/pull/3575): Handle some cases of duplicate export bindings (@joeljeske) -* [#3616](https://github.com/rollup/rollup/pull/3616): Make watch mode available in plugins (@lukastaegert) + +- [#3575](https://github.com/rollup/rollup/pull/3575): Handle some cases of duplicate export bindings (@joeljeske) +- [#3616](https://github.com/rollup/rollup/pull/3616): Make watch mode available in plugins (@lukastaegert) ## 2.13.1 -*2020-06-04* + +_2020-06-04_ ### Bug Fixes -* Prevent conflicts in SystemJS when `module` is used as a top-level variable (#3614) + +- Prevent conflicts in SystemJS when `module` is used as a top-level variable (#3614) ### Pull Requests -* [#3614](https://github.com/rollup/rollup/pull/3614): Handle system reserved identifier dedupes (@guybedford) + +- [#3614](https://github.com/rollup/rollup/pull/3614): Handle system reserved identifier dedupes (@guybedford) ## 2.13.0 -*2020-06-03* + +_2020-06-03_ ### Features -* Allow to specify that an emitted chunk is only loaded after a given module has loaded to improve chunking (#3606) + +- Allow to specify that an emitted chunk is only loaded after a given module has loaded to improve chunking (#3606) ### Pull Requests -* [#3606](https://github.com/rollup/rollup/pull/3606): Enable specifying implicit dependencies when emitting chunks (@lukastaegert) + +- [#3606](https://github.com/rollup/rollup/pull/3606): Enable specifying implicit dependencies when emitting chunks (@lukastaegert) ## 2.12.1 -*2020-06-02* + +_2020-06-02_ ### Bug Fixes -* Render valid imports when chunk names correspond to directory names in virtual setups (#3609) + +- Render valid imports when chunk names correspond to directory names in virtual setups (#3609) ### Pull Requests -* [#3609](https://github.com/rollup/rollup/pull/3609): Handle imports from chunks with names that correspond to parent directory names of other chunks (@guybedford) + +- [#3609](https://github.com/rollup/rollup/pull/3609): Handle imports from chunks with names that correspond to parent directory names of other chunks (@guybedford) ## 2.12.0 -*2020-05-31* + +_2020-05-31_ ### Features -* Add an option `--waitForBundleInput` to let the build wait until all entry point files are available before starting (#3577) + +- Add an option `--waitForBundleInput` to let the build wait until all entry point files are available before starting (#3577) ### Pull Requests -* [#3577](https://github.com/rollup/rollup/pull/3577): Wait for bundle input option (@Heerschop) + +- [#3577](https://github.com/rollup/rollup/pull/3577): Wait for bundle input option (@Heerschop) ## 2.11.2 -*2020-05-28* + +_2020-05-28_ ### Bug Fixes -* Include side-effects in the second argument of `Array.from` (#3604) + +- Include side-effects in the second argument of `Array.from` (#3604) ### Pull Requests -* [#3604](https://github.com/rollup/rollup/pull/3604): Mark `Array.from` as side-effectful, use two-argument Array.from when mapping Sets (@lukastaegert) + +- [#3604](https://github.com/rollup/rollup/pull/3604): Mark `Array.from` as side-effectful, use two-argument Array.from when mapping Sets (@lukastaegert) ## 2.11.1 -*2020-05-28* + +_2020-05-28_ ### Bug Fixes -* Also include side-effects in files that are marked as side-effect-free if they contain an included default export that is reexported (#3602) + +- Also include side-effects in files that are marked as side-effect-free if they contain an included default export that is reexported (#3602) ### Pull Requests -* [#3602](https://github.com/rollup/rollup/pull/3602): Handle side-effects next to side-effect-free default exports in case the default export is reexported (@lukastaegert) + +- [#3602](https://github.com/rollup/rollup/pull/3602): Handle side-effects next to side-effect-free default exports in case the default export is reexported (@lukastaegert) ## 2.11.0 -*2020-05-27* + +_2020-05-27_ ### Features -* Add basic support for optional chaining (#3582) -* Provide a normalized set of options with proper default values to `buildStart` and `renderStart` (#3597) -* Do not count adding properties to the prototype of an unused class as a side-effect (#3598) -* Support providing `null` for empty setters in SystemJS via option (#3592) + +- Add basic support for optional chaining (#3582) +- Provide a normalized set of options with proper default values to `buildStart` and `renderStart` (#3597) +- Do not count adding properties to the prototype of an unused class as a side-effect (#3598) +- Support providing `null` for empty setters in SystemJS via option (#3592) ### Bug Fixes -* Do not fail when using a `/*#__PURE__*/` annotation inside a class field (#3599) -* Allow using `--watch` and `--treeshake` together with sub-options such as `--watch.clearScreen` on the command line (#3597) + +- Do not fail when using a `/*#__PURE__*/` annotation inside a class field (#3599) +- Allow using `--watch` and `--treeshake` together with sub-options such as `--watch.clearScreen` on the command line (#3597) ### Pull Requests -* [#3582](https://github.com/rollup/rollup/pull/3582): Support optional chaining via acorn fork(@guybedford) -* [#3592](https://github.com/rollup/rollup/pull/3592): System format optional setters(@guybedford) -* [#3597](https://github.com/rollup/rollup/pull/3597): Provide normalized options (@lukastaegert) -* [#3598](https://github.com/rollup/rollup/pull/3598): Treeshake prototype modifications in classes (@lukastaegert) -* [#3599](https://github.com/rollup/rollup/pull/3599): Retain pure annotations in class fields (@lukastaegert) -* [#3601](https://github.com/rollup/rollup/pull/3601): Fix white-space in docs (@tu4mo) + +- [#3582](https://github.com/rollup/rollup/pull/3582): Support optional chaining via acorn fork(@guybedford) +- [#3592](https://github.com/rollup/rollup/pull/3592): System format optional setters(@guybedford) +- [#3597](https://github.com/rollup/rollup/pull/3597): Provide normalized options (@lukastaegert) +- [#3598](https://github.com/rollup/rollup/pull/3598): Treeshake prototype modifications in classes (@lukastaegert) +- [#3599](https://github.com/rollup/rollup/pull/3599): Retain pure annotations in class fields (@lukastaegert) +- [#3601](https://github.com/rollup/rollup/pull/3601): Fix white-space in docs (@tu4mo) ## 2.10.9 -*2020-05-24* + +_2020-05-24_ ### Bug Fixes -* Prevent invalid exports when facades are created (#3590) + +- Prevent invalid exports when facades are created (#3590) ### Pull Requests -* [#3590](https://github.com/rollup/rollup/pull/3590): Prevent unneeded exports when entry facades are created and ensure all exported variables in facades are imported (@lukastaegert) + +- [#3590](https://github.com/rollup/rollup/pull/3590): Prevent unneeded exports when entry facades are created and ensure all exported variables in facades are imported (@lukastaegert) ## 2.10.8 -*2020-05-23* + +_2020-05-23_ ### Bug Fixes -* Fix issues when synthetic named exports are reexported as default exports (#3586) + +- Fix issues when synthetic named exports are reexported as default exports (#3586) ### Pull Requests -* [#3584](https://github.com/rollup/rollup/pull/3584): Clarify documentation for `output.paths` (@jacksteamdev) -* [#3585](https://github.com/rollup/rollup/pull/3585): Target Node.js v14 instead of v13 in Windows tests (@mangs) -* [#3586](https://github.com/rollup/rollup/pull/3586): Handle default reexports of synthetic named exports over several stages (@lukastaegert) + +- [#3584](https://github.com/rollup/rollup/pull/3584): Clarify documentation for `output.paths` (@jacksteamdev) +- [#3585](https://github.com/rollup/rollup/pull/3585): Target Node.js v14 instead of v13 in Windows tests (@mangs) +- [#3586](https://github.com/rollup/rollup/pull/3586): Handle default reexports of synthetic named exports over several stages (@lukastaegert) ## 2.10.7 -*2020-05-22* + +_2020-05-22_ ### Bug Fixes -* Handle modules re-exporting namespaces without further own code (#3576) + +- Handle modules re-exporting namespaces without further own code (#3576) ### Pull Requests -* [#3576](https://github.com/rollup/rollup/pull/3576): Fix "cannot read exports of undefined" error (@guybedford) + +- [#3576](https://github.com/rollup/rollup/pull/3576): Fix "cannot read exports of undefined" error (@guybedford) ## 2.10.6 -*2020-05-22* + +_2020-05-22_ ### Bug Fixes -* Fix some issues around class fields (#3580) -* Prevent a maximum call stack error when a called entity references itself in its declaration (#3581) + +- Fix some issues around class fields (#3580) +- Prevent a maximum call stack error when a called entity references itself in its declaration (#3581) ### Pull Requests -* [#3580](https://github.com/rollup/rollup/pull/3580): Update acorn class features (@guybedford) -* [#3581](https://github.com/rollup/rollup/pull/3581): Do not fail when including call arguments of recursively defined variables (@lukastaegert) + +- [#3580](https://github.com/rollup/rollup/pull/3580): Update acorn class features (@guybedford) +- [#3581](https://github.com/rollup/rollup/pull/3581): Do not fail when including call arguments of recursively defined variables (@lukastaegert) ## 2.10.5 -*2020-05-19* + +_2020-05-19_ ### Bug Fixes -* Do not remove side-effects that may influence an included default export declaration when side-effects are disabled (#3572) + +- Do not remove side-effects that may influence an included default export declaration when side-effects are disabled (#3572) ### Pull Requests -* [#3572](https://github.com/rollup/rollup/pull/3572): Observe side-effects in files containing a default export declaration that reexports a variable (@lukastaegert) + +- [#3572](https://github.com/rollup/rollup/pull/3572): Observe side-effects in files containing a default export declaration that reexports a variable (@lukastaegert) ## 2.10.4 -*2020-05-19* + +_2020-05-19_ ### Bug Fixes -* Tree-shake unused classes with fields unless there are side-effects in the field declaration (#3569) + +- Tree-shake unused classes with fields unless there are side-effects in the field declaration (#3569) ### Pull Requests -* [#3569](https://github.com/rollup/rollup/pull/3569): Make sure unused classes with fields are tree-shaken if possible (@lukastaegert) + +- [#3569](https://github.com/rollup/rollup/pull/3569): Make sure unused classes with fields are tree-shaken if possible (@lukastaegert) ## 2.10.3 -*2020-05-18* + +_2020-05-18_ ### Bug Fixes -* Validate return value of sourcemapPathTransform option (#3561) + +- Validate return value of sourcemapPathTransform option (#3561) ### Pull Requests -* [#3561](https://github.com/rollup/rollup/pull/3561): Throw error if sourcemapPathTransform-option does not return a string (@Simonwep) + +- [#3561](https://github.com/rollup/rollup/pull/3561): Throw error if sourcemapPathTransform-option does not return a string (@Simonwep) ## 2.10.2 -*2020-05-15* + +_2020-05-15_ ### Bug Fixes -* Properly include calls to mutating array methods in certain scenarios (#3559) + +- Properly include calls to mutating array methods in certain scenarios (#3559) ### Pull Requests -* [#3559](https://github.com/rollup/rollup/pull/3559): Make sure UnknownFooExpressions are included when referenced as return values in a MultiExpression (@lukastaegert) + +- [#3559](https://github.com/rollup/rollup/pull/3559): Make sure UnknownFooExpressions are included when referenced as return values in a MultiExpression (@lukastaegert) ## 2.10.1 -*2020-05-15* + +_2020-05-15_ ### Bug Fixes -* Do not throw when "undefined" is used as a default export (#3558) + +- Do not throw when "undefined" is used as a default export (#3558) ### Pull Requests -* [#3558](https://github.com/rollup/rollup/pull/3558): Properly handle default exporting undefined (@lukastaegert) + +- [#3558](https://github.com/rollup/rollup/pull/3558): Properly handle default exporting undefined (@lukastaegert) ## 2.10.0 -*2020-05-13* + +_2020-05-13_ ### Features -* Avoid unnecessary empty imports from a facade chunk to the original chunk (#3552) -* Pin facade creation order so that if several user-defined chunks reference the same module, the first always becomes the "actual" chunk while the later ones become facades (#3552) + +- Avoid unnecessary empty imports from a facade chunk to the original chunk (#3552) +- Pin facade creation order so that if several user-defined chunks reference the same module, the first always becomes the "actual" chunk while the later ones become facades (#3552) ### Bug Fixes -* Do not omit reexports from secondary chunks when creating facades for entry points without hoisting transitive dependencies (#3552) + +- Do not omit reexports from secondary chunks when creating facades for entry points without hoisting transitive dependencies (#3552) ### Pull Requests -* [#3552](https://github.com/rollup/rollup/pull/3552): Avoid unnecessary facade dependency inlining (@guybedford) + +- [#3552](https://github.com/rollup/rollup/pull/3552): Avoid unnecessary facade dependency inlining (@guybedford) ## 2.9.1 -*2020-05-11* + +_2020-05-11_ ### Bug Fixes -* Do not create unintended live-bindings or invalid reexports when reexporting global variables (#3550) + +- Do not create unintended live-bindings or invalid reexports when reexporting global variables (#3550) ### Pull Requests -* [#3550](https://github.com/rollup/rollup/pull/3550): Track updates of globals that are exported as default (@lukastaegert) + +- [#3550](https://github.com/rollup/rollup/pull/3550): Track updates of globals that are exported as default (@lukastaegert) ## 2.9.0 -*2020-05-10* + +_2020-05-10_ ### Features -* Add ids of static and dynamic imports to `this.getModuleInfo` (#3542) -* Provide `getModuleInfo` and `getModuleIds` to `manualChunks` functions (#3542) -* Add nullish coalescing support (#3548) -* Make the rebuild delay in watch mode configurable and set the default to `0` for snappy rebuilds (#3502) -* Add `this.getModuleIds` to the plugin context as future replacement for `this.moduleIds` (#3542) + +- Add ids of static and dynamic imports to `this.getModuleInfo` (#3542) +- Provide `getModuleInfo` and `getModuleIds` to `manualChunks` functions (#3542) +- Add nullish coalescing support (#3548) +- Make the rebuild delay in watch mode configurable and set the default to `0` for snappy rebuilds (#3502) +- Add `this.getModuleIds` to the plugin context as future replacement for `this.moduleIds` (#3542) ### Pull Requests -* [#3502](https://github.com/rollup/rollup/pull/3502): Configurable build delay (@mattdesl) -* [#3542](https://github.com/rollup/rollup/pull/3542): Extend manualChunks API (@lukastaegert) -* [#3548](https://github.com/rollup/rollup/pull/3548): Support nullish coalescing with tree-shaking (@lukastaegert) + +- [#3502](https://github.com/rollup/rollup/pull/3502): Configurable build delay (@mattdesl) +- [#3542](https://github.com/rollup/rollup/pull/3542): Extend manualChunks API (@lukastaegert) +- [#3548](https://github.com/rollup/rollup/pull/3548): Support nullish coalescing with tree-shaking (@lukastaegert) ## 2.8.2 -*2020-05-07* + +_2020-05-07_ ### Bug Fixes -* Avoid invalid code when simplifying the body of a shorthand arrow function expression (#3540) + +- Avoid invalid code when simplifying the body of a shorthand arrow function expression (#3540) ### Pull Requests -* [#3540](https://github.com/rollup/rollup/pull/3540): Wrap object expressions in parentheses if they become children of an arrow function expression (@lukastaegert) + +- [#3540](https://github.com/rollup/rollup/pull/3540): Wrap object expressions in parentheses if they become children of an arrow function expression (@lukastaegert) ## 2.8.1 -*2020-05-07* + +_2020-05-07_ ### Bug Fixes -* Allow using plugins on CLI that are exported as `exports.default` (#3529) -* Do not fail side-effect detection in nested callbacks of builtins (#3539) + +- Allow using plugins on CLI that are exported as `exports.default` (#3529) +- Do not fail side-effect detection in nested callbacks of builtins (#3539) ### Pull Requests -* [#3529](https://github.com/rollup/rollup/pull/3529): Use default named export with plugins (@NotWoods) -* [#3539](https://github.com/rollup/rollup/pull/3539): Track call side-effects both by entity and CallExpression to avoid untracked side-effects in nested calls (@lukastaegert) + +- [#3529](https://github.com/rollup/rollup/pull/3529): Use default named export with plugins (@NotWoods) +- [#3539](https://github.com/rollup/rollup/pull/3539): Track call side-effects both by entity and CallExpression to avoid untracked side-effects in nested calls (@lukastaegert) ## 2.8.0 -*2020-05-06* + +_2020-05-06_ ### Features -* When a dynamically imported chunk contains more exports than the imported module namespace, do not create a facade chunk but an inline namespace (#3535) + +- When a dynamically imported chunk contains more exports than the imported module namespace, do not create a facade chunk but an inline namespace (#3535) ### Bug Fixes -* Do not execute dynamically imported code before synchronous code in the importing module when generating CommonJS (#3535) + +- Do not execute dynamically imported code before synchronous code in the importing module when generating CommonJS (#3535) ### Pull Requests -* [#3535](https://github.com/rollup/rollup/pull/3535): Avoid dynamic facade chunks (@lukastaegert) + +- [#3535](https://github.com/rollup/rollup/pull/3535): Avoid dynamic facade chunks (@lukastaegert) ## 2.7.6 -*2020-04-30* + +_2020-04-30_ ### Bug Fixes -* Fix a type issue when a default export references a global variable (#3526) + +- Fix a type issue when a default export references a global variable (#3526) ### Pull Requests -* [#3526](https://github.com/rollup/rollup/pull/3526): Handles default exporting global variables (@lukastaegert) + +- [#3526](https://github.com/rollup/rollup/pull/3526): Handles default exporting global variables (@lukastaegert) ## 2.7.5 -*2020-04-29* + +_2020-04-29_ ### Bug Fixes -* Prevent infinite loop when default values of function parameters in a default export contain a slash (#3522) + +- Prevent infinite loop when default values of function parameters in a default export contain a slash (#3522) ### Pull Requests -* [#3522](https://github.com/rollup/rollup/pull/3522): Avoid infinite loop when finding position for id insertion in default export (@lukastaegert) + +- [#3522](https://github.com/rollup/rollup/pull/3522): Avoid infinite loop when finding position for id insertion in default export (@lukastaegert) ## 2.7.4 -*2020-04-29* + +_2020-04-29_ ### Bug Fixes -* Fix an issue where wrong variable names were used when preserving modules (#3521) + +- Fix an issue where wrong variable names were used when preserving modules (#3521) ### Pull Requests -* [#3521](https://github.com/rollup/rollup/pull/3521): Fix and improve default export alias logic (@lukastaegert) + +- [#3521](https://github.com/rollup/rollup/pull/3521): Fix and improve default export alias logic (@lukastaegert) ## 2.7.3 -*2020-04-27* + +_2020-04-27_ ### Bug Fixes -* Do not access `__proto__` when running Rollup (#3518) + +- Do not access `__proto__` when running Rollup (#3518) ### Pull Requests -* [#3518](https://github.com/rollup/rollup/pull/3518): use acorn-class-fields and acorn-static-class-features from npm (@nitsky) + +- [#3518](https://github.com/rollup/rollup/pull/3518): use acorn-class-fields and acorn-static-class-features from npm (@nitsky) ## 2.7.2 -*2020-04-22* + +_2020-04-22_ ### Bug Fixes -* Prevent an infinite loop when creating separate manual chunks with circular dependencies (#3510) -* Do not fail if "super" is used in the definition of a class field (#3511) -* Throw if a plugin tries to emit a file with an absolute Windows path (#3509) + +- Prevent an infinite loop when creating separate manual chunks with circular dependencies (#3510) +- Do not fail if "super" is used in the definition of a class field (#3511) +- Throw if a plugin tries to emit a file with an absolute Windows path (#3509) ### Pull Requests -* [#3509](https://github.com/rollup/rollup/pull/3509): Ban emitFile via absolute paths on Windows OS (@SASUKE40) -* [#3510](https://github.com/rollup/rollup/pull/3510): Do not fail for circular imports between manual chunks (@lukastaegert) -* [#3511](https://github.com/rollup/rollup/pull/3511): Support "super" in class fields (@lukastaegert) + +- [#3509](https://github.com/rollup/rollup/pull/3509): Ban emitFile via absolute paths on Windows OS (@SASUKE40) +- [#3510](https://github.com/rollup/rollup/pull/3510): Do not fail for circular imports between manual chunks (@lukastaegert) +- [#3511](https://github.com/rollup/rollup/pull/3511): Support "super" in class fields (@lukastaegert) ## 2.7.1 -*2020-04-21* + +_2020-04-21_ ### Bug Fixes -* Use correct path for dynamic imports if `output.paths` is used (#3508) + +- Use correct path for dynamic imports if `output.paths` is used (#3508) ### Pull Requests -* [#3508](https://github.com/rollup/rollup/pull/3508): Respect output.paths in dynamic imports (@lukastaegert) + +- [#3508](https://github.com/rollup/rollup/pull/3508): Respect output.paths in dynamic imports (@lukastaegert) ## 2.7.0 -*2020-04-21* + +_2020-04-21_ ### Features -* Add `preserveEntrySignatures` option to control how exports of entry points are handled (#3498) -* Add `preserveSignature` flag to `this.emitFile` to control exports of emitted chunks (#3498) -* Add `output.minifyInternalExports` option to control if internal exports are minified (#3498) + +- Add `preserveEntrySignatures` option to control how exports of entry points are handled (#3498) +- Add `preserveSignature` flag to `this.emitFile` to control exports of emitted chunks (#3498) +- Add `output.minifyInternalExports` option to control if internal exports are minified (#3498) ### Pull Requests -* [#3498](https://github.com/rollup/rollup/pull/3498): Add option to configure if entry signatures are preserved (@lukastaegert) + +- [#3498](https://github.com/rollup/rollup/pull/3498): Add option to configure if entry signatures are preserved (@lukastaegert) ## 2.6.1 -*2020-04-12* + +_2020-04-12_ ### Bug Fixes -* Close watch mode when stdin closes in a non-TTY environment (#3493) + +- Close watch mode when stdin closes in a non-TTY environment (#3493) ### Pull Requests -* [#3493](https://github.com/rollup/rollup/pull/3493): Ensure --watch mode exits correctly when stdin is closed (@jakesgordon) + +- [#3493](https://github.com/rollup/rollup/pull/3493): Ensure --watch mode exits correctly when stdin is closed (@jakesgordon) ## 2.6.0 -*2020-04-10* + +_2020-04-10_ ### Features -* Allow regular expressions to declare external modules (#3482) + +- Allow regular expressions to declare external modules (#3482) ### Pull Requests -* [#3482](https://github.com/rollup/rollup/pull/3482): Allow regular expressions in config.external (@johannes-z) + +- [#3482](https://github.com/rollup/rollup/pull/3482): Allow regular expressions in config.external (@johannes-z) ## 2.5.0 + This version is identical to 2.4.0 ## 2.4.0 -*2020-04-09* + +_2020-04-09_ ### Features -* Add support for most private and public class field features (#3488) + +- Add support for most private and public class field features (#3488) ### Bug Fixes -* Do not replace `this` with `undefined` in class field definitions (#3488) + +- Do not replace `this` with `undefined` in class field definitions (#3488) ### Pull Requests -* [#3488](https://github.com/rollup/rollup/pull/3488): Rollup class fields support (@guybedford and @lukastaegert) + +- [#3488](https://github.com/rollup/rollup/pull/3488): Rollup class fields support (@guybedford and @lukastaegert) ## 2.3.5 -*2020-04-09* + +_2020-04-09_ ### Bug Fixes -* Never remove labels when tree-shaking is disabled (#3492) + +- Never remove labels when tree-shaking is disabled (#3492) ### Pull Requests -* [#3492](https://github.com/rollup/rollup/pull/3492): Always use a new inclusion context when including declarations of variables, always inlcude labels when not treeshaking (@lukastaegert) + +- [#3492](https://github.com/rollup/rollup/pull/3492): Always use a new inclusion context when including declarations of variables, always inlcude labels when not treeshaking (@lukastaegert) ## 2.3.4 -*2020-04-07* + +_2020-04-07_ ### Bug Fixes -* Handle re-exporting synthetic exports from entry-points (#3319) -* Fix cross-chunk imports of synthetic exports (#3319) -* Handle namespace objects that contain re-exported synthetic namespaces (#3319) + +- Handle re-exporting synthetic exports from entry-points (#3319) +- Fix cross-chunk imports of synthetic exports (#3319) +- Handle namespace objects that contain re-exported synthetic namespaces (#3319) ### Pull Requests -* [#3319](https://github.com/rollup/rollup/pull/3319): Handle re-exports of synthetic named exports (@manucorporat and @lukastaegert) + +- [#3319](https://github.com/rollup/rollup/pull/3319): Handle re-exports of synthetic named exports (@manucorporat and @lukastaegert) ## 2.3.3 -*2020-04-04* + +_2020-04-04_ ### Bug Fixes -* Add external namespaces to dynamic namespace objects (#3474) + +- Add external namespaces to dynamic namespace objects (#3474) ### Pull Requests -* [#3474](https://github.com/rollup/rollup/pull/3474): Support external star exports on namespace objects (@guybedford) + +- [#3474](https://github.com/rollup/rollup/pull/3474): Support external star exports on namespace objects (@guybedford) ## 2.3.2 -*2020-03-31* + +_2020-03-31_ ### Bug Fixes -* Only warn but do not fail build when a namespace is called as a function (#3475) -* Make sure pre-existing sourcemap comments are also removed when rebuilding using the cache (#3476) + +- Only warn but do not fail build when a namespace is called as a function (#3475) +- Make sure pre-existing sourcemap comments are also removed when rebuilding using the cache (#3476) ### Pull Requests -* [#3475](https://github.com/rollup/rollup/pull/3475): Call namespace error as a warning (@guybedford) -* [#3476](https://github.com/rollup/rollup/pull/3476): Store locations for removed comments in cache (@lukastaegert) + +- [#3475](https://github.com/rollup/rollup/pull/3475): Call namespace error as a warning (@guybedford) +- [#3476](https://github.com/rollup/rollup/pull/3476): Store locations for removed comments in cache (@lukastaegert) ## 2.3.1 -*2020-03-30* + +_2020-03-30_ ### Bug Fixes -* Do not fail if the config file returns an function returning a Promise (#3472) + +- Do not fail if the config file returns an function returning a Promise (#3472) ### Pull Requests -* [#3472](https://github.com/rollup/rollup/pull/3472): Fix support for async functions as config (@lukastaegert) + +- [#3472](https://github.com/rollup/rollup/pull/3472): Fix support for async functions as config (@lukastaegert) ## 2.3.0 -*2020-03-29* + +_2020-03-29_ ### Features -* Do not transpile config files with `.mjs` extension in Node 13+ or `.cjs` extension in any Node version and load them appropriately (#3445) -* Extract helper to load a config file the way rollup does it via `rollup/dist/loadConfigFile` (#3445) + +- Do not transpile config files with `.mjs` extension in Node 13+ or `.cjs` extension in any Node version and load them appropriately (#3445) +- Extract helper to load a config file the way rollup does it via `rollup/dist/loadConfigFile` (#3445) ### Bug Fixes -* Keep watching the config file if an error occurs during initial load in watch node (#3445) -* Add a helpful error message when using a transpiled config in a repository with "type": "module" (#3445) + +- Keep watching the config file if an error occurs during initial load in watch node (#3445) +- Add a helpful error message when using a transpiled config in a repository with "type": "module" (#3445) ### Pull Requests -* [#3445](https://github.com/rollup/rollup/pull/3445): Support native ESM configs in Node 13, support untranspiled configs (@lukastaegert) -* [#3468](https://github.com/rollup/rollup/pull/3468): Don't use esm output format alias in the documentation (@vsn4ik) + +- [#3445](https://github.com/rollup/rollup/pull/3445): Support native ESM configs in Node 13, support untranspiled configs (@lukastaegert) +- [#3468](https://github.com/rollup/rollup/pull/3468): Don't use esm output format alias in the documentation (@vsn4ik) ## 2.2.0 -*2020-03-24* + +_2020-03-24_ ### Features -* Add `renderDynamicImport` hook to rewrite dynamic import expressions (#3449) -* Add information about dynamically imported modules to `this.getModuleInfo` (#3449) + +- Add `renderDynamicImport` hook to rewrite dynamic import expressions (#3449) +- Add information about dynamically imported modules to `this.getModuleInfo` (#3449) ### Bug Fixes -* Make file emission work with Uin8Array sources when using Rollup in the browser (#3452) -* Fix types to allow watch to accept an array of configs (#3453) -* Do not strip `.js` extensions from AMD imports when the import is a user-supplied replacement for a non-resolvable dynamic import target (#3453) + +- Make file emission work with Uin8Array sources when using Rollup in the browser (#3452) +- Fix types to allow watch to accept an array of configs (#3453) +- Do not strip `.js` extensions from AMD imports when the import is a user-supplied replacement for a non-resolvable dynamic import target (#3453) ### Pull Requests -* [#3449](https://github.com/rollup/rollup/pull/3449): Add hook to rewrite dynamic import expressions (@lukastaegert) -* [#3452](https://github.com/rollup/rollup/pull/3452): Avoid the assumption of Buffer in browser envs (@JoviDeCroock) -* [#3453](https://github.com/rollup/rollup/pull/3453): fix types since watch accepts single or array config (@lukeed) -* [#3456](https://github.com/rollup/rollup/pull/3456): fix SystemJS url in tutorial (@guybedford) + +- [#3449](https://github.com/rollup/rollup/pull/3449): Add hook to rewrite dynamic import expressions (@lukastaegert) +- [#3452](https://github.com/rollup/rollup/pull/3452): Avoid the assumption of Buffer in browser envs (@JoviDeCroock) +- [#3453](https://github.com/rollup/rollup/pull/3453): fix types since watch accepts single or array config (@lukeed) +- [#3456](https://github.com/rollup/rollup/pull/3456): fix SystemJS url in tutorial (@guybedford) ## 2.1.0 -*2020-03-18* + +_2020-03-18_ ### Features -* Allow specifying an importer when emitting files to resolve relative ids (#3442) + +- Allow specifying an importer when emitting files to resolve relative ids (#3442) ### Pull Requests -* [#3442](https://github.com/rollup/rollup/pull/3442): Add optional `importer` parameter to `this.emitFile` (@lukastaegert) + +- [#3442](https://github.com/rollup/rollup/pull/3442): Add optional `importer` parameter to `this.emitFile` (@lukastaegert) ## 2.0.6 -*2020-03-13* + +_2020-03-13_ ### Bug Fixes -* Do not use file names from different outputs when generating sourcemaps using the `dir` option (#3440) + +- Do not use file names from different outputs when generating sourcemaps using the `dir` option (#3440) ### Pull Requests -* [#3440](https://github.com/rollup/rollup/pull/3440): Use correct file names when writing sourcemaps for multiple outputs (@lukastaegert) + +- [#3440](https://github.com/rollup/rollup/pull/3440): Use correct file names when writing sourcemaps for multiple outputs (@lukastaegert) ## 2.0.5 -*2020-03-12* + +_2020-03-12_ ### Bug Fixes -* Fix an issue where conditional statements would assume they have the wrong test value (#3438) + +- Fix an issue where conditional statements would assume they have the wrong test value (#3438) ### Pull Requests -* [#3438](https://github.com/rollup/rollup/pull/3438): Make sure logical expressions always check the left argument for side-effects (@lukastaegert) + +- [#3438](https://github.com/rollup/rollup/pull/3438): Make sure logical expressions always check the left argument for side-effects (@lukastaegert) ## 2.0.4 -*2020-03-12* + +_2020-03-12_ ### Bug Fixes -* Avoid conflicts between namespace imports when preserving modules (#3435) + +- Avoid conflicts between namespace imports when preserving modules (#3435) ### Pull Requests -* [#3435](https://github.com/rollup/rollup/pull/3435): Deconflict multiple `index` imports for ES format using nested export star statements (@kamranayub) + +- [#3435](https://github.com/rollup/rollup/pull/3435): Deconflict multiple `index` imports for ES format using nested export star statements (@kamranayub) ## 2.0.3 -*2020-03-10* + +_2020-03-10_ ### Bug Fixes -* Add type for this.getCombinedSourcemap to transform context (#3431) + +- Add type for this.getCombinedSourcemap to transform context (#3431) ### Pull Requests -* [#3377](https://github.com/rollup/rollup/pull/3377): Switch to yargs-parser lib (@jamesgeorge007) -* [#3426](https://github.com/rollup/rollup/pull/3426): Use strict types with PluginDriver (@NotWoods) -* [#3431](https://github.com/rollup/rollup/pull/3431): Add missing type declaration for getCombinedSourcemap (@Anidetrix) -* [#3432](https://github.com/rollup/rollup/pull/3432): Detail how return values from `augmentChunkHash` are used (@jakearchibald) + +- [#3377](https://github.com/rollup/rollup/pull/3377): Switch to yargs-parser lib (@jamesgeorge007) +- [#3426](https://github.com/rollup/rollup/pull/3426): Use strict types with PluginDriver (@NotWoods) +- [#3431](https://github.com/rollup/rollup/pull/3431): Add missing type declaration for getCombinedSourcemap (@Anidetrix) +- [#3432](https://github.com/rollup/rollup/pull/3432): Detail how return values from `augmentChunkHash` are used (@jakearchibald) ## 2.0.2 -*2020-03-07* + +_2020-03-07_ ### Bug Fixes -* Make sure the ESM import still works (#3430) + +- Make sure the ESM import still works (#3430) ### Pull Requests -* [#3430](https://github.com/rollup/rollup/pull/3430): Fix conditional exports again (@lukastaegert) + +- [#3430](https://github.com/rollup/rollup/pull/3430): Fix conditional exports again (@lukastaegert) ## 2.0.1 -*2020-03-07* + +_2020-03-07_ ### Bug Fixes -* Reenable importing rollup in Node 13.0 - 13.7 (#3428) + +- Reenable importing rollup in Node 13.0 - 13.7 (#3428) ### Pull Requests -* [#3428](https://github.com/rollup/rollup/pull/3428): Fix conditional exports in Node 13.0 - 13.7 (@lukastaegert) + +- [#3428](https://github.com/rollup/rollup/pull/3428): Fix conditional exports in Node 13.0 - 13.7 (@lukastaegert) ## 2.0.0 -*2020-03-06* + +_2020-03-06_ ### Breaking Changes -* Rollup now requires at least Node 10 to run, or a sufficiently modern browser (#3346) -* The file structure of Rollup's ESM builds has changed: + +- Rollup now requires at least Node 10 to run, or a sufficiently modern browser (#3346) +- The file structure of Rollup's ESM builds has changed: + - The main ESM entry point is now at `rollup/dist/es/rollup.js` instead of `rollup/dist/rollup.es.js` - The ESM browser build is at `rollup/dist/es/rollup.browser.js` instead of `rollup/dist/rollup.browser.es.js` - + In general, the ESM builds now follow the same naming scheme as the CJS builds but are located in the `rollup/dist/es` subfolder instead of `rollup/dist` (#3391) -* The "watch.chokidar" option no longer accepts a `boolean` value but only an object of parameters that is passed to the bundled Chokidar instance. Chokidar installations by the user will be ignored in favour of the bundled instance (#3331) -* Modules that are completely tree-shaken will no longer be listed as part of any chunks in `generateBundle` -* The `experimentalOptimizeChunks` and `chunkGroupingSize` options have been removed -* [acorn](https://github.com/acornjs/acorn) plugins can only be used if they accept a passed-in acorn instance instead of importing it themselves. See https://github.com/acornjs/acorn/pull/870#issuecomment-527339830 for what needs to be done to make plugins compatible that do not support this yet (#3391) -* Emitted chunks now have the TypeScript type `Uint8Array` instead of `Buffer`. A `Buffer` can still be used, though (#3395) -* The TypeScript types no longer use ESTree types for AST nodes but a very generic type that does not contain information specific to certain node types (#3395) -* The signature of the `writeBundle` plugin hook has been changed to match `generateBundle`: The bundle object is now passed as second parameter instead of first and the first parameter is the output options (#3361) -* The following plugin hooks have been removed: + +- The "watch.chokidar" option no longer accepts a `boolean` value but only an object of parameters that is passed to the bundled Chokidar instance. Chokidar installations by the user will be ignored in favour of the bundled instance (#3331) +- Modules that are completely tree-shaken will no longer be listed as part of any chunks in `generateBundle` +- The `experimentalOptimizeChunks` and `chunkGroupingSize` options have been removed +- [acorn](https://github.com/acornjs/acorn) plugins can only be used if they accept a passed-in acorn instance instead of importing it themselves. See https://github.com/acornjs/acorn/pull/870#issuecomment-527339830 for what needs to be done to make plugins compatible that do not support this yet (#3391) +- Emitted chunks now have the TypeScript type `Uint8Array` instead of `Buffer`. A `Buffer` can still be used, though (#3395) +- The TypeScript types no longer use ESTree types for AST nodes but a very generic type that does not contain information specific to certain node types (#3395) +- The signature of the `writeBundle` plugin hook has been changed to match `generateBundle`: The bundle object is now passed as second parameter instead of first and the first parameter is the output options (#3361) +- The following plugin hooks have been removed: - ongenerate: use `generateBundle` instead - onwrite: use `writeBundle` instead - transformBundle: use `renderChunk` instead - transformChunk: use `renderChunk` instead -* You can no longer access `this.watcher` on the plugin context. -* The `transform` hook can no longer return `dependencies`. -* The `treeshake.pureExternalModules` option will now show a deprecation warning when used: use `treeshake.moduleSideEffects: 'no-external'` instead -* Using `import.meta.ROLLUP_ASSET_URL_<..>` and `import.meta.ROLLUP_CHUNK_URL_<..>` in code will now show warnings: use `import.meta.ROLLUP_FILE_URL_<..>` instead -* The `resolveAssetUrl` hook will now show a deprecation warning when used: use `resolveFileUrl` instead -* The following plugin context functions will show warnings when used: +- You can no longer access `this.watcher` on the plugin context. +- The `transform` hook can no longer return `dependencies`. +- The `treeshake.pureExternalModules` option will now show a deprecation warning when used: use `treeshake.moduleSideEffects: 'no-external'` instead +- Using `import.meta.ROLLUP_ASSET_URL_<..>` and `import.meta.ROLLUP_CHUNK_URL_<..>` in code will now show warnings: use `import.meta.ROLLUP_FILE_URL_<..>` instead +- The `resolveAssetUrl` hook will now show a deprecation warning when used: use `resolveFileUrl` instead +- The following plugin context functions will show warnings when used: - `this.emitAsset`: use `this.emitFile` - `this.emitChunk`: use `this.emitFile` - `this.getAssetFileName`: use `this.getFileName` - `this.getChunkFileName`: use `this.getFileName` - `this.isExternal`: use `this.resolve` - `this.resolveId`: use `this.resolve` -* Directly adding properties to the bundle object in the `generateBundle` is deprecated will show a warning (removing properties is allowed, though): Use `this.emitFile` -* Accessing `chunk.isAsset` on the bundle is deprecated: Use `chunk.type === 'asset'` instead -* The error code for a missing `name` property when targeting UMD has been changed to `MISSING_NAME_OPTION_FOR_IIFE_EXPORT` to emphasize this is needed for the IIFE part of UMD (#3393) +- Directly adding properties to the bundle object in the `generateBundle` is deprecated will show a warning (removing properties is allowed, though): Use `this.emitFile` +- Accessing `chunk.isAsset` on the bundle is deprecated: Use `chunk.type === 'asset'` instead +- The error code for a missing `name` property when targeting UMD has been changed to `MISSING_NAME_OPTION_FOR_IIFE_EXPORT` to emphasize this is needed for the IIFE part of UMD (#3393) ### Features -* Rollup now bundles [Chokidar](https://github.com/paulmillr/chokidar) for a better watch experience (#3331) -* Rollup now bundles [acorn](https://github.com/acornjs/acorn) again, removing its only external dependency (#3391) -* Do not consider empty imports from side-effect-free modules for chunking and hoist side-effect imports if necessary (#3369) -* Rollup can now be imported as an ES module in Node via `import {rollup} from 'rollup'`. Note that this relies on Node's experimental [conditional package exports](https://nodejs.org/dist/latest-v13.x/docs/api/esm.html#esm_conditional_exports) feature and is therefore itself experimental (#3391) -* `systemjs` can be used as format alias for `system` (#3381) + +- Rollup now bundles [Chokidar](https://github.com/paulmillr/chokidar) for a better watch experience (#3331) +- Rollup now bundles [acorn](https://github.com/acornjs/acorn) again, removing its only external dependency (#3391) +- Do not consider empty imports from side-effect-free modules for chunking and hoist side-effect imports if necessary (#3369) +- Rollup can now be imported as an ES module in Node via `import {rollup} from 'rollup'`. Note that this relies on Node's experimental [conditional package exports](https://nodejs.org/dist/latest-v13.x/docs/api/esm.html#esm_conditional_exports) feature and is therefore itself experimental (#3391) +- `systemjs` can be used as format alias for `system` (#3381) ### Bug Fixes -* Unknown output options now trigger a warning when using the JavaScript API (#3352) -* Rollup will no longer introduce Node types into TypeScript projects that do not use them (#3395) -* Generate correct sourcemaps when tree-shaking occurs in a multi-file bundle (#3423) + +- Unknown output options now trigger a warning when using the JavaScript API (#3352) +- Rollup will no longer introduce Node types into TypeScript projects that do not use them (#3395) +- Generate correct sourcemaps when tree-shaking occurs in a multi-file bundle (#3423) ### Pull Requests -* [#3331](https://github.com/rollup/rollup/pull/3331): Bundle Chokidar (@lukastaegert) -* [#3343](https://github.com/rollup/rollup/pull/3343): Remove experimentalOptimizeChunks (@lukastaegert) -* [#3346](https://github.com/rollup/rollup/pull/3346): Update minimum required Node version to 10 (@lukastaegert) -* [#3352](https://github.com/rollup/rollup/pull/3352): Remove active deprecations (@lukastaegert) -* [#3361](https://github.com/rollup/rollup/pull/3361): Change writeBundle signature to match generateBundle (@lukastaegert) -* [#3369](https://github.com/rollup/rollup/pull/3369): Avoid empty imports from side-effect-free chunks (@lukastaegert) -* [#3381](https://github.com/rollup/rollup/pull/3381): Rename esm to es everywhere, add systemjs alias (@lukastaegert) -* [#3391](https://github.com/rollup/rollup/pull/3391): Bundle acorn, allow importing Rollup as Node ES module, update dependencies (@lukastaegert) -* [#3393](https://github.com/rollup/rollup/pull/3393): Better error code for name-less umd bundle (@rail44) -* [#3395](https://github.com/rollup/rollup/pull/3395): Remove `@types` dependencies (@lukastaegert) -* [#3423](https://github.com/rollup/rollup/pull/3423): Update magic-string and fix sourcemaps (@lukastaegert) + +- [#3331](https://github.com/rollup/rollup/pull/3331): Bundle Chokidar (@lukastaegert) +- [#3343](https://github.com/rollup/rollup/pull/3343): Remove experimentalOptimizeChunks (@lukastaegert) +- [#3346](https://github.com/rollup/rollup/pull/3346): Update minimum required Node version to 10 (@lukastaegert) +- [#3352](https://github.com/rollup/rollup/pull/3352): Remove active deprecations (@lukastaegert) +- [#3361](https://github.com/rollup/rollup/pull/3361): Change writeBundle signature to match generateBundle (@lukastaegert) +- [#3369](https://github.com/rollup/rollup/pull/3369): Avoid empty imports from side-effect-free chunks (@lukastaegert) +- [#3381](https://github.com/rollup/rollup/pull/3381): Rename esm to es everywhere, add systemjs alias (@lukastaegert) +- [#3391](https://github.com/rollup/rollup/pull/3391): Bundle acorn, allow importing Rollup as Node ES module, update dependencies (@lukastaegert) +- [#3393](https://github.com/rollup/rollup/pull/3393): Better error code for name-less umd bundle (@rail44) +- [#3395](https://github.com/rollup/rollup/pull/3395): Remove `@types` dependencies (@lukastaegert) +- [#3423](https://github.com/rollup/rollup/pull/3423): Update magic-string and fix sourcemaps (@lukastaegert) ## 1.32.1 -*2020-03-06* + +_2020-03-06_ ### Bug Fixes -* Handle default export detection for AMD and IIFE externals that do not have a prototype (#3420) -* Handle missing whitespace when the else branch of an if-statement is simplified (#3421) -* Mention the importing module when reporting errors for missing named exports (#3401) -* Add code to warning for missing output.name of IIFE bundles (#3372) + +- Handle default export detection for AMD and IIFE externals that do not have a prototype (#3420) +- Handle missing whitespace when the else branch of an if-statement is simplified (#3421) +- Mention the importing module when reporting errors for missing named exports (#3401) +- Add code to warning for missing output.name of IIFE bundles (#3372) ### Pull Requests -* [#3372](https://github.com/rollup/rollup/pull/3372): Add warning code for missing output.name of IIFE bundle that has export (@rail44) -* [#3401](https://github.com/rollup/rollup/pull/3401): Missing exports errors now print the importing module (@timiyay) -* [#3418](https://github.com/rollup/rollup/pull/3418): Structure lifecycle hooks, add links to build time hooks (@lukastaegert) -* [#3420](https://github.com/rollup/rollup/pull/3420): Update generated code of getInteropBlock() to work with null prototype objects (@jdalton) -* [#3421](https://github.com/rollup/rollup/pull/3421): Avoid invalid code when "else" branch is simplified (@lukastaegert) + +- [#3372](https://github.com/rollup/rollup/pull/3372): Add warning code for missing output.name of IIFE bundle that has export (@rail44) +- [#3401](https://github.com/rollup/rollup/pull/3401): Missing exports errors now print the importing module (@timiyay) +- [#3418](https://github.com/rollup/rollup/pull/3418): Structure lifecycle hooks, add links to build time hooks (@lukastaegert) +- [#3420](https://github.com/rollup/rollup/pull/3420): Update generated code of getInteropBlock() to work with null prototype objects (@jdalton) +- [#3421](https://github.com/rollup/rollup/pull/3421): Avoid invalid code when "else" branch is simplified (@lukastaegert) ## 1.32.0 -*2020-02-28* + +_2020-02-28_ ### Features -* Allow adding plugins on the command line via `--plugin ` (#3379) + +- Allow adding plugins on the command line via `--plugin ` (#3379) ### Pull Requests -* [#3379](https://github.com/rollup/rollup/pull/3379): introduce CLI --plugin support (@kzc) -* [#3390](https://github.com/rollup/rollup/pull/3390): fix typo: this.addWatchfile (@mistlog) -* [#3392](https://github.com/rollup/rollup/pull/3392): Bump codecov from 3.6.1 to 3.6.5 -* [#3404](https://github.com/rollup/rollup/pull/3404): Update resolveFileUrl docs (@jakearchibald) + +- [#3379](https://github.com/rollup/rollup/pull/3379): introduce CLI --plugin support (@kzc) +- [#3390](https://github.com/rollup/rollup/pull/3390): fix typo: this.addWatchfile (@mistlog) +- [#3392](https://github.com/rollup/rollup/pull/3392): Bump codecov from 3.6.1 to 3.6.5 +- [#3404](https://github.com/rollup/rollup/pull/3404): Update resolveFileUrl docs (@jakearchibald) ## 1.31.1 -*2020-02-14* + +_2020-02-14_ ### Bug Fixes -* Make sure errored files are always re-evaluated in watch mode to avoid an issue in the typescript plugin (#3388) + +- Make sure errored files are always re-evaluated in watch mode to avoid an issue in the typescript plugin (#3388) ### Pull Requests -* [#3366](https://github.com/rollup/rollup/pull/3366): Correct spelling minifaction to minification (@VictorHom) -* [#3371](https://github.com/rollup/rollup/pull/3371): Adjust bug template to mention REPL.it (@lukastaegert) -* [#3388](https://github.com/rollup/rollup/pull/3388): Run transform hooks again in watch mode on files that errored (@lukastaegert) + +- [#3366](https://github.com/rollup/rollup/pull/3366): Correct spelling minifaction to minification (@VictorHom) +- [#3371](https://github.com/rollup/rollup/pull/3371): Adjust bug template to mention REPL.it (@lukastaegert) +- [#3388](https://github.com/rollup/rollup/pull/3388): Run transform hooks again in watch mode on files that errored (@lukastaegert) ## 1.31.0 -*2020-01-31* + +_2020-01-31_ ### Features -* Always disable tree-shaking for asm.js functions to maintain semantics (#3362) + +- Always disable tree-shaking for asm.js functions to maintain semantics (#3362) ### Pull Requests -* [#3362](https://github.com/rollup/rollup/pull/3362): Preserve asm.js code (@lukastaegert) + +- [#3362](https://github.com/rollup/rollup/pull/3362): Preserve asm.js code (@lukastaegert) ## 1.30.1 -*2020-01-27* + +_2020-01-27_ ### Bug Fixes -* Do not mistreat static entgry points as dynamic ones when chunking (#3357) -* Resolve a crash when chunking circular dynamic imports (#3357) + +- Do not mistreat static entgry points as dynamic ones when chunking (#3357) +- Resolve a crash when chunking circular dynamic imports (#3357) ### Pull Requests -* [#3357](https://github.com/rollup/rollup/pull/3357): Resolve issues with circular dynamic entries (@lukastaegert) + +- [#3357](https://github.com/rollup/rollup/pull/3357): Resolve issues with circular dynamic entries (@lukastaegert) ## 1.30.0 -*2020-01-27* + +_2020-01-27_ ### Features -* Do not split chunks when dynamically imported modules import modules that are already loaded by all dynamic importers (#3354) -* Add `hoistTransitiveImports` option to disable hoisting imports of static dependencies into entry chunks (#3353) + +- Do not split chunks when dynamically imported modules import modules that are already loaded by all dynamic importers (#3354) +- Add `hoistTransitiveImports` option to disable hoisting imports of static dependencies into entry chunks (#3353) ### Bug Fixes -* Make sure polyfills are always loaded first when each static entry point contains them as first import (#3354) + +- Make sure polyfills are always loaded first when each static entry point contains them as first import (#3354) ### Pull Requests -* [#3353](https://github.com/rollup/rollup/pull/3353): Add option to avoid hoisting transitive imports (@lukastaegert) -* [#3354](https://github.com/rollup/rollup/pull/3354): Improve chunking algorithm for dynamic imports (@tjenkinson and @lukastaegert) + +- [#3353](https://github.com/rollup/rollup/pull/3353): Add option to avoid hoisting transitive imports (@lukastaegert) +- [#3354](https://github.com/rollup/rollup/pull/3354): Improve chunking algorithm for dynamic imports (@tjenkinson and @lukastaegert) ## 1.29.1 -*2020-01-21* + +_2020-01-21_ ### Bug Fixes -* Avoid crashes for circular reexports when named exports cannot be found (#3350) + +- Avoid crashes for circular reexports when named exports cannot be found (#3350) ### Pull Requests -* [#3335](https://github.com/rollup/rollup/pull/3335): Fix typo (@robbinworks) -* [#3342](https://github.com/rollup/rollup/pull/3342): Remove ":" from test file names for Windows and update dependencies (@lukastaegert) -* [#3350](https://github.com/rollup/rollup/pull/3350): Properly handle circular reexports (@lukastaegert) + +- [#3335](https://github.com/rollup/rollup/pull/3335): Fix typo (@robbinworks) +- [#3342](https://github.com/rollup/rollup/pull/3342): Remove ":" from test file names for Windows and update dependencies (@lukastaegert) +- [#3350](https://github.com/rollup/rollup/pull/3350): Properly handle circular reexports (@lukastaegert) ## 1.29.0 -*2020-01-08* + +_2020-01-08_ ### Features -* Enable top-level await by default (#3089) -* Add typings for watch events (#3302) + +- Enable top-level await by default (#3089) +- Add typings for watch events (#3302) ### Bug Fixes -* Deconflict files that would conflict only on a case-insensitive OS (#3317) -* Do not fail in certain scenarios where a logical expression inside a sequence expression was being directly included (#3327) + +- Deconflict files that would conflict only on a case-insensitive OS (#3317) +- Do not fail in certain scenarios where a logical expression inside a sequence expression was being directly included (#3327) ### Pull Requests -* [#3089](https://github.com/rollup/rollup/pull/3089): Move top-level await out of experimental (@guybedford) -* [#3302](https://github.com/rollup/rollup/pull/3302): Adds type definitions for RollupWatcher events (@NotWoods) -* [#3317](https://github.com/rollup/rollup/pull/3317): Fix module id conflict on a case insensitive OS (@yesmeck) -* [#3327](https://github.com/rollup/rollup/pull/3327): Handle deoptimizations while a node is being included (@lukastaegert) + +- [#3089](https://github.com/rollup/rollup/pull/3089): Move top-level await out of experimental (@guybedford) +- [#3302](https://github.com/rollup/rollup/pull/3302): Adds type definitions for RollupWatcher events (@NotWoods) +- [#3317](https://github.com/rollup/rollup/pull/3317): Fix module id conflict on a case insensitive OS (@yesmeck) +- [#3327](https://github.com/rollup/rollup/pull/3327): Handle deoptimizations while a node is being included (@lukastaegert) ## 1.28.0 -*2020-01-04* + +_2020-01-04_ ### Features -* Allow piping in stdin via the command line interface (#3312, #3290) -* Allow plugins to mark modules as having syntheticNamedExports for e.g. better CJS interoperability (#3295) -* Ignore variable reassignments in dead code when tree-shaking to remove more unneeded code (#3212) + +- Allow piping in stdin via the command line interface (#3312, #3290) +- Allow plugins to mark modules as having syntheticNamedExports for e.g. better CJS interoperability (#3295) +- Ignore variable reassignments in dead code when tree-shaking to remove more unneeded code (#3212) ### Bug Fixes -* Properly respect tree-shaken code when generating sourcemaps (#3318) + +- Properly respect tree-shaken code when generating sourcemaps (#3318) ### Pull Requests -* [#3212](https://github.com/rollup/rollup/pull/3212): Handle assignments in dead code (@tjenkinson) -* [#3290](https://github.com/rollup/rollup/pull/3290): Implement stdin input with optional "-" as the file name (@kzc) -* [#3295](https://github.com/rollup/rollup/pull/3295): Add syntheticNamedExports (@manucorporat) -* [#3300](https://github.com/rollup/rollup/pull/3300): Add note about setting `types` in tsconfig file (@tjenkinson) -* [#3303](https://github.com/rollup/rollup/pull/3303): Use ! to assert not-null in TypeScript (@NotWoods) -* [#3312](https://github.com/rollup/rollup/pull/3312): Implement stdin input (@lukastaegert) -* [#3318](https://github.com/rollup/rollup/pull/3318): Update magic-string and other dependencies (@lukastaegert) + +- [#3212](https://github.com/rollup/rollup/pull/3212): Handle assignments in dead code (@tjenkinson) +- [#3290](https://github.com/rollup/rollup/pull/3290): Implement stdin input with optional "-" as the file name (@kzc) +- [#3295](https://github.com/rollup/rollup/pull/3295): Add syntheticNamedExports (@manucorporat) +- [#3300](https://github.com/rollup/rollup/pull/3300): Add note about setting `types` in tsconfig file (@tjenkinson) +- [#3303](https://github.com/rollup/rollup/pull/3303): Use ! to assert not-null in TypeScript (@NotWoods) +- [#3312](https://github.com/rollup/rollup/pull/3312): Implement stdin input (@lukastaegert) +- [#3318](https://github.com/rollup/rollup/pull/3318): Update magic-string and other dependencies (@lukastaegert) ## 1.27.14 -*2019-12-22* + +_2019-12-22_ ### Bug Fixes -* Update references to official rollup plugins in error messages (#3297, #3298) + +- Update references to official rollup plugins in error messages (#3297, #3298) ### Pull Requests -* [#3286](https://github.com/rollup/rollup/pull/3286): Update link to JavaScript API documentation (@romankaravia) -* [#3294](https://github.com/rollup/rollup/pull/3294): Update deprecated references to the node-resolve plugin in the documentation (@Vlad-Shcherbina) -* [#3297](https://github.com/rollup/rollup/pull/3297): Update references to rollup-plugin-json (@cprecioso) -* [#3298](https://github.com/rollup/rollup/pull/3298): Update references to official rollup plugins (@cprecioso) + +- [#3286](https://github.com/rollup/rollup/pull/3286): Update link to JavaScript API documentation (@romankaravia) +- [#3294](https://github.com/rollup/rollup/pull/3294): Update deprecated references to the node-resolve plugin in the documentation (@Vlad-Shcherbina) +- [#3297](https://github.com/rollup/rollup/pull/3297): Update references to rollup-plugin-json (@cprecioso) +- [#3298](https://github.com/rollup/rollup/pull/3298): Update references to official rollup plugins (@cprecioso) ## 1.27.13 -*2019-12-14* + +_2019-12-14_ ### Bug Fixes -* Do not truncate environment variable values at the first colon when using the `--environment` option (#3283) + +- Do not truncate environment variable values at the first colon when using the `--environment` option (#3283) ### Pull Requests -* [#3283](https://github.com/rollup/rollup/pull/3283): Allow environment variables to contain colons (@tlaverdure) + +- [#3283](https://github.com/rollup/rollup/pull/3283): Allow environment variables to contain colons (@tlaverdure) ## 1.27.12 -*2019-12-13* + +_2019-12-13_ ### Bug Fixes -* Prevent invalid AMD or SystemJS code when accessing `import.meta` (#3282) + +- Prevent invalid AMD or SystemJS code when accessing `import.meta` (#3282) ### Pull Requests -* [#3282](https://github.com/rollup/rollup/pull/3282): Always make "module" available for SystemJS and AMD formats if `import.meta` is accessed directly (@lukastaegert) + +- [#3282](https://github.com/rollup/rollup/pull/3282): Always make "module" available for SystemJS and AMD formats if `import.meta` is accessed directly (@lukastaegert) ## 1.27.11 -*2019-12-12* + +_2019-12-12_ ### Bug Fixes -* Resolve a crash due to an infinite loop (#3280) + +- Resolve a crash due to an infinite loop (#3280) ### Pull Requests -* [#3280](https://github.com/rollup/rollup/pull/3280): Prevent infinite deoptimizations (@lukastaegert) + +- [#3280](https://github.com/rollup/rollup/pull/3280): Prevent infinite deoptimizations (@lukastaegert) ## 1.27.10 -*2019-12-11* + +_2019-12-11_ ### Bug Fixes -* Keep track of function return values in more situations (#3278) + +- Keep track of function return values in more situations (#3278) ### Pull Requests -* [#3278](https://github.com/rollup/rollup/pull/3278): Avoid some unnecessary value tracking deoptimizations (@lukastaegert) + +- [#3278](https://github.com/rollup/rollup/pull/3278): Avoid some unnecessary value tracking deoptimizations (@lukastaegert) ## 1.27.9 -*2019-12-07* + +_2019-12-07_ ### Bug Fixes -* Fix an issue where reexports could be missing when preserving modules (#3273) -* Allow turning of color output via NO_COLOR or FORCE_COLOR=0 environment variables (#3272) + +- Fix an issue where reexports could be missing when preserving modules (#3273) +- Allow turning of color output via NO_COLOR or FORCE_COLOR=0 environment variables (#3272) ### Pull Requests -* [#3272](https://github.com/rollup/rollup/pull/3272): Support either NO_COLOR or FORCE_COLOR=0 to turn off color (@kikonen) -* [#3273](https://github.com/rollup/rollup/pull/3273): Make sure that indirectly reexported modules also become chunk dependencies when preserving modules(@lukastaegert) + +- [#3272](https://github.com/rollup/rollup/pull/3272): Support either NO_COLOR or FORCE_COLOR=0 to turn off color (@kikonen) +- [#3273](https://github.com/rollup/rollup/pull/3273): Make sure that indirectly reexported modules also become chunk dependencies when preserving modules(@lukastaegert) ## 1.27.8 -*2019-12-02* + +_2019-12-02_ ### Bug Fixes -* Deoptimize objects when a method is called on them to make sure modifications via "this" are observed (#3266) + +- Deoptimize objects when a method is called on them to make sure modifications via "this" are observed (#3266) ### Pull Requests -* [#3266](https://github.com/rollup/rollup/pull/3266): Workaround for various object literal mutation bugs (@kzc) + +- [#3266](https://github.com/rollup/rollup/pull/3266): Workaround for various object literal mutation bugs (@kzc) ## 1.27.7 -*2019-12-01* + +_2019-12-01_ ### Bug Fixes -* Fix a scenario where a reassignments to computed properties were not tracked (#3267) + +- Fix a scenario where a reassignments to computed properties were not tracked (#3267) ### Pull Requests -* [#3267](https://github.com/rollup/rollup/pull/3267): Fix incomplete computed property deoptimization (@lukastaegert) + +- [#3267](https://github.com/rollup/rollup/pull/3267): Fix incomplete computed property deoptimization (@lukastaegert) ## 1.27.6 -*2019-11-30* + +_2019-11-30_ ### Bug Fixes -* Use "auto" export mode by default for all modules when preserving modules (#3265) -* Observe "output.exports" when preserving modules and warn for mixed exports if necessary (#3265) + +- Use "auto" export mode by default for all modules when preserving modules (#3265) +- Observe "output.exports" when preserving modules and warn for mixed exports if necessary (#3265) ### Pull Requests -* [#3265](https://github.com/rollup/rollup/pull/3265): Use export mode "auto" by default when preserving modules (@lukastaegert) + +- [#3265](https://github.com/rollup/rollup/pull/3265): Use export mode "auto" by default when preserving modules (@lukastaegert) ## 1.27.5 -*2019-11-25* + +_2019-11-25_ ### Bug Fixes -* Make sure namespaces for inlined dynamic imports are treated as variable accesses when deconflicting (#3256) + +- Make sure namespaces for inlined dynamic imports are treated as variable accesses when deconflicting (#3256) ### Pull Requests -* [#3256](https://github.com/rollup/rollup/pull/3256): Avoid name conflicts when inlining dynamic imports nested in functions (@lukastaegert) -* [#3257](https://github.com/rollup/rollup/pull/3257): Update dependencies (@lukastaegert) + +- [#3256](https://github.com/rollup/rollup/pull/3256): Avoid name conflicts when inlining dynamic imports nested in functions (@lukastaegert) +- [#3257](https://github.com/rollup/rollup/pull/3257): Update dependencies (@lukastaegert) ## 1.27.4 -*2019-11-22* + +_2019-11-22_ ### Bug Fixes -* Aggregate circular dependency warnings in the CLI (#3249) -* Do not defer non-aggregated handlers in the CLI (#3249) + +- Aggregate circular dependency warnings in the CLI (#3249) +- Do not defer non-aggregated handlers in the CLI (#3249) ### Pull Requests -* [#3249](https://github.com/rollup/rollup/pull/3249): Fix broken Windows CLI tests (@lukastaegert) -* [#3251](https://github.com/rollup/rollup/pull/3251): Add installation as a separate header (@ashrith-kulai) + +- [#3249](https://github.com/rollup/rollup/pull/3249): Fix broken Windows CLI tests (@lukastaegert) +- [#3251](https://github.com/rollup/rollup/pull/3251): Add installation as a separate header (@ashrith-kulai) ## 1.27.3 -*2019-11-20* + +_2019-11-20_ ### Bug Fixes -* Provide better warning when empty chunks are created in a code-splitting scenario (#3244) + +- Provide better warning when empty chunks are created in a code-splitting scenario (#3244) ### Pull Requests -* [#3244](https://github.com/rollup/rollup/pull/3244): Clearer empty chunk warning (@tjenkinson) + +- [#3244](https://github.com/rollup/rollup/pull/3244): Clearer empty chunk warning (@tjenkinson) ## 1.27.2 -*2019-11-18* + +_2019-11-18_ ### Bug Fixes -* Fix an issue where live bindings were not working correctly when using `+=` in SystemJS (#3242) + +- Fix an issue where live bindings were not working correctly when using `+=` in SystemJS (#3242) ### Pull Requests -* [#3242](https://github.com/rollup/rollup/pull/3242): Export updated assignments when using shorthand update assignment expressions in SystemJS (@lukastaegert) + +- [#3242](https://github.com/rollup/rollup/pull/3242): Export updated assignments when using shorthand update assignment expressions in SystemJS (@lukastaegert) ## 1.27.1 -*2019-11-18* + +_2019-11-18_ ### Bug Fixes -* Fix an issue where code after a switch-statement with removed cases was erroneously not included (#3241) + +- Fix an issue where code after a switch-statement with removed cases was erroneously not included (#3241) ### Pull Requests -* [#3237](https://github.com/rollup/rollup/pull/3237): make `acornOptions` optional in `parse()` in docs (@tjenkinson) -* [#3240](https://github.com/rollup/rollup/pull/3240): Update dependencies and fix vulnerability (@lukastaegert) -* [#3241](https://github.com/rollup/rollup/pull/3241): Do not truncate after switch-statement with removed case (@lukastaegert) + +- [#3237](https://github.com/rollup/rollup/pull/3237): make `acornOptions` optional in `parse()` in docs (@tjenkinson) +- [#3240](https://github.com/rollup/rollup/pull/3240): Update dependencies and fix vulnerability (@lukastaegert) +- [#3241](https://github.com/rollup/rollup/pull/3241): Do not truncate after switch-statement with removed case (@lukastaegert) ## 1.27.0 -*2019-11-12* + +_2019-11-12_ ### Features -* Add support for output-specific plugins (#3218) -* Reenable parallel output processing when using the CLI (#3218) -* Warn if files are emitted that would overwrite previously emitted files (#3218) + +- Add support for output-specific plugins (#3218) +- Reenable parallel output processing when using the CLI (#3218) +- Warn if files are emitted that would overwrite previously emitted files (#3218) ### Bug Fixes -* Do not overwrite files emitted in other builds if outputs are generated in parallel (#3218) + +- Do not overwrite files emitted in other builds if outputs are generated in parallel (#3218) ### Pull Requests -* [#3218](https://github.com/rollup/rollup/pull/3218): Per output plugins (@lukastaegert) + +- [#3218](https://github.com/rollup/rollup/pull/3218): Per output plugins (@lukastaegert) ## 1.26.5 -*2019-11-11* + +_2019-11-11_ ### Bug Fixes -* Fix a regression where it was no longer to pass a certain option format to generate (#3223) + +- Fix a regression where it was no longer to pass a certain option format to generate (#3223) ### Pull Requests -* [#3223](https://github.com/rollup/rollup/pull/3223): Allow passing input options to output (@lukastaegert) + +- [#3223](https://github.com/rollup/rollup/pull/3223): Allow passing input options to output (@lukastaegert) ## 1.26.4 -*2019-11-09* + +_2019-11-09_ ### Bug Fixes -* Keep watching known files after a plugin error during the initial build (#3219) + +- Keep watching known files after a plugin error during the initial build (#3219) ### Pull Requests -* [#3216](https://github.com/rollup/rollup/pull/3216): Fix small typo (@kaisermann) -* [#3217](https://github.com/rollup/rollup/pull/3217): Update dependencies and fix security vulnerability (@lukastaegert) -* [#3219](https://github.com/rollup/rollup/pull/3219): Also recover from plugin errors during the initial build (@lukastaegert) + +- [#3216](https://github.com/rollup/rollup/pull/3216): Fix small typo (@kaisermann) +- [#3217](https://github.com/rollup/rollup/pull/3217): Update dependencies and fix security vulnerability (@lukastaegert) +- [#3219](https://github.com/rollup/rollup/pull/3219): Also recover from plugin errors during the initial build (@lukastaegert) ## 1.26.3 -*2019-11-02* + +_2019-11-02_ ### Bug Fixes -* Work around an incompatibility with rollup-plugin-dts (#3211) + +- Work around an incompatibility with rollup-plugin-dts (#3211) ### Pull Requests -* [#3211](https://github.com/rollup/rollup/pull/3211): Do no fail if the source attribute is `undefined` in an unused named export (@lukastaegert) + +- [#3211](https://github.com/rollup/rollup/pull/3211): Do no fail if the source attribute is `undefined` in an unused named export (@lukastaegert) ## 1.26.2 -*2019-10-31* + +_2019-10-31_ ### Bug Fixes -* Do not create invalid code when using `treeshake: false` and star re-exports (#3209) + +- Do not create invalid code when using `treeshake: false` and star re-exports (#3209) ### Pull Requests -* [#3209](https://github.com/rollup/rollup/pull/3209): Also remove export-all declarations when not tree-shaking (@lukastaegert) + +- [#3209](https://github.com/rollup/rollup/pull/3209): Also remove export-all declarations when not tree-shaking (@lukastaegert) ## 1.26.1 -*2019-10-31* + +_2019-10-31_ ### Bug Fixes -* Prevent an issue where outputs would overwrite files emitted by other outputs (#3201) -* Do not throw an error if the config file does not have a .js extension (#3204) + +- Prevent an issue where outputs would overwrite files emitted by other outputs (#3201) +- Do not throw an error if the config file does not have a .js extension (#3204) ### Pull Requests -* [#3201](https://github.com/rollup/rollup/pull/3201): Make the CLI run generate/output in serial (@marijnh) -* [#3204](https://github.com/rollup/rollup/pull/3204): support all config file extensions (.js,.mjs,...) (@arlac77) + +- [#3201](https://github.com/rollup/rollup/pull/3201): Make the CLI run generate/output in serial (@marijnh) +- [#3204](https://github.com/rollup/rollup/pull/3204): support all config file extensions (.js,.mjs,...) (@arlac77) ## 1.26.0 -*2019-10-27* + +_2019-10-27_ ### Features -* Only warn when no output is provided for an IIFE bundle but still produce valid code (#3181) -* Support reexporting namespaces as a binding (#3193) -* Switch from hash.js to crypto for hashing in the Node build for better performance and support for very large assets (#3194) + +- Only warn when no output is provided for an IIFE bundle but still produce valid code (#3181) +- Support reexporting namespaces as a binding (#3193) +- Switch from hash.js to crypto for hashing in the Node build for better performance and support for very large assets (#3194) ### Bug Fixes -* Correctly handle chunks reexporting the same namespace as two different bindings (#3193) + +- Correctly handle chunks reexporting the same namespace as two different bindings (#3193) ### Pull Requests -* [#3181](https://github.com/rollup/rollup/pull/3181): Remove the need to provide an output name for IIFE bundles (@bterrier) -* [#3193](https://github.com/rollup/rollup/pull/3193): Add support for "export * as name from …" (@lukastaegert) -* [#3194](https://github.com/rollup/rollup/pull/3194): Add support for large assets (> 100 MB) (@SebastianNiemann) + +- [#3181](https://github.com/rollup/rollup/pull/3181): Remove the need to provide an output name for IIFE bundles (@bterrier) +- [#3193](https://github.com/rollup/rollup/pull/3193): Add support for "export \* as name from …" (@lukastaegert) +- [#3194](https://github.com/rollup/rollup/pull/3194): Add support for large assets (> 100 MB) (@SebastianNiemann) ## 1.25.2 -*2019-10-23* + +_2019-10-23_ ### Bug Fixes -* Improve performance of bundled UMD code by adding additional parentheses to enforce eager parsing (#3183) -* Improve types to tolerate passing a Rollup config with multiple outputs to `rollup.rollup` (#3184) + +- Improve performance of bundled UMD code by adding additional parentheses to enforce eager parsing (#3183) +- Improve types to tolerate passing a Rollup config with multiple outputs to `rollup.rollup` (#3184) ### Pull Requests -* [#3183](https://github.com/rollup/rollup/pull/3183): Add parentheses to factory function of UMD bundles (@ajihyf) -* [#3184](https://github.com/rollup/rollup/pull/3184): RollupOptions accept output as array (@imcotton) + +- [#3183](https://github.com/rollup/rollup/pull/3183): Add parentheses to factory function of UMD bundles (@ajihyf) +- [#3184](https://github.com/rollup/rollup/pull/3184): RollupOptions accept output as array (@imcotton) ## 1.25.1 -*2019-10-20* + +_2019-10-20_ ### Bug Fixes -* Handle a situation where code was not included after a switch statement (#3178) -* Handle a situation where code was not included after a do-while loop (#3180) -* Do not fail if different outputs emit the same file (#3175) -* Give access to the original acorn error for parse errors (#3176) + +- Handle a situation where code was not included after a switch statement (#3178) +- Handle a situation where code was not included after a do-while loop (#3180) +- Do not fail if different outputs emit the same file (#3175) +- Give access to the original acorn error for parse errors (#3176) ### Pull Requests -* [#3175](https://github.com/rollup/rollup/pull/3175): Disable errors for duplicate emitted file names (@marijnh) -* [#3176](https://github.com/rollup/rollup/pull/3176): Add original parser error to rollup error; Update tests (@gribnoysup) -* [#3178](https://github.com/rollup/rollup/pull/3178): Fix switch case not being included correctly (@lukastaegert) -* [#3179](https://github.com/rollup/rollup/pull/3179): Update dependencies (@lukastaegert) -* [#3180](https://github.com/rollup/rollup/pull/3180): Handle conditional breaks in do-while loops with unconditional return (@lukastaegert) + +- [#3175](https://github.com/rollup/rollup/pull/3175): Disable errors for duplicate emitted file names (@marijnh) +- [#3176](https://github.com/rollup/rollup/pull/3176): Add original parser error to rollup error; Update tests (@gribnoysup) +- [#3178](https://github.com/rollup/rollup/pull/3178): Fix switch case not being included correctly (@lukastaegert) +- [#3179](https://github.com/rollup/rollup/pull/3179): Update dependencies (@lukastaegert) +- [#3180](https://github.com/rollup/rollup/pull/3180): Handle conditional breaks in do-while loops with unconditional return (@lukastaegert) ## 1.25.0 -*2019-10-18* + +_2019-10-18_ ### Features -* Remove try-catch if there is no side-effect in the try-block (#3166) -* Omit side-effect-free trailing cases in switch-statements (#3166) -* Remove unused labels (#3170) + +- Remove try-catch if there is no side-effect in the try-block (#3166) +- Omit side-effect-free trailing cases in switch-statements (#3166) +- Remove unused labels (#3170) ### Bug Fixes -* Do not remove code after labeled statements that contain a throw or return if the label is used (#3170) -* Prevent invalid code when expressions are simplified that do not follow a white-space character (#3173) -* Do not remove continue statements inside switch statements (#3166) -* Prevent trailing empty lines when tree-shaking inside switch statements (#3166) + +- Do not remove code after labeled statements that contain a throw or return if the label is used (#3170) +- Prevent invalid code when expressions are simplified that do not follow a white-space character (#3173) +- Do not remove continue statements inside switch statements (#3166) +- Prevent trailing empty lines when tree-shaking inside switch statements (#3166) ### Pull Requests -* [#3166](https://github.com/rollup/rollup/pull/3166): Better try statement tree shaking (@lukastaegert) -* [#3170](https://github.com/rollup/rollup/pull/3170): Handle optional control flow in labeled statements, remove unused labels (@lukastaegert) -* [#3173](https://github.com/rollup/rollup/pull/3173): Add missing spaces in certain statements and expressions to avoid invalid code (@lukastaegert) + +- [#3166](https://github.com/rollup/rollup/pull/3166): Better try statement tree shaking (@lukastaegert) +- [#3170](https://github.com/rollup/rollup/pull/3170): Handle optional control flow in labeled statements, remove unused labels (@lukastaegert) +- [#3173](https://github.com/rollup/rollup/pull/3173): Add missing spaces in certain statements and expressions to avoid invalid code (@lukastaegert) ## 1.24.0 -*2019-10-15* + +_2019-10-15_ ### Features -* Respect `break`, `continue`, `return` and `throw` when tree-shaking to detect dead code (#3153) -* Do treat treat hoisted function declarations as "unknown" when checking for call side-effects (#3153) + +- Respect `break`, `continue`, `return` and `throw` when tree-shaking to detect dead code (#3153) +- Do treat treat hoisted function declarations as "unknown" when checking for call side-effects (#3153) ### Bug Fixes -* Make sure that unknown `import.meta` properties produce valid code in SystemJS (#3152) -* Make sure `treeshake.annotations: false` is respected for class instantiation (#3153) -* Check property access side-effects for class instantiation (#3153) -* Do not suppress break statements inside labeled statements (#3153) + +- Make sure that unknown `import.meta` properties produce valid code in SystemJS (#3152) +- Make sure `treeshake.annotations: false` is respected for class instantiation (#3153) +- Check property access side-effects for class instantiation (#3153) +- Do not suppress break statements inside labeled statements (#3153) ### Pull Requests -* [#3152](https://github.com/rollup/rollup/pull/3152): Allow import.meta.* for systemjs format (@dmail) -* [#3153](https://github.com/rollup/rollup/pull/3153): Get rid of immutable.js and implement tree-shaking for broken control flow (@lukastaegert) + +- [#3152](https://github.com/rollup/rollup/pull/3152): Allow import.meta.\* for systemjs format (@dmail) +- [#3153](https://github.com/rollup/rollup/pull/3153): Get rid of immutable.js and implement tree-shaking for broken control flow (@lukastaegert) ## 1.23.1 -*2019-10-05* + +_2019-10-05_ ### Bug Fixes -* Fix a regression where the node types had a specific minimal version (#3143) + +- Fix a regression where the node types had a specific minimal version (#3143) ### Pull Requests -* [#3143](https://github.com/rollup/rollup/pull/3143): Ensure that types packages have star version ranges (@lukastaegert) + +- [#3143](https://github.com/rollup/rollup/pull/3143): Ensure that types packages have star version ranges (@lukastaegert) ## 1.23.0 -*2019-10-03* + +_2019-10-03_ ### Features -* Add placeholders for extensions when preserving modules (#3116) + +- Add placeholders for extensions when preserving modules (#3116) ### Pull Requests -* [#3116](https://github.com/rollup/rollup/pull/3116): Include extensions in preserveModules output filenames for scriptified assets (@Andarist) -* [#3142](https://github.com/rollup/rollup/pull/3142): Fix typo (@tu4mo) + +- [#3116](https://github.com/rollup/rollup/pull/3116): Include extensions in preserveModules output filenames for scriptified assets (@Andarist) +- [#3142](https://github.com/rollup/rollup/pull/3142): Fix typo (@tu4mo) ## 1.22.0 -*2019-09-29* + +_2019-09-29_ ### Features -* Add a new "hidden" sourcemap type that generates the map files but omits the sourcemap comment (#3120) -* Generate more efficient code when using `namespaceToStringTag: true` (#3135) -* Make sure namespace objects do not have a prototype (#3136) + +- Add a new "hidden" sourcemap type that generates the map files but omits the sourcemap comment (#3120) +- Generate more efficient code when using `namespaceToStringTag: true` (#3135) +- Make sure namespace objects do not have a prototype (#3136) ### Bug Fixes -* Do not ignore side-effectful iterators by always preserving for..of loops for now (#3132) -* Make sure `--context` is observed as a CLI option (#3134) -* Do not require specific versions for @types dependencies (#3131) + +- Do not ignore side-effectful iterators by always preserving for..of loops for now (#3132) +- Make sure `--context` is observed as a CLI option (#3134) +- Do not require specific versions for @types dependencies (#3131) ### Pull Requests -* [#3120](https://github.com/rollup/rollup/pull/3120): Generate sourcemaps but omit the comment (@rohitmohan96) -* [#3131](https://github.com/rollup/rollup/pull/3131): Use asterisk for @types/* dependencies (@frenzzy) -* [#3132](https://github.com/rollup/rollup/pull/3132): Preserve empty for...of loops (@imatlopez) -* [#3133](https://github.com/rollup/rollup/pull/3133): Update dependencies (@lukastaegert) -* [#3134](https://github.com/rollup/rollup/pull/3134): Wire up --context CLI flag (@tchetwin) -* [#3135](https://github.com/rollup/rollup/pull/3135): Remove Symbol polyfill in module namespaces (@mkubilayk) -* [#3136](https://github.com/rollup/rollup/pull/3136): Set null prototype on namespace objects (@rpamely) + +- [#3120](https://github.com/rollup/rollup/pull/3120): Generate sourcemaps but omit the comment (@rohitmohan96) +- [#3131](https://github.com/rollup/rollup/pull/3131): Use asterisk for @types/\* dependencies (@frenzzy) +- [#3132](https://github.com/rollup/rollup/pull/3132): Preserve empty for...of loops (@imatlopez) +- [#3133](https://github.com/rollup/rollup/pull/3133): Update dependencies (@lukastaegert) +- [#3134](https://github.com/rollup/rollup/pull/3134): Wire up --context CLI flag (@tchetwin) +- [#3135](https://github.com/rollup/rollup/pull/3135): Remove Symbol polyfill in module namespaces (@mkubilayk) +- [#3136](https://github.com/rollup/rollup/pull/3136): Set null prototype on namespace objects (@rpamely) ## 1.21.4 -*2019-09-16* + +_2019-09-16_ ### Bug Fixes -* Recognize common browser globals (#3117) -* Do not treat "typeof " as a side-effect (#3117) + +- Recognize common browser globals (#3117) +- Do not treat "typeof " as a side-effect (#3117) ### Pull Requests -* [#3117](https://github.com/rollup/rollup/pull/3117): Add browser globals to known globals and prevent "typeof" side-effects (@lukastaegert) + +- [#3117](https://github.com/rollup/rollup/pull/3117): Add browser globals to known globals and prevent "typeof" side-effects (@lukastaegert) ## 1.21.3 -*2019-09-14* + +_2019-09-14_ ### Bug Fixes -* Fix a regression where modifying a watched file did not trigger a rebuild (#3112) + +- Fix a regression where modifying a watched file did not trigger a rebuild (#3112) ### Pull Requests -* [#3112](https://github.com/rollup/rollup/pull/3112): Fix .addWatchFile() dependencies failing to invalidate in watch mode (@tivac) + +- [#3112](https://github.com/rollup/rollup/pull/3112): Fix .addWatchFile() dependencies failing to invalidate in watch mode (@tivac) ## 1.21.2 -*2019-09-09* + +_2019-09-09_ ### Bug Fixes -* Fix wrong deprecation message to direct to `this.emitFile` instead of `this.emitAsset` + +- Fix wrong deprecation message to direct to `this.emitFile` instead of `this.emitAsset` ## 1.21.1 -*2019-09-09* + +_2019-09-09_ ### Bug Fixes -* Allow legacy plugins to still add assets directly to the bundle object (#3105) + +- Allow legacy plugins to still add assets directly to the bundle object (#3105) ### Pull Requests -* [#3105](https://github.com/rollup/rollup/pull/3105): Allow legacy plugins to still add assets directly to the bundle object (@lukastaegert) + +- [#3105](https://github.com/rollup/rollup/pull/3105): Allow legacy plugins to still add assets directly to the bundle object (@lukastaegert) ## 1.21.0 -*2019-09-08* + +_2019-09-08_ ### Features -* Respect `output.entryFileNames` when preserving modules (#3088) -* Make accessing unknown globals a side-effect unless this is deactivated via `treeshake.unknownGlobalSideEffects` (#3068) -* Respect global objects when checking for pure global functions (#3068) -* Introduce a `type` to more easily distinguish chunks and assets in the output bundle (#3080) + +- Respect `output.entryFileNames` when preserving modules (#3088) +- Make accessing unknown globals a side-effect unless this is deactivated via `treeshake.unknownGlobalSideEffects` (#3068) +- Respect global objects when checking for pure global functions (#3068) +- Introduce a `type` to more easily distinguish chunks and assets in the output bundle (#3080) ### Bug Fixes -* Recover in watch mode when the initial build fails (#3081) -* Make sure `output.strict` is respected for SystemJS output (#3101) + +- Recover in watch mode when the initial build fails (#3081) +- Make sure `output.strict` is respected for SystemJS output (#3101) ### Pull Requests -* [#3068](https://github.com/rollup/rollup/pull/3068): Make accessing unknown globals a side-effect (@lukastaegert) -* [#3080](https://github.com/rollup/rollup/pull/3080): OutputBundle Tagged union with 'type = chunk|asset' (@askbeka) -* [#3081](https://github.com/rollup/rollup/pull/3081): Watch files onbuild, even if build fails (@mhkeller) -* [#3088](https://github.com/rollup/rollup/pull/3088): Add support for entryFileNames pattern used in combination with preserveModules option (@Andarist) -* [#3101](https://github.com/rollup/rollup/pull/3101): Remove 'use strict'; from systemjs when strict=false (@askbeka) + +- [#3068](https://github.com/rollup/rollup/pull/3068): Make accessing unknown globals a side-effect (@lukastaegert) +- [#3080](https://github.com/rollup/rollup/pull/3080): OutputBundle Tagged union with 'type = chunk|asset' (@askbeka) +- [#3081](https://github.com/rollup/rollup/pull/3081): Watch files onbuild, even if build fails (@mhkeller) +- [#3088](https://github.com/rollup/rollup/pull/3088): Add support for entryFileNames pattern used in combination with preserveModules option (@Andarist) +- [#3101](https://github.com/rollup/rollup/pull/3101): Remove 'use strict'; from systemjs when strict=false (@askbeka) ## 1.20.3 -*2019-08-28* + +_2019-08-28_ ### Bug Fixes -* Make sure file hashes change when a change of the naming pattern leads to a file name change of a dependency (#3083) -* Fix several issues where reexporting an external "default" export could lead to invalid or incorrect code (#3084) + +- Make sure file hashes change when a change of the naming pattern leads to a file name change of a dependency (#3083) +- Fix several issues where reexporting an external "default" export could lead to invalid or incorrect code (#3084) ### Pull Requests -* [#3078](https://github.com/rollup/rollup/pull/3078): Add github actions workflow config for windows (@shellscape) -* [#3083](https://github.com/rollup/rollup/pull/3083): Properly reflect dependency file names in hash (@lukastaegert) -* [#3084](https://github.com/rollup/rollup/pull/3084): Fix "default" reexport issues in non ESM/System formats (@lukastaegert) + +- [#3078](https://github.com/rollup/rollup/pull/3078): Add github actions workflow config for windows (@shellscape) +- [#3083](https://github.com/rollup/rollup/pull/3083): Properly reflect dependency file names in hash (@lukastaegert) +- [#3084](https://github.com/rollup/rollup/pull/3084): Fix "default" reexport issues in non ESM/System formats (@lukastaegert) ## 1.20.2 -*2019-08-25* + +_2019-08-25_ ### Bug Fixes -* Avoid an issue where circular namespace reexports would crash Rollup (#3074) + +- Avoid an issue where circular namespace reexports would crash Rollup (#3074) ### Pull Requests -* [#3077](https://github.com/rollup/rollup/pull/3077): Handle namespaces that reexport themselves (@lukastaegert) + +- [#3077](https://github.com/rollup/rollup/pull/3077): Handle namespaces that reexport themselves (@lukastaegert) ## 1.20.1 -*2019-08-22* + +_2019-08-22_ ### Bug Fixes -* Fix an issue where variable names inside dynamic import expressions were not rendered correctly (#3073) -* Fix type definition to allow a single watcher config as well as an array (#3074) + +- Fix an issue where variable names inside dynamic import expressions were not rendered correctly (#3073) +- Fix type definition to allow a single watcher config as well as an array (#3074) ### Pull Requests -* [#3073](https://github.com/rollup/rollup/pull/3073): Fix wrong variable name in import expression (@lukastaegert) -* [#3074](https://github.com/rollup/rollup/pull/3074): Fixes type definition on watch and Watcher constructor (@MicahZoltu) + +- [#3073](https://github.com/rollup/rollup/pull/3073): Fix wrong variable name in import expression (@lukastaegert) +- [#3074](https://github.com/rollup/rollup/pull/3074): Fixes type definition on watch and Watcher constructor (@MicahZoltu) ## 1.20.0 -*2019-08-21* + +_2019-08-21_ ### Features -* Add augmentChunkHash plugin hook to be able to reflect changes in renderChunk in the chunk hash (#2921) + +- Add augmentChunkHash plugin hook to be able to reflect changes in renderChunk in the chunk hash (#2921) ### Bug Fixes -* Do not mutate the acorn options object (#3051) -* Make sure the order of emitted chunks always reflects the order in which they were emitted (#3055) -* Do not hang when there are strings containing comment-like syntax in some scenarios (#3069) + +- Do not mutate the acorn options object (#3051) +- Make sure the order of emitted chunks always reflects the order in which they were emitted (#3055) +- Do not hang when there are strings containing comment-like syntax in some scenarios (#3069) ### Pull Requests -* [#2921](https://github.com/rollup/rollup/pull/2921): Add augmentChunkHash plugin hook (@isidrok) -* [#2995](https://github.com/rollup/rollup/pull/2995): Add info on installing locally to docs (@mesqueeb) -* [#3037](https://github.com/rollup/rollup/pull/3037): Refresh pull request labels (@shellscape) -* [#3048](https://github.com/rollup/rollup/pull/3048): Document ROLLUP_WATCH environment variable (@shellscape) -* [#3051](https://github.com/rollup/rollup/pull/3051): Avoid changes to the original options (.acorn) object (@LongTengDao) -* [#3052](https://github.com/rollup/rollup/pull/3052): Minor refactoring: Remove one try-catch (@KSXGitHub) -* [#3053](https://github.com/rollup/rollup/pull/3053): Refactor to use async-await in more places (@KSXGitHub) -* [#3055](https://github.com/rollup/rollup/pull/3055): Provide consistent chunking via a consistent order of entry modules when emitting chunks (@lukastaegert) -* [#3058](https://github.com/rollup/rollup/pull/3058): Remove acorn-bigint and acorn-dynamic-import from bundle (@LongTengDao) -* [#3061](https://github.com/rollup/rollup/pull/3061): Update to acorn@7 (@lukastaegert) -* [#3063](https://github.com/rollup/rollup/pull/3063): Auto-generate license file (@lukastaegert) -* [#3069](https://github.com/rollup/rollup/pull/3069): Prevent infinite loop when scanning for line-breaks and there are comment-like strings (@lukastaegert) + +- [#2921](https://github.com/rollup/rollup/pull/2921): Add augmentChunkHash plugin hook (@isidrok) +- [#2995](https://github.com/rollup/rollup/pull/2995): Add info on installing locally to docs (@mesqueeb) +- [#3037](https://github.com/rollup/rollup/pull/3037): Refresh pull request labels (@shellscape) +- [#3048](https://github.com/rollup/rollup/pull/3048): Document ROLLUP_WATCH environment variable (@shellscape) +- [#3051](https://github.com/rollup/rollup/pull/3051): Avoid changes to the original options (.acorn) object (@LongTengDao) +- [#3052](https://github.com/rollup/rollup/pull/3052): Minor refactoring: Remove one try-catch (@KSXGitHub) +- [#3053](https://github.com/rollup/rollup/pull/3053): Refactor to use async-await in more places (@KSXGitHub) +- [#3055](https://github.com/rollup/rollup/pull/3055): Provide consistent chunking via a consistent order of entry modules when emitting chunks (@lukastaegert) +- [#3058](https://github.com/rollup/rollup/pull/3058): Remove acorn-bigint and acorn-dynamic-import from bundle (@LongTengDao) +- [#3061](https://github.com/rollup/rollup/pull/3061): Update to acorn@7 (@lukastaegert) +- [#3063](https://github.com/rollup/rollup/pull/3063): Auto-generate license file (@lukastaegert) +- [#3069](https://github.com/rollup/rollup/pull/3069): Prevent infinite loop when scanning for line-breaks and there are comment-like strings (@lukastaegert) ## 1.19.4 -*2019-08-07* + +_2019-08-07_ ### Bug Fixes -* Prevent invalid code when exporting an external namespace (#3034) -* Prevent invalid or non-equivalent code when simplifying expressions in return and throw statements (#3035) + +- Prevent invalid code when exporting an external namespace (#3034) +- Prevent invalid or non-equivalent code when simplifying expressions in return and throw statements (#3035) ### Pull Requests -* [#3034](https://github.com/rollup/rollup/pull/3034): Avoid generating .* as export (@LongTengDao) -* [#3035](https://github.com/rollup/rollup/pull/3035): Prevent ASI errors for conditional expressions (@lukastaegert) -* [#3036](https://github.com/rollup/rollup/pull/3036): Fix documents to use https, not http (@giraffate) + +- [#3034](https://github.com/rollup/rollup/pull/3034): Avoid generating .\* as export (@LongTengDao) +- [#3035](https://github.com/rollup/rollup/pull/3035): Prevent ASI errors for conditional expressions (@lukastaegert) +- [#3036](https://github.com/rollup/rollup/pull/3036): Fix documents to use https, not http (@giraffate) ## 1.19.3 -*2019-08-06* + +_2019-08-06_ ### Bug Fixes -* Fix wrong URLs in error messages (#3033) + +- Fix wrong URLs in error messages (#3033) ### Pull Requests -* [#3033](https://github.com/rollup/rollup/pull/3033): Fix wrong URLs in error messages (@giraffate) + +- [#3033](https://github.com/rollup/rollup/pull/3033): Fix wrong URLs in error messages (@giraffate) ## 1.19.2 -*2019-08-05* + +_2019-08-05_ ### Bug Fixes -* Add bin file to package + +- Add bin file to package ## 1.19.1 -*2019-08-05* + +_2019-08-05_ ### Bug Fixes -* Remove wrong extension in package.json file (#3031) + +- Remove wrong extension in package.json file (#3031) ### Pull Requests -* [#3031](https://github.com/rollup/rollup/pull/3031): Fix wrong extension (@lukastaegert) + +- [#3031](https://github.com/rollup/rollup/pull/3031): Fix wrong extension (@lukastaegert) ## 1.19.0 -*2019-08-05* + +_2019-08-05_ ### Features -* Implement a new unified file emission API for assets and chunks with support for explicit file names (#2999) -* Use the id of the last module in a chunk as base for the chunk name if no better name is available (#3025) -* Use the id of the last module in a chunk as base for the variable name of a chunk in some formats if no better name is available (#2999) + +- Implement a new unified file emission API for assets and chunks with support for explicit file names (#2999) +- Use the id of the last module in a chunk as base for the chunk name if no better name is available (#3025) +- Use the id of the last module in a chunk as base for the variable name of a chunk in some formats if no better name is available (#2999) ### Bug Fixes -* Do not produce invalid variable names if an empty name is chosen for a virtual module (#3026) -* Fix an issue where a module variable name would conflict with a local variable name in some formats (#3020) + +- Do not produce invalid variable names if an empty name is chosen for a virtual module (#3026) +- Fix an issue where a module variable name would conflict with a local variable name in some formats (#3020) ### Pull Requests -* [#2999](https://github.com/rollup/rollup/pull/2999): Unified file emission api (@lukastaegert) -* [#3020](https://github.com/rollup/rollup/pull/3020): Switch to a code-splitting build and update dependencies (@lukastaegert) -* [#3025](https://github.com/rollup/rollup/pull/3025): Use id of last module in chunk as name base for auto-generated chunks (@lukastaegert) -* [#3026](https://github.com/rollup/rollup/pull/3026): Avoid variable from empty module name be empty (@LongTengDao) + +- [#2999](https://github.com/rollup/rollup/pull/2999): Unified file emission api (@lukastaegert) +- [#3020](https://github.com/rollup/rollup/pull/3020): Switch to a code-splitting build and update dependencies (@lukastaegert) +- [#3025](https://github.com/rollup/rollup/pull/3025): Use id of last module in chunk as name base for auto-generated chunks (@lukastaegert) +- [#3026](https://github.com/rollup/rollup/pull/3026): Avoid variable from empty module name be empty (@LongTengDao) ## 1.18.0 -*2019-08-01* + +_2019-08-01_ ### Features -* Add `externalLiveBindings: false` option to optimize code when live bindings are not needed (#3010) + +- Add `externalLiveBindings: false` option to optimize code when live bindings are not needed (#3010) ### Pull Requests -* [#2997](https://github.com/rollup/rollup/pull/2997): Integrate coverage into CI setup (@lukastaegert) -* [#2998](https://github.com/rollup/rollup/pull/2998): Update readme badges (@lukastaegert) -* [#3010](https://github.com/rollup/rollup/pull/3010): Add option to prevent code for external live bindings (@lukastaegert) + +- [#2997](https://github.com/rollup/rollup/pull/2997): Integrate coverage into CI setup (@lukastaegert) +- [#2998](https://github.com/rollup/rollup/pull/2998): Update readme badges (@lukastaegert) +- [#3010](https://github.com/rollup/rollup/pull/3010): Add option to prevent code for external live bindings (@lukastaegert) ## 1.17.0 -*2019-07-15* + +_2019-07-15_ ### Features -* Allow plugins to access current combined sourcemap in transform hook for coverage instrumentation (#2993) + +- Allow plugins to access current combined sourcemap in transform hook for coverage instrumentation (#2993) ### Pull Requests -* [#2987](https://github.com/rollup/rollup/pull/2987): Fix code fences for link (@johanholmerin) -* [#2989](https://github.com/rollup/rollup/pull/2989): Bump lodash from 4.17.11 to 4.17.14 (@dependabot) -* [#2993](https://github.com/rollup/rollup/pull/2993): Add getCombinedSourceMap in transform plugin context (@billowz) + +- [#2987](https://github.com/rollup/rollup/pull/2987): Fix code fences for link (@johanholmerin) +- [#2989](https://github.com/rollup/rollup/pull/2989): Bump lodash from 4.17.11 to 4.17.14 (@dependabot) +- [#2993](https://github.com/rollup/rollup/pull/2993): Add getCombinedSourceMap in transform plugin context (@billowz) ## 1.16.7 -*2019-07-09* + +_2019-07-09_ ### Bug Fixes -* Fix an issue where exported import.meta properties would lead to invalid code (#2986) + +- Fix an issue where exported import.meta properties would lead to invalid code (#2986) ### Pull Requests -* [#2985](https://github.com/rollup/rollup/pull/2985): Improve sourcemap types (@jridgewell) -* [#2986](https://github.com/rollup/rollup/pull/2986): Only overwrite content when resolving import.meta properties (@lukastaegert) + +- [#2985](https://github.com/rollup/rollup/pull/2985): Improve sourcemap types (@jridgewell) +- [#2986](https://github.com/rollup/rollup/pull/2986): Only overwrite content when resolving import.meta properties (@lukastaegert) ## 1.16.6 -*2019-07-04* + +_2019-07-04_ ### Bug Fixes -* Do not pass undefined to resolveDynamicImport for unresolvable template literals (#2984) + +- Do not pass undefined to resolveDynamicImport for unresolvable template literals (#2984) ### Pull Requests -* [#2984](https://github.com/rollup/rollup/pull/2984): Always forward AST nodes for unresolvable dynamic imports (@lukastaegert) + +- [#2984](https://github.com/rollup/rollup/pull/2984): Always forward AST nodes for unresolvable dynamic imports (@lukastaegert) ## 1.16.5 -*2019-07-04* + +_2019-07-04_ ### Bug Fixes -* onwarn should still be called when --silent is used (#2982) -* Properly clean up watchers for files that are deleted between builds (#2982) + +- onwarn should still be called when --silent is used (#2982) +- Properly clean up watchers for files that are deleted between builds (#2982) ### Pull Requests -* [#2981](https://github.com/rollup/rollup/pull/2981): Do not skip onwarn handler when --silent is used (@lukastaegert) -* [#2982](https://github.com/rollup/rollup/pull/2982): Make tests run on Node 12, fix watcher cleanup issue (@lukastaegert) + +- [#2981](https://github.com/rollup/rollup/pull/2981): Do not skip onwarn handler when --silent is used (@lukastaegert) +- [#2982](https://github.com/rollup/rollup/pull/2982): Make tests run on Node 12, fix watcher cleanup issue (@lukastaegert) ## 1.16.4 -*2019-07-02* + +_2019-07-02_ ### Bug Fixes -* Do not show a TypeScript error when providing a location as number to this.warn and this.error (#2974) -* Use the correct TypeScript type for Sourcemap.version (#2976) + +- Do not show a TypeScript error when providing a location as number to this.warn and this.error (#2974) +- Use the correct TypeScript type for Sourcemap.version (#2976) ### Pull Requests -* [#2965](https://github.com/rollup/rollup/pull/2965): Use async readFile in getRollupDefaultPlugin (@kaksmet) -* [#2974](https://github.com/rollup/rollup/pull/2974): Align TS types, docs and implementation for this.warn and this.error (@lukastaegert) -* [#2976](https://github.com/rollup/rollup/pull/2976): Fix sourcemap type and update dependencies (@lukastaegert) + +- [#2965](https://github.com/rollup/rollup/pull/2965): Use async readFile in getRollupDefaultPlugin (@kaksmet) +- [#2974](https://github.com/rollup/rollup/pull/2974): Align TS types, docs and implementation for this.warn and this.error (@lukastaegert) +- [#2976](https://github.com/rollup/rollup/pull/2976): Fix sourcemap type and update dependencies (@lukastaegert) ## 1.16.3 -*2019-06-29* + +_2019-06-29_ ### Bug Fixes -* Prevent name conflicts with unused function parameters (#2972) + +- Prevent name conflicts with unused function parameters (#2972) ### Pull Requests -* [#2972](https://github.com/rollup/rollup/pull/2972): Deconflict unused parameters (@lukastaegert) + +- [#2972](https://github.com/rollup/rollup/pull/2972): Deconflict unused parameters (@lukastaegert) ## 1.16.2 -*2019-06-22* + +_2019-06-22_ ### Bug Fixes -* Properly wrap dynamic imports in Promises that can be caught when generating CJS output (#2958) + +- Properly wrap dynamic imports in Promises that can be caught when generating CJS output (#2958) ### Pull Requests -* [#2958](https://github.com/rollup/rollup/pull/2958): Make sure errors from dynamic imports can be caught (@lukastaegert) + +- [#2958](https://github.com/rollup/rollup/pull/2958): Make sure errors from dynamic imports can be caught (@lukastaegert) ## 1.16.1 -*2019-06-21* + +_2019-06-21_ ### Pull Requests -* [#2956](https://github.com/rollup/rollup/pull/2956): Add missing CLI docs for strictDeprecations (@lukastaegert) + +- [#2956](https://github.com/rollup/rollup/pull/2956): Add missing CLI docs for strictDeprecations (@lukastaegert) ## 1.16.0 -*2019-06-21* + +_2019-06-21_ ### Features -* Add strictDeprecations option to throw when currently or upcoming deprecated features are used (#2945) -* Keep annotations and comments when simplifying logical and conditional expressions (#2955) + +- Add strictDeprecations option to throw when currently or upcoming deprecated features are used (#2945) +- Keep annotations and comments when simplifying logical and conditional expressions (#2955) ### Bug Fixes -* Generate proper namespace objects when dynamically importing external dependencies for AMD or CJS formats (#2954) -* Fix dynamically imported variables not being resolved correctly when importing from an entry chunk with only a default export (#2954) -* Do not reexport default when reexporting a namespace (#2954) + +- Generate proper namespace objects when dynamically importing external dependencies for AMD or CJS formats (#2954) +- Fix dynamically imported variables not being resolved correctly when importing from an entry chunk with only a default export (#2954) +- Do not reexport default when reexporting a namespace (#2954) ### Pull Requests -* [#2945](https://github.com/rollup/rollup/pull/2945): Add option to handle use of features marked for deprecation as errors (@lukastaegert) -* [#2954](https://github.com/rollup/rollup/pull/2954): Improve dynamic import interop (@lukastaegert) -* [#2955](https://github.com/rollup/rollup/pull/2955): Keep annotations and comments when simplifying logical and conditional expressions (@lukastaegert) + +- [#2945](https://github.com/rollup/rollup/pull/2945): Add option to handle use of features marked for deprecation as errors (@lukastaegert) +- [#2954](https://github.com/rollup/rollup/pull/2954): Improve dynamic import interop (@lukastaegert) +- [#2955](https://github.com/rollup/rollup/pull/2955): Keep annotations and comments when simplifying logical and conditional expressions (@lukastaegert) ## 1.15.6 -*2019-06-16* + +_2019-06-16_ ### Bug Fixes -* No longer use an alternate screen in watch mode to allow scrolling (#2942) -* Prioritize non-external imports over external ones when resolving conflicting namespace re-exports (#2893) + +- No longer use an alternate screen in watch mode to allow scrolling (#2942) +- Prioritize non-external imports over external ones when resolving conflicting namespace re-exports (#2893) ### Pull Requests -* [#2893](https://github.com/rollup/rollup/pull/2893): Improve handling of conflicting namespace exports (@aleclarson) -* [#2942](https://github.com/rollup/rollup/pull/2942): Get rid of alternate screen and simplify screen clearing (@lukastaegert) + +- [#2893](https://github.com/rollup/rollup/pull/2893): Improve handling of conflicting namespace exports (@aleclarson) +- [#2942](https://github.com/rollup/rollup/pull/2942): Get rid of alternate screen and simplify screen clearing (@lukastaegert) ## 1.15.5 -*2019-06-14* + +_2019-06-14_ ### Bug Fixes -* Do not include any comments for completely tree-shaken files so that `renderedLength === 0` is a reliable check (#2940) -* Do not cause type errors when returning `null` from `resolveId` (#2941) + +- Do not include any comments for completely tree-shaken files so that `renderedLength === 0` is a reliable check (#2940) +- Do not cause type errors when returning `null` from `resolveId` (#2941) ### Pull Requests -* [#2940](https://github.com/rollup/rollup/pull/2940): Completely omit files that do not have any included statements (@lukastaegert) -* [#2941](https://github.com/rollup/rollup/pull/2941): Explicitly allow null as return value for various hooks (@lukastaegert) + +- [#2940](https://github.com/rollup/rollup/pull/2940): Completely omit files that do not have any included statements (@lukastaegert) +- [#2941](https://github.com/rollup/rollup/pull/2941): Explicitly allow null as return value for various hooks (@lukastaegert) ## 1.15.4 -*2019-06-14* + +_2019-06-14_ ### Bug Fixes -* Improve how asset and chunk URLs are resolved for UMD, IIFE and CJS output (#2937) + +- Improve how asset and chunk URLs are resolved for UMD, IIFE and CJS output (#2937) ### Pull Requests -* [#2937](https://github.com/rollup/rollup/pull/2937): Fix URL resolution to work when the current script contains query parameters (@lukastaegert) + +- [#2937](https://github.com/rollup/rollup/pull/2937): Fix URL resolution to work when the current script contains query parameters (@lukastaegert) ## 1.15.3 -*2019-06-13* + +_2019-06-13_ ### Bug Fixes -* Always reemit assets and chunks from cached transform hooks (#2936) + +- Always reemit assets and chunks from cached transform hooks (#2936) ### Pull Requests -* [#2936](https://github.com/rollup/rollup/pull/2936): Fix repeated re-emission of files emitted from a transform hook (@lukastaegert) + +- [#2936](https://github.com/rollup/rollup/pull/2936): Fix repeated re-emission of files emitted from a transform hook (@lukastaegert) ## 1.15.2 -*2019-06-13* + +_2019-06-13_ ### Bug Fixes -* Make sure chunks emitted from transform hooks are also emitted for incremental builds in watch mode (#2933) + +- Make sure chunks emitted from transform hooks are also emitted for incremental builds in watch mode (#2933) ### Pull Requests -* [#2933](https://github.com/rollup/rollup/pull/2933): Reemit chunks emitted from transform hooks (@lukastaegert) + +- [#2933](https://github.com/rollup/rollup/pull/2933): Reemit chunks emitted from transform hooks (@lukastaegert) ## 1.15.1 -*2019-06-11* + +_2019-06-11_ ### Bug Fixes -* Do not fail when reexporting variables in dynamic entry points from other chunks (#2928) + +- Do not fail when reexporting variables in dynamic entry points from other chunks (#2928) ### Pull Requests -* [#2928](https://github.com/rollup/rollup/pull/2928): Handle reexports from dynamic entries across chunk (@lukastaegert) + +- [#2928](https://github.com/rollup/rollup/pull/2928): Handle reexports from dynamic entries across chunk (@lukastaegert) ## 1.15.0 -*2019-06-11* + +_2019-06-11_ ### Features -* Tone down try-catch deoptimization while maintaining polyfill support (#2918) + +- Tone down try-catch deoptimization while maintaining polyfill support (#2918) ### Bug Fixes -* Handle feature detection with "typeof" for regular expressios (#2916) -* Deoptimize `'' + variable'` type coercion as expression statement for feature detection (#2917) -* Always observe argument side-effects when tree-shaking (#2924) + +- Handle feature detection with "typeof" for regular expressios (#2916) +- Deoptimize `'' + variable'` type coercion as expression statement for feature detection (#2917) +- Always observe argument side-effects when tree-shaking (#2924) ### Pull Requests -* [#2916](https://github.com/rollup/rollup/pull/2916): Deoptimize typeof for regular expression literals to better support es6-shim (@lukastaegert) -* [#2917](https://github.com/rollup/rollup/pull/2917): Support implicit type coercion errors in es5-shim (@lukastaegert) -* [#2918](https://github.com/rollup/rollup/pull/2918): Deoptimize try-catch less radically (@lukastaegert) -* [#2924](https://github.com/rollup/rollup/pull/2924): Do not tree-shake arguments with side-effects (@lukastaegert) + +- [#2916](https://github.com/rollup/rollup/pull/2916): Deoptimize typeof for regular expression literals to better support es6-shim (@lukastaegert) +- [#2917](https://github.com/rollup/rollup/pull/2917): Support implicit type coercion errors in es5-shim (@lukastaegert) +- [#2918](https://github.com/rollup/rollup/pull/2918): Deoptimize try-catch less radically (@lukastaegert) +- [#2924](https://github.com/rollup/rollup/pull/2924): Do not tree-shake arguments with side-effects (@lukastaegert) ## 1.14.6 -*2019-06-10* + +_2019-06-10_ ### Bug Fixes -* Fix an issue where call arguments were not included in try statements (#2914) + +- Fix an issue where call arguments were not included in try statements (#2914) ### Pull Requests -* [#2914](https://github.com/rollup/rollup/pull/2914): Properly include try statements for each pass when deoptimization is deactivated (@lukastaegert) + +- [#2914](https://github.com/rollup/rollup/pull/2914): Properly include try statements for each pass when deoptimization is deactivated (@lukastaegert) ## 1.14.5 -*2019-06-09* + +_2019-06-09_ ### Bug Fixes -* Keep external ids unmodified when using the object form of resolveId (#2907) -* Cache dynamic import resolutions when using Rollup cache (#2908) -* Keep all necessary parentheses when tree-shaking call arguments (#2911) + +- Keep external ids unmodified when using the object form of resolveId (#2907) +- Cache dynamic import resolutions when using Rollup cache (#2908) +- Keep all necessary parentheses when tree-shaking call arguments (#2911) ### Pull Requests -* [#2906](https://github.com/rollup/rollup/pull/2906): Update dependencies (@lukastaegert) -* [#2907](https://github.com/rollup/rollup/pull/2907): Do not renormalize external ids when using the object form (@lukastaegert) -* [#2908](https://github.com/rollup/rollup/pull/2908): Cache dynamic ids if possible (@lukastaegert) -* [#2911](https://github.com/rollup/rollup/pull/2911): Fix treeshaken parameters around parentheses (@manucorporat) + +- [#2906](https://github.com/rollup/rollup/pull/2906): Update dependencies (@lukastaegert) +- [#2907](https://github.com/rollup/rollup/pull/2907): Do not renormalize external ids when using the object form (@lukastaegert) +- [#2908](https://github.com/rollup/rollup/pull/2908): Cache dynamic ids if possible (@lukastaegert) +- [#2911](https://github.com/rollup/rollup/pull/2911): Fix treeshaken parameters around parentheses (@manucorporat) ## 1.14.4 -*2019-06-07* + +_2019-06-07_ ### Bug Fixes -* Do not omit external re-exports for `moduleSideEffects: false` (#2905) + +- Do not omit external re-exports for `moduleSideEffects: false` (#2905) ### Pull Requests -* [#2905](https://github.com/rollup/rollup/pull/2905): Make sure external re-exports are included for moduleSideEffects: false (@lukastaegert) + +- [#2905](https://github.com/rollup/rollup/pull/2905): Make sure external re-exports are included for moduleSideEffects: false (@lukastaegert) ## 1.14.3 -*2019-06-06* + +_2019-06-06_ ### Bug Fixes -* Generate correct external imports when importing from a directory that would be above the root of the current working directory (#2902) + +- Generate correct external imports when importing from a directory that would be above the root of the current working directory (#2902) ### Pull Requests -* [#2902](https://github.com/rollup/rollup/pull/2902): Use browser relative path algorithm for chunks (@lukastaegert) + +- [#2902](https://github.com/rollup/rollup/pull/2902): Use browser relative path algorithm for chunks (@lukastaegert) ## 1.14.2 -*2019-06-05* + +_2019-06-05_ ### Bug Fixes -* Prevent unnecessary inclusion of external namespace import in certain situations (#2900) + +- Prevent unnecessary inclusion of external namespace import in certain situations (#2900) ### Pull Requests -* [#2900](https://github.com/rollup/rollup/pull/2900): Handle early bind for member expressions (@lukastaegert) + +- [#2900](https://github.com/rollup/rollup/pull/2900): Handle early bind for member expressions (@lukastaegert) ## 1.14.1 -*2019-06-05* + +_2019-06-05_ ### Bug Fixes -* Fix an issue where try-statements were not included properly when a variable declared inside the statement was accessed outside it (#2898) -* Fix an issue where `await` expressions were not included properly (#2899) + +- Fix an issue where try-statements were not included properly when a variable declared inside the statement was accessed outside it (#2898) +- Fix an issue where `await` expressions were not included properly (#2899) ### Pull Requests -* [#2898](https://github.com/rollup/rollup/pull/2898): Properly include try-catch-statements even if they have already been included in some way (@lukastaegert) -* [#2899](https://github.com/rollup/rollup/pull/2899): Fix unintended early return in await inclusion handling (@lukastaegert) + +- [#2898](https://github.com/rollup/rollup/pull/2898): Properly include try-catch-statements even if they have already been included in some way (@lukastaegert) +- [#2899](https://github.com/rollup/rollup/pull/2899): Fix unintended early return in await inclusion handling (@lukastaegert) ## 1.14.0 -*2019-06-05* + +_2019-06-05_ ### Features -* Deoptimize code inside and called from try-statements for feature detection (#2892) -* Tree-shake unused call arguments (#2892) + +- Deoptimize code inside and called from try-statements for feature detection (#2892) +- Tree-shake unused call arguments (#2892) ### Pull Requests -* [#2892](https://github.com/rollup/rollup/pull/2892): Implement try-statement-deoptimization for feature detection, tree-shake unused arguments (@lukastaegert) +- [#2892](https://github.com/rollup/rollup/pull/2892): Implement try-statement-deoptimization for feature detection, tree-shake unused arguments (@lukastaegert) ## 1.13.1 -*2019-06-01* + +_2019-06-01_ ### Bug Fixes -* Avoid conflicts between top-level module, require etc. and CommonJS runtimes (#2889) + +- Avoid conflicts between top-level module, require etc. and CommonJS runtimes (#2889) ### Pull Requests -* [#2888](https://github.com/rollup/rollup/pull/2888): Enable full TypeScript strict mode (@lukastaegert) -* [#2889](https://github.com/rollup/rollup/pull/2889): Protect all module globals for CJS output from being redefined (@lukastaegert) + +- [#2888](https://github.com/rollup/rollup/pull/2888): Enable full TypeScript strict mode (@lukastaegert) +- [#2889](https://github.com/rollup/rollup/pull/2889): Protect all module globals for CJS output from being redefined (@lukastaegert) ## 1.13.0 -*2019-05-31* + +_2019-05-31_ ### Features -* Omit `exports` and `module` from SystemJS wrapper if possible (#2880) -* Try to use the first letters of names when mangling exports (#2885) + +- Omit `exports` and `module` from SystemJS wrapper if possible (#2880) +- Try to use the first letters of names when mangling exports (#2885) ### Bug Fixes -* Avoid conflicts with local variables when using format specific globals to render dynamic imports and file URLs (#2880) -* Do not produce undefined reexports when reexporting from entry points (#2885) + +- Avoid conflicts with local variables when using format specific globals to render dynamic imports and file URLs (#2880) +- Do not produce undefined reexports when reexporting from entry points (#2885) ### Pull Requests -* [#2880](https://github.com/rollup/rollup/pull/2880): Deconflict global variables used inside format-specific code (@lukastaegert) -* [#2885](https://github.com/rollup/rollup/pull/2885): Do not produce undefined reexports when reexporting from entry points and refactor chunk linking (@lukastaegert) + +- [#2880](https://github.com/rollup/rollup/pull/2880): Deconflict global variables used inside format-specific code (@lukastaegert) +- [#2885](https://github.com/rollup/rollup/pull/2885): Do not produce undefined reexports when reexporting from entry points and refactor chunk linking (@lukastaegert) ## 1.12.5 -*2019-05-30* + +_2019-05-30_ ### Pull Requests -* [#2884](https://github.com/rollup/rollup/pull/2884): Update pluginutils for new micormatch and reduced bundle size (@lukastaegert) + +- [#2884](https://github.com/rollup/rollup/pull/2884): Update pluginutils for new micormatch and reduced bundle size (@lukastaegert) ## 1.12.4 -*2019-05-27* + +_2019-05-27_ ### Bug Fixes -* Show correct error stack trace for errors throw in "load" hooks (#2871) + +- Show correct error stack trace for errors throw in "load" hooks (#2871) ### Pull Requests -* [#2875](https://github.com/rollup/rollup/pull/2875): Mention subfolders in docs (@lukastaegert) -* [#2871](https://github.com/rollup/rollup/pull/2871): Reserve error stack information (@LongTengDao) + +- [#2875](https://github.com/rollup/rollup/pull/2875): Mention subfolders in docs (@lukastaegert) +- [#2871](https://github.com/rollup/rollup/pull/2871): Reserve error stack information (@LongTengDao) ## 1.12.3 -*2019-05-19* + +_2019-05-19_ ### Bug Fixes -* Prevent duplicate imports when exports are reexported as default exports (#2866) + +- Prevent duplicate imports when exports are reexported as default exports (#2866) ### Pull Requests -* [#2755](https://github.com/rollup/rollup/pull/2755): Enable TypeScript strictNullChecks (@edsrzf) -* [#2866](https://github.com/rollup/rollup/pull/2866): Properly deduplicate reexported default exports (@lukastaegert) + +- [#2755](https://github.com/rollup/rollup/pull/2755): Enable TypeScript strictNullChecks (@edsrzf) +- [#2866](https://github.com/rollup/rollup/pull/2866): Properly deduplicate reexported default exports (@lukastaegert) ## 1.12.2 -*2019-05-17* + +_2019-05-17_ ### Bug Fixes -* Do not fail when using clearScreen:false in watchMode (#2858) -* Properly resolve star reexports when preserving modules (#2860) + +- Do not fail when using clearScreen:false in watchMode (#2858) +- Properly resolve star reexports when preserving modules (#2860) ### Pull Requests -* [#2858](https://github.com/rollup/rollup/pull/2858): Declare processConfigsErr before use (@humphd) -* [#2860](https://github.com/rollup/rollup/pull/2860): Keep nested exports with preserveModules (@TomCaserta) -* [#2864](https://github.com/rollup/rollup/pull/2864): Cache transitive reexport detection (@lukastaegert) + +- [#2858](https://github.com/rollup/rollup/pull/2858): Declare processConfigsErr before use (@humphd) +- [#2860](https://github.com/rollup/rollup/pull/2860): Keep nested exports with preserveModules (@TomCaserta) +- [#2864](https://github.com/rollup/rollup/pull/2864): Cache transitive reexport detection (@lukastaegert) ## 1.12.1 -*2019-05-16* + +_2019-05-16_ ### Bug Fixes -* Extend file name sanitation to also replace "?" and "*" e.g. when preserving modules with the updated commonjs plugin (#2860) -* Do not ignore module transformer that return an empty string (#2861) + +- Extend file name sanitation to also replace "?" and "\*" e.g. when preserving modules with the updated commonjs plugin (#2860) +- Do not ignore module transformer that return an empty string (#2861) ### Pull Requests -* [#2860](https://github.com/rollup/rollup/pull/2860): Update to latest plugins and extend file name sanitation (@lukastaegert) -* [#2861](https://github.com/rollup/rollup/pull/2861): Allow transformers to return an empty string (@lukastaegert) + +- [#2860](https://github.com/rollup/rollup/pull/2860): Update to latest plugins and extend file name sanitation (@lukastaegert) +- [#2861](https://github.com/rollup/rollup/pull/2861): Allow transformers to return an empty string (@lukastaegert) ## 1.12.0 -*2019-05-15* + +_2019-05-15_ ### Features -* Add `treeshake.moduleSideEffects` option to allow removing empty imports without a side-effect check (#2844) -* Extend plugin API to allow marking modules as side-effect-free (#2844) -* Extend `this.resolve` plugin context function with an option to skip the `resolveId` hook of the calling plugin (#2844) -* Add `isEntry` flag to `this.getModuleInfo` plugin context function (#2844) -* Distribute Rollup as optimized ES2015 code (#2851) + +- Add `treeshake.moduleSideEffects` option to allow removing empty imports without a side-effect check (#2844) +- Extend plugin API to allow marking modules as side-effect-free (#2844) +- Extend `this.resolve` plugin context function with an option to skip the `resolveId` hook of the calling plugin (#2844) +- Add `isEntry` flag to `this.getModuleInfo` plugin context function (#2844) +- Distribute Rollup as optimized ES2015 code (#2851) ### Pull Requests -* [#2844](https://github.com/rollup/rollup/pull/2844): Add options and hooks to control module side effects (@lukastaegert) -* [#2851](https://github.com/rollup/rollup/pull/2851): Switch to ES2015 output (@lukastaegert) + +- [#2844](https://github.com/rollup/rollup/pull/2844): Add options and hooks to control module side effects (@lukastaegert) +- [#2851](https://github.com/rollup/rollup/pull/2851): Switch to ES2015 output (@lukastaegert) ## 1.11.3 -*2019-05-05* + +_2019-05-05_ ### Bug Fixes -* Quote es3 keywords in namespace objects (#2825) + +- Quote es3 keywords in namespace objects (#2825) ### Pull Requests -* [#2825](https://github.com/rollup/rollup/pull/2825): Add es3 support for namespace object import (@sormy) + +- [#2825](https://github.com/rollup/rollup/pull/2825): Add es3 support for namespace object import (@sormy) ## 1.11.2 -*2019-05-04* + +_2019-05-04_ ### Bug Fixes -* Prevent a crash when handling circular namespace exports (#2836) + +- Prevent a crash when handling circular namespace exports (#2836) ### Pull Requests -* [#2836](https://github.com/rollup/rollup/pull/2836): Make sure circular `export * from X` does not stack overflow (@Swatinem) + +- [#2836](https://github.com/rollup/rollup/pull/2836): Make sure circular `export * from X` does not stack overflow (@Swatinem) ## 1.11.1 -*2019-05-04* + +_2019-05-04_ ### Bug Fixes -* Fix an issue where rendered exports were reported as "removed" in the bundle information (#2835) + +- Fix an issue where rendered exports were reported as "removed" in the bundle information (#2835) ### Pull Requests -* [#2835](https://github.com/rollup/rollup/pull/2835): Fix `removedExports` to correctly track the exported item (@Swatinem) + +- [#2835](https://github.com/rollup/rollup/pull/2835): Fix `removedExports` to correctly track the exported item (@Swatinem) ## 1.11.0 -*2019-05-03* + +_2019-05-03_ ### Features -* Add `emitChunk` plugin context function to emit additional entry chunks that can be referenced from the code (#2809) -* Allow `manualChunks` to be a function (#2831) -* Omit `.js` extensions in AMD imports to make sure an AMD `baseUrl` would work (#2809) -* Automatically use the name of the imported module as a base for dynamically imported chunks (#2809) -* Add `resolveFileUrl` plugin hook to replace `resolveAssetUrl` and handle emitted chunks as well (#2809) -* Add `resolve` plugin hook to replace `resolveId` and `isExternal` that returns an object (#2829) -* Allow `resolveDynamicImport` to return an `{id, external}` object to also resolve unresolvable dynamic imports to a module (#2829) + +- Add `emitChunk` plugin context function to emit additional entry chunks that can be referenced from the code (#2809) +- Allow `manualChunks` to be a function (#2831) +- Omit `.js` extensions in AMD imports to make sure an AMD `baseUrl` would work (#2809) +- Automatically use the name of the imported module as a base for dynamically imported chunks (#2809) +- Add `resolveFileUrl` plugin hook to replace `resolveAssetUrl` and handle emitted chunks as well (#2809) +- Add `resolve` plugin hook to replace `resolveId` and `isExternal` that returns an object (#2829) +- Allow `resolveDynamicImport` to return an `{id, external}` object to also resolve unresolvable dynamic imports to a module (#2829) ### Bug Fixes -* Do not create invalid code if a dynamic import contains nothing but reexports (#2809) -* Do not fail if modules that define a manual chunk depend on each other (#2809) -* Do not fail if a module that defines a manual chunk is the dependency of a module defining a different manual chunk (#2809) -* No longer fail for unnamed duplicate entry points but combine them (#2809) -* Always return `string | null` from `this.resolveId` even if some `resolveId` hooks return objects (#2829) -* Show proper warnings when `resolveDynamicImport` resolves to a non-external module that does not exist (#2829) + +- Do not create invalid code if a dynamic import contains nothing but reexports (#2809) +- Do not fail if modules that define a manual chunk depend on each other (#2809) +- Do not fail if a module that defines a manual chunk is the dependency of a module defining a different manual chunk (#2809) +- No longer fail for unnamed duplicate entry points but combine them (#2809) +- Always return `string | null` from `this.resolveId` even if some `resolveId` hooks return objects (#2829) +- Show proper warnings when `resolveDynamicImport` resolves to a non-external module that does not exist (#2829) ### Pull Requests -* [#2809](https://github.com/rollup/rollup/pull/2809): Add hook for dynamic entry chunk emission (@lukastaegert) -* [#2821](https://github.com/rollup/rollup/pull/2821): Fix syntax error in documentation (@FFxSquall) -* [#2829](https://github.com/rollup/rollup/pull/2829): Improve id resolution (@lukastaegert) -* [#2831](https://github.com/rollup/rollup/pull/2831): Allow manualChunks to be a function (@lukastaegert) -* [#2832](https://github.com/rollup/rollup/pull/2832): Improve `generateBundle` documentation (@lukastaegert) -* [#2833](https://github.com/rollup/rollup/pull/2833): Update dependencies (@lukastaegert) + +- [#2809](https://github.com/rollup/rollup/pull/2809): Add hook for dynamic entry chunk emission (@lukastaegert) +- [#2821](https://github.com/rollup/rollup/pull/2821): Fix syntax error in documentation (@FFxSquall) +- [#2829](https://github.com/rollup/rollup/pull/2829): Improve id resolution (@lukastaegert) +- [#2831](https://github.com/rollup/rollup/pull/2831): Allow manualChunks to be a function (@lukastaegert) +- [#2832](https://github.com/rollup/rollup/pull/2832): Improve `generateBundle` documentation (@lukastaegert) +- [#2833](https://github.com/rollup/rollup/pull/2833): Update dependencies (@lukastaegert) ## 1.10.1 -*2019-04-19* + +_2019-04-19_ ### Bug Fixes -* Invalid options.format values will now trigger a helpful error (#2813) + +- Invalid options.format values will now trigger a helpful error (#2813) ### Pull Requests -* [#2812](https://github.com/rollup/rollup/pull/2812): Minor documentation update (@dnalborczyk) -* [#2813](https://github.com/rollup/rollup/pull/2813): Catch invalid options.format values (@marijnh) -* [#2816](https://github.com/rollup/rollup/pull/2816): Update all dependencies to fix security issues (@lukastaegert) + +- [#2812](https://github.com/rollup/rollup/pull/2812): Minor documentation update (@dnalborczyk) +- [#2813](https://github.com/rollup/rollup/pull/2813): Catch invalid options.format values (@marijnh) +- [#2816](https://github.com/rollup/rollup/pull/2816): Update all dependencies to fix security issues (@lukastaegert) ## 1.10.0 -*2019-04-11* + +_2019-04-11_ ### Features -* Improve generated code to polyfill `import.meta.url` (#2785) -* Add plugin hook to configure handling of `import.meta` (#2785) -* Improve generated code when accessing URLs of emitted assets (#2796) -* Add plugin hook to configure the generated code when accessing URLs of emitted assets (#2796) + +- Improve generated code to polyfill `import.meta.url` (#2785) +- Add plugin hook to configure handling of `import.meta` (#2785) +- Improve generated code when accessing URLs of emitted assets (#2796) +- Add plugin hook to configure the generated code when accessing URLs of emitted assets (#2796) ### Bug Fixes -* No longer resolve assets to their parent URL in some cases (#2796) + +- No longer resolve assets to their parent URL in some cases (#2796) ### Pull Requests -* [#2785](https://github.com/rollup/rollup/pull/2785): Refactor handling of import.meta.url and add option to configure behaviour (@lukastaegert) -* [#2796](https://github.com/rollup/rollup/pull/2796): Improve and fix asset emission (@lukastaegert) + +- [#2785](https://github.com/rollup/rollup/pull/2785): Refactor handling of import.meta.url and add option to configure behaviour (@lukastaegert) +- [#2796](https://github.com/rollup/rollup/pull/2796): Improve and fix asset emission (@lukastaegert) ## 1.9.3 -*2019-04-10* + +_2019-04-10_ ### Bug Fixes -* Simplify return expressions that are evaluated before the surrounding function is bound (#2803) + +- Simplify return expressions that are evaluated before the surrounding function is bound (#2803) ### Pull Requests -* [#2803](https://github.com/rollup/rollup/pull/2803): Handle out-of-order binding of identifiers to improve tree-shaking (@lukastaegert) + +- [#2803](https://github.com/rollup/rollup/pull/2803): Handle out-of-order binding of identifiers to improve tree-shaking (@lukastaegert) ## 1.9.2 -*2019-04-10* + +_2019-04-10_ ### Bug Fixes -* Allowing replacing `output.file` with `output.dir` in the `outputOptions` hook (#2802) + +- Allowing replacing `output.file` with `output.dir` in the `outputOptions` hook (#2802) ### Pull Requests -* [#2802](https://github.com/rollup/rollup/pull/2802): Observe modified output options in bundle.write (@lukastaegert) + +- [#2802](https://github.com/rollup/rollup/pull/2802): Observe modified output options in bundle.write (@lukastaegert) ## 1.9.1 -*2019-04-10* + +_2019-04-10_ ### Bug Fixes -* Make sure inline comments in dynamic imports are preserved (#2797) + +- Make sure inline comments in dynamic imports are preserved (#2797) ### Pull Requests -* [#2797](https://github.com/rollup/rollup/pull/2797): Emit inline comments inside dynamic import (@manucorporat) + +- [#2797](https://github.com/rollup/rollup/pull/2797): Emit inline comments inside dynamic import (@manucorporat) ## 1.9.0 -*2019-04-05* + +_2019-04-05_ ### Features -* Add built-in support for bigint (#2789) + +- Add built-in support for bigint (#2789) ### Pull Requests -* [#2789](https://github.com/rollup/rollup/pull/2789): Ship with bigint support built-in (@danielgindi) -* [#2791](https://github.com/rollup/rollup/pull/2791): Use shared extractAssignedNames from rollup-pluginutils (@lukastaegert) -* [#2792](https://github.com/rollup/rollup/pull/2792): Test that rollup-plugin-commonjs works with preserveModules (@lukastaegert) + +- [#2789](https://github.com/rollup/rollup/pull/2789): Ship with bigint support built-in (@danielgindi) +- [#2791](https://github.com/rollup/rollup/pull/2791): Use shared extractAssignedNames from rollup-pluginutils (@lukastaegert) +- [#2792](https://github.com/rollup/rollup/pull/2792): Test that rollup-plugin-commonjs works with preserveModules (@lukastaegert) ## 1.8.0 -*2019-04-02* + +_2019-04-02_ ### Features -* Support `module` as alias for `esm` and `commonjs` for `cjs` to match Node (#2783) + +- Support `module` as alias for `esm` and `commonjs` for `cjs` to match Node (#2783) ### Pull Requests -* [#2782](https://github.com/rollup/rollup/pull/2782): Inline interopDefault in config loading (@guybedford) -* [#2783](https://github.com/rollup/rollup/pull/2783): Support Node-style format aliases (@guybedford) + +- [#2782](https://github.com/rollup/rollup/pull/2782): Inline interopDefault in config loading (@guybedford) +- [#2783](https://github.com/rollup/rollup/pull/2783): Support Node-style format aliases (@guybedford) ## 1.7.4 -*2019-03-28* + +_2019-03-28_ ### Bug Fixes -* Improve TypeScript type of the treeshaking options (#2779) + +- Improve TypeScript type of the treeshaking options (#2779) ### Pull Requests -* [#2779](https://github.com/rollup/rollup/pull/2779): Make all properties in TreeshakingOptions optional (@ndelangen) + +- [#2779](https://github.com/rollup/rollup/pull/2779): Make all properties in TreeshakingOptions optional (@ndelangen) ## 1.7.3 -*2019-03-24* + +_2019-03-24_ ### Bug Fixes -* Use getters when re-exporting live-bindings (#2765) + +- Use getters when re-exporting live-bindings (#2765) ### Pull Requests -* [#2765](https://github.com/rollup/rollup/pull/2765): Support exporting live-bindings from other chunks or external dependencies (@lukastaegert) + +- [#2765](https://github.com/rollup/rollup/pull/2765): Support exporting live-bindings from other chunks or external dependencies (@lukastaegert) ## 1.7.2 -*2019-03-24* + +_2019-03-24_ ### Bug Fixes -* Make sure relative external ids are resolved correctly (#2774) + +- Make sure relative external ids are resolved correctly (#2774) ### Pull Requests -* [#2774](https://github.com/rollup/rollup/pull/2774): Resolve relative external ids (@lukastaegert) + +- [#2774](https://github.com/rollup/rollup/pull/2774): Resolve relative external ids (@lukastaegert) ## 1.7.1 -*2019-03-24* + +_2019-03-24_ ### Bug Fixes -* Prevent invalid code when exporting several hundred identifiers from a chunk (#2768) -* Do not wrongly deconflict labels (#2776) + +- Prevent invalid code when exporting several hundred identifiers from a chunk (#2768) +- Do not wrongly deconflict labels (#2776) ### Pull Requests -* [#2768](https://github.com/rollup/rollup/pull/2768): Sanitize shortened internal export names (@lukastaegert) -* [#2769](https://github.com/rollup/rollup/pull/2769): Update dependencies and fix security issue (@lukastaegert) -* [#2776](https://github.com/rollup/rollup/pull/2776): Do not treat break labels as identifiers (@lukastaegert) + +- [#2768](https://github.com/rollup/rollup/pull/2768): Sanitize shortened internal export names (@lukastaegert) +- [#2769](https://github.com/rollup/rollup/pull/2769): Update dependencies and fix security issue (@lukastaegert) +- [#2776](https://github.com/rollup/rollup/pull/2776): Do not treat break labels as identifiers (@lukastaegert) ## 1.7.0 -*2019-03-20* + +_2019-03-20_ ### Features -* Sort chunk exports by name for greater consistency (#2757) + +- Sort chunk exports by name for greater consistency (#2757) ### Bug Fixes -* Fix a situation where tree-shakeable code would not be removed in an indeterminate manner (#2757) + +- Fix a situation where tree-shakeable code would not be removed in an indeterminate manner (#2757) ### Pull Requests -* [#2757](https://github.com/rollup/rollup/pull/2757): Sort modules before binding, sort exports (@lukastaegert) + +- [#2757](https://github.com/rollup/rollup/pull/2757): Sort modules before binding, sort exports (@lukastaegert) ## 1.6.1 -*2019-03-20* + +_2019-03-20_ ### Bug Fixes -* Avoid name clashes of unused default exports when tree-shaking is false (#2758) -* Do not crash when generating SystemJS bundles containing array patterns with member expressions (#2760) + +- Avoid name clashes of unused default exports when tree-shaking is false (#2758) +- Do not crash when generating SystemJS bundles containing array patterns with member expressions (#2760) ### Pull Requests -* [#2758](https://github.com/rollup/rollup/pull/2758): Make sure unused default exports are deconflicted when tree-shaking is false (@lukastaegert) -* [#2760](https://github.com/rollup/rollup/pull/2760): Handle member expressions in array patterns (@lukastaegert) + +- [#2758](https://github.com/rollup/rollup/pull/2758): Make sure unused default exports are deconflicted when tree-shaking is false (@lukastaegert) +- [#2760](https://github.com/rollup/rollup/pull/2760): Handle member expressions in array patterns (@lukastaegert) ## 1.6.0 -*2019-03-08* + +_2019-03-08_ ### Features -* Add plugin hook to modify output options (#2736) + +- Add plugin hook to modify output options (#2736) ### Pull Requests -* [#2736](https://github.com/rollup/rollup/pull/2736): Add hook for modifying OutputOptions (@Comandeer) + +- [#2736](https://github.com/rollup/rollup/pull/2736): Add hook for modifying OutputOptions (@Comandeer) ## 1.5.0 -*2019-03-07* + +_2019-03-07_ ### Features -* Allow resolving to a different id while marking it as external at the same time (#2734) + +- Allow resolving to a different id while marking it as external at the same time (#2734) ### Pull Requests -* [#2734](https://github.com/rollup/rollup/pull/2734): Allow resolveId to return an object (@lukastaegert) + +- [#2734](https://github.com/rollup/rollup/pull/2734): Allow resolveId to return an object (@lukastaegert) ## 1.4.2 -*2019-03-07* + +_2019-03-07_ ### Bug Fixes -* Respect variable identity of exports when hashing (#2741) -* Resolve a situations where a variable was imported twice with the same name (#2737) + +- Respect variable identity of exports when hashing (#2741) +- Resolve a situations where a variable was imported twice with the same name (#2737) ### Pull Requests -* [#2741](https://github.com/rollup/rollup/pull/2741): Fix hashing when different variable are exported using the same name (@lukastaegert) -* [#2737](https://github.com/rollup/rollup/pull/2737): Fix duplicate imports with conflicting names (@lukastaegert) + +- [#2741](https://github.com/rollup/rollup/pull/2741): Fix hashing when different variable are exported using the same name (@lukastaegert) +- [#2737](https://github.com/rollup/rollup/pull/2737): Fix duplicate imports with conflicting names (@lukastaegert) ## 1.4.1 -*2019-03-04* + +_2019-03-04_ ### Bug Fixes -* Do not treat the import target "" as external by default (#2733) + +- Do not treat the import target "" as external by default (#2733) ### Pull Requests -* [#2733](https://github.com/rollup/rollup/pull/2733): Do not treat the import target "" as external by default (@LongTengDao) + +- [#2733](https://github.com/rollup/rollup/pull/2733): Do not treat the import target "" as external by default (@LongTengDao) ## 1.4.0 -*2019-03-01* + +_2019-03-01_ ### Features -* Add option to change the name of the dynamic import function to allow polyfilling it (#2723) + +- Add option to change the name of the dynamic import function to allow polyfilling it (#2723) ### Pull Requests -* [#2723](https://github.com/rollup/rollup/pull/2723): Add dynamicImportFunction option (@keithamus) + +- [#2723](https://github.com/rollup/rollup/pull/2723): Add dynamicImportFunction option (@keithamus) ## 1.3.3 -*2019-03-01* + +_2019-03-01_ ### Bug Fixes -* Fix performance regression when handling long chains of calls to property methods (#2732) + +- Fix performance regression when handling long chains of calls to property methods (#2732) ### Pull Requests -* [#2730](https://github.com/rollup/rollup/pull/2730): Order types, interfaces, classes, and object members (@lukastaegert) -* [#2732](https://github.com/rollup/rollup/pull/2732): Take chunk export mode into account when reexporting default (@lukastaegert) + +- [#2730](https://github.com/rollup/rollup/pull/2730): Order types, interfaces, classes, and object members (@lukastaegert) +- [#2732](https://github.com/rollup/rollup/pull/2732): Take chunk export mode into account when reexporting default (@lukastaegert) ## 1.3.2 -*2019-02-27* + +_2019-02-27_ ### Bug Fixes -* Allow ids of default exported classes to be exported separately (#2728) + +- Allow ids of default exported classes to be exported separately (#2728) ### Pull Requests -* [#2728](https://github.com/rollup/rollup/pull/2728): Update dependencies (@lukastaegert) + +- [#2728](https://github.com/rollup/rollup/pull/2728): Update dependencies (@lukastaegert) ## 1.3.1 -*2019-02-27* + +_2019-02-27_ ### Bug Fixes -* Correctly reexport the default export from entry chunks (#2727) + +- Correctly reexport the default export from entry chunks (#2727) ### Pull Requests -* [#2727](https://github.com/rollup/rollup/pull/2727): Take chunk export mode into account when reexporting default (@lukastaegert) + +- [#2727](https://github.com/rollup/rollup/pull/2727): Take chunk export mode into account when reexporting default (@lukastaegert) ## 1.3.0 -*2019-02-26* + +_2019-02-26_ ### Features -* Treeshake call expressions prefixed with UglifyJS style `@__PURE__` annotations (#2429) + +- Treeshake call expressions prefixed with UglifyJS style `@__PURE__` annotations (#2429) ### Pull Requests -* [#2429](https://github.com/rollup/rollup/pull/2429): Add support for /*#__PURE__*/ comments (@conartist6 and @lukastaegert) + +- [#2429](https://github.com/rollup/rollup/pull/2429): Add support for /_#**PURE**_/ comments (@conartist6 and @lukastaegert) ## 1.2.5 -*2019-02-26* + +_2019-02-26_ ### Bug Fixes -* Store external ids reported by plugins in watch mode (#2718) + +- Store external ids reported by plugins in watch mode (#2718) ### Pull Requests -* [#2718](https://github.com/rollup/rollup/pull/2718): Incremental external (@andreas-karlsson) + +- [#2718](https://github.com/rollup/rollup/pull/2718): Incremental external (@andreas-karlsson) ## 1.2.4 -*2019-02-26* + +_2019-02-26_ ### Bug Fixes -* Fix an issue where a variable was imported twice under the same name (#2715) + +- Fix an issue where a variable was imported twice under the same name (#2715) ### Pull Requests -* [#2715](https://github.com/rollup/rollup/pull/2715): Deduplicate imports referencing default exports and their original variables (@lukastaegert) + +- [#2715](https://github.com/rollup/rollup/pull/2715): Deduplicate imports referencing default exports and their original variables (@lukastaegert) ## 1.2.3 -*2019-02-23* + +_2019-02-23_ ### Bug Fixes -* Use correct path when rendering dynamic imports where the entry module is empty (#2714) + +- Use correct path when rendering dynamic imports where the entry module is empty (#2714) ### Pull Requests -* [#2714](https://github.com/rollup/rollup/pull/2714): Properly render dynamic imports when imported module is empty (@lukastaegert) + +- [#2714](https://github.com/rollup/rollup/pull/2714): Properly render dynamic imports when imported module is empty (@lukastaegert) ## 1.2.2 -*2019-02-19* + +_2019-02-19_ ### Bug Fixes -* Fix wrong external imports when using the `paths` options only for some outputs (#2706) + +- Fix wrong external imports when using the `paths` options only for some outputs (#2706) ### Pull Requests -* [#2706](https://github.com/rollup/rollup/pull/2706): Always recreate paths for external modules (@lukastaegert) + +- [#2706](https://github.com/rollup/rollup/pull/2706): Always recreate paths for external modules (@lukastaegert) ## 1.2.1 -*2019-02-17* + +_2019-02-17_ ### Bug Fixes -* Fix ESM version of Rollup (#2705) + +- Fix ESM version of Rollup (#2705) ### Pull Requests -* [#2705](https://github.com/rollup/rollup/pull/2705): Fix ESM version of Rollup (@lukastaegert) + +- [#2705](https://github.com/rollup/rollup/pull/2705): Fix ESM version of Rollup (@lukastaegert) ## 1.2.0 -*2019-02-17* + +_2019-02-17_ ### Features -* Fewer renamed variables due to a completely reimplemented deconflicting logic (#2689) + +- Fewer renamed variables due to a completely reimplemented deconflicting logic (#2689) ### Bug Fixes -* Respect rendered and tree-shaken exports when determining chunk hashes (#2695) -* Fix an error when dynamic imports end up in the same chunk as one of their importees (#2677) -* Do not generate invalid code when expressions containing IIFEs are simplified (#2696) -* Do not throw an error when more than ten bundles are watched (#2700) -* Treat re-exported globals in a spec-compliant way (#2691) -* Fix issues related to wrongly renamed variables (#2689) -* Do not throw an error if config files contain non-default exports (#2673) -* Improve type of `RollupOutput.output` to guarantee at least one chunk (#2679) + +- Respect rendered and tree-shaken exports when determining chunk hashes (#2695) +- Fix an error when dynamic imports end up in the same chunk as one of their importees (#2677) +- Do not generate invalid code when expressions containing IIFEs are simplified (#2696) +- Do not throw an error when more than ten bundles are watched (#2700) +- Treat re-exported globals in a spec-compliant way (#2691) +- Fix issues related to wrongly renamed variables (#2689) +- Do not throw an error if config files contain non-default exports (#2673) +- Improve type of `RollupOutput.output` to guarantee at least one chunk (#2679) ### Pull Requests -* [#2673](https://github.com/rollup/rollup/pull/2673): Allow config files to have non-default exports (@swansontec) -* [#2677](https://github.com/rollup/rollup/pull/2677): Prevent final resolution and facade creation for inlined dynamic imports (@Rich-Harris and @lukastaegert) -* [#2679](https://github.com/rollup/rollup/pull/2679): Improve type of `RollupOutput.output` (@MattiasBuelens) -* [#2689](https://github.com/rollup/rollup/pull/2689): Reimplement variable deconflicting logic (@lukastaegert) -* [#2691](https://github.com/rollup/rollup/pull/2691): Fix CI issues and update acorn dependency (@lukastaegert) -* [#2693](https://github.com/rollup/rollup/pull/2693): Fix typo in export-globals test (@MattiasBuelens) -* [#2695](https://github.com/rollup/rollup/pull/2695): Respect rendered exports when generating chunk hashes (@lukastaegert) -* [#2696](https://github.com/rollup/rollup/pull/2696): Correctly render function expression inside simplified expression statements (@lukastaegert) -* [#2700](https://github.com/rollup/rollup/pull/2700): Add a fix for MaxListenersExceededWarning (@luwes) -* [#2703](https://github.com/rollup/rollup/pull/2703): Update rollup-pluginutils (@lukastaegert) + +- [#2673](https://github.com/rollup/rollup/pull/2673): Allow config files to have non-default exports (@swansontec) +- [#2677](https://github.com/rollup/rollup/pull/2677): Prevent final resolution and facade creation for inlined dynamic imports (@Rich-Harris and @lukastaegert) +- [#2679](https://github.com/rollup/rollup/pull/2679): Improve type of `RollupOutput.output` (@MattiasBuelens) +- [#2689](https://github.com/rollup/rollup/pull/2689): Reimplement variable deconflicting logic (@lukastaegert) +- [#2691](https://github.com/rollup/rollup/pull/2691): Fix CI issues and update acorn dependency (@lukastaegert) +- [#2693](https://github.com/rollup/rollup/pull/2693): Fix typo in export-globals test (@MattiasBuelens) +- [#2695](https://github.com/rollup/rollup/pull/2695): Respect rendered exports when generating chunk hashes (@lukastaegert) +- [#2696](https://github.com/rollup/rollup/pull/2696): Correctly render function expression inside simplified expression statements (@lukastaegert) +- [#2700](https://github.com/rollup/rollup/pull/2700): Add a fix for MaxListenersExceededWarning (@luwes) +- [#2703](https://github.com/rollup/rollup/pull/2703): Update rollup-pluginutils (@lukastaegert) ## 1.1.2 -*2019-01-21* + +_2019-01-21_ ### Bug Fixes -* Tree-shaken dynamic imports no longer leave behind `undefined` entries in the bundle information (#2663) -* Dynamic imports in dynamically imported files could lead to crashes and would not always create new chunks (#2664) + +- Tree-shaken dynamic imports no longer leave behind `undefined` entries in the bundle information (#2663) +- Dynamic imports in dynamically imported files could lead to crashes and would not always create new chunks (#2664) ### Pull Requests -* [#2663](https://github.com/rollup/rollup/pull/2663): Do not include tree-shaken dynamic imports in bundle information (@lukastaegert) -* [#2664](https://github.com/rollup/rollup/pull/2664): Properly handle dynamic imports declared in dynamically imported files (@everdimension) + +- [#2663](https://github.com/rollup/rollup/pull/2663): Do not include tree-shaken dynamic imports in bundle information (@lukastaegert) +- [#2664](https://github.com/rollup/rollup/pull/2664): Properly handle dynamic imports declared in dynamically imported files (@everdimension) ## 1.1.1 -*2019-01-19* + +_2019-01-19_ ### Bug Fixes -* Make sure object prototype methods are not considered to be falsy when tree-shaking (#2652) + +- Make sure object prototype methods are not considered to be falsy when tree-shaking (#2652) ### Pull Requests -* [#2652](https://github.com/rollup/rollup/pull/2652): Make sure object prototype methods are not considered to be falsy (@lukastaegert) -* [#2654](https://github.com/rollup/rollup/pull/2654): Use correct signature for `this.setAssetSource` in docs (@everdimension) -* [#2656](https://github.com/rollup/rollup/pull/2656): Swap descriptions for `[extname]` and `[ext]` in docs (@tivac) + +- [#2652](https://github.com/rollup/rollup/pull/2652): Make sure object prototype methods are not considered to be falsy (@lukastaegert) +- [#2654](https://github.com/rollup/rollup/pull/2654): Use correct signature for `this.setAssetSource` in docs (@everdimension) +- [#2656](https://github.com/rollup/rollup/pull/2656): Swap descriptions for `[extname]` and `[ext]` in docs (@tivac) ## 1.1.0 -*2019-01-09* + +_2019-01-09_ ### Features -* Make `this.meta` available from the `options` plugin hook (#2642) -* Add a new `writeBundle` plugin hook that is called *after* all files have been written (#2643) + +- Make `this.meta` available from the `options` plugin hook (#2642) +- Add a new `writeBundle` plugin hook that is called _after_ all files have been written (#2643) ### Bug Fixes -* Make sure the `acorn` import of the bundled non-ESM acorn plugins is correctly translated to ESM (#2636) -* Make sure input options are actually passed to the `buildStart` hook (#2642) + +- Make sure the `acorn` import of the bundled non-ESM acorn plugins is correctly translated to ESM (#2636) +- Make sure input options are actually passed to the `buildStart` hook (#2642) ### Pull Requests -* [#2636](https://github.com/rollup/rollup/pull/2636): Improve how acorn is imported, update dependencies (@lukastaegert) -* [#2642](https://github.com/rollup/rollup/pull/2642): Make this.meta available in options hook, pass input options to buildStart (@lukastaegert) -* [#2643](https://github.com/rollup/rollup/pull/2643): Implement writeBundle hook (@lukastaegert) + +- [#2636](https://github.com/rollup/rollup/pull/2636): Improve how acorn is imported, update dependencies (@lukastaegert) +- [#2642](https://github.com/rollup/rollup/pull/2642): Make this.meta available in options hook, pass input options to buildStart (@lukastaegert) +- [#2643](https://github.com/rollup/rollup/pull/2643): Implement writeBundle hook (@lukastaegert) ## 1.0.2 -*2019-01-05* + +_2019-01-05_ ### Bug Fixes -* Make sure the transform hook is always reevaluated when a file watched by the hook changes (#2633) -* Fix a crash when generating hashes for tree-shaken dynamic imports (#2638) -* Fix a crash and some inconsistencies when using the acorn-bigint plugin (#2640) + +- Make sure the transform hook is always reevaluated when a file watched by the hook changes (#2633) +- Fix a crash when generating hashes for tree-shaken dynamic imports (#2638) +- Fix a crash and some inconsistencies when using the acorn-bigint plugin (#2640) ### Pull Requests -* [#2633](https://github.com/rollup/rollup/pull/2633): Document `this.addWatchFile` and make sure it also declares transform dependencies (@lukastaegert) -* [#2635](https://github.com/rollup/rollup/pull/2635): Make sure `code` is optional in warning type (@lukastaegert) -* [#2638](https://github.com/rollup/rollup/pull/2638): Do not fail when generating hashes for tree-shaken dynamic imports (@lukastaegert) -* [#2640](https://github.com/rollup/rollup/pull/2640): Always treat bigints as unknown (@lukastaegert) -* [#2641](https://github.com/rollup/rollup/pull/2641): Make sure all CLI options are listed in the summary (@lukastaegert) + +- [#2633](https://github.com/rollup/rollup/pull/2633): Document `this.addWatchFile` and make sure it also declares transform dependencies (@lukastaegert) +- [#2635](https://github.com/rollup/rollup/pull/2635): Make sure `code` is optional in warning type (@lukastaegert) +- [#2638](https://github.com/rollup/rollup/pull/2638): Do not fail when generating hashes for tree-shaken dynamic imports (@lukastaegert) +- [#2640](https://github.com/rollup/rollup/pull/2640): Always treat bigints as unknown (@lukastaegert) +- [#2641](https://github.com/rollup/rollup/pull/2641): Make sure all CLI options are listed in the summary (@lukastaegert) ## 1.0.1 -*2019-01-03* + +_2019-01-03_ ### Bug Fixes -* Properly handle reexporting an external default export for non-ESM targets when using named exports mode (#2620) -* Do not (wrongly) re-declare input options in the merged `RollupOptions` type (#2622) + +- Properly handle reexporting an external default export for non-ESM targets when using named exports mode (#2620) +- Do not (wrongly) re-declare input options in the merged `RollupOptions` type (#2622) ### Pull Requests -* [#2620](https://github.com/rollup/rollup/pull/2620): Fixed issue with reexporting default as default with `{exports: named, interop: true}` options (@Andarist) -* [#2622](https://github.com/rollup/rollup/pull/2622): Simplify RollupOptions (@Kinrany) -* [#2627](https://github.com/rollup/rollup/pull/2627): Show how to skip imports for optional plugins (@chris-morgan) + +- [#2620](https://github.com/rollup/rollup/pull/2620): Fixed issue with reexporting default as default with `{exports: named, interop: true}` options (@Andarist) +- [#2622](https://github.com/rollup/rollup/pull/2622): Simplify RollupOptions (@Kinrany) +- [#2627](https://github.com/rollup/rollup/pull/2627): Show how to skip imports for optional plugins (@chris-morgan) ## 1.0.0 -*2018-12-28* + +_2018-12-28_ ### Breaking Changes -* Several (mostly deprecated) options have been removed or renamed (#2293, #2409): + +- Several (mostly deprecated) options have been removed or renamed (#2293, #2409): - banner -> output.banner - dest -> output.file - entry -> input @@ -2006,7 +4873,7 @@ This version is identical to 2.4.0 - globals -> output.globals - indent -> output.indent - interop -> output.interop - - intro -> output.intro + - intro -> output.intro - load -> use plugin API - moduleName -> output.name - name -> output.name @@ -2025,1688 +4892,1871 @@ This version is identical to 2.4.0 - targets -> use output as an array - transform -> use plugin API - useStrict -> output.strict -* In general, output options can no longer be used as input options (#2409) -* `bundle.generate` and `bundle.write` now return a new format (#2293) -* Several plugin hooks have become deprecated and will display warnings when used (#2409): +- In general, output options can no longer be used as input options (#2409) +- `bundle.generate` and `bundle.write` now return a new format (#2293) +- Several plugin hooks have become deprecated and will display warnings when used (#2409): - transformBundle - transformChunk - ongenerate - onwrite -* Plugin transform dependencies are deprecated in favour of using the `this.addWatchFile` plugin context function (#2409) -* Accessing `this.watcher` in plugin hooks is deprecated in favour of the `watchChange` plugin hook and the `this.addWatchFile` plugin context function (#2409) -* Using dynamic import statements will by default create a new chunk unless `inlineDynamicImports` is used (#2293) -* Rollup now uses acorn@6 which means that acorn plugins must be compatible with this version; acorn is now external for non-browser builds to make plugins work (#2293) +- Plugin transform dependencies are deprecated in favour of using the `this.addWatchFile` plugin context function (#2409) +- Accessing `this.watcher` in plugin hooks is deprecated in favour of the `watchChange` plugin hook and the `this.addWatchFile` plugin context function (#2409) +- Using dynamic import statements will by default create a new chunk unless `inlineDynamicImports` is used (#2293) +- Rollup now uses acorn@6 which means that acorn plugins must be compatible with this version; acorn is now external for non-browser builds to make plugins work (#2293) ### Features -* The `--dir` ClI option can now be aliased as `-d` (#2293) -* The `--input` option now supports named entry points via `=` (#2293) + +- The `--dir` ClI option can now be aliased as `-d` (#2293) +- The `--input` option now supports named entry points via `=` (#2293) ### Bug Fixes -* Both the `--input` option as well as the default CLI option now support named inputs (#2293) + +- Both the `--input` option as well as the default CLI option now support named inputs (#2293) ### Pull Requests -* [#2293](https://github.com/rollup/rollup/pull/2293): Unify code paths for 1.0 relase and update documentation (@guybedford and @lukastaegert) -* [#2409](https://github.com/rollup/rollup/pull/2409): Remove old deprecated features and add new deprecation warnings (@guybedford) -* [#2486](https://github.com/rollup/rollup/pull/2486): Upgrade to acorn 6 (@marijnh) -* [#2611](https://github.com/rollup/rollup/pull/2611): Fix hook's name in test description (@Andarist) -* [#2612](https://github.com/rollup/rollup/pull/2612): Fix a self-contradicting comment in the docs (@LongTengDao) + +- [#2293](https://github.com/rollup/rollup/pull/2293): Unify code paths for 1.0 relase and update documentation (@guybedford and @lukastaegert) +- [#2409](https://github.com/rollup/rollup/pull/2409): Remove old deprecated features and add new deprecation warnings (@guybedford) +- [#2486](https://github.com/rollup/rollup/pull/2486): Upgrade to acorn 6 (@marijnh) +- [#2611](https://github.com/rollup/rollup/pull/2611): Fix hook's name in test description (@Andarist) +- [#2612](https://github.com/rollup/rollup/pull/2612): Fix a self-contradicting comment in the docs (@LongTengDao) ## 0.68.2 -*2018-12-23* + +_2018-12-23_ ### Bug Fixes -* Do not assume hoisted variables to have been initialized (#2607) + +- Do not assume hoisted variables to have been initialized (#2607) ### Pull Requests -* [#2607](https://github.com/rollup/rollup/pull/2607): Fix an issues where hoisted variables were assumed to have been initialized (@lye) + +- [#2607](https://github.com/rollup/rollup/pull/2607): Fix an issues where hoisted variables were assumed to have been initialized (@lye) ## 0.68.1 -*2018-12-19* + +_2018-12-19_ ### Bug Fixes -* Fix an issue with UMD wrappers where a variable is used without being defined (#2600) + +- Fix an issue with UMD wrappers where a variable is used without being defined (#2600) ### Pull Requests -* [#2600](https://github.com/rollup/rollup/pull/2600): Fix UMD and IIFE wrapper issues and add comprehensive functional wrapper tests (@lukastaegert) + +- [#2600](https://github.com/rollup/rollup/pull/2600): Fix UMD and IIFE wrapper issues and add comprehensive functional wrapper tests (@lukastaegert) ## 0.68.0 -*2018-12-16* + +_2018-12-16_ ### Breaking Changes -* `optimizeChunks` is renamed to `experimentalOptimizeChunks` to reflect this feature is not production-ready yet (#2575) - -### Features -* Plugins can iterate all module ids via `this.moduleIds` (#2565) -* Plugins can get graph information about a module via `this.getModuleInfo(id)` (#2565) -* Plugins and JS API users get more information about the generated chunks: `dynamicImports`, `facadeModuleId`, `isDynamicEntry`, `name` (#2575) -* Tree-shaken dynamic imports will no longer create chunks or influence chunking in any way (#2575) -* Dynamic imports will no longer follow the `entryFileNames` but the `chunkFileNames` property reflecting those are solely internally used (#2575) -* If there are chunk naming conflicts, entry chunks will always take precedence (#2575) -* If an entry facade is created, only the facade chunk is marked as `isEntry` (#2575) -* Dynamic chunks will only be marked as `isEntry` if they are actually entry chunks as well; thus there is now a 1-to-1 correspondence between modules listed in `input` and chunks marked as `isEntry` (#2575) -* Chunks no longer contain imports for variables that are tree-shaken in the chunk but used in other chunks (#2584) -* Chunks will always import re-exported variables directly from the chunk where they are originally exported from (#2584) -* Null characters will be pruned from chunk ids to allow for virtually created chunks and make `rollup-plugin-multi-entry` compatible with code-splitting and thus the upcoming 1.0 version (#2590) -* Simplify the UMD wrapper code as much as possible, especially if there are no exports (#2594) -* The UMD wrapper will now work in strict mode by checking for `self` before `this` when determining the global variable (#2594) - -### Bug Fixes -* If a facade is created for a dynamic entry point, this facade will be imported instead of the facaded chunk (#2575) -* Manual chunks that include multiple entry points will have proper facades created for all entry points if necessary (#2575) -* If missing exports are shimmed, the shim variable will not be global but created on a per-module basis and is deconflicted with variables having the same name (#2584) -* Missing export shims work properly in SystemJS (#2584) -* `preserveModules` now handles dynamic namespace imports (#2584) -* Fix chunk execution order in certain scenarios (#2584) -* Exports and assignments using destructuring syntax will properly update the exported variables when generating SystemJS output (#2587) -* Hashes in chunk names will now also take dynamic imports into account (#2596) - -### Pull Requests -* [#2565](https://github.com/rollup/rollup/pull/2565): Provide module graph information on the plugin context (@samccone) -* [#2575](https://github.com/rollup/rollup/pull/2575): Extend bundle information, tree-shake dynamic imports, fix dynamic import facade creation, support manual chunks with multiple entry points, make `optimizeChunks` experimental (@lukastaegert) -* [#2577](https://github.com/rollup/rollup/pull/2577): Update dependencies (@lukastaegert) -* [#2584](https://github.com/rollup/rollup/pull/2584): Prune tree-shaken chunk imports, fix missing export shimming, support dynamic namespaces when preserving modules, improve chunk execution order (@lukastaegert) -* [#2587](https://github.com/rollup/rollup/pull/2587): Support exports using destructuring declarations and assignments in SystemJS (@lukastaegert) -* [#2590](https://github.com/rollup/rollup/pull/2590): Make sure chunk ids do not contain invalid characters to allow for chunks to correspond to virtual modules (@lukastaegert) -* [#2594](https://github.com/rollup/rollup/pull/2594): Simplify UMD wrapper code and make sure it works in strict mode (@lukastaegert) -* [#2596](https://github.com/rollup/rollup/pull/2596): Take both static and dynamic dependencies into account when calculating hashes (@lukastaegert) + +- `optimizeChunks` is renamed to `experimentalOptimizeChunks` to reflect this feature is not production-ready yet (#2575) + +### Features + +- Plugins can iterate all module ids via `this.moduleIds` (#2565) +- Plugins can get graph information about a module via `this.getModuleInfo(id)` (#2565) +- Plugins and JS API users get more information about the generated chunks: `dynamicImports`, `facadeModuleId`, `isDynamicEntry`, `name` (#2575) +- Tree-shaken dynamic imports will no longer create chunks or influence chunking in any way (#2575) +- Dynamic imports will no longer follow the `entryFileNames` but the `chunkFileNames` property reflecting those are solely internally used (#2575) +- If there are chunk naming conflicts, entry chunks will always take precedence (#2575) +- If an entry facade is created, only the facade chunk is marked as `isEntry` (#2575) +- Dynamic chunks will only be marked as `isEntry` if they are actually entry chunks as well; thus there is now a 1-to-1 correspondence between modules listed in `input` and chunks marked as `isEntry` (#2575) +- Chunks no longer contain imports for variables that are tree-shaken in the chunk but used in other chunks (#2584) +- Chunks will always import re-exported variables directly from the chunk where they are originally exported from (#2584) +- Null characters will be pruned from chunk ids to allow for virtually created chunks and make `rollup-plugin-multi-entry` compatible with code-splitting and thus the upcoming 1.0 version (#2590) +- Simplify the UMD wrapper code as much as possible, especially if there are no exports (#2594) +- The UMD wrapper will now work in strict mode by checking for `self` before `this` when determining the global variable (#2594) + +### Bug Fixes + +- If a facade is created for a dynamic entry point, this facade will be imported instead of the facaded chunk (#2575) +- Manual chunks that include multiple entry points will have proper facades created for all entry points if necessary (#2575) +- If missing exports are shimmed, the shim variable will not be global but created on a per-module basis and is deconflicted with variables having the same name (#2584) +- Missing export shims work properly in SystemJS (#2584) +- `preserveModules` now handles dynamic namespace imports (#2584) +- Fix chunk execution order in certain scenarios (#2584) +- Exports and assignments using destructuring syntax will properly update the exported variables when generating SystemJS output (#2587) +- Hashes in chunk names will now also take dynamic imports into account (#2596) + +### Pull Requests + +- [#2565](https://github.com/rollup/rollup/pull/2565): Provide module graph information on the plugin context (@samccone) +- [#2575](https://github.com/rollup/rollup/pull/2575): Extend bundle information, tree-shake dynamic imports, fix dynamic import facade creation, support manual chunks with multiple entry points, make `optimizeChunks` experimental (@lukastaegert) +- [#2577](https://github.com/rollup/rollup/pull/2577): Update dependencies (@lukastaegert) +- [#2584](https://github.com/rollup/rollup/pull/2584): Prune tree-shaken chunk imports, fix missing export shimming, support dynamic namespaces when preserving modules, improve chunk execution order (@lukastaegert) +- [#2587](https://github.com/rollup/rollup/pull/2587): Support exports using destructuring declarations and assignments in SystemJS (@lukastaegert) +- [#2590](https://github.com/rollup/rollup/pull/2590): Make sure chunk ids do not contain invalid characters to allow for chunks to correspond to virtual modules (@lukastaegert) +- [#2594](https://github.com/rollup/rollup/pull/2594): Simplify UMD wrapper code and make sure it works in strict mode (@lukastaegert) +- [#2596](https://github.com/rollup/rollup/pull/2596): Take both static and dynamic dependencies into account when calculating hashes (@lukastaegert) ## 0.67.4 -*2018-12-03* + +_2018-12-03_ ### Bug Fixes -* Prevent corrupt source maps for files with very long lines (#2571) + +- Prevent corrupt source maps for files with very long lines (#2571) ### Pull Requests -* [#2571](https://github.com/rollup/rollup/pull/2571): Fix an issue with long lines in sourcemaps (@mislav) + +- [#2571](https://github.com/rollup/rollup/pull/2571): Fix an issue with long lines in sourcemaps (@mislav) ## 0.67.3 -*2018-11-17* + +_2018-11-17_ ### Bug Fixes -* Make sure the ESM browser build is actually published to npm (#2560) -* Throw proper error when using `inlineDynamicImports` with `experimentalPreserveModules` (#2560) + +- Make sure the ESM browser build is actually published to npm (#2560) +- Throw proper error when using `inlineDynamicImports` with `experimentalPreserveModules` (#2560) ### Pull Requests -* [#2552](https://github.com/rollup/rollup/pull/2552): Properly include ESM browser build in package (@lukastaegert) -* [#2560](https://github.com/rollup/rollup/pull/2560): Show proper error when using `inlineDynamicImports` with `experimentalPreserveModules` (@clarkdo) + +- [#2552](https://github.com/rollup/rollup/pull/2552): Properly include ESM browser build in package (@lukastaegert) +- [#2560](https://github.com/rollup/rollup/pull/2560): Show proper error when using `inlineDynamicImports` with `experimentalPreserveModules` (@clarkdo) ## 0.67.2 -*2018-11-17* + +_2018-11-17_ ### Bug Fixes -* Prevent crash when not returning sourcemaps from `renderChunk` plugin hook (#2558) + +- Prevent crash when not returning sourcemaps from `renderChunk` plugin hook (#2558) ### Pull Requests -* [#2558](https://github.com/rollup/rollup/pull/2558): Prevent crash when not returning sourcemaps from `renderChunk` (@kyle1320) + +- [#2558](https://github.com/rollup/rollup/pull/2558): Prevent crash when not returning sourcemaps from `renderChunk` (@kyle1320) ## 0.67.1 -*2018-11-11* + +_2018-11-11_ ### Bug Fixes -* Deconflict CLI entry points with same name but on different paths if no explicit naming is used (#2548) + +- Deconflict CLI entry points with same name but on different paths if no explicit naming is used (#2548) ### Pull Requests -* [#2548](https://github.com/rollup/rollup/pull/2548): Deconflict CLI entry points with same name but on different paths if no explicit naming is used (@lukastaegert) + +- [#2548](https://github.com/rollup/rollup/pull/2548): Deconflict CLI entry points with same name but on different paths if no explicit naming is used (@lukastaegert) ## 0.67.0 -*2018-11-04* + +_2018-11-04_ ### Breaking Changes + none ### Features -* Do not resolve external dynamic imports via plugins to match the logic for static external imports again (#2505) -* Support virtual modules created by plugins when preserving modules (#2511) -* Add new `output.sourcemapExcludeSources` option to exclude the actual sources from sourcemaps (#2531) + +- Do not resolve external dynamic imports via plugins to match the logic for static external imports again (#2505) +- Support virtual modules created by plugins when preserving modules (#2511) +- Add new `output.sourcemapExcludeSources` option to exclude the actual sources from sourcemaps (#2531) ### Bug Fixes -* Fix TypeScript type for sourcemaps (#2507) -* Fix order of external and inter-chunk imports to match the proper execution order (#2508) -* Do not tree-shake children of unknown nodes to e.g. properly handle do-expressions via acorn plugin (#2510) -* Prevent memory leak when using the bundle as cache (#2522) -* Fix mis-placed semicolons for certain SystemJS exports (#2529) + +- Fix TypeScript type for sourcemaps (#2507) +- Fix order of external and inter-chunk imports to match the proper execution order (#2508) +- Do not tree-shake children of unknown nodes to e.g. properly handle do-expressions via acorn plugin (#2510) +- Prevent memory leak when using the bundle as cache (#2522) +- Fix mis-placed semicolons for certain SystemJS exports (#2529) ### Pull Requests -* [#2505](https://github.com/rollup/rollup/pull/2505): Do not resolve external dynamic imports via plugins (@lukastaegert) -* [#2507](https://github.com/rollup/rollup/pull/2507): Fix public sourcemap type (@aMarCruz) -* [#2508](https://github.com/rollup/rollup/pull/2508): Improve execution order of chunks and externals (@lukastaegert) -* [#2510](https://github.com/rollup/rollup/pull/2510): Do not tree-shake children of unknown nodes to e.g. properly handle do-expressions via acorn plugin (@devsnek) -* [#2511](https://github.com/rollup/rollup/pull/2511): Create chunks for virtual modules when preserving modules (@lukastaegert) -* [#2522](https://github.com/rollup/rollup/pull/2522): Prevent memory leak when using the bundle as cache (@kyle1320) -* [#2529](https://github.com/rollup/rollup/pull/2529): Fix mis-placed semicolons for certain SystemJS exports (@kyle1320) -* [#2531](https://github.com/rollup/rollup/pull/2531): add `sourcemapExcludeSources` option to exclude the source content from sourcemaps (@kitsonk) + +- [#2505](https://github.com/rollup/rollup/pull/2505): Do not resolve external dynamic imports via plugins (@lukastaegert) +- [#2507](https://github.com/rollup/rollup/pull/2507): Fix public sourcemap type (@aMarCruz) +- [#2508](https://github.com/rollup/rollup/pull/2508): Improve execution order of chunks and externals (@lukastaegert) +- [#2510](https://github.com/rollup/rollup/pull/2510): Do not tree-shake children of unknown nodes to e.g. properly handle do-expressions via acorn plugin (@devsnek) +- [#2511](https://github.com/rollup/rollup/pull/2511): Create chunks for virtual modules when preserving modules (@lukastaegert) +- [#2522](https://github.com/rollup/rollup/pull/2522): Prevent memory leak when using the bundle as cache (@kyle1320) +- [#2529](https://github.com/rollup/rollup/pull/2529): Fix mis-placed semicolons for certain SystemJS exports (@kyle1320) +- [#2531](https://github.com/rollup/rollup/pull/2531): add `sourcemapExcludeSources` option to exclude the source content from sourcemaps (@kitsonk) ## 0.66.6 -*2018-10-10* -* Properly deconflict function and class declaration ids of reassigned default exports ([#2502](https://github.com/rollup/rollup/pull/2502)) + +_2018-10-10_ + +- Properly deconflict function and class declaration ids of reassigned default exports ([#2502](https://github.com/rollup/rollup/pull/2502)) ## 0.66.5 -*2018-10-09* -* Remove cache from memory once no longer needed ([#2496](https://github.com/rollup/rollup/pull/2496)) -* Provide better error message when reexporting external namespace reexports ([#2499](https://github.com/rollup/rollup/pull/2499)) + +_2018-10-09_ + +- Remove cache from memory once no longer needed ([#2496](https://github.com/rollup/rollup/pull/2496)) +- Provide better error message when reexporting external namespace reexports ([#2499](https://github.com/rollup/rollup/pull/2499)) ## 0.66.4 -*2018-10-04* -* Fix links in warnings and errors ([#2471](https://github.com/rollup/rollup/pull/2471)) + +_2018-10-04_ + +- Fix links in warnings and errors ([#2471](https://github.com/rollup/rollup/pull/2471)) ## 0.66.3 -*2018-10-03* -* Detect side-effects in string.replace function arguments ([#2476](https://github.com/rollup/rollup/pull/2476)) -* Make sure chunk ids are assigned before creating output bundle ([#2483](https://github.com/rollup/rollup/pull/2483)) -* Use proper plugin name in error ([#2470](https://github.com/rollup/rollup/pull/2470)) -* Update TypeScript version and fix type errors ([#2488](https://github.com/rollup/rollup/pull/2488)) + +_2018-10-03_ + +- Detect side-effects in string.replace function arguments ([#2476](https://github.com/rollup/rollup/pull/2476)) +- Make sure chunk ids are assigned before creating output bundle ([#2483](https://github.com/rollup/rollup/pull/2483)) +- Use proper plugin name in error ([#2470](https://github.com/rollup/rollup/pull/2470)) +- Update TypeScript version and fix type errors ([#2488](https://github.com/rollup/rollup/pull/2488)) ## 0.66.2 -*2018-09-21* -* Add additional information to parse errors messages in JSON and other non-JS files ([#2466](https://github.com/rollup/rollup/pull/2466)) + +_2018-09-21_ + +- Add additional information to parse errors messages in JSON and other non-JS files ([#2466](https://github.com/rollup/rollup/pull/2466)) ## 0.66.1 -*2018-09-19* -* Ignore falsy plugins ([#2464](https://github.com/rollup/rollup/pull/2464)) -* Switch back to official TypeScript plugin ([#2465](https://github.com/rollup/rollup/pull/2465)) + +_2018-09-19_ + +- Ignore falsy plugins ([#2464](https://github.com/rollup/rollup/pull/2464)) +- Switch back to official TypeScript plugin ([#2465](https://github.com/rollup/rollup/pull/2465)) ## 0.66.0 -*2018-09-16* -* Support ES2019 optional catch bindings ([#2455](https://github.com/rollup/rollup/pull/2455)) -* Add option to transform paths within sourcemaps ([#2430](https://github.com/rollup/rollup/pull/2430)) -* Add renderStart and renderEnd plugin hooks ([#2438](https://github.com/rollup/rollup/pull/2438)) -* Expose ESM browser build and minify browser builds ([#2437](https://github.com/rollup/rollup/pull/2437) -* Associate hoisted variables in function bodys with function parameters ([#2456](https://github.com/rollup/rollup/pull/2456)) -* Fix issue when deconflicting variables used as pattern defaults ([#2446](https://github.com/rollup/rollup/pull/2446)) -* Properly deconflict default exported class and function expressions with ids ([#2458](https://github.com/rollup/rollup/pull/2458)) -* Faster internal test builds ([#2457](https://github.com/rollup/rollup/pull/2457)) -* Switch to rollup-plugin-typescript2 ([#2460](https://github.com/rollup/rollup/pull/2460)) -* Fix internal "perf" script ([#2433](https://github.com/rollup/rollup/pull/2433)) -* Test that errors are passed to the buildEnd hook ([#2450](https://github.com/rollup/rollup/pull/2450)) + +_2018-09-16_ + +- Support ES2019 optional catch bindings ([#2455](https://github.com/rollup/rollup/pull/2455)) +- Add option to transform paths within sourcemaps ([#2430](https://github.com/rollup/rollup/pull/2430)) +- Add renderStart and renderEnd plugin hooks ([#2438](https://github.com/rollup/rollup/pull/2438)) +- Expose ESM browser build and minify browser builds ([#2437](https://github.com/rollup/rollup/pull/2437) +- Associate hoisted variables in function bodys with function parameters ([#2456](https://github.com/rollup/rollup/pull/2456)) +- Fix issue when deconflicting variables used as pattern defaults ([#2446](https://github.com/rollup/rollup/pull/2446)) +- Properly deconflict default exported class and function expressions with ids ([#2458](https://github.com/rollup/rollup/pull/2458)) +- Faster internal test builds ([#2457](https://github.com/rollup/rollup/pull/2457)) +- Switch to rollup-plugin-typescript2 ([#2460](https://github.com/rollup/rollup/pull/2460)) +- Fix internal "perf" script ([#2433](https://github.com/rollup/rollup/pull/2433)) +- Test that errors are passed to the buildEnd hook ([#2450](https://github.com/rollup/rollup/pull/2450)) ## 0.65.2 -*2018-09-05* -* Prevent watch mode memory leak ([#2441](https://github.com/rollup/rollup/pull/2441)) + +_2018-09-05_ + +- Prevent watch mode memory leak ([#2441](https://github.com/rollup/rollup/pull/2441)) ## 0.65.1 -*2018-09-05* -* Prevent globbing when using chokidar ([#2432](https://github.com/rollup/rollup/pull/2432)) + +_2018-09-05_ + +- Prevent globbing when using chokidar ([#2432](https://github.com/rollup/rollup/pull/2432)) ## 0.65.0 -*2018-08-25* -* Refactor and unify plugin system ([#2382](https://github.com/rollup/rollup/pull/2382)) -* Implement plugin cache API ([#2389](https://github.com/rollup/rollup/pull/2389)) -* Add watchChange plugin hook to watch changed files, deprecate asset dependencies ([#2405](https://github.com/rollup/rollup/pull/2405)) -* Refine asset handling ([#2369](https://github.com/rollup/rollup/pull/2369)) -* Implement `renderChunk` hook to replace `transformChunk` and `transformBundle` hooks ([#2406](https://github.com/rollup/rollup/pull/2406)) -* Add rollup version to plugin context ([#2394](https://github.com/rollup/rollup/pull/2394)) -* Do not resume stdin in watch mode to fix it for Lerna users ([#2410](https://github.com/rollup/rollup/pull/2410)) -* Allow `[format]` placeholder for id generation ([#2387](https://github.com/rollup/rollup/pull/2387)) -* Always log error stacks even when a code frame is given ([#2417](https://github.com/rollup/rollup/pull/2417)) -* Do not test module ids starting with `\0` as external ([#2400](https://github.com/rollup/rollup/pull/2400)) -* Fix tracing of namespace variables ([#2408](https://github.com/rollup/rollup/pull/2408)) -* Fix re-tracing of namespace variables ([#2420](https://github.com/rollup/rollup/pull/2420)) -* Properly wrap comment annotations in SystemJS exports ([#2408](https://github.com/rollup/rollup/pull/2408)) -* Fix renaming of destructured parameters ([#2419](https://github.com/rollup/rollup/pull/2419)) -* Do not display version in watch mode when using `--silent` ([#2392](https://github.com/rollup/rollup/pull/2392)) -* Make `cacheExpiry` an experimental option for now ([#2401](https://github.com/rollup/rollup/pull/2401)) -* Lint test configs on commit ([#2402](https://github.com/rollup/rollup/pull/2402)) -* Add code of conduct ([#2388](https://github.com/rollup/rollup/pull/2388)) -* Move to CircleCI ([#2390](https://github.com/rollup/rollup/pull/2390)) -* Update pull request template ([#2404](https://github.com/rollup/rollup/pull/2404)) + +_2018-08-25_ + +- Refactor and unify plugin system ([#2382](https://github.com/rollup/rollup/pull/2382)) +- Implement plugin cache API ([#2389](https://github.com/rollup/rollup/pull/2389)) +- Add watchChange plugin hook to watch changed files, deprecate asset dependencies ([#2405](https://github.com/rollup/rollup/pull/2405)) +- Refine asset handling ([#2369](https://github.com/rollup/rollup/pull/2369)) +- Implement `renderChunk` hook to replace `transformChunk` and `transformBundle` hooks ([#2406](https://github.com/rollup/rollup/pull/2406)) +- Add rollup version to plugin context ([#2394](https://github.com/rollup/rollup/pull/2394)) +- Do not resume stdin in watch mode to fix it for Lerna users ([#2410](https://github.com/rollup/rollup/pull/2410)) +- Allow `[format]` placeholder for id generation ([#2387](https://github.com/rollup/rollup/pull/2387)) +- Always log error stacks even when a code frame is given ([#2417](https://github.com/rollup/rollup/pull/2417)) +- Do not test module ids starting with `\0` as external ([#2400](https://github.com/rollup/rollup/pull/2400)) +- Fix tracing of namespace variables ([#2408](https://github.com/rollup/rollup/pull/2408)) +- Fix re-tracing of namespace variables ([#2420](https://github.com/rollup/rollup/pull/2420)) +- Properly wrap comment annotations in SystemJS exports ([#2408](https://github.com/rollup/rollup/pull/2408)) +- Fix renaming of destructured parameters ([#2419](https://github.com/rollup/rollup/pull/2419)) +- Do not display version in watch mode when using `--silent` ([#2392](https://github.com/rollup/rollup/pull/2392)) +- Make `cacheExpiry` an experimental option for now ([#2401](https://github.com/rollup/rollup/pull/2401)) +- Lint test configs on commit ([#2402](https://github.com/rollup/rollup/pull/2402)) +- Add code of conduct ([#2388](https://github.com/rollup/rollup/pull/2388)) +- Move to CircleCI ([#2390](https://github.com/rollup/rollup/pull/2390)) +- Update pull request template ([#2404](https://github.com/rollup/rollup/pull/2404)) ## 0.64.1 -*2018-08-07* -* Do not render initializers of hoisted variables in dead branches ([#2384](https://github.com/rollup/rollup/pull/2384)) + +_2018-08-07_ + +- Do not render initializers of hoisted variables in dead branches ([#2384](https://github.com/rollup/rollup/pull/2384)) ## 0.64.0 -*2018-08-07* -* Print memory consumption together with performance timings ([#2370](https://github.com/rollup/rollup/pull/2370)) -* Enable plugins to mark imports as external by returning false for resolveId ([#2351](https://github.com/rollup/rollup/pull/2351)) -* Always retain empty manual chunks ([#2362](https://github.com/rollup/rollup/pull/2362)) -* Ensure CLI warnings are shown on errors and add error for external id collisions ([#2334](https://github.com/rollup/rollup/pull/2334)) -* Remove unnecessary dependency, update dependencies, fix linting of test config ([#2376](https://github.com/rollup/rollup/pull/2376)) -* Add targeted Github issue templates ([#2356](https://github.com/rollup/rollup/pull/2356)) + +_2018-08-07_ + +- Print memory consumption together with performance timings ([#2370](https://github.com/rollup/rollup/pull/2370)) +- Enable plugins to mark imports as external by returning false for resolveId ([#2351](https://github.com/rollup/rollup/pull/2351)) +- Always retain empty manual chunks ([#2362](https://github.com/rollup/rollup/pull/2362)) +- Ensure CLI warnings are shown on errors and add error for external id collisions ([#2334](https://github.com/rollup/rollup/pull/2334)) +- Remove unnecessary dependency, update dependencies, fix linting of test config ([#2376](https://github.com/rollup/rollup/pull/2376)) +- Add targeted Github issue templates ([#2356](https://github.com/rollup/rollup/pull/2356)) ## 0.63.5 -*2018-08-01* -* Ensure onwrite plugin hooks execute in sequence ([#2364](https://github.com/rollup/rollup/pull/2364)) -* Always warn when no name is provided for a global module ([#2359](https://github.com/rollup/rollup/pull/2359)) -* Add utility type for user created plugins ([#2355](https://github.com/rollup/rollup/pull/2355)) -* Remove deprecated es6 format from types ([#2349](https://github.com/rollup/rollup/pull/2349)) -* Mark inlineDynamicImports as optional in types ([#2348](https://github.com/rollup/rollup/pull/2348)) + +_2018-08-01_ + +- Ensure onwrite plugin hooks execute in sequence ([#2364](https://github.com/rollup/rollup/pull/2364)) +- Always warn when no name is provided for a global module ([#2359](https://github.com/rollup/rollup/pull/2359)) +- Add utility type for user created plugins ([#2355](https://github.com/rollup/rollup/pull/2355)) +- Remove deprecated es6 format from types ([#2349](https://github.com/rollup/rollup/pull/2349)) +- Mark inlineDynamicImports as optional in types ([#2348](https://github.com/rollup/rollup/pull/2348)) ## 0.63.4 -*2018-07-20* -* Use turbocolor instead of chalk ([#2339](https://github.com/rollup/rollup/pull/2339)) + +_2018-07-20_ + +- Use turbocolor instead of chalk ([#2339](https://github.com/rollup/rollup/pull/2339)) ## 0.63.3 -*2018-07-20* -* Handle expressions where "in" and "instanceof" are applied to primitive values ([#2344](https://github.com/rollup/rollup/pull/2344)) + +_2018-07-20_ + +- Handle expressions where "in" and "instanceof" are applied to primitive values ([#2344](https://github.com/rollup/rollup/pull/2344)) ## 0.63.2 -*2018-07-18* -* Fix bind order in for-of loops ([#2338](https://github.com/rollup/rollup/pull/2338)) + +_2018-07-18_ + +- Fix bind order in for-of loops ([#2338](https://github.com/rollup/rollup/pull/2338)) ## 0.63.1 -*2018-07-18* + +_2018-07-18_ ## 0.63.0 -*2018-07-17* -* Fix many tree-shaking related issues ([#2315](https://github.com/rollup/rollup/pull/2315)) -* Add experimental support for top-level await ([#2235](https://github.com/rollup/rollup/pull/2235)) -* Prevent duplicate version printout in watch mode ([#2325](https://github.com/rollup/rollup/pull/2325)) -* Respect error frames provided by plugins ([#2309](https://github.com/rollup/rollup/pull/2309)) -* Add `esm` format alias to types ([#2327](https://github.com/rollup/rollup/pull/2327)) -* Further unify internal test setup ([#2329](https://github.com/rollup/rollup/pull/2329)) + +_2018-07-17_ + +- Fix many tree-shaking related issues ([#2315](https://github.com/rollup/rollup/pull/2315)) +- Add experimental support for top-level await ([#2235](https://github.com/rollup/rollup/pull/2235)) +- Prevent duplicate version printout in watch mode ([#2325](https://github.com/rollup/rollup/pull/2325)) +- Respect error frames provided by plugins ([#2309](https://github.com/rollup/rollup/pull/2309)) +- Add `esm` format alias to types ([#2327](https://github.com/rollup/rollup/pull/2327)) +- Further unify internal test setup ([#2329](https://github.com/rollup/rollup/pull/2329)) ## 0.62.0 -*2018-06-27* -* Add option to automatically shim missing exports ([#2118](https://github.com/rollup/rollup/pull/2118)) -* Inline dynamic imports that are also imported statically and only used in a single chunk ([#2295](https://github.com/rollup/rollup/pull/2295)) -* Handle caching and invalidation of assets ([#2267](https://github.com/rollup/rollup/pull/2267)) -* Fix plugin related types ([#2299](https://github.com/rollup/rollup/pull/2299)) + +_2018-06-27_ + +- Add option to automatically shim missing exports ([#2118](https://github.com/rollup/rollup/pull/2118)) +- Inline dynamic imports that are also imported statically and only used in a single chunk ([#2295](https://github.com/rollup/rollup/pull/2295)) +- Handle caching and invalidation of assets ([#2267](https://github.com/rollup/rollup/pull/2267)) +- Fix plugin related types ([#2299](https://github.com/rollup/rollup/pull/2299)) ## 0.61.2 -*2018-06-23* -* Improve watcher error handling, only rebuild invalidated outputs ([#2296](https://github.com/rollup/rollup/pull/2296)) -* Update dependencies, make watcher more stable ([#2297](https://github.com/rollup/rollup/pull/2297)) + +_2018-06-23_ + +- Improve watcher error handling, only rebuild invalidated outputs ([#2296](https://github.com/rollup/rollup/pull/2296)) +- Update dependencies, make watcher more stable ([#2297](https://github.com/rollup/rollup/pull/2297)) ## 0.61.1 -*2018-06-21* -* Do not try to deconflict "undefined" ([#2291](https://github.com/rollup/rollup/pull/2291)) -* Properly track values for loop interator declarations and reassigned namespaces, add smoke test ([#2292](https://github.com/rollup/rollup/pull/2292)) + +_2018-06-21_ + +- Do not try to deconflict "undefined" ([#2291](https://github.com/rollup/rollup/pull/2291)) +- Properly track values for loop interator declarations and reassigned namespaces, add smoke test ([#2292](https://github.com/rollup/rollup/pull/2292)) ## 0.61.0 -*2018-06-20* -* Declare file dependencies via transform plugin hooks ([#2259](https://github.com/rollup/rollup/pull/2259)) -* Handle undefined values when evaluating conditionals ([#2264](https://github.com/rollup/rollup/pull/2264)) -* Handle known undefined properties when evaluating conditionals ([#2265](https://github.com/rollup/rollup/pull/2265)) -* Access watch events via the plugin context ([#2261](https://github.com/rollup/rollup/pull/2261)) -* Add option to suppress `__esModule` flag in output ([#2287](https://github.com/rollup/rollup/pull/2287)) -* Fix issue when re-declaring variables, track reassignments in more cases ([#2279](https://github.com/rollup/rollup/pull/2279)) -* Add VSCode debug settings ([#2276](https://github.com/rollup/rollup/pull/2276)) + +_2018-06-20_ + +- Declare file dependencies via transform plugin hooks ([#2259](https://github.com/rollup/rollup/pull/2259)) +- Handle undefined values when evaluating conditionals ([#2264](https://github.com/rollup/rollup/pull/2264)) +- Handle known undefined properties when evaluating conditionals ([#2265](https://github.com/rollup/rollup/pull/2265)) +- Access watch events via the plugin context ([#2261](https://github.com/rollup/rollup/pull/2261)) +- Add option to suppress `__esModule` flag in output ([#2287](https://github.com/rollup/rollup/pull/2287)) +- Fix issue when re-declaring variables, track reassignments in more cases ([#2279](https://github.com/rollup/rollup/pull/2279)) +- Add VSCode debug settings ([#2276](https://github.com/rollup/rollup/pull/2276)) ## 0.60.7 -*2018-06-14* -* Fix typing issue ([#2269](https://github.com/rollup/rollup/pull/2269)) + +_2018-06-14_ + +- Fix typing issue ([#2269](https://github.com/rollup/rollup/pull/2269)) ## 0.60.6 -*2018-06-14* -* Track mutations of included virtual arrays ([#2263](https://github.com/rollup/rollup/pull/2263)) -* Update readme ([#2266](https://github.com/rollup/rollup/pull/2266)) + +_2018-06-14_ + +- Track mutations of included virtual arrays ([#2263](https://github.com/rollup/rollup/pull/2263)) +- Update readme ([#2266](https://github.com/rollup/rollup/pull/2266)) ## 0.60.5 -*2018-06-14* -* Track deep reassignments of global and exported variables and improve performance ([#2254](https://github.com/rollup/rollup/pull/2254)) + +_2018-06-14_ + +- Track deep reassignments of global and exported variables and improve performance ([#2254](https://github.com/rollup/rollup/pull/2254)) ## 0.60.4 -*2018-06-13* -* Properly handle initially uninitialized exports and exports of globals in SystemJS output ([#2258](https://github.com/rollup/rollup/pull/2258)) + +_2018-06-13_ + +- Properly handle initially uninitialized exports and exports of globals in SystemJS output ([#2258](https://github.com/rollup/rollup/pull/2258)) ## 0.60.3 -*2018-06-13* -* Fix types to allow watching an array of outputs ([#2262](https://github.com/rollup/rollup/pull/2262)) + +_2018-06-13_ + +- Fix types to allow watching an array of outputs ([#2262](https://github.com/rollup/rollup/pull/2262)) ## 0.60.2 -*2018-06-11* -* Permit setting an asset's source in `generateBundle` ([#2256](https://github.com/rollup/rollup/pull/2256)) -* Add automatic linting ([#2242](https://github.com/rollup/rollup/pull/2242)) + +_2018-06-11_ + +- Permit setting an asset's source in `generateBundle` ([#2256](https://github.com/rollup/rollup/pull/2256)) +- Add automatic linting ([#2242](https://github.com/rollup/rollup/pull/2242)) ## 0.60.1 -*2018-06-07* -* Fix plugin regressions ([#2246](https://github.com/rollup/rollup/pull/2246)) -* Avoid conflicts for large numbers of variables ([#2244](https://github.com/rollup/rollup/pull/2244)) + +_2018-06-07_ + +- Fix plugin regressions ([#2246](https://github.com/rollup/rollup/pull/2246)) +- Avoid conflicts for large numbers of variables ([#2244](https://github.com/rollup/rollup/pull/2244)) ## 0.60.0 -*2018-06-06* -* New plugin hooks: transformChunk, buildStart, buildEnd; extended plugin context with warn, error, resolveId, isExternal, emitAsset, setAssetSource and getAssetFileName available to any hook ([#2208](https://github.com/rollup/rollup/pull/2208)) -* [BREAKING] Deprecate the `legacy` option and thus IE8 support ([#2141](https://github.com/rollup/rollup/pull/2141)) -* Detect more known extensions and load .mjs without extension ([#2211](https://github.com/rollup/rollup/pull/2211)) -* Add compact output mode ([#2151](https://github.com/rollup/rollup/pull/2151)) -* Significantly improve sourcemap generation performance ([#2228](https://github.com/rollup/rollup/pull/2228)) -* Enable naming SystemJS modules ([#2028](https://github.com/rollup/rollup/pull/2028)) -* Do not use alternate screen if clearScreen is set in watch mode ([#2125](https://github.com/rollup/rollup/pull/2125)) -* Allow object input form for code-splitting in watch mode ([#2217](https://github.com/rollup/rollup/pull/2217)) -* Track reassignments of methods of exports from outside ([#2240](https://github.com/rollup/rollup/pull/2240)) -* Preserve id of default exported functions and classes ([#2234](https://github.com/rollup/rollup/pull/2234)) -* Add semicolons after default exports ([#2209](https://github.com/rollup/rollup/pull/2209)) -* Fix build problems on Windows ([#2232](https://github.com/rollup/rollup/pull/2232)) -* Display install size in readme ([#2196](https://github.com/rollup/rollup/pull/2196)) -* Improve preserve modules test ([#2236](https://github.com/rollup/rollup/pull/2236)) + +_2018-06-06_ + +- New plugin hooks: transformChunk, buildStart, buildEnd; extended plugin context with warn, error, resolveId, isExternal, emitAsset, setAssetSource and getAssetFileName available to any hook ([#2208](https://github.com/rollup/rollup/pull/2208)) +- [BREAKING] Deprecate the `legacy` option and thus IE8 support ([#2141](https://github.com/rollup/rollup/pull/2141)) +- Detect more known extensions and load .mjs without extension ([#2211](https://github.com/rollup/rollup/pull/2211)) +- Add compact output mode ([#2151](https://github.com/rollup/rollup/pull/2151)) +- Significantly improve sourcemap generation performance ([#2228](https://github.com/rollup/rollup/pull/2228)) +- Enable naming SystemJS modules ([#2028](https://github.com/rollup/rollup/pull/2028)) +- Do not use alternate screen if clearScreen is set in watch mode ([#2125](https://github.com/rollup/rollup/pull/2125)) +- Allow object input form for code-splitting in watch mode ([#2217](https://github.com/rollup/rollup/pull/2217)) +- Track reassignments of methods of exports from outside ([#2240](https://github.com/rollup/rollup/pull/2240)) +- Preserve id of default exported functions and classes ([#2234](https://github.com/rollup/rollup/pull/2234)) +- Add semicolons after default exports ([#2209](https://github.com/rollup/rollup/pull/2209)) +- Fix build problems on Windows ([#2232](https://github.com/rollup/rollup/pull/2232)) +- Display install size in readme ([#2196](https://github.com/rollup/rollup/pull/2196)) +- Improve preserve modules test ([#2236](https://github.com/rollup/rollup/pull/2236)) ## 0.59.4 -*2018-05-28* -* Fix performance regression when many return statements are used ([#2218](https://github.com/rollup/rollup/pull/2218)) + +_2018-05-28_ + +- Fix performance regression when many return statements are used ([#2218](https://github.com/rollup/rollup/pull/2218)) ## 0.59.3 -*2018-05-24* -* Fix reassignment tracking for constructor parameters ([#2214](https://github.com/rollup/rollup/pull/2214)) + +_2018-05-24_ + +- Fix reassignment tracking for constructor parameters ([#2214](https://github.com/rollup/rollup/pull/2214)) ## 0.59.2 -*2018-05-21* -* Fix reassignment tracking in for-in loops ([#2205](https://github.com/rollup/rollup/pull/2205)) + +_2018-05-21_ + +- Fix reassignment tracking in for-in loops ([#2205](https://github.com/rollup/rollup/pull/2205)) ## 0.59.1 -*2018-05-16* -* Fix infinite recursion when determining literal values of circular structures ([#2193](https://github.com/rollup/rollup/pull/2193)) -* Fix invalid code when simplifying expressions without spaces ([#2194](https://github.com/rollup/rollup/pull/2194)) + +_2018-05-16_ + +- Fix infinite recursion when determining literal values of circular structures ([#2193](https://github.com/rollup/rollup/pull/2193)) +- Fix invalid code when simplifying expressions without spaces ([#2194](https://github.com/rollup/rollup/pull/2194)) ## 0.59.0 -*2018-05-15* -* Tree-shake statically analysable dynamic conditionals ([#2167](https://github.com/rollup/rollup/pull/2167)) -* Do not emit empty chunks when code-splitting or empty files when preserving modules ([#2128](https://github.com/rollup/rollup/pull/2128)) -* Support `import.meta.url` ([#2164](https://github.com/rollup/rollup/pull/2164)) -* Add `esm` format alias ([#2102](https://github.com/rollup/rollup/pull/2102)) -* Use alphanumeric base64 characters when deconflicting variables ([#2188](https://github.com/rollup/rollup/pull/2188)) -* Improve handling of external modules imported as both default and named imports ([#2136](https://github.com/rollup/rollup/pull/2136)) -* Properly deconflict named imports from other chunks ([#2177](https://github.com/rollup/rollup/pull/2177)) -* Fix an issue with namespaces containing reexports ([#2157](https://github.com/rollup/rollup/pull/2157)) -* Fix an issue with with incorrectly mapped default exports when code-splitting CJS or AMD modules ([#2178](https://github.com/rollup/rollup/pull/2178)) -* Fix an issue with wrong paths of relative external imports ([#2160](https://github.com/rollup/rollup/pull/2160)) -* Fix an issue when using default exports and `interop: false` ([#2149](https://github.com/rollup/rollup/pull/2149)) -* Fix in issue with invalid syntax in SystemJS output ([#2187](https://github.com/rollup/rollup/pull/2187)) -* Fix an issue when tree-shaking call expressions and reassigned variables ([#2186](https://github.com/rollup/rollup/pull/2186)) -* Fix file paths in source maps ([#2161](https://github.com/rollup/rollup/pull/2161)) -* Fix wrong file name in error message ([#2137](https://github.com/rollup/rollup/pull/2137)) -* Always use npm 5 on CI ([#2185](https://github.com/rollup/rollup/pull/2185)) + +_2018-05-15_ + +- Tree-shake statically analysable dynamic conditionals ([#2167](https://github.com/rollup/rollup/pull/2167)) +- Do not emit empty chunks when code-splitting or empty files when preserving modules ([#2128](https://github.com/rollup/rollup/pull/2128)) +- Support `import.meta.url` ([#2164](https://github.com/rollup/rollup/pull/2164)) +- Add `esm` format alias ([#2102](https://github.com/rollup/rollup/pull/2102)) +- Use alphanumeric base64 characters when deconflicting variables ([#2188](https://github.com/rollup/rollup/pull/2188)) +- Improve handling of external modules imported as both default and named imports ([#2136](https://github.com/rollup/rollup/pull/2136)) +- Properly deconflict named imports from other chunks ([#2177](https://github.com/rollup/rollup/pull/2177)) +- Fix an issue with namespaces containing reexports ([#2157](https://github.com/rollup/rollup/pull/2157)) +- Fix an issue with with incorrectly mapped default exports when code-splitting CJS or AMD modules ([#2178](https://github.com/rollup/rollup/pull/2178)) +- Fix an issue with wrong paths of relative external imports ([#2160](https://github.com/rollup/rollup/pull/2160)) +- Fix an issue when using default exports and `interop: false` ([#2149](https://github.com/rollup/rollup/pull/2149)) +- Fix in issue with invalid syntax in SystemJS output ([#2187](https://github.com/rollup/rollup/pull/2187)) +- Fix an issue when tree-shaking call expressions and reassigned variables ([#2186](https://github.com/rollup/rollup/pull/2186)) +- Fix file paths in source maps ([#2161](https://github.com/rollup/rollup/pull/2161)) +- Fix wrong file name in error message ([#2137](https://github.com/rollup/rollup/pull/2137)) +- Always use npm 5 on CI ([#2185](https://github.com/rollup/rollup/pull/2185)) ## 0.58.2 -*2018-04-23* -* Fix rendering of certain statically resolvable if statements ([#2146](https://github.com/rollup/rollup/pull/2146)) + +_2018-04-23_ + +- Fix rendering of certain statically resolvable if statements ([#2146](https://github.com/rollup/rollup/pull/2146)) ## 0.58.1 -*2018-04-18* -* Fix comment detection ([#2129](https://github.com/rollup/rollup/pull/2129)) + +_2018-04-18_ + +- Fix comment detection ([#2129](https://github.com/rollup/rollup/pull/2129)) ## 0.58.0 -*2018-04-16* -* Support individual chunk names with optional content hashes ([#2068](https://github.com/rollup/rollup/pull/2068)) -* Support manually created chunks ([#2084](https://github.com/rollup/rollup/pull/2084)) -* Automatically import deep dependencies when code splitting for better performance ([#2073](https://github.com/rollup/rollup/pull/2073)) -* Automatically minify internal export/import names for esm and system output ([#2087](https://github.com/rollup/rollup/pull/2087)) -* Add option to automatically merge small chunks ([#2090](https://github.com/rollup/rollup/pull/2090)) -* Significantly improve tree-shaking performance ([#2119](https://github.com/rollup/rollup/pull/2119)) -* Enable tree-shaking for logical expressions ([#2098](https://github.com/rollup/rollup/pull/2098)) -* Rework external types and reduce type related dependencies ([#2108](https://github.com/rollup/rollup/pull/2108)) -* Support parallel dependency resolution ([#2116](https://github.com/rollup/rollup/pull/2116)) -* Improve deprecation handling ([#2076](https://github.com/rollup/rollup/pull/2076)) -* Enable `--perf` timings in watch mode ([#2065](https://github.com/rollup/rollup/pull/2065)) -* Improve performance timers ([#2111](https://github.com/rollup/rollup/pull/2111)) -* Improve error handling for plugins ([#2100](https://github.com/rollup/rollup/pull/2100)) -* Improve error when using `--dir` in a single file build ([#2123](https://github.com/rollup/rollup/pull/2123)) -* Do not warn for external imports that are unused due to tree-shaking ([#2124](https://github.com/rollup/rollup/pull/2124)) -* Update mixed export warning message ([#2107](https://github.com/rollup/rollup/pull/2107)) -* Remove duplicate badges from readme ([#2083](https://github.com/rollup/rollup/pull/2083)) -* Update readme examples ([#2086](https://github.com/rollup/rollup/pull/2086)) + +_2018-04-16_ + +- Support individual chunk names with optional content hashes ([#2068](https://github.com/rollup/rollup/pull/2068)) +- Support manually created chunks ([#2084](https://github.com/rollup/rollup/pull/2084)) +- Automatically import deep dependencies when code splitting for better performance ([#2073](https://github.com/rollup/rollup/pull/2073)) +- Automatically minify internal export/import names for esm and system output ([#2087](https://github.com/rollup/rollup/pull/2087)) +- Add option to automatically merge small chunks ([#2090](https://github.com/rollup/rollup/pull/2090)) +- Significantly improve tree-shaking performance ([#2119](https://github.com/rollup/rollup/pull/2119)) +- Enable tree-shaking for logical expressions ([#2098](https://github.com/rollup/rollup/pull/2098)) +- Rework external types and reduce type related dependencies ([#2108](https://github.com/rollup/rollup/pull/2108)) +- Support parallel dependency resolution ([#2116](https://github.com/rollup/rollup/pull/2116)) +- Improve deprecation handling ([#2076](https://github.com/rollup/rollup/pull/2076)) +- Enable `--perf` timings in watch mode ([#2065](https://github.com/rollup/rollup/pull/2065)) +- Improve performance timers ([#2111](https://github.com/rollup/rollup/pull/2111)) +- Improve error handling for plugins ([#2100](https://github.com/rollup/rollup/pull/2100)) +- Improve error when using `--dir` in a single file build ([#2123](https://github.com/rollup/rollup/pull/2123)) +- Do not warn for external imports that are unused due to tree-shaking ([#2124](https://github.com/rollup/rollup/pull/2124)) +- Update mixed export warning message ([#2107](https://github.com/rollup/rollup/pull/2107)) +- Remove duplicate badges from readme ([#2083](https://github.com/rollup/rollup/pull/2083)) +- Update readme examples ([#2086](https://github.com/rollup/rollup/pull/2086)) ## 0.57.1 -*2018-03-17* -* Improve sourcemap generation performance ([#2062](https://github.com/rollup/rollup/pull/2062)) -* Add reserved config option namespace and improve CLI interface ([#2063](https://github.com/rollup/rollup/pull/2063)) -* Fix issue with default exported function and class expressions ([#2059](https://github.com/rollup/rollup/pull/2059)) -* Replace `forEach` with faster `for` loops in some places ([#2064](https://github.com/rollup/rollup/pull/2064)) + +_2018-03-17_ + +- Improve sourcemap generation performance ([#2062](https://github.com/rollup/rollup/pull/2062)) +- Add reserved config option namespace and improve CLI interface ([#2063](https://github.com/rollup/rollup/pull/2063)) +- Fix issue with default exported function and class expressions ([#2059](https://github.com/rollup/rollup/pull/2059)) +- Replace `forEach` with faster `for` loops in some places ([#2064](https://github.com/rollup/rollup/pull/2064)) ## 0.57.0 -*2018-03-15* -* Add option to preserve the module structure instead of bundling ([#1922](https://github.com/rollup/rollup/pull/1922)) -* Enable watch mode when code-splitting ([#2035](https://github.com/rollup/rollup/pull/2035)) -* Optionally pass CLI commands to config file ([#1926](https://github.com/rollup/rollup/pull/1926)) -* Option to add correct `.toString` tags to namespaces ([#2041](https://github.com/rollup/rollup/pull/2041)) -* Option and scripts to display performance timings ([#2045](https://github.com/rollup/rollup/pull/2045)) -* Fixes for exported or early accessed namespaces + improved namespace indentation ([#2041](https://github.com/rollup/rollup/pull/2041)) -* Include missing TypeScript dependencies ([#1965](https://github.com/rollup/rollup/pull/1965)) -* Add #_PURE annotation to frozen namespaces ([#2044](https://github.com/rollup/rollup/pull/2044)) -* Improve sourcemap and tree-shaking performance ([#2052](https://github.com/rollup/rollup/pull/2052)) -* Inline sourcemap lookups and make rollup smaller ([#2055](https://github.com/rollup/rollup/pull/2055)) -* Use updated magic-string types ([#2057](https://github.com/rollup/rollup/pull/2057)) -* [BREAKING] Revert class id preservation from #2025 ([#2048](https://github.com/rollup/rollup/pull/2048)) -* [BREAKING] Refactor missing export plugin hook ([#1987](https://github.com/rollup/rollup/pull/1987)) + +_2018-03-15_ + +- Add option to preserve the module structure instead of bundling ([#1922](https://github.com/rollup/rollup/pull/1922)) +- Enable watch mode when code-splitting ([#2035](https://github.com/rollup/rollup/pull/2035)) +- Optionally pass CLI commands to config file ([#1926](https://github.com/rollup/rollup/pull/1926)) +- Option to add correct `.toString` tags to namespaces ([#2041](https://github.com/rollup/rollup/pull/2041)) +- Option and scripts to display performance timings ([#2045](https://github.com/rollup/rollup/pull/2045)) +- Fixes for exported or early accessed namespaces + improved namespace indentation ([#2041](https://github.com/rollup/rollup/pull/2041)) +- Include missing TypeScript dependencies ([#1965](https://github.com/rollup/rollup/pull/1965)) +- Add #\_PURE annotation to frozen namespaces ([#2044](https://github.com/rollup/rollup/pull/2044)) +- Improve sourcemap and tree-shaking performance ([#2052](https://github.com/rollup/rollup/pull/2052)) +- Inline sourcemap lookups and make rollup smaller ([#2055](https://github.com/rollup/rollup/pull/2055)) +- Use updated magic-string types ([#2057](https://github.com/rollup/rollup/pull/2057)) +- [BREAKING] Revert class id preservation from #2025 ([#2048](https://github.com/rollup/rollup/pull/2048)) +- [BREAKING] Refactor missing export plugin hook ([#1987](https://github.com/rollup/rollup/pull/1987)) ## 0.56.5 -*2018-03-07* -* Preserve ids when deconflicting classes ([#2025](https://github.com/rollup/rollup/pull/2025)) -* Fix an issue with re-exported namespace imports ([#2034](https://github.com/rollup/rollup/pull/2034)) -* Prevent an infinite loop when binding member expressions ([#1963](https://github.com/rollup/rollup/pull/1963)) -* Convert code style via prettier ([#2031](https://github.com/rollup/rollup/pull/2031)) -* Fix links in documentation ([#2026](https://github.com/rollup/rollup/pull/2026)) + +_2018-03-07_ + +- Preserve ids when deconflicting classes ([#2025](https://github.com/rollup/rollup/pull/2025)) +- Fix an issue with re-exported namespace imports ([#2034](https://github.com/rollup/rollup/pull/2034)) +- Prevent an infinite loop when binding member expressions ([#1963](https://github.com/rollup/rollup/pull/1963)) +- Convert code style via prettier ([#2031](https://github.com/rollup/rollup/pull/2031)) +- Fix links in documentation ([#2026](https://github.com/rollup/rollup/pull/2026)) ## 0.56.4 -*2018-03-05* -* Make rollup builds reproducible ([#2024](https://github.com/rollup/rollup/pull/2024)) -* Improve error handling for source maps ([#2012](https://github.com/rollup/rollup/pull/2012)) -* Properly handle SystemJS default exports without semicolons ([#2019](https://github.com/rollup/rollup/pull/2019)) -* Properly handle importing the same variable several times when code-splitting ([#2020](https://github.com/rollup/rollup/pull/2020)) -* Improve re-export tracing ([#2021](https://github.com/rollup/rollup/pull/2021)) -* Apply "prettier" on commit ([#2017](https://github.com/rollup/rollup/pull/2017)) -* Automatically clean up outdated tests ([#2009](https://github.com/rollup/rollup/pull/2009)) -* Add SystemJS output to form tests ([#2022](https://github.com/rollup/rollup/pull/2022)) -* Improve internal build configuration ([#2016](https://github.com/rollup/rollup/pull/2016)) + +_2018-03-05_ + +- Make rollup builds reproducible ([#2024](https://github.com/rollup/rollup/pull/2024)) +- Improve error handling for source maps ([#2012](https://github.com/rollup/rollup/pull/2012)) +- Properly handle SystemJS default exports without semicolons ([#2019](https://github.com/rollup/rollup/pull/2019)) +- Properly handle importing the same variable several times when code-splitting ([#2020](https://github.com/rollup/rollup/pull/2020)) +- Improve re-export tracing ([#2021](https://github.com/rollup/rollup/pull/2021)) +- Apply "prettier" on commit ([#2017](https://github.com/rollup/rollup/pull/2017)) +- Automatically clean up outdated tests ([#2009](https://github.com/rollup/rollup/pull/2009)) +- Add SystemJS output to form tests ([#2022](https://github.com/rollup/rollup/pull/2022)) +- Improve internal build configuration ([#2016](https://github.com/rollup/rollup/pull/2016)) ## 0.56.3 -*2018-02-25* -* Fix issues around default exports and module facades ([#2001](https://github.com/rollup/rollup/pull/2001)) -* Improve and fix internal chunk interface ([#1994](https://github.com/rollup/rollup/pull/1994)) -* Fix superfluous semicolons added after declarations ([#1999](https://github.com/rollup/rollup/pull/1999)) -* Improve code-splitting tests ([#1990](https://github.com/rollup/rollup/pull/1990)) + +_2018-02-25_ + +- Fix issues around default exports and module facades ([#2001](https://github.com/rollup/rollup/pull/2001)) +- Improve and fix internal chunk interface ([#1994](https://github.com/rollup/rollup/pull/1994)) +- Fix superfluous semicolons added after declarations ([#1999](https://github.com/rollup/rollup/pull/1999)) +- Improve code-splitting tests ([#1990](https://github.com/rollup/rollup/pull/1990)) ## 0.56.2 -*2018-02-19* -* Fix handling of reassigned default exports ([#1975](https://github.com/rollup/rollup/pull/1975)) -* Fix handling of renamed exports in entry points ([#1977](https://github.com/rollup/rollup/pull/1977)) -* Update internal TypeScript version ([#1980](https://github.com/rollup/rollup/pull/1980)) -* Omit compiled source files from published types ([#1981](https://github.com/rollup/rollup/pull/1981)) -* Fix example in readme file ([#1984](https://github.com/rollup/rollup/pull/1984)) -* Fix non-replaced dynamic imports in non-ESM output ([#1985](https://github.com/rollup/rollup/pull/1985)) + +_2018-02-19_ + +- Fix handling of reassigned default exports ([#1975](https://github.com/rollup/rollup/pull/1975)) +- Fix handling of renamed exports in entry points ([#1977](https://github.com/rollup/rollup/pull/1977)) +- Update internal TypeScript version ([#1980](https://github.com/rollup/rollup/pull/1980)) +- Omit compiled source files from published types ([#1981](https://github.com/rollup/rollup/pull/1981)) +- Fix example in readme file ([#1984](https://github.com/rollup/rollup/pull/1984)) +- Fix non-replaced dynamic imports in non-ESM output ([#1985](https://github.com/rollup/rollup/pull/1985)) ## 0.56.1 -*2018-02-16* -* Fix regression when rendering switch statements ([#1971](https://github.com/rollup/rollup/pull/1971)) + +_2018-02-16_ + +- Fix regression when rendering switch statements ([#1971](https://github.com/rollup/rollup/pull/1971)) ## 0.56.0 -*2018-02-15* -* Update to ECMAScript 2018 ([#1953](https://github.com/rollup/rollup/pull/1953)) -* Rework tree-shaking rendering algorithm ([#1949](https://github.com/rollup/rollup/pull/1949)) -* Tree-shake pure prototype calls on literals ([#1916](https://github.com/rollup/rollup/pull/1916)) -* Expose AST parser to plugins ([#1945](https://github.com/rollup/rollup/pull/1945)) -* Fix namespace re-export deconflicting ([#1960](https://github.com/rollup/rollup/pull/1960)) -* Allow globals to be re-exported ([#1959](https://github.com/rollup/rollup/pull/1959)) -* Fix internal performance timers ([#1966](https://github.com/rollup/rollup/pull/1966)) + +_2018-02-15_ + +- Update to ECMAScript 2018 ([#1953](https://github.com/rollup/rollup/pull/1953)) +- Rework tree-shaking rendering algorithm ([#1949](https://github.com/rollup/rollup/pull/1949)) +- Tree-shake pure prototype calls on literals ([#1916](https://github.com/rollup/rollup/pull/1916)) +- Expose AST parser to plugins ([#1945](https://github.com/rollup/rollup/pull/1945)) +- Fix namespace re-export deconflicting ([#1960](https://github.com/rollup/rollup/pull/1960)) +- Allow globals to be re-exported ([#1959](https://github.com/rollup/rollup/pull/1959)) +- Fix internal performance timers ([#1966](https://github.com/rollup/rollup/pull/1966)) ## 0.55.5 -*2018-02-10* -* Remove OpenCollective dependency ([#1915](https://github.com/rollup/rollup/pull/1915)) + +_2018-02-10_ + +- Remove OpenCollective dependency ([#1915](https://github.com/rollup/rollup/pull/1915)) ## 0.55.4 -*2018-02-09* -* Improve name deconflicting of external variables ([#1930](https://github.com/rollup/rollup/pull/1930)) -* Improve re-export handling ([#1947](https://github.com/rollup/rollup/pull/1947)) -* Mark preserveSymlinks option as optional ([#1939](https://github.com/rollup/rollup/pull/1939)) -* Enable code-splitting tests to check directory structures ([#1924](https://github.com/rollup/rollup/pull/1924)) -* Improve TypeScript definition test ([#1954](https://github.com/rollup/rollup/pull/1954)) + +_2018-02-09_ + +- Improve name deconflicting of external variables ([#1930](https://github.com/rollup/rollup/pull/1930)) +- Improve re-export handling ([#1947](https://github.com/rollup/rollup/pull/1947)) +- Mark preserveSymlinks option as optional ([#1939](https://github.com/rollup/rollup/pull/1939)) +- Enable code-splitting tests to check directory structures ([#1924](https://github.com/rollup/rollup/pull/1924)) +- Improve TypeScript definition test ([#1954](https://github.com/rollup/rollup/pull/1954)) ## 0.55.3 -*2018-02-01* -* Remove OpenCollective dependency ([#1915](https://github.com/rollup/rollup/pull/1915)) + +_2018-02-01_ + +- Remove OpenCollective dependency ([#1915](https://github.com/rollup/rollup/pull/1915)) ## 0.55.2 -*2018-02-01* -* Add option to not follow symlinks ([#1819](https://github.com/rollup/rollup/pull/1819)) -* Fix crash in windows shell ([#1928](https://github.com/rollup/rollup/pull/1928)) -* Fix and test for external TypeScript errors ([#1903](https://github.com/rollup/rollup/pull/1903)) -* Activate OpenCollective ([#1915](https://github.com/rollup/rollup/pull/1915)) -* Optimize CI scripts ([#1921](https://github.com/rollup/rollup/pull/1921)) + +_2018-02-01_ + +- Add option to not follow symlinks ([#1819](https://github.com/rollup/rollup/pull/1819)) +- Fix crash in windows shell ([#1928](https://github.com/rollup/rollup/pull/1928)) +- Fix and test for external TypeScript errors ([#1903](https://github.com/rollup/rollup/pull/1903)) +- Activate OpenCollective ([#1915](https://github.com/rollup/rollup/pull/1915)) +- Optimize CI scripts ([#1921](https://github.com/rollup/rollup/pull/1921)) ## 0.55.1 -*2018-01-26* -* Improve dynamic import workflow ([#1907](https://github.com/rollup/rollup/pull/1907)) -* Properly handle multiple dynamic imports of the same module ([#1911](https://github.com/rollup/rollup/pull/1911)) -* Fix import specifier deshadowing ([#1912](https://github.com/rollup/rollup/pull/1912)) -* Allow plugin load hook to return an empty string ([#1908](https://github.com/rollup/rollup/pull/1908)) -* Let onwarn handler accept strings ([#1905](https://github.com/rollup/rollup/pull/1905)) + +_2018-01-26_ + +- Improve dynamic import workflow ([#1907](https://github.com/rollup/rollup/pull/1907)) +- Properly handle multiple dynamic imports of the same module ([#1911](https://github.com/rollup/rollup/pull/1911)) +- Fix import specifier deshadowing ([#1912](https://github.com/rollup/rollup/pull/1912)) +- Allow plugin load hook to return an empty string ([#1908](https://github.com/rollup/rollup/pull/1908)) +- Let onwarn handler accept strings ([#1905](https://github.com/rollup/rollup/pull/1905)) ## 0.55.0 -*2018-01-23* -* Support code splitting ([#1841](https://github.com/rollup/rollup/pull/1841)) -* Support SystemJS as output format ([#1897](https://github.com/rollup/rollup/pull/1897)) -* Allow injecting acorn plugins ([#1857](https://github.com/rollup/rollup/pull/1857)) -* Add `missingExport` plugin hook ([#1845](https://github.com/rollup/rollup/pull/1845)) -* No longer parse config files via bublé ([#1899](https://github.com/rollup/rollup/pull/1899)) -* Use externally maintained dynamic import acorn plugin ([#1891](https://github.com/rollup/rollup/pull/1891)) -* Fix an error message ([#1886](https://github.com/rollup/rollup/pull/1886)) -* Refactor internal rendering options ([#1900](https://github.com/rollup/rollup/pull/1900)) -* Extract internal path resolution ([#1879](https://github.com/rollup/rollup/pull/1879)) -* Extract internal bundle option handling ([#1880](https://github.com/rollup/rollup/pull/1880)) -* Add import description type ([#1884](https://github.com/rollup/rollup/pull/1884)) -* Clean up watch options types ([#1860](https://github.com/rollup/rollup/pull/1860)) -* Clean up some tests ([#1888](https://github.com/rollup/rollup/pull/1888)) + +_2018-01-23_ + +- Support code splitting ([#1841](https://github.com/rollup/rollup/pull/1841)) +- Support SystemJS as output format ([#1897](https://github.com/rollup/rollup/pull/1897)) +- Allow injecting acorn plugins ([#1857](https://github.com/rollup/rollup/pull/1857)) +- Add `missingExport` plugin hook ([#1845](https://github.com/rollup/rollup/pull/1845)) +- No longer parse config files via bublé ([#1899](https://github.com/rollup/rollup/pull/1899)) +- Use externally maintained dynamic import acorn plugin ([#1891](https://github.com/rollup/rollup/pull/1891)) +- Fix an error message ([#1886](https://github.com/rollup/rollup/pull/1886)) +- Refactor internal rendering options ([#1900](https://github.com/rollup/rollup/pull/1900)) +- Extract internal path resolution ([#1879](https://github.com/rollup/rollup/pull/1879)) +- Extract internal bundle option handling ([#1880](https://github.com/rollup/rollup/pull/1880)) +- Add import description type ([#1884](https://github.com/rollup/rollup/pull/1884)) +- Clean up watch options types ([#1860](https://github.com/rollup/rollup/pull/1860)) +- Clean up some tests ([#1888](https://github.com/rollup/rollup/pull/1888)) ## 0.54.1 -*2018-01-17* -* Fix TypeScript errors in emitted type definitions ([#1871](https://github.com/rollup/rollup/pull/1871)) + +_2018-01-17_ + +- Fix TypeScript errors in emitted type definitions ([#1871](https://github.com/rollup/rollup/pull/1871)) ## 0.54.0 -*2018-01-12* -* Automatically inline locally resolvable dynamic imports ([#1816](https://github.com/rollup/rollup/pull/1816)) -* Preserve directives in function bodies ([#1856](https://github.com/rollup/rollup/pull/1856)) -* Refactor an error notification ([#1846](https://github.com/rollup/rollup/pull/1846)) -* Refactor a wrong import ([#1863](https://github.com/rollup/rollup/pull/1863)) -* Improve emitted TypeScript definitions ([#1864](https://github.com/rollup/rollup/pull/1864)) -* Refactor unused import ([#1866](https://github.com/rollup/rollup/pull/1866)) + +_2018-01-12_ + +- Automatically inline locally resolvable dynamic imports ([#1816](https://github.com/rollup/rollup/pull/1816)) +- Preserve directives in function bodies ([#1856](https://github.com/rollup/rollup/pull/1856)) +- Refactor an error notification ([#1846](https://github.com/rollup/rollup/pull/1846)) +- Refactor a wrong import ([#1863](https://github.com/rollup/rollup/pull/1863)) +- Improve emitted TypeScript definitions ([#1864](https://github.com/rollup/rollup/pull/1864)) +- Refactor unused import ([#1866](https://github.com/rollup/rollup/pull/1866)) ## 0.53.4 -*2018-01-10* -* More type cleanup ([#1858](https://github.com/rollup/rollup/pull/1858)) -* Use chalks internal helper to detect if colors should be used ([#1853](https://github.com/rollup/rollup/pull/1853)) -* Refactor entity handling to use interfaces ([#1840](https://github.com/rollup/rollup/pull/1840)) -* Use immutable.js internal types ([#1844](https://github.com/rollup/rollup/pull/1844)) -* Ship `TypeScript` declaration files ([#1837](https://github.com/rollup/rollup/pull/1837)) + +_2018-01-10_ + +- More type cleanup ([#1858](https://github.com/rollup/rollup/pull/1858)) +- Use chalks internal helper to detect if colors should be used ([#1853](https://github.com/rollup/rollup/pull/1853)) +- Refactor entity handling to use interfaces ([#1840](https://github.com/rollup/rollup/pull/1840)) +- Use immutable.js internal types ([#1844](https://github.com/rollup/rollup/pull/1844)) +- Ship `TypeScript` declaration files ([#1837](https://github.com/rollup/rollup/pull/1837)) ## 0.53.3 -*2018-01-02* -* Use correct name when re-exporting from external modules ([#1794](https://github.com/rollup/rollup/pull/1794)) -* Disable warnings when `resolveId` returns false ([#1825](https://github.com/rollup/rollup/pull/1825)) + +_2018-01-02_ + +- Use correct name when re-exporting from external modules ([#1794](https://github.com/rollup/rollup/pull/1794)) +- Disable warnings when `resolveId` returns false ([#1825](https://github.com/rollup/rollup/pull/1825)) ## 0.53.2 -*2017-12-30* -* Properly handle output arrays in the JavaScript API ([#1827](https://github.com/rollup/rollup/pull/1827)) + +_2017-12-30_ + +- Properly handle output arrays in the JavaScript API ([#1827](https://github.com/rollup/rollup/pull/1827)) ## 0.53.1 -*2017-12-28* -* Properly deprecate more config options ([#1812](https://github.com/rollup/rollup/pull/1812)) -* Pass output options to `transformBundle` plugin hook ([#1813](https://github.com/rollup/rollup/pull/1813)) + +_2017-12-28_ + +- Properly deprecate more config options ([#1812](https://github.com/rollup/rollup/pull/1812)) +- Pass output options to `transformBundle` plugin hook ([#1813](https://github.com/rollup/rollup/pull/1813)) ## 0.53.0 -*2017-12-22* -* Experimental dynamic import support ([#1790](https://github.com/rollup/rollup/pull/1790)) -* Unify config validation ([#1805](https://github.com/rollup/rollup/pull/1805)) + +_2017-12-22_ + +- Experimental dynamic import support ([#1790](https://github.com/rollup/rollup/pull/1790)) +- Unify config validation ([#1805](https://github.com/rollup/rollup/pull/1805)) ## 0.52.3 -*2017-12-19* -* Properly hoist default exported functions in more situations ([#1799](https://github.com/rollup/rollup/pull/1799)) -* Allow plugin transformations to not overwrite source maps by returning null ([#1797](https://github.com/rollup/rollup/pull/1797)) -* Provide more parameters to "external" handler ([#1792](https://github.com/rollup/rollup/pull/1792)) + +_2017-12-19_ + +- Properly hoist default exported functions in more situations ([#1799](https://github.com/rollup/rollup/pull/1799)) +- Allow plugin transformations to not overwrite source maps by returning null ([#1797](https://github.com/rollup/rollup/pull/1797)) +- Provide more parameters to "external" handler ([#1792](https://github.com/rollup/rollup/pull/1792)) ## 0.52.2 -*2017-12-15* -* No longer ignore side-effects in JSON.parse and JSON.stringify ([#1785](https://github.com/rollup/rollup/pull/1785)) -* Updated links in warnings ([#1776](https://github.com/rollup/rollup/pull/1776)) -* No longer prevent self-imports ([#1777](https://github.com/rollup/rollup/pull/1777)) -* Properly hoist default exported functions ([#1787](https://github.com/rollup/rollup/pull/1787)) -* Prevent corruption when re-exporting default exports ([#1765](https://github.com/rollup/rollup/pull/1765)) + +_2017-12-15_ + +- No longer ignore side-effects in JSON.parse and JSON.stringify ([#1785](https://github.com/rollup/rollup/pull/1785)) +- Updated links in warnings ([#1776](https://github.com/rollup/rollup/pull/1776)) +- No longer prevent self-imports ([#1777](https://github.com/rollup/rollup/pull/1777)) +- Properly hoist default exported functions ([#1787](https://github.com/rollup/rollup/pull/1787)) +- Prevent corruption when re-exporting default exports ([#1765](https://github.com/rollup/rollup/pull/1765)) ## 0.52.1 -*2017-12-05* -* Improve deprecation warnings ([#1765](https://github.com/rollup/rollup/pull/1765)) -* Properly use stdin ([#1774](https://github.com/rollup/rollup/pull/1774)) -* Let --environment be used multiple times ([#1768](https://github.com/rollup/rollup/pull/1768)) -* Always transpile config files ([#1759](https://github.com/rollup/rollup/pull/1759)) -* Respect globals option in headers of UMD and IIFE files ([#1747](https://github.com/rollup/rollup/pull/1747)) + +_2017-12-05_ + +- Improve deprecation warnings ([#1765](https://github.com/rollup/rollup/pull/1765)) +- Properly use stdin ([#1774](https://github.com/rollup/rollup/pull/1774)) +- Let --environment be used multiple times ([#1768](https://github.com/rollup/rollup/pull/1768)) +- Always transpile config files ([#1759](https://github.com/rollup/rollup/pull/1759)) +- Respect globals option in headers of UMD and IIFE files ([#1747](https://github.com/rollup/rollup/pull/1747)) ## 0.52.0 -*2017-11-25* -* Accept config as promise ([#1731](https://github.com/rollup/rollup/pull/1731)) -* Accept promises for intro/outro/banner/footer ([#1253](https://github.com/rollup/rollup/pull/1253)) -* Option to prevent freezing of namespace imports ([#1696](https://github.com/rollup/rollup/pull/1696)) -* Option to retain all output in watch mode ([#1688](https://github.com/rollup/rollup/pull/1688)) -* Options to fine-tune treeshaking ([#1760](https://github.com/rollup/rollup/pull/1760)) + +_2017-11-25_ + +- Accept config as promise ([#1731](https://github.com/rollup/rollup/pull/1731)) +- Accept promises for intro/outro/banner/footer ([#1253](https://github.com/rollup/rollup/pull/1253)) +- Option to prevent freezing of namespace imports ([#1696](https://github.com/rollup/rollup/pull/1696)) +- Option to retain all output in watch mode ([#1688](https://github.com/rollup/rollup/pull/1688)) +- Options to fine-tune treeshaking ([#1760](https://github.com/rollup/rollup/pull/1760)) ## 0.51.8 -*2017-11-19* -* Fix speed problems by simplifying treeshaking reassignment handling ([#1740](https://github.com/rollup/rollup/pull/1740)) -* Update dependencies ([#1742](https://github.com/rollup/rollup/pull/1742)) + +_2017-11-19_ + +- Fix speed problems by simplifying treeshaking reassignment handling ([#1740](https://github.com/rollup/rollup/pull/1740)) +- Update dependencies ([#1742](https://github.com/rollup/rollup/pull/1742)) ## 0.51.7 -*2017-11-17* -* Keep "this"-context when calling sequence expressions ([#1724](https://github.com/rollup/rollup/pull/1724)) + +_2017-11-17_ + +- Keep "this"-context when calling sequence expressions ([#1724](https://github.com/rollup/rollup/pull/1724)) ## 0.51.6 -*2017-11-16* -* Use sourcemaps to determine error locations ([#1728](https://github.com/rollup/rollup/pull/1728)) + +_2017-11-16_ + +- Use sourcemaps to determine error locations ([#1728](https://github.com/rollup/rollup/pull/1728)) ## 0.51.5 -*2017-11-11* -* Fix regressions with uninitialised conditional expressions ([#1720](https://github.com/rollup/rollup/pull/1720)) + +_2017-11-11_ + +- Fix regressions with uninitialised conditional expressions ([#1720](https://github.com/rollup/rollup/pull/1720)) ## 0.51.4 -*2017-11-11* -* Fix regressions preventing builds ([#1725](https://github.com/rollup/rollup/pull/1725)) + +_2017-11-11_ + +- Fix regressions preventing builds ([#1725](https://github.com/rollup/rollup/pull/1725)) ## 0.51.3 -*2017-11-10* -* Fix regression when treeshaking sequence expressions ([#1717](https://github.com/rollup/rollup/pull/1717)) + +_2017-11-10_ + +- Fix regression when treeshaking sequence expressions ([#1717](https://github.com/rollup/rollup/pull/1717)) ## 0.51.2 -*2017-11-09* -* Fix treeshaking regression when labels are used inside functions ([#1712](https://github.com/rollup/rollup/pull/1712)) + +_2017-11-09_ + +- Fix treeshaking regression when labels are used inside functions ([#1712](https://github.com/rollup/rollup/pull/1712)) ## 0.51.1 -*2017-11-08* -* Fix an issue with empty return statements ([#1704](https://github.com/rollup/rollup/pull/1704)) + +_2017-11-08_ + +- Fix an issue with empty return statements ([#1704](https://github.com/rollup/rollup/pull/1704)) ## 0.51.0 -*2017-11-08* -* Massive improvements to the treeshaking algorithm ([#1667](https://github.com/rollup/rollup/pull/1667)) + +_2017-11-08_ + +- Massive improvements to the treeshaking algorithm ([#1667](https://github.com/rollup/rollup/pull/1667)) ## 0.50.1 -*2017-11-08* -* Fix treeshaking regression ([#1695](https://github.com/rollup/rollup/pull/1695)) -* Treeshaking improvements ([#1650](https://github.com/rollup/rollup/pull/1650)) -* Enable installation from Github ([#1670](https://github.com/rollup/rollup/pull/1670)) -* Update documentation ([#1660](https://github.com/rollup/rollup/pull/1660)) + +_2017-11-08_ + +- Fix treeshaking regression ([#1695](https://github.com/rollup/rollup/pull/1695)) +- Treeshaking improvements ([#1650](https://github.com/rollup/rollup/pull/1650)) +- Enable installation from Github ([#1670](https://github.com/rollup/rollup/pull/1670)) +- Update documentation ([#1660](https://github.com/rollup/rollup/pull/1660)) ## 0.50.0 -*2017-09-16* -* Many treeshaking improvements ([#1624](https://github.com/rollup/rollup/pull/1624)) -* Show finish time in watch mode ([#1620](https://github.com/rollup/rollup/pull/1620)) + +_2017-09-16_ + +- Many treeshaking improvements ([#1624](https://github.com/rollup/rollup/pull/1624)) +- Show finish time in watch mode ([#1620](https://github.com/rollup/rollup/pull/1620)) ## 0.49.3 -*2017-09-08* -* Respect `watch` options ([#1596](https://github.com/rollup/rollup/issues/1596)) -* Fix treeshaking regressions ([#1604](https://github.com/rollup/rollup/pull/1604)) -* Allow `-o` to work with `output.format` ([#1606](https://github.com/rollup/rollup/pull/1606)) + +_2017-09-08_ + +- Respect `watch` options ([#1596](https://github.com/rollup/rollup/issues/1596)) +- Fix treeshaking regressions ([#1604](https://github.com/rollup/rollup/pull/1604)) +- Allow `-o` to work with `output.format` ([#1606](https://github.com/rollup/rollup/pull/1606)) ## 0.49.2 -*2017-08-29* -* Fix treeshaking regressions ([#1591](https://github.com/rollup/rollup/pull/1591)) + +_2017-08-29_ + +- Fix treeshaking regressions ([#1591](https://github.com/rollup/rollup/pull/1591)) ## 0.49.1 -*2017-08-28* -* Fix treeshaking regressions ([#1586](https://github.com/rollup/rollup/pull/1586)) + +_2017-08-28_ + +- Fix treeshaking regressions ([#1586](https://github.com/rollup/rollup/pull/1586)) ## 0.49.0 -*2017-08-27* -* Completely update the treeshaking algorithm ([#1582](https://github.com/rollup/rollup/pull/1582)) -* Only flip screen buffer if appropriate ([#1574](https://github.com/rollup/rollup/pull/1574)) -* Guard against two instances creating the same dir ([#1576](https://github.com/rollup/rollup/pull/1576)) + +_2017-08-27_ + +- Completely update the treeshaking algorithm ([#1582](https://github.com/rollup/rollup/pull/1582)) +- Only flip screen buffer if appropriate ([#1574](https://github.com/rollup/rollup/pull/1574)) +- Guard against two instances creating the same dir ([#1576](https://github.com/rollup/rollup/pull/1576)) ## 0.48.2 -* Paths is an output option ([#1569](https://github.com/rollup/rollup/pull/1569)) +- Paths is an output option ([#1569](https://github.com/rollup/rollup/pull/1569)) ## 0.48.1 -* Print deprecation warnings in watch mode, and fix options when watcher restarts ([#1568](https://github.com/rollup/rollup/pull/1568)) +- Print deprecation warnings in watch mode, and fix options when watcher restarts ([#1568](https://github.com/rollup/rollup/pull/1568)) ## 0.48.0 -* Numerous changes to the `options` object and CLI arguments ([#1479](https://github.com/rollup/rollup/issues/1479)). See [this gist](https://gist.github.com/Rich-Harris/d472c50732dab03efeb37472b08a3f32) for a rundown. +- Numerous changes to the `options` object and CLI arguments ([#1479](https://github.com/rollup/rollup/issues/1479)). See [this gist](https://gist.github.com/Rich-Harris/d472c50732dab03efeb37472b08a3f32) for a rundown. ## 0.47.6 -* Set `process.env.ROLLUP_WATCH` *before* loading config file +- Set `process.env.ROLLUP_WATCH` _before_ loading config file ## 0.47.5 -* Fix broken multi-bundle configs with `rollup.watch` ([#1532](https://github.com/rollup/rollup/issues/1532)) +- Fix broken multi-bundle configs with `rollup.watch` ([#1532](https://github.com/rollup/rollup/issues/1532)) ## 0.47.4 -* Delete cached config file before reloading in watch mode +- Delete cached config file before reloading in watch mode ## 0.47.3 -* Deshadow aliased imports ([#1550](https://github.com/rollup/rollup/issues/1550)) +- Deshadow aliased imports ([#1550](https://github.com/rollup/rollup/issues/1550)) ## 0.47.2 -* Rebuild with dependency that npm randomly deleted +- Rebuild with dependency that npm randomly deleted ## 0.47.1 -* Ignore external namespace imports when deshadowing ([#1547](https://github.com/rollup/rollup/issues/1547)) +- Ignore external namespace imports when deshadowing ([#1547](https://github.com/rollup/rollup/issues/1547)) ## 0.47.0 -* Watch config file, restart `rollup.watch` on change ([#1535](https://github.com/rollup/rollup/issues/1535)) -* Correctly render `export { foo } from` declarations in `es` output ([#1543](https://github.com/rollup/rollup/pull/1543)) -* Reinstate missing `rollup.VERSION` +- Watch config file, restart `rollup.watch` on change ([#1535](https://github.com/rollup/rollup/issues/1535)) +- Correctly render `export { foo } from` declarations in `es` output ([#1543](https://github.com/rollup/rollup/pull/1543)) +- Reinstate missing `rollup.VERSION` ## 0.46.3 -* init for/for-of loop section head with correct scopes ([#1538](https://github.com/rollup/rollup/issues/1538), [#1539](https://github.com/rollup/rollup/issues/1539)) -* Fix namespace imports and re-exports in `es` output ([#1511](https://github.com/rollup/rollup/issues/1511)) -* Deshadow indirectly imported namespaces ([#1488](https://github.com/rollup/rollup/issues/1488), [#1505](https://github.com/rollup/rollup/issues/1505)) +- init for/for-of loop section head with correct scopes ([#1538](https://github.com/rollup/rollup/issues/1538), [#1539](https://github.com/rollup/rollup/issues/1539)) +- Fix namespace imports and re-exports in `es` output ([#1511](https://github.com/rollup/rollup/issues/1511)) +- Deshadow indirectly imported namespaces ([#1488](https://github.com/rollup/rollup/issues/1488), [#1505](https://github.com/rollup/rollup/issues/1505)) ## 0.46.2 -* Pass options to `bundle.write` correctly in `rollup.watch` ([#1533](https://github.com/rollup/rollup/issues/1533)) -* init for-in loop section head with correct scopes ([#1480](https://github.com/rollup/rollup/issues/1480)) -* support `--no-interop` flag ([#1524](https://github.com/rollup/rollup/issues/1524)) +- Pass options to `bundle.write` correctly in `rollup.watch` ([#1533](https://github.com/rollup/rollup/issues/1533)) +- init for-in loop section head with correct scopes ([#1480](https://github.com/rollup/rollup/issues/1480)) +- support `--no-interop` flag ([#1524](https://github.com/rollup/rollup/issues/1524)) ## 0.46.1 -* Remove `rollup.watch` from browser build ([#1530](https://github.com/rollup/rollup/issues/1530)) -* Remove `source-map-support` dependency ([#1528](https://github.com/rollup/rollup/issues/1528)) +- Remove `rollup.watch` from browser build ([#1530](https://github.com/rollup/rollup/issues/1530)) +- Remove `source-map-support` dependency ([#1528](https://github.com/rollup/rollup/issues/1528)) ## 0.46.0 -* `options.format` is now required ([#1491](https://github.com/rollup/rollup/pull/1491)) -* if `options.format` is `es6`, it will now throw an error (should be `es`) ([#1491](https://github.com/rollup/rollup/pull/1491)) -* Add experimental `rollup.watch` method, replacing [rollup-watch](https://github.com/rollup/rollup-watch) ([#1491](https://github.com/rollup/rollup/pull/1491)) -* Batch warnings together in CLI output ([#1491](https://github.com/rollup/rollup/pull/1491)) -* Clear screen between rebuilds in `--watch` mode ([#1491](https://github.com/rollup/rollup/pull/1491)) -* `onwarn` function's second argument is the default handler, allowing easier filtering without reimplementing any logic ([#1491](https://github.com/rollup/rollup/pull/1491)) -* Prevent semi-colon removal after variable declaration that is for loop body ([#1275](https://github.com/rollup/rollup/issues/1275)) -* Return `exports` for namespaced but non-extended IIFE bundles ([#1492](https://github.com/rollup/rollup/issues/1492)) -* Fix scoping in switch statements ([#1498](https://github.com/rollup/rollup/pull/1498)) -* Handle side-effects in tagged template expressions ([#1508](https://github.com/rollup/rollup/pull/1508)) -* More descriptive error for missing options.format ([#1510](https://github.com/rollup/rollup/pull/1510)) -* Refactor scope handling ([#1517](https://github.com/rollup/rollup/pull/1517)) -* Handle failure of a config in multi-config build ([#1513](https://github.com/rollup/rollup/issues/1513)) - +- `options.format` is now required ([#1491](https://github.com/rollup/rollup/pull/1491)) +- if `options.format` is `es6`, it will now throw an error (should be `es`) ([#1491](https://github.com/rollup/rollup/pull/1491)) +- Add experimental `rollup.watch` method, replacing [rollup-watch](https://github.com/rollup/rollup-watch) ([#1491](https://github.com/rollup/rollup/pull/1491)) +- Batch warnings together in CLI output ([#1491](https://github.com/rollup/rollup/pull/1491)) +- Clear screen between rebuilds in `--watch` mode ([#1491](https://github.com/rollup/rollup/pull/1491)) +- `onwarn` function's second argument is the default handler, allowing easier filtering without reimplementing any logic ([#1491](https://github.com/rollup/rollup/pull/1491)) +- Prevent semi-colon removal after variable declaration that is for loop body ([#1275](https://github.com/rollup/rollup/issues/1275)) +- Return `exports` for namespaced but non-extended IIFE bundles ([#1492](https://github.com/rollup/rollup/issues/1492)) +- Fix scoping in switch statements ([#1498](https://github.com/rollup/rollup/pull/1498)) +- Handle side-effects in tagged template expressions ([#1508](https://github.com/rollup/rollup/pull/1508)) +- More descriptive error for missing options.format ([#1510](https://github.com/rollup/rollup/pull/1510)) +- Refactor scope handling ([#1517](https://github.com/rollup/rollup/pull/1517)) +- Handle failure of a config in multi-config build ([#1513](https://github.com/rollup/rollup/issues/1513)) ## 0.45.2 -* Fix interop when import is a string ([#1486](https://github.com/rollup/rollup/issues/1486)) -* Separate `resolvedIds` from `resolvedExternalIds` ([#1490](https://github.com/rollup/rollup/pull/1490)) -* Add `--extend` flag to CLI ([#1482](https://github.com/rollup/rollup/pull/1482)) +- Fix interop when import is a string ([#1486](https://github.com/rollup/rollup/issues/1486)) +- Separate `resolvedIds` from `resolvedExternalIds` ([#1490](https://github.com/rollup/rollup/pull/1490)) +- Add `--extend` flag to CLI ([#1482](https://github.com/rollup/rollup/pull/1482)) ## 0.45.1 -* Remove `weak` from `optionalDependencies` ([#1483](https://github.com/rollup/rollup/issues/1483)) +- Remove `weak` from `optionalDependencies` ([#1483](https://github.com/rollup/rollup/issues/1483)) ## 0.45.0 -* [BREAKING] `bundle.generate(...)` returns a Promise, so that `transformBundle` plugin hooks can be asynchronous ([#1474](https://github.com/rollup/rollup/issues/1474)) +- [BREAKING] `bundle.generate(...)` returns a Promise, so that `transformBundle` plugin hooks can be asynchronous ([#1474](https://github.com/rollup/rollup/issues/1474)) ## 0.44.0 -* [BREAKING] Don't extend existing globals, unless `options.extend` is true ([#827](https://github.com/rollup/rollup/issues/827)) -* Fix handling of catch clause parameters ([#1462](https://github.com/rollup/rollup/issues/1462)) +- [BREAKING] Don't extend existing globals, unless `options.extend` is true ([#827](https://github.com/rollup/rollup/issues/827)) +- Fix handling of catch clause parameters ([#1462](https://github.com/rollup/rollup/issues/1462)) ## 0.43.1 -* Fix memory leak on incremental rebuilds ([#883](https://github.com/rollup/rollup/issues/883)) -* Allow `this.warn` and `this.error` to accept a `{line, column}` object as an alternative to a character index ([#1265](https://github.com/rollup/rollup/issues/1265)) -* Print more useful error if entry module is 'external' ([#1264](https://github.com/rollup/rollup/issues/1264)) -* Catch errors in `bundle.generate` options ([#1463](https://github.com/rollup/rollup/pull/1463)) -* Fix magic-string deprecation warning ([#1445](https://github.com/rollup/rollup/pull/1445)) +- Fix memory leak on incremental rebuilds ([#883](https://github.com/rollup/rollup/issues/883)) +- Allow `this.warn` and `this.error` to accept a `{line, column}` object as an alternative to a character index ([#1265](https://github.com/rollup/rollup/issues/1265)) +- Print more useful error if entry module is 'external' ([#1264](https://github.com/rollup/rollup/issues/1264)) +- Catch errors in `bundle.generate` options ([#1463](https://github.com/rollup/rollup/pull/1463)) +- Fix magic-string deprecation warning ([#1445](https://github.com/rollup/rollup/pull/1445)) ## 0.43.0 -* Allow config files to import JSON ([#1426](https://github.com/rollup/rollup/issues/1426)) -* Allow undefined imports in interop block ([#1341](https://github.com/rollup/rollup/issues/1341)) -* Add `process.env.ROLLUP_WATCH = 'true'` in watch mode ([#1429](https://github.com/rollup/rollup/issues/1429)) -* Add `pureExternalModules` option ([#1352](https://github.com/rollup/rollup/issues/1352)) -* Allow plugins to specify `options.entry` ([#1270](https://github.com/rollup/rollup/issues/1270)) -* Update dependencies +- Allow config files to import JSON ([#1426](https://github.com/rollup/rollup/issues/1426)) +- Allow undefined imports in interop block ([#1341](https://github.com/rollup/rollup/issues/1341)) +- Add `process.env.ROLLUP_WATCH = 'true'` in watch mode ([#1429](https://github.com/rollup/rollup/issues/1429)) +- Add `pureExternalModules` option ([#1352](https://github.com/rollup/rollup/issues/1352)) +- Allow plugins to specify `options.entry` ([#1270](https://github.com/rollup/rollup/issues/1270)) +- Update dependencies ## 0.42.0 -* Deprecate `options.moduleId` in favour of `options.amd.id` ([#1365](https://github.com/rollup/rollup/pull/1365)) -* Add `options.amd.define` option to specify name of AMD `define` function ([#1365](https://github.com/rollup/rollup/pull/1365)) -* Fix incorrect class removal with `treeshake: false` ([#1375](https://github.com/rollup/rollup/pull/1375)) -* Deconflict module exports imported as namespaces ([#1384](https://github.com/rollup/rollup/issues/1384)) -* Handle bare self-imports ([#1274](https://github.com/rollup/rollup/issues/1274)) -* Allow config file to export an array of multiple configs ([#1389](https://github.com/rollup/rollup/pull/1389)) -* Handle exponentiation operator, and fail gracefully on unknown operators ([#1416](https://github.com/rollup/rollup/issues/1416)) -* Add `watch` option ([#1424](https://github.com/rollup/rollup/pull/1424)) +- Deprecate `options.moduleId` in favour of `options.amd.id` ([#1365](https://github.com/rollup/rollup/pull/1365)) +- Add `options.amd.define` option to specify name of AMD `define` function ([#1365](https://github.com/rollup/rollup/pull/1365)) +- Fix incorrect class removal with `treeshake: false` ([#1375](https://github.com/rollup/rollup/pull/1375)) +- Deconflict module exports imported as namespaces ([#1384](https://github.com/rollup/rollup/issues/1384)) +- Handle bare self-imports ([#1274](https://github.com/rollup/rollup/issues/1274)) +- Allow config file to export an array of multiple configs ([#1389](https://github.com/rollup/rollup/pull/1389)) +- Handle exponentiation operator, and fail gracefully on unknown operators ([#1416](https://github.com/rollup/rollup/issues/1416)) +- Add `watch` option ([#1424](https://github.com/rollup/rollup/pull/1424)) ## 0.41.6 -* Preserve `originalSourceMap` on incremental rebuilds for loaders with sourcemaps ([#1336](https://github.com/rollup/rollup/issues/1336)) +- Preserve `originalSourceMap` on incremental rebuilds for loaders with sourcemaps ([#1336](https://github.com/rollup/rollup/issues/1336)) ## 0.41.5 -* Wrap ternary consequent/alternate sequences in parens ([#1273](https://github.com/rollup/rollup/issues/1273)) -* Fix erroneous warning on multiple `export * from` declarations with defaults ([#1278](https://github.com/rollup/rollup/issues/1278)) -* Prevent variable conflicts with `treeshake: false` ([#1268](https://github.com/rollup/rollup/issues/1268)) -* Allow missing `source` when collapsing sourcemaps ([#1254](https://github.com/rollup/rollup/issues/1254)) -* Allow plugins to log with strings ([#1316](https://github.com/rollup/rollup/pull/1316)) +- Wrap ternary consequent/alternate sequences in parens ([#1273](https://github.com/rollup/rollup/issues/1273)) +- Fix erroneous warning on multiple `export * from` declarations with defaults ([#1278](https://github.com/rollup/rollup/issues/1278)) +- Prevent variable conflicts with `treeshake: false` ([#1268](https://github.com/rollup/rollup/issues/1268)) +- Allow missing `source` when collapsing sourcemaps ([#1254](https://github.com/rollup/rollup/issues/1254)) +- Allow plugins to log with strings ([#1316](https://github.com/rollup/rollup/pull/1316)) ## 0.41.4 -* Fix cases of multiple `export * from 'external'` declarations ([#1252](https://github.com/rollup/rollup/issues/1252)) -* Fix 'TODO' error message ([#1257](https://github.com/rollup/rollup/issues/1257)) +- Fix cases of multiple `export * from 'external'` declarations ([#1252](https://github.com/rollup/rollup/issues/1252)) +- Fix 'TODO' error message ([#1257](https://github.com/rollup/rollup/issues/1257)) ## 0.41.3 -* Don't treat `this.foo` as possible namespace ([#1258](https://github.com/rollup/rollup/issues/1258)) +- Don't treat `this.foo` as possible namespace ([#1258](https://github.com/rollup/rollup/issues/1258)) ## 0.41.2 -* Optimize `namespace['foo']` references ([#1240](https://github.com/rollup/rollup/pull/1240)) +- Optimize `namespace['foo']` references ([#1240](https://github.com/rollup/rollup/pull/1240)) ## 0.41.1 -* Include `new` expressions where callee is a class with side-effects ([#980](https://github.com/rollup/rollup/issues/980) [#1233](https://github.com/rollup/rollup/issues/1233)) +- Include `new` expressions where callee is a class with side-effects ([#980](https://github.com/rollup/rollup/issues/980) [#1233](https://github.com/rollup/rollup/issues/1233)) ## 0.41.0 -* Add `this.warn(...)` and `this.error(...)` methods to plugin `transform` hook contexts ([#1140](https://github.com/rollup/rollup/issues/1140)) -* `throw` always considered to be a side effect ([#1227](https://github.com/rollup/rollup/pull/1227)) +- Add `this.warn(...)` and `this.error(...)` methods to plugin `transform` hook contexts ([#1140](https://github.com/rollup/rollup/issues/1140)) +- `throw` always considered to be a side effect ([#1227](https://github.com/rollup/rollup/pull/1227)) ## 0.40.2 -* Add `file` property to sourcemaps for bundles with plugins ([#986](https://github.com/rollup/rollup/issues/986)) -* Don't require globals for empty imports ([#1217](https://github.com/rollup/rollup/issues/1217)) +- Add `file` property to sourcemaps for bundles with plugins ([#986](https://github.com/rollup/rollup/issues/986)) +- Don't require globals for empty imports ([#1217](https://github.com/rollup/rollup/issues/1217)) ## 0.40.1 -* Allow missing space between `export default` and declaration ([#1218](https://github.com/rollup/rollup/pull/1218)) +- Allow missing space between `export default` and declaration ([#1218](https://github.com/rollup/rollup/pull/1218)) ## 0.40.0 -* [BREAKING] Better, more consistent error logging ([#1212](https://github.com/rollup/rollup/pull/1212)) -* Don't use colours and emojis for non-TTY stderr ([#1201](https://github.com/rollup/rollup/issues/1201)) +- [BREAKING] Better, more consistent error logging ([#1212](https://github.com/rollup/rollup/pull/1212)) +- Don't use colours and emojis for non-TTY stderr ([#1201](https://github.com/rollup/rollup/issues/1201)) ## 0.39.2 -* Prevent mutation of cached ASTs (fixes stack overflow with rollup-watch) ([#1205](https://github.com/rollup/rollup/pull/1205)) +- Prevent mutation of cached ASTs (fixes stack overflow with rollup-watch) ([#1205](https://github.com/rollup/rollup/pull/1205)) ## 0.39.1 -* Ignore `var` initialisers in dead branches ([#1198](https://github.com/rollup/rollup/issues/1198)) +- Ignore `var` initialisers in dead branches ([#1198](https://github.com/rollup/rollup/issues/1198)) ## 0.39.0 -* [BREAKING] Warnings are objects, rather than strings ([#1194](https://github.com/rollup/rollup/issues/1194)) +- [BREAKING] Warnings are objects, rather than strings ([#1194](https://github.com/rollup/rollup/issues/1194)) ## 0.38.3 -* More informative warning for implicit external dependencies ([#1051](https://github.com/rollup/rollup/issues/1051)) -* Warn when creating browser bundle with external dependencies on Node built-ins ([#1051](https://github.com/rollup/rollup/issues/1051)) -* Statically analyse LogicalExpression nodes, for better dead code removal ([#1061](https://github.com/rollup/rollup/issues/1061)) +- More informative warning for implicit external dependencies ([#1051](https://github.com/rollup/rollup/issues/1051)) +- Warn when creating browser bundle with external dependencies on Node built-ins ([#1051](https://github.com/rollup/rollup/issues/1051)) +- Statically analyse LogicalExpression nodes, for better dead code removal ([#1061](https://github.com/rollup/rollup/issues/1061)) ## 0.38.2 -* Preserve `var` declarations in dead branches ([#997](https://github.com/rollup/rollup/issues/997)) -* Warn if exporting a call expression that looks like a function declaration ([#1011](https://github.com/rollup/rollup/issues/1011)) -* Wrap function expressions in parentheses if necessary ([#1011](https://github.com/rollup/rollup/issues/1011)) +- Preserve `var` declarations in dead branches ([#997](https://github.com/rollup/rollup/issues/997)) +- Warn if exporting a call expression that looks like a function declaration ([#1011](https://github.com/rollup/rollup/issues/1011)) +- Wrap function expressions in parentheses if necessary ([#1011](https://github.com/rollup/rollup/issues/1011)) ## 0.38.1 -* Fix sourcemap comment removal ([#1104](https://github.com/rollup/rollup/issues/1104)) -* Warn if empty bundle is generated ([#444](https://github.com/rollup/rollup/issues/444)) -* Support ES2017 syntax ([#492](https://github.com/rollup/rollup/issues/492)) -* Remove unused imports from external modules ([#595](https://github.com/rollup/rollup/issues/595)) -* Remove unused function and class declarations inside function bodies ([#1108](https://github.com/rollup/rollup/issues/1108), [#1178](https://github.com/rollup/rollup/issues/1178)) -* Deconflict function expression IDs ([#1176](https://github.com/rollup/rollup/issues/1176)) +- Fix sourcemap comment removal ([#1104](https://github.com/rollup/rollup/issues/1104)) +- Warn if empty bundle is generated ([#444](https://github.com/rollup/rollup/issues/444)) +- Support ES2017 syntax ([#492](https://github.com/rollup/rollup/issues/492)) +- Remove unused imports from external modules ([#595](https://github.com/rollup/rollup/issues/595)) +- Remove unused function and class declarations inside function bodies ([#1108](https://github.com/rollup/rollup/issues/1108), [#1178](https://github.com/rollup/rollup/issues/1178)) +- Deconflict function expression IDs ([#1176](https://github.com/rollup/rollup/issues/1176)) ## 0.38.0 -* [BREAKING] `export { foo as default }` creates live binding ([#1078](https://github.com/rollup/rollup/issues/1078)) -* Prevent sourceMappingURL removal edge case ([#988](https://github.com/rollup/rollup/issues/988)) -* Bind function expression IDs to the correct scope ([#1083](https://github.com/rollup/rollup/issues/1083)) -* Correctly deshadow destructured parameters with assignments ([#1008](https://github.com/rollup/rollup/issues/1008)) +- [BREAKING] `export { foo as default }` creates live binding ([#1078](https://github.com/rollup/rollup/issues/1078)) +- Prevent sourceMappingURL removal edge case ([#988](https://github.com/rollup/rollup/issues/988)) +- Bind function expression IDs to the correct scope ([#1083](https://github.com/rollup/rollup/issues/1083)) +- Correctly deshadow destructured parameters with assignments ([#1008](https://github.com/rollup/rollup/issues/1008)) ## 0.37.2 -* Remove unused `new` expressions without side-effects ([#179](https://github.com/rollup/rollup/issues/179)) -* Only remove valid sourceMappingURL comments ([#1132](https://github.com/rollup/rollup/issues/1132)) -* Ensure blocks containing activated `var` declarations are included in output ([#1113](https://github.com/rollup/rollup/issues/1113)) -* Support plugin outros ([#1116](https://github.com/rollup/rollup/issues/1116)) +- Remove unused `new` expressions without side-effects ([#179](https://github.com/rollup/rollup/issues/179)) +- Only remove valid sourceMappingURL comments ([#1132](https://github.com/rollup/rollup/issues/1132)) +- Ensure blocks containing activated `var` declarations are included in output ([#1113](https://github.com/rollup/rollup/issues/1113)) +- Support plugin outros ([#1116](https://github.com/rollup/rollup/issues/1116)) ## 0.37.1 -* Follow symlinks ([#447](https://github.com/rollup/rollup/issues/447)) -* Fix tree-shaking of recursive functions and other cases ([#1120](https://github.com/rollup/rollup/issues/1120), [#1142](https://github.com/rollup/rollup/issues/1142)) -* Support module names that require quotes ([#582](https://github.com/rollup/rollup/issues/582), [#584](https://github.com/rollup/rollup/issues/584)) -* Fix [#957](https://github.com/rollup/rollup/issues/957) +- Follow symlinks ([#447](https://github.com/rollup/rollup/issues/447)) +- Fix tree-shaking of recursive functions and other cases ([#1120](https://github.com/rollup/rollup/issues/1120), [#1142](https://github.com/rollup/rollup/issues/1142)) +- Support module names that require quotes ([#582](https://github.com/rollup/rollup/issues/582), [#584](https://github.com/rollup/rollup/issues/584)) +- Fix [#957](https://github.com/rollup/rollup/issues/957) ## 0.37.0 -* [BREAKING] Default exports are not included in reified namespaces ([#1028](https://github.com/rollup/rollup/issues/1028)) -* Parentheses do not defeat tree-shaking ([#1101](https://github.com/rollup/rollup/issues/1101), [#1128](https://github.com/rollup/rollup/issues/1128)) -* More `legacy` fixes: do not create getters ([#1069](https://github.com/rollup/rollup/pull/1069)), do not include `__esModule` ([#1068](https://github.com/rollup/rollup/pull/1068)), quote reserved property names ([#1057](https://github.com/rollup/rollup/pull/1057)) -* Fix missing namespace member warnings ([#1045](https://github.com/rollup/rollup/issues/1045)) -* Fix TypeError in arrow function without braces returning a function ([#1062](https://github.com/rollup/rollup/pull/1062)) +- [BREAKING] Default exports are not included in reified namespaces ([#1028](https://github.com/rollup/rollup/issues/1028)) +- Parentheses do not defeat tree-shaking ([#1101](https://github.com/rollup/rollup/issues/1101), [#1128](https://github.com/rollup/rollup/issues/1128)) +- More `legacy` fixes: do not create getters ([#1069](https://github.com/rollup/rollup/pull/1069)), do not include `__esModule` ([#1068](https://github.com/rollup/rollup/pull/1068)), quote reserved property names ([#1057](https://github.com/rollup/rollup/pull/1057)) +- Fix missing namespace member warnings ([#1045](https://github.com/rollup/rollup/issues/1045)) +- Fix TypeError in arrow function without braces returning a function ([#1062](https://github.com/rollup/rollup/pull/1062)) ## 0.36.4 -* Only depend on program-level call expressions ([#977](https://github.com/rollup/rollup/issues/977)) +- Only depend on program-level call expressions ([#977](https://github.com/rollup/rollup/issues/977)) ## 0.36.3 -* Add `legacy` option for IE8 support ([#989](https://github.com/rollup/rollup/pull/989)) +- Add `legacy` option for IE8 support ([#989](https://github.com/rollup/rollup/pull/989)) ## 0.36.2 -* Insert semicolons where necessary to fix broken code ([#1004](https://github.com/rollup/rollup/issues/1004)) -* Include module ID and location when warning about top-level `this` ([#1012](https://github.com/rollup/rollup/pull/1012)) -* More informative error for missing exports ([#1033](https://github.com/rollup/rollup/issues/1033)) -* `options.moduleContext` for per-module context overrides ([#1023](https://github.com/rollup/rollup/pull/1023)) +- Insert semicolons where necessary to fix broken code ([#1004](https://github.com/rollup/rollup/issues/1004)) +- Include module ID and location when warning about top-level `this` ([#1012](https://github.com/rollup/rollup/pull/1012)) +- More informative error for missing exports ([#1033](https://github.com/rollup/rollup/issues/1033)) +- `options.moduleContext` for per-module context overrides ([#1023](https://github.com/rollup/rollup/pull/1023)) ## 0.36.1 -* Include naked block statements ([#981](https://github.com/rollup/rollup/issues/981)) -* Correctly include falsy alternate statements in optimised if blocks ([#973](https://github.com/rollup/rollup/issues/973)) -* Prevent omission of default exports that are only used by the exporting module ([#967](https://github.com/rollup/rollup/pull/967)) -* Prevent warning on `auto` exports with ES output ([#966](https://github.com/rollup/rollup/pull/966)) +- Include naked block statements ([#981](https://github.com/rollup/rollup/issues/981)) +- Correctly include falsy alternate statements in optimised if blocks ([#973](https://github.com/rollup/rollup/issues/973)) +- Prevent omission of default exports that are only used by the exporting module ([#967](https://github.com/rollup/rollup/pull/967)) +- Prevent warning on `auto` exports with ES output ([#966](https://github.com/rollup/rollup/pull/966)) ## 0.36.0 -* `export { foo as default }` no longer creates a live binding ([#860](https://github.com/rollup/rollup/issues/860)) +- `export { foo as default }` no longer creates a live binding ([#860](https://github.com/rollup/rollup/issues/860)) ## 0.35.15 -* Warn on missing unused imports in deshadowing phase ([#928](https://github.com/rollup/rollup/issues/928)) -* Always add a newline to the end of bundles ([#958](https://github.com/rollup/rollup/issues/958)) +- Warn on missing unused imports in deshadowing phase ([#928](https://github.com/rollup/rollup/issues/928)) +- Always add a newline to the end of bundles ([#958](https://github.com/rollup/rollup/issues/958)) ## 0.35.14 -* Include all parent statements of expression with effects, up to function boundary ([#930](https://github.com/rollup/rollup/issues/930)) +- Include all parent statements of expression with effects, up to function boundary ([#930](https://github.com/rollup/rollup/issues/930)) ## 0.35.13 -* Include superclasses when including their subclasses ([#932](https://github.com/rollup/rollup/issues/932)) +- Include superclasses when including their subclasses ([#932](https://github.com/rollup/rollup/issues/932)) ## 0.35.12 -* Add `interop: false` option to disable unwrapping of external imports ([#939](https://github.com/rollup/rollup/issues/939)) +- Add `interop: false` option to disable unwrapping of external imports ([#939](https://github.com/rollup/rollup/issues/939)) ## 0.35.11 -* Deconflict reified namespaces with other declarations ([#910](https://github.com/rollup/rollup/issues/910)) +- Deconflict reified namespaces with other declarations ([#910](https://github.com/rollup/rollup/issues/910)) ## 0.35.10 -* Only remove EmptyStatement nodes directly inside blocks ([#913](https://github.com/rollup/rollup/issues/931)) +- Only remove EmptyStatement nodes directly inside blocks ([#913](https://github.com/rollup/rollup/issues/931)) ## 0.35.9 -* Support Node 0.12 ([#909](https://github.com/rollup/rollup/issues/909)) +- Support Node 0.12 ([#909](https://github.com/rollup/rollup/issues/909)) ## 0.35.8 -* Correctly deshadow re-assigned module functions ([#910](https://github.com/rollup/rollup/issues/910)) +- Correctly deshadow re-assigned module functions ([#910](https://github.com/rollup/rollup/issues/910)) ## 0.35.7 -* Refactor `flushTime.js` ([#922](https://github.com/rollup/rollup/pull/922)) +- Refactor `flushTime.js` ([#922](https://github.com/rollup/rollup/pull/922)) ## 0.35.6 -* Fix browser build +- Fix browser build ## 0.35.5 -* Allow empty for loop heads ([#919](https://github.com/rollup/rollup/issues/919)) +- Allow empty for loop heads ([#919](https://github.com/rollup/rollup/issues/919)) ## 0.35.4 -* Preserve effects in for-of and for-in loops ([#870](https://github.com/rollup/rollup/issues/870)) -* Remove empty statements ([#918](https://github.com/rollup/rollup/pull/918)) +- Preserve effects in for-of and for-in loops ([#870](https://github.com/rollup/rollup/issues/870)) +- Remove empty statements ([#918](https://github.com/rollup/rollup/pull/918)) ## 0.35.3 -* Render identifiers inside template literals +- Render identifiers inside template literals ## 0.35.2 -* Fix broken build caused by out of date locally installed dependencies +- Fix broken build caused by out of date locally installed dependencies ## 0.35.1 -* Rewrite deconflicted class identifiers ([#915](https://github.com/rollup/rollup/pull/915)) -* Include `dependencies` in `bundle.modules` objects ([#903](https://github.com/rollup/rollup/issues/903)) -* Update to Acorn 4 ([#914](https://github.com/rollup/rollup/pull/914)) +- Rewrite deconflicted class identifiers ([#915](https://github.com/rollup/rollup/pull/915)) +- Include `dependencies` in `bundle.modules` objects ([#903](https://github.com/rollup/rollup/issues/903)) +- Update to Acorn 4 ([#914](https://github.com/rollup/rollup/pull/914)) ## 0.35.0 -* Rewrite analysis/tree-shaking code ([#902](https://github.com/rollup/rollup/pull/902)) -* Include conditional mutations of global objects ([#901](https://github.com/rollup/rollup/issues/901)) -* Only reify namespaces if necessary ([#898](https://github.com/rollup/rollup/issues/898)) -* Track mutations of aliased globals ([#893](https://github.com/rollup/rollup/issues/893)) -* Include duplicated var declarations ([#716](https://github.com/rollup/rollup/issues/716)) +- Rewrite analysis/tree-shaking code ([#902](https://github.com/rollup/rollup/pull/902)) +- Include conditional mutations of global objects ([#901](https://github.com/rollup/rollup/issues/901)) +- Only reify namespaces if necessary ([#898](https://github.com/rollup/rollup/issues/898)) +- Track mutations of aliased globals ([#893](https://github.com/rollup/rollup/issues/893)) +- Include duplicated var declarations ([#716](https://github.com/rollup/rollup/issues/716)) ## 0.34.13 -* Pass `{ format }` through to `transformBundle` ([#867](https://github.com/rollup/rollup/issues/867)) +- Pass `{ format }` through to `transformBundle` ([#867](https://github.com/rollup/rollup/issues/867)) ## 0.34.12 -* Fix `rollup --watch` ([#887](https://github.com/rollup/rollup/issues/887)) -* Case-sensitive paths ([#862](https://github.com/rollup/rollup/issues/862)) +- Fix `rollup --watch` ([#887](https://github.com/rollup/rollup/issues/887)) +- Case-sensitive paths ([#862](https://github.com/rollup/rollup/issues/862)) ## 0.34.11 -* Prevent leaky state when `bundle` is reused ([#875](https://github.com/rollup/rollup/issues/875)) -* Ensure `intro` appears before interop block ([#880](https://github.com/rollup/rollup/issues/880)) +- Prevent leaky state when `bundle` is reused ([#875](https://github.com/rollup/rollup/issues/875)) +- Ensure `intro` appears before interop block ([#880](https://github.com/rollup/rollup/issues/880)) ## 0.34.10 -* Allow custom `options.context` to replace top-level `this` ([#851](https://github.com/rollup/rollup/issues/851)) -* Fix `noConflict` when used via `rollup --config` ([#846](https://github.com/rollup/rollup/issues/846)) -* Place `outro` block *after* export block ([#852](https://github.com/rollup/rollup/issues/852)) +- Allow custom `options.context` to replace top-level `this` ([#851](https://github.com/rollup/rollup/issues/851)) +- Fix `noConflict` when used via `rollup --config` ([#846](https://github.com/rollup/rollup/issues/846)) +- Place `outro` block _after_ export block ([#852](https://github.com/rollup/rollup/issues/852)) ## 0.34.9 -* Disable indentation by default, for faster bundle generation ([#812](https://github.com/rollup/rollup/pull/812)) -* More helpful error on missing entry file ([#802](https://github.com/rollup/rollup/issues/802)) -* Preserve comments before import declarations ([#815](https://github.com/rollup/rollup/pull/815)) +- Disable indentation by default, for faster bundle generation ([#812](https://github.com/rollup/rollup/pull/812)) +- More helpful error on missing entry file ([#802](https://github.com/rollup/rollup/issues/802)) +- Preserve comments before import declarations ([#815](https://github.com/rollup/rollup/pull/815)) ## 0.34.8 -* Wrap UMD factory function in parens to avoid lazy parsing ([#774](https://github.com/rollup/rollup/pull/774)) +- Wrap UMD factory function in parens to avoid lazy parsing ([#774](https://github.com/rollup/rollup/pull/774)) ## 0.34.7 -* Leave it up to resolveId to normalize the entry path ([#835](https://github.com/rollup/rollup/pull/835)) -* Cache decoded mappings ([#834](https://github.com/rollup/rollup/pull/834)) +- Leave it up to resolveId to normalize the entry path ([#835](https://github.com/rollup/rollup/pull/835)) +- Cache decoded mappings ([#834](https://github.com/rollup/rollup/pull/834)) ## 0.34.5 -* Fix circular export ([#813](https://github.com/rollup/rollup/issues/813)) +- Fix circular export ([#813](https://github.com/rollup/rollup/issues/813)) ## 0.34.4 -* Module render performance tweak ([#823](https://github.com/rollup/rollup/pull/823)) +- Module render performance tweak ([#823](https://github.com/rollup/rollup/pull/823)) ## 0.34.3 -* Avoid infinite recursion in `Bundle.sort()` ([#800](https://github.com/rollup/rollup/pull/800)) +- Avoid infinite recursion in `Bundle.sort()` ([#800](https://github.com/rollup/rollup/pull/800)) ## 0.34.2 -* resolveId calls are cached now to improve incremental build -* Fixed error message recursion in plugins +- resolveId calls are cached now to improve incremental build +- Fixed error message recursion in plugins ## 0.34.1 -* Support `paths` config ([#754](https://github.com/rollup/rollup/issues/754)) -* Allow `export *` from external module, internally +- Support `paths` config ([#754](https://github.com/rollup/rollup/issues/754)) +- Allow `export *` from external module, internally ## 0.34.0 -* Use resolved IDs for relative imports that are also external modules, to allow `options.globals` to work with them ([#763](https://github.com/rollup/rollup/issues/763)) -* Ensure reassigned exports are declared in an ES bundle, and remove empty `exports.foo;` statements ([#755](https://github.com/rollup/rollup/issues/755)) -* Add newline after sourcemap comment ([#756](https://github.com/rollup/rollup/issues/756)) +- Use resolved IDs for relative imports that are also external modules, to allow `options.globals` to work with them ([#763](https://github.com/rollup/rollup/issues/763)) +- Ensure reassigned exports are declared in an ES bundle, and remove empty `exports.foo;` statements ([#755](https://github.com/rollup/rollup/issues/755)) +- Add newline after sourcemap comment ([#756](https://github.com/rollup/rollup/issues/756)) ## 0.33.2 -* Add `bundle` as second argument to `ongenerate` and `onwrite` hooks ([#773](https://github.com/rollup/rollup/pull/773)) -* Warn on top-level `this` ([#770](https://github.com/rollup/rollup/issues/770)) +- Add `bundle` as second argument to `ongenerate` and `onwrite` hooks ([#773](https://github.com/rollup/rollup/pull/773)) +- Warn on top-level `this` ([#770](https://github.com/rollup/rollup/issues/770)) ## 0.33.1 -* Fix `--no-strict` option ([#751](https://github.com/rollup/rollup/pull/751)) -* Fix Windows edge case with case-sensitive paths ([#760](https://github.com/rollup/rollup/pull/760)) +- Fix `--no-strict` option ([#751](https://github.com/rollup/rollup/pull/751)) +- Fix Windows edge case with case-sensitive paths ([#760](https://github.com/rollup/rollup/pull/760)) ## 0.33.0 -* Downgrade missing transformer sourcemap to a warning, not an error, and print the name of the offending plugin if possible ([#746](https://github.com/rollup/rollup/issues/746)) -* Warn if same name is re-exported from two modules ([#722](https://github.com/rollup/rollup/issues/722)) +- Downgrade missing transformer sourcemap to a warning, not an error, and print the name of the offending plugin if possible ([#746](https://github.com/rollup/rollup/issues/746)) +- Warn if same name is re-exported from two modules ([#722](https://github.com/rollup/rollup/issues/722)) ## 0.32.4 -* Add `ongenerate` and `onwrite` plugin hooks ([#742](https://github.com/rollup/rollup/pull/742)) +- Add `ongenerate` and `onwrite` plugin hooks ([#742](https://github.com/rollup/rollup/pull/742)) ## 0.32.3 -* Generated correct sourcemaps with reified namespaces ([#668](https://github.com/rollup/rollup/issues/668)) -* Exclude plugin helper modules from sourcemaps ([#747](https://github.com/rollup/rollup/pull/747)) +- Generated correct sourcemaps with reified namespaces ([#668](https://github.com/rollup/rollup/issues/668)) +- Exclude plugin helper modules from sourcemaps ([#747](https://github.com/rollup/rollup/pull/747)) ## 0.32.2 -* Allow `--globals` to work with `--external` or `options.external` in whatever configuration ([#743](https://github.com/rollup/rollup/issues/743)) +- Allow `--globals` to work with `--external` or `options.external` in whatever configuration ([#743](https://github.com/rollup/rollup/issues/743)) ## 0.32.1 -* Preserve side-effects to default exports that coincide with used named exports ([#733](https://github.com/rollup/rollup/issues/733)) -* Support `rollup -c node:pkgname` ([#736](https://github.com/rollup/rollup/issues/736)) +- Preserve side-effects to default exports that coincide with used named exports ([#733](https://github.com/rollup/rollup/issues/733)) +- Support `rollup -c node:pkgname` ([#736](https://github.com/rollup/rollup/issues/736)) ## 0.32.0 -* Deprecate `es6` format in favour of `es` ([#468](https://github.com/rollup/rollup/issues/468)) -* Add correct `jsnext:main` build ([#726](https://github.com/rollup/rollup/pull/726)) +- Deprecate `es6` format in favour of `es` ([#468](https://github.com/rollup/rollup/issues/468)) +- Add correct `jsnext:main` build ([#726](https://github.com/rollup/rollup/pull/726)) ## 0.31.2 -* Allow `load` plugins to provide sourcemap ([#715](https://github.com/rollup/rollup/pull/715)) -* Allow `sourceMapFile` in config options ([#717](https://github.com/rollup/rollup/issues/717)) +- Allow `load` plugins to provide sourcemap ([#715](https://github.com/rollup/rollup/pull/715)) +- Allow `sourceMapFile` in config options ([#717](https://github.com/rollup/rollup/issues/717)) ## 0.31.1 -* Logging for errors emitted by `rollup-watch` ([#712](https://github.com/rollup/rollup/issues/712)) +- Logging for errors emitted by `rollup-watch` ([#712](https://github.com/rollup/rollup/issues/712)) ## 0.31.0 -* Rewrite top-level `this` as `undefined` ([#707](https://github.com/rollup/rollup/pull/707)) -* Pass `options.acorn` to Acorn ([#564](https://github.com/rollup/rollup/issues/564)) +- Rewrite top-level `this` as `undefined` ([#707](https://github.com/rollup/rollup/pull/707)) +- Pass `options.acorn` to Acorn ([#564](https://github.com/rollup/rollup/issues/564)) ## 0.30.0 -* Bundle CLI ([#700](https://github.com/rollup/rollup/issues/700)) -* Ensure absolute paths are normalised ([#704](https://github.com/rollup/rollup/issues/704)) -* Allow `rollup --watch` to work with targets +- Bundle CLI ([#700](https://github.com/rollup/rollup/issues/700)) +- Ensure absolute paths are normalised ([#704](https://github.com/rollup/rollup/issues/704)) +- Allow `rollup --watch` to work with targets ## 0.29.1 -* Merge `target` options with main options ([#701](https://github.com/rollup/rollup/issues/701)) -* Update magic-string ([#690](https://github.com/rollup/rollup/issues/690)) +- Merge `target` options with main options ([#701](https://github.com/rollup/rollup/issues/701)) +- Update magic-string ([#690](https://github.com/rollup/rollup/issues/690)) ## 0.29.0 -* `rollup --watch` ([#284](https://github.com/rollup/rollup/issues/284)) +- `rollup --watch` ([#284](https://github.com/rollup/rollup/issues/284)) ## 0.28.0 -* Experimental support for incremental rebuilds ([#658](https://github.com/rollup/rollup/pull/658)) +- Experimental support for incremental rebuilds ([#658](https://github.com/rollup/rollup/pull/658)) ## 0.27.1 -* Ensure names exported from a module are not replaced with reserved words ([#696](https://github.com/rollup/rollup/pull/696)) -* Revert ([#692](https://github.com/rollup/rollup/pull/692)) – resolved IDs must be strings +- Ensure names exported from a module are not replaced with reserved words ([#696](https://github.com/rollup/rollup/pull/696)) +- Revert ([#692](https://github.com/rollup/rollup/pull/692)) – resolved IDs must be strings ## 0.27.0 -* Use native promises instead of `es6-promise` ([#689](https://github.com/rollup/rollup/issues/689)) -* Support multiple targets in config files ([#655](https://github.com/rollup/rollup/issues/655)) -* Allow `resolveId` plugin functions to return non-strings ([#692](https://github.com/rollup/rollup/pull/692)) +- Use native promises instead of `es6-promise` ([#689](https://github.com/rollup/rollup/issues/689)) +- Support multiple targets in config files ([#655](https://github.com/rollup/rollup/issues/655)) +- Allow `resolveId` plugin functions to return non-strings ([#692](https://github.com/rollup/rollup/pull/692)) ## 0.26.7 -* Distinguish between default and namespace imports of external module ([#637](https://github.com/rollup/rollup/issues/637)) -* Add `__esModule` property to named exports in AMD, CJS and UMD modes ([#650](https://github.com/rollup/rollup/issues/650)) +- Distinguish between default and namespace imports of external module ([#637](https://github.com/rollup/rollup/issues/637)) +- Add `__esModule` property to named exports in AMD, CJS and UMD modes ([#650](https://github.com/rollup/rollup/issues/650)) ## 0.26.6 -* Deconflict named imports from external modules in ES bundles ([#659](https://github.com/rollup/rollup/issues/659)) -* Support `options.preferConst` to generate `const` declarations for exports rather than `var` declarations ([#653](https://github.com/rollup/rollup/issues/653)) +- Deconflict named imports from external modules in ES bundles ([#659](https://github.com/rollup/rollup/issues/659)) +- Support `options.preferConst` to generate `const` declarations for exports rather than `var` declarations ([#653](https://github.com/rollup/rollup/issues/653)) ## 0.26.5 -* Preserve `debugger` statements ([#664](https://github.com/rollup/rollup/issues/664)) -* Allow `options.external` to be a function ([#522](https://github.com/rollup/rollup/issues/522)) +- Preserve `debugger` statements ([#664](https://github.com/rollup/rollup/issues/664)) +- Allow `options.external` to be a function ([#522](https://github.com/rollup/rollup/issues/522)) ## 0.26.4 -* Prevent plugin-provided external IDs being normalised ([#630](https://github.com/rollup/rollup/issues/630), [#633](https://github.com/rollup/rollup/issues/633)) -* Throw if module exports/re-exports the same name twice, or has multiple default exports ([#679](https://github.com/rollup/rollup/issues/679)) -* Warn about `eval` security issue ([#675]((https://github.com/rollup/rollup/issues/675))) - +- Prevent plugin-provided external IDs being normalised ([#630](https://github.com/rollup/rollup/issues/630), [#633](https://github.com/rollup/rollup/issues/633)) +- Throw if module exports/re-exports the same name twice, or has multiple default exports ([#679](https://github.com/rollup/rollup/issues/679)) +- Warn about `eval` security issue ([#675](<(https://github.com/rollup/rollup/issues/675)>)) ## 0.26.3 -* Ensure reference is not incorrectly marked as a reassignment ([#648](https://github.com/rollup/rollup/issues/648)) +- Ensure reference is not incorrectly marked as a reassignment ([#648](https://github.com/rollup/rollup/issues/648)) ## 0.26.2 -* Sanity check output of `load` hook ([#607](https://github.com/rollup/rollup/issues/607)) -* Correct scoping for ID class expressions ([#626](https://github.com/rollup/rollup/issues/626)) -* Warn if named and default exports are used together in auto mode ([#587](https://github.com/rollup/rollup/issues/587)) -* Allow variable initialisers to be rewritten if necessary ([#632](https://github.com/rollup/rollup/issues/632)) -* Prevent double `var` with no-treeshake option ([#639](https://github.com/rollup/rollup/pull/639)) +- Sanity check output of `load` hook ([#607](https://github.com/rollup/rollup/issues/607)) +- Correct scoping for ID class expressions ([#626](https://github.com/rollup/rollup/issues/626)) +- Warn if named and default exports are used together in auto mode ([#587](https://github.com/rollup/rollup/issues/587)) +- Allow variable initialisers to be rewritten if necessary ([#632](https://github.com/rollup/rollup/issues/632)) +- Prevent double `var` with no-treeshake option ([#639](https://github.com/rollup/rollup/pull/639)) ## 0.26.1 -* Add `treeshake: false`/`--no-treeshake` option for debugging ([#505](https://github.com/rollup/rollup/issues/505)) -* Update build process to use Bublé ([#620](https://github.com/rollup/rollup/pull/620)) +- Add `treeshake: false`/`--no-treeshake` option for debugging ([#505](https://github.com/rollup/rollup/issues/505)) +- Update build process to use Bublé ([#620](https://github.com/rollup/rollup/pull/620)) ## 0.26.0 -* Add `noConflict`/`--no-conflict` option for UMD builds ([#580](https://github.com/rollup/rollup/pull/580)) -* Normalise relative external paths ([#591](https://github.com/rollup/rollup/pull/591)) -* Report files causing transform errors ([#609](https://github.com/rollup/rollup/pull/609)) -* Handle sourcemap segments with a single member ([#619](https://github.com/rollup/rollup/pull/619)) -* Update dependencies +- Add `noConflict`/`--no-conflict` option for UMD builds ([#580](https://github.com/rollup/rollup/pull/580)) +- Normalise relative external paths ([#591](https://github.com/rollup/rollup/pull/591)) +- Report files causing transform errors ([#609](https://github.com/rollup/rollup/pull/609)) +- Handle sourcemap segments with a single member ([#619](https://github.com/rollup/rollup/pull/619)) +- Update dependencies ## 0.25.8 -* Unixize entry path ([#586](https://github.com/rollup/rollup/pull/586)) +- Unixize entry path ([#586](https://github.com/rollup/rollup/pull/586)) ## 0.25.7 -* Expand deshadowed shorthand properties ([#575](https://github.com/rollup/rollup/issues/575)) -* Allow external files to be non-existent ([#532](https://github.com/rollup/rollup/issues/532)) +- Expand deshadowed shorthand properties ([#575](https://github.com/rollup/rollup/issues/575)) +- Allow external files to be non-existent ([#532](https://github.com/rollup/rollup/issues/532)) ## 0.25.6 -* Fix a regression introduced by #566 ([#569](https://github.com/rollup/rollup/issues/569)) -* Prune dead conditional expressions more carefully ([#567](https://github.com/rollup/rollup/issues/567)) +- Fix a regression introduced by #566 ([#569](https://github.com/rollup/rollup/issues/569)) +- Prune dead conditional expressions more carefully ([#567](https://github.com/rollup/rollup/issues/567)) ## 0.25.5 -* Make sure shorthand destructuring assignments don't break ([#528](https://github.com/rollup/rollup/issues/528)) -* Allow 'exports' key ([#542](https://github.com/rollup/rollup/issues/542)) -* Ensure `foo. bar` where `foo` is a namespace import is rewritten correctly ([#566](https://github.com/rollup/rollup/issues/566)) -* Fix an edge case for exported globals (e.g. `export { document }`) ([#562](https://github.com/rollup/rollup/issues/562)) +- Make sure shorthand destructuring assignments don't break ([#528](https://github.com/rollup/rollup/issues/528)) +- Allow 'exports' key ([#542](https://github.com/rollup/rollup/issues/542)) +- Ensure `foo. bar` where `foo` is a namespace import is rewritten correctly ([#566](https://github.com/rollup/rollup/issues/566)) +- Fix an edge case for exported globals (e.g. `export { document }`) ([#562](https://github.com/rollup/rollup/issues/562)) ## 0.25.4 -* Fix misnamed exports of default imports in ES bundles ([#513](https://github.com/rollup/rollup/issues/513)) -* CLI: warn on missing config ([#515](https://github.com/rollup/rollup/pull/515)) -* Detect side-effects in non-top-level member expression assignment ([#476](https://github.com/rollup/rollup/issues/476)) -* Don't remove computed property class keys ([#504](https://github.com/rollup/rollup/issues/504)) -* Augment existing global object rather than replacing ([#493](https://github.com/rollup/rollup/issues/493)) -* Don't fail on `export {}`, warn instead ([#486](https://github.com/rollup/rollup/issues/486)) +- Fix misnamed exports of default imports in ES bundles ([#513](https://github.com/rollup/rollup/issues/513)) +- CLI: warn on missing config ([#515](https://github.com/rollup/rollup/pull/515)) +- Detect side-effects in non-top-level member expression assignment ([#476](https://github.com/rollup/rollup/issues/476)) +- Don't remove computed property class keys ([#504](https://github.com/rollup/rollup/issues/504)) +- Augment existing global object rather than replacing ([#493](https://github.com/rollup/rollup/issues/493)) +- Don't fail on `export {}`, warn instead ([#486](https://github.com/rollup/rollup/issues/486)) ## 0.25.3 -* Handle non-objects and `null` in `_interopDefault` ([#474](https://github.com/rollup/rollup/issues/474)) +- Handle non-objects and `null` in `_interopDefault` ([#474](https://github.com/rollup/rollup/issues/474)) ## 0.25.2 -* Skip dead branches of a conditional expression (#[465](https://github.com/rollup/rollup/pull/465)) -* Allow globals to be exported ([#472](https://github.com/rollup/rollup/pull/472)) -* Ensure reassigned exports are exported ([#484](https://github.com/rollup/rollup/issues/484)) +- Skip dead branches of a conditional expression (#[465](https://github.com/rollup/rollup/pull/465)) +- Allow globals to be exported ([#472](https://github.com/rollup/rollup/pull/472)) +- Ensure reassigned exports are exported ([#484](https://github.com/rollup/rollup/issues/484)) ## 0.25.1 -* Throw error if namespace is called ([#446](https://github.com/rollup/rollup/issues/446)) -* Prevent shadowing bug in ES6 output ([#441](https://github.com/rollup/rollup/pull/441)) -* Prevent `var exports.foo` ([#426](https://github.com/rollup/rollup/issues/426)) -* Prevent double export of aliased symbols ([#438](https://github.com/rollup/rollup/issues/438)) -* Provide more informative error if Rollup is used in-browser without appropriate `resolveId`/`load` hooks ([#275](https://github.com/rollup/rollup/issues/275)) -* Use `_interopDefault` function to DRY out code with many external dependencies, in CommonJS output ([#458](https://github.com/rollup/rollup/pull/458)) +- Throw error if namespace is called ([#446](https://github.com/rollup/rollup/issues/446)) +- Prevent shadowing bug in ES6 output ([#441](https://github.com/rollup/rollup/pull/441)) +- Prevent `var exports.foo` ([#426](https://github.com/rollup/rollup/issues/426)) +- Prevent double export of aliased symbols ([#438](https://github.com/rollup/rollup/issues/438)) +- Provide more informative error if Rollup is used in-browser without appropriate `resolveId`/`load` hooks ([#275](https://github.com/rollup/rollup/issues/275)) +- Use `_interopDefault` function to DRY out code with many external dependencies, in CommonJS output ([#458](https://github.com/rollup/rollup/pull/458)) ## 0.25.0 -* **breaking** Module order is determined according to spec, rather than in a way designed to prevent runtime errors. Rollup will warn if it detects runtime errors are likely ([#435](https://github.com/rollup/rollup/issues/435)) -* Prevent overly aggressive tree-shaking with complex call expressions ([#440](https://github.com/rollup/rollup/issues/440)) +- **breaking** Module order is determined according to spec, rather than in a way designed to prevent runtime errors. Rollup will warn if it detects runtime errors are likely ([#435](https://github.com/rollup/rollup/issues/435)) +- Prevent overly aggressive tree-shaking with complex call expressions ([#440](https://github.com/rollup/rollup/issues/440)) ## 0.24.1 -* Handle calls to default exports other that are not function expressions or references to function declarations ([#421](https://github.com/rollup/rollup/issues/421)) -* Ensure namespace blocks are created for chained imports ([#430](https://github.com/rollup/rollup/issues/430)) -* Include references in computed property keys ([#434](https://github.com/rollup/rollup/issues/434)) -* Use CLI `--external` option correctly ([#417](https://github.com/rollup/rollup/pull/417)) -* Allow relative imports to be treated as external, if absolute paths are provided in `options.external` ([#410](https://github.com/rollup/rollup/issues/410)) -* Make IIFE output adhere to Crockford style ([#415](https://github.com/rollup/rollup/pull/415)) +- Handle calls to default exports other that are not function expressions or references to function declarations ([#421](https://github.com/rollup/rollup/issues/421)) +- Ensure namespace blocks are created for chained imports ([#430](https://github.com/rollup/rollup/issues/430)) +- Include references in computed property keys ([#434](https://github.com/rollup/rollup/issues/434)) +- Use CLI `--external` option correctly ([#417](https://github.com/rollup/rollup/pull/417)) +- Allow relative imports to be treated as external, if absolute paths are provided in `options.external` ([#410](https://github.com/rollup/rollup/issues/410)) +- Make IIFE output adhere to Crockford style ([#415](https://github.com/rollup/rollup/pull/415)) ## 0.24.0 -* No longer attempts to resolve IDs in `options.external` ([#407](https://github.com/rollup/rollup/issues/407)) -* Fix broken sourcemap resolution in cases where some modules are transformed and others aren't ([#404](https://github.com/rollup/rollup/issues/404)) +- No longer attempts to resolve IDs in `options.external` ([#407](https://github.com/rollup/rollup/issues/407)) +- Fix broken sourcemap resolution in cases where some modules are transformed and others aren't ([#404](https://github.com/rollup/rollup/issues/404)) ## 0.23.2 -* Ensure `dest` or `sourceMapFile` is resolved against CWD for purposes of sourcemap generation ([#344](https://github.com/rollup/rollup/issues/344)) -* Support `banner`, `footer`, `intro` and `outro` options via CLI ([#330](https://github.com/rollup/rollup/issues/330)) -* Allow `options.global` to be a function rather than an object, and warn on missing names ([#293](https://github.com/rollup/rollup/issues/293)) -* Ensure side-effects are captured in cyclical call expressions ([#397](https://github.com/rollup/rollup/issues/397)) -* Fix parse error with body-less arrow function expressions ([#403](https://github.com/rollup/rollup/issues/403)) +- Ensure `dest` or `sourceMapFile` is resolved against CWD for purposes of sourcemap generation ([#344](https://github.com/rollup/rollup/issues/344)) +- Support `banner`, `footer`, `intro` and `outro` options via CLI ([#330](https://github.com/rollup/rollup/issues/330)) +- Allow `options.global` to be a function rather than an object, and warn on missing names ([#293](https://github.com/rollup/rollup/issues/293)) +- Ensure side-effects are captured in cyclical call expressions ([#397](https://github.com/rollup/rollup/issues/397)) +- Fix parse error with body-less arrow function expressions ([#403](https://github.com/rollup/rollup/issues/403)) ## 0.23.1 -* Reinstate missing fix from ([#392](https://github.com/rollup/rollup/pull/392)) +- Reinstate missing fix from ([#392](https://github.com/rollup/rollup/pull/392)) ## 0.23.0 -* Add `bundleTransform` plugin hook and option ([#387](https://github.com/rollup/rollup/pull/387)) -* Correctly store names in sourcemaps, regardless of transformers -* Add `--environment` option to CLI ([#388](https://github.com/rollup/rollup/pull/388)) -* Handle destructuring in exports ([#374](https://github.com/rollup/rollup/issues/374)) -* Fix UMD global exports bug introduced in 0.22.1 ([#392](https://github.com/rollup/rollup/pull/392)) +- Add `bundleTransform` plugin hook and option ([#387](https://github.com/rollup/rollup/pull/387)) +- Correctly store names in sourcemaps, regardless of transformers +- Add `--environment` option to CLI ([#388](https://github.com/rollup/rollup/pull/388)) +- Handle destructuring in exports ([#374](https://github.com/rollup/rollup/issues/374)) +- Fix UMD global exports bug introduced in 0.22.1 ([#392](https://github.com/rollup/rollup/pull/392)) ## 0.22.2 -* Prevent lost `var` keywords ([#390](https://github.com/rollup/rollup/issues/390)) +- Prevent lost `var` keywords ([#390](https://github.com/rollup/rollup/issues/390)) ## 0.22.1 -* Update expected option keys ([#379](https://github.com/rollup/rollup/issues/379)) -* Handle transformers that return stringified sourcemaps ([#377](https://github.com/rollup/rollup/issues/377)) -* Automatically create missing namespaces if `moduleName` contains dots ([#378](https://github.com/rollup/rollup/issues/378)) -* Ignore external dependency warnings coming from config file ([#333](https://github.com/rollup/rollup/issues/333)) -* Update to latest magic-string for performance boost +- Update expected option keys ([#379](https://github.com/rollup/rollup/issues/379)) +- Handle transformers that return stringified sourcemaps ([#377](https://github.com/rollup/rollup/issues/377)) +- Automatically create missing namespaces if `moduleName` contains dots ([#378](https://github.com/rollup/rollup/issues/378)) +- Ignore external dependency warnings coming from config file ([#333](https://github.com/rollup/rollup/issues/333)) +- Update to latest magic-string for performance boost ## 0.22.0 -* Duplicate warnings are squelched ([#362](https://github.com/rollup/rollup/issues/362)) -* Plugins can manipulate or override the `options` object ([#371](https://github.com/rollup/rollup/pull/371)) +- Duplicate warnings are squelched ([#362](https://github.com/rollup/rollup/issues/362)) +- Plugins can manipulate or override the `options` object ([#371](https://github.com/rollup/rollup/pull/371)) ## 0.21.3 -* Validate option keys ([#348](https://github.com/rollup/rollup/pull/348)) -* Allow namespaces imports to sit alongside named imports ([#355](https://github.com/rollup/rollup/issues/355)) -* Count references inside destructured objects ([#364](https://github.com/rollup/rollup/issues/364)) -* Preserve top-level `delete` statements ([#352](https://github.com/rollup/rollup/issues/352)) +- Validate option keys ([#348](https://github.com/rollup/rollup/pull/348)) +- Allow namespaces imports to sit alongside named imports ([#355](https://github.com/rollup/rollup/issues/355)) +- Count references inside destructured objects ([#364](https://github.com/rollup/rollup/issues/364)) +- Preserve top-level `delete` statements ([#352](https://github.com/rollup/rollup/issues/352)) ## 0.21.2 -* Missing relative imports are an error, not a warning ([#321](https://github.com/rollup/rollup/issues/321)) -* Fixed incorrectly renamed default exports in ES6 bundles ([#339](https://github.com/rollup/rollup/issues/339)) -* Fixed infinite recursion bug ([#341](https://github.com/rollup/rollup/issues/341)) +- Missing relative imports are an error, not a warning ([#321](https://github.com/rollup/rollup/issues/321)) +- Fixed incorrectly renamed default exports in ES6 bundles ([#339](https://github.com/rollup/rollup/issues/339)) +- Fixed infinite recursion bug ([#341](https://github.com/rollup/rollup/issues/341)) ## 0.21.1 -* Remove `aggressive: true` (was too aggressive) ([#309](https://github.com/rollup/rollup/pull/309)) -* Handle top-level block statements ([#326](https://github.com/rollup/rollup/issues/326)) -* Optimise namespaces with default exports ([#314](https://github.com/rollup/rollup/issues/314)) +- Remove `aggressive: true` (was too aggressive) ([#309](https://github.com/rollup/rollup/pull/309)) +- Handle top-level block statements ([#326](https://github.com/rollup/rollup/issues/326)) +- Optimise namespaces with default exports ([#314](https://github.com/rollup/rollup/issues/314)) ## 0.21.0 -* Only include statements whose side-effects are relevant (i.e. contribute to exports or affect global state) ([#253](https://github.com/rollup/rollup/pull/253)) ([#253](https://github.com/rollup/rollup/pull/253)) -* Exclude dead branches from analysis and inclusion ([#249](https://github.com/rollup/rollup/pull/249)) -* Add `aggressive: true` option to eliminate all side-effects outside entry module -* More informative error when re-exporting non-existent binding ([#274](https://github.com/rollup/rollup/issues/274)) -* Fix infinite recursion bug ([#291](https://github.com/rollup/rollup/issues/291)) -* Log errors when using `rollup --config` ([#288](https://github.com/rollup/rollup/pull/288)) -* Return rejected promises on startup instead of throwing error, if options are invalid ([#303](https://github.com/rollup/rollup/pull/303)) +- Only include statements whose side-effects are relevant (i.e. contribute to exports or affect global state) ([#253](https://github.com/rollup/rollup/pull/253)) ([#253](https://github.com/rollup/rollup/pull/253)) +- Exclude dead branches from analysis and inclusion ([#249](https://github.com/rollup/rollup/pull/249)) +- Add `aggressive: true` option to eliminate all side-effects outside entry module +- More informative error when re-exporting non-existent binding ([#274](https://github.com/rollup/rollup/issues/274)) +- Fix infinite recursion bug ([#291](https://github.com/rollup/rollup/issues/291)) +- Log errors when using `rollup --config` ([#288](https://github.com/rollup/rollup/pull/288)) +- Return rejected promises on startup instead of throwing error, if options are invalid ([#303](https://github.com/rollup/rollup/pull/303)) ## 0.20.5 -* Ensure re-exports don't create a local binding ([#270](https://github.com/rollup/rollup/pull/270)) +- Ensure re-exports don't create a local binding ([#270](https://github.com/rollup/rollup/pull/270)) ## 0.20.4 -* Check file exists at resolve time, to allow filenames with non-extension dots in them ([#250](https://github.com/rollup/rollup/pull/250)) -* Import `Promise` where used, for Node 0.10 support ([#254](https://github.com/rollup/rollup/issues/254)) -* Allow asynchronous transformer plugins ([#260](https://github.com/rollup/rollup/issues/260)) -* Don't assume re-exported bindings are globals when deconflicting ([#267](https://github.com/rollup/rollup/issues/267)) - +- Check file exists at resolve time, to allow filenames with non-extension dots in them ([#250](https://github.com/rollup/rollup/pull/250)) +- Import `Promise` where used, for Node 0.10 support ([#254](https://github.com/rollup/rollup/issues/254)) +- Allow asynchronous transformer plugins ([#260](https://github.com/rollup/rollup/issues/260)) +- Don't assume re-exported bindings are globals when deconflicting ([#267](https://github.com/rollup/rollup/issues/267)) ## 0.20.3 -* Fix bug where multiple `export *` declarations caused error ([#244](https://github.com/rollup/rollup/pulls/244)) -* Missing namespace exports are a warning, not an error ([#244](https://github.com/rollup/rollup/pulls/244)) -* Plugins can provide `banner` and `footer` options (string, or function that returns a string) ([#235](https://github.com/rollup/rollup/issues/235)) -* Warn on encountering `eval` ([#186](https://github.com/rollup/rollup/issues/186)) +- Fix bug where multiple `export *` declarations caused error ([#244](https://github.com/rollup/rollup/pulls/244)) +- Missing namespace exports are a warning, not an error ([#244](https://github.com/rollup/rollup/pulls/244)) +- Plugins can provide `banner` and `footer` options (string, or function that returns a string) ([#235](https://github.com/rollup/rollup/issues/235)) +- Warn on encountering `eval` ([#186](https://github.com/rollup/rollup/issues/186)) ## 0.20.2 -* Handle errors in build config file -* More robust deconflicting, in cases where e.g. `foo$1` already exists -* Use Rollup CLI for own build process +- Handle errors in build config file +- More robust deconflicting, in cases where e.g. `foo$1` already exists +- Use Rollup CLI for own build process ## 0.20.1 -* Support `--config` file to enable plugins with CLI ([#226](https://github.com/rollup/rollup/pulls/226)) -* Prevent `default` being used as variable name ([#215](https://github.com/rollup/rollup/issues/215)) -* Update deps +- Support `--config` file to enable plugins with CLI ([#226](https://github.com/rollup/rollup/pulls/226)) +- Prevent `default` being used as variable name ([#215](https://github.com/rollup/rollup/issues/215)) +- Update deps ## 0.20.0 -* Support for [plugins](https://github.com/rollup/rollup/wiki/Plugins) ([#207](https://github.com/rollup/rollup/pulls/207)) -* BREAKING – `options.transform`, `options.load`, `options.resolveId`, `options.resolveExternal` and `options.external` are no longer supported, and should be handled by plugins. [More info](https://github.com/rollup/rollup/wiki/Plugins) -* BREAKING – the .js extension is only added if it looks like there's no extension, allowing e.g. `import data from 'data.json'` (with the appropriate transformer). For safety, always include the file extension – import `./foo.js`, not `./foo` +- Support for [plugins](https://github.com/rollup/rollup/wiki/Plugins) ([#207](https://github.com/rollup/rollup/pulls/207)) +- BREAKING – `options.transform`, `options.load`, `options.resolveId`, `options.resolveExternal` and `options.external` are no longer supported, and should be handled by plugins. [More info](https://github.com/rollup/rollup/wiki/Plugins) +- BREAKING – the .js extension is only added if it looks like there's no extension, allowing e.g. `import data from 'data.json'` (with the appropriate transformer). For safety, always include the file extension – import `./foo.js`, not `./foo` ## 0.19.2 -* Fix exporting namespaces to include all of their exports ([#204](https://github.com/rollup/rollup/issues/204)) -* Namespace exotic objects are frozen to ensure that its properties cannot be modified, reconfigured, redefined or deleted ([#203](https://github.com/rollup/rollup/pulls/203)) -* Fix `ReferenceError: Promise is not defined` in node v0.10 ([#189](https://github.com/rollup/rollup/issues/189)) +- Fix exporting namespaces to include all of their exports ([#204](https://github.com/rollup/rollup/issues/204)) +- Namespace exotic objects are frozen to ensure that its properties cannot be modified, reconfigured, redefined or deleted ([#203](https://github.com/rollup/rollup/pulls/203)) +- Fix `ReferenceError: Promise is not defined` in node v0.10 ([#189](https://github.com/rollup/rollup/issues/189)) ## 0.19.1 -* Fix `module.basename()` when used with custom `resolveId` function -* Use [rollup-babel](https://github.com/rollup/rollup-babel) to build self -* Exposed the version string through the API: `require( 'rollup' ).VERSION` +- Fix `module.basename()` when used with custom `resolveId` function +- Use [rollup-babel](https://github.com/rollup/rollup-babel) to build self +- Exposed the version string through the API: `require( 'rollup' ).VERSION` ## 0.19.0 -* **breaking** The `transform` option is no longer passed through to custom loaders. Loaders should only concern themselves with providing source code; transformation will *always* take place -* `options.transform` functions can return a string, or a `{code, map, ast}` object. Where possible, sourcemap chains will be flattened ([#175](https://github.com/rollup/rollup/pull/175)) -* `options.resolveId`, `options.resolveExternal` and `options.load` can each be a function or an array of functions. If an array, the first non-null/undefined return value is used. In both cases, failed resolution/loading will fall back to the defaults, unless an error is thrown. ([#174](https://github.com/rollup/rollup/pull/174)) -* New `intro` and `outro` options – similar to `banner` and `footer` except inserted *inside* any format-specific wrapper -* Multiple var declarations in an export block (e.g. `export let a = 1, b = 2`) are split up to facilitate tree-shaking ([#171](https://github.com/rollup/rollup/issues/171)) -* More informative error when using a missing namespace property ([#169](https://github.com/rollup/rollup/pull/169)) -* Update various dependencies +- **breaking** The `transform` option is no longer passed through to custom loaders. Loaders should only concern themselves with providing source code; transformation will _always_ take place +- `options.transform` functions can return a string, or a `{code, map, ast}` object. Where possible, sourcemap chains will be flattened ([#175](https://github.com/rollup/rollup/pull/175)) +- `options.resolveId`, `options.resolveExternal` and `options.load` can each be a function or an array of functions. If an array, the first non-null/undefined return value is used. In both cases, failed resolution/loading will fall back to the defaults, unless an error is thrown. ([#174](https://github.com/rollup/rollup/pull/174)) +- New `intro` and `outro` options – similar to `banner` and `footer` except inserted _inside_ any format-specific wrapper +- Multiple var declarations in an export block (e.g. `export let a = 1, b = 2`) are split up to facilitate tree-shaking ([#171](https://github.com/rollup/rollup/issues/171)) +- More informative error when using a missing namespace property ([#169](https://github.com/rollup/rollup/pull/169)) +- Update various dependencies ## 0.18.5 -* Allow namespaces to be assigned to variables ([#168](https://github.com/rollup/rollup/issues/168)) -* Promote `chalk` and `source-map-support` to `dependencies`, as they're used by the CLI ([#167](https://github.com/rollup/rollup/pull/167)) +- Allow namespaces to be assigned to variables ([#168](https://github.com/rollup/rollup/issues/168)) +- Promote `chalk` and `source-map-support` to `dependencies`, as they're used by the CLI ([#167](https://github.com/rollup/rollup/pull/167)) ## 0.18.4 -* Make external modules configurable (i.e. `external.config.foo = 'bar'`) without erroring +- Make external modules configurable (i.e. `external.config.foo = 'bar'`) without erroring ## 0.18.3 -* Crop indent exclusion ranges to exclude enclosing quotes ([#166](https://github.com/rollup/rollup/issues/166)) +- Crop indent exclusion ranges to exclude enclosing quotes ([#166](https://github.com/rollup/rollup/issues/166)) ## 0.18.2 -* Include definitions of namespace members that are exported as defaults +- Include definitions of namespace members that are exported as defaults ## 0.18.1 -* Include `acorn.parse` in bundle, remove `sander` from dependencies, simplify build +- Include `acorn.parse` in bundle, remove `sander` from dependencies, simplify build ## 0.18.0 -* Internal rewrite -* Reinstate statically-analysable namespace imports -* Avoid using getters in namespace blocks where possible ([#144](https://github.com/rollup/rollup/issues/144)) -* Track variable aliases ([#96](https://github.com/rollup/rollup/issues/96)) -* Prevent multiline strings being indented ([#164](https://github.com/rollup/rollup/issues/164)) +- Internal rewrite +- Reinstate statically-analysable namespace imports +- Avoid using getters in namespace blocks where possible ([#144](https://github.com/rollup/rollup/issues/144)) +- Track variable aliases ([#96](https://github.com/rollup/rollup/issues/96)) +- Prevent multiline strings being indented ([#164](https://github.com/rollup/rollup/issues/164)) ## 0.17.4 -* Allow imports from hidden directories (replay of [#133](https://github.com/rollup/rollup/issues/133)) +- Allow imports from hidden directories (replay of [#133](https://github.com/rollup/rollup/issues/133)) ## 0.17.3 -* Handle parenthesised default exports ([#136](https://github.com/rollup/rollup/issues/136)) +- Handle parenthesised default exports ([#136](https://github.com/rollup/rollup/issues/136)) ## 0.17.2 -* Allow use of scoped npm packages ([#131](https://github.com/rollup/rollup/issues/131)) +- Allow use of scoped npm packages ([#131](https://github.com/rollup/rollup/issues/131)) ## 0.17.1 -* Allow namespaces to be passed to a function ([#149](https://github.com/rollup/rollup/issues/149)) +- Allow namespaces to be passed to a function ([#149](https://github.com/rollup/rollup/issues/149)) ## 0.17.0 -* Roll back to 0.15.0 and reapply subsequent fixes pending resolution of ([#132](https://github.com/rollup/rollup/issues/132)) and related issues +- Roll back to 0.15.0 and reapply subsequent fixes pending resolution of ([#132](https://github.com/rollup/rollup/issues/132)) and related issues ## 0.16.4 -* Fix import paths with `.` ([#133](https://github.com/rollup/rollup/issues/133)) -* Prevent sourceMappingURL confusion leading to broken sourcemap -* Add code coverage reporting [#130](https://github.com/rollup/rollup/pull/130)) -* Add `modules` property to user-facing `bundle` – an array with `{id}` objects ([#128](https://github.com/rollup/rollup/issues/128)) +- Fix import paths with `.` ([#133](https://github.com/rollup/rollup/issues/133)) +- Prevent sourceMappingURL confusion leading to broken sourcemap +- Add code coverage reporting [#130](https://github.com/rollup/rollup/pull/130)) +- Add `modules` property to user-facing `bundle` – an array with `{id}` objects ([#128](https://github.com/rollup/rollup/issues/128)) ## 0.16.3 -* Prevent adjacent blocks of multiple var declarations causing magic-string failure ([#105](https://github.com/rollup/rollup/issues/105)) +- Prevent adjacent blocks of multiple var declarations causing magic-string failure ([#105](https://github.com/rollup/rollup/issues/105)) ## 0.16.2 -* Top-level function calls and assignments to globals are treated as side-effects, and always included -* Import files from subdirectories of external packages, e.g. `import mod from 'foo/sub/mod'` ([#126](https://github.com/rollup/rollup/issues/126)) +- Top-level function calls and assignments to globals are treated as side-effects, and always included +- Import files from subdirectories of external packages, e.g. `import mod from 'foo/sub/mod'` ([#126](https://github.com/rollup/rollup/issues/126)) ## 0.16.1 -* Handle assignment patterns, and destructured/rest parameters, when analysing scopes -* Fix bug preventing project from self-building (make base `Identifier` class markable) +- Handle assignment patterns, and destructured/rest parameters, when analysing scopes +- Fix bug preventing project from self-building (make base `Identifier` class markable) ## 0.16.0 -* Internal refactoring ([#99](https://github.com/rollup/rollup/pull/99)) -* Optimisation for statically-analysable namespace imports ([#99](https://github.com/rollup/rollup/pull/99)) -* Windows support (theoretically!) ([#117](https://github.com/rollup/rollup/pull/117) / [#119](https://github.com/rollup/rollup/pull/119)) +- Internal refactoring ([#99](https://github.com/rollup/rollup/pull/99)) +- Optimisation for statically-analysable namespace imports ([#99](https://github.com/rollup/rollup/pull/99)) +- Windows support (theoretically!) ([#117](https://github.com/rollup/rollup/pull/117) / [#119](https://github.com/rollup/rollup/pull/119)) ## 0.15.0 -* Load all modules specified by `import` statements, and do tree-shaking synchronously once loading is complete. This results in simpler and faster code, and enables future improvements ([#97](https://github.com/rollup/rollup/pull/97)) -* Only rewrite `foo` as `exports.foo` when it makes sense to ([#92](https://github.com/rollup/rollup/issues/92)) -* Fix bug with shadowed variables that are eventually exported ([#91](https://github.com/rollup/rollup/issues/91)) -* Exclude unused function declarations that happen to modify a used name ([#90](https://github.com/rollup/rollup/pull/90)) -* Simplify internal `Scope` model – scopes always attach to blocks, never function expressions/declarations +- Load all modules specified by `import` statements, and do tree-shaking synchronously once loading is complete. This results in simpler and faster code, and enables future improvements ([#97](https://github.com/rollup/rollup/pull/97)) +- Only rewrite `foo` as `exports.foo` when it makes sense to ([#92](https://github.com/rollup/rollup/issues/92)) +- Fix bug with shadowed variables that are eventually exported ([#91](https://github.com/rollup/rollup/issues/91)) +- Exclude unused function declarations that happen to modify a used name ([#90](https://github.com/rollup/rollup/pull/90)) +- Simplify internal `Scope` model – scopes always attach to blocks, never function expressions/declarations ## 0.14.1 -* `export { name } from './other'` does not create a local binding ([#16](https://github.com/rollup/rollup/issues/16)) -* A single binding can be exported under multiple names ([#18](https://github.com/rollup/rollup/issues/18)) -* `useStrict` option exposed to CLI as `--strict`/`--no-strict` ([#81](https://github.com/rollup/rollup/issues/81)) -* Neater exports from ES6 bundles +- `export { name } from './other'` does not create a local binding ([#16](https://github.com/rollup/rollup/issues/16)) +- A single binding can be exported under multiple names ([#18](https://github.com/rollup/rollup/issues/18)) +- `useStrict` option exposed to CLI as `--strict`/`--no-strict` ([#81](https://github.com/rollup/rollup/issues/81)) +- Neater exports from ES6 bundles ## 0.14.0 -* Internal refactoring -* Correctly deconflict generated default export names ([#72](https://github.com/rollup/rollup/issues/72)) -* Handle `export { x } from 'y'` declarations ([#74](https://github.com/rollup/rollup/issues/74)) -* Dedupe named imports from external modules in ES6 bundles ([#77](https://github.com/rollup/rollup/issues/77)) +- Internal refactoring +- Correctly deconflict generated default export names ([#72](https://github.com/rollup/rollup/issues/72)) +- Handle `export { x } from 'y'` declarations ([#74](https://github.com/rollup/rollup/issues/74)) +- Dedupe named imports from external modules in ES6 bundles ([#77](https://github.com/rollup/rollup/issues/77)) ## 0.13.0 -* Support `banner` and `footer` options ([#66](https://github.com/rollup/rollup/pull/66)) -* Remove pre-existing sourcemap comments ([#66](https://github.com/rollup/rollup/pull/66)) -* Deconflict external imports ([#66](https://github.com/rollup/rollup/pull/66)) -* Use existing AST, if provided ([#66](https://github.com/rollup/rollup/pull/66)) -* Rename internal namespace exports as appropriate ([#66](https://github.com/rollup/rollup/pull/66)) -* Remove uninitialised var declarations that get exported ([#66](https://github.com/rollup/rollup/pull/66)) -* Rename variables named `exports` to avoid conflicts ([#66](https://github.com/rollup/rollup/pull/66)) +- Support `banner` and `footer` options ([#66](https://github.com/rollup/rollup/pull/66)) +- Remove pre-existing sourcemap comments ([#66](https://github.com/rollup/rollup/pull/66)) +- Deconflict external imports ([#66](https://github.com/rollup/rollup/pull/66)) +- Use existing AST, if provided ([#66](https://github.com/rollup/rollup/pull/66)) +- Rename internal namespace exports as appropriate ([#66](https://github.com/rollup/rollup/pull/66)) +- Remove uninitialised var declarations that get exported ([#66](https://github.com/rollup/rollup/pull/66)) +- Rename variables named `exports` to avoid conflicts ([#66](https://github.com/rollup/rollup/pull/66)) ## 0.12.1 -* Don't attempt to mark statements belonging to external modules ([#68](https://github.com/rollup/rollup/issues/68)) -* Correctly deshadow variables that conflict with imports ([#68](https://github.com/rollup/rollup/issues/68)) +- Don't attempt to mark statements belonging to external modules ([#68](https://github.com/rollup/rollup/issues/68)) +- Correctly deshadow variables that conflict with imports ([#68](https://github.com/rollup/rollup/issues/68)) ## 0.12.0 -* Internal re-architecting, resulting in more efficient bundling with reduced memory usage -* Shorthand properties are expanded if necessary ([#61](https://github.com/rollup/rollup/issues/61)) -* Fixed various bugs with bundle external dependencies, particularly when generating ES6 bundles ([#59](https://github.com/rollup/rollup/issues/59)) -* Add `--globals` option to CLI ([#60](https://github.com/rollup/rollup/pull/60)) -* Allow imports of external modules for side-effects ([#55](https://github.com/rollup/rollup/pull/55)) -* Prevent Rollup hanging on non-existent external module ([#54](https://github.com/rollup/rollup/pull/54)) +- Internal re-architecting, resulting in more efficient bundling with reduced memory usage +- Shorthand properties are expanded if necessary ([#61](https://github.com/rollup/rollup/issues/61)) +- Fixed various bugs with bundle external dependencies, particularly when generating ES6 bundles ([#59](https://github.com/rollup/rollup/issues/59)) +- Add `--globals` option to CLI ([#60](https://github.com/rollup/rollup/pull/60)) +- Allow imports of external modules for side-effects ([#55](https://github.com/rollup/rollup/pull/55)) +- Prevent Rollup hanging on non-existent external module ([#54](https://github.com/rollup/rollup/pull/54)) ## 0.11.4 -* Side-effect preservation applies to internal default exports ([#43](https://github.com/rollup/rollup/issues/43)) +- Side-effect preservation applies to internal default exports ([#43](https://github.com/rollup/rollup/issues/43)) ## 0.11.3 -* Class methods are not incorrectly renamed ([#42](https://github.com/rollup/rollup/issues/42)) -* External modules are assigned names before canonical names are determined ([#42](https://github.com/rollup/rollup/issues/42)) +- Class methods are not incorrectly renamed ([#42](https://github.com/rollup/rollup/issues/42)) +- External modules are assigned names before canonical names are determined ([#42](https://github.com/rollup/rollup/issues/42)) ## 0.11.2 -* Correctly handle computed properties (e.g. `foo[bar]`) when discovering dependencies ([#47](https://github.com/rollup/rollup/pull/47)) +- Correctly handle computed properties (e.g. `foo[bar]`) when discovering dependencies ([#47](https://github.com/rollup/rollup/pull/47)) ## 0.11.1 -* Support for `export * from '..'` ([#46](https://github.com/rollup/rollup/pull/46)) +- Support for `export * from '..'` ([#46](https://github.com/rollup/rollup/pull/46)) ## 0.11.0 -* Experimental browser-friendly build (`dist/rollup.browser.js`) ([#25](https://github.com/rollup/rollup/issues/25)) -* Internal re-architecting to make discovery process simpler and more performant -* Preservation of side-effects that happen in a separate module to the affected definition ([#39](https://github.com/rollup/rollup/issues/39)) +- Experimental browser-friendly build (`dist/rollup.browser.js`) ([#25](https://github.com/rollup/rollup/issues/25)) +- Internal re-architecting to make discovery process simpler and more performant +- Preservation of side-effects that happen in a separate module to the affected definition ([#39](https://github.com/rollup/rollup/issues/39)) ## 0.10.0 -* Better sorting algorithm – sorting happens at the module level, rather than the statement level. This avoids certain edge cases -* IIFEs are ignored for the purposes of distinguishing between 'strong' and 'weak' dependencies -* Empty `var` declarations for exported bindings are omitted +- Better sorting algorithm – sorting happens at the module level, rather than the statement level. This avoids certain edge cases +- IIFEs are ignored for the purposes of distinguishing between 'strong' and 'weak' dependencies +- Empty `var` declarations for exported bindings are omitted ## 0.9.1 -* Much faster statement insertion (fixes major 0.9.0 performance regression) +- Much faster statement insertion (fixes major 0.9.0 performance regression) ## 0.9.0 -* BREAKING - `resolvePath` is now `resolveId`. The returned `id` (which by default is a filepath) is passed to the `load` function, which can optionally be overridden, and which is applied to all modules including the entry module. This allows custom resolver and loading logic for integration with third party systems (e.g. JSPM) or, eventually, in-browser usage ([#30](https://github.com/rollup/rollup/issues/30)) -* A statement cannot appear after later statements from the same bundle ([#34](https://github.com/rollup/rollup/issues/34)) -* Tricky cyclical dependencies are handled ([#36](https://github.com/rollup/rollup/issues/36)) -* `sourcemap` option is used by CLI (was omitted previously) +- BREAKING - `resolvePath` is now `resolveId`. The returned `id` (which by default is a filepath) is passed to the `load` function, which can optionally be overridden, and which is applied to all modules including the entry module. This allows custom resolver and loading logic for integration with third party systems (e.g. JSPM) or, eventually, in-browser usage ([#30](https://github.com/rollup/rollup/issues/30)) +- A statement cannot appear after later statements from the same bundle ([#34](https://github.com/rollup/rollup/issues/34)) +- Tricky cyclical dependencies are handled ([#36](https://github.com/rollup/rollup/issues/36)) +- `sourcemap` option is used by CLI (was omitted previously) ## 0.8.3 -* Correctly rename functions that have arguments with the same name ([#32](https://github.com/rollup/rollup/issues/32)) -* Ensure unused default exports are given a legal name ([#33](https://github.com/rollup/rollup/issues/33)) +- Correctly rename functions that have arguments with the same name ([#32](https://github.com/rollup/rollup/issues/32)) +- Ensure unused default exports are given a legal name ([#33](https://github.com/rollup/rollup/issues/33)) ## 0.8.2 -* Support `moduleId` and `moduleName` via CLI ([#24](https://github.com/rollup/rollup/issues/24)) +- Support `moduleId` and `moduleName` via CLI ([#24](https://github.com/rollup/rollup/issues/24)) ## 0.8.1 -* Anonymous functions that are exported as default are converted to named function declarations for correct hoisting, rather than being bound to functions ([#29](https://github.com/rollup/rollup/issues/29)) -* Automatically-generated default export names are deconflicted with local definitions ([#29](https://github.com/rollup/rollup/issues/29)) +- Anonymous functions that are exported as default are converted to named function declarations for correct hoisting, rather than being bound to functions ([#29](https://github.com/rollup/rollup/issues/29)) +- Automatically-generated default export names are deconflicted with local definitions ([#29](https://github.com/rollup/rollup/issues/29)) ## 0.8.0 -* Top-level variable declarations with multiple declarators are split up, to avoid unnecessary code importing and incorrectly-ordered statements ([#26](https://github.com/rollup/rollup/issues/26)) -* `this` at the top level is `undefined` ([#28](https://github.com/rollup/rollup/issues/28)) +- Top-level variable declarations with multiple declarators are split up, to avoid unnecessary code importing and incorrectly-ordered statements ([#26](https://github.com/rollup/rollup/issues/26)) +- `this` at the top level is `undefined` ([#28](https://github.com/rollup/rollup/issues/28)) ## 0.7.8 -* Avoid using `path.parse` - unsupported in node 0.10 +- Avoid using `path.parse` - unsupported in node 0.10 ## 0.7.7 -* Promise `source-map-support` from `devDependencies` to `dependencies` ([#23](https://github.com/rollup/rollup/issues/23)) +- Promise `source-map-support` from `devDependencies` to `dependencies` ([#23](https://github.com/rollup/rollup/issues/23)) ## 0.7.6 -* Better placement of `export default` statements ([#21](https://github.com/rollup/rollup/issues/21)) -* Prevent function calls and property assignments from being treated as rebinding for sake of unbound default exports -* Add `--external foo,bar,baz` option to CLI (equivalent to `external: ['foo', 'bar', 'baz']`) -* Add CLI tests +- Better placement of `export default` statements ([#21](https://github.com/rollup/rollup/issues/21)) +- Prevent function calls and property assignments from being treated as rebinding for sake of unbound default exports +- Add `--external foo,bar,baz` option to CLI (equivalent to `external: ['foo', 'bar', 'baz']`) +- Add CLI tests ## 0.7.5 -* Prevent accidental conflicts with the global namespace ([#20](https://github.com/rollup/rollup/issues/20)) +- Prevent accidental conflicts with the global namespace ([#20](https://github.com/rollup/rollup/issues/20)) ## 0.7.4 -* More precise statement re-ordering to satisfy `export default` constraint (fixes bug introduced in 0.7.3) +- More precise statement re-ordering to satisfy `export default` constraint (fixes bug introduced in 0.7.3) ## 0.7.3 -* Default exports are not bound. To enable this, statements within a module are sorted to retain their original order ([#15](https://github.com/rollup/rollup/issues/15)) -* Better positioning of comments ([#14](https://github.com/rollup/rollup/issues/14)) -* Various fixes to get Travis-CI rigged up +- Default exports are not bound. To enable this, statements within a module are sorted to retain their original order ([#15](https://github.com/rollup/rollup/issues/15)) +- Better positioning of comments ([#14](https://github.com/rollup/rollup/issues/14)) +- Various fixes to get Travis-CI rigged up ## 0.7.2 -* Fix sourcemap paths on Windows ([#6](https://github.com/rollup/rollup/pull/6)) +- Fix sourcemap paths on Windows ([#6](https://github.com/rollup/rollup/pull/6)) ## 0.7.1 -* Named functions can be used as default exports from a bundle -* Method calls are assumed to mutate the owner (i.e. `foo.bar()` mutates `foo`) ([#13](https://github.com/rollup/rollup/issues/13)) -* `options.indent` can be used to control indentation of resulting bundle. `options.true` (default) means 'auto', `options.false` means empty string. Alternatively specify whitespace e.g. `' '` or `'\t'` ([#5](https://github.com/rollup/rollup/issues/5)) +- Named functions can be used as default exports from a bundle +- Method calls are assumed to mutate the owner (i.e. `foo.bar()` mutates `foo`) ([#13](https://github.com/rollup/rollup/issues/13)) +- `options.indent` can be used to control indentation of resulting bundle. `options.true` (default) means 'auto', `options.false` means empty string. Alternatively specify whitespace e.g. `' '` or `'\t'` ([#5](https://github.com/rollup/rollup/issues/5)) ## 0.7.0 -* Ensure statements are always separated by a newline ([#9](https://github.com/rollup/rollup/pull/9)) -* Use CommonJS `exports` correctly (UMD exports) -* Throw error if `moduleName` is required but missing (UMD exports) -* Attach IIFE global to `this` rather than `window` -* Allow names inside bundle to the the names of `Object.prototype` properties ([#12](https://github.com/rollup/rollup/pull/12)) -* Keep exports live ([#11](https://github.com/rollup/rollup/pull/11)) +- Ensure statements are always separated by a newline ([#9](https://github.com/rollup/rollup/pull/9)) +- Use CommonJS `exports` correctly (UMD exports) +- Throw error if `moduleName` is required but missing (UMD exports) +- Attach IIFE global to `this` rather than `window` +- Allow names inside bundle to the the names of `Object.prototype` properties ([#12](https://github.com/rollup/rollup/pull/12)) +- Keep exports live ([#11](https://github.com/rollup/rollup/pull/11)) ## 0.6.5 -* Add sourceMappingURL comment to code, as appropriate -* Higher resolution sourcemaps +- Add sourceMappingURL comment to code, as appropriate +- Higher resolution sourcemaps ## 0.6.4 -* Fix CJS bundling with default export +- Fix CJS bundling with default export ## 0.6.3 -* Fix exports and external module imports with some output formats -* Fix endless cycle bug on Windows ([#3](https://github.com/rollup/rollup/pull/3)) - thanks @Bobris +- Fix exports and external module imports with some output formats +- Fix endless cycle bug on Windows ([#3](https://github.com/rollup/rollup/pull/3)) - thanks @Bobris ## 0.6.2 -* Permit assignments to properties of imported bindings +- Permit assignments to properties of imported bindings ## 0.6.1 -* Support for basic transformers +- Support for basic transformers ## 0.6.0 -* BREAKING - `rollup.rollup` and `bundle.write` both take a single options argument -* BREAKING - external modules must be declared upfront with `options.external: [...]` -* Non-relative module paths will be resolved by looking for `jsnext:main` fields in the appropriate `package.json` files. This behaviour can be overridden by passing an alternative `resolveExternal` function -* Fix sourcemap options -* Include CLI files in npm package (duh) +- BREAKING - `rollup.rollup` and `bundle.write` both take a single options argument +- BREAKING - external modules must be declared upfront with `options.external: [...]` +- Non-relative module paths will be resolved by looking for `jsnext:main` fields in the appropriate `package.json` files. This behaviour can be overridden by passing an alternative `resolveExternal` function +- Fix sourcemap options +- Include CLI files in npm package (duh) ## 0.5.0 -* Command line interface -* Sourcemap generation -* Correct behaviour with `export { x as y } from 'z'` +- Command line interface +- Sourcemap generation +- Correct behaviour with `export { x as y } from 'z'` ## 0.4.1 -* More import name deconflicting +- More import name deconflicting ## 0.4.0 -* Self-hosting! `rollup.rollup` now rolls up rollup -* Fix bug with comments inside a statement later being appended to it -* Prevent shadowing of external modules -* Rewrite computed property identifiers where necessary -* Preserve original statement order where possible -* Internal refactoring +- Self-hosting! `rollup.rollup` now rolls up rollup +- Fix bug with comments inside a statement later being appended to it +- Prevent shadowing of external modules +- Rewrite computed property identifiers where necessary +- Preserve original statement order where possible +- Internal refactoring ## 0.3.1 -* Saner deconflicting -* Rename namespace imports from external modules correctly +- Saner deconflicting +- Rename namespace imports from external modules correctly ## 0.3.0 -* Basic functionality present, mostly spec-compliant +- Basic functionality present, mostly spec-compliant ## 0.2.1 -* Include dist files in npm package (duh) +- Include dist files in npm package (duh) ## 0.2.0 -* First release capable of doing anything useful -* Still lots of basic functionality missing +- First release capable of doing anything useful +- Still lots of basic functionality missing ## 0.1.0 -* Initial experiment +- Initial experiment diff --git a/node_modules/rollup/LICENSE.md b/node_modules/rollup/LICENSE.md index 1f1a46eb9a1b..d5a5c4fb8615 100644 --- a/node_modules/rollup/LICENSE.md +++ b/node_modules/rollup/LICENSE.md @@ -5,143 +5,32 @@ The MIT License (MIT) Copyright (c) 2017 [these people](https://github.com/rollup/rollup/graphs/contributors) -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # Licenses of bundled dependencies The published Rollup artifact additionally contains code with the following licenses: MIT, ISC # Bundled dependencies: -## acorn -License: MIT -By: Marijn Haverbeke, Ingvar Stepanyan, Adrian Heine -Repository: https://github.com/acornjs/acorn.git - -> Copyright (C) 2012-2018 by various contributors (see AUTHORS) -> -> Permission is hereby granted, free of charge, to any person obtaining a copy -> of this software and associated documentation files (the "Software"), to deal -> in the Software without restriction, including without limitation the rights -> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -> copies of the Software, and to permit persons to whom the Software is -> furnished to do so, subject to the following conditions: -> -> The above copyright notice and this permission notice shall be included in -> all copies or substantial portions of the Software. -> -> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -> THE SOFTWARE. - ---------------------------------------- - -## acorn-class-fields -License: MIT -By: Adrian Heine -Repository: https://github.com/acornjs/acorn-class-fields - -> Copyright (C) 2017-2018 by Adrian Heine -> -> Permission is hereby granted, free of charge, to any person obtaining a copy -> of this software and associated documentation files (the "Software"), to deal -> in the Software without restriction, including without limitation the rights -> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -> copies of the Software, and to permit persons to whom the Software is -> furnished to do so, subject to the following conditions: -> -> The above copyright notice and this permission notice shall be included in -> all copies or substantial portions of the Software. -> -> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -> THE SOFTWARE. - ---------------------------------------- - -## acorn-numeric-separator +## @rollup/pluginutils License: MIT -By: Adrian Heine -Repository: https://github.com/acornjs/acorn-numeric-separator - -> Copyright (C) 2017-2018 by Adrian Heine -> -> Permission is hereby granted, free of charge, to any person obtaining a copy -> of this software and associated documentation files (the "Software"), to deal -> in the Software without restriction, including without limitation the rights -> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -> copies of the Software, and to permit persons to whom the Software is -> furnished to do so, subject to the following conditions: -> -> The above copyright notice and this permission notice shall be included in -> all copies or substantial portions of the Software. -> -> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -> THE SOFTWARE. +By: Rich Harris +Repository: rollup/plugins --------------------------------------- -## acorn-private-class-elements +## acorn License: MIT -By: Adrian Heine -Repository: https://github.com/acornjs/acorn-private-class-elements +By: Marijn Haverbeke, Ingvar Stepanyan, Adrian Heine +Repository: https://github.com/acornjs/acorn.git -> Copyright (C) 2017-2018 by Adrian Heine -> -> Permission is hereby granted, free of charge, to any person obtaining a copy -> of this software and associated documentation files (the "Software"), to deal -> in the Software without restriction, including without limitation the rights -> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -> copies of the Software, and to permit persons to whom the Software is -> furnished to do so, subject to the following conditions: +> MIT License > -> The above copyright notice and this permission notice shall be included in -> all copies or substantial portions of the Software. -> -> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -> THE SOFTWARE. - ---------------------------------------- - -## acorn-static-class-features -License: MIT -By: Adrian Heine -Repository: https://github.com/acornjs/acorn-static-class-features - -> Copyright (C) 2017-2018 by Adrian Heine +> Copyright (C) 2012-2022 by various contributors (see AUTHORS) > > Permission is hereby granted, free of charge, to any person obtaining a copy > of this software and associated documentation files (the "Software"), to deal @@ -168,7 +57,9 @@ License: MIT By: Marijn Haverbeke, Ingvar Stepanyan, Adrian Heine Repository: https://github.com/acornjs/acorn.git -> Copyright (C) 2012-2018 by various contributors (see AUTHORS) +> MIT License +> +> Copyright (C) 2012-2020 by various contributors (see AUTHORS) > > Permission is hereby granted, free of charge, to any person obtaining a copy > of this software and associated documentation files (the "Software"), to deal @@ -218,6 +109,16 @@ License: MIT By: Sindre Sorhus Repository: sindresorhus/binary-extensions +> MIT License +> +> Copyright (c) 2019 Sindre Sorhus (https://sindresorhus.com), Paul Miller (https://paulmillr.com) +> +> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + --------------------------------------- ## braces @@ -249,13 +150,6 @@ Repository: micromatch/braces --------------------------------------- -## camelcase -License: MIT -By: Sindre Sorhus -Repository: sindresorhus/camelcase - ---------------------------------------- - ## chokidar License: MIT By: Paul Miller, Elan Shanker @@ -305,12 +199,15 @@ License: MIT By: Sindre Sorhus Repository: sindresorhus/date-time ---------------------------------------- - -## decamelize -License: MIT -By: Sindre Sorhus -Repository: sindresorhus/decamelize +> MIT License +> +> Copyright (c) Sindre Sorhus (https://sindresorhus.com) +> +> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --------------------------------------- @@ -400,6 +297,16 @@ License: MIT By: Sindre Sorhus Repository: sindresorhus/is-binary-path +> MIT License +> +> Copyright (c) 2019 Sindre Sorhus (https://sindresorhus.com), Paul Miller (https://paulmillr.com) +> +> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + --------------------------------------- ## is-extglob @@ -518,35 +425,6 @@ Repository: https://github.com/rich-harris/magic-string --------------------------------------- -## micromatch -License: MIT -By: Jon Schlinkert, Amila Welihinda, Bogdan Chadkin, Brian Woodward, Devon Govett, Elan Shanker, Fabrício Matté, Martin Kolárik, Olsten Larck, Paul Miller, Tom Byrer, Tyler Akins, Peter Bright -Repository: micromatch/micromatch - -> The MIT License (MIT) -> -> Copyright (c) 2014-present, Jon Schlinkert. -> -> Permission is hereby granted, free of charge, to any person obtaining a copy -> of this software and associated documentation files (the "Software"), to deal -> in the Software without restriction, including without limitation the rights -> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -> copies of the Software, and to permit persons to whom the Software is -> furnished to do so, subject to the following conditions: -> -> The above copyright notice and this permission notice shall be included in -> all copies or substantial portions of the Software. -> -> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -> THE SOFTWARE. - ---------------------------------------- - ## minimalistic-assert License: ISC Repository: https://github.com/calvinmetcalf/minimalistic-assert.git @@ -601,6 +479,16 @@ License: MIT By: Sindre Sorhus Repository: sindresorhus/parse-ms +> MIT License +> +> Copyright (c) Sindre Sorhus (sindresorhus.com) +> +> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + --------------------------------------- ## picomatch @@ -637,6 +525,16 @@ License: MIT By: Sindre Sorhus Repository: sindresorhus/pretty-bytes +> MIT License +> +> Copyright (c) Sindre Sorhus (https://sindresorhus.com) +> +> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + --------------------------------------- ## pretty-ms @@ -644,6 +542,16 @@ License: MIT By: Sindre Sorhus Repository: sindresorhus/pretty-ms +> MIT License +> +> Copyright (c) Sindre Sorhus (sindresorhus.com) +> +> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + --------------------------------------- ## readdirp @@ -675,20 +583,6 @@ Repository: git://github.com/paulmillr/readdirp.git --------------------------------------- -## require-relative -License: MIT -By: Valerio Proietti -Repository: git://github.com/kamicane/require-relative.git - ---------------------------------------- - -## rollup-pluginutils -License: MIT -By: Rich Harris -Repository: rollup/rollup-pluginutils - ---------------------------------------- - ## signal-exit License: ISC By: Ben Coe @@ -747,6 +641,16 @@ License: MIT By: Sindre Sorhus Repository: sindresorhus/time-zone +> MIT License +> +> Copyright (c) Sindre Sorhus (https://sindresorhus.com) +> +> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + --------------------------------------- ## to-regex-range diff --git a/node_modules/rollup/README.md b/node_modules/rollup/README.md index 303e43db2553..fb297a9acba1 100644 --- a/node_modules/rollup/README.md +++ b/node_modules/rollup/README.md @@ -1,4 +1,6 @@ -# Rollup +

+ +

@@ -19,14 +21,13 @@ license - - dependency status - - - Join the chat at https://gitter.im/rollup/rollup + + + Join the chat at https://is.gd/rollup_chat

+

Rollup

## Overview @@ -34,7 +35,7 @@ Rollup is a module bundler for JavaScript which compiles small pieces of code in ## Quick Start Guide -Install with `npm install --global rollup`. Rollup can be used either through a [command line interface](https://rollupjs.org/#command-line-reference) with an optional configuration file, or else through its [JavaScript API](https://rollupjs.org/guide/en/#javascript-api). Run `rollup --help` to see the available options and parameters. The starter project templates, [rollup-starter-lib](https://github.com/rollup/rollup-starter-lib) and [rollup-starter-app](https://github.com/rollup/rollup-starter-app), demonstrate common configuration options, and more detailed instructions are available throughout the [user guide](https://rollupjs.org/). +Install with `npm install --global rollup`. Rollup can be used either through a [command line interface](https://rollupjs.org/#command-line-reference) with an optional configuration file or else through its [JavaScript API](https://rollupjs.org/guide/en/#javascript-api). Run `rollup --help` to see the available options and parameters. The starter project templates, [rollup-starter-lib](https://github.com/rollup/rollup-starter-lib) and [rollup-starter-app](https://github.com/rollup/rollup-starter-app), demonstrate common configuration options, and more detailed instructions are available throughout the [user guide](https://rollupjs.org/). ### Commands @@ -65,20 +66,20 @@ rollup main.js --format umd --name "myBundle" --file bundle.js Developing software is usually easier if you break your project into smaller separate pieces, since that often removes unexpected interactions and dramatically reduces the complexity of the problems you'll need to solve, and simply writing smaller projects in the first place [isn't necessarily the answer](https://medium.com/@Rich_Harris/small-modules-it-s-not-quite-that-simple-3ca532d65de4). Unfortunately, JavaScript has not historically included this capability as a core feature in the language. -This finally changed with ES modules support in JavaScript, which provides a syntax for importing and exporting functions and data so they can be shared between separate scripts. The specification is now implemented in all major browsers and in Node.js behind the --experimental-modules flag for ".mjs" files. Rollup allows you to write your code using this module system, either outputting optimized ES modules for use in these native environments, or compiling it back down to existing supported formats such as CommonJS modules, AMD modules, and IIFE-style scripts. This means that you get to *write future-proof code*, and you also get the tremendous benefits of... +This finally changed with ES modules support in JavaScript, which provides a syntax for importing and exporting functions and data so they can be shared between separate scripts. Most browsers and Node.js support ES modules. However, Node.js releases before 12.17 support ES modules only behind the `--experimental-modules` flag, and older browsers like Internet Explorer do not support ES modules at all. Rollup allows you to write your code using ES modules, and run your application even in environments that do not support ES modules natively. For environments that support them, Rollup can output optimized ES modules; for environments that don't, Rollup can compile your code to other formats such as CommonJS modules, AMD modules, and IIFE-style scripts. This means that you get to _write future-proof code_, and you also get the tremendous benefits of... ## Tree Shaking In addition to enabling the use of ES modules, Rollup also statically analyzes and optimizes the code you are importing, and will exclude anything that isn't actually used. This allows you to build on top of existing tools and modules without adding extra dependencies or bloating the size of your project. -For example, with CommonJS, the *entire tool or library must be imported*. +For example, with CommonJS, the _entire tool or library must be imported_. ```js // import the entire utils object with CommonJS -var utils = require( 'utils' ); +var utils = require('utils'); var query = 'Rollup'; // use the ajax method of the utils object -utils.ajax( 'https://api.example.com?search=' + query ).then( handleResponse ); +utils.ajax('https://api.example.com?search=' + query).then(handleResponse); ``` But with ES modules, instead of importing the whole `utils` object, we can just import the one `ajax` function we need: @@ -88,7 +89,7 @@ But with ES modules, instead of importing the whole `utils` object, we can just import { ajax } from 'utils'; var query = 'Rollup'; // call the ajax function -ajax( 'https://api.example.com?search=' + query ).then( handleResponse ); +ajax('https://api.example.com?search=' + query).then(handleResponse); ``` Because Rollup includes the bare minimum, it results in lighter, faster, and less complicated libraries and applications. Since this approach is based on explicit `import` and `export` statements, it is vastly more effective than simply running an automated minifier to detect unused variables in the compiled output code. @@ -101,13 +102,11 @@ Rollup can import existing CommonJS modules [through a plugin](https://github.co ### Publishing ES Modules -To make sure your ES modules are immediately usable by tools that work with CommonJS such as Node.js and webpack, you can use Rollup to compile to UMD or CommonJS format, and then point to that compiled version with the `main` property in your `package.json` file. If your `package.json` file also has a `module` field, ES-module-aware tools like Rollup and [webpack 2](https://webpack.js.org/) will [import the ES module version](https://github.com/rollup/rollup/wiki/pkg.module) directly. +To make sure your ES modules are immediately usable by tools that work with CommonJS such as Node.js and webpack, you can use Rollup to compile to UMD or CommonJS format, and then point to that compiled version with the `main` property in your `package.json` file. If your `package.json` file also has a `module` field, ES-module-aware tools like Rollup and [webpack](https://webpack.js.org/) will [import the ES module version](https://github.com/rollup/rollup/wiki/pkg.module) directly. ## Contributors -This project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)]. - - +This project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)]. ## Backers @@ -115,23 +114,11 @@ Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com - ## Sponsors Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/rollup#sponsor)] - - - - - - - - - - - - + ## License diff --git a/node_modules/rollup/dist/bin/rollup b/node_modules/rollup/dist/bin/rollup index 162ef6ee8b5e..2cac3797c7d5 100755 --- a/node_modules/rollup/dist/bin/rollup +++ b/node_modules/rollup/dist/bin/rollup @@ -2,9 +2,8 @@ /* @license - Rollup.js v2.18.0 - Mon, 22 Jun 2020 04:16:05 GMT - commit ee6ef99935fbd24a3e30ef05b0b98e4019f983c6 - + Rollup.js v2.79.1 + Thu, 22 Sep 2022 04:55:29 GMT - commit 69ff4181e701a0fe0026d0ba147f31bc86beffa8 https://github.com/rollup/rollup @@ -12,1177 +11,1229 @@ */ 'use strict'; -Object.defineProperty(exports, '__esModule', { value: true }); +Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } }); -var rollup = require('../shared/rollup.js'); -var path = require('path'); -var util = require('util'); -var mergeOptions = require('../shared/mergeOptions.js'); -var loadConfigFile_js = require('../shared/loadConfigFile.js'); +const process$1 = require('process'); +const rollup = require('../shared/rollup.js'); +const require$$2 = require('util'); +const require$$0$1 = require('fs'); +const require$$0 = require('path'); +const mergeOptions = require('../shared/mergeOptions.js'); +const loadConfigFile_js = require('../shared/loadConfigFile.js'); +require('perf_hooks'); require('crypto'); -var fs = require('fs'); require('events'); -var module$1 = require('module'); require('url'); - -var help = "rollup version __VERSION__\n=====================================\n\nUsage: rollup [options] \n\nBasic options:\n\n-c, --config Use this config file (if argument is used but value\n is unspecified, defaults to rollup.config.js)\n-d, --dir Directory for chunks (if absent, prints to stdout)\n-e, --external Comma-separate list of module IDs to exclude\n-f, --format Type of output (amd, cjs, es, iife, umd, system)\n-g, --globals Comma-separate list of `moduleID:Global` pairs\n-h, --help Show this help message\n-i, --input Input (alternative to )\n-m, --sourcemap Generate sourcemap (`-m inline` for inline map)\n-n, --name Name for UMD export\n-o, --file Single output file (if absent, prints to stdout)\n-p, --plugin Use the plugin specified (may be repeated)\n-v, --version Show version number\n-w, --watch Watch files in bundle and rebuild on changes\n--amd.id ID for AMD module (default is anonymous)\n--amd.define Function to use in place of `define`\n--assetFileNames Name pattern for emitted assets\n--banner Code to insert at top of bundle (outside wrapper)\n--chunkFileNames Name pattern for emitted secondary chunks\n--compact Minify wrapper code\n--context Specify top-level `this` value\n--entryFileNames Name pattern for emitted entry chunks\n--environment Settings passed to config file (see example)\n--no-esModule Do not add __esModule property\n--exports Specify export mode (auto, default, named, none)\n--extend Extend global variable defined by --name\n--no-externalLiveBindings Do not generate code to support live bindings\n--footer Code to insert at end of bundle (outside wrapper)\n--no-freeze Do not freeze namespace objects\n--no-hoistTransitiveImports Do not hoist transitive imports into entry chunks\n--no-indent Don't indent result\n--no-interop Do not include interop block\n--inlineDynamicImports Create single bundle when using dynamic imports\n--intro Code to insert at top of bundle (inside wrapper)\n--minifyInternalExports Force or disable minification of internal exports\n--namespaceToStringTag Create proper `.toString` methods for namespaces\n--noConflict Generate a noConflict method for UMD globals\n--outro Code to insert at end of bundle (inside wrapper)\n--preferConst Use `const` instead of `var` for exports\n--no-preserveEntrySignatures Avoid facade chunks for entry points\n--preserveModules Preserve module structure\n--preserveSymlinks Do not follow symlinks when resolving files\n--shimMissingExports Create shim variables for missing exports\n--silent Don't print warnings\n--sourcemapExcludeSources Do not include source code in source maps\n--sourcemapFile Specify bundle position for source maps\n--no-stdin do not read \"-\" from stdin\n--no-strict Don't emit `\"use strict\";` in the generated modules\n--strictDeprecations Throw errors for deprecated features\n--systemNullSetters Replace empty SystemJS setters with `null`\n--no-treeshake Disable tree-shaking optimisations\n--no-treeshake.annotations Ignore pure call annotations\n--no-treeshake.moduleSideEffects Assume modules have no side-effects\n--no-treeshake.propertyReadSideEffects Ignore property access side-effects\n--no-treeshake.tryCatchDeoptimization Do not turn off try-catch-tree-shaking\n--no-treeshake.unknownGlobalSideEffects Assume unknown globals do not throw\n--waitForBundleInput Wait for bundle input files\n--watch.buildDelay Throttle watch rebuilds\n--no-watch.clearScreen Do not clear the screen when rebuilding\n--watch.skipWrite Do not write files to disk when watching\n--watch.exclude Exclude files from being watched\n--watch.include Limit watching to specified files\n\nExamples:\n\n# use settings in config file\nrollup -c\n\n# in config file, process.env.INCLUDE_DEPS === 'true'\n# and process.env.BUILD === 'production'\nrollup -c --environment INCLUDE_DEPS,BUILD:production\n\n# create CommonJS bundle.js from src/main.js\nrollup --format=cjs --file=bundle.js -- src/main.js\n\n# create self-executing IIFE using `window.jQuery`\n# and `window._` as external globals\nrollup -f iife --globals jquery:jQuery,lodash:_ \\\n -i src/app.js -o build/app.js -m build/app.js.map\n\nNotes:\n\n* When piping to stdout, only inline sourcemaps are permitted\n\nFor more information visit https://rollupjs.org\n"; - -const preserveCamelCase = string => { - let isLastCharLower = false; - let isLastCharUpper = false; - let isLastLastCharUpper = false; - - for (let i = 0; i < string.length; i++) { - const character = string[i]; - - if (isLastCharLower && /[a-zA-Z]/.test(character) && character.toUpperCase() === character) { - string = string.slice(0, i) + '-' + string.slice(i); - isLastCharLower = false; - isLastLastCharUpper = isLastCharUpper; - isLastCharUpper = true; - i++; - } else if (isLastCharUpper && isLastLastCharUpper && /[a-zA-Z]/.test(character) && character.toLowerCase() === character) { - string = string.slice(0, i - 1) + '-' + string.slice(i - 1); - isLastLastCharUpper = isLastCharUpper; - isLastCharUpper = false; - isLastCharLower = true; - } else { - isLastCharLower = character.toLowerCase() === character && character.toUpperCase() !== character; - isLastLastCharUpper = isLastCharUpper; - isLastCharUpper = character.toUpperCase() === character && character.toLowerCase() !== character; - } - } - - return string; -}; - -const camelCase = (input, options) => { - if (!(typeof input === 'string' || Array.isArray(input))) { - throw new TypeError('Expected the input to be `string | string[]`'); - } - - options = Object.assign({ - pascalCase: false - }, options); - - const postProcess = x => options.pascalCase ? x.charAt(0).toUpperCase() + x.slice(1) : x; - - if (Array.isArray(input)) { - input = input.map(x => x.trim()) - .filter(x => x.length) - .join('-'); - } else { - input = input.trim(); - } - - if (input.length === 0) { - return ''; - } - - if (input.length === 1) { - return options.pascalCase ? input.toUpperCase() : input.toLowerCase(); - } - - const hasUpperCase = input !== input.toLowerCase(); - - if (hasUpperCase) { - input = preserveCamelCase(input); - } - - input = input - .replace(/^[_.\- ]+/, '') - .toLowerCase() - .replace(/[_.\- ]+(\w|$)/g, (_, p1) => p1.toUpperCase()) - .replace(/\d+(\w|$)/g, m => m.toUpperCase()); - - return postProcess(input); -}; - -var camelcase = camelCase; -// TODO: Remove this for the next major release -var _default = camelCase; -camelcase.default = _default; - -var decamelize = function (str, sep) { - if (typeof str !== 'string') { - throw new TypeError('Expected a string'); - } - - sep = typeof sep === 'undefined' ? '_' : sep; - - return str - .replace(/([a-z\d])([A-Z])/g, '$1' + sep + '$2') - .replace(/([A-Z]+)([A-Z][a-z\d]+)/g, '$1' + sep + '$2') - .toLowerCase(); -}; - -// take an un-split argv string and tokenize it. -var tokenizeArgString = function (argString) { - if (Array.isArray(argString)) { - return argString.map(e => typeof e !== 'string' ? e + '' : e) - } - - argString = argString.trim(); - - let i = 0; - let prevC = null; - let c = null; - let opening = null; - const args = []; - - for (let ii = 0; ii < argString.length; ii++) { - prevC = c; - c = argString.charAt(ii); - - // split on spaces unless we're in quotes. - if (c === ' ' && !opening) { - if (!(prevC === ' ')) { - i++; - } - continue - } - - // don't split the string if we're in matching - // opening or closing single and double quotes. - if (c === opening) { - opening = null; - } else if ((c === "'" || c === '"') && !opening) { - opening = c; +require('tty'); + +const help = "rollup version __VERSION__\n=====================================\n\nUsage: rollup [options] \n\nBasic options:\n\n-c, --config Use this config file (if argument is used but value\n is unspecified, defaults to rollup.config.js)\n-d, --dir Directory for chunks (if absent, prints to stdout)\n-e, --external Comma-separate list of module IDs to exclude\n-f, --format Type of output (amd, cjs, es, iife, umd, system)\n-g, --globals Comma-separate list of `moduleID:Global` pairs\n-h, --help Show this help message\n-i, --input Input (alternative to )\n-m, --sourcemap Generate sourcemap (`-m inline` for inline map)\n-n, --name Name for UMD export\n-o, --file Single output file (if absent, prints to stdout)\n-p, --plugin Use the plugin specified (may be repeated)\n-v, --version Show version number\n-w, --watch Watch files in bundle and rebuild on changes\n--amd.id ID for AMD module (default is anonymous)\n--amd.autoId Generate the AMD ID based off the chunk name\n--amd.basePath Path to prepend to auto generated AMD ID\n--amd.define Function to use in place of `define`\n--amd.forceJsExtensionForImports Use `.js` extension in AMD imports\n--assetFileNames Name pattern for emitted assets\n--banner Code to insert at top of bundle (outside wrapper)\n--chunkFileNames Name pattern for emitted secondary chunks\n--compact Minify wrapper code\n--context Specify top-level `this` value\n--entryFileNames Name pattern for emitted entry chunks\n--environment Settings passed to config file (see example)\n--no-esModule Do not add __esModule property\n--exports Specify export mode (auto, default, named, none)\n--extend Extend global variable defined by --name\n--no-externalLiveBindings Do not generate code to support live bindings\n--failAfterWarnings Exit with an error if the build produced warnings\n--footer Code to insert at end of bundle (outside wrapper)\n--no-freeze Do not freeze namespace objects\n--no-hoistTransitiveImports Do not hoist transitive imports into entry chunks\n--no-indent Don't indent result\n--no-interop Do not include interop block\n--inlineDynamicImports Create single bundle when using dynamic imports\n--intro Code to insert at top of bundle (inside wrapper)\n--minifyInternalExports Force or disable minification of internal exports\n--namespaceToStringTag Create proper `.toString` methods for namespaces\n--noConflict Generate a noConflict method for UMD globals\n--outro Code to insert at end of bundle (inside wrapper)\n--preferConst Use `const` instead of `var` for exports\n--no-preserveEntrySignatures Avoid facade chunks for entry points\n--preserveModules Preserve module structure\n--preserveModulesRoot Put preserved modules under this path at root level\n--preserveSymlinks Do not follow symlinks when resolving files\n--no-sanitizeFileName Do not replace invalid characters in file names\n--shimMissingExports Create shim variables for missing exports\n--silent Don't print warnings\n--sourcemapBaseUrl Emit absolute sourcemap URLs with given base\n--sourcemapExcludeSources Do not include source code in source maps\n--sourcemapFile Specify bundle position for source maps\n--stdin=ext Specify file extension used for stdin input\n--no-stdin Do not read \"-\" from stdin\n--no-strict Don't emit `\"use strict\";` in the generated modules\n--strictDeprecations Throw errors for deprecated features\n--systemNullSetters Replace empty SystemJS setters with `null`\n--no-treeshake Disable tree-shaking optimisations\n--no-treeshake.annotations Ignore pure call annotations\n--no-treeshake.moduleSideEffects Assume modules have no side-effects\n--no-treeshake.propertyReadSideEffects Ignore property access side-effects\n--no-treeshake.tryCatchDeoptimization Do not turn off try-catch-tree-shaking\n--no-treeshake.unknownGlobalSideEffects Assume unknown globals do not throw\n--waitForBundleInput Wait for bundle input files\n--watch.buildDelay Throttle watch rebuilds\n--no-watch.clearScreen Do not clear the screen when rebuilding\n--watch.skipWrite Do not write files to disk when watching\n--watch.exclude Exclude files from being watched\n--watch.include Limit watching to specified files\n--watch.onStart Shell command to run on `\"START\"` event\n--watch.onBundleStart Shell command to run on `\"BUNDLE_START\"` event\n--watch.onBundleEnd Shell command to run on `\"BUNDLE_END\"` event\n--watch.onEnd Shell command to run on `\"END\"` event\n--watch.onError Shell command to run on `\"ERROR\"` event\n--validate Validate output\n\nExamples:\n\n# use settings in config file\nrollup -c\n\n# in config file, process.env.INCLUDE_DEPS === 'true'\n# and process.env.BUILD === 'production'\nrollup -c --environment INCLUDE_DEPS,BUILD:production\n\n# create CommonJS bundle.js from src/main.js\nrollup --format=cjs --file=bundle.js -- src/main.js\n\n# create self-executing IIFE using `window.jQuery`\n# and `window._` as external globals\nrollup -f iife --globals jquery:jQuery,lodash:_ \\\n -i src/app.js -o build/app.js -m build/app.js.map\n\nNotes:\n\n* When piping to stdout, only inline sourcemaps are permitted\n\nFor more information visit https://rollupjs.org\n"; + +/** + * @license + * Copyright (c) 2016, Contributors + * SPDX-License-Identifier: ISC + */ +function camelCase(str) { + // Handle the case where an argument is provided as camel case, e.g., fooBar. + // by ensuring that the string isn't already mixed case: + const isCamelCase = str !== str.toLowerCase() && str !== str.toUpperCase(); + if (!isCamelCase) { + str = str.toLowerCase(); } - - if (!args[i]) args[i] = ''; - args[i] += c; - } - - return args -}; - -function parse (args, opts) { - opts = Object.assign(Object.create(null), opts); - // allow a string argument to be passed in rather - // than an argv array. - args = tokenizeArgString(args); - - // aliases might have transitive relationships, normalize this. - const aliases = combineAliases(Object.assign(Object.create(null), opts.alias)); - const configuration = Object.assign({ - 'boolean-negation': true, - 'camel-case-expansion': true, - 'combine-arrays': false, - 'dot-notation': true, - 'duplicate-arguments-array': true, - 'flatten-duplicate-arrays': true, - 'greedy-arrays': true, - 'halt-at-non-option': false, - 'nargs-eats-options': false, - 'negation-prefix': 'no-', - 'parse-numbers': true, - 'populate--': false, - 'set-placeholder-key': false, - 'short-option-groups': true, - 'strip-aliased': false, - 'strip-dashed': false, - 'unknown-options-as-args': false - }, opts.configuration); - const defaults = Object.assign(Object.create(null), opts.default); - const configObjects = opts.configObjects || []; - const envPrefix = opts.envPrefix; - const notFlagsOption = configuration['populate--']; - const notFlagsArgv = notFlagsOption ? '--' : '_'; - const newAliases = Object.create(null); - const defaulted = Object.create(null); - // allow a i18n handler to be passed in, default to a fake one (util.format). - const __ = opts.__ || util.format; - const flags = { - aliases: Object.create(null), - arrays: Object.create(null), - bools: Object.create(null), - strings: Object.create(null), - numbers: Object.create(null), - counts: Object.create(null), - normalize: Object.create(null), - configs: Object.create(null), - nargs: Object.create(null), - coercions: Object.create(null), - keys: [] - }; - const negative = /^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/; - const negatedBoolean = new RegExp('^--' + configuration['negation-prefix'] + '(.+)') - - ;[].concat(opts.array).filter(Boolean).forEach(function (opt) { - const key = opt.key || opt; - - // assign to flags[bools|strings|numbers] - const assignment = Object.keys(opt).map(function (key) { - return ({ - boolean: 'bools', - string: 'strings', - number: 'numbers' - })[key] - }).filter(Boolean).pop(); - - // assign key to be coerced - if (assignment) { - flags[assignment][key] = true; + if (str.indexOf('-') === -1 && str.indexOf('_') === -1) { + return str; } - - flags.arrays[key] = true; - flags.keys.push(key); - }) - - ;[].concat(opts.boolean).filter(Boolean).forEach(function (key) { - flags.bools[key] = true; - flags.keys.push(key); - }) - - ;[].concat(opts.string).filter(Boolean).forEach(function (key) { - flags.strings[key] = true; - flags.keys.push(key); - }) - - ;[].concat(opts.number).filter(Boolean).forEach(function (key) { - flags.numbers[key] = true; - flags.keys.push(key); - }) - - ;[].concat(opts.count).filter(Boolean).forEach(function (key) { - flags.counts[key] = true; - flags.keys.push(key); - }) - - ;[].concat(opts.normalize).filter(Boolean).forEach(function (key) { - flags.normalize[key] = true; - flags.keys.push(key); - }); - - Object.keys(opts.narg || {}).forEach(function (k) { - flags.nargs[k] = opts.narg[k]; - flags.keys.push(k); - }); - - Object.keys(opts.coerce || {}).forEach(function (k) { - flags.coercions[k] = opts.coerce[k]; - flags.keys.push(k); - }); - - if (Array.isArray(opts.config) || typeof opts.config === 'string') { -[].concat(opts.config).filter(Boolean).forEach(function (key) { - flags.configs[key] = true; - }); - } else { - Object.keys(opts.config || {}).forEach(function (k) { - flags.configs[k] = opts.config[k]; - }); - } - - // create a lookup table that takes into account all - // combinations of aliases: {f: ['foo'], foo: ['f']} - extendAliases(opts.key, aliases, opts.default, flags.arrays); - - // apply default values to all aliases. - Object.keys(defaults).forEach(function (key) { - (flags.aliases[key] || []).forEach(function (alias) { - defaults[alias] = defaults[key]; - }); - }); - - let error = null; - checkConfiguration(); - - let notFlags = []; - - const argv = Object.assign(Object.create(null), { _: [] }); - // TODO(bcoe): for the first pass at removing object prototype we didn't - // remove all prototypes from objects returned by this API, we might want - // to gradually move towards doing so. - const argvReturn = {}; - - for (let i = 0; i < args.length; i++) { - const arg = args[i]; - let broken; - let key; - let letters; - let m; - let next; - let value; - - // any unknown option (except for end-of-options, "--") - if (arg !== '--' && isUnknownOptionAsArg(arg)) { - argv._.push(arg); - // -- separated by = - } else if (arg.match(/^--.+=/) || ( - !configuration['short-option-groups'] && arg.match(/^-.+=/) - )) { - // Using [\s\S] instead of . because js doesn't support the - // 'dotall' regex modifier. See: - // http://stackoverflow.com/a/1068308/13216 - m = arg.match(/^--?([^=]+)=([\s\S]*)$/); - - // arrays format = '--f=a b c' - if (checkAllAliases(m[1], flags.arrays)) { - i = eatArray(i, m[1], args, m[2]); - } else if (checkAllAliases(m[1], flags.nargs) !== false) { - // nargs format = '--f=monkey washing cat' - i = eatNargs(i, m[1], args, m[2]); - } else { - setArg(m[1], m[2]); - } - } else if (arg.match(negatedBoolean) && configuration['boolean-negation']) { - key = arg.match(negatedBoolean)[1]; - setArg(key, checkAllAliases(key, flags.arrays) ? [false] : false); - - // -- separated by space. - } else if (arg.match(/^--.+/) || ( - !configuration['short-option-groups'] && arg.match(/^-[^-]+/) - )) { - key = arg.match(/^--?(.+)/)[1]; - - if (checkAllAliases(key, flags.arrays)) { - // array format = '--foo a b c' - i = eatArray(i, key, args); - } else if (checkAllAliases(key, flags.nargs) !== false) { - // nargs format = '--foo a b c' - // should be truthy even if: flags.nargs[key] === 0 - i = eatNargs(i, key, args); - } else { - next = args[i + 1]; - - if (next !== undefined && (!next.match(/^-/) || - next.match(negative)) && - !checkAllAliases(key, flags.bools) && - !checkAllAliases(key, flags.counts)) { - setArg(key, next); - i++; - } else if (/^(true|false)$/.test(next)) { - setArg(key, next); - i++; - } else { - setArg(key, defaultValue(key)); + else { + let camelcase = ''; + let nextChrUpper = false; + const leadingHyphens = str.match(/^-+/); + for (let i = leadingHyphens ? leadingHyphens[0].length : 0; i < str.length; i++) { + let chr = str.charAt(i); + if (nextChrUpper) { + nextChrUpper = false; + chr = chr.toUpperCase(); + } + if (i !== 0 && (chr === '-' || chr === '_')) { + nextChrUpper = true; + } + else if (chr !== '-' && chr !== '_') { + camelcase += chr; + } } - } - - // dot-notation flag separated by '='. - } else if (arg.match(/^-.\..+=/)) { - m = arg.match(/^-([^=]+)=([\s\S]*)$/); - setArg(m[1], m[2]); - - // dot-notation flag separated by space. - } else if (arg.match(/^-.\..+/) && !arg.match(negative)) { - next = args[i + 1]; - key = arg.match(/^-(.\..+)/)[1]; - - if (next !== undefined && !next.match(/^-/) && - !checkAllAliases(key, flags.bools) && - !checkAllAliases(key, flags.counts)) { - setArg(key, next); - i++; - } else { - setArg(key, defaultValue(key)); - } - } else if (arg.match(/^-[^-]+/) && !arg.match(negative)) { - letters = arg.slice(1, -1).split(''); - broken = false; - - for (let j = 0; j < letters.length; j++) { - next = arg.slice(j + 2); - - if (letters[j + 1] && letters[j + 1] === '=') { - value = arg.slice(j + 3); - key = letters[j]; - - if (checkAllAliases(key, flags.arrays)) { - // array format = '-f=a b c' - i = eatArray(i, key, args, value); - } else if (checkAllAliases(key, flags.nargs) !== false) { - // nargs format = '-f=monkey washing cat' - i = eatNargs(i, key, args, value); - } else { - setArg(key, value); - } - - broken = true; - break + return camelcase; + } +} +function decamelize(str, joinString) { + const lowercase = str.toLowerCase(); + joinString = joinString || '-'; + let notCamelcase = ''; + for (let i = 0; i < str.length; i++) { + const chrLower = lowercase.charAt(i); + const chrString = str.charAt(i); + if (chrLower !== chrString && i > 0) { + notCamelcase += `${joinString}${lowercase.charAt(i)}`; } - - if (next === '-') { - setArg(letters[j], next); - continue + else { + notCamelcase += chrString; } + } + return notCamelcase; +} +function looksLikeNumber(x) { + if (x === null || x === undefined) + return false; + // if loaded from config, may already be a number. + if (typeof x === 'number') + return true; + // hexadecimal. + if (/^0x[0-9a-f]+$/i.test(x)) + return true; + // don't treat 0123 as a number; as it drops the leading '0'. + if (/^0[^.]/.test(x)) + return false; + return /^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x); +} - // current letter is an alphabetic character and next value is a number - if (/[A-Za-z]/.test(letters[j]) && - /^-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) { - setArg(letters[j], next); - broken = true; - break +/** + * @license + * Copyright (c) 2016, Contributors + * SPDX-License-Identifier: ISC + */ +// take an un-split argv string and tokenize it. +function tokenizeArgString(argString) { + if (Array.isArray(argString)) { + return argString.map(e => typeof e !== 'string' ? e + '' : e); + } + argString = argString.trim(); + let i = 0; + let prevC = null; + let c = null; + let opening = null; + const args = []; + for (let ii = 0; ii < argString.length; ii++) { + prevC = c; + c = argString.charAt(ii); + // split on spaces unless we're in quotes. + if (c === ' ' && !opening) { + if (!(prevC === ' ')) { + i++; + } + continue; } - - if (letters[j + 1] && letters[j + 1].match(/\W/)) { - setArg(letters[j], next); - broken = true; - break - } else { - setArg(letters[j], defaultValue(letters[j])); + // don't split the string if we're in matching + // opening or closing single and double quotes. + if (c === opening) { + opening = null; } - } - - key = arg.slice(-1)[0]; - - if (!broken && key !== '-') { - if (checkAllAliases(key, flags.arrays)) { - // array format = '-f a b c' - i = eatArray(i, key, args); - } else if (checkAllAliases(key, flags.nargs) !== false) { - // nargs format = '-f a b c' - // should be truthy even if: flags.nargs[key] === 0 - i = eatNargs(i, key, args); - } else { - next = args[i + 1]; - - if (next !== undefined && (!/^(-|--)[^-]/.test(next) || - next.match(negative)) && - !checkAllAliases(key, flags.bools) && - !checkAllAliases(key, flags.counts)) { - setArg(key, next); - i++; - } else if (/^(true|false)$/.test(next)) { - setArg(key, next); - i++; - } else { - setArg(key, defaultValue(key)); - } + else if ((c === "'" || c === '"') && !opening) { + opening = c; } - } - } else if (arg.match(/^-[0-9]$/) && - arg.match(negative) && - checkAllAliases(arg.slice(1), flags.bools)) { - // single-digit boolean alias, e.g: xargs -0 - key = arg.slice(1); - setArg(key, defaultValue(key)); - } else if (arg === '--') { - notFlags = args.slice(i + 1); - break - } else if (configuration['halt-at-non-option']) { - notFlags = args.slice(i); - break - } else { - argv._.push(maybeCoerceNumber('_', arg)); + if (!args[i]) + args[i] = ''; + args[i] += c; } - } - - // order of precedence: - // 1. command line arg - // 2. value from env var - // 3. value from config file - // 4. value from config objects - // 5. configured default value - applyEnvVars(argv, true); // special case: check env vars that point to config file - applyEnvVars(argv, false); - setConfig(argv); - setConfigObjects(); - applyDefaultsAndAliases(argv, flags.aliases, defaults, true); - applyCoercions(argv); - if (configuration['set-placeholder-key']) setPlaceholderKeys(argv); - - // for any counts either not in args or without an explicit default, set to 0 - Object.keys(flags.counts).forEach(function (key) { - if (!hasKey(argv, key.split('.'))) setArg(key, 0); - }); - - // '--' defaults to undefined. - if (notFlagsOption && notFlags.length) argv[notFlagsArgv] = []; - notFlags.forEach(function (key) { - argv[notFlagsArgv].push(key); - }); - - if (configuration['camel-case-expansion'] && configuration['strip-dashed']) { - Object.keys(argv).filter(key => key !== '--' && key.includes('-')).forEach(key => { - delete argv[key]; - }); - } - - if (configuration['strip-aliased']) { -[].concat(...Object.keys(aliases).map(k => aliases[k])).forEach(alias => { - if (configuration['camel-case-expansion']) { - delete argv[alias.split('.').map(prop => camelcase(prop)).join('.')]; - } - - delete argv[alias]; - }); - } - - // how many arguments should we consume, based - // on the nargs option? - function eatNargs (i, key, args, argAfterEqualSign) { - let ii; - let toEat = checkAllAliases(key, flags.nargs); - // NaN has a special meaning for the array type, indicating that one or - // more values are expected. - toEat = isNaN(toEat) ? 1 : toEat; - - if (toEat === 0) { - if (!isUndefined(argAfterEqualSign)) { - error = Error(__('Argument unexpected for: %s', key)); - } - setArg(key, defaultValue(key)); - return i - } - - let available = isUndefined(argAfterEqualSign) ? 0 : 1; - if (configuration['nargs-eats-options']) { - // classic behavior, yargs eats positional and dash arguments. - if (args.length - (i + 1) + available < toEat) { - error = Error(__('Not enough arguments following: %s', key)); - } - available = toEat; - } else { - // nargs will not consume flag arguments, e.g., -abc, --foo, - // and terminates when one is observed. - for (ii = i + 1; ii < args.length; ii++) { - if (!args[ii].match(/^-[^0-9]/) || args[ii].match(negative) || isUnknownOptionAsArg(args[ii])) available++; - else break - } - if (available < toEat) error = Error(__('Not enough arguments following: %s', key)); - } - - let consumed = Math.min(available, toEat); - if (!isUndefined(argAfterEqualSign) && consumed > 0) { - setArg(key, argAfterEqualSign); - consumed--; - } - for (ii = i + 1; ii < (consumed + i + 1); ii++) { - setArg(key, args[ii]); - } - - return (i + consumed) - } - - // if an option is an array, eat all non-hyphenated arguments - // following it... YUM! - // e.g., --foo apple banana cat becomes ["apple", "banana", "cat"] - function eatArray (i, key, args, argAfterEqualSign) { - let argsToSet = []; - let next = argAfterEqualSign || args[i + 1]; - // If both array and nargs are configured, enforce the nargs count: - const nargsCount = checkAllAliases(key, flags.nargs); - - if (checkAllAliases(key, flags.bools) && !(/^(true|false)$/.test(next))) { - argsToSet.push(true); - } else if (isUndefined(next) || - (isUndefined(argAfterEqualSign) && /^-/.test(next) && !negative.test(next) && !isUnknownOptionAsArg(next))) { - // for keys without value ==> argsToSet remains an empty [] - // set user default value, if available - if (defaults[key] !== undefined) { - const defVal = defaults[key]; - argsToSet = Array.isArray(defVal) ? defVal : [defVal]; - } - } else { - // value in --option=value is eaten as is - if (!isUndefined(argAfterEqualSign)) { - argsToSet.push(processValue(key, argAfterEqualSign)); - } - for (let ii = i + 1; ii < args.length; ii++) { - if ((!configuration['greedy-arrays'] && argsToSet.length > 0) || - (nargsCount && argsToSet.length >= nargsCount)) break - next = args[ii]; - if (/^-/.test(next) && !negative.test(next) && !isUnknownOptionAsArg(next)) break - i = ii; - argsToSet.push(processValue(key, next)); - } - } - - // If both array and nargs are configured, create an error if less than - // nargs positionals were found. NaN has special meaning, indicating - // that at least one value is required (more are okay). - if ((nargsCount && argsToSet.length < nargsCount) || - (isNaN(nargsCount) && argsToSet.length === 0)) { - error = Error(__('Not enough arguments following: %s', key)); - } - - setArg(key, argsToSet); - return i - } - - function setArg (key, val) { - if (/-/.test(key) && configuration['camel-case-expansion']) { - const alias = key.split('.').map(function (prop) { - return camelcase(prop) - }).join('.'); - addNewAlias(key, alias); - } - - const value = processValue(key, val); - const splitKey = key.split('.'); - setKey(argv, splitKey, value); - - // handle populating aliases of the full key - if (flags.aliases[key]) { - flags.aliases[key].forEach(function (x) { - x = x.split('.'); - setKey(argv, x, value); - }); - } - - // handle populating aliases of the first element of the dot-notation key - if (splitKey.length > 1 && configuration['dot-notation']) { -(flags.aliases[splitKey[0]] || []).forEach(function (x) { - x = x.split('.'); - - // expand alias with nested objects in key - const a = [].concat(splitKey); - a.shift(); // nuke the old key. - x = x.concat(a); + return args; +} - // populate alias only if is not already an alias of the full key - // (already populated above) - if (!(flags.aliases[key] || []).includes(x.join('.'))) { - setKey(argv, x, value); - } - }); +/** + * @license + * Copyright (c) 2016, Contributors + * SPDX-License-Identifier: ISC + */ +var DefaultValuesForTypeKey; +(function (DefaultValuesForTypeKey) { + DefaultValuesForTypeKey["BOOLEAN"] = "boolean"; + DefaultValuesForTypeKey["STRING"] = "string"; + DefaultValuesForTypeKey["NUMBER"] = "number"; + DefaultValuesForTypeKey["ARRAY"] = "array"; +})(DefaultValuesForTypeKey || (DefaultValuesForTypeKey = {})); + +/** + * @license + * Copyright (c) 2016, Contributors + * SPDX-License-Identifier: ISC + */ +let mixin; +class YargsParser { + constructor(_mixin) { + mixin = _mixin; } - - // Set normalize getter and setter when key is in 'normalize' but isn't an array - if (checkAllAliases(key, flags.normalize) && !checkAllAliases(key, flags.arrays)) { - const keys = [key].concat(flags.aliases[key] || []); - keys.forEach(function (key) { - Object.defineProperty(argvReturn, key, { - enumerable: true, - get () { - return val - }, - set (value) { - val = typeof value === 'string' ? path.normalize(value) : value; - } + parse(argsInput, options) { + const opts = Object.assign({ + alias: undefined, + array: undefined, + boolean: undefined, + config: undefined, + configObjects: undefined, + configuration: undefined, + coerce: undefined, + count: undefined, + default: undefined, + envPrefix: undefined, + narg: undefined, + normalize: undefined, + string: undefined, + number: undefined, + __: undefined, + key: undefined + }, options); + // allow a string argument to be passed in rather + // than an argv array. + const args = tokenizeArgString(argsInput); + // aliases might have transitive relationships, normalize this. + const aliases = combineAliases(Object.assign(Object.create(null), opts.alias)); + const configuration = Object.assign({ + 'boolean-negation': true, + 'camel-case-expansion': true, + 'combine-arrays': false, + 'dot-notation': true, + 'duplicate-arguments-array': true, + 'flatten-duplicate-arrays': true, + 'greedy-arrays': true, + 'halt-at-non-option': false, + 'nargs-eats-options': false, + 'negation-prefix': 'no-', + 'parse-numbers': true, + 'parse-positional-numbers': true, + 'populate--': false, + 'set-placeholder-key': false, + 'short-option-groups': true, + 'strip-aliased': false, + 'strip-dashed': false, + 'unknown-options-as-args': false + }, opts.configuration); + const defaults = Object.assign(Object.create(null), opts.default); + const configObjects = opts.configObjects || []; + const envPrefix = opts.envPrefix; + const notFlagsOption = configuration['populate--']; + const notFlagsArgv = notFlagsOption ? '--' : '_'; + const newAliases = Object.create(null); + const defaulted = Object.create(null); + // allow a i18n handler to be passed in, default to a fake one (util.format). + const __ = opts.__ || mixin.format; + const flags = { + aliases: Object.create(null), + arrays: Object.create(null), + bools: Object.create(null), + strings: Object.create(null), + numbers: Object.create(null), + counts: Object.create(null), + normalize: Object.create(null), + configs: Object.create(null), + nargs: Object.create(null), + coercions: Object.create(null), + keys: [] + }; + const negative = /^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/; + const negatedBoolean = new RegExp('^--' + configuration['negation-prefix'] + '(.+)'); + [].concat(opts.array || []).filter(Boolean).forEach(function (opt) { + const key = typeof opt === 'object' ? opt.key : opt; + // assign to flags[bools|strings|numbers] + const assignment = Object.keys(opt).map(function (key) { + const arrayFlagKeys = { + boolean: 'bools', + string: 'strings', + number: 'numbers' + }; + return arrayFlagKeys[key]; + }).filter(Boolean).pop(); + // assign key to be coerced + if (assignment) { + flags[assignment][key] = true; + } + flags.arrays[key] = true; + flags.keys.push(key); }); - }); - } - } - - function addNewAlias (key, alias) { - if (!(flags.aliases[key] && flags.aliases[key].length)) { - flags.aliases[key] = [alias]; - newAliases[alias] = true; - } - if (!(flags.aliases[alias] && flags.aliases[alias].length)) { - addNewAlias(alias, key); - } - } - - function processValue (key, val) { - // strings may be quoted, clean this up as we assign values. - if (typeof val === 'string' && - (val[0] === "'" || val[0] === '"') && - val[val.length - 1] === val[0] - ) { - val = val.substring(1, val.length - 1); - } - - // handle parsing boolean arguments --foo=true --bar false. - if (checkAllAliases(key, flags.bools) || checkAllAliases(key, flags.counts)) { - if (typeof val === 'string') val = val === 'true'; - } - - let value = Array.isArray(val) - ? val.map(function (v) { return maybeCoerceNumber(key, v) }) - : maybeCoerceNumber(key, val); - - // increment a count given as arg (either no value or value parsed as boolean) - if (checkAllAliases(key, flags.counts) && (isUndefined(value) || typeof value === 'boolean')) { - value = increment; - } - - // Set normalized value when key is in 'normalize' and in 'arrays' - if (checkAllAliases(key, flags.normalize) && checkAllAliases(key, flags.arrays)) { - if (Array.isArray(val)) value = val.map(path.normalize); - else value = path.normalize(val); - } - return value - } - - function maybeCoerceNumber (key, value) { - if (!checkAllAliases(key, flags.strings) && !checkAllAliases(key, flags.bools) && !Array.isArray(value)) { - const shouldCoerceNumber = isNumber(value) && configuration['parse-numbers'] && ( - Number.isSafeInteger(Math.floor(value)) - ); - if (shouldCoerceNumber || (!isUndefined(value) && checkAllAliases(key, flags.numbers))) value = Number(value); - } - return value - } - - // set args from config.json file, this should be - // applied last so that defaults can be applied. - function setConfig (argv) { - const configLookup = Object.create(null); - - // expand defaults/aliases, in-case any happen to reference - // the config.json file. - applyDefaultsAndAliases(configLookup, flags.aliases, defaults); - - Object.keys(flags.configs).forEach(function (configKey) { - const configPath = argv[configKey] || configLookup[configKey]; - if (configPath) { - try { - let config = null; - const resolvedConfigPath = path.resolve(process.cwd(), configPath); - - if (typeof flags.configs[configKey] === 'function') { - try { - config = flags.configs[configKey](resolvedConfigPath); - } catch (e) { - config = e; + [].concat(opts.boolean || []).filter(Boolean).forEach(function (key) { + flags.bools[key] = true; + flags.keys.push(key); + }); + [].concat(opts.string || []).filter(Boolean).forEach(function (key) { + flags.strings[key] = true; + flags.keys.push(key); + }); + [].concat(opts.number || []).filter(Boolean).forEach(function (key) { + flags.numbers[key] = true; + flags.keys.push(key); + }); + [].concat(opts.count || []).filter(Boolean).forEach(function (key) { + flags.counts[key] = true; + flags.keys.push(key); + }); + [].concat(opts.normalize || []).filter(Boolean).forEach(function (key) { + flags.normalize[key] = true; + flags.keys.push(key); + }); + if (typeof opts.narg === 'object') { + Object.entries(opts.narg).forEach(([key, value]) => { + if (typeof value === 'number') { + flags.nargs[key] = value; + flags.keys.push(key); + } + }); + } + if (typeof opts.coerce === 'object') { + Object.entries(opts.coerce).forEach(([key, value]) => { + if (typeof value === 'function') { + flags.coercions[key] = value; + flags.keys.push(key); + } + }); + } + if (typeof opts.config !== 'undefined') { + if (Array.isArray(opts.config) || typeof opts.config === 'string') { + [].concat(opts.config).filter(Boolean).forEach(function (key) { + flags.configs[key] = true; + }); } - if (config instanceof Error) { - error = config; - return + else if (typeof opts.config === 'object') { + Object.entries(opts.config).forEach(([key, value]) => { + if (typeof value === 'boolean' || typeof value === 'function') { + flags.configs[key] = value; + } + }); } - } else { - config = rollup.commonjsRequire(); - } - - setConfigObject(config); - } catch (ex) { - if (argv[configKey]) error = Error(__('Invalid JSON config file: %s', configPath)); } - } - }); - } - - // set args from config object. - // it recursively checks nested objects. - function setConfigObject (config, prev) { - Object.keys(config).forEach(function (key) { - const value = config[key]; - const fullKey = prev ? prev + '.' + key : key; - - // if the value is an inner object and we have dot-notation - // enabled, treat inner objects in config the same as - // heavily nested dot notations (foo.bar.apple). - if (typeof value === 'object' && value !== null && !Array.isArray(value) && configuration['dot-notation']) { - // if the value is an object but not an array, check nested object - setConfigObject(value, fullKey); - } else { - // setting arguments via CLI takes precedence over - // values within the config file. - if (!hasKey(argv, fullKey.split('.')) || (checkAllAliases(fullKey, flags.arrays) && configuration['combine-arrays'])) { - setArg(fullKey, value); + // create a lookup table that takes into account all + // combinations of aliases: {f: ['foo'], foo: ['f']} + extendAliases(opts.key, aliases, opts.default, flags.arrays); + // apply default values to all aliases. + Object.keys(defaults).forEach(function (key) { + (flags.aliases[key] || []).forEach(function (alias) { + defaults[alias] = defaults[key]; + }); + }); + let error = null; + checkConfiguration(); + let notFlags = []; + const argv = Object.assign(Object.create(null), { _: [] }); + // TODO(bcoe): for the first pass at removing object prototype we didn't + // remove all prototypes from objects returned by this API, we might want + // to gradually move towards doing so. + const argvReturn = {}; + for (let i = 0; i < args.length; i++) { + const arg = args[i]; + const truncatedArg = arg.replace(/^-{3,}/, '---'); + let broken; + let key; + let letters; + let m; + let next; + let value; + // any unknown option (except for end-of-options, "--") + if (arg !== '--' && isUnknownOptionAsArg(arg)) { + pushPositional(arg); + // ---, ---=, ----, etc, + } + else if (truncatedArg.match(/---+(=|$)/)) { + // options without key name are invalid. + pushPositional(arg); + continue; + // -- separated by = + } + else if (arg.match(/^--.+=/) || (!configuration['short-option-groups'] && arg.match(/^-.+=/))) { + // Using [\s\S] instead of . because js doesn't support the + // 'dotall' regex modifier. See: + // http://stackoverflow.com/a/1068308/13216 + m = arg.match(/^--?([^=]+)=([\s\S]*)$/); + // arrays format = '--f=a b c' + if (m !== null && Array.isArray(m) && m.length >= 3) { + if (checkAllAliases(m[1], flags.arrays)) { + i = eatArray(i, m[1], args, m[2]); + } + else if (checkAllAliases(m[1], flags.nargs) !== false) { + // nargs format = '--f=monkey washing cat' + i = eatNargs(i, m[1], args, m[2]); + } + else { + setArg(m[1], m[2]); + } + } + } + else if (arg.match(negatedBoolean) && configuration['boolean-negation']) { + m = arg.match(negatedBoolean); + if (m !== null && Array.isArray(m) && m.length >= 2) { + key = m[1]; + setArg(key, checkAllAliases(key, flags.arrays) ? [false] : false); + } + // -- separated by space. + } + else if (arg.match(/^--.+/) || (!configuration['short-option-groups'] && arg.match(/^-[^-]+/))) { + m = arg.match(/^--?(.+)/); + if (m !== null && Array.isArray(m) && m.length >= 2) { + key = m[1]; + if (checkAllAliases(key, flags.arrays)) { + // array format = '--foo a b c' + i = eatArray(i, key, args); + } + else if (checkAllAliases(key, flags.nargs) !== false) { + // nargs format = '--foo a b c' + // should be truthy even if: flags.nargs[key] === 0 + i = eatNargs(i, key, args); + } + else { + next = args[i + 1]; + if (next !== undefined && (!next.match(/^-/) || + next.match(negative)) && + !checkAllAliases(key, flags.bools) && + !checkAllAliases(key, flags.counts)) { + setArg(key, next); + i++; + } + else if (/^(true|false)$/.test(next)) { + setArg(key, next); + i++; + } + else { + setArg(key, defaultValue(key)); + } + } + } + // dot-notation flag separated by '='. + } + else if (arg.match(/^-.\..+=/)) { + m = arg.match(/^-([^=]+)=([\s\S]*)$/); + if (m !== null && Array.isArray(m) && m.length >= 3) { + setArg(m[1], m[2]); + } + // dot-notation flag separated by space. + } + else if (arg.match(/^-.\..+/) && !arg.match(negative)) { + next = args[i + 1]; + m = arg.match(/^-(.\..+)/); + if (m !== null && Array.isArray(m) && m.length >= 2) { + key = m[1]; + if (next !== undefined && !next.match(/^-/) && + !checkAllAliases(key, flags.bools) && + !checkAllAliases(key, flags.counts)) { + setArg(key, next); + i++; + } + else { + setArg(key, defaultValue(key)); + } + } + } + else if (arg.match(/^-[^-]+/) && !arg.match(negative)) { + letters = arg.slice(1, -1).split(''); + broken = false; + for (let j = 0; j < letters.length; j++) { + next = arg.slice(j + 2); + if (letters[j + 1] && letters[j + 1] === '=') { + value = arg.slice(j + 3); + key = letters[j]; + if (checkAllAliases(key, flags.arrays)) { + // array format = '-f=a b c' + i = eatArray(i, key, args, value); + } + else if (checkAllAliases(key, flags.nargs) !== false) { + // nargs format = '-f=monkey washing cat' + i = eatNargs(i, key, args, value); + } + else { + setArg(key, value); + } + broken = true; + break; + } + if (next === '-') { + setArg(letters[j], next); + continue; + } + // current letter is an alphabetic character and next value is a number + if (/[A-Za-z]/.test(letters[j]) && + /^-?\d+(\.\d*)?(e-?\d+)?$/.test(next) && + checkAllAliases(next, flags.bools) === false) { + setArg(letters[j], next); + broken = true; + break; + } + if (letters[j + 1] && letters[j + 1].match(/\W/)) { + setArg(letters[j], next); + broken = true; + break; + } + else { + setArg(letters[j], defaultValue(letters[j])); + } + } + key = arg.slice(-1)[0]; + if (!broken && key !== '-') { + if (checkAllAliases(key, flags.arrays)) { + // array format = '-f a b c' + i = eatArray(i, key, args); + } + else if (checkAllAliases(key, flags.nargs) !== false) { + // nargs format = '-f a b c' + // should be truthy even if: flags.nargs[key] === 0 + i = eatNargs(i, key, args); + } + else { + next = args[i + 1]; + if (next !== undefined && (!/^(-|--)[^-]/.test(next) || + next.match(negative)) && + !checkAllAliases(key, flags.bools) && + !checkAllAliases(key, flags.counts)) { + setArg(key, next); + i++; + } + else if (/^(true|false)$/.test(next)) { + setArg(key, next); + i++; + } + else { + setArg(key, defaultValue(key)); + } + } + } + } + else if (arg.match(/^-[0-9]$/) && + arg.match(negative) && + checkAllAliases(arg.slice(1), flags.bools)) { + // single-digit boolean alias, e.g: xargs -0 + key = arg.slice(1); + setArg(key, defaultValue(key)); + } + else if (arg === '--') { + notFlags = args.slice(i + 1); + break; + } + else if (configuration['halt-at-non-option']) { + notFlags = args.slice(i); + break; + } + else { + pushPositional(arg); + } } - } - }); - } - - // set all config objects passed in opts - function setConfigObjects () { - if (typeof configObjects === 'undefined') return - configObjects.forEach(function (configObject) { - setConfigObject(configObject); - }); - } - - function applyEnvVars (argv, configOnly) { - if (typeof envPrefix === 'undefined') return - - const prefix = typeof envPrefix === 'string' ? envPrefix : ''; - Object.keys(process.env).forEach(function (envVar) { - if (prefix === '' || envVar.lastIndexOf(prefix, 0) === 0) { - // get array of nested keys and convert them to camel case - const keys = envVar.split('__').map(function (key, i) { - if (i === 0) { - key = key.substring(prefix.length); - } - return camelcase(key) + // order of precedence: + // 1. command line arg + // 2. value from env var + // 3. value from config file + // 4. value from config objects + // 5. configured default value + applyEnvVars(argv, true); // special case: check env vars that point to config file + applyEnvVars(argv, false); + setConfig(argv); + setConfigObjects(); + applyDefaultsAndAliases(argv, flags.aliases, defaults, true); + applyCoercions(argv); + if (configuration['set-placeholder-key']) + setPlaceholderKeys(argv); + // for any counts either not in args or without an explicit default, set to 0 + Object.keys(flags.counts).forEach(function (key) { + if (!hasKey(argv, key.split('.'))) + setArg(key, 0); }); - - if (((configOnly && flags.configs[keys.join('.')]) || !configOnly) && !hasKey(argv, keys)) { - setArg(keys.join('.'), process.env[envVar]); + // '--' defaults to undefined. + if (notFlagsOption && notFlags.length) + argv[notFlagsArgv] = []; + notFlags.forEach(function (key) { + argv[notFlagsArgv].push(key); + }); + if (configuration['camel-case-expansion'] && configuration['strip-dashed']) { + Object.keys(argv).filter(key => key !== '--' && key.includes('-')).forEach(key => { + delete argv[key]; + }); } - } - }); - } - - function applyCoercions (argv) { - let coerce; - const applied = new Set(); - Object.keys(argv).forEach(function (key) { - if (!applied.has(key)) { // If we haven't already coerced this option via one of its aliases - coerce = checkAllAliases(key, flags.coercions); - if (typeof coerce === 'function') { - try { - const value = maybeCoerceNumber(key, coerce(argv[key])) - ;([].concat(flags.aliases[key] || [], key)).forEach(ali => { - applied.add(ali); - argv[ali] = value; + if (configuration['strip-aliased']) { + [].concat(...Object.keys(aliases).map(k => aliases[k])).forEach(alias => { + if (configuration['camel-case-expansion'] && alias.includes('-')) { + delete argv[alias.split('.').map(prop => camelCase(prop)).join('.')]; + } + delete argv[alias]; }); - } catch (err) { - error = err; - } } - } - }); - } - - function setPlaceholderKeys (argv) { - flags.keys.forEach((key) => { - // don't set placeholder keys for dot notation options 'foo.bar'. - if (~key.indexOf('.')) return - if (typeof argv[key] === 'undefined') argv[key] = undefined; - }); - return argv - } - - function applyDefaultsAndAliases (obj, aliases, defaults, canLog = false) { - Object.keys(defaults).forEach(function (key) { - if (!hasKey(obj, key.split('.'))) { - setKey(obj, key.split('.'), defaults[key]); - if (canLog) defaulted[key] = true - - ;(aliases[key] || []).forEach(function (x) { - if (hasKey(obj, x.split('.'))) return - setKey(obj, x.split('.'), defaults[key]); - }); - } - }); - } - - function hasKey (obj, keys) { - let o = obj; - - if (!configuration['dot-notation']) keys = [keys.join('.')]; - - keys.slice(0, -1).forEach(function (key) { - o = (o[key] || {}); - }); - - const key = keys[keys.length - 1]; - - if (typeof o !== 'object') return false - else return key in o - } - - function setKey (obj, keys, value) { - let o = obj; - - if (!configuration['dot-notation']) keys = [keys.join('.')]; - - keys.slice(0, -1).forEach(function (key, index) { - // TODO(bcoe): in the next major version of yargs, switch to - // Object.create(null) for dot notation: - key = sanitizeKey(key); - - if (typeof o === 'object' && o[key] === undefined) { - o[key] = {}; - } - - if (typeof o[key] !== 'object' || Array.isArray(o[key])) { - // ensure that o[key] is an array, and that the last item is an empty object. - if (Array.isArray(o[key])) { - o[key].push({}); - } else { - o[key] = [o[key], {}]; + // Push argument into positional array, applying numeric coercion: + function pushPositional(arg) { + const maybeCoercedNumber = maybeCoerceNumber('_', arg); + if (typeof maybeCoercedNumber === 'string' || typeof maybeCoercedNumber === 'number') { + argv._.push(maybeCoercedNumber); + } } - - // we want to update the empty object at the end of the o[key] array, so set o to that object - o = o[key][o[key].length - 1]; - } else { - o = o[key]; - } - }); - - // TODO(bcoe): in the next major version of yargs, switch to - // Object.create(null) for dot notation: - const key = sanitizeKey(keys[keys.length - 1]); - - const isTypeArray = checkAllAliases(keys.join('.'), flags.arrays); - const isValueArray = Array.isArray(value); - let duplicate = configuration['duplicate-arguments-array']; - - // nargs has higher priority than duplicate - if (!duplicate && checkAllAliases(key, flags.nargs)) { - duplicate = true; - if ((!isUndefined(o[key]) && flags.nargs[key] === 1) || (Array.isArray(o[key]) && o[key].length === flags.nargs[key])) { - o[key] = undefined; - } - } - - if (value === increment) { - o[key] = increment(o[key]); - } else if (Array.isArray(o[key])) { - if (duplicate && isTypeArray && isValueArray) { - o[key] = configuration['flatten-duplicate-arrays'] ? o[key].concat(value) : (Array.isArray(o[key][0]) ? o[key] : [o[key]]).concat([value]); - } else if (!duplicate && Boolean(isTypeArray) === Boolean(isValueArray)) { - o[key] = value; - } else { - o[key] = o[key].concat([value]); - } - } else if (o[key] === undefined && isTypeArray) { - o[key] = isValueArray ? value : [value]; - } else if (duplicate && !( - o[key] === undefined || - checkAllAliases(key, flags.counts) || - checkAllAliases(key, flags.bools) - )) { - o[key] = [o[key], value]; - } else { - o[key] = value; - } - } - - // extend the aliases list with inferred aliases. - function extendAliases (...args) { - args.forEach(function (obj) { - Object.keys(obj || {}).forEach(function (key) { - // short-circuit if we've already added a key - // to the aliases array, for example it might - // exist in both 'opts.default' and 'opts.key'. - if (flags.aliases[key]) return - - flags.aliases[key] = [].concat(aliases[key] || []); - // For "--option-name", also set argv.optionName - flags.aliases[key].concat(key).forEach(function (x) { - if (/-/.test(x) && configuration['camel-case-expansion']) { - const c = camelcase(x); - if (c !== key && flags.aliases[key].indexOf(c) === -1) { - flags.aliases[key].push(c); - newAliases[c] = true; + // how many arguments should we consume, based + // on the nargs option? + function eatNargs(i, key, args, argAfterEqualSign) { + let ii; + let toEat = checkAllAliases(key, flags.nargs); + // NaN has a special meaning for the array type, indicating that one or + // more values are expected. + toEat = typeof toEat !== 'number' || isNaN(toEat) ? 1 : toEat; + if (toEat === 0) { + if (!isUndefined(argAfterEqualSign)) { + error = Error(__('Argument unexpected for: %s', key)); + } + setArg(key, defaultValue(key)); + return i; } - } - }); - // For "--optionName", also set argv['option-name'] - flags.aliases[key].concat(key).forEach(function (x) { - if (x.length > 1 && /[A-Z]/.test(x) && configuration['camel-case-expansion']) { - const c = decamelize(x, '-'); - if (c !== key && flags.aliases[key].indexOf(c) === -1) { - flags.aliases[key].push(c); - newAliases[c] = true; + let available = isUndefined(argAfterEqualSign) ? 0 : 1; + if (configuration['nargs-eats-options']) { + // classic behavior, yargs eats positional and dash arguments. + if (args.length - (i + 1) + available < toEat) { + error = Error(__('Not enough arguments following: %s', key)); + } + available = toEat; } - } - }); - flags.aliases[key].forEach(function (x) { - flags.aliases[x] = [key].concat(flags.aliases[key].filter(function (y) { - return x !== y - })); - }); - }); - }); - } - - // return the 1st set flag for any of a key's aliases (or false if no flag set) - function checkAllAliases (key, flag) { - const toCheck = [].concat(flags.aliases[key] || [], key); - const keys = Object.keys(flag); - const setAlias = toCheck.find(key => keys.includes(key)); - return setAlias ? flag[setAlias] : false - } - - function hasAnyFlag (key) { - const toCheck = [].concat(Object.keys(flags).map(k => flags[k])); - return toCheck.some(function (flag) { - return Array.isArray(flag) ? flag.includes(key) : flag[key] - }) - } - - function hasFlagsMatching (arg, ...patterns) { - const toCheck = [].concat(...patterns); - return toCheck.some(function (pattern) { - const match = arg.match(pattern); - return match && hasAnyFlag(match[1]) - }) - } - - // based on a simplified version of the short flag group parsing logic - function hasAllShortFlags (arg) { - // if this is a negative number, or doesn't start with a single hyphen, it's not a short flag group - if (arg.match(negative) || !arg.match(/^-[^-]+/)) { return false } - let hasAllFlags = true; - let next; - const letters = arg.slice(1).split(''); - for (let j = 0; j < letters.length; j++) { - next = arg.slice(j + 2); - - if (!hasAnyFlag(letters[j])) { - hasAllFlags = false; - break - } - - if ((letters[j + 1] && letters[j + 1] === '=') || - next === '-' || - (/[A-Za-z]/.test(letters[j]) && /^-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) || - (letters[j + 1] && letters[j + 1].match(/\W/))) { - break - } - } - return hasAllFlags - } - - function isUnknownOptionAsArg (arg) { - return configuration['unknown-options-as-args'] && isUnknownOption(arg) - } - - function isUnknownOption (arg) { - // ignore negative numbers - if (arg.match(negative)) { return false } - // if this is a short option group and all of them are configured, it isn't unknown - if (hasAllShortFlags(arg)) { return false } - // e.g. '--count=2' - const flagWithEquals = /^-+([^=]+?)=[\s\S]*$/; - // e.g. '-a' or '--arg' - const normalFlag = /^-+([^=]+?)$/; - // e.g. '-a-' - const flagEndingInHyphen = /^-+([^=]+?)-$/; - // e.g. '-abc123' - const flagEndingInDigits = /^-+([^=]+?\d+)$/; - // e.g. '-a/usr/local' - const flagEndingInNonWordCharacters = /^-+([^=]+?)\W+.*$/; - // check the different types of flag styles, including negatedBoolean, a pattern defined near the start of the parse method - return !hasFlagsMatching(arg, flagWithEquals, negatedBoolean, normalFlag, flagEndingInHyphen, flagEndingInDigits, flagEndingInNonWordCharacters) - } - - // make a best effor to pick a default value - // for an option based on name and type. - function defaultValue (key) { - if (!checkAllAliases(key, flags.bools) && - !checkAllAliases(key, flags.counts) && - `${key}` in defaults) { - return defaults[key] - } else { - return defaultForType(guessType(key)) + else { + // nargs will not consume flag arguments, e.g., -abc, --foo, + // and terminates when one is observed. + for (ii = i + 1; ii < args.length; ii++) { + if (!args[ii].match(/^-[^0-9]/) || args[ii].match(negative) || isUnknownOptionAsArg(args[ii])) + available++; + else + break; + } + if (available < toEat) + error = Error(__('Not enough arguments following: %s', key)); + } + let consumed = Math.min(available, toEat); + if (!isUndefined(argAfterEqualSign) && consumed > 0) { + setArg(key, argAfterEqualSign); + consumed--; + } + for (ii = i + 1; ii < (consumed + i + 1); ii++) { + setArg(key, args[ii]); + } + return (i + consumed); + } + // if an option is an array, eat all non-hyphenated arguments + // following it... YUM! + // e.g., --foo apple banana cat becomes ["apple", "banana", "cat"] + function eatArray(i, key, args, argAfterEqualSign) { + let argsToSet = []; + let next = argAfterEqualSign || args[i + 1]; + // If both array and nargs are configured, enforce the nargs count: + const nargsCount = checkAllAliases(key, flags.nargs); + if (checkAllAliases(key, flags.bools) && !(/^(true|false)$/.test(next))) { + argsToSet.push(true); + } + else if (isUndefined(next) || + (isUndefined(argAfterEqualSign) && /^-/.test(next) && !negative.test(next) && !isUnknownOptionAsArg(next))) { + // for keys without value ==> argsToSet remains an empty [] + // set user default value, if available + if (defaults[key] !== undefined) { + const defVal = defaults[key]; + argsToSet = Array.isArray(defVal) ? defVal : [defVal]; + } + } + else { + // value in --option=value is eaten as is + if (!isUndefined(argAfterEqualSign)) { + argsToSet.push(processValue(key, argAfterEqualSign)); + } + for (let ii = i + 1; ii < args.length; ii++) { + if ((!configuration['greedy-arrays'] && argsToSet.length > 0) || + (nargsCount && typeof nargsCount === 'number' && argsToSet.length >= nargsCount)) + break; + next = args[ii]; + if (/^-/.test(next) && !negative.test(next) && !isUnknownOptionAsArg(next)) + break; + i = ii; + argsToSet.push(processValue(key, next)); + } + } + // If both array and nargs are configured, create an error if less than + // nargs positionals were found. NaN has special meaning, indicating + // that at least one value is required (more are okay). + if (typeof nargsCount === 'number' && ((nargsCount && argsToSet.length < nargsCount) || + (isNaN(nargsCount) && argsToSet.length === 0))) { + error = Error(__('Not enough arguments following: %s', key)); + } + setArg(key, argsToSet); + return i; + } + function setArg(key, val) { + if (/-/.test(key) && configuration['camel-case-expansion']) { + const alias = key.split('.').map(function (prop) { + return camelCase(prop); + }).join('.'); + addNewAlias(key, alias); + } + const value = processValue(key, val); + const splitKey = key.split('.'); + setKey(argv, splitKey, value); + // handle populating aliases of the full key + if (flags.aliases[key]) { + flags.aliases[key].forEach(function (x) { + const keyProperties = x.split('.'); + setKey(argv, keyProperties, value); + }); + } + // handle populating aliases of the first element of the dot-notation key + if (splitKey.length > 1 && configuration['dot-notation']) { + (flags.aliases[splitKey[0]] || []).forEach(function (x) { + let keyProperties = x.split('.'); + // expand alias with nested objects in key + const a = [].concat(splitKey); + a.shift(); // nuke the old key. + keyProperties = keyProperties.concat(a); + // populate alias only if is not already an alias of the full key + // (already populated above) + if (!(flags.aliases[key] || []).includes(keyProperties.join('.'))) { + setKey(argv, keyProperties, value); + } + }); + } + // Set normalize getter and setter when key is in 'normalize' but isn't an array + if (checkAllAliases(key, flags.normalize) && !checkAllAliases(key, flags.arrays)) { + const keys = [key].concat(flags.aliases[key] || []); + keys.forEach(function (key) { + Object.defineProperty(argvReturn, key, { + enumerable: true, + get() { + return val; + }, + set(value) { + val = typeof value === 'string' ? mixin.normalize(value) : value; + } + }); + }); + } + } + function addNewAlias(key, alias) { + if (!(flags.aliases[key] && flags.aliases[key].length)) { + flags.aliases[key] = [alias]; + newAliases[alias] = true; + } + if (!(flags.aliases[alias] && flags.aliases[alias].length)) { + addNewAlias(alias, key); + } + } + function processValue(key, val) { + // strings may be quoted, clean this up as we assign values. + if (typeof val === 'string' && + (val[0] === "'" || val[0] === '"') && + val[val.length - 1] === val[0]) { + val = val.substring(1, val.length - 1); + } + // handle parsing boolean arguments --foo=true --bar false. + if (checkAllAliases(key, flags.bools) || checkAllAliases(key, flags.counts)) { + if (typeof val === 'string') + val = val === 'true'; + } + let value = Array.isArray(val) + ? val.map(function (v) { return maybeCoerceNumber(key, v); }) + : maybeCoerceNumber(key, val); + // increment a count given as arg (either no value or value parsed as boolean) + if (checkAllAliases(key, flags.counts) && (isUndefined(value) || typeof value === 'boolean')) { + value = increment(); + } + // Set normalized value when key is in 'normalize' and in 'arrays' + if (checkAllAliases(key, flags.normalize) && checkAllAliases(key, flags.arrays)) { + if (Array.isArray(val)) + value = val.map((val) => { return mixin.normalize(val); }); + else + value = mixin.normalize(val); + } + return value; + } + function maybeCoerceNumber(key, value) { + if (!configuration['parse-positional-numbers'] && key === '_') + return value; + if (!checkAllAliases(key, flags.strings) && !checkAllAliases(key, flags.bools) && !Array.isArray(value)) { + const shouldCoerceNumber = looksLikeNumber(value) && configuration['parse-numbers'] && (Number.isSafeInteger(Math.floor(parseFloat(`${value}`)))); + if (shouldCoerceNumber || (!isUndefined(value) && checkAllAliases(key, flags.numbers))) { + value = Number(value); + } + } + return value; + } + // set args from config.json file, this should be + // applied last so that defaults can be applied. + function setConfig(argv) { + const configLookup = Object.create(null); + // expand defaults/aliases, in-case any happen to reference + // the config.json file. + applyDefaultsAndAliases(configLookup, flags.aliases, defaults); + Object.keys(flags.configs).forEach(function (configKey) { + const configPath = argv[configKey] || configLookup[configKey]; + if (configPath) { + try { + let config = null; + const resolvedConfigPath = mixin.resolve(mixin.cwd(), configPath); + const resolveConfig = flags.configs[configKey]; + if (typeof resolveConfig === 'function') { + try { + config = resolveConfig(resolvedConfigPath); + } + catch (e) { + config = e; + } + if (config instanceof Error) { + error = config; + return; + } + } + else { + config = mixin.require(resolvedConfigPath); + } + setConfigObject(config); + } + catch (ex) { + // Deno will receive a PermissionDenied error if an attempt is + // made to load config without the --allow-read flag: + if (ex.name === 'PermissionDenied') + error = ex; + else if (argv[configKey]) + error = Error(__('Invalid JSON config file: %s', configPath)); + } + } + }); + } + // set args from config object. + // it recursively checks nested objects. + function setConfigObject(config, prev) { + Object.keys(config).forEach(function (key) { + const value = config[key]; + const fullKey = prev ? prev + '.' + key : key; + // if the value is an inner object and we have dot-notation + // enabled, treat inner objects in config the same as + // heavily nested dot notations (foo.bar.apple). + if (typeof value === 'object' && value !== null && !Array.isArray(value) && configuration['dot-notation']) { + // if the value is an object but not an array, check nested object + setConfigObject(value, fullKey); + } + else { + // setting arguments via CLI takes precedence over + // values within the config file. + if (!hasKey(argv, fullKey.split('.')) || (checkAllAliases(fullKey, flags.arrays) && configuration['combine-arrays'])) { + setArg(fullKey, value); + } + } + }); + } + // set all config objects passed in opts + function setConfigObjects() { + if (typeof configObjects !== 'undefined') { + configObjects.forEach(function (configObject) { + setConfigObject(configObject); + }); + } + } + function applyEnvVars(argv, configOnly) { + if (typeof envPrefix === 'undefined') + return; + const prefix = typeof envPrefix === 'string' ? envPrefix : ''; + const env = mixin.env(); + Object.keys(env).forEach(function (envVar) { + if (prefix === '' || envVar.lastIndexOf(prefix, 0) === 0) { + // get array of nested keys and convert them to camel case + const keys = envVar.split('__').map(function (key, i) { + if (i === 0) { + key = key.substring(prefix.length); + } + return camelCase(key); + }); + if (((configOnly && flags.configs[keys.join('.')]) || !configOnly) && !hasKey(argv, keys)) { + setArg(keys.join('.'), env[envVar]); + } + } + }); + } + function applyCoercions(argv) { + let coerce; + const applied = new Set(); + Object.keys(argv).forEach(function (key) { + if (!applied.has(key)) { // If we haven't already coerced this option via one of its aliases + coerce = checkAllAliases(key, flags.coercions); + if (typeof coerce === 'function') { + try { + const value = maybeCoerceNumber(key, coerce(argv[key])); + ([].concat(flags.aliases[key] || [], key)).forEach(ali => { + applied.add(ali); + argv[ali] = value; + }); + } + catch (err) { + error = err; + } + } + } + }); + } + function setPlaceholderKeys(argv) { + flags.keys.forEach((key) => { + // don't set placeholder keys for dot notation options 'foo.bar'. + if (~key.indexOf('.')) + return; + if (typeof argv[key] === 'undefined') + argv[key] = undefined; + }); + return argv; + } + function applyDefaultsAndAliases(obj, aliases, defaults, canLog = false) { + Object.keys(defaults).forEach(function (key) { + if (!hasKey(obj, key.split('.'))) { + setKey(obj, key.split('.'), defaults[key]); + if (canLog) + defaulted[key] = true; + (aliases[key] || []).forEach(function (x) { + if (hasKey(obj, x.split('.'))) + return; + setKey(obj, x.split('.'), defaults[key]); + }); + } + }); + } + function hasKey(obj, keys) { + let o = obj; + if (!configuration['dot-notation']) + keys = [keys.join('.')]; + keys.slice(0, -1).forEach(function (key) { + o = (o[key] || {}); + }); + const key = keys[keys.length - 1]; + if (typeof o !== 'object') + return false; + else + return key in o; + } + function setKey(obj, keys, value) { + let o = obj; + if (!configuration['dot-notation']) + keys = [keys.join('.')]; + keys.slice(0, -1).forEach(function (key) { + // TODO(bcoe): in the next major version of yargs, switch to + // Object.create(null) for dot notation: + key = sanitizeKey(key); + if (typeof o === 'object' && o[key] === undefined) { + o[key] = {}; + } + if (typeof o[key] !== 'object' || Array.isArray(o[key])) { + // ensure that o[key] is an array, and that the last item is an empty object. + if (Array.isArray(o[key])) { + o[key].push({}); + } + else { + o[key] = [o[key], {}]; + } + // we want to update the empty object at the end of the o[key] array, so set o to that object + o = o[key][o[key].length - 1]; + } + else { + o = o[key]; + } + }); + // TODO(bcoe): in the next major version of yargs, switch to + // Object.create(null) for dot notation: + const key = sanitizeKey(keys[keys.length - 1]); + const isTypeArray = checkAllAliases(keys.join('.'), flags.arrays); + const isValueArray = Array.isArray(value); + let duplicate = configuration['duplicate-arguments-array']; + // nargs has higher priority than duplicate + if (!duplicate && checkAllAliases(key, flags.nargs)) { + duplicate = true; + if ((!isUndefined(o[key]) && flags.nargs[key] === 1) || (Array.isArray(o[key]) && o[key].length === flags.nargs[key])) { + o[key] = undefined; + } + } + if (value === increment()) { + o[key] = increment(o[key]); + } + else if (Array.isArray(o[key])) { + if (duplicate && isTypeArray && isValueArray) { + o[key] = configuration['flatten-duplicate-arrays'] ? o[key].concat(value) : (Array.isArray(o[key][0]) ? o[key] : [o[key]]).concat([value]); + } + else if (!duplicate && Boolean(isTypeArray) === Boolean(isValueArray)) { + o[key] = value; + } + else { + o[key] = o[key].concat([value]); + } + } + else if (o[key] === undefined && isTypeArray) { + o[key] = isValueArray ? value : [value]; + } + else if (duplicate && !(o[key] === undefined || + checkAllAliases(key, flags.counts) || + checkAllAliases(key, flags.bools))) { + o[key] = [o[key], value]; + } + else { + o[key] = value; + } + } + // extend the aliases list with inferred aliases. + function extendAliases(...args) { + args.forEach(function (obj) { + Object.keys(obj || {}).forEach(function (key) { + // short-circuit if we've already added a key + // to the aliases array, for example it might + // exist in both 'opts.default' and 'opts.key'. + if (flags.aliases[key]) + return; + flags.aliases[key] = [].concat(aliases[key] || []); + // For "--option-name", also set argv.optionName + flags.aliases[key].concat(key).forEach(function (x) { + if (/-/.test(x) && configuration['camel-case-expansion']) { + const c = camelCase(x); + if (c !== key && flags.aliases[key].indexOf(c) === -1) { + flags.aliases[key].push(c); + newAliases[c] = true; + } + } + }); + // For "--optionName", also set argv['option-name'] + flags.aliases[key].concat(key).forEach(function (x) { + if (x.length > 1 && /[A-Z]/.test(x) && configuration['camel-case-expansion']) { + const c = decamelize(x, '-'); + if (c !== key && flags.aliases[key].indexOf(c) === -1) { + flags.aliases[key].push(c); + newAliases[c] = true; + } + } + }); + flags.aliases[key].forEach(function (x) { + flags.aliases[x] = [key].concat(flags.aliases[key].filter(function (y) { + return x !== y; + })); + }); + }); + }); + } + function checkAllAliases(key, flag) { + const toCheck = [].concat(flags.aliases[key] || [], key); + const keys = Object.keys(flag); + const setAlias = toCheck.find(key => keys.includes(key)); + return setAlias ? flag[setAlias] : false; + } + function hasAnyFlag(key) { + const flagsKeys = Object.keys(flags); + const toCheck = [].concat(flagsKeys.map(k => flags[k])); + return toCheck.some(function (flag) { + return Array.isArray(flag) ? flag.includes(key) : flag[key]; + }); + } + function hasFlagsMatching(arg, ...patterns) { + const toCheck = [].concat(...patterns); + return toCheck.some(function (pattern) { + const match = arg.match(pattern); + return match && hasAnyFlag(match[1]); + }); + } + // based on a simplified version of the short flag group parsing logic + function hasAllShortFlags(arg) { + // if this is a negative number, or doesn't start with a single hyphen, it's not a short flag group + if (arg.match(negative) || !arg.match(/^-[^-]+/)) { + return false; + } + let hasAllFlags = true; + let next; + const letters = arg.slice(1).split(''); + for (let j = 0; j < letters.length; j++) { + next = arg.slice(j + 2); + if (!hasAnyFlag(letters[j])) { + hasAllFlags = false; + break; + } + if ((letters[j + 1] && letters[j + 1] === '=') || + next === '-' || + (/[A-Za-z]/.test(letters[j]) && /^-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) || + (letters[j + 1] && letters[j + 1].match(/\W/))) { + break; + } + } + return hasAllFlags; + } + function isUnknownOptionAsArg(arg) { + return configuration['unknown-options-as-args'] && isUnknownOption(arg); + } + function isUnknownOption(arg) { + arg = arg.replace(/^-{3,}/, '--'); + // ignore negative numbers + if (arg.match(negative)) { + return false; + } + // if this is a short option group and all of them are configured, it isn't unknown + if (hasAllShortFlags(arg)) { + return false; + } + // e.g. '--count=2' + const flagWithEquals = /^-+([^=]+?)=[\s\S]*$/; + // e.g. '-a' or '--arg' + const normalFlag = /^-+([^=]+?)$/; + // e.g. '-a-' + const flagEndingInHyphen = /^-+([^=]+?)-$/; + // e.g. '-abc123' + const flagEndingInDigits = /^-+([^=]+?\d+)$/; + // e.g. '-a/usr/local' + const flagEndingInNonWordCharacters = /^-+([^=]+?)\W+.*$/; + // check the different types of flag styles, including negatedBoolean, a pattern defined near the start of the parse method + return !hasFlagsMatching(arg, flagWithEquals, negatedBoolean, normalFlag, flagEndingInHyphen, flagEndingInDigits, flagEndingInNonWordCharacters); + } + // make a best effort to pick a default value + // for an option based on name and type. + function defaultValue(key) { + if (!checkAllAliases(key, flags.bools) && + !checkAllAliases(key, flags.counts) && + `${key}` in defaults) { + return defaults[key]; + } + else { + return defaultForType(guessType(key)); + } + } + // return a default value, given the type of a flag., + function defaultForType(type) { + const def = { + [DefaultValuesForTypeKey.BOOLEAN]: true, + [DefaultValuesForTypeKey.STRING]: '', + [DefaultValuesForTypeKey.NUMBER]: undefined, + [DefaultValuesForTypeKey.ARRAY]: [] + }; + return def[type]; + } + // given a flag, enforce a default type. + function guessType(key) { + let type = DefaultValuesForTypeKey.BOOLEAN; + if (checkAllAliases(key, flags.strings)) + type = DefaultValuesForTypeKey.STRING; + else if (checkAllAliases(key, flags.numbers)) + type = DefaultValuesForTypeKey.NUMBER; + else if (checkAllAliases(key, flags.bools)) + type = DefaultValuesForTypeKey.BOOLEAN; + else if (checkAllAliases(key, flags.arrays)) + type = DefaultValuesForTypeKey.ARRAY; + return type; + } + function isUndefined(num) { + return num === undefined; + } + // check user configuration settings for inconsistencies + function checkConfiguration() { + // count keys should not be set as array/narg + Object.keys(flags.counts).find(key => { + if (checkAllAliases(key, flags.arrays)) { + error = Error(__('Invalid configuration: %s, opts.count excludes opts.array.', key)); + return true; + } + else if (checkAllAliases(key, flags.nargs)) { + error = Error(__('Invalid configuration: %s, opts.count excludes opts.narg.', key)); + return true; + } + return false; + }); + } + return { + aliases: Object.assign({}, flags.aliases), + argv: Object.assign(argvReturn, argv), + configuration: configuration, + defaulted: Object.assign({}, defaulted), + error: error, + newAliases: Object.assign({}, newAliases) + }; } - } - - // return a default value, given the type of a flag., - // e.g., key of type 'string' will default to '', rather than 'true'. - function defaultForType (type) { - const def = { - boolean: true, - string: '', - number: undefined, - array: [] - }; - - return def[type] - } - - // given a flag, enforce a default type. - function guessType (key) { - let type = 'boolean'; - if (checkAllAliases(key, flags.strings)) type = 'string'; - else if (checkAllAliases(key, flags.numbers)) type = 'number'; - else if (checkAllAliases(key, flags.bools)) type = 'boolean'; - else if (checkAllAliases(key, flags.arrays)) type = 'array'; - return type - } - - function isNumber (x) { - if (x === null || x === undefined) return false - // if loaded from config, may already be a number. - if (typeof x === 'number') return true - // hexadecimal. - if (/^0x[0-9a-f]+$/i.test(x)) return true - // don't treat 0123 as a number; as it drops the leading '0'. - if (x.length > 1 && x[0] === '0') return false - return /^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x) - } - - function isUndefined (num) { - return num === undefined - } - - // check user configuration settings for inconsistencies - function checkConfiguration () { - // count keys should not be set as array/narg - Object.keys(flags.counts).find(key => { - if (checkAllAliases(key, flags.arrays)) { - error = Error(__('Invalid configuration: %s, opts.count excludes opts.array.', key)); - return true - } else if (checkAllAliases(key, flags.nargs)) { - error = Error(__('Invalid configuration: %s, opts.count excludes opts.narg.', key)); - return true - } - }); - } - - return { - argv: Object.assign(argvReturn, argv), - error: error, - aliases: Object.assign({}, flags.aliases), - newAliases: Object.assign({}, newAliases), - defaulted: Object.assign({}, defaulted), - configuration: configuration - } } - // if any aliases reference each other, we should // merge them together. -function combineAliases (aliases) { - const aliasArrays = []; - const combined = Object.create(null); - let change = true; - - // turn alias lookup hash {key: ['alias1', 'alias2']} into - // a simple array ['key', 'alias1', 'alias2'] - Object.keys(aliases).forEach(function (key) { - aliasArrays.push( - [].concat(aliases[key], key) - ); - }); - - // combine arrays until zero changes are - // made in an iteration. - while (change) { - change = false; - for (let i = 0; i < aliasArrays.length; i++) { - for (let ii = i + 1; ii < aliasArrays.length; ii++) { - const intersect = aliasArrays[i].filter(function (v) { - return aliasArrays[ii].indexOf(v) !== -1 - }); - - if (intersect.length) { - aliasArrays[i] = aliasArrays[i].concat(aliasArrays[ii]); - aliasArrays.splice(ii, 1); - change = true; - break +function combineAliases(aliases) { + const aliasArrays = []; + const combined = Object.create(null); + let change = true; + // turn alias lookup hash {key: ['alias1', 'alias2']} into + // a simple array ['key', 'alias1', 'alias2'] + Object.keys(aliases).forEach(function (key) { + aliasArrays.push([].concat(aliases[key], key)); + }); + // combine arrays until zero changes are + // made in an iteration. + while (change) { + change = false; + for (let i = 0; i < aliasArrays.length; i++) { + for (let ii = i + 1; ii < aliasArrays.length; ii++) { + const intersect = aliasArrays[i].filter(function (v) { + return aliasArrays[ii].indexOf(v) !== -1; + }); + if (intersect.length) { + aliasArrays[i] = aliasArrays[i].concat(aliasArrays[ii]); + aliasArrays.splice(ii, 1); + change = true; + break; + } + } } - } } - } - - // map arrays back to the hash-lookup (de-dupe while - // we're at it). - aliasArrays.forEach(function (aliasArray) { - aliasArray = aliasArray.filter(function (v, i, self) { - return self.indexOf(v) === i + // map arrays back to the hash-lookup (de-dupe while + // we're at it). + aliasArrays.forEach(function (aliasArray) { + aliasArray = aliasArray.filter(function (v, i, self) { + return self.indexOf(v) === i; + }); + const lastAlias = aliasArray.pop(); + if (lastAlias !== undefined && typeof lastAlias === 'string') { + combined[lastAlias] = aliasArray; + } }); - combined[aliasArray.pop()] = aliasArray; - }); - - return combined + return combined; } - // this function should only be called when a count is given as an arg // it is NOT called to set a default value // thus we can start the count at 1 instead of 0 -function increment (orig) { - return orig !== undefined ? orig + 1 : 1 +function increment(orig) { + return orig !== undefined ? orig + 1 : 1; } - -function Parser (args, opts) { - const result = parse(args.slice(), opts); - return result.argv -} - -// parse arguments and return detailed -// meta information, aliases, etc. -Parser.detailed = function (args, opts) { - return parse(args.slice(), opts) -}; - // TODO(bcoe): in the next major version of yargs, switch to // Object.create(null) for dot notation: -function sanitizeKey (key) { - if (key === '__proto__') return '___proto___' - return key +function sanitizeKey(key) { + if (key === '__proto__') + return '___proto___'; + return key; } -var yargsParser = Parser; +/** + * @fileoverview Main entrypoint for libraries using yargs-parser in Node.js + * CJS and ESM environments. + * + * @license + * Copyright (c) 2016, Contributors + * SPDX-License-Identifier: ISC + */ +// See https://github.com/yargs/yargs-parser#supported-nodejs-versions for our +// version support policy. The YARGS_MIN_NODE_VERSION is used for testing only. +const minNodeVersion = (process && process.env && process.env.YARGS_MIN_NODE_VERSION) + ? Number(process.env.YARGS_MIN_NODE_VERSION) + : 10; +if (process && process.version) { + const major = Number(process.version.match(/v([^.]+)/)[1]); + if (major < minNodeVersion) { + throw Error(`yargs parser supports a minimum Node.js version of ${minNodeVersion}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`); + } +} +// Creates a yargs-parser instance using Node.js standard libraries: +const env = process ? process.env : {}; +const parser = new YargsParser({ + cwd: process.cwd, + env: () => { + return env; + }, + format: require$$2.format, + normalize: require$$0.normalize, + resolve: require$$0.resolve, + // TODO: figure out a way to combine ESM and CJS coverage, such that + // we can exercise all the lines below: + require: (path) => { + if (typeof require !== 'undefined') { + return require(path); + } + else if (path.match(/\.json$/)) { + return require$$0$1.readFileSync(path, 'utf8'); + } + else { + throw Error('only .json config files are supported in ESM'); + } + } +}); +const yargsParser = function Parser(args, opts) { + const result = parser.parse(args.slice(), opts); + return result.argv; +}; +yargsParser.detailed = function (args, opts) { + return parser.parse(args.slice(), opts); +}; +yargsParser.camelCase = camelCase; +yargsParser.decamelize = decamelize; +yargsParser.looksLikeNumber = looksLikeNumber; +const argParser = yargsParser; var parseMs = milliseconds => { if (typeof milliseconds !== 'number') { @@ -1202,6 +1253,8 @@ var parseMs = milliseconds => { }; }; +const parseMilliseconds = parseMs; + const pluralize = (word, count) => count === 1 ? word : `${word}s`; const SECOND_ROUNDING_EPSILON = 0.0000001; @@ -1253,7 +1306,7 @@ var prettyMs = (milliseconds, options = {}) => { result.push(prefix + valueString + suffix); }; - const parsed = parseMs(milliseconds); + const parsed = parseMilliseconds(milliseconds); add(Math.trunc(parsed.days / 365), 'year', 'y'); add(parsed.days % 365, 'day', 'd'); @@ -1263,7 +1316,7 @@ var prettyMs = (milliseconds, options = {}) => { if ( options.separateMilliseconds || options.formatSubMilliseconds || - milliseconds < 1000 + (!options.colonNotation && milliseconds < 1000) ) { add(parsed.seconds, 'second', 's'); if (options.formatSubMilliseconds) { @@ -1325,9 +1378,7 @@ var prettyMs = (milliseconds, options = {}) => { return options.colonNotation ? result.join('') : result.join(' '); }; -let SOURCEMAPPING_URL = 'sourceMa'; -SOURCEMAPPING_URL += 'ppingURL'; -var SOURCEMAPPING_URL$1 = SOURCEMAPPING_URL; +const ms = prettyMs; const BYTE_UNITS = [ 'B', @@ -1341,6 +1392,18 @@ const BYTE_UNITS = [ 'YB' ]; +const BIBYTE_UNITS = [ + 'B', + 'kiB', + 'MiB', + 'GiB', + 'TiB', + 'PiB', + 'EiB', + 'ZiB', + 'YiB' +]; + const BIT_UNITS = [ 'b', 'kbit', @@ -1353,18 +1416,30 @@ const BIT_UNITS = [ 'Ybit' ]; +const BIBIT_UNITS = [ + 'b', + 'kibit', + 'Mibit', + 'Gibit', + 'Tibit', + 'Pibit', + 'Eibit', + 'Zibit', + 'Yibit' +]; + /* Formats the given number using `Number#toLocaleString`. - If locale is a string, the value is expected to be a locale-key (for example: `de`). - If locale is true, the system default locale is used for translation. - If no value for locale is specified, the number is returned unmodified. */ -const toLocaleString = (number, locale) => { +const toLocaleString = (number, locale, options) => { let result = number; - if (typeof locale === 'string') { - result = number.toLocaleString(locale); - } else if (locale === true) { - result = number.toLocaleString(); + if (typeof locale === 'string' || Array.isArray(locale)) { + result = number.toLocaleString(locale, options); + } else if (locale === true || options !== undefined) { + result = number.toLocaleString(undefined, options); } return result; @@ -1375,11 +1450,14 @@ var prettyBytes = (number, options) => { throw new TypeError(`Expected a finite number, got ${typeof number}: ${number}`); } - options = Object.assign({bits: false}, options); - const UNITS = options.bits ? BIT_UNITS : BYTE_UNITS; + options = Object.assign({bits: false, binary: false}, options); + + const UNITS = options.bits ? + (options.binary ? BIBIT_UNITS : BIT_UNITS) : + (options.binary ? BIBYTE_UNITS : BYTE_UNITS); if (options.signed && number === 0) { - return ' 0 ' + UNITS[0]; + return ` 0 ${UNITS[0]}`; } const isNegative = number < 0; @@ -1389,26 +1467,42 @@ var prettyBytes = (number, options) => { number = -number; } + let localeOptions; + + if (options.minimumFractionDigits !== undefined) { + localeOptions = {minimumFractionDigits: options.minimumFractionDigits}; + } + + if (options.maximumFractionDigits !== undefined) { + localeOptions = Object.assign({maximumFractionDigits: options.maximumFractionDigits}, localeOptions); + } + if (number < 1) { - const numberString = toLocaleString(number, options.locale); + const numberString = toLocaleString(number, options.locale, localeOptions); return prefix + numberString + ' ' + UNITS[0]; } - const exponent = Math.min(Math.floor(Math.log10(number) / 3), UNITS.length - 1); + const exponent = Math.min(Math.floor(options.binary ? Math.log(number) / Math.log(1024) : Math.log10(number) / 3), UNITS.length - 1); // eslint-disable-next-line unicorn/prefer-exponentiation-operator - number = Number((number / Math.pow(1000, exponent)).toPrecision(3)); - const numberString = toLocaleString(number, options.locale); + number /= Math.pow(options.binary ? 1024 : 1000, exponent); + + if (!localeOptions) { + number = number.toPrecision(3); + } + + const numberString = toLocaleString(Number(number), options.locale, localeOptions); const unit = UNITS[exponent]; return prefix + numberString + ' ' + unit; }; +const prettyBytes$1 = prettyBytes; + function printTimings(timings) { - Object.keys(timings).forEach(label => { - const appliedColor = label[0] === '#' ? (label[1] !== '#' ? loadConfigFile_js.colorette.underline : loadConfigFile_js.colorette.bold) : (text) => text; - const [time, memory, total] = timings[label]; - const row = `${label}: ${time.toFixed(0)}ms, ${prettyBytes(memory)} / ${prettyBytes(total)}`; + Object.entries(timings).forEach(([label, [time, memory, total]]) => { + const appliedColor = label[0] === '#' ? (label[1] !== '#' ? loadConfigFile_js.underline : loadConfigFile_js.bold) : (text) => text; + const row = `${label}: ${time.toFixed(0)}ms, ${prettyBytes$1(memory)} / ${prettyBytes$1(total)}`; console.info(appliedColor(row)); }); } @@ -1417,7 +1511,7 @@ async function build(inputOptions, warnings, silent = false) { const outputOptions = inputOptions.output; const useStdout = !outputOptions[0].file && !outputOptions[0].dir; const start = Date.now(); - const files = useStdout ? ['stdout'] : outputOptions.map((t) => rollup.relativeId(t.file || t.dir)); + const files = useStdout ? ['stdout'] : outputOptions.map(t => rollup.relativeId(t.file || t.dir)); if (!silent) { let inputFiles; if (typeof inputOptions.input === 'string') { @@ -1427,11 +1521,9 @@ async function build(inputOptions, warnings, silent = false) { inputFiles = inputOptions.input.join(', '); } else if (typeof inputOptions.input === 'object' && inputOptions.input !== null) { - inputFiles = Object.keys(inputOptions.input) - .map((name) => inputOptions.input[name]) - .join(', '); + inputFiles = Object.values(inputOptions.input).join(', '); } - loadConfigFile_js.stderr(loadConfigFile_js.colorette.cyan(`\n${loadConfigFile_js.colorette.bold(inputFiles)} → ${loadConfigFile_js.colorette.bold(files.join(', '))}...`)); + loadConfigFile_js.stderr(loadConfigFile_js.cyan(`\n${loadConfigFile_js.bold(inputFiles)} → ${loadConfigFile_js.bold(files.join(', '))}...`)); } const bundle = await rollup.rollup(inputOptions); if (useStdout) { @@ -1439,7 +1531,7 @@ async function build(inputOptions, warnings, silent = false) { if (output.sourcemap && output.sourcemap !== 'inline') { loadConfigFile_js.handleError({ code: 'ONLY_INLINE_SOURCEMAPS', - message: 'Only inline sourcemaps are supported when bundling to stdout.', + message: 'Only inline sourcemaps are supported when bundling to stdout.' }); } const { output: outputs } = await bundle.generate(output); @@ -1451,12 +1543,12 @@ async function build(inputOptions, warnings, silent = false) { else { source = file.code; if (output.sourcemap === 'inline') { - source += `\n//# ${SOURCEMAPPING_URL$1}=${file.map.toUrl()}\n`; + source += `\n//# ${rollup.SOURCEMAPPING_URL}=${file.map.toUrl()}\n`; } } if (outputs.length > 1) - process.stdout.write(`\n${loadConfigFile_js.colorette.cyan(loadConfigFile_js.colorette.bold(`//→ ${file.fileName}:`))}\n`); - process.stdout.write(source); + process$1.stdout.write(`\n${loadConfigFile_js.cyan(loadConfigFile_js.bold(`//→ ${file.fileName}:`))}\n`); + process$1.stdout.write(source); } if (!silent) { warnings.flush(); @@ -1464,56 +1556,29 @@ async function build(inputOptions, warnings, silent = false) { return; } await Promise.all(outputOptions.map(bundle.write)); + await bundle.close(); if (!silent) { warnings.flush(); - loadConfigFile_js.stderr(loadConfigFile_js.colorette.green(`created ${loadConfigFile_js.colorette.bold(files.join(', '))} in ${loadConfigFile_js.colorette.bold(prettyMs(Date.now() - start))}`)); + loadConfigFile_js.stderr(loadConfigFile_js.green(`created ${loadConfigFile_js.bold(files.join(', '))} in ${loadConfigFile_js.bold(ms(Date.now() - start))}`)); if (bundle && bundle.getTimings) { printTimings(bundle.getTimings()); } } } -var modules = {}; - -var getModule = function(dir) { - var rootPath = dir ? path.resolve(dir) : process.cwd(); - var rootName = path.join(rootPath, '@root'); - var root = modules[rootName]; - if (!root) { - root = new module$1(rootName); - root.filename = rootName; - root.paths = module$1._nodeModulePaths(rootPath); - modules[rootName] = root; - } - return root; -}; - -var requireRelative = function(requested, relativeTo) { - var root = getModule(relativeTo); - return root.require(requested); -}; - -requireRelative.resolve = function(requested, relativeTo) { - var root = getModule(relativeTo); - return module$1._resolveFilename(requested, root); -}; - -var requireRelative_1 = requireRelative; - const DEFAULT_CONFIG_BASE = 'rollup.config'; -function getConfigPath(commandConfig) { - const cwd = process.cwd(); +async function getConfigPath(commandConfig) { if (commandConfig === true) { - return path.join(cwd, findConfigFileNameInCwd()); + return require$$0.resolve(await findConfigFileNameInCwd()); } if (commandConfig.slice(0, 5) === 'node:') { const pkgName = commandConfig.slice(5); try { - return requireRelative_1.resolve(`rollup-config-${pkgName}`, cwd); + return require.resolve(`rollup-config-${pkgName}`, { paths: [process$1.cwd()] }); } - catch (err) { + catch (_a) { try { - return requireRelative_1.resolve(pkgName, cwd); + return require.resolve(pkgName, { paths: [process$1.cwd()] }); } catch (err) { if (err.code === 'MODULE_NOT_FOUND') { @@ -1526,11 +1591,11 @@ function getConfigPath(commandConfig) { } } } - return fs.realpathSync(commandConfig); + return require$$0.resolve(commandConfig); } -function findConfigFileNameInCwd() { - const filesInWorkingDir = new Set(fs.readdirSync(process.cwd())); - for (const extension of ['mjs', 'cjs']) { +async function findConfigFileNameInCwd() { + const filesInWorkingDir = new Set(await require$$0$1.promises.readdir(process$1.cwd())); + for (const extension of ['mjs', 'cjs', 'ts']) { const fileName = `${DEFAULT_CONFIG_BASE}.${extension}`; if (filesInWorkingDir.has(fileName)) return fileName; @@ -1538,13 +1603,13 @@ function findConfigFileNameInCwd() { return `${DEFAULT_CONFIG_BASE}.js`; } -function loadConfigFromCommand(command) { +async function loadConfigFromCommand(command) { const warnings = loadConfigFile_js.batchWarnings(); - if (!command.input && (command.stdin || !process.stdin.isTTY)) { + if (!command.input && (command.stdin || !process$1.stdin.isTTY)) { command.input = loadConfigFile_js.stdinName; } const options = mergeOptions.mergeOptions({ input: [] }, command, warnings.add); - loadConfigFile_js.addCommandPluginsToInputOptions(options, command); + await loadConfigFile_js.addCommandPluginsToInputOptions(options, command); return { options: [options], warnings }; } @@ -1566,14 +1631,12 @@ async function runRollup(command) { inputSource = command.input; } if (inputSource && inputSource.length > 0) { - if (inputSource.some((input) => input.indexOf('=') !== -1)) { + if (inputSource.some((input) => input.includes('='))) { command.input = {}; inputSource.forEach((input) => { const equalsIndex = input.indexOf('='); - const value = input.substr(equalsIndex + 1); - let key = input.substr(0, equalsIndex); - if (!key) - key = rollup.getAliasName(input); + const value = input.substring(equalsIndex + 1); + const key = input.substring(0, equalsIndex) || rollup.getAliasName(input); command.input[key] = value; }); } @@ -1588,18 +1651,13 @@ async function runRollup(command) { environment.forEach((arg) => { arg.split(',').forEach((pair) => { const [key, ...value] = pair.split(':'); - if (value.length) { - process.env[key] = value.join(':'); - } - else { - process.env[key] = String(true); - } + process$1.env[key] = value.length === 0 ? String(true) : value.join(':'); }); }); } - if (command.watch) { + if (mergeOptions.isWatchEnabled(command.watch)) { await rollup.loadFsEvents(); - const { watch } = await Promise.resolve().then(function () { return require('../shared/watch-cli.js'); }); + const { watch } = await Promise.resolve().then(() => require('../shared/watch-cli.js')); watch(command); } else { @@ -1609,6 +1667,13 @@ async function runRollup(command) { for (const inputOptions of options) { await build(inputOptions, warnings, command.silent); } + if (command.failAfterWarnings && warnings.warningOccurred) { + warnings.flush(); + loadConfigFile_js.handleError({ + code: 'FAIL_AFTER_WARNINGS', + message: 'Warnings occurred and --failAfterWarnings flag present' + }); + } } catch (err) { warnings.flush(); @@ -1622,18 +1687,18 @@ async function runRollup(command) { } async function getConfigs(command) { if (command.config) { - const configFile = getConfigPath(command.config); + const configFile = await getConfigPath(command.config); const { options, warnings } = await loadConfigFile_js.loadAndParseConfigFile(configFile, command); return { options, warnings }; } - return loadConfigFromCommand(command); + return await loadConfigFromCommand(command); } -const command = yargsParser(process.argv.slice(2), { +const command = argParser(process$1.argv.slice(2), { alias: mergeOptions.commandAliases, configuration: { 'camel-case-expansion': false } }); -if (command.help || (process.argv.length <= 2 && process.stdin.isTTY)) { +if (command.help || (process$1.argv.length <= 2 && process$1.stdin.isTTY)) { console.log(`\n${help.replace('__VERSION__', rollup.version)}\n`); } else if (command.version) { @@ -1643,7 +1708,7 @@ else { try { require('source-map-support').install(); } - catch (err) { + catch (_a) { // do nothing } runRollup(command); @@ -1651,6 +1716,6 @@ else { exports.getConfigPath = getConfigPath; exports.loadConfigFromCommand = loadConfigFromCommand; -exports.prettyMs = prettyMs; +exports.ms = ms; exports.printTimings = printTimings; //# sourceMappingURL=rollup.map diff --git a/node_modules/rollup/dist/es/rollup.browser.js b/node_modules/rollup/dist/es/rollup.browser.js index 85195a043c88..4724a96ec301 100644 --- a/node_modules/rollup/dist/es/rollup.browser.js +++ b/node_modules/rollup/dist/es/rollup.browser.js @@ -1,11 +1,10 @@ /* @license - Rollup.js v2.18.0 - Mon, 22 Jun 2020 04:16:05 GMT - commit ee6ef99935fbd24a3e30ef05b0b98e4019f983c6 - + Rollup.js v2.79.1 + Thu, 22 Sep 2022 04:55:29 GMT - commit 69ff4181e701a0fe0026d0ba147f31bc86beffa8 https://github.com/rollup/rollup Released under the MIT License. */ -for(var e="2.18.0",t={},s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",i=0;i>>=5)>0&&(i|=32),t+=s[i]}while(e>0);return t}var a=function e(t){this.bits=t instanceof e?t.bits.slice():[]};a.prototype.add=function(e){this.bits[e>>5]|=1<<(31&e)},a.prototype.has=function(e){return!!(this.bits[e>>5]&1<<(31&e))};var o=function(e,t,s){this.start=e,this.end=t,this.original=s,this.intro="",this.outro="",this.content=s,this.storeName=!1,this.edited=!1,Object.defineProperties(this,{previous:{writable:!0,value:null},next:{writable:!0,value:null}})};o.prototype.appendLeft=function(e){this.outro+=e},o.prototype.appendRight=function(e){this.intro=this.intro+e},o.prototype.clone=function(){var e=new o(this.start,this.end,this.original);return e.intro=this.intro,e.outro=this.outro,e.content=this.content,e.storeName=this.storeName,e.edited=this.edited,e},o.prototype.contains=function(e){return this.start0&&(a+=";"),0!==h.length){for(var l=0,c=[],u=0,d=h;u1&&(f+=r(p[1]-t)+r(p[2]-s)+r(p[3]-i),t=p[1],s=p[2],i=p[3]),5===p.length&&(f+=r(p[4]-n),n=p[4]),c.push(f)}a+=c.join(",")}}return a}(e.mappings)};function c(e){var t=e.split("\n"),s=t.filter((function(e){return/^\t+/.test(e)})),i=t.filter((function(e){return/^ {2,}/.test(e)}));if(0===s.length&&0===i.length)return null;if(s.length>=i.length)return"\t";var n=i.reduce((function(e,t){var s=/^ +/.exec(t)[0].length;return Math.min(s,e)}),1/0);return new Array(n+1).join(" ")}function u(e,t){var s=e.split(/[/\\]/),i=t.split(/[/\\]/);for(s.pop();s[0]===i[0];)s.shift(),i.shift();if(s.length)for(var n=s.length;n--;)s[n]="..";return s.concat(i).join("/")}l.prototype.toString=function(){return JSON.stringify(this)},l.prototype.toUrl=function(){return"data:application/json;charset=utf-8;base64,"+h(this.toString())};var d=Object.prototype.toString;function p(e){return"[object Object]"===d.call(e)}function f(e){for(var t=e.split("\n"),s=[],i=0,n=0;i>1;e=0&&n.push(i),this.rawSegments.push(n)}else this.pending&&this.rawSegments.push(this.pending);this.advance(t),this.pending=null},m.prototype.addUneditedChunk=function(e,t,s,i,n){for(var r=t.start,a=!0;r1){for(var s=0;s=e&&s<=t)throw new Error("Cannot move a selection inside itself");this._split(e),this._split(t),this._split(s);var i=this.byStart[e],n=this.byEnd[t],r=i.previous,a=n.next,o=this.byStart[s];if(!o&&n===this.lastChunk)return this;var h=o?o.previous:this.lastChunk;return r&&(r.next=a),a&&(a.previous=r),h&&(h.next=i),o&&(o.previous=n),i.previous||(this.firstChunk=n.next),n.next||(this.lastChunk=i.previous,this.lastChunk.next=null),i.previous=h,n.next=o||null,h||(this.firstChunk=i),o||(this.lastChunk=n),this},x.prototype.overwrite=function(e,t,s,i){if("string"!=typeof s)throw new TypeError("replacement content must be a string");for(;e<0;)e+=this.original.length;for(;t<0;)t+=this.original.length;if(t>this.original.length)throw new Error("end is out of bounds");if(e===t)throw new Error("Cannot overwrite a zero-length range – use appendLeft or prependRight instead");this._split(e),this._split(t),!0===i&&(y.storeName||(console.warn("The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string"),y.storeName=!0),i={storeName:!0});var n=void 0!==i&&i.storeName,r=void 0!==i&&i.contentOnly;if(n){var a=this.original.slice(e,t);this.storedNames[a]=!0}var h=this.byStart[e],l=this.byEnd[t];if(h){if(t>h.end&&h.next!==this.byStart[h.end])throw new Error("Cannot overwrite across a split point");if(h.edit(s,n,r),h!==l){for(var c=h.next;c!==l;)c.edit("",!1),c=c.next;c.edit("",!1)}}else{var u=new o(e,t,"").edit(s,n);l.next=u,u.previous=l}return this},x.prototype.prepend=function(e){if("string"!=typeof e)throw new TypeError("outro content must be a string");return this.intro=e+this.intro,this},x.prototype.prependLeft=function(e,t){if("string"!=typeof t)throw new TypeError("inserted content must be a string");this._split(e);var s=this.byEnd[e];return s?s.prependLeft(t):this.intro=t+this.intro,this},x.prototype.prependRight=function(e,t){if("string"!=typeof t)throw new TypeError("inserted content must be a string");this._split(e);var s=this.byStart[e];return s?s.prependRight(t):this.outro=t+this.outro,this},x.prototype.remove=function(e,t){for(;e<0;)e+=this.original.length;for(;t<0;)t+=this.original.length;if(e===t)return this;if(e<0||t>this.original.length)throw new Error("Character is out of bounds");if(e>t)throw new Error("end must be greater than start");this._split(e),this._split(t);for(var s=this.byStart[e];s;)s.intro="",s.outro="",s.edit(""),s=t>s.end?this.byStart[s.end]:null;return this},x.prototype.lastChar=function(){if(this.outro.length)return this.outro[this.outro.length-1];var e=this.lastChunk;do{if(e.outro.length)return e.outro[e.outro.length-1];if(e.content.length)return e.content[e.content.length-1];if(e.intro.length)return e.intro[e.intro.length-1]}while(e=e.previous);return this.intro.length?this.intro[this.intro.length-1]:""},x.prototype.lastLine=function(){var e=this.outro.lastIndexOf(g);if(-1!==e)return this.outro.substr(e+1);var t=this.outro,s=this.lastChunk;do{if(s.outro.length>0){if(-1!==(e=s.outro.lastIndexOf(g)))return s.outro.substr(e+1)+t;t=s.outro+t}if(s.content.length>0){if(-1!==(e=s.content.lastIndexOf(g)))return s.content.substr(e+1)+t;t=s.content+t}if(s.intro.length>0){if(-1!==(e=s.intro.lastIndexOf(g)))return s.intro.substr(e+1)+t;t=s.intro+t}}while(s=s.previous);return-1!==(e=this.intro.lastIndexOf(g))?this.intro.substr(e+1)+t:this.intro+t},x.prototype.slice=function(e,t){for(void 0===e&&(e=0),void 0===t&&(t=this.original.length);e<0;)e+=this.original.length;for(;t<0;)t+=this.original.length;for(var s="",i=this.firstChunk;i&&(i.start>e||i.end<=e);){if(i.start=t)return s;i=i.next}if(i&&i.edited&&i.start!==e)throw new Error("Cannot use replaced character "+e+" as slice start anchor.");for(var n=i;i;){!i.intro||n===i&&i.start!==e||(s+=i.intro);var r=i.start=t;if(r&&i.edited&&i.end!==t)throw new Error("Cannot use replaced character "+t+" as slice end anchor.");var a=n===i?e-i.start:0,o=r?i.content.length+t-i.end:i.content.length;if(s+=i.content.slice(a,o),!i.outro||r&&i.end!==t||(s+=i.outro),r)break;i=i.next}return s},x.prototype.snip=function(e,t){var s=this.clone();return s.remove(0,e),s.remove(t,s.original.length),s},x.prototype._split=function(e){if(!this.byStart[e]&&!this.byEnd[e])for(var t=this.lastSearchedChunk,s=e>t.end;t;){if(t.contains(e))return this._splitChunk(t,e);t=s?this.byStart[t.end]:this.byEnd[t.start]}},x.prototype._splitChunk=function(e,t){if(e.edited&&e.content.length){var s=f(this.original)(t);throw new Error("Cannot split a chunk that has already been edited ("+s.line+":"+s.column+' – "'+e.original+'")')}var i=e.split(t);return this.byEnd[t]=e,this.byStart[t]=i,this.byEnd[i.end]=i,e===this.lastChunk&&(this.lastChunk=i),this.lastSearchedChunk=e,!0},x.prototype.toString=function(){for(var e=this.intro,t=this.firstChunk;t;)e+=t.toString(),t=t.next;return e+this.outro},x.prototype.isEmpty=function(){var e=this.firstChunk;do{if(e.intro.length&&e.intro.trim()||e.content.length&&e.content.trim()||e.outro.length&&e.outro.trim())return!1}while(e=e.next);return!0},x.prototype.length=function(){var e=this.firstChunk,t=0;do{t+=e.intro.length+e.content.length+e.outro.length}while(e=e.next);return t},x.prototype.trimLines=function(){return this.trim("[\\r\\n]")},x.prototype.trim=function(e){return this.trimStart(e).trimEnd(e)},x.prototype.trimEndAborted=function(e){var t=new RegExp((e||"\\s")+"+$");if(this.outro=this.outro.replace(t,""),this.outro.length)return!0;var s=this.lastChunk;do{var i=s.end,n=s.trimEnd(t);if(s.end!==i&&(this.lastChunk===s&&(this.lastChunk=s.next),this.byEnd[s.end]=s,this.byStart[s.next.start]=s.next,this.byEnd[s.next.end]=s.next),n)return!0;s=s.previous}while(s);return!1},x.prototype.trimEnd=function(e){return this.trimEndAborted(e),this},x.prototype.trimStartAborted=function(e){var t=new RegExp("^"+(e||"\\s")+"+");if(this.intro=this.intro.replace(t,""),this.intro.length)return!0;var s=this.firstChunk;do{var i=s.end,n=s.trimStart(t);if(s.end!==i&&(s===this.lastChunk&&(this.lastChunk=s.next),this.byEnd[s.end]=s,this.byStart[s.next.start]=s.next,this.byEnd[s.next.end]=s.next),n)return!0;s=s.next}while(s);return!1},x.prototype.trimStart=function(e){return this.trimStartAborted(e),this};var E=Object.prototype.hasOwnProperty,v=function(e){void 0===e&&(e={}),this.intro=e.intro||"",this.separator=void 0!==e.separator?e.separator:"\n",this.sources=[],this.uniqueSources=[],this.uniqueSourceIndexByFilename={}};function b(e,t){const s=e.split(/[/\\]/).filter(Boolean),i=t.split(/[/\\]/).filter(Boolean);for("."===s[0]&&s.shift(),"."===i[0]&&i.shift();s[0]&&i[0]&&s[0]===i[0];)s.shift(),i.shift();for(;".."===i[0]&&s.length>0;)i.shift(),s.pop();for(;s.pop();)i.unshift("..");return i.join("/")}v.prototype.addSource=function(e){if(e instanceof x)return this.addSource({content:e,filename:e.filename,separator:this.separator});if(!p(e)||!e.content)throw new Error("bundle.addSource() takes an object with a `content` property, which should be an instance of MagicString, and an optional `filename`");if(["filename","indentExclusionRanges","separator"].forEach((function(t){E.call(e,t)||(e[t]=e.content[t])})),void 0===e.separator&&(e.separator=this.separator),e.filename)if(E.call(this.uniqueSourceIndexByFilename,e.filename)){var t=this.uniqueSources[this.uniqueSourceIndexByFilename[e.filename]];if(e.content.original!==t.content)throw new Error("Illegal source: same filename ("+e.filename+"), different contents")}else this.uniqueSourceIndexByFilename[e.filename]=this.uniqueSources.length,this.uniqueSources.push({filename:e.filename,content:e.content.original});return this.sources.push(e),this},v.prototype.append=function(e,t){return this.addSource({content:new x(e),separator:t&&t.separator||""}),this},v.prototype.clone=function(){var e=new v({intro:this.intro,separator:this.separator});return this.sources.forEach((function(t){e.addSource({filename:t.filename,content:t.content.clone(),separator:t.separator})})),e},v.prototype.generateDecodedMap=function(e){var t=this;void 0===e&&(e={});var s=[];this.sources.forEach((function(e){Object.keys(e.content.storedNames).forEach((function(e){~s.indexOf(e)||s.push(e)}))}));var i=new m(e.hires);return this.intro&&i.advance(this.intro),this.sources.forEach((function(e,n){n>0&&i.advance(t.separator);var r=e.filename?t.uniqueSourceIndexByFilename[e.filename]:-1,a=e.content,o=f(a.original);a.intro&&i.advance(a.intro),a.firstChunk.eachNext((function(t){var n=o(t.start);t.intro.length&&i.advance(t.intro),e.filename?t.edited?i.addEdit(r,t.content,n,t.storeName?s.indexOf(t.original):-1):i.addUneditedChunk(r,t,a.original,n,a.sourcemapLocations):i.advance(t.content),t.outro.length&&i.advance(t.outro)})),a.outro&&i.advance(a.outro)})),{file:e.file?e.file.split(/[/\\]/).pop():null,sources:this.uniqueSources.map((function(t){return e.file?u(e.file,t.filename):t.filename})),sourcesContent:this.uniqueSources.map((function(t){return e.includeContent?t.content:null})),names:s,mappings:i.raw}},v.prototype.generateMap=function(e){return new l(this.generateDecodedMap(e))},v.prototype.getIndentString=function(){var e={};return this.sources.forEach((function(t){var s=t.content.indentStr;null!==s&&(e[s]||(e[s]=0),e[s]+=1)})),Object.keys(e).sort((function(t,s){return e[t]-e[s]}))[0]||"\t"},v.prototype.indent=function(e){var t=this;if(arguments.length||(e=this.getIndentString()),""===e)return this;var s=!this.intro||"\n"===this.intro.slice(-1);return this.sources.forEach((function(i,n){var r=void 0!==i.separator?i.separator:t.separator,a=s||n>0&&/\r?\n$/.test(r);i.content.indent(e,{exclude:i.indentExclusionRanges,indentStart:a}),s="\n"===i.content.lastChar()})),this.intro&&(this.intro=e+this.intro.replace(/^[^\n]/gm,(function(t,s){return s>0?e+t:t}))),this},v.prototype.prepend=function(e){return this.intro=e+this.intro,this},v.prototype.toString=function(){var e=this,t=this.sources.map((function(t,s){var i=void 0!==t.separator?t.separator:e.separator;return(s>0?i:"")+t.content.toString()})).join("");return this.intro+t},v.prototype.isEmpty=function(){return(!this.intro.length||!this.intro.trim())&&!this.sources.some((function(e){return!e.content.isEmpty()}))},v.prototype.length=function(){return this.sources.reduce((function(e,t){return e+t.content.length()}),this.intro.length)},v.prototype.trimLines=function(){return this.trim("[\\r\\n]")},v.prototype.trim=function(e){return this.trimStart(e).trimEnd(e)},v.prototype.trimStart=function(e){var t=new RegExp("^"+(e||"\\s")+"+");if(this.intro=this.intro.replace(t,""),!this.intro){var s,i=0;do{if(!(s=this.sources[i++]))break}while(!s.content.trimStartAborted(e))}return this},v.prototype.trimEnd=function(e){var t,s=new RegExp((e||"\\s")+"+$"),i=this.sources.length-1;do{if(!(t=this.sources[i--])){this.intro=this.intro.replace(s,"");break}}while(!t.content.trimEndAborted(e));return this};function S(e,t,s,i){if(t.remove(s,i),e.annotations)for(const i of e.annotations){if(!(i.start=i)return i;n=e.charCodeAt(++s),++s,(s=47===n?e.indexOf("\n",s)+1:e.indexOf("*/",s)+2)>i&&(i=e.indexOf(t,s))}}const k=/\s/;function w(e,t){for(;tt)return t;if(s=e.charCodeAt(++i),47===s)return t;i=e.indexOf("*/",i+2)+2,i>t&&(t=e.indexOf("\n",i))}}function _(e,t,s,i,n){let r,a,o,h,l=e[0],c=!l.included||l.needsBoundaries;c&&(h=s+N(t.original.slice(s,l.start))+1);for(let s=1;s<=e.length;s++)r=l,a=h,o=c,l=e[s],c=void 0!==l&&(!l.included||l.needsBoundaries),o||c?(h=r.end+N(t.original.slice(r.end,void 0===l?i:l.start))+1,r.included?o?r.render(t,n,{end:h,start:a}):r.render(t,n):S(r,t,a,h)):r.render(t,n)}function I(e,t,s,i){const n=[];let r,a,o,h,l,c=s-1;for(let i=0;it.exportNamesByVariable.get(e).map(t=>`${t}:${s}${e.getName()}`).join(","+s)).join(","+s)}${s}})`}function M(e,t,s){const i=s.compact?"":" ",n=s.compact?"":";";return`function${i}(v)${i}{${i}return exports({${i}${e.map(e=>s.exportNamesByVariable.get(e).map(s=>`${s}:${i}${t?e.getName():"v"}`).join(","+i)).join(","+i)}${i}}),${i}v${n}${i}}(`}function L(e){let t="";do{const s=e%64;e=Math.floor(e/64),t="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_$"[s]+t}while(0!==e);return t}const R=Object.assign(Object.create(null),{await:!0,break:!0,case:!0,catch:!0,class:!0,const:!0,continue:!0,debugger:!0,default:!0,delete:!0,do:!0,else:!0,enum:!0,eval:!0,export:!0,extends:!0,false:!0,finally:!0,for:!0,function:!0,if:!0,implements:!0,import:!0,in:!0,instanceof:!0,interface:!0,let:!0,new:!0,null:!0,package:!0,private:!0,protected:!0,public:!0,return:!0,static:!0,super:!0,switch:!0,this:!0,throw:!0,true:!0,try:!0,typeof:!0,undefined:!0,var:!0,void:!0,while:!0,with:!0,yield:!0});function O(e,t){let s=e,i=1;for(;t.has(s)||R[s];)s=`${e}$${L(i++)}`;return t.add(s),s}const D=[],V=Symbol("Unknown Key"),B=[],F=[V],W=Symbol("Entities");class U{constructor(){this.entityPaths=Object.create(null,{[W]:{value:new Set}})}getEntities(e){let t=this.entityPaths;for(const s of e)t=t[s]=t[s]||Object.create(null,{[W]:{value:new Set}});return t[W]}}const z=new U;class j{constructor(){this.entityPaths=Object.create(null,{[W]:{value:new Map}})}getEntities(e,t){let s=this.entityPaths;for(const t of e)s=s[t]=s[t]||Object.create(null,{[W]:{value:new Map}});const i=s[W],n=i.get(t)||new Set;return i.set(t,n),n}}function G(e,t=null){return Object.create(t,e)}const H=Symbol("Unknown Value"),q={deoptimizePath:()=>{},getLiteralValueAtPath:()=>H,getReturnExpressionWhenCalledAtPath:()=>q,hasEffectsWhenAccessedAtPath:e=>e.length>0,hasEffectsWhenAssignedAtPath:e=>e.length>0,hasEffectsWhenCalledAtPath:()=>!0,include:()=>{},includeCallArguments(e,t){for(const s of t)s.include(e,!1)},included:!0,toString:()=>"[[UNKNOWN]]"},K={deoptimizePath:()=>{},getLiteralValueAtPath:()=>{},getReturnExpressionWhenCalledAtPath:()=>q,hasEffectsWhenAccessedAtPath:e=>e.length>0,hasEffectsWhenAssignedAtPath:e=>e.length>0,hasEffectsWhenCalledAtPath:()=>!0,include:()=>{},includeCallArguments(){},included:!0,toString:()=>"undefined"},X={value:{callsArgs:null,mutatesSelf:!1,returns:null,returnsPrimitive:q}},Y={value:{returns:null,returnsPrimitive:q,callsArgs:null,mutatesSelf:!0}},Q={value:{returns:null,returnsPrimitive:q,callsArgs:[0],mutatesSelf:!1}};class J{constructor(){this.included=!1}deoptimizePath(){}getLiteralValueAtPath(){return H}getReturnExpressionWhenCalledAtPath(e){return 1===e.length?Ee(fe,e[0]):q}hasEffectsWhenAccessedAtPath(e){return e.length>1}hasEffectsWhenAssignedAtPath(e){return e.length>1}hasEffectsWhenCalledAtPath(e,t,s){return 1!==e.length||xe(fe,e[0],this.included,t,s)}include(){this.included=!0}includeCallArguments(e,t){for(const s of t)s.include(e,!1)}toString(){return"[[UNKNOWN ARRAY]]"}}const Z={value:{callsArgs:null,mutatesSelf:!1,returns:J,returnsPrimitive:null}},ee={value:{callsArgs:null,mutatesSelf:!0,returns:J,returnsPrimitive:null}},te={value:{callsArgs:[0],mutatesSelf:!1,returns:J,returnsPrimitive:null}},se={value:{callsArgs:[0],mutatesSelf:!0,returns:J,returnsPrimitive:null}},ie={deoptimizePath:()=>{},getLiteralValueAtPath:()=>H,getReturnExpressionWhenCalledAtPath:e=>1===e.length?Ee(me,e[0]):q,hasEffectsWhenAccessedAtPath:e=>e.length>1,hasEffectsWhenAssignedAtPath:e=>e.length>0,hasEffectsWhenCalledAtPath:e=>{if(1===e.length){const t=e[0];return"string"!=typeof t||!me[t]}return!0},include:()=>{},includeCallArguments(e,t){for(const s of t)s.include(e,!1)},included:!0,toString:()=>"[[UNKNOWN BOOLEAN]]"},ne={value:{callsArgs:null,mutatesSelf:!1,returns:null,returnsPrimitive:ie}},re={value:{callsArgs:[0],mutatesSelf:!1,returns:null,returnsPrimitive:ie}},ae={deoptimizePath:()=>{},getLiteralValueAtPath:()=>H,getReturnExpressionWhenCalledAtPath:e=>1===e.length?Ee(ge,e[0]):q,hasEffectsWhenAccessedAtPath:e=>e.length>1,hasEffectsWhenAssignedAtPath:e=>e.length>0,hasEffectsWhenCalledAtPath:e=>{if(1===e.length){const t=e[0];return"string"!=typeof t||!ge[t]}return!0},include:()=>{},includeCallArguments(e,t){for(const s of t)s.include(e,!1)},included:!0,toString:()=>"[[UNKNOWN NUMBER]]"},oe={value:{callsArgs:null,mutatesSelf:!1,returns:null,returnsPrimitive:ae}},he={value:{callsArgs:null,mutatesSelf:!0,returns:null,returnsPrimitive:ae}},le={value:{callsArgs:[0],mutatesSelf:!1,returns:null,returnsPrimitive:ae}},ce={deoptimizePath:()=>{},getLiteralValueAtPath:()=>H,getReturnExpressionWhenCalledAtPath:e=>1===e.length?Ee(ye,e[0]):q,hasEffectsWhenAccessedAtPath:e=>e.length>1,hasEffectsWhenAssignedAtPath:e=>e.length>0,hasEffectsWhenCalledAtPath:(e,t,s)=>1!==e.length||xe(ye,e[0],!0,t,s),include:()=>{},includeCallArguments(e,t){for(const s of t)s.include(e,!1)},included:!0,toString:()=>"[[UNKNOWN STRING]]"},ue={value:{callsArgs:null,mutatesSelf:!1,returns:null,returnsPrimitive:ce}};class de{constructor(){this.included=!1}deoptimizePath(){}getLiteralValueAtPath(){return H}getReturnExpressionWhenCalledAtPath(e){return 1===e.length?Ee(pe,e[0]):q}hasEffectsWhenAccessedAtPath(e){return e.length>1}hasEffectsWhenAssignedAtPath(e){return e.length>1}hasEffectsWhenCalledAtPath(e,t,s){return 1!==e.length||xe(pe,e[0],this.included,t,s)}include(){this.included=!0}includeCallArguments(e,t){for(const s of t)s.include(e,!1)}toString(){return"[[UNKNOWN OBJECT]]"}}const pe=G({hasOwnProperty:ne,isPrototypeOf:ne,propertyIsEnumerable:ne,toLocaleString:ue,toString:ue,valueOf:X}),fe=G({concat:Z,copyWithin:ee,every:re,fill:ee,filter:te,find:Q,findIndex:le,forEach:Q,includes:ne,indexOf:oe,join:ue,lastIndexOf:oe,map:te,pop:Y,push:he,reduce:Q,reduceRight:Q,reverse:ee,shift:Y,slice:Z,some:re,sort:se,splice:ee,unshift:he},pe),me=G({valueOf:ne},pe),ge=G({toExponential:ue,toFixed:ue,toLocaleString:ue,toPrecision:ue,valueOf:oe},pe),ye=G({charAt:ue,charCodeAt:oe,codePointAt:oe,concat:ue,endsWith:ne,includes:ne,indexOf:oe,lastIndexOf:oe,localeCompare:oe,match:ne,normalize:ue,padEnd:ue,padStart:ue,repeat:ue,replace:{value:{callsArgs:[1],mutatesSelf:!1,returns:null,returnsPrimitive:ce}},search:oe,slice:ue,split:Z,startsWith:ne,substr:ue,substring:ue,toLocaleLowerCase:ue,toLocaleUpperCase:ue,toLowerCase:ue,toUpperCase:ue,trim:ue,valueOf:ue},pe);function xe(e,t,s,i,n){if("string"!=typeof t||!e[t]||e[t].mutatesSelf&&s)return!0;if(!e[t].callsArgs)return!1;for(const s of e[t].callsArgs)if(i.args[s]&&i.args[s].hasEffectsWhenCalledAtPath(B,{args:D,withNew:!1},n))return!0;return!1}function Ee(e,t){return"string"==typeof t&&e[t]?null!==e[t].returnsPrimitive?e[t].returnsPrimitive:new e[t].returns:q}class ve{constructor(e){this.alwaysRendered=!1,this.included=!1,this.isId=!1,this.isReassigned=!1,this.renderBaseName=null,this.renderName=null,this.name=e}addReference(e){}deoptimizePath(e){}getBaseVariableName(){return this.renderBaseName||this.renderName||this.name}getLiteralValueAtPath(e,t,s){return H}getName(){const e=this.renderName||this.name;return this.renderBaseName?`${this.renderBaseName}.${e}`:e}getReturnExpressionWhenCalledAtPath(e,t,s){return q}hasEffectsWhenAccessedAtPath(e,t){return e.length>0}hasEffectsWhenAssignedAtPath(e,t){return!0}hasEffectsWhenCalledAtPath(e,t,s){return!0}include(){this.included=!0}includeCallArguments(e,t){for(const s of t)s.include(e,!1)}markCalledFromTryStatement(){}setRenderNames(e,t){this.renderBaseName=e,this.renderName=t}setSafeName(e){this.renderName=e}}class be extends ve{constructor(e,t){super(t),this.module=e,this.isNamespace="*"===t,this.referenced=!1}addReference(e){this.referenced=!0,"default"!==this.name&&"*"!==this.name||this.module.suggestName(e.name)}include(){this.included||(this.included=!0,this.module.used=!0)}}const Se="break case class catch const continue debugger default delete do else export extends finally for function if import in instanceof let new return super switch this throw try typeof var void while with yield enum await implements package protected static interface private public".split(" "),Ae="Infinity NaN undefined null true false eval uneval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Symbol Error EvalError InternalError RangeError ReferenceError SyntaxError TypeError URIError Number Math Date String RegExp Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array Map Set WeakMap WeakSet SIMD ArrayBuffer DataView JSON Promise Generator GeneratorFunction Reflect Proxy Intl".split(" "),Pe=new Set(Se.concat(Ae)),Ce=/[^$_a-zA-Z0-9]/g,ke=e=>/\d/.test(e[0]);function we(e){return e=e.replace(/-(\w)/g,(e,t)=>t.toUpperCase()).replace(Ce,"_"),(ke(e)||Pe.has(e))&&(e="_"+e),e||"_"}const Ne=/^(?:\/|(?:[A-Za-z]:)?[\\|/])/,_e=/^\.?\.\//;function Ie(e){return Ne.test(e)}function $e(e){return _e.test(e)}function Te(e){return e.replace(/\\/g,"/")}function Me(e){return e.split(/(\/|\\)/).pop()}function Le(e){const t=/(\/|\\)[^/\\]*$/.exec(e);if(!t)return".";const s=e.slice(0,-t[0].length);return s||"/"}function Re(e){const t=/\.[^.]+$/.exec(Me(e));return t?t[0]:""}function Oe(e,t){const s=e.split(/[/\\]/).filter(Boolean),i=t.split(/[/\\]/).filter(Boolean);for("."===s[0]&&s.shift(),"."===i[0]&&i.shift();s[0]&&i[0]&&s[0]===i[0];)s.shift(),i.shift();for(;".."===i[0]&&s.length>0;)i.shift(),s.pop();for(;s.pop();)i.unshift("..");return i.join("/")}function De(...e){let t=e.shift().split(/[/\\]/);return e.forEach(e=>{if(Ie(e))t=e.split(/[/\\]/);else{const s=e.split(/[/\\]/);for(;"."===s[0]||".."===s[0];){".."===s.shift()&&t.pop()}t.push.apply(t,s)}}),t.join("/")}class Ve{constructor(e,t,s){this.options=e,this.dynamicImporters=[],this.exportsNames=!1,this.exportsNamespace=!1,this.importers=[],this.mostCommonSuggestion=0,this.reexported=!1,this.renderPath=void 0,this.renormalizeRenderPath=!1,this.used=!1,this.id=t,this.execIndex=1/0,this.moduleSideEffects=s;const i=t.split(/[\\/]/);this.variableName=we(i.pop()),this.nameSuggestions=Object.create(null),this.declarations=Object.create(null),this.exportedVariables=new Map}getVariableForExportName(e){"*"===e?this.exportsNamespace=!0:"default"!==e&&(this.exportsNames=!0);let t=this.declarations[e];return t||(this.declarations[e]=t=new be(this,e),this.exportedVariables.set(t,e),t)}setRenderPath(e,t){return this.renderPath="function"==typeof e.paths?e.paths(this.id):e.paths[this.id],this.renderPath||(Ie(this.id)?(this.renderPath=Te(Oe(t,this.id)),this.renormalizeRenderPath=!0):this.renderPath=this.id),this.renderPath}suggestName(e){this.nameSuggestions[e]||(this.nameSuggestions[e]=0),this.nameSuggestions[e]+=1,this.nameSuggestions[e]>this.mostCommonSuggestion&&(this.mostCommonSuggestion=this.nameSuggestions[e],this.variableName=e)}warnUnusedImports(){const e=Object.keys(this.declarations).filter(e=>{if("*"===e)return!1;const t=this.declarations[e];return!t.included&&!this.reexported&&!t.referenced});if(0===e.length)return;const t=1===e.length?`'${e[0]}' is`:`${e.slice(0,-1).map(e=>`'${e}'`).join(", ")} and '${e.slice(-1)}' are`;this.options.onwarn({code:"UNUSED_EXTERNAL_IMPORT",message:`${t} imported from external module '${this.id}' but never used`,names:e,source:this.id})}}function Be(e){e.isExecuted=!0;const t=[e],s=new Set;for(const e of t)for(const i of[...e.dependencies,...e.implicitlyLoadedBefore])i instanceof Ve||i.isExecuted||!i.moduleSideEffects&&!e.implicitlyLoadedBefore.has(i)||s.has(i.id)||(i.isExecuted=!0,s.add(i.id),t.push(i))}function Fe(){return{brokenFlow:0,includedCallArguments:new Set,includedLabels:new Set}}function We(){return{accessed:new U,assigned:new U,brokenFlow:0,called:new j,ignore:{breaks:!1,continues:!1,labels:new Set,returnAwaitYield:!1},includedLabels:new Set,instantiated:new j,replacedVariableInits:new Map}}class Ue extends ve{constructor(e,t,s,i){super(e),this.additionalInitializers=null,this.calledFromTryStatement=!1,this.expressionsToBeDeoptimized=[],this.declarations=t?[t]:[],this.init=s,this.deoptimizationTracker=i.deoptimizationTracker,this.module=i.module}addDeclaration(e,t){this.declarations.push(e),null===this.additionalInitializers&&(this.additionalInitializers=null===this.init?[]:[this.init],this.init=q,this.isReassigned=!0),null!==t&&this.additionalInitializers.push(t)}consolidateInitializers(){if(null!==this.additionalInitializers){for(const e of this.additionalInitializers)e.deoptimizePath(F);this.additionalInitializers=null}}deoptimizePath(e){if(e.length>7||this.isReassigned)return;const t=this.deoptimizationTracker.getEntities(e);if(!t.has(this))if(t.add(this),0===e.length){if(!this.isReassigned){this.isReassigned=!0;const e=this.expressionsToBeDeoptimized;this.expressionsToBeDeoptimized=[];for(const t of e)t.deoptimizeCache();this.init&&this.init.deoptimizePath(F)}}else this.init&&this.init.deoptimizePath(e)}getLiteralValueAtPath(e,t,s){if(this.isReassigned||!this.init||e.length>7)return H;const i=t.getEntities(e);if(i.has(this.init))return H;this.expressionsToBeDeoptimized.push(s),i.add(this.init);const n=this.init.getLiteralValueAtPath(e,t,s);return i.delete(this.init),n}getReturnExpressionWhenCalledAtPath(e,t,s){if(this.isReassigned||!this.init||e.length>7)return q;const i=t.getEntities(e);if(i.has(this.init))return q;this.expressionsToBeDeoptimized.push(s),i.add(this.init);const n=this.init.getReturnExpressionWhenCalledAtPath(e,t,s);return i.delete(this.init),n}hasEffectsWhenAccessedAtPath(e,t){if(0===e.length)return!1;if(this.isReassigned||e.length>7)return!0;const s=t.accessed.getEntities(e);return!s.has(this)&&(s.add(this),this.init&&this.init.hasEffectsWhenAccessedAtPath(e,t))}hasEffectsWhenAssignedAtPath(e,t){if(this.included||e.length>7)return!0;if(0===e.length)return!1;if(this.isReassigned)return!0;const s=t.assigned.getEntities(e);return!s.has(this)&&(s.add(this),this.init&&this.init.hasEffectsWhenAssignedAtPath(e,t))}hasEffectsWhenCalledAtPath(e,t,s){if(e.length>7||this.isReassigned)return!0;const i=(t.withNew?s.instantiated:s.called).getEntities(e,t);return!i.has(this)&&(i.add(this),this.init&&this.init.hasEffectsWhenCalledAtPath(e,t,s))}include(){if(!this.included){this.included=!0,this.module.isExecuted||Be(this.module);for(const e of this.declarations){e.included||e.include(Fe(),!1);let t=e.parent;for(;!t.included&&(t.included=!0,"Program"!==t.type);)t=t.parent}}}includeCallArguments(e,t){if(this.isReassigned||this.init&&e.includedCallArguments.has(this.init))for(const s of t)s.include(e,!1);else this.init&&(e.includedCallArguments.add(this.init),this.init.includeCallArguments(e,t),e.includedCallArguments.delete(this.init))}markCalledFromTryStatement(){this.calledFromTryStatement=!0}}class ze{constructor(){this.children=[],this.variables=new Map}addDeclaration(e,t,s=null,i){const n=e.name;let r=this.variables.get(n);return r?r.addDeclaration(e,s):(r=new Ue(e.name,e,s||K,t),this.variables.set(n,r)),r}contains(e){return this.variables.has(e)}findVariable(e){throw new Error("Internal Error: findVariable needs to be implemented by a subclass")}}class je extends ze{constructor(e){super(),this.accessedOutsideVariables=new Map,this.parent=e,e.children.push(this)}addAccessedDynamicImport(e){(this.accessedDynamicImports||(this.accessedDynamicImports=new Set)).add(e),this.parent instanceof je&&this.parent.addAccessedDynamicImport(e)}addAccessedGlobalsByFormat(e){const t=this.accessedGlobalVariablesByFormat||(this.accessedGlobalVariablesByFormat=new Map);for(const s of Object.keys(e)){let i=t.get(s);i||(i=new Set,t.set(s,i));for(const t of e[s])i.add(t)}this.parent instanceof je&&this.parent.addAccessedGlobalsByFormat(e)}addNamespaceMemberAccess(e,t){this.accessedOutsideVariables.set(e,t),this.parent.addNamespaceMemberAccess(e,t)}addReturnExpression(e){this.parent instanceof je&&this.parent.addReturnExpression(e)}addUsedOutsideNames(e,t,s){for(const i of this.accessedOutsideVariables.values())i.included&&(e.add(i.getBaseVariableName()),"system"===t&&s.has(i)&&e.add("exports"));const i=this.accessedGlobalVariablesByFormat&&this.accessedGlobalVariablesByFormat.get(t);if(i)for(const t of i)e.add(t)}contains(e){return this.variables.has(e)||this.parent.contains(e)}deconflict(e,t){const s=new Set;if(this.addUsedOutsideNames(s,e,t),this.accessedDynamicImports)for(const e of this.accessedDynamicImports)e.inlineNamespace&&s.add(e.inlineNamespace.getBaseVariableName());for(const[e,t]of this.variables)(t.included||t.alwaysRendered)&&t.setSafeName(O(e,s));for(const s of this.children)s.deconflict(e,t)}findLexicalBoundary(){return this.parent.findLexicalBoundary()}findVariable(e){const t=this.variables.get(e)||this.accessedOutsideVariables.get(e);if(t)return t;const s=this.parent.findVariable(e);return this.accessedOutsideVariables.set(e,s),s}}function Ge(e,t,s){if("number"==typeof s)throw new Error("locate takes a { startIndex, offsetLine, offsetColumn } object as the third argument");return function(e,t){void 0===t&&(t={});var s=t.offsetLine||0,i=t.offsetColumn||0,n=e.split("\n"),r=0,a=n.map((function(e,t){var s=r+e.length+1,i={start:r,end:s,line:t};return r=s,i})),o=0;function h(e,t){return e.start<=t&&t=i.end?1:-1;i;){if(h(i,t))return l(i,t);i=a[o+=n]}}}(e,s)(t,s&&s.startIndex)}const He={Literal:[],Program:["body"]};class qe{constructor(e,t,s){this.included=!1,this.keys=He[e.type]||function(e){return He[e.type]=Object.keys(e).filter(t=>"object"==typeof e[t]),He[e.type]}(e),this.parent=t,this.context=t.context,this.createScope(s),this.parseNode(e),this.initialise(),this.context.magicString.addSourcemapLocation(this.start),this.context.magicString.addSourcemapLocation(this.end)}bind(){for(const e of this.keys){const t=this[e];if(null!==t&&"annotations"!==e)if(Array.isArray(t))for(const e of t)null!==e&&e.bind();else t.bind()}}createScope(e){this.scope=e}declare(e,t){return[]}deoptimizePath(e){}getLiteralValueAtPath(e,t,s){return H}getReturnExpressionWhenCalledAtPath(e,t,s){return q}hasEffects(e){for(const t of this.keys){const s=this[t];if(null!==s&&"annotations"!==t)if(Array.isArray(s)){for(const t of s)if(null!==t&&t.hasEffects(e))return!0}else if(s.hasEffects(e))return!0}return!1}hasEffectsWhenAccessedAtPath(e,t){return e.length>0}hasEffectsWhenAssignedAtPath(e,t){return!0}hasEffectsWhenCalledAtPath(e,t,s){return!0}include(e,t){this.included=!0;for(const s of this.keys){const i=this[s];if(null!==i&&"annotations"!==s)if(Array.isArray(i))for(const s of i)null!==s&&s.include(e,t);else i.include(e,t)}}includeCallArguments(e,t){for(const s of t)s.include(e,!1)}includeWithAllDeclaredVariables(e,t){this.include(t,e)}initialise(){}insertSemicolon(e){";"!==e.original[this.end-1]&&e.appendLeft(this.end,";")}parseNode(e){for(const t of Object.keys(e)){if(this.hasOwnProperty(t))continue;const s=e[t];if("object"!=typeof s||null===s||"annotations"===t)this[t]=s;else if(Array.isArray(s)){this[t]=[];for(const e of s)this[t].push(null===e?null:new(this.context.nodeConstructors[e.type]||this.context.nodeConstructors.UnknownNode)(e,this,this.scope))}else this[t]=new(this.context.nodeConstructors[s.type]||this.context.nodeConstructors.UnknownNode)(s,this,this.scope)}}render(e,t){for(const s of this.keys){const i=this[s];if(null!==i&&"annotations"!==s)if(Array.isArray(i))for(const s of i)null!==s&&s.render(e,t);else i.render(e,t)}}shouldBeIncluded(e){return this.included||!e.brokenFlow&&this.hasEffects(We())}toString(){return this.context.code.slice(this.start,this.end)}}class Ke extends qe{createScope(e){this.scope=new je(e)}hasEffectsWhenAccessedAtPath(e){return!(e.length<=1)&&(e.length>2||"prototype"!==e[0])}hasEffectsWhenAssignedAtPath(e){return!(e.length<=1)&&(e.length>2||"prototype"!==e[0])}hasEffectsWhenCalledAtPath(e,t,s){return!t.withNew||(this.body.hasEffectsWhenCalledAtPath(e,t,s)||null!==this.superClass&&this.superClass.hasEffectsWhenCalledAtPath(e,t,s))}initialise(){null!==this.id&&this.id.declare("class",this)}}class Xe extends Ke{initialise(){super.initialise(),null!==this.id&&(this.id.variable.isId=!0)}parseNode(e){null!==e.id&&(this.id=new this.context.nodeConstructors.Identifier(e.id,this,this.scope.parent)),super.parseNode(e)}render(e,t){"system"===t.format&&this.id&&t.exportNamesByVariable.has(this.id.variable)&&e.appendLeft(this.end,`${t.compact?"":" "}${T([this.id.variable],t)};`),super.render(e,t)}}class Ye extends Ue{constructor(e){super("arguments",null,q,e)}hasEffectsWhenAccessedAtPath(e){return e.length>1}hasEffectsWhenAssignedAtPath(){return!0}hasEffectsWhenCalledAtPath(){return!0}}class Qe extends Ue{constructor(e){super("this",null,null,e)}getLiteralValueAtPath(){return H}hasEffectsWhenAccessedAtPath(e,t){return this.getInit(t).hasEffectsWhenAccessedAtPath(e,t)||super.hasEffectsWhenAccessedAtPath(e,t)}hasEffectsWhenAssignedAtPath(e,t){return this.getInit(t).hasEffectsWhenAssignedAtPath(e,t)||super.hasEffectsWhenAssignedAtPath(e,t)}hasEffectsWhenCalledAtPath(e,t,s){return this.getInit(s).hasEffectsWhenCalledAtPath(e,t,s)||super.hasEffectsWhenCalledAtPath(e,t,s)}getInit(e){return e.replacedVariableInits.get(this)||q}}class Je extends je{constructor(e,t){super(e),this.parameters=[],this.hasRest=!1,this.context=t,this.hoistedBodyVarScope=new je(this)}addParameterDeclaration(e){const t=e.name;let s=this.hoistedBodyVarScope.variables.get(t);return s?s.addDeclaration(e,null):s=new Ue(t,e,q,this.context),this.variables.set(t,s),s}addParameterVariables(e,t){this.parameters=e;for(const t of e)for(const e of t)e.alwaysRendered=!0;this.hasRest=t}includeCallArguments(e,t){let s=!1,i=!1;const n=this.hasRest&&this.parameters[this.parameters.length-1];for(let r=t.length-1;r>=0;r--){const a=this.parameters[r]||n,o=t[r];if(a){s=!1;for(const e of a)e.included&&(i=!0),e.calledFromTryStatement&&(s=!0)}!i&&o.shouldBeIncluded(e)&&(i=!0),i&&o.include(e,s)}}}class Ze extends Je{constructor(){super(...arguments),this.returnExpression=null,this.returnExpressions=[]}addReturnExpression(e){this.returnExpressions.push(e)}getReturnExpression(){return null===this.returnExpression&&this.updateReturnExpression(),this.returnExpression}updateReturnExpression(){if(1===this.returnExpressions.length)this.returnExpression=this.returnExpressions[0];else{this.returnExpression=q;for(const e of this.returnExpressions)e.deoptimizePath(F)}}}class et extends Ze{constructor(e,t){super(e,t),this.variables.set("arguments",this.argumentsVariable=new Ye(t)),this.variables.set("this",this.thisVariable=new Qe(t))}findLexicalBoundary(){return this}includeCallArguments(e,t){if(super.includeCallArguments(e,t),this.argumentsVariable.included)for(const s of t)s.included||s.include(e,!1)}}const tt=Object.create(null),st=Symbol("Value Properties"),it={pure:!0},nt={pure:!1},rt={__proto__:null,[st]:nt},at={__proto__:null,[st]:it},ot={__proto__:null,[st]:nt,prototype:rt},ht={__proto__:null,[st]:it,prototype:rt},lt={__proto__:null,[st]:it,from:at,of:at,prototype:rt},ct={__proto__:null,[st]:it,supportedLocalesOf:ht},ut={global:rt,globalThis:rt,self:rt,window:rt,__proto__:null,[st]:nt,Array:{__proto__:null,[st]:nt,from:rt,isArray:at,of:at,prototype:rt},ArrayBuffer:{__proto__:null,[st]:it,isView:at,prototype:rt},Atomics:rt,BigInt:ot,BigInt64Array:ot,BigUint64Array:ot,Boolean:ht,constructor:ot,DataView:ht,Date:{__proto__:null,[st]:it,now:at,parse:at,prototype:rt,UTC:at},decodeURI:at,decodeURIComponent:at,encodeURI:at,encodeURIComponent:at,Error:ht,escape:at,eval:rt,EvalError:ht,Float32Array:lt,Float64Array:lt,Function:ot,hasOwnProperty:rt,Infinity:rt,Int16Array:lt,Int32Array:lt,Int8Array:lt,isFinite:at,isNaN:at,isPrototypeOf:rt,JSON:rt,Map:ht,Math:{__proto__:null,[st]:nt,abs:at,acos:at,acosh:at,asin:at,asinh:at,atan:at,atan2:at,atanh:at,cbrt:at,ceil:at,clz32:at,cos:at,cosh:at,exp:at,expm1:at,floor:at,fround:at,hypot:at,imul:at,log:at,log10:at,log1p:at,log2:at,max:at,min:at,pow:at,random:at,round:at,sign:at,sin:at,sinh:at,sqrt:at,tan:at,tanh:at,trunc:at},NaN:rt,Number:{__proto__:null,[st]:it,isFinite:at,isInteger:at,isNaN:at,isSafeInteger:at,parseFloat:at,parseInt:at,prototype:rt},Object:{__proto__:null,[st]:it,create:at,getNotifier:at,getOwn:at,getOwnPropertyDescriptor:at,getOwnPropertyNames:at,getOwnPropertySymbols:at,getPrototypeOf:at,is:at,isExtensible:at,isFrozen:at,isSealed:at,keys:at,prototype:rt},parseFloat:at,parseInt:at,Promise:{__proto__:null,[st]:nt,all:at,prototype:rt,race:at,resolve:at},propertyIsEnumerable:rt,Proxy:rt,RangeError:ht,ReferenceError:ht,Reflect:rt,RegExp:ht,Set:ht,SharedArrayBuffer:ot,String:{__proto__:null,[st]:it,fromCharCode:at,fromCodePoint:at,prototype:rt,raw:at},Symbol:{__proto__:null,[st]:it,for:at,keyFor:at,prototype:rt},SyntaxError:ht,toLocaleString:rt,toString:rt,TypeError:ht,Uint16Array:lt,Uint32Array:lt,Uint8Array:lt,Uint8ClampedArray:lt,unescape:at,URIError:ht,valueOf:rt,WeakMap:ht,WeakSet:ht,clearInterval:ot,clearTimeout:ot,console:rt,Intl:{__proto__:null,[st]:nt,Collator:ct,DateTimeFormat:ct,ListFormat:ct,NumberFormat:ct,PluralRules:ct,RelativeTimeFormat:ct},setInterval:ot,setTimeout:ot,TextDecoder:ot,TextEncoder:ot,URL:ot,URLSearchParams:ot,AbortController:ot,AbortSignal:ot,addEventListener:rt,alert:rt,AnalyserNode:ot,Animation:ot,AnimationEvent:ot,applicationCache:rt,ApplicationCache:ot,ApplicationCacheErrorEvent:ot,atob:rt,Attr:ot,Audio:ot,AudioBuffer:ot,AudioBufferSourceNode:ot,AudioContext:ot,AudioDestinationNode:ot,AudioListener:ot,AudioNode:ot,AudioParam:ot,AudioProcessingEvent:ot,AudioScheduledSourceNode:ot,AudioWorkletNode:ot,BarProp:ot,BaseAudioContext:ot,BatteryManager:ot,BeforeUnloadEvent:ot,BiquadFilterNode:ot,Blob:ot,BlobEvent:ot,blur:rt,BroadcastChannel:ot,btoa:rt,ByteLengthQueuingStrategy:ot,Cache:ot,caches:rt,CacheStorage:ot,cancelAnimationFrame:rt,cancelIdleCallback:rt,CanvasCaptureMediaStreamTrack:ot,CanvasGradient:ot,CanvasPattern:ot,CanvasRenderingContext2D:ot,ChannelMergerNode:ot,ChannelSplitterNode:ot,CharacterData:ot,clientInformation:rt,ClipboardEvent:ot,close:rt,closed:rt,CloseEvent:ot,Comment:ot,CompositionEvent:ot,confirm:rt,ConstantSourceNode:ot,ConvolverNode:ot,CountQueuingStrategy:ot,createImageBitmap:rt,Credential:ot,CredentialsContainer:ot,crypto:rt,Crypto:ot,CryptoKey:ot,CSS:ot,CSSConditionRule:ot,CSSFontFaceRule:ot,CSSGroupingRule:ot,CSSImportRule:ot,CSSKeyframeRule:ot,CSSKeyframesRule:ot,CSSMediaRule:ot,CSSNamespaceRule:ot,CSSPageRule:ot,CSSRule:ot,CSSRuleList:ot,CSSStyleDeclaration:ot,CSSStyleRule:ot,CSSStyleSheet:ot,CSSSupportsRule:ot,CustomElementRegistry:ot,customElements:rt,CustomEvent:ot,DataTransfer:ot,DataTransferItem:ot,DataTransferItemList:ot,defaultstatus:rt,defaultStatus:rt,DelayNode:ot,DeviceMotionEvent:ot,DeviceOrientationEvent:ot,devicePixelRatio:rt,dispatchEvent:rt,document:rt,Document:ot,DocumentFragment:ot,DocumentType:ot,DOMError:ot,DOMException:ot,DOMImplementation:ot,DOMMatrix:ot,DOMMatrixReadOnly:ot,DOMParser:ot,DOMPoint:ot,DOMPointReadOnly:ot,DOMQuad:ot,DOMRect:ot,DOMRectReadOnly:ot,DOMStringList:ot,DOMStringMap:ot,DOMTokenList:ot,DragEvent:ot,DynamicsCompressorNode:ot,Element:ot,ErrorEvent:ot,Event:ot,EventSource:ot,EventTarget:ot,external:rt,fetch:rt,File:ot,FileList:ot,FileReader:ot,find:rt,focus:rt,FocusEvent:ot,FontFace:ot,FontFaceSetLoadEvent:ot,FormData:ot,frames:rt,GainNode:ot,Gamepad:ot,GamepadButton:ot,GamepadEvent:ot,getComputedStyle:rt,getSelection:rt,HashChangeEvent:ot,Headers:ot,history:rt,History:ot,HTMLAllCollection:ot,HTMLAnchorElement:ot,HTMLAreaElement:ot,HTMLAudioElement:ot,HTMLBaseElement:ot,HTMLBodyElement:ot,HTMLBRElement:ot,HTMLButtonElement:ot,HTMLCanvasElement:ot,HTMLCollection:ot,HTMLContentElement:ot,HTMLDataElement:ot,HTMLDataListElement:ot,HTMLDetailsElement:ot,HTMLDialogElement:ot,HTMLDirectoryElement:ot,HTMLDivElement:ot,HTMLDListElement:ot,HTMLDocument:ot,HTMLElement:ot,HTMLEmbedElement:ot,HTMLFieldSetElement:ot,HTMLFontElement:ot,HTMLFormControlsCollection:ot,HTMLFormElement:ot,HTMLFrameElement:ot,HTMLFrameSetElement:ot,HTMLHeadElement:ot,HTMLHeadingElement:ot,HTMLHRElement:ot,HTMLHtmlElement:ot,HTMLIFrameElement:ot,HTMLImageElement:ot,HTMLInputElement:ot,HTMLLabelElement:ot,HTMLLegendElement:ot,HTMLLIElement:ot,HTMLLinkElement:ot,HTMLMapElement:ot,HTMLMarqueeElement:ot,HTMLMediaElement:ot,HTMLMenuElement:ot,HTMLMetaElement:ot,HTMLMeterElement:ot,HTMLModElement:ot,HTMLObjectElement:ot,HTMLOListElement:ot,HTMLOptGroupElement:ot,HTMLOptionElement:ot,HTMLOptionsCollection:ot,HTMLOutputElement:ot,HTMLParagraphElement:ot,HTMLParamElement:ot,HTMLPictureElement:ot,HTMLPreElement:ot,HTMLProgressElement:ot,HTMLQuoteElement:ot,HTMLScriptElement:ot,HTMLSelectElement:ot,HTMLShadowElement:ot,HTMLSlotElement:ot,HTMLSourceElement:ot,HTMLSpanElement:ot,HTMLStyleElement:ot,HTMLTableCaptionElement:ot,HTMLTableCellElement:ot,HTMLTableColElement:ot,HTMLTableElement:ot,HTMLTableRowElement:ot,HTMLTableSectionElement:ot,HTMLTemplateElement:ot,HTMLTextAreaElement:ot,HTMLTimeElement:ot,HTMLTitleElement:ot,HTMLTrackElement:ot,HTMLUListElement:ot,HTMLUnknownElement:ot,HTMLVideoElement:ot,IDBCursor:ot,IDBCursorWithValue:ot,IDBDatabase:ot,IDBFactory:ot,IDBIndex:ot,IDBKeyRange:ot,IDBObjectStore:ot,IDBOpenDBRequest:ot,IDBRequest:ot,IDBTransaction:ot,IDBVersionChangeEvent:ot,IdleDeadline:ot,IIRFilterNode:ot,Image:ot,ImageBitmap:ot,ImageBitmapRenderingContext:ot,ImageCapture:ot,ImageData:ot,indexedDB:rt,innerHeight:rt,innerWidth:rt,InputEvent:ot,IntersectionObserver:ot,IntersectionObserverEntry:ot,isSecureContext:rt,KeyboardEvent:ot,KeyframeEffect:ot,length:rt,localStorage:rt,location:rt,Location:ot,locationbar:rt,matchMedia:rt,MediaDeviceInfo:ot,MediaDevices:ot,MediaElementAudioSourceNode:ot,MediaEncryptedEvent:ot,MediaError:ot,MediaKeyMessageEvent:ot,MediaKeySession:ot,MediaKeyStatusMap:ot,MediaKeySystemAccess:ot,MediaList:ot,MediaQueryList:ot,MediaQueryListEvent:ot,MediaRecorder:ot,MediaSettingsRange:ot,MediaSource:ot,MediaStream:ot,MediaStreamAudioDestinationNode:ot,MediaStreamAudioSourceNode:ot,MediaStreamEvent:ot,MediaStreamTrack:ot,MediaStreamTrackEvent:ot,menubar:rt,MessageChannel:ot,MessageEvent:ot,MessagePort:ot,MIDIAccess:ot,MIDIConnectionEvent:ot,MIDIInput:ot,MIDIInputMap:ot,MIDIMessageEvent:ot,MIDIOutput:ot,MIDIOutputMap:ot,MIDIPort:ot,MimeType:ot,MimeTypeArray:ot,MouseEvent:ot,moveBy:rt,moveTo:rt,MutationEvent:ot,MutationObserver:ot,MutationRecord:ot,name:rt,NamedNodeMap:ot,NavigationPreloadManager:ot,navigator:rt,Navigator:ot,NetworkInformation:ot,Node:ot,NodeFilter:rt,NodeIterator:ot,NodeList:ot,Notification:ot,OfflineAudioCompletionEvent:ot,OfflineAudioContext:ot,offscreenBuffering:rt,OffscreenCanvas:ot,open:rt,openDatabase:rt,Option:ot,origin:rt,OscillatorNode:ot,outerHeight:rt,outerWidth:rt,PageTransitionEvent:ot,pageXOffset:rt,pageYOffset:rt,PannerNode:ot,parent:rt,Path2D:ot,PaymentAddress:ot,PaymentRequest:ot,PaymentRequestUpdateEvent:ot,PaymentResponse:ot,performance:rt,Performance:ot,PerformanceEntry:ot,PerformanceLongTaskTiming:ot,PerformanceMark:ot,PerformanceMeasure:ot,PerformanceNavigation:ot,PerformanceNavigationTiming:ot,PerformanceObserver:ot,PerformanceObserverEntryList:ot,PerformancePaintTiming:ot,PerformanceResourceTiming:ot,PerformanceTiming:ot,PeriodicWave:ot,Permissions:ot,PermissionStatus:ot,personalbar:rt,PhotoCapabilities:ot,Plugin:ot,PluginArray:ot,PointerEvent:ot,PopStateEvent:ot,postMessage:rt,Presentation:ot,PresentationAvailability:ot,PresentationConnection:ot,PresentationConnectionAvailableEvent:ot,PresentationConnectionCloseEvent:ot,PresentationConnectionList:ot,PresentationReceiver:ot,PresentationRequest:ot,print:rt,ProcessingInstruction:ot,ProgressEvent:ot,PromiseRejectionEvent:ot,prompt:rt,PushManager:ot,PushSubscription:ot,PushSubscriptionOptions:ot,queueMicrotask:rt,RadioNodeList:ot,Range:ot,ReadableStream:ot,RemotePlayback:ot,removeEventListener:rt,Request:ot,requestAnimationFrame:rt,requestIdleCallback:rt,resizeBy:rt,ResizeObserver:ot,ResizeObserverEntry:ot,resizeTo:rt,Response:ot,RTCCertificate:ot,RTCDataChannel:ot,RTCDataChannelEvent:ot,RTCDtlsTransport:ot,RTCIceCandidate:ot,RTCIceTransport:ot,RTCPeerConnection:ot,RTCPeerConnectionIceEvent:ot,RTCRtpReceiver:ot,RTCRtpSender:ot,RTCSctpTransport:ot,RTCSessionDescription:ot,RTCStatsReport:ot,RTCTrackEvent:ot,screen:rt,Screen:ot,screenLeft:rt,ScreenOrientation:ot,screenTop:rt,screenX:rt,screenY:rt,ScriptProcessorNode:ot,scroll:rt,scrollbars:rt,scrollBy:rt,scrollTo:rt,scrollX:rt,scrollY:rt,SecurityPolicyViolationEvent:ot,Selection:ot,ServiceWorker:ot,ServiceWorkerContainer:ot,ServiceWorkerRegistration:ot,sessionStorage:rt,ShadowRoot:ot,SharedWorker:ot,SourceBuffer:ot,SourceBufferList:ot,speechSynthesis:rt,SpeechSynthesisEvent:ot,SpeechSynthesisUtterance:ot,StaticRange:ot,status:rt,statusbar:rt,StereoPannerNode:ot,stop:rt,Storage:ot,StorageEvent:ot,StorageManager:ot,styleMedia:rt,StyleSheet:ot,StyleSheetList:ot,SubtleCrypto:ot,SVGAElement:ot,SVGAngle:ot,SVGAnimatedAngle:ot,SVGAnimatedBoolean:ot,SVGAnimatedEnumeration:ot,SVGAnimatedInteger:ot,SVGAnimatedLength:ot,SVGAnimatedLengthList:ot,SVGAnimatedNumber:ot,SVGAnimatedNumberList:ot,SVGAnimatedPreserveAspectRatio:ot,SVGAnimatedRect:ot,SVGAnimatedString:ot,SVGAnimatedTransformList:ot,SVGAnimateElement:ot,SVGAnimateMotionElement:ot,SVGAnimateTransformElement:ot,SVGAnimationElement:ot,SVGCircleElement:ot,SVGClipPathElement:ot,SVGComponentTransferFunctionElement:ot,SVGDefsElement:ot,SVGDescElement:ot,SVGDiscardElement:ot,SVGElement:ot,SVGEllipseElement:ot,SVGFEBlendElement:ot,SVGFEColorMatrixElement:ot,SVGFEComponentTransferElement:ot,SVGFECompositeElement:ot,SVGFEConvolveMatrixElement:ot,SVGFEDiffuseLightingElement:ot,SVGFEDisplacementMapElement:ot,SVGFEDistantLightElement:ot,SVGFEDropShadowElement:ot,SVGFEFloodElement:ot,SVGFEFuncAElement:ot,SVGFEFuncBElement:ot,SVGFEFuncGElement:ot,SVGFEFuncRElement:ot,SVGFEGaussianBlurElement:ot,SVGFEImageElement:ot,SVGFEMergeElement:ot,SVGFEMergeNodeElement:ot,SVGFEMorphologyElement:ot,SVGFEOffsetElement:ot,SVGFEPointLightElement:ot,SVGFESpecularLightingElement:ot,SVGFESpotLightElement:ot,SVGFETileElement:ot,SVGFETurbulenceElement:ot,SVGFilterElement:ot,SVGForeignObjectElement:ot,SVGGElement:ot,SVGGeometryElement:ot,SVGGradientElement:ot,SVGGraphicsElement:ot,SVGImageElement:ot,SVGLength:ot,SVGLengthList:ot,SVGLinearGradientElement:ot,SVGLineElement:ot,SVGMarkerElement:ot,SVGMaskElement:ot,SVGMatrix:ot,SVGMetadataElement:ot,SVGMPathElement:ot,SVGNumber:ot,SVGNumberList:ot,SVGPathElement:ot,SVGPatternElement:ot,SVGPoint:ot,SVGPointList:ot,SVGPolygonElement:ot,SVGPolylineElement:ot,SVGPreserveAspectRatio:ot,SVGRadialGradientElement:ot,SVGRect:ot,SVGRectElement:ot,SVGScriptElement:ot,SVGSetElement:ot,SVGStopElement:ot,SVGStringList:ot,SVGStyleElement:ot,SVGSVGElement:ot,SVGSwitchElement:ot,SVGSymbolElement:ot,SVGTextContentElement:ot,SVGTextElement:ot,SVGTextPathElement:ot,SVGTextPositioningElement:ot,SVGTitleElement:ot,SVGTransform:ot,SVGTransformList:ot,SVGTSpanElement:ot,SVGUnitTypes:ot,SVGUseElement:ot,SVGViewElement:ot,TaskAttributionTiming:ot,Text:ot,TextEvent:ot,TextMetrics:ot,TextTrack:ot,TextTrackCue:ot,TextTrackCueList:ot,TextTrackList:ot,TimeRanges:ot,toolbar:rt,top:rt,Touch:ot,TouchEvent:ot,TouchList:ot,TrackEvent:ot,TransitionEvent:ot,TreeWalker:ot,UIEvent:ot,ValidityState:ot,visualViewport:rt,VisualViewport:ot,VTTCue:ot,WaveShaperNode:ot,WebAssembly:rt,WebGL2RenderingContext:ot,WebGLActiveInfo:ot,WebGLBuffer:ot,WebGLContextEvent:ot,WebGLFramebuffer:ot,WebGLProgram:ot,WebGLQuery:ot,WebGLRenderbuffer:ot,WebGLRenderingContext:ot,WebGLSampler:ot,WebGLShader:ot,WebGLShaderPrecisionFormat:ot,WebGLSync:ot,WebGLTexture:ot,WebGLTransformFeedback:ot,WebGLUniformLocation:ot,WebGLVertexArrayObject:ot,WebSocket:ot,WheelEvent:ot,Window:ot,Worker:ot,WritableStream:ot,XMLDocument:ot,XMLHttpRequest:ot,XMLHttpRequestEventTarget:ot,XMLHttpRequestUpload:ot,XMLSerializer:ot,XPathEvaluator:ot,XPathExpression:ot,XPathResult:ot,XSLTProcessor:ot};for(const e of["window","global","self","globalThis"])ut[e]=ut;function dt(e){let t=ut;for(const s of e){if("string"!=typeof s)return null;if(t=t[s],!t)return null}return t[st]}class pt extends ve{constructor(){super(...arguments),this.isReassigned=!0}hasEffectsWhenAccessedAtPath(e){return!function(e){return 1===e.length?"undefined"===e[0]||null!==dt(e):null!==dt(e.slice(0,-1))}([this.name,...e])}hasEffectsWhenCalledAtPath(e){return!function(e){const t=dt(e);return null!==t&&t.pure}([this.name,...e])}}class ft extends qe{constructor(){super(...arguments),this.variable=null,this.bound=!1}addExportedVariables(e,t){null!==this.variable&&t.has(this.variable)&&e.push(this.variable)}bind(){this.bound||(this.bound=!0,null===this.variable&&function e(t,s){if("MemberExpression"===t.type)return!t.computed&&e(t.object,t);if("Identifier"===t.type){if(!s)return!0;switch(s.type){case"MemberExpression":return s.computed||t===s.object;case"MethodDefinition":return s.computed;case"FieldDefinition":case"Property":return s.computed||t===s.value;case"ExportSpecifier":case"ImportSpecifier":return t===s.local;case"LabeledStatement":case"BreakStatement":case"ContinueStatement":return!1;default:return!0}}return!1}(this,this.parent)&&(this.variable=this.scope.findVariable(this.name),this.variable.addReference(this)),null!==this.variable&&this.variable instanceof Ue&&null!==this.variable.additionalInitializers&&this.variable.consolidateInitializers())}declare(e,t){let s;switch(e){case"var":s=this.scope.addDeclaration(this,this.context,t,!0);break;case"function":s=this.scope.addDeclaration(this,this.context,t,"function");break;case"let":case"const":case"class":s=this.scope.addDeclaration(this,this.context,t,!1);break;case"parameter":s=this.scope.addParameterDeclaration(this);break;default:throw new Error(`Internal Error: Unexpected identifier kind ${e}.`)}return[this.variable=s]}deoptimizePath(e){this.bound||this.bind(),0!==e.length||this.scope.contains(this.name)||this.disallowImportReassignment(),this.variable.deoptimizePath(e)}getLiteralValueAtPath(e,t,s){return this.bound||this.bind(),this.variable.getLiteralValueAtPath(e,t,s)}getReturnExpressionWhenCalledAtPath(e,t,s){return this.bound||this.bind(),this.variable.getReturnExpressionWhenCalledAtPath(e,t,s)}hasEffects(){return this.context.options.treeshake.unknownGlobalSideEffects&&this.variable instanceof pt&&this.variable.hasEffectsWhenAccessedAtPath(B)}hasEffectsWhenAccessedAtPath(e,t){return null!==this.variable&&this.variable.hasEffectsWhenAccessedAtPath(e,t)}hasEffectsWhenAssignedAtPath(e,t){return!this.variable||this.variable.hasEffectsWhenAssignedAtPath(e,t)}hasEffectsWhenCalledAtPath(e,t,s){return!this.variable||this.variable.hasEffectsWhenCalledAtPath(e,t,s)}include(){this.included||(this.included=!0,null!==this.variable&&this.context.includeVariable(this.variable))}includeCallArguments(e,t){this.variable.includeCallArguments(e,t)}render(e,t,{renderedParentType:s,isCalleeOfRenderedParent:i,isShorthandProperty:n}=tt){if(this.variable){const t=this.variable.getName();t!==this.name&&(e.overwrite(this.start,this.end,t,{contentOnly:!0,storeName:!0}),n&&e.prependRight(this.start,this.name+": ")),"eval"===t&&"CallExpression"===s&&i&&e.appendRight(this.start,"0, ")}}disallowImportReassignment(){return this.context.error({code:"ILLEGAL_REASSIGNMENT",message:`Illegal reassignment to import '${this.name}'`},this.start)}}class mt extends qe{constructor(){super(...arguments),this.declarationInit=null}addExportedVariables(e,t){this.argument.addExportedVariables(e,t)}bind(){super.bind(),null!==this.declarationInit&&this.declarationInit.deoptimizePath([V,V])}declare(e,t){return this.declarationInit=t,this.argument.declare(e,q)}deoptimizePath(e){0===e.length&&this.argument.deoptimizePath(B)}hasEffectsWhenAssignedAtPath(e,t){return e.length>0||this.argument.hasEffectsWhenAssignedAtPath(B,t)}}class gt extends qe{constructor(){super(...arguments),this.isPrototypeDeoptimized=!1}createScope(e){this.scope=new et(e,this.context)}deoptimizePath(e){1===e.length&&("prototype"===e[0]?this.isPrototypeDeoptimized=!0:e[0]===V&&(this.isPrototypeDeoptimized=!0,this.scope.getReturnExpression().deoptimizePath(F)))}getReturnExpressionWhenCalledAtPath(e){return 0===e.length?this.scope.getReturnExpression():q}hasEffects(){return null!==this.id&&this.id.hasEffects()}hasEffectsWhenAccessedAtPath(e){return!(e.length<=1)&&(e.length>2||"prototype"!==e[0]||this.isPrototypeDeoptimized)}hasEffectsWhenAssignedAtPath(e){return!(e.length<=1)&&(e.length>2||"prototype"!==e[0]||this.isPrototypeDeoptimized)}hasEffectsWhenCalledAtPath(e,t,s){if(e.length>0)return!0;for(const e of this.params)if(e.hasEffects(s))return!0;const i=s.replacedVariableInits.get(this.scope.thisVariable);s.replacedVariableInits.set(this.scope.thisVariable,t.withNew?new de:q);const{brokenFlow:n,ignore:r}=s;return s.ignore={breaks:!1,continues:!1,labels:new Set,returnAwaitYield:!0},!!this.body.hasEffects(s)||(s.brokenFlow=n,i?s.replacedVariableInits.set(this.scope.thisVariable,i):s.replacedVariableInits.delete(this.scope.thisVariable),s.ignore=r,!1)}include(e,t){this.included=!0,this.id&&this.id.include();const s=this.scope.argumentsVariable.included;for(const i of this.params)i instanceof ft&&!s||i.include(e,t);const{brokenFlow:i}=e;e.brokenFlow=0,this.body.include(e,t),e.brokenFlow=i}includeCallArguments(e,t){this.scope.includeCallArguments(e,t)}initialise(){null!==this.id&&this.id.declare("function",this),this.scope.addParameterVariables(this.params.map(e=>e.declare("parameter",q)),this.params[this.params.length-1]instanceof mt),this.body.addImplicitReturnExpressionToScope()}parseNode(e){this.body=new this.context.nodeConstructors.BlockStatement(e.body,this,this.scope.hoistedBodyVarScope),super.parseNode(e)}}gt.prototype.preventChildBlockScope=!0;class yt extends gt{initialise(){super.initialise(),null!==this.id&&(this.id.variable.isId=!0)}parseNode(e){null!==e.id&&(this.id=new this.context.nodeConstructors.Identifier(e.id,this,this.scope.parent)),super.parseNode(e)}}class xt extends qe{include(e,t){super.include(e,t),t&&this.context.includeVariable(this.variable)}initialise(){const e=this.declaration;this.declarationName=e.id&&e.id.name||this.declaration.name,this.variable=this.scope.addExportDefaultDeclaration(this.declarationName||this.context.getModuleName(),this,this.context),this.context.addExport(this)}render(e,t,s){const{start:i,end:n}=s,r=function(e,t){return w(e,C(e,"default",t)+7)}(e.original,this.start);if(this.declaration instanceof yt)this.renderNamedDeclaration(e,r,"function","(",null===this.declaration.id,t);else if(this.declaration instanceof Xe)this.renderNamedDeclaration(e,r,"class","{",null===this.declaration.id,t);else{if(this.variable.getOriginalVariable()!==this.variable)return void S(this,e,i,n);if(!this.variable.included)return e.remove(this.start,r),this.declaration.render(e,t,{isCalleeOfRenderedParent:!1,renderedParentType:"ExpressionStatement"}),void(";"!==e.original[this.end-1]&&e.appendLeft(this.end,";"));this.renderVariableDeclaration(e,r,t)}this.declaration.render(e,t)}renderNamedDeclaration(e,t,s,i,n,r){const a=this.variable.getName();e.remove(this.start,t),n&&e.appendLeft(function(e,t,s,i){const n=C(e,t,i)+t.length;e=e.slice(n,C(e,s,n));const r=C(e,"*");return-1===r?n:n+r+1}(e.original,s,i,t)," "+a),"system"===r.format&&this.declaration instanceof Xe&&r.exportNamesByVariable.has(this.variable)&&e.appendLeft(this.end,` ${T([this.variable],r)};`)}renderVariableDeclaration(e,t,s){const i=59===e.original.charCodeAt(this.end-1),n="system"===s.format&&s.exportNamesByVariable.get(this.variable);n?(e.overwrite(this.start,t,`${s.varOrConst} ${this.variable.getName()} = exports('${n[0]}', `),e.appendRight(i?this.end-1:this.end,")"+(i?"":";"))):(e.overwrite(this.start,t,`${s.varOrConst} ${this.variable.getName()} = `),i||e.appendLeft(this.end,";"))}}xt.prototype.needsBoundaries=!0;class Et extends ve{constructor(){super("undefined")}getLiteralValueAtPath(){}}class vt extends Ue{constructor(e,t,s){super(e,t,t.declaration,s),this.hasId=!1,this.originalId=null,this.originalVariableAndDeclarationModules=null;const i=t.declaration;(i instanceof yt||i instanceof Xe)&&i.id?(this.hasId=!0,this.originalId=i.id):i instanceof ft&&(this.originalId=i)}addReference(e){this.hasId||(this.name=e.name)}getAssignedVariableName(){return this.originalId&&this.originalId.name||null}getBaseVariableName(){const e=this.getOriginalVariable();return e===this?super.getBaseVariableName():e.getBaseVariableName()}getName(){const e=this.getOriginalVariable();return e===this?super.getName():e.getName()}getOriginalVariable(){return this.getOriginalVariableAndDeclarationModules().original}getOriginalVariableAndDeclarationModules(){if(null===this.originalVariableAndDeclarationModules)if(!this.originalId||!this.hasId&&(this.originalId.variable.isReassigned||this.originalId.variable instanceof Et))this.originalVariableAndDeclarationModules={modules:[],original:this};else{const e=this.originalId.variable;if(e instanceof vt){const{modules:t,original:s}=e.getOriginalVariableAndDeclarationModules();this.originalVariableAndDeclarationModules={modules:t.concat(this.module),original:s}}else this.originalVariableAndDeclarationModules={modules:[this.module],original:e}}return this.originalVariableAndDeclarationModules}}class bt extends ve{constructor(e){super("_missingExportShim"),this.module=e}}class St extends ve{constructor(e,t){super(e.getModuleName()),this.memberVariables=null,this.mergedNamespaces=[],this.referencedEarly=!1,this.references=[],this.context=e,this.module=e.module,this.syntheticNamedExports=t}addReference(e){this.references.push(e),this.name=e.name}deoptimizePath(){const e=this.getMemberVariables();for(const t of Object.keys(e))e[t].deoptimizePath(F)}getMemberVariables(){if(this.memberVariables)return this.memberVariables;const e=Object.create(null);for(const t of this.context.getExports().concat(this.context.getReexports()))"*"!==t[0]&&(e[t]=this.context.traceExport(t));return this.memberVariables=e,this.memberVariables=e}include(){if(!this.included){this.included=!0;for(const e of this.references)if(e.context.getModuleExecIndex()<=this.context.getModuleExecIndex()){this.referencedEarly=!0;break}this.mergedNamespaces=this.context.includeAndGetAdditionalMergedNamespaces();const e=this.getMemberVariables();for(const t of Object.keys(e))e[t].include()}}renderBlock(e){const t=e.compact?"":" ",s=e.compact?"":"\n",i=e.indent,n=this.getMemberVariables(),r=Object.keys(n).map(s=>{const r=n[s];if(this.referencedEarly||r.isReassigned)return`${i}get ${s}${t}()${t}{${t}return ${r.getName()}${e.compact?"":";"}${t}}`;const a=R[s]?`'${s}'`:s;return`${i}${a}: ${r.getName()}`});e.namespaceToStringTag&&r.unshift(`${i}[Symbol.toStringTag]:${t}'Module'`);const a=this.mergedNamespaces.length>0||this.syntheticNamedExports;a||r.unshift(`${i}__proto__:${t}null`);let o=`{${s}${r.join(","+s)}${s}}`;if(a){const e=["/*#__PURE__*/Object.create(null)"];this.mergedNamespaces.length>0&&e.push(...this.mergedNamespaces.map(e=>e.getName())),this.syntheticNamedExports&&e.push(this.module.getDefaultExport().getName()),r.length>0&&e.push(o),o=`/*#__PURE__*/Object.assign(${e.join(","+t)})`}e.freeze&&(o=`/*#__PURE__*/Object.freeze(${o})`);const h=this.getName();return o=`${e.varOrConst} ${h}${t}=${t}${o};`,"system"===e.format&&e.exportNamesByVariable.has(this)&&(o+=`${s}${T([this],e)};`),o}renderFirst(){return this.referencedEarly}}St.prototype.isNamespace=!0;class At extends ve{constructor(e,t,s){super(t),this.context=e,this.module=e.module,this.defaultVariable=s}getBaseVariable(){let e=this.defaultVariable;return e instanceof vt&&(e=e.getOriginalVariable()),e instanceof At&&(e=e.getBaseVariable()),e}getName(){const e=this.name;return`${this.defaultVariable.getName()}${Pt(e)}`}include(){this.included||(this.included=!0,this.context.includeVariable(this.defaultVariable))}}const Pt=e=>/^(?!\d)[\w$]+$/.test(e)?"."+e:`[${JSON.stringify(e)}]`,Ct="Object.defineProperty(exports, '__esModule', { value: true });",kt="Object.defineProperty(exports,'__esModule',{value:true});";function wt(e,t,s,i,n,r,a="return "){const o=n?"":" ",h=n?"":"\n";if(!s){let s;if(e.length>0)s=e[0].local;else for(const e of t)if(e.reexports){const t=e.reexports[0];s=e.namedExportsMode&&"*"!==t.imported&&"default"!==t.imported?`${e.name}.${t.imported}`:e.name;break}return`${a}${s};`}let l="";for(const{name:e,reexports:i}of t)if(i&&s)for(const t of i)"*"===t.reexported&&(l&&(l+=h),t.needsLiveBinding?l+=`Object.keys(${e}).forEach(function${o}(k)${o}{${h}${r}if${o}(k${o}!==${o}'default')${o}Object.defineProperty(exports,${o}k,${o}{${h}${r}${r}enumerable:${o}true,${h}${r}${r}get:${o}function${o}()${o}{${h}${r}${r}${r}return ${e}[k];${h}${r}${r}}${h}${r}});${h}});`:l+=`Object.keys(${e}).forEach(function${o}(k)${o}{${h}${r}if${o}(k${o}!==${o}'default')${o}exports[k]${o}=${o}${e}[k];${h}});`);for(const{name:e,imports:n,reexports:a,isChunk:c,namedExportsMode:u,exportsNames:d}of t)if(a&&s)for(const t of a)if("default"!==t.imported||c)if("*"!==t.imported){l&&(l+=h);const s="default"!==t.imported||u?`${e}.${t.imported}`:e;l+=t.needsLiveBinding?`Object.defineProperty(exports,${o}'${t.reexported}',${o}{${h}${r}enumerable:${o}true,${h}${r}get:${o}function${o}()${o}{${h}${r}${r}return ${s};${h}${r}}${h}});`:`exports.${t.reexported}${o}=${o}${s};`}else"*"!==t.reexported&&(l&&(l+=h),l+=`exports.${t.reexported}${o}=${o}${e};`);else l&&(l+=h),d&&(a.some(e=>"default"===e.imported?"default"===e.reexported:"*"!==e.imported)||n&&n.some(e=>"default"!==e.imported))?l+=`exports.${t.reexported}${o}=${o}${e}${!1!==i?"__default":".default"};`:l+=`exports.${t.reexported}${o}=${o}${e};`;for(const t of e){const e="exports."+t.exported,s=t.local;e!==s&&(l&&(l+=h),l+=`${e}${o}=${o}${s};`)}return l}function Nt(e,t,s){const i=t.compact?"":" ";return e.map(({name:e,exportsNames:n,exportsDefault:r,namedExportsMode:a})=>a&&r&&t.interop?n?`${s} ${e}__default${i}=${i}'default'${i}in ${e}${i}?${i}${e}['default']${i}:${i}${e};`:`${e}${i}=${i}${e}${i}&&${i}Object.prototype.hasOwnProperty.call(${e},${i}'default')${i}?${i}${e}['default']${i}:${i}${e};`:null).filter(Boolean).join(t.compact?"":"\n")}function _t(e,t,s,i){return`${i}var d${e}=${e}Object.getOwnPropertyDescriptor(e,${e}k);${t}${i}Object.defineProperty(n,${e}k,${e}d.get${e}?${e}d${e}:${e}{${t}${i}${s}enumerable:${e}true,${t}${i}${s}get:${e}function${e}()${e}{${t}${i}${s}${s}return e[k];${t}${i}${s}}${t}${i}});${t}`}function It(e,t,s,i){return`${i}n[k]${e}=e${e}[k];${t}`}function $t(e,t,s,i){return`function _interopNamespace(e)${e}{${t}${s}if${e}(e${e}&&${e}e.__esModule)${e}{${e}return e;${e}}${e}else${e}{${t}${s}${s}var n${e}=${e}{};${t}${s}${s}if${e}(e)${e}{${t}${s}${s}${s}Object.keys(e).forEach(function${e}(k)${e}{${t}`+(i?_t:It)(e,t,s,s+s+s+s)+`${s}${s}${s}});${t}`+`${s}${s}}${t}`+`${s}${s}n['default']${e}=${e}e;${t}`+`${s}${s}return n;${t}`+`${s}}${t}`+`}${t}${t}`}const Tt={assert:!0,buffer:!0,console:!0,constants:!0,domain:!0,events:!0,http:!0,https:!0,os:!0,path:!0,process:!0,punycode:!0,querystring:!0,stream:!0,string_decoder:!0,timers:!0,tty:!0,url:!0,util:!0,vm:!0,zlib:!0};function Mt(e,t){const s=t.map(({id:e})=>e).filter(e=>e in Tt);if(!s.length)return;e({code:"MISSING_NODE_BUILTINS",message:`Creating a browser bundle that depends on Node.js built-in ${1===s.length?`module ('${s[0]}')`:`modules (${s.slice(0,-1).map(e=>`'${e}'`).join(", ")} and '${s.slice(-1)}')`}. You might need to include https://github.com/ionic-team/rollup-plugin-node-polyfills`,modules:s})}function Lt(e){return e.replace(/^\t+/,e=>e.split("\t").join(" "))}function Rt(e){return e.replace(/[\0?*]/g,"_")}function Ot(e){const t=Me(e);return t.substr(0,t.length-Re(e).length)}function Dt(e){return"undefined"!=typeof process&&Ie(e)?Oe(process.cwd(),e):e}function Vt(e){return!("/"===e[0]||"."===e[0]&&("/"===e[1]||"."===e[1])||Rt(e)!==e||Ie(e))}function Bt(e){throw e instanceof Error||(e=Object.assign(new Error(e.message),e)),e}function Ft(e,t,s,i){if("object"==typeof t){const{line:s,column:n}=t;e.loc={file:i,line:s,column:n}}else{e.pos=t;const{line:n,column:r}=Ge(s,t,{offsetLine:1});e.loc={file:i,line:n,column:r}}if(void 0===e.frame){const{line:t,column:i}=e.loc;e.frame=function(e,t,s){let i=e.split("\n");const n=Math.max(0,t-3);let r=Math.min(t+2,i.length);for(i=i.slice(n,r);!/\S/.test(i[i.length-1]);)i.pop(),r-=1;const a=String(r).length;return i.map((e,i)=>{const r=n+i+1===t;let o=String(i+n+1);for(;o.lengthDt(e.id)).sort();return{code:Wt.MISSING_IMPLICIT_DEPENDANT,message:`Module "${Dt(e.id)}" that should be implicitly loaded before "${1===t.length?t[0]:`${t.slice(0,-1).join('", "')}" and "${t.slice(-1)[0]}`}" is not included in the module graph. Either it was not imported by an included module or only via a tree-shaken dynamic import, or no imported bindings were used and it had otherwise no side-effects.`}}function jt(e,t,s){return{code:Wt.NAMESPACE_CONFLICT,message:`Conflicting namespaces: ${Dt(t.id)} re-exports '${e}' from both ${Dt(t.exportsAll[e])} and ${Dt(s.exportsAll[e])} (will be ignored)`,name:e,reexporter:t.id,sources:[t.exportsAll[e],s.exportsAll[e]]}}function Gt(e){return{code:Wt.VALIDATION_ERROR,message:e}}function Ht(e,t,s){qt(e,t,s.onwarn,s.strictDeprecations)}function qt(e,t,s,i){if(t||i){const t=function(e){return{code:Wt.DEPRECATED_FEATURE,..."string"==typeof e?{message:e}:e}}(e);if(i)return Bt(t);s(t)}}!function(e){e.ASSET_NOT_FINALISED="ASSET_NOT_FINALISED",e.ASSET_NOT_FOUND="ASSET_NOT_FOUND",e.ASSET_SOURCE_ALREADY_SET="ASSET_SOURCE_ALREADY_SET",e.ASSET_SOURCE_MISSING="ASSET_SOURCE_MISSING",e.BAD_LOADER="BAD_LOADER",e.CANNOT_EMIT_FROM_OPTIONS_HOOK="CANNOT_EMIT_FROM_OPTIONS_HOOK",e.CHUNK_NOT_GENERATED="CHUNK_NOT_GENERATED",e.DEPRECATED_FEATURE="DEPRECATED_FEATURE",e.FILE_NOT_FOUND="FILE_NOT_FOUND",e.FILE_NAME_CONFLICT="FILE_NAME_CONFLICT",e.INPUT_HOOK_IN_OUTPUT_PLUGIN="INPUT_HOOK_IN_OUTPUT_PLUGIN",e.INVALID_CHUNK="INVALID_CHUNK",e.INVALID_EXPORT_OPTION="INVALID_EXPORT_OPTION",e.INVALID_EXTERNAL_ID="INVALID_EXTERNAL_ID",e.INVALID_OPTION="INVALID_OPTION",e.INVALID_PLUGIN_HOOK="INVALID_PLUGIN_HOOK",e.INVALID_ROLLUP_PHASE="INVALID_ROLLUP_PHASE",e.MISSING_IMPLICIT_DEPENDANT="MISSING_IMPLICIT_DEPENDANT",e.MIXED_EXPORTS="MIXED_EXPORTS",e.NAMESPACE_CONFLICT="NAMESPACE_CONFLICT",e.PLUGIN_ERROR="PLUGIN_ERROR",e.UNRESOLVED_ENTRY="UNRESOLVED_ENTRY",e.UNRESOLVED_IMPORT="UNRESOLVED_IMPORT",e.VALIDATION_ERROR="VALIDATION_ERROR",e.EXTERNAL_SYNTHETIC_EXPORTS="EXTERNAL_SYNTHETIC_EXPORTS",e.SYNTHETIC_NAMED_EXPORTS_NEED_DEFAULT="SYNTHETIC_NAMED_EXPORTS_NEED_DEFAULT"}(Wt||(Wt={}));const Kt=/^[a-zA-Z$_][a-zA-Z0-9$_]*$/;function Xt(e){return Kt.test(e)?"."+e:`['${e}']`}function Yt(e){return e.split(".").map(Xt).join("")}function Qt(e,t,s,i,n){const r=i?"":" ",a=e.split(".");a[0]=("function"==typeof s?s(a[0]):s[a[0]])||a[0];const o=a.pop();let h=t,l=a.map(e=>(h+=Xt(e),`${h}${r}=${r}${h}${r}||${r}{}`)).concat(`${h}${Xt(o)}`).join(","+r).concat(`${r}=${r}${n}`);return a.length>0&&(l=`(${l})`),l}function Jt(e){let t=e.length;for(;t--;){const s=e[t];if(s.exportsDefault||s.exportsNames)return e.slice(0,t+1)}return[]}const Zt=e=>"this"+Yt(e);function es({dependencies:e,exports:t}){const s=new Set(t.map(e=>e.exported));s.has("default")||s.add("default");for(const{reexports:t}of e)if(t)for(const e of t)"*"===e.imported||s.has(e.reexported)||s.add(e.reexported);return s}function ts(e,t,s,i){return 0===e.length?"":1===e.length?`${s}${s}${s}exports('${e[0].name}',${t}${e[0].value});${i}${i}`:`${s}${s}${s}exports({${i}`+e.map(({name:e,value:i})=>`${s}${s}${s}${s}${e}:${t}${i}`).join(","+i)+`${i}${s}${s}${s}});${i}${i}`}function ss(e,t){return e?`${t}${Yt(e)}`:"null"}var is={system:function(e,{accessedGlobals:t,dependencies:s,exports:i,hasExports:n,indentString:r,intro:a,outro:o,usesTopLevelAwait:h,varOrConst:l},c){const u=c.compact?"":"\n",d=c.compact?"":" ",p=s.map(e=>`'${e.id}'`),f=[];let m;const g=[];for(const{imports:e,reexports:t}of s){const n=[];if(e)for(const t of e)f.push(t.local),"*"===t.imported?n.push(`${t.local}${d}=${d}module;`):n.push(`${t.local}${d}=${d}module.${t.imported};`);if(t){let e=!1;if(t.length>1||1===t.length&&("*"===t[0].reexported||"*"===t[0].imported)){for(const a of t)"*"===a.reexported&&(m||(m=es({dependencies:s,exports:i})),e||(n.push(`${l} _setter${d}=${d}{};`),e=!0),n.push(`for${d}(var _$p${d}in${d}module)${d}{`),n.push(`${r}if${d}(!_starExcludes[_$p])${d}_setter[_$p]${d}=${d}module[_$p];`),n.push("}"));for(const e of t)"*"===e.imported&&"*"!==e.reexported&&n.push(`exports('${e.reexported}',${d}module);`);for(const s of t)"*"!==s.reexported&&"*"!==s.imported&&(e||(n.push(`${l} _setter${d}=${d}{};`),e=!0),n.push(`_setter.${s.reexported}${d}=${d}module.${s.imported};`));e&&n.push("exports(_setter);")}else for(const e of t)n.push(`exports('${e.reexported}',${d}module.${e.imported});`)}g.push(n.join(`${u}${r}${r}${r}`))}const y=c.name?`'${c.name}',${d}`:"",x=t.has("module")?`exports,${d}module`:n?"exports":"";let E=`System.register(${y}[`+p.join(","+d)+`],${d}function${d}(${x})${d}{${u}${r}${c.strict?"'use strict';":""}`+((e,t,s,i,n)=>e?`${n}${i}${t} _starExcludes${s}=${s}{${s}${[...e].map(e=>`${e}:${s}1`).join(","+s)}${s}};`:"")(m,l,d,r,u)+((e,t,s,i)=>e.length?`${i}${s}var ${e.join(","+t)};`:"")(f,d,r,u)+`${u}${r}return${d}{${g.length?`${u}${r}${r}setters:${d}[${g.map(e=>e?`function${d}(module)${d}{${u}${r}${r}${r}${e}${u}${r}${r}}`:c.systemNullSetters?"null":`function${d}()${d}{}`).join(","+d)}],`:""}${u}`;E+=`${r}${r}execute:${d}${h?"async"+d:""}function${d}()${d}{${u}${u}`+((e,t,s,i)=>ts(e.filter(e=>e.hoisted||e.uninitialized).map(e=>({name:e.exported,value:e.uninitialized?"void 0":e.local})),t,s,i))(i,d,r,u);const v=`${u}${u}`+((e,t,s,i)=>ts(e.filter(e=>e.expression).map(e=>({name:e.exported,value:e.local})),t,s,i))(i,d,r,u)+((e,t,s,i)=>ts(e.filter(e=>"_missingExportShim"===e.local).map(e=>({name:e.exported,value:"_missingExportShim"})),t,s,i))(i,d,r,u)+`${r}${r}}${u}${r}}${c.compact?"":";"}${u}});`;return a&&e.prepend(a),o&&e.append(o),e.indent(`${r}${r}${r}`).append(v).prepend(E)},amd:function(e,{accessedGlobals:t,dependencies:s,exports:i,hasExports:n,indentString:r,intro:a,isEntryModuleFacade:o,namedExportsMode:h,outro:l,varOrConst:c,warn:u},d){Mt(u,s);const p=s.map(e=>{return`'${t=e.id,"."===t[0]&&t.endsWith(".js")?t.slice(0,-3):t}'`;var t}),f=s.map(e=>e.name),m=d.compact?"":"\n",g=d.compact?"":" ";h&&n&&(f.unshift("exports"),p.unshift("'exports'")),t.has("require")&&(f.unshift("require"),p.unshift("'require'")),t.has("module")&&(f.unshift("module"),p.unshift("'module'"));const y=d.amd||{},x=(y.id?`'${y.id}',${g}`:"")+(p.length?`[${p.join(","+g)}],${g}`:""),E=d.strict?g+"'use strict';":"",v=`${y.define}(${x}function${g}(${f.join(","+g)})${g}{${E}${m}${m}`,b=Nt(s,d,c);b&&e.prepend(b+m+m),t.has("_interopNamespace")&&e.prepend($t(g,m,r,d.externalLiveBindings)),a&&e.prepend(a);const S=wt(i,s,h,d.interop,d.compact,r);return S&&e.append(m+m+S),h&&n&&o&&d.esModule&&e.append(`${m}${m}${d.compact?kt:Ct}`),l&&e.append(l),e.indent(r).append(m+m+"});").prepend(v)},cjs:function(e,{accessedGlobals:t,dependencies:s,exports:i,hasExports:n,indentString:r,intro:a,isEntryModuleFacade:o,namedExportsMode:h,outro:l,varOrConst:c},u){const d=u.compact?"":"\n",p=u.compact?"":" ";a=(!1===u.strict?a:`'use strict';${d}${d}${a}`)+(h&&n&&o&&u.esModule?`${u.compact?kt:Ct}${d}${d}`:"");let f,m=!1,g=!1;f="";for(const{id:e,namedExportsMode:t,isChunk:i,name:n,reexports:r,imports:a,exportsNames:o,exportsDefault:h}of s)r||a?(f+=u.compact&&g?",":`${f?";"+d:""}${c} `,g=!0,u.interop&&!i&&h&&t?(m=!0,f+=o?`${n}${p}=${p}require('${e}')${u.compact?",":`;\n${c} `}${n}__default${p}=${p}_interopDefault(${n})`:`${n}${p}=${p}_interopDefault(require('${e}'))`):f+=`${n}${p}=${p}require('${e}')`):(f&&(f+=!u.compact||g?";"+d:","),g=!1,f+=`require('${e}')`);if(f&&(f+=";"),m){const e=u.compact?"e":"ex";a+=`function _interopDefault${p}(${e})${p}{${p}return${p}(${e}${p}&&${p}(typeof ${e}${p}===${p}'object')${p}&&${p}'default'${p}in ${e})${p}?${p}${e}['default']${p}:${p}${e}${u.compact?"":"; "}}${d}${d}`}t.has("_interopNamespace")&&(a+=$t(p,d,r,u.externalLiveBindings)),f&&(a+=f+d+d);const y=wt(i,s,h,u.interop,u.compact,r,`module.exports${p}=${p}`);return e.prepend(a),y&&e.append(d+d+y),l&&e.append(l),e},es:function(e,{intro:t,outro:s,dependencies:i,exports:n,varOrConst:r},a){const o=a.compact?"":" ",h=a.compact?"":"\n",l=function(e,t){const s=[];for(const{id:i,reexports:n,imports:r,name:a}of e)if(n||r){if(r){let e=null,n=null;const a=[];for(const t of r)"default"===t.imported?e=t:"*"===t.imported?n=t:a.push(t);n&&s.push(`import${t}*${t}as ${n.local} from${t}'${i}';`),e&&0===a.length?s.push(`import ${e.local} from${t}'${i}';`):a.length>0&&s.push(`import ${e?`${e.local},${t}`:""}{${t}${a.map(e=>e.imported===e.local?e.imported:`${e.imported} as ${e.local}`).join(","+t)}${t}}${t}from${t}'${i}';`)}if(n){let e=null;const o=[],h=[];for(const t of n)"*"===t.reexported?e=t:"*"===t.imported?o.push(t):h.push(t);if(e&&s.push(`export${t}*${t}from${t}'${i}';`),o.length>0){r&&r.some(e=>"*"===e.imported&&e.local===a)||s.push(`import${t}*${t}as ${a} from${t}'${i}';`);for(const e of o)s.push(`export${t}{${t}${a===e.reexported?a:`${a} as ${e.reexported}`} };`)}h.length>0&&s.push(`export${t}{${t}${h.map(e=>e.imported===e.reexported?e.imported:`${e.imported} as ${e.reexported}`).join(","+t)}${t}}${t}from${t}'${i}';`)}}else s.push(`import${t}'${i}';`);return s}(i,o);l.length>0&&(t+=l.join(h)+h+h),t&&e.prepend(t);const c=function(e,t,s){const i=[],n=[];for(const r of e)"default"===r.exported?i.push(`export default ${r.local};`):(r.expression&&i.push(`${s} ${r.local}${t}=${t}${r.expression};`),n.push(r.exported===r.local?r.local:`${r.local} as ${r.exported}`));n.length&&i.push(`export${t}{${t}${n.join(","+t)}${t}};`);return i}(n,o,r);return c.length&&e.append(h+h+c.join(h).trim()),s&&e.append(s),e.trim()},iife:function(e,{dependencies:t,exports:s,hasExports:i,indentString:n,intro:r,namedExportsMode:a,outro:o,varOrConst:h,warn:l},c){const u=c.compact?"":" ",d=c.compact?"":"\n",{extend:p,name:f}=c,m=f&&-1!==f.indexOf("."),g=!p&&!m;if(f&&g&&(ke(y=f)||Pe.has(y)||Ce.test(y)))return Bt({code:"ILLEGAL_IDENTIFIER_AS_NAME",message:`Given name "${f}" is not a legal JS identifier. If you need this, you can try "output.extend: true".`});var y;Mt(l,t);const x=Jt(t),E=x.map(e=>e.globalName||"null"),v=x.map(e=>e.name);i&&!f&&l({code:"MISSING_NAME_OPTION_FOR_IIFE_EXPORT",message:'If you do not supply "output.name", you may not be able to access the exports of an IIFE bundle.'}),a&&i&&(p?(E.unshift(`${Zt(f)}${u}=${u}${Zt(f)}${u}||${u}{}`),v.unshift("exports")):(E.unshift("{}"),v.unshift("exports")));const b=c.strict?`${n}'use strict';${d}${d}`:"";let S=`(function${u}(${v.join(","+u)})${u}{${d}${b}`;!i||p&&a||!f||(S=(g?`${h} ${f}`:Zt(f))+`${u}=${u}${S}`),m&&i&&(S=function(e,t,s,i){const n=i?"":" ",r=e.split(".");r[0]=("function"==typeof s?s(r[0]):s[r[0]])||r[0],r.pop();let a=t;return r.map(e=>(a+=Xt(e),`${a}${n}=${n}${a}${n}||${n}{}${i?"":";"}`)).join(i?",":"\n")+(i&&r.length?";":"\n")}(f,"this",c.globals,c.compact)+S);let A=`${d}${d}}(${E.join(","+u)}));`;!p&&a&&i&&(A=`${d}${d}${n}return exports;${A}`);const P=Nt(t,c,h);P&&e.prepend(P+d+d),r&&e.prepend(r);const C=wt(s,t,a,c.interop,c.compact,n);return C&&e.append(d+d+C),o&&e.append(o),e.indent(n).prepend(S).append(A)},umd:function(e,{dependencies:t,exports:s,hasExports:i,indentString:n,intro:r,namedExportsMode:a,outro:o,varOrConst:h,warn:l},c){const u=c.compact?"":" ",d=c.compact?"":"\n",p=c.compact?"f":"factory",f=c.compact?"g":"global";if(i&&!c.name)return Bt({code:"MISSING_NAME_OPTION_FOR_IIFE_EXPORT",message:'You must supply "output.name" for UMD bundles that have exports so that the exports are accessible in environments without a module loader.'});Mt(l,t);const m=t.map(e=>`'${e.id}'`),g=t.map(e=>`require('${e.id}')`),y=Jt(t),x=y.map(e=>ss(e.globalName,f)),E=y.map(e=>e.name);a&&(i||c.noConflict)&&(m.unshift("'exports'"),g.unshift("exports"),x.unshift(Qt(c.name,f,c.globals,c.compact,(c.extend?`${ss(c.name,f)}${u}||${u}`:"")+"{}")),E.unshift("exports"));const v=(c.amd.id?`'${c.amd.id}',${u}`:"")+(m.length?`[${m.join(","+u)}],${u}`:""),b=c.amd.define,S=!a&&i?`module.exports${u}=${u}`:"",A=c.strict?`${u}'use strict';${d}`:"";let P;if(c.noConflict){const e=c.compact?"e":"exports";let t;if(!a&&i)t=`var ${e}${u}=${u}${Qt(c.name,f,c.globals,c.compact,`${p}(${x.join(","+u)})`)};`;else if(a){t=`var ${e}${u}=${u}${x.shift()};${d}${n}${n}${p}(${[e].concat(x).join(","+u)});`}P=`(function${u}()${u}{${d}${n}${n}var current${u}=${u}${function(e,t,s){const i=e.split(".");let n=t;return i.map(e=>(n+=Xt(e),n)).join(`${s}&&${s}`)}(c.name,f,u)};${d}${n}${n}${t}${d}${n}${n}${e}.noConflict${u}=${u}function${u}()${u}{${u}${ss(c.name,f)}${u}=${u}current;${u}return ${e}${c.compact?"":"; "}};${d}`+n+"}())"}else P=`${p}(${x.join(","+u)})`,!a&&i&&(P=Qt(c.name,f,c.globals,c.compact,P));const C=i||!0===c.noConflict&&a||x.length>0,k=C?"this,"+u:"",w=C?`(${f}${u}=${u}${f}${u}||${u}self,${u}`:"",N=C?")":"",_=`(function${u}(${C?`${f},${u}`:""}${p})${u}{${d}`+(C?`${n}typeof exports${u}===${u}'object'${u}&&${u}typeof module${u}!==${u}'undefined'${u}?${u}${S}${p}(${g.join(","+u)})${u}:${d}`:"")+`${n}typeof ${b}${u}===${u}'function'${u}&&${u}${b}.amd${u}?${u}${b}(${v}${p})${u}:${d}`+`${n}${w}${P}${N};${d}`+`}(${k}(function${u}(${E.join(", ")})${u}{${A}${d}`,I=d+d+"})));",$=Nt(t,c,h);$&&e.prepend($+d+d),r&&e.prepend(r);const T=wt(s,t,a,c.interop,c.compact,n);return T&&e.append(d+d+T),a&&i&&c.esModule&&e.append(d+d+(c.compact?kt:Ct)),o&&e.append(o),e.trim().indent(n).append(I).prepend(_)}};const ns={ArrayPattern(e,t){for(const s of t.elements)s&&ns[s.type](e,s)},AssignmentPattern(e,t){ns[t.left.type](e,t.left)},Identifier(e,t){e.push(t.name)},MemberExpression(){},ObjectPattern(e,t){for(const s of t.properties)"RestElement"===s.type?ns.RestElement(e,s):ns[s.value.type](e,s.value)},RestElement(e,t){ns[t.argument.type](e,t.argument)}},rs=function(e){const t=[];return ns[e.type](t,e),t};class as extends qe{hasEffects(){return!1}initialise(){this.context.addExport(this)}render(e,t,s){e.remove(s.start,s.end)}}as.prototype.needsBoundaries=!0;class os extends je{addDeclaration(e,t,s=null,i){return i?this.parent.addDeclaration(e,t,"function"===i?s:q,i):super.addDeclaration(e,t,s,!1)}}class hs extends qe{initialise(){this.directive&&"use strict"!==this.directive&&"Program"===this.parent.type&&this.context.warn({code:"MODULE_LEVEL_DIRECTIVE",message:`Module level directives cause errors when bundled, '${this.directive}' was ignored.`},this.start)}render(e,t){super.render(e,t),this.included&&this.insertSemicolon(e)}shouldBeIncluded(e){return this.directive&&"use strict"!==this.directive?"Program"!==this.parent.type:super.shouldBeIncluded(e)}}class ls extends qe{constructor(){super(...arguments),this.directlyIncluded=!1}addImplicitReturnExpressionToScope(){const e=this.body[this.body.length-1];e&&"ReturnStatement"===e.type||this.scope.addReturnExpression(q)}createScope(e){this.scope=this.parent.preventChildBlockScope?e:new os(e)}hasEffects(e){if(this.deoptimizeBody)return!0;for(const t of this.body){if(t.hasEffects(e))return!0;if(e.brokenFlow)break}return!1}include(e,t){if(!this.deoptimizeBody||!this.directlyIncluded){this.included=!0,this.directlyIncluded=!0,this.deoptimizeBody&&(t=!0);for(const s of this.body)(t||s.shouldBeIncluded(e))&&s.include(e,t)}}initialise(){const e=this.body[0];this.deoptimizeBody=e instanceof hs&&"use asm"===e.directive}render(e,t){this.body.length?_(this.body,e,this.start+1,this.end-1,t):super.render(e,t)}}class cs extends qe{createScope(e){this.scope=new Ze(e,this.context)}deoptimizePath(e){1===e.length&&e[0]===V&&this.scope.getReturnExpression().deoptimizePath(F)}getReturnExpressionWhenCalledAtPath(e){return 0===e.length?this.scope.getReturnExpression():q}hasEffects(){return!1}hasEffectsWhenAccessedAtPath(e){return e.length>1}hasEffectsWhenAssignedAtPath(e){return e.length>1}hasEffectsWhenCalledAtPath(e,t,s){if(e.length>0)return!0;for(const e of this.params)if(e.hasEffects(s))return!0;const{ignore:i,brokenFlow:n}=s;return s.ignore={breaks:!1,continues:!1,labels:new Set,returnAwaitYield:!0},!!this.body.hasEffects(s)||(s.ignore=i,s.brokenFlow=n,!1)}include(e,t){this.included=!0;for(const s of this.params)s instanceof ft||s.include(e,t);const{brokenFlow:s}=e;e.brokenFlow=0,this.body.include(e,t),e.brokenFlow=s}includeCallArguments(e,t){this.scope.includeCallArguments(e,t)}initialise(){this.scope.addParameterVariables(this.params.map(e=>e.declare("parameter",q)),this.params[this.params.length-1]instanceof mt),this.body instanceof ls?this.body.addImplicitReturnExpressionToScope():this.scope.addReturnExpression(this.body)}parseNode(e){"BlockStatement"===e.body.type&&(this.body=new this.context.nodeConstructors.BlockStatement(e.body,this,this.scope.hoistedBodyVarScope)),super.parseNode(e)}}cs.prototype.preventChildBlockScope=!0;const us={"!=":(e,t)=>e!=t,"!==":(e,t)=>e!==t,"%":(e,t)=>e%t,"&":(e,t)=>e&t,"*":(e,t)=>e*t,"**":(e,t)=>e**t,"+":(e,t)=>e+t,"-":(e,t)=>e-t,"/":(e,t)=>e/t,"<":(e,t)=>ee<e<=t,"==":(e,t)=>e==t,"===":(e,t)=>e===t,">":(e,t)=>e>t,">=":(e,t)=>e>=t,">>":(e,t)=>e>>t,">>>":(e,t)=>e>>>t,"^":(e,t)=>e^t,in:()=>H,instanceof:()=>H,"|":(e,t)=>e|t};class ds extends qe{getLiteralValueAtPath(e){return e.length>0||null===this.value&&110!==this.context.code.charCodeAt(this.start)||"bigint"==typeof this.value||47===this.context.code.charCodeAt(this.start)?H:this.value}getReturnExpressionWhenCalledAtPath(e){return 1!==e.length?q:Ee(this.members,e[0])}hasEffectsWhenAccessedAtPath(e){return null===this.value?e.length>0:e.length>1}hasEffectsWhenAssignedAtPath(e){return e.length>0}hasEffectsWhenCalledAtPath(e,t,s){return 1!==e.length||xe(this.members,e[0],this.included,t,s)}initialise(){this.members=function(e){switch(typeof e){case"boolean":return me;case"number":return ge;case"string":return ye;default:return Object.create(null)}}(this.value)}parseNode(e){this.value=e.value,this.regex=e.regex,super.parseNode(e)}render(e){"string"==typeof this.value&&e.indentExclusionRanges.push([this.start+1,this.end-1])}}function ps(e){return e.computed?function(e){if(e instanceof ds)return String(e.value);return null}(e.property):e.property.name}class fs extends qe{constructor(){super(...arguments),this.variable=null,this.bound=!1,this.expressionsToBeDeoptimized=[],this.replacement=null,this.wasPathDeoptimizedWhileOptimized=!1}addExportedVariables(){}bind(){if(this.bound)return;this.bound=!0;const e=function e(t){const s=t.propertyKey,i=t.object;if("string"==typeof s){if(i instanceof ft)return[{key:i.name,pos:i.start},{key:s,pos:t.property.start}];if(i instanceof fs){const n=e(i);return n&&[...n,{key:s,pos:t.property.start}]}}return null}(this),t=e&&this.scope.findVariable(e[0].key);if(t&&t.isNamespace){const s=this.resolveNamespaceVariables(t,e.slice(1));s?"string"==typeof s?this.replacement=s:(s instanceof be&&s.module&&s.module.suggestName(e[0].key),this.variable=s,this.scope.addNamespaceMemberAccess(function(e){let t=e[0].key;for(let s=1;s0||this.value.hasEffectsWhenCalledAtPath(B,t,s)}}class Es{constructor(e){this.included=!1,this.expressions=e}deoptimizePath(e){for(const t of this.expressions)t.deoptimizePath(e)}getLiteralValueAtPath(){return H}getReturnExpressionWhenCalledAtPath(e,t,s){return new Es(this.expressions.map(i=>i.getReturnExpressionWhenCalledAtPath(e,t,s)))}hasEffectsWhenAccessedAtPath(e,t){for(const s of this.expressions)if(s.hasEffectsWhenAccessedAtPath(e,t))return!0;return!1}hasEffectsWhenAssignedAtPath(e,t){for(const s of this.expressions)if(s.hasEffectsWhenAssignedAtPath(e,t))return!0;return!1}hasEffectsWhenCalledAtPath(e,t,s){for(const i of this.expressions)if(i.hasEffectsWhenCalledAtPath(e,t,s))return!0;return!1}include(e,t){for(const s of this.expressions)s.included||s.include(e,t)}includeCallArguments(){}}class vs extends qe{bind(){null!==this.declaration&&this.declaration.bind()}hasEffects(e){return null!==this.declaration&&this.declaration.hasEffects(e)}initialise(){this.context.addExport(this)}render(e,t,s){const{start:i,end:n}=s;null===this.declaration?e.remove(i,n):(e.remove(this.start,this.declaration.start),this.declaration.render(e,t,{start:i,end:n}))}}vs.prototype.needsBoundaries=!0;const bs=Symbol("unset");class Ss extends qe{bind(){}hasEffects(){return!1}initialise(){this.context.addImport(this)}render(e,t,s){e.remove(s.start,s.end)}}Ss.prototype.needsBoundaries=!0;const As="ROLLUP_ASSET_URL_",Ps="ROLLUP_FILE_URL_";const Cs={amd:["document","module","URL"],cjs:["document","require","URL"],iife:["document","URL"],system:["module"],umd:["document","require","URL"]},ks={amd:["document","require","URL"],cjs:["document","require","URL"],iife:["document","URL"],system:["module","URL"],umd:["document","require","URL"]},ws=(e,t="URL")=>`new ${t}(${e}).href`,Ns=e=>ws(`'${e}', document.currentScript && document.currentScript.src || document.baseURI`),_s=e=>(t,s)=>{const i=e(s);return null===t?`({ url: ${i} })`:"url"===t?i:"undefined"},Is=e=>`(document.currentScript && document.currentScript.src || new URL('${e}', document.baseURI).href)`,$s={amd:e=>("."!==e[0]&&(e="./"+e),ws(`require.toUrl('${e}'), document.baseURI`)),cjs:e=>`(typeof document === 'undefined' ? ${ws(`'file:' + __dirname + '/${e}'`,"(require('u' + 'rl').URL)")} : ${Ns(e)})`,es:e=>ws(`'${e}', import.meta.url`),iife:e=>Ns(e),system:e=>ws(`'${e}', module.meta.url`),umd:e=>`(typeof document === 'undefined' ? ${ws(`'file:' + __dirname + '/${e}'`,"(require('u' + 'rl').URL)")} : ${Ns(e)})`},Ts={amd:_s(()=>ws("module.uri, document.baseURI")),cjs:_s(e=>`(typeof document === 'undefined' ? ${ws("'file:' + __filename","(require('u' + 'rl').URL)")} : ${Is(e)})`),iife:_s(e=>Is(e)),system:e=>null===e?"module.meta":"module.meta."+e,umd:_s(e=>`(typeof document === 'undefined' ? ${ws("'file:' + __filename","(require('u' + 'rl').URL)")} : ${Is(e)})`)};class Ms extends qe{bind(){super.bind(),this.argument.deoptimizePath([V,V])}}class Ls extends qe{constructor(){super(...arguments),this.hasCachedEffect=!1}hasEffects(e){if(this.hasCachedEffect)return!0;for(const t of this.body)if(t.hasEffects(e))return this.hasCachedEffect=!0;return!1}include(e,t){this.included=!0;for(const s of this.body)(t||s.shouldBeIncluded(e))&&s.include(e,t)}render(e,t){this.body.length?_(this.body,e,this.start,this.end,t):super.render(e,t)}}class Rs extends qe{hasEffects(e){if(this.test&&this.test.hasEffects(e))return!0;for(const t of this.consequent){if(e.brokenFlow)break;if(t.hasEffects(e))return!0}return!1}include(e,t){this.included=!0,this.test&&this.test.include(e,t);for(const s of this.consequent)(t||s.shouldBeIncluded(e))&&s.include(e,t)}render(e,t,s){if(this.consequent.length){this.test&&this.test.render(e,t);const i=this.test?this.test.end:C(e.original,"default",this.start)+7,n=C(e.original,":",i)+1;_(this.consequent,e,n,s.end,t)}else super.render(e,t)}}Rs.prototype.needsBoundaries=!0;class Os extends qe{getLiteralValueAtPath(e){return e.length>0||1!==this.quasis.length?H:this.quasis[0].value.cooked}render(e,t){e.indentExclusionRanges.push([this.start,this.end]),super.render(e,t)}}class Ds extends je{constructor(e,t){super(e),this.context=t,this.variables.set("this",new Ue("this",null,K,t))}addExportDefaultDeclaration(e,t,s){const i=new vt(e,t,s);return this.variables.set("default",i),i}addNamespaceMemberAccess(e,t){t instanceof pt&&this.accessedOutsideVariables.set(t.name,t)}deconflict(e,t){for(const s of this.children)s.deconflict(e,t)}findLexicalBoundary(){return this}findVariable(e){const t=this.variables.get(e)||this.accessedOutsideVariables.get(e);if(t)return t;const s=this.context.traceVariable(e)||this.parent.findVariable(e);return s instanceof pt&&this.accessedOutsideVariables.set(e,s),s}}const Vs={"!":e=>!e,"+":e=>+e,"-":e=>-e,delete:()=>H,typeof:e=>typeof e,void:()=>{},"~":e=>~e};function Bs(e,t){return null!==e.renderBaseName&&t.has(e)&&e.isReassigned}class Fs extends qe{deoptimizePath(){for(const e of this.declarations)e.deoptimizePath(B)}hasEffectsWhenAssignedAtPath(){return!1}include(e,t){this.included=!0;for(const s of this.declarations)(t||s.shouldBeIncluded(e))&&s.include(e,t)}includeWithAllDeclaredVariables(e,t){this.included=!0;for(const s of this.declarations)s.include(t,e)}initialise(){for(const e of this.declarations)e.declareDeclarator(this.kind)}render(e,t,s=tt){if(function(e,t){for(const s of e){if(!s.included)return!1;if("Identifier"===s.id.type){if(t.has(s.id.variable))return!1}else{const e=[];if(s.id.addExportedVariables(e,t),e.length>0)return!1}}return!0}(this.declarations,t.exportNamesByVariable)){for(const s of this.declarations)s.render(e,t);s.isNoStatement||59===e.original.charCodeAt(this.end-1)||e.appendLeft(this.end,";")}else this.renderReplacedDeclarations(e,t,s)}renderDeclarationEnd(e,t,s,i,n,r,a,o){59===e.original.charCodeAt(this.end-1)&&e.remove(this.end-1,this.end),r&&(t+=";"),null!==s?(10!==e.original.charCodeAt(i-1)||10!==e.original.charCodeAt(this.end)&&13!==e.original.charCodeAt(this.end)||(i--,13===e.original.charCodeAt(i)&&i--),i===s+1?e.overwrite(s,n,t):(e.overwrite(s,s+1,t),e.remove(i,n))):e.appendLeft(n,t),a.length>0&&e.appendLeft(n,` ${T(a,o)};`)}renderReplacedDeclarations(e,t,{start:s=this.start,end:i=this.end,isNoStatement:n}){const r=I(this.declarations,e,this.start+this.kind.length,this.end-(59===e.original.charCodeAt(this.end-1)?1:0));let a,o;o=/\n\s*$/.test(e.slice(this.start,r[0].start))?this.start+this.kind.length:r[0].start;let h=o-1;e.remove(this.start,h);let l,c,u=!1,d=!1,p="";const f=[];for(const{node:s,start:i,separator:n,contentEnd:m,end:g}of r)if(!s.included||s.id instanceof ft&&Bs(s.id.variable,t.exportNamesByVariable)&&null===s.init)e.remove(i,g);else{if(l="",c="",s.id instanceof ft&&Bs(s.id.variable,t.exportNamesByVariable))d&&(p+=";"),u=!1;else{if("system"===t.format&&null!==s.init)if("Identifier"!==s.id.type)s.id.addExportedVariables(f,t.exportNamesByVariable);else{const i=t.exportNamesByVariable.get(s.id.variable);if(i){const n=t.compact?"":" ",r=C(e.original,"=",s.id.end);e.prependLeft(w(e.original,r+1),1===i.length?`exports('${i[0]}',${n}`:M([s.id.variable],!1,t)),c+=")"}}u?p+=",":(d&&(p+=";"),l+=this.kind+" ",u=!0)}o===h+1?e.overwrite(h,o,p+l):(e.overwrite(h,h+1,p),e.appendLeft(o,l)),s.render(e,t),a=m,o=g,d=!0,h=n,p=c}d?this.renderDeclarationEnd(e,p,h,a,o,!n,f,t):e.remove(s,i)}}const Ws={ArrayExpression:class extends qe{bind(){super.bind();for(const e of this.elements)null!==e&&e.deoptimizePath(F)}getReturnExpressionWhenCalledAtPath(e){return 1!==e.length?q:Ee(fe,e[0])}hasEffectsWhenAccessedAtPath(e){return e.length>1}hasEffectsWhenCalledAtPath(e,t,s){return 1!==e.length||xe(fe,e[0],this.included,t,s)}},ArrayPattern:class extends qe{addExportedVariables(e,t){for(const s of this.elements)null!==s&&s.addExportedVariables(e,t)}declare(e){const t=[];for(const s of this.elements)null!==s&&t.push(...s.declare(e,q));return t}deoptimizePath(e){if(0===e.length)for(const t of this.elements)null!==t&&t.deoptimizePath(e)}hasEffectsWhenAssignedAtPath(e,t){if(e.length>0)return!0;for(const e of this.elements)if(null!==e&&e.hasEffectsWhenAssignedAtPath(B,t))return!0;return!1}},ArrowFunctionExpression:cs,AssignmentExpression:class extends qe{constructor(){super(...arguments),this.deoptimized=!1}hasEffects(e){return this.deoptimized||this.applyDeoptimizations(),this.right.hasEffects(e)||this.left.hasEffects(e)||this.left.hasEffectsWhenAssignedAtPath(B,e)}hasEffectsWhenAccessedAtPath(e,t){return e.length>0&&this.right.hasEffectsWhenAccessedAtPath(e,t)}include(e,t){this.deoptimized||this.applyDeoptimizations(),this.included=!0,this.left.include(e,t),this.right.include(e,t)}render(e,t){if(this.left.render(e,t),this.right.render(e,t),"system"===t.format){const s=this.left.variable&&t.exportNamesByVariable.get(this.left.variable);if("Identifier"===this.left.type&&s){const i=t.compact?"":" ",n=C(e.original,this.operator,this.left.end),r=this.operator.length>1?`${s[0]}${i}${this.operator.slice(0,-1)}${i}`:"";e.overwrite(n,w(e.original,n+this.operator.length),`=${i}${1===s.length?`exports('${s[0]}',${i}`:M([this.left.variable],!1,t)}${r}`),e.appendLeft(this.right.end,")")}else{const s=[];this.left.addExportedVariables(s,t.exportNamesByVariable),s.length>0&&(e.prependRight(this.start,M(s,!0,t)),e.appendLeft(this.end,")"))}}}applyDeoptimizations(){this.deoptimized=!0,this.left.deoptimizePath(B),this.right.deoptimizePath(F)}},AssignmentPattern:class extends qe{addExportedVariables(e,t){this.left.addExportedVariables(e,t)}bind(){super.bind(),this.left.deoptimizePath(B),this.right.deoptimizePath(F)}declare(e,t){return this.left.declare(e,t)}deoptimizePath(e){0===e.length&&this.left.deoptimizePath(e)}hasEffectsWhenAssignedAtPath(e,t){return e.length>0||this.left.hasEffectsWhenAssignedAtPath(B,t)}render(e,t,{isShorthandProperty:s}=tt){this.left.render(e,t,{isShorthandProperty:s}),this.right.render(e,t)}},AwaitExpression:class extends qe{hasEffects(e){return!e.ignore.returnAwaitYield||this.argument.hasEffects(e)}include(e,t){if(!this.included){this.included=!0;e:if(!this.context.usesTopLevelAwait){let e=this.parent;do{if(e instanceof gt||e instanceof cs)break e}while(e=e.parent);this.context.usesTopLevelAwait=!0}}this.argument.include(e,t)}},BinaryExpression:class extends qe{deoptimizeCache(){}getLiteralValueAtPath(e,t,s){if(e.length>0)return H;const i=this.left.getLiteralValueAtPath(B,t,s);if(i===H)return H;const n=this.right.getLiteralValueAtPath(B,t,s);if(n===H)return H;const r=us[this.operator];return r?r(i,n):H}hasEffects(e){return"+"===this.operator&&this.parent instanceof hs&&""===this.left.getLiteralValueAtPath(B,z,this)||super.hasEffects(e)}hasEffectsWhenAccessedAtPath(e){return e.length>1}},BlockStatement:ls,BreakStatement:class extends qe{hasEffects(e){if(this.label){if(!e.ignore.labels.has(this.label.name))return!0;e.includedLabels.add(this.label.name),e.brokenFlow=2}else{if(!e.ignore.breaks)return!0;e.brokenFlow=1}return!1}include(e){this.included=!0,this.label&&(this.label.include(),e.includedLabels.add(this.label.name)),e.brokenFlow=this.label?2:1}},CallExpression:class extends qe{constructor(){super(...arguments),this.expressionsToBeDeoptimized=[],this.returnExpression=null,this.wasPathDeoptmizedWhileOptimized=!1}bind(){if(super.bind(),this.callee instanceof ft){this.scope.findVariable(this.callee.name).isNamespace&&this.context.warn({code:"CANNOT_CALL_NAMESPACE",message:`Cannot call a namespace ('${this.callee.name}')`},this.start),"eval"===this.callee.name&&this.context.warn({code:"EVAL",message:"Use of eval is strongly discouraged, as it poses security risks and may cause issues with minification",url:"https://rollupjs.org/guide/en/#avoiding-eval"},this.start)}this.getReturnExpression(z),this.callee instanceof fs&&!this.callee.variable&&this.callee.object.deoptimizePath(F);for(const e of this.arguments)e.deoptimizePath(F)}deoptimizeCache(){if(this.returnExpression!==q){this.returnExpression=null;const e=this.getReturnExpression(z),t=this.expressionsToBeDeoptimized;e!==q&&(this.expressionsToBeDeoptimized=[],this.wasPathDeoptmizedWhileOptimized&&(e.deoptimizePath(F),this.wasPathDeoptmizedWhileOptimized=!1));for(const e of t)e.deoptimizeCache()}}deoptimizePath(e){if(0===e.length)return;const t=this.context.deoptimizationTracker.getEntities(e);if(t.has(this))return;t.add(this);const s=this.getReturnExpression(z);s!==q&&(this.wasPathDeoptmizedWhileOptimized=!0,s.deoptimizePath(e))}getLiteralValueAtPath(e,t,s){const i=this.getReturnExpression(t);if(i===q)return H;const n=t.getEntities(e);if(n.has(i))return H;this.expressionsToBeDeoptimized.push(s),n.add(i);const r=i.getLiteralValueAtPath(e,t,s);return n.delete(i),r}getReturnExpressionWhenCalledAtPath(e,t,s){const i=this.getReturnExpression(t);if(this.returnExpression===q)return q;const n=t.getEntities(e);if(n.has(i))return q;this.expressionsToBeDeoptimized.push(s),n.add(i);const r=i.getReturnExpressionWhenCalledAtPath(e,t,s);return n.delete(i),r}hasEffects(e){for(const t of this.arguments)if(t.hasEffects(e))return!0;return(!this.context.options.treeshake.annotations||!this.annotatedPure)&&(this.callee.hasEffects(e)||this.callee.hasEffectsWhenCalledAtPath(B,this.callOptions,e))}hasEffectsWhenAccessedAtPath(e,t){if(0===e.length)return!1;const s=t.accessed.getEntities(e);return!s.has(this)&&(s.add(this),this.returnExpression.hasEffectsWhenAccessedAtPath(e,t))}hasEffectsWhenAssignedAtPath(e,t){if(0===e.length)return!0;const s=t.assigned.getEntities(e);return!s.has(this)&&(s.add(this),this.returnExpression.hasEffectsWhenAssignedAtPath(e,t))}hasEffectsWhenCalledAtPath(e,t,s){const i=(t.withNew?s.instantiated:s.called).getEntities(e,t);return!i.has(this)&&(i.add(this),this.returnExpression.hasEffectsWhenCalledAtPath(e,t,s))}include(e,t){t?(super.include(e,t),"variables"===t&&this.callee instanceof ft&&this.callee.variable&&this.callee.variable.markCalledFromTryStatement()):(this.included=!0,this.callee.include(e,!1)),this.callee.includeCallArguments(e,this.arguments),this.returnExpression.included||this.returnExpression.include(e,!1)}initialise(){this.callOptions={args:this.arguments,withNew:!1}}render(e,t,{renderedParentType:s}=tt){if(this.callee.render(e,t),this.arguments.length>0)if(this.arguments[this.arguments.length-1].included)for(const s of this.arguments)s.render(e,t);else{let s=this.arguments.length-2;for(;s>=0&&!this.arguments[s].included;)s--;if(s>=0){for(let i=0;i<=s;i++)this.arguments[i].render(e,t);e.remove(C(e.original,",",this.arguments[s].end),this.end-1)}else e.remove(C(e.original,"(",this.callee.end)+1,this.end-1)}"ExpressionStatement"===s&&"FunctionExpression"===this.callee.type&&(e.appendRight(this.start,"("),e.prependLeft(this.end,")"))}getReturnExpression(e){return null===this.returnExpression?(this.returnExpression=q,this.returnExpression=this.callee.getReturnExpressionWhenCalledAtPath(B,e,this)):this.returnExpression}},CatchClause:gs,ChainExpression:class extends qe{},ClassBody:class extends qe{createScope(e){this.scope=new ys(e)}hasEffectsWhenCalledAtPath(e,t,s){return e.length>0||null!==this.classConstructor&&this.classConstructor.hasEffectsWhenCalledAtPath(B,t,s)}initialise(){for(const e of this.body)if(e instanceof xs&&"constructor"===e.kind)return void(this.classConstructor=e);this.classConstructor=null}},ClassDeclaration:Xe,ClassExpression:class extends Ke{},ConditionalExpression:class extends qe{constructor(){super(...arguments),this.expressionsToBeDeoptimized=[],this.isBranchResolutionAnalysed=!1,this.usedBranch=null,this.wasPathDeoptimizedWhileOptimized=!1}bind(){super.bind(),this.getUsedBranch()}deoptimizeCache(){if(null!==this.usedBranch){const e=this.usedBranch===this.consequent?this.alternate:this.consequent;this.usedBranch=null;const t=this.expressionsToBeDeoptimized;this.expressionsToBeDeoptimized=[],this.wasPathDeoptimizedWhileOptimized&&e.deoptimizePath(F);for(const e of t)e.deoptimizeCache()}}deoptimizePath(e){if(e.length>0){const t=this.getUsedBranch();null===t?(this.consequent.deoptimizePath(e),this.alternate.deoptimizePath(e)):(this.wasPathDeoptimizedWhileOptimized=!0,t.deoptimizePath(e))}}getLiteralValueAtPath(e,t,s){const i=this.getUsedBranch();return null===i?H:(this.expressionsToBeDeoptimized.push(s),i.getLiteralValueAtPath(e,t,s))}getReturnExpressionWhenCalledAtPath(e,t,s){const i=this.getUsedBranch();return null===i?new Es([this.consequent.getReturnExpressionWhenCalledAtPath(e,t,s),this.alternate.getReturnExpressionWhenCalledAtPath(e,t,s)]):(this.expressionsToBeDeoptimized.push(s),i.getReturnExpressionWhenCalledAtPath(e,t,s))}hasEffects(e){return!!this.test.hasEffects(e)||(null===this.usedBranch?this.consequent.hasEffects(e)||this.alternate.hasEffects(e):this.usedBranch.hasEffects(e))}hasEffectsWhenAccessedAtPath(e,t){return 0!==e.length&&(null===this.usedBranch?this.consequent.hasEffectsWhenAccessedAtPath(e,t)||this.alternate.hasEffectsWhenAccessedAtPath(e,t):this.usedBranch.hasEffectsWhenAccessedAtPath(e,t))}hasEffectsWhenAssignedAtPath(e,t){return 0===e.length||(null===this.usedBranch?this.consequent.hasEffectsWhenAssignedAtPath(e,t)||this.alternate.hasEffectsWhenAssignedAtPath(e,t):this.usedBranch.hasEffectsWhenAssignedAtPath(e,t))}hasEffectsWhenCalledAtPath(e,t,s){return null===this.usedBranch?this.consequent.hasEffectsWhenCalledAtPath(e,t,s)||this.alternate.hasEffectsWhenCalledAtPath(e,t,s):this.usedBranch.hasEffectsWhenCalledAtPath(e,t,s)}include(e,t){this.included=!0,t||this.test.shouldBeIncluded(e)||null===this.usedBranch?(this.test.include(e,t),this.consequent.include(e,t),this.alternate.include(e,t)):this.usedBranch.include(e,t)}render(e,t,{renderedParentType:s,isCalleeOfRenderedParent:i,preventASI:n}=tt){if(this.test.included)super.render(e,t);else{const r=C(e.original,":",this.consequent.end),a=(this.consequent.included?C(e.original,"?",this.test.end):r)+1;n&&$(e,a,this.usedBranch.start),e.remove(this.start,a),this.consequent.included&&e.remove(r,this.end),A(this,e),this.usedBranch.render(e,t,{isCalleeOfRenderedParent:s?i:this.parent.callee===this,renderedParentType:s||this.parent.type})}}getUsedBranch(){if(this.isBranchResolutionAnalysed)return this.usedBranch;this.isBranchResolutionAnalysed=!0;const e=this.test.getLiteralValueAtPath(B,z,this);return e===H?null:this.usedBranch=e?this.consequent:this.alternate}},ContinueStatement:class extends qe{hasEffects(e){if(this.label){if(!e.ignore.labels.has(this.label.name))return!0;e.includedLabels.add(this.label.name),e.brokenFlow=2}else{if(!e.ignore.continues)return!0;e.brokenFlow=1}return!1}include(e){this.included=!0,this.label&&(this.label.include(),e.includedLabels.add(this.label.name)),e.brokenFlow=this.label?2:1}},DoWhileStatement:class extends qe{hasEffects(e){if(this.test.hasEffects(e))return!0;const{brokenFlow:t,ignore:{breaks:s,continues:i}}=e;return e.ignore.breaks=!0,e.ignore.continues=!0,!!this.body.hasEffects(e)||(e.ignore.breaks=s,e.ignore.continues=i,e.brokenFlow=t,!1)}include(e,t){this.included=!0,this.test.include(e,t);const{brokenFlow:s}=e;this.body.include(e,t),e.brokenFlow=s}},EmptyStatement:class extends qe{hasEffects(){return!1}},ExportAllDeclaration:as,ExportDefaultDeclaration:xt,ExportNamedDeclaration:vs,ExportSpecifier:class extends qe{},ExpressionStatement:hs,FieldDefinition:class extends qe{hasEffects(e){return this.key.hasEffects(e)||this.static&&null!==this.value&&this.value.hasEffects(e)}},ForInStatement:class extends qe{bind(){this.left.bind(),this.left.deoptimizePath(B),this.right.bind(),this.body.bind()}createScope(e){this.scope=new os(e)}hasEffects(e){if(this.left&&(this.left.hasEffects(e)||this.left.hasEffectsWhenAssignedAtPath(B,e))||this.right&&this.right.hasEffects(e))return!0;const{brokenFlow:t,ignore:{breaks:s,continues:i}}=e;return e.ignore.breaks=!0,e.ignore.continues=!0,!!this.body.hasEffects(e)||(e.ignore.breaks=s,e.ignore.continues=i,e.brokenFlow=t,!1)}include(e,t){this.included=!0,this.left.includeWithAllDeclaredVariables(t,e),this.left.deoptimizePath(B),this.right.include(e,t);const{brokenFlow:s}=e;this.body.include(e,t),e.brokenFlow=s}render(e,t){this.left.render(e,t,P),this.right.render(e,t,P),110===e.original.charCodeAt(this.right.start-1)&&e.prependLeft(this.right.start," "),this.body.render(e,t)}},ForOfStatement:class extends qe{bind(){this.left.bind(),this.left.deoptimizePath(B),this.right.bind(),this.body.bind()}createScope(e){this.scope=new os(e)}hasEffects(){return!0}include(e,t){this.included=!0,this.left.includeWithAllDeclaredVariables(t,e),this.left.deoptimizePath(B),this.right.include(e,t);const{brokenFlow:s}=e;this.body.include(e,t),e.brokenFlow=s}render(e,t){this.left.render(e,t,P),this.right.render(e,t,P),102===e.original.charCodeAt(this.right.start-1)&&e.prependLeft(this.right.start," "),this.body.render(e,t)}},ForStatement:class extends qe{createScope(e){this.scope=new os(e)}hasEffects(e){if(this.init&&this.init.hasEffects(e)||this.test&&this.test.hasEffects(e)||this.update&&this.update.hasEffects(e))return!0;const{brokenFlow:t,ignore:{breaks:s,continues:i}}=e;return e.ignore.breaks=!0,e.ignore.continues=!0,!!this.body.hasEffects(e)||(e.ignore.breaks=s,e.ignore.continues=i,e.brokenFlow=t,!1)}include(e,t){this.included=!0,this.init&&this.init.include(e,t),this.test&&this.test.include(e,t);const{brokenFlow:s}=e;this.update&&this.update.include(e,t),this.body.include(e,t),e.brokenFlow=s}render(e,t){this.init&&this.init.render(e,t,P),this.test&&this.test.render(e,t,P),this.update&&this.update.render(e,t,P),this.body.render(e,t)}},FunctionDeclaration:yt,FunctionExpression:class extends gt{},Identifier:ft,IfStatement:class extends qe{constructor(){super(...arguments),this.testValue=bs}deoptimizeCache(){this.testValue=H}hasEffects(e){if(this.test.hasEffects(e))return!0;const t=this.getTestValue();if(t===H){const{brokenFlow:t}=e;if(this.consequent.hasEffects(e))return!0;const s=e.brokenFlow;return e.brokenFlow=t,null===this.alternate?!1:!!this.alternate.hasEffects(e)||(e.brokenFlow=e.brokenFlow1}include(){if(!this.included){this.included=!0;const e=this.parent,t=this.metaProperty=e instanceof fs&&"string"==typeof e.propertyKey?e.propertyKey:null;t&&(t.startsWith(Ps)||t.startsWith(As)||t.startsWith("ROLLUP_CHUNK_URL_"))?this.scope.addAccessedGlobalsByFormat(ks):this.scope.addAccessedGlobalsByFormat(Cs)}}initialise(){"import"===this.meta.name&&this.context.addImportMeta(this)}renderFinalMechanism(e,t,s,i){if(!this.included)return;const n=this.parent,r=this.metaProperty;if(r&&(r.startsWith(Ps)||r.startsWith(As)||r.startsWith("ROLLUP_CHUNK_URL_"))){let a,o=null,h=null,l=null;r.startsWith(Ps)?(o=r.substr(Ps.length),a=i.getFileName(o)):r.startsWith(As)?(Ht(`Using the "${As}" prefix to reference files is deprecated. Use the "${Ps}" prefix instead.`,!0,this.context.options),h=r.substr(As.length),a=i.getFileName(h)):(Ht(`Using the "ROLLUP_CHUNK_URL_" prefix to reference files is deprecated. Use the "${Ps}" prefix instead.`,!0,this.context.options),l=r.substr("ROLLUP_CHUNK_URL_".length),a=i.getFileName(l));const c=Te(Oe(Le(t),a));let u;return null!==h&&(u=i.hookFirstSync("resolveAssetUrl",[{assetFileName:a,chunkId:t,format:s,moduleId:this.context.module.id,relativeAssetPath:c}])),u||(u=i.hookFirstSync("resolveFileUrl",[{assetReferenceId:h,chunkId:t,chunkReferenceId:l,fileName:a,format:s,moduleId:this.context.module.id,referenceId:o||h||l,relativePath:c}])||$s[s](c)),void e.overwrite(n.start,n.end,u,{contentOnly:!0})}const a=i.hookFirstSync("resolveImportMeta",[r,{chunkId:t,format:s,moduleId:this.context.module.id}])||Ts[s]&&Ts[s](r,t);"string"==typeof a&&(n instanceof fs?e.overwrite(n.start,n.end,a,{contentOnly:!0}):e.overwrite(this.start,this.end,a,{contentOnly:!0}))}},MethodDefinition:xs,NewExpression:class extends qe{bind(){super.bind();for(const e of this.arguments)e.deoptimizePath(F)}hasEffects(e){for(const t of this.arguments)if(t.hasEffects(e))return!0;return(!this.context.options.treeshake.annotations||!this.annotatedPure)&&(this.callee.hasEffects(e)||this.callee.hasEffectsWhenCalledAtPath(B,this.callOptions,e))}hasEffectsWhenAccessedAtPath(e){return e.length>1}initialise(){this.callOptions={args:this.arguments,withNew:!0}}},ObjectExpression:class extends qe{constructor(){super(...arguments),this.deoptimizedPaths=new Set,this.expressionsToBeDeoptimized=new Map,this.hasUnknownDeoptimizedProperty=!1,this.propertyMap=null,this.unmatchablePropertiesRead=[],this.unmatchablePropertiesWrite=[]}bind(){super.bind(),this.getPropertyMap()}deoptimizeCache(){this.hasUnknownDeoptimizedProperty||this.deoptimizeAllProperties()}deoptimizePath(e){if(this.hasUnknownDeoptimizedProperty)return;const t=this.getPropertyMap(),s=e[0];if(1===e.length){if("string"!=typeof s)return void this.deoptimizeAllProperties();if(!this.deoptimizedPaths.has(s)){this.deoptimizedPaths.add(s);const e=this.expressionsToBeDeoptimized.get(s);if(e)for(const t of e)t.deoptimizeCache()}}const i=1===e.length?F:e.slice(1);for(const e of"string"==typeof s?t[s]?t[s].propertiesRead:[]:this.properties)e.deoptimizePath(i)}getLiteralValueAtPath(e,t,s){const i=this.getPropertyMap(),n=e[0];if(0===e.length||this.hasUnknownDeoptimizedProperty||"string"!=typeof n||this.deoptimizedPaths.has(n))return H;if(1===e.length&&!i[n]&&!pe[n]&&0===this.unmatchablePropertiesRead.length){const e=this.expressionsToBeDeoptimized.get(n);return void(e?e.push(s):this.expressionsToBeDeoptimized.set(n,[s]))}if(!i[n]||null===i[n].exactMatchRead||i[n].propertiesRead.length>1)return H;const r=this.expressionsToBeDeoptimized.get(n);return r?r.push(s):this.expressionsToBeDeoptimized.set(n,[s]),i[n].exactMatchRead.getLiteralValueAtPath(e.slice(1),t,s)}getReturnExpressionWhenCalledAtPath(e,t,s){const i=this.getPropertyMap(),n=e[0];if(0===e.length||this.hasUnknownDeoptimizedProperty||"string"!=typeof n||this.deoptimizedPaths.has(n))return q;if(1===e.length&&pe[n]&&0===this.unmatchablePropertiesRead.length&&(!i[n]||null===i[n].exactMatchRead))return Ee(pe,n);if(!i[n]||null===i[n].exactMatchRead||i[n].propertiesRead.length>1)return q;const r=this.expressionsToBeDeoptimized.get(n);return r?r.push(s):this.expressionsToBeDeoptimized.set(n,[s]),i[n].exactMatchRead.getReturnExpressionWhenCalledAtPath(e.slice(1),t,s)}hasEffectsWhenAccessedAtPath(e,t){if(0===e.length)return!1;const s=e[0],i=this.propertyMap;if(e.length>1&&(this.hasUnknownDeoptimizedProperty||"string"!=typeof s||this.deoptimizedPaths.has(s)||!i[s]||null===i[s].exactMatchRead))return!0;const n=e.slice(1);for(const e of"string"!=typeof s?this.properties:i[s]?i[s].propertiesRead:[])if(e.hasEffectsWhenAccessedAtPath(n,t))return!0;return!1}hasEffectsWhenAssignedAtPath(e,t){const s=e[0],i=this.propertyMap;if(e.length>1&&(this.hasUnknownDeoptimizedProperty||this.deoptimizedPaths.has(s)||!i[s]||null===i[s].exactMatchRead))return!0;const n=e.slice(1);for(const r of"string"!=typeof s?this.properties:e.length>1?i[s].propertiesRead:i[s]?i[s].propertiesWrite:[])if(r.hasEffectsWhenAssignedAtPath(n,t))return!0;return!1}hasEffectsWhenCalledAtPath(e,t,s){const i=e[0];if("string"!=typeof i||this.hasUnknownDeoptimizedProperty||this.deoptimizedPaths.has(i)||(this.propertyMap[i]?!this.propertyMap[i].exactMatchRead:e.length>1||!pe[i]))return!0;const n=e.slice(1);if(this.propertyMap[i])for(const e of this.propertyMap[i].propertiesRead)if(e.hasEffectsWhenCalledAtPath(n,t,s))return!0;return!(1!==e.length||!pe[i])&&xe(pe,i,this.included,t,s)}render(e,t,{renderedParentType:s}=tt){super.render(e,t),"ExpressionStatement"!==s&&"ArrowFunctionExpression"!==s||(e.appendRight(this.start,"("),e.prependLeft(this.end,")"))}deoptimizeAllProperties(){this.hasUnknownDeoptimizedProperty=!0;for(const e of this.properties)e.deoptimizePath(F);for(const e of this.expressionsToBeDeoptimized.values())for(const t of e)t.deoptimizeCache()}getPropertyMap(){if(null!==this.propertyMap)return this.propertyMap;const e=this.propertyMap=Object.create(null);for(let t=this.properties.length-1;t>=0;t--){const s=this.properties[t];if(s instanceof Ms){this.unmatchablePropertiesRead.push(s);continue}const i="get"!==s.kind,n="set"!==s.kind;let r;if(s.computed){const e=s.key.getLiteralValueAtPath(B,z,this);if(e===H){n?this.unmatchablePropertiesRead.push(s):this.unmatchablePropertiesWrite.push(s);continue}r=String(e)}else r=s.key instanceof ft?s.key.name:String(s.key.value);const a=e[r];a?(n&&null===a.exactMatchRead&&(a.exactMatchRead=s,a.propertiesRead.push(s,...this.unmatchablePropertiesRead)),i&&!n&&null===a.exactMatchWrite&&(a.exactMatchWrite=s,a.propertiesWrite.push(s,...this.unmatchablePropertiesWrite))):e[r]={exactMatchRead:n?s:null,exactMatchWrite:i?s:null,propertiesRead:n?[s,...this.unmatchablePropertiesRead]:[],propertiesWrite:i&&!n?[s,...this.unmatchablePropertiesWrite]:[]}}return e}},ObjectPattern:class extends qe{addExportedVariables(e,t){for(const s of this.properties)"Property"===s.type?s.value.addExportedVariables(e,t):s.argument.addExportedVariables(e,t)}declare(e,t){const s=[];for(const i of this.properties)s.push(...i.declare(e,t));return s}deoptimizePath(e){if(0===e.length)for(const t of this.properties)t.deoptimizePath(e)}hasEffectsWhenAssignedAtPath(e,t){if(e.length>0)return!0;for(const e of this.properties)if(e.hasEffectsWhenAssignedAtPath(B,t))return!0;return!1}},PrivateName:class extends qe{},Program:Ls,Property:class extends qe{constructor(){super(...arguments),this.declarationInit=null,this.returnExpression=null}bind(){super.bind(),"get"===this.kind&&this.getReturnExpression(),null!==this.declarationInit&&this.declarationInit.deoptimizePath([V,V])}declare(e,t){return this.declarationInit=t,this.value.declare(e,q)}deoptimizeCache(){}deoptimizePath(e){"get"===this.kind?this.getReturnExpression().deoptimizePath(e):this.value.deoptimizePath(e)}getLiteralValueAtPath(e,t,s){return"get"===this.kind?this.getReturnExpression().getLiteralValueAtPath(e,t,s):this.value.getLiteralValueAtPath(e,t,s)}getReturnExpressionWhenCalledAtPath(e,t,s){return"get"===this.kind?this.getReturnExpression().getReturnExpressionWhenCalledAtPath(e,t,s):this.value.getReturnExpressionWhenCalledAtPath(e,t,s)}hasEffects(e){return this.key.hasEffects(e)||this.value.hasEffects(e)}hasEffectsWhenAccessedAtPath(e,t){if("get"===this.kind){const s=t.accessed.getEntities(e);return!s.has(this)&&(s.add(this),this.value.hasEffectsWhenCalledAtPath(B,this.accessorCallOptions,t)||e.length>0&&this.returnExpression.hasEffectsWhenAccessedAtPath(e,t))}return this.value.hasEffectsWhenAccessedAtPath(e,t)}hasEffectsWhenAssignedAtPath(e,t){if("get"===this.kind){const s=t.assigned.getEntities(e);return!s.has(this)&&(s.add(this),this.returnExpression.hasEffectsWhenAssignedAtPath(e,t))}if("set"===this.kind){const s=t.assigned.getEntities(e);return!s.has(this)&&(s.add(this),this.value.hasEffectsWhenCalledAtPath(B,this.accessorCallOptions,t))}return this.value.hasEffectsWhenAssignedAtPath(e,t)}hasEffectsWhenCalledAtPath(e,t,s){if("get"===this.kind){const i=(t.withNew?s.instantiated:s.called).getEntities(e,t);return!i.has(this)&&(i.add(this),this.returnExpression.hasEffectsWhenCalledAtPath(e,t,s))}return this.value.hasEffectsWhenCalledAtPath(e,t,s)}initialise(){this.accessorCallOptions={args:D,withNew:!1}}render(e,t){this.shorthand||this.key.render(e,t),this.value.render(e,t,{isShorthandProperty:this.shorthand})}getReturnExpression(){return null===this.returnExpression?(this.returnExpression=q,this.returnExpression=this.value.getReturnExpressionWhenCalledAtPath(B,z,this)):this.returnExpression}},RestElement:mt,ReturnStatement:class extends qe{hasEffects(e){return!(e.ignore.returnAwaitYield&&(null===this.argument||!this.argument.hasEffects(e)))||(e.brokenFlow=2,!1)}include(e,t){this.included=!0,this.argument&&this.argument.include(e,t),e.brokenFlow=2}initialise(){this.scope.addReturnExpression(this.argument||q)}render(e,t){this.argument&&(this.argument.render(e,t,{preventASI:!0}),this.argument.start===this.start+6&&e.prependLeft(this.start+6," "))}},SequenceExpression:class extends qe{deoptimizePath(e){e.length>0&&this.expressions[this.expressions.length-1].deoptimizePath(e)}getLiteralValueAtPath(e,t,s){return this.expressions[this.expressions.length-1].getLiteralValueAtPath(e,t,s)}hasEffects(e){for(const t of this.expressions)if(t.hasEffects(e))return!0;return!1}hasEffectsWhenAccessedAtPath(e,t){return e.length>0&&this.expressions[this.expressions.length-1].hasEffectsWhenAccessedAtPath(e,t)}hasEffectsWhenAssignedAtPath(e,t){return 0===e.length||this.expressions[this.expressions.length-1].hasEffectsWhenAssignedAtPath(e,t)}hasEffectsWhenCalledAtPath(e,t,s){return this.expressions[this.expressions.length-1].hasEffectsWhenCalledAtPath(e,t,s)}include(e,t){this.included=!0;for(let s=0;s=0;r--){const a=this.cases[r];if(a.included&&(n=!0),!n){const e=We();e.ignore.breaks=!0,n=a.hasEffects(e)}n?(a.include(e,t),i=i0&&_(this.cases,e,this.cases[0].start,this.end-1,t)}},TaggedTemplateExpression:class extends qe{bind(){if(super.bind(),"Identifier"===this.tag.type){const e=this.tag.name;this.scope.findVariable(e).isNamespace&&this.context.warn({code:"CANNOT_CALL_NAMESPACE",message:`Cannot call a namespace ('${e}')`},this.start),"eval"===e&&this.context.warn({code:"EVAL",message:"Use of eval is strongly discouraged, as it poses security risks and may cause issues with minification",url:"https://rollupjs.org/guide/en/#avoiding-eval"},this.start)}}hasEffects(e){return super.hasEffects(e)||this.tag.hasEffectsWhenCalledAtPath(B,this.callOptions,e)}initialise(){this.callOptions={args:D,withNew:!1}}},TemplateElement:class extends qe{bind(){}hasEffects(){return!1}include(){this.included=!0}parseNode(e){this.value=e.value,super.parseNode(e)}render(){}},TemplateLiteral:Os,ThisExpression:class extends qe{bind(){super.bind(),this.variable=this.scope.findVariable("this")}hasEffectsWhenAccessedAtPath(e,t){return e.length>0&&this.variable.hasEffectsWhenAccessedAtPath(e,t)}hasEffectsWhenAssignedAtPath(e,t){return this.variable.hasEffectsWhenAssignedAtPath(e,t)}initialise(){this.alias=this.scope.findLexicalBoundary()instanceof Ds?this.context.moduleContext:null,"undefined"===this.alias&&this.context.warn({code:"THIS_IS_UNDEFINED",message:"The 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten",url:"https://rollupjs.org/guide/en/#error-this-is-undefined"},this.start)}render(e){null!==this.alias&&e.overwrite(this.start,this.end,this.alias,{contentOnly:!1,storeName:!0})}},ThrowStatement:class extends qe{hasEffects(){return!0}include(e,t){this.included=!0,this.argument.include(e,t),e.brokenFlow=2}render(e,t){this.argument.render(e,t,{preventASI:!0}),this.argument.start===this.start+5&&e.prependLeft(this.start+5," ")}},TryStatement:class extends qe{constructor(){super(...arguments),this.directlyIncluded=!1}hasEffects(e){return(this.context.options.treeshake.tryCatchDeoptimization?this.block.body.length>0:this.block.hasEffects(e))||null!==this.finalizer&&this.finalizer.hasEffects(e)}include(e,t){var s;const i=null===(s=this.context.options.treeshake)||void 0===s?void 0:s.tryCatchDeoptimization,{brokenFlow:n}=e;this.directlyIncluded&&i||(this.included=!0,this.directlyIncluded=!0,this.block.include(e,i?"variables":t),e.brokenFlow=n),null!==this.handler&&(this.handler.include(e,t),e.brokenFlow=n),null!==this.finalizer&&this.finalizer.include(e,t)}},UnaryExpression:class extends qe{bind(){super.bind(),"delete"===this.operator&&this.argument.deoptimizePath(B)}getLiteralValueAtPath(e,t,s){if(e.length>0)return H;const i=this.argument.getLiteralValueAtPath(B,t,s);return i===H?H:Vs[this.operator](i)}hasEffects(e){return!("typeof"===this.operator&&this.argument instanceof ft)&&(this.argument.hasEffects(e)||"delete"===this.operator&&this.argument.hasEffectsWhenAssignedAtPath(B,e))}hasEffectsWhenAccessedAtPath(e){return"void"===this.operator?e.length>0:e.length>1}},UnknownNode:class extends qe{hasEffects(){return!0}include(e){super.include(e,!0)}},UpdateExpression:class extends qe{bind(){if(super.bind(),this.argument.deoptimizePath(B),this.argument instanceof ft){this.scope.findVariable(this.argument.name).isReassigned=!0}}hasEffects(e){return this.argument.hasEffects(e)||this.argument.hasEffectsWhenAssignedAtPath(B,e)}hasEffectsWhenAccessedAtPath(e){return e.length>1}render(e,t){if(this.argument.render(e,t),"system"===t.format){const s=this.argument.variable,i=t.exportNamesByVariable.get(s);if(i&&i.length){const n=t.compact?"":" ",r=s.getName();if(this.prefix)1===i.length?e.overwrite(this.start,this.end,`exports('${i[0]}',${n}${this.operator}${r})`):e.overwrite(this.start,this.end,`(${this.operator}${r},${n}${T([s],t)},${n}${r})`);else if(i.length>1)e.overwrite(this.start,this.end,`${M([s],!1,t)}${this.operator}${r})`);else{let t;switch(this.operator){case"++":t=`${r}${n}+${n}1`;break;case"--":t=`${r}${n}-${n}1`}e.overwrite(this.start,this.end,`(exports('${i[0]}',${n}${t}),${n}${r}${this.operator})`)}}}}},VariableDeclaration:Fs,VariableDeclarator:class extends qe{declareDeclarator(e){this.id.declare(e,this.init||K)}deoptimizePath(e){this.id.deoptimizePath(e)}render(e,t){null===this.init||this.init.included?super.render(e,t):(e.remove(this.id.end,this.end),this.id.render(e,t))}},WhileStatement:class extends qe{hasEffects(e){if(this.test.hasEffects(e))return!0;const{brokenFlow:t,ignore:{breaks:s,continues:i}}=e;return e.ignore.breaks=!0,e.ignore.continues=!0,!!this.body.hasEffects(e)||(e.ignore.breaks=s,e.ignore.continues=i,e.brokenFlow=t,!1)}include(e,t){this.included=!0,this.test.include(e,t);const{brokenFlow:s}=e;this.body.include(e,t),e.brokenFlow=s}},YieldExpression:class extends qe{bind(){super.bind(),null!==this.argument&&this.argument.deoptimizePath(F)}hasEffects(e){return!e.ignore.returnAwaitYield||null!==this.argument&&this.argument.hasEffects(e)}render(e,t){this.argument&&(this.argument.render(e,t),this.argument.start===this.start+5&&e.prependLeft(this.start+5," "))}}};function Us(e){return e.id}function zs(e,t,s){s(e,t)}function js(e,t,s){}var Gs={};function Hs(e,t,s=e.type){let i=t.commentNodes[t.commentIndex];for(;i&&e.start>=i.end;)qs(e,i),i=t.commentNodes[++t.commentIndex];i&&i.end<=e.end&&Gs[s](e,t,Hs)}function qs(e,t){e.annotations?e.annotations.push(t):e.annotations=[t],"ExpressionStatement"===e.type&&(e=e.expression),"CallExpression"!==e.type&&"NewExpression"!==e.type||(e.annotatedPure=!0)}Gs.Program=Gs.BlockStatement=function(e,t,s){for(var i=0,n=e.body;iKs.test(e.text);let Ys="sourceMa";Ys+="ppingURL";const Qs=new RegExp("^#\\s+sourceMappingURL=.+\\n?"),Js=()=>{};let Zs=()=>[0,0],ei=()=>0,ti=()=>0,si={};function ii(e,t){switch(t){case 1:return"# "+e;case 2:return"## "+e;case 3:return e;default:return`${" ".repeat(t-4)}- ${e}`}}function ni(e,t=3){e=ii(e,t),si.hasOwnProperty(e)||(si[e]={memory:0,startMemory:void 0,startTime:void 0,time:0,totalMemory:0});const s=ti();si[e].startTime=Zs(),si[e].startMemory=s}function ri(e,t=3){if(e=ii(e,t),si.hasOwnProperty(e)){const t=ti();si[e].time+=ei(si[e].startTime),si[e].totalMemory=Math.max(si[e].totalMemory,t),si[e].memory+=t-si[e].startMemory}}function ai(){const e={};for(const t of Object.keys(si))e[t]=[si[t].time,si[t].memory,si[t].totalMemory];return e}let oi=Js,hi=Js;const li={load:!0,resolveDynamicImport:!0,resolveId:!0,transform:!0};function ci(e,t){const s={};for(const i of Object.keys(e))if(!0===li[i]){let n="plugin "+t;e.name&&(n+=` (${e.name})`),n+=" - "+i,s[i]=function(){oi(n,4);const t=e[i].apply(this===s?e:this,arguments);return hi(n,4),t&&"function"==typeof t.then&&(oi(n+" (async)",4),t.then(()=>hi(n+" (async)",4))),t}}else s[i]=e[i];return s}function ui(e){e.perf?(si={},"undefined"!=typeof process&&"function"==typeof process.hrtime?(Zs=process.hrtime.bind(process),ei=e=>{return 1e3*(t=process.hrtime(e))[0]+t[1]/1e6;var t}):"undefined"!=typeof performance&&"function"==typeof performance.now&&(Zs=()=>[performance.now(),0],ei=e=>performance.now()-e[0]),"undefined"!=typeof process&&"function"==typeof process.memoryUsage&&(ti=()=>process.memoryUsage().heapUsed),oi=ni,hi=ri,e.plugins=e.plugins.map(ci)):(oi=Js,hi=Js)}function di(e,t,s,i){return t.error({code:"MISSING_EXPORT",message:`'${e}' is not exported by ${Dt(s)}, imported by ${Dt(t.id)}`,url:"https://rollupjs.org/guide/en/#error-name-is-not-exported-by-module"},i)}const pi={identifier:null,localName:"_missingExportShim"};function fi(e,t,s,i=new Map){const n=i.get(t);if(n){if(n.has(e))return null;n.add(e)}else i.set(t,new Set([e]));return e.getVariableForExportName(t,s,i)}class mi{constructor(e,t,s,i,n,r){this.graph=e,this.id=t,this.options=s,this.moduleSideEffects=i,this.syntheticNamedExports=n,this.isEntryPoint=r,this.chunkFileNames=new Set,this.chunkName=null,this.comments=[],this.dependencies=new Set,this.dynamicDependencies=new Set,this.dynamicImporters=[],this.dynamicImports=[],this.execIndex=1/0,this.exportAllSources=new Set,this.exports=Object.create(null),this.exportsAll=Object.create(null),this.implicitlyLoadedAfter=new Set,this.implicitlyLoadedBefore=new Set,this.importDescriptions=Object.create(null),this.importers=[],this.importMetas=[],this.imports=new Set,this.includedDynamicImporters=[],this.isExecuted=!1,this.isUserDefinedEntryPoint=!1,this.preserveSignature=this.options.preserveEntrySignatures,this.reexportDescriptions=Object.create(null),this.sources=new Set,this.userChunkNames=new Set,this.usesTopLevelAwait=!1,this.allExportNames=null,this.defaultExport=null,this.exportAllModules=[],this.exportNamesByVariable=null,this.exportShimVariable=new bt(this),this.relevantDependencies=null,this.syntheticExports=new Map,this.transformDependencies=[],this.transitiveReexports=null,this.excludeFromSourcemap=/\0/.test(t),this.context=s.moduleContext(t)}basename(){const e=Me(this.id),t=Re(this.id);return we(t?e.slice(0,-t.length):e)}bindReferences(){this.ast.bind()}error(e,t){return this.addLocationToLogProps(e,t),Bt(e)}getAllExportNames(){if(this.allExportNames)return this.allExportNames;const e=this.allExportNames=new Set;for(const t of Object.keys(this.exports))e.add(t);for(const t of Object.keys(this.reexportDescriptions))e.add(t);for(const t of this.exportAllModules)if(t instanceof Ve)e.add("*"+t.id);else for(const s of t.getAllExportNames())"default"!==s&&e.add(s);return e}getDefaultExport(){return null===this.defaultExport&&(this.defaultExport=void 0,this.defaultExport=this.getVariableForExportName("default")),this.defaultExport?this.defaultExport:Bt({code:Wt.SYNTHETIC_NAMED_EXPORTS_NEED_DEFAULT,id:this.id,message:"Modules with 'syntheticNamedExports' need a default export."})}getDependenciesToBeIncluded(){if(this.relevantDependencies)return this.relevantDependencies;const e=new Set,t=new Set,s=new Set(this.dependencies);let i=this.imports;if(this.isEntryPoint||this.includedDynamicImporters.length>0||this.namespace.included){i=new Set(i);for(const e of[...this.getReexports(),...this.getExports()])i.add(this.getVariableForExportName(e))}for(let n of i){if(n instanceof At)n=n.getBaseVariable();else if(n instanceof vt){const{modules:e,original:i}=n.getOriginalVariableAndDeclarationModules();n=i;for(const i of e)t.add(i),s.add(i)}e.add(n.module)}if(this.options.treeshake){for(const i of s)if((i.moduleSideEffects||t.has(i))&&!e.has(i))if(i instanceof Ve||i.hasEffects())e.add(i);else for(const e of i.dependencies)s.add(e)}else for(const t of this.dependencies)e.add(t);return this.relevantDependencies=e}getExportNamesByVariable(){if(this.exportNamesByVariable)return this.exportNamesByVariable;const e=new Map;for(const t of this.getAllExportNames()){let s=this.getVariableForExportName(t);if(s instanceof vt&&(s=s.getOriginalVariable()),!s||!(s.included||s instanceof be))continue;const i=e.get(s);i?i.push(t):e.set(s,[t])}return this.exportNamesByVariable=e}getExports(){return Object.keys(this.exports)}getReexports(){if(this.transitiveReexports)return this.transitiveReexports;this.transitiveReexports=[];const e=new Set;for(const t in this.reexportDescriptions)e.add(t);for(const t of this.exportAllModules)if(t instanceof Ve)e.add("*"+t.id);else for(const s of[...t.getReexports(),...t.getExports()])"default"!==s&&e.add(s);return this.transitiveReexports=[...e]}getRenderedExports(){const e=[],t=[];for(const s in this.exports){const i=this.getVariableForExportName(s);(i&&i.included?e:t).push(s)}return{renderedExports:e,removedExports:t}}getVariableForExportName(e,t,s){if("*"===e[0]){if(1===e.length)return this.namespace;return this.graph.modulesById.get(e.slice(1)).getVariableForExportName("*")}const i=this.reexportDescriptions[e];if(i){const e=fi(i.module,i.localName,!1,s);return e||di(i.localName,this,i.module.id,i.start)}const n=this.exports[e];if(n){if(n===pi)return this.exportShimVariable;const e=n.localName;return this.traceVariable(e)}if("default"!==e)for(const t of this.exportAllModules){const i=fi(t,e,!0,s);if(i)return i}if(!t){if(this.syntheticNamedExports){let t=this.syntheticExports.get(e);if(!t){const s=this.getDefaultExport();return t=new At(this.astContext,e,s),this.syntheticExports.set(e,t),t}return t}if(this.options.shimMissingExports)return this.shimMissingExport(e),this.exportShimVariable}return null}hasEffects(){return this.ast.included&&this.ast.hasEffects(We())}include(){const e=Fe();this.ast.shouldBeIncluded(e)&&this.ast.include(e,!1)}includeAllExports(){this.isExecuted||(this.graph.needsTreeshakingPass=!0,Be(this));for(const e of this.getExports()){const t=this.getVariableForExportName(e);t.deoptimizePath(F),t.included||(t.include(),this.graph.needsTreeshakingPass=!0)}for(const e of this.getReexports()){const t=this.getVariableForExportName(e);t.deoptimizePath(F),t.included||(t.include(),this.graph.needsTreeshakingPass=!0),t instanceof be&&(t.module.reexported=!0)}}includeAllInBundle(){this.ast.include(Fe(),!0)}isIncluded(){return this.ast.included||this.namespace.included}linkImports(){this.addModulesToImportDescriptions(this.importDescriptions),this.addModulesToImportDescriptions(this.reexportDescriptions);for(const e in this.exports)"default"!==e&&(this.exportsAll[e]=this.id);const e=[];for(const t of this.exportAllSources){const s=this.graph.modulesById.get(this.resolvedIds[t].id);if(s instanceof Ve)e.push(s);else{this.exportAllModules.push(s);for(const e in s.exportsAll)e in this.exportsAll?this.options.onwarn(jt(e,this,s)):this.exportsAll[e]=s.exportsAll[e]}}this.exportAllModules.push(...e)}render(e){const t=this.magicString.clone();return this.ast.render(t,e),this.usesTopLevelAwait=this.astContext.usesTopLevelAwait,t}setSource({alwaysRemovedCode:e,ast:t,code:s,customTransformCache:i,moduleSideEffects:n,originalCode:r,originalSourcemap:a,resolvedIds:o,sourcemapChain:h,syntheticNamedExports:l,transformDependencies:c,transformFiles:u}){if(this.code=s,this.originalCode=r,this.originalSourcemap=a,this.sourcemapChain=h,u&&(this.transformFiles=u),this.transformDependencies=c,this.customTransformCache=i,"boolean"==typeof n&&(this.moduleSideEffects=n),"boolean"==typeof l&&(this.syntheticNamedExports=l),oi("generate ast",3),this.alwaysRemovedCode=e||[],t)this.esTreeAst=t;else{this.esTreeAst=function(e,t,s){try{return t.parse(e.code,{...s,onComment:(t,s,i,n)=>e.comments.push({block:t,text:s,start:i,end:n})})}catch(t){let s=t.message.replace(/ \(\d+:\d+\)$/,"");return e.id.endsWith(".json")?s+=" (Note that you need @rollup/plugin-json to import JSON files)":e.id.endsWith(".js")||(s+=" (Note that you need plugins to import files that are not JavaScript)"),e.error({code:"PARSE_ERROR",message:s,parserError:t},t.pos)}}(this,this.graph.acornParser,this.options.acorn);for(const e of this.comments)!e.block&&Qs.test(e.text)&&this.alwaysRemovedCode.push([e.start,e.end]);d=this.comments,Hs(this.esTreeAst,{commentIndex:0,commentNodes:d.filter(Xs)})}var d;hi("generate ast",3),this.resolvedIds=o||Object.create(null);const p=this.id;this.magicString=new x(s,{filename:this.excludeFromSourcemap?null:p,indentExclusionRanges:[]});for(const[e,t]of this.alwaysRemovedCode)this.magicString.remove(e,t);oi("analyse ast",3),this.astContext={addDynamicImport:this.addDynamicImport.bind(this),addExport:this.addExport.bind(this),addImport:this.addImport.bind(this),addImportMeta:this.addImportMeta.bind(this),code:s,deoptimizationTracker:this.graph.deoptimizationTracker,error:this.error.bind(this),fileName:p,getExports:this.getExports.bind(this),getModuleExecIndex:()=>this.execIndex,getModuleName:this.basename.bind(this),getReexports:this.getReexports.bind(this),importDescriptions:this.importDescriptions,includeAndGetAdditionalMergedNamespaces:this.includeAndGetAdditionalMergedNamespaces.bind(this),includeDynamicImport:this.includeDynamicImport.bind(this),includeVariable:this.includeVariable.bind(this),magicString:this.magicString,module:this,moduleContext:this.context,nodeConstructors:Ws,options:this.options,traceExport:this.getVariableForExportName.bind(this),traceVariable:this.traceVariable.bind(this),usesTopLevelAwait:!1,warn:this.warn.bind(this)},this.scope=new Ds(this.graph.scope,this.astContext),this.namespace=new St(this.astContext,this.syntheticNamedExports),this.ast=new Ls(this.esTreeAst,{type:"Module",context:this.astContext},this.scope),hi("analyse ast",3)}toJSON(){return{alwaysRemovedCode:this.alwaysRemovedCode,ast:this.esTreeAst,code:this.code,customTransformCache:this.customTransformCache,dependencies:Array.from(this.dependencies,Us),id:this.id,moduleSideEffects:this.moduleSideEffects,originalCode:this.originalCode,originalSourcemap:this.originalSourcemap,resolvedIds:this.resolvedIds,sourcemapChain:this.sourcemapChain,syntheticNamedExports:this.syntheticNamedExports,transformDependencies:this.transformDependencies,transformFiles:this.transformFiles}}traceVariable(e){const t=this.scope.variables.get(e);if(t)return t;if(e in this.importDescriptions){const t=this.importDescriptions[e],s=t.module;if(s instanceof mi&&"*"===t.name)return s.namespace;const i=s.getVariableForExportName(t.name);return i||di(t.name,this,s.id,t.start)}return null}warn(e,t){this.addLocationToLogProps(e,t),this.options.onwarn(e)}addDynamicImport(e){let t=e.source;t instanceof Os?1===t.quasis.length&&t.quasis[0].value.cooked&&(t=t.quasis[0].value.cooked):t instanceof ds&&"string"==typeof t.value&&(t=t.value),this.dynamicImports.push({node:e,resolution:null,argument:t})}addExport(e){if(e instanceof xt)this.exports.default={identifier:e.variable.getAssignedVariableName(),localName:"default"};else if(e instanceof as){const t=e.source.value;if(this.sources.add(t),e.exported){const s=e.exported.name;this.reexportDescriptions[s]={localName:"*",module:null,source:t,start:e.start}}else this.exportAllSources.add(t)}else if(e.source instanceof ds){const t=e.source.value;this.sources.add(t);for(const s of e.specifiers){const e=s.exported.name;this.reexportDescriptions[e]={localName:s.local.name,module:null,source:t,start:s.start}}}else if(e.declaration){const t=e.declaration;if(t instanceof Fs)for(const e of t.declarations)for(const t of rs(e.id))this.exports[t]={identifier:null,localName:t};else{const e=t.id.name;this.exports[e]={identifier:null,localName:e}}}else for(const t of e.specifiers){const e=t.local.name,s=t.exported.name;this.exports[s]={identifier:null,localName:e}}}addImport(e){const t=e.source.value;this.sources.add(t);for(const s of e.specifiers){const e="ImportDefaultSpecifier"===s.type,i="ImportNamespaceSpecifier"===s.type,n=e?"default":i?"*":s.imported.name;this.importDescriptions[s.local.name]={module:null,name:n,source:t,start:s.start}}}addImportMeta(e){this.importMetas.push(e)}addLocationToLogProps(e,t){e.id=this.id,e.pos=t;let s=this.code,{column:i,line:n}=Ge(s,t,{offsetLine:1});try{({column:i,line:n}=function(e,t){const s=e.filter(e=>e.mappings);for(;s.length>0;){const e=s.pop(),i=e.mappings[t.line-1];let n=!1;if(void 0!==i)for(const s of i)if(s[0]>=t.column){if(1===s.length)break;t={column:s[3],line:s[2]+1,name:5===s.length?e.names[s[4]]:void 0,source:e.sources[s[1]]},n=!0;break}if(!n)throw new Error("Can't resolve original location of error.")}return t}(this.sourcemapChain,{column:i,line:n})),s=this.originalCode}catch(e){this.options.onwarn({code:"SOURCEMAP_ERROR",id:this.id,loc:{column:i,file:this.id,line:n},message:"Error when using sourcemap for reporting an error: "+e.message,pos:t})}Ft(e,{column:i,line:n},s,this.id)}addModulesToImportDescriptions(e){for(const t of Object.keys(e)){const s=e[t],i=this.resolvedIds[s.source].id;s.module=this.graph.modulesById.get(i)}}includeAndGetAdditionalMergedNamespaces(){const e=[];for(const t of this.exportAllModules)if(t instanceof Ve){const s=t.getVariableForExportName("*");s.include(),this.imports.add(s),e.push(s)}else if(t.syntheticNamedExports){const s=t.getDefaultExport();s.include(),this.imports.add(s),e.push(s)}return e}includeDynamicImport(e){const t=this.dynamicImports.find(t=>t.node===e).resolution;t instanceof mi&&(t.includedDynamicImporters.push(this),t.includeAllExports())}includeVariable(e){const t=e.module;e.included||(e.include(),this.graph.needsTreeshakingPass=!0),t&&t!==this&&this.imports.add(e)}shimMissingExport(e){this.options.onwarn({code:"SHIMMED_EXPORT",exporter:Dt(this.id),exportName:e,message:`Missing export "${e}" has been shimmed in module ${Dt(this.id)}.`}),this.exports[e]=pi}}class gi{constructor(e,t){this.isOriginal=!0,this.filename=e,this.content=t}traceSegment(e,t,s){return{line:e,column:t,name:s,source:this}}}class yi{constructor(e,t){this.sources=t,this.names=e.names,this.mappings=e.mappings}traceMappings(){const e=[],t=[],s=[],i=[];for(const n of this.mappings){const r=[];for(const i of n){if(1==i.length)continue;const n=this.sources[i[1]];if(!n)continue;const a=n.traceSegment(i[2],i[3],5===i.length?this.names[i[4]]:"");if(a){let n=e.lastIndexOf(a.source.filename);if(-1===n)n=e.length,e.push(a.source.filename),t[n]=a.source.content;else if(null==t[n])t[n]=a.source.content;else if(null!=a.source.content&&t[n]!==a.source.content)return Bt({message:"Multiple conflicting contents for sourcemap source "+a.source.filename});const o=[i[0],n,a.line,a.column];if(a.name){let e=s.indexOf(a.name);-1===e&&(e=s.length,s.push(a.name)),o[4]=e}r.push(o)}}i.push(r)}return{sources:e,sourcesContent:t,names:s,mappings:i}}traceSegment(e,t,s){const i=this.mappings[e];if(!i)return null;let n=0,r=i.length-1;for(;n<=r;){const e=n+r>>1,a=i[e];if(a[0]===t){if(1==a.length)return null;const e=this.sources[a[1]];return e?e.traceSegment(a[2],a[3],5===a.length?this.names[a[4]]:s):null}a[0]>t?r=e-1:n=e+1}return null}}function xi(e){return function(t,s){return s.mappings?new yi(s,[t]):(e({code:"SOURCEMAP_BROKEN",message:`Sourcemap is likely to be incorrect: a plugin (${s.plugin}) was used to transform files, but didn't generate a sourcemap for the transformation. Consult the plugin documentation for help`,plugin:s.plugin,url:"https://rollupjs.org/guide/en/#warning-sourcemap-is-likely-to-be-incorrect"}),new yi({mappings:[],names:[]},[t]))}}function Ei(e,t,s,i,n){let r;if(s){const t=s.sources,i=s.sourcesContent||[],n=Le(e)||".",a=s.sourceRoot||".",o=t.map((e,t)=>new gi(De(n,a,e),i[t]));r=new yi(s,o)}else r=new gi(e,t);return i.reduce(n,r)}var vi=bi;function bi(e,t){if(!e)throw new Error(t||"Assertion failed")}function Si(e,t){return 55296==(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1)))}function Ai(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function Pi(e){return 1===e.length?"0"+e:e}function Ci(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}bi.equal=function(e,t,s){if(e!=t)throw new Error(s||"Assertion failed: "+e+" != "+t)};var ki={inherits:function(e,t,s){return e(s={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}()}},s.exports),s.exports}((function(e){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var s=function(){};s.prototype=t.prototype,e.prototype=new s,e.prototype.constructor=e}}})),toArray:function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var s=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),n=0;n>6|192,s[i++]=63&r|128):Si(e,n)?(r=65536+((1023&r)<<10)+(1023&e.charCodeAt(++n)),s[i++]=r>>18|240,s[i++]=r>>12&63|128,s[i++]=r>>6&63|128,s[i++]=63&r|128):(s[i++]=r>>12|224,s[i++]=r>>6&63|128,s[i++]=63&r|128)}else for(n=0;n>>0}return r},split32:function(e,t){for(var s=new Array(4*e.length),i=0,n=0;i>>24,s[n+1]=r>>>16&255,s[n+2]=r>>>8&255,s[n+3]=255&r):(s[n+3]=r>>>24,s[n+2]=r>>>16&255,s[n+1]=r>>>8&255,s[n]=255&r)}return s},rotr32:function(e,t){return e>>>t|e<<32-t},rotl32:function(e,t){return e<>>32-t},sum32:function(e,t){return e+t>>>0},sum32_3:function(e,t,s){return e+t+s>>>0},sum32_4:function(e,t,s,i){return e+t+s+i>>>0},sum32_5:function(e,t,s,i,n){return e+t+s+i+n>>>0},sum64:function(e,t,s,i){var n=e[t],r=i+e[t+1]>>>0,a=(r>>0,e[t+1]=r},sum64_hi:function(e,t,s,i){return(t+i>>>0>>0},sum64_lo:function(e,t,s,i){return t+i>>>0},sum64_4_hi:function(e,t,s,i,n,r,a,o){var h=0,l=t;return h+=(l=l+i>>>0)>>0)>>0)>>0},sum64_4_lo:function(e,t,s,i,n,r,a,o){return t+i+r+o>>>0},sum64_5_hi:function(e,t,s,i,n,r,a,o,h,l){var c=0,u=t;return c+=(u=u+i>>>0)>>0)>>0)>>0)>>0},sum64_5_lo:function(e,t,s,i,n,r,a,o,h,l){return t+i+r+o+l>>>0},rotr64_hi:function(e,t,s){return(t<<32-s|e>>>s)>>>0},rotr64_lo:function(e,t,s){return(e<<32-s|t>>>s)>>>0},shr64_hi:function(e,t,s){return e>>>s},shr64_lo:function(e,t,s){return(e<<32-s|t>>>s)>>>0}};function wi(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}var Ni=wi;wi.prototype.update=function(e,t){if(e=ki.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var s=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-s,e.length),0===this.pending.length&&(this.pending=null),e=ki.join32(e,0,e.length-s,this.endian);for(var i=0;i>>24&255,i[n++]=e>>>16&255,i[n++]=e>>>8&255,i[n++]=255&e}else for(i[n++]=255&e,i[n++]=e>>>8&255,i[n++]=e>>>16&255,i[n++]=e>>>24&255,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,r=8;r>>3},g1_256:function(e){return Ii(e,17)^Ii(e,19)^e>>>10}},Ri=ki.sum32,Oi=ki.sum32_4,Di=ki.sum32_5,Vi=Li.ch32,Bi=Li.maj32,Fi=Li.s0_256,Wi=Li.s1_256,Ui=Li.g0_256,zi=Li.g1_256,ji=_i.BlockHash,Gi=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function Hi(){if(!(this instanceof Hi))return new Hi;ji.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=Gi,this.W=new Array(64)}ki.inherits(Hi,ji);var qi=Hi;Hi.blockSize=512,Hi.outSize=256,Hi.hmacStrength=192,Hi.padLength=64,Hi.prototype._update=function(e,t){for(var s=this.W,i=0;i<16;i++)s[i]=e[t+i];for(;iqi(),Xi={amd:Ji,cjs:Ji,es:function(e,t,s,i,n,r,a){if(n)for(const t of s)t.variableName=O(t.variableName,e);Qi(e,t,s,i);for(const t of a)t.setSafeName(O(t.name,e))},iife:Ji,system:Qi,umd:Ji};function Yi(e,t,s,i,n,r,a,o,h,l){for(const t of e)t.scope.addUsedOutsideNames(i,n,l);!function(e,t){for(const s of t){for(const t of s.scope.variables.values())t.included&&!(t.renderBaseName||t instanceof vt&&t.getOriginalVariable()!==t)&&t.setRenderNames(null,O(t.name,e));const t=s.namespace;t.included&&t.setRenderNames(null,O(t.name,e))}}(i,e),Xi[n](i,s,t,r,a,o,h);for(const t of e)t.scope.deconflict(n,l)}function Qi(e,t,s,i){for(const s of t){const t=s.module,n=s.name;let r;r=t instanceof Ve&&("*"===n||"default"===n)?"default"===n&&i&&t.exportsNamespace?t.variableName+"__default":t.variableName:n,s.setRenderNames(null,O(r,e))}}function Ji(e,t,s,i,n,r){for(const t of s)t.variableName=O(t.variableName,e);for(const e of t){const t=e.module;if(t instanceof Ve){const s=e.name;"default"===s&&i&&(t.exportsNamespace||t.exportsNames)?e.setRenderNames(null,t.variableName+"__default"):"*"===s||"default"===s?e.setRenderNames(null,t.variableName):e.setRenderNames(t.variableName,null)}else{const s=r.get(t);"default"===s.exportMode||n&&e.isNamespace?e.setRenderNames(null,s.variableName):e.setRenderNames(s.variableName,s.getVariableExportName(e))}}}const Zi=/[\\'\r\n\u2028\u2029]/,en=/(['\r\n\u2028\u2029])/g,tn=/\\/g;function sn(e){return e.match(Zi)?e.replace(tn,"\\\\").replace(en,"\\$1"):e}const nn=(e,t)=>e.execIndex>t.execIndex?1:-1;function rn(e){e.sort(nn)}function an(e,t,s){const i=[Dt(e.id)];let n=t;for(;n!==e;)i.push(Dt(n.id)),n=s.get(n);return i.push(i[0]),i.reverse(),i}function on(e,{exports:t,name:s,format:i},n,r){const a=e.getExportNames();if("default"===t){if(1!==a.length||"default"!==a[0])return Bt(Ut("default",a,n))}else if("none"===t&&a.length)return Bt(Ut("none",a,n));return"auto"===t&&(0===a.length?t="none":1===a.length&&"default"===a[0]?t="default":("es"!==i&&-1!==a.indexOf("default")&&r(function(e,t){return{code:Wt.MIXED_EXPORTS,id:e,message:`Entry module "${Dt(e)}" is using named and default exports together. Consumers of your bundle will have to use \`${t||"chunk"}["default"]\` to access the default export, which may not be what you want. Use \`output.exports: "named"\` to disable this warning`,url:"https://rollupjs.org/guide/en/#output-exports"}}(n,s)),t="named")),t}function hn(e){const t=e.split("\n"),s=t.filter(e=>/^\t+/.test(e)),i=t.filter(e=>/^ {2,}/.test(e));if(0===s.length&&0===i.length)return null;if(s.length>=i.length)return"\t";const n=i.reduce((e,t)=>{const s=/^ +/.exec(t)[0].length;return Math.min(s,e)},1/0);return new Array(n+1).join(" ")}function ln(e){if(!e)return null;if("string"==typeof e&&(e=JSON.parse(e)),""===e.mappings)return{mappings:[],names:[],sources:[],version:3};let s;return s="string"==typeof e.mappings?function(e){for(var s=[],i=[],r=[0,0,0,0,0],a=0,o=0,h=0,l=0;o>>=1,p&&(l=0===l?-2147483648:-l),r[a]+=l,a++,l=h=0}}}return n(i,r,a),s.push(i),s}(e.mappings):e.mappings,{...e,mappings:s}}function cn(e,t,s){return Vt(e)?e.replace(/\[(\w+)\]/g,(e,i)=>{if(!s.hasOwnProperty(i))return Bt(Gt(`"[${i}]" is not a valid placeholder in "${t}" pattern.`));const n=s[i]();return Vt(n)?n:Bt(Gt(`Invalid substitution "${n}" for placeholder "[${i}]" in "${t}" pattern, can be neither absolute nor relative path.`))}):Bt(Gt(`Invalid pattern "${e}" for "${t}", patterns can be neither absolute nor relative paths and must not contain invalid characters.`))}function un(e,t){const s=new Set(Object.keys(t).map(e=>e.toLowerCase()));if(!s.has(e.toLocaleLowerCase()))return e;const i=Re(e);e=e.substr(0,e.length-i.length);let n,r=1;for(;s.has((n=e+ ++r+i).toLowerCase()););return n}const dn=[".js",".jsx",".ts",".tsx"];function pn(e,t,s,i){const n="function"==typeof t?t(e.id):t[e.id];return n||(s?(i({code:"MISSING_GLOBAL_NAME",guess:e.variableName,message:`No name was provided for external module '${e.id}' in output.globals – guessing '${e.variableName}'`,source:e.id}),e.variableName):void 0)}class fn{constructor(e,t,s,i,n,r,a,o){this.orderedModules=e,this.inputOptions=t,this.outputOptions=s,this.unsetOptions=i,this.modulesById=n,this.chunkByModule=r,this.facadeChunkByModule=a,this.manualChunkAlias=o,this.entryModules=[],this.exportMode="named",this.facadeModule=null,this.id=null,this.dependencies=new Set,this.dynamicDependencies=new Set,this.dynamicEntryModules=[],this.exportNamesByVariable=null,this.exports=new Set,this.exportsByName=null,this.fileName=null,this.implicitEntryModules=[],this.implicitlyLoadedBefore=new Set,this.imports=new Set,this.indentString=void 0,this.isEmpty=!0,this.name=null,this.needsExportsShim=!1,this.renderedDependencies=null,this.renderedExports=null,this.renderedHash=void 0,this.renderedModuleSources=new Map,this.renderedSource=null,this.sortedExportNames=null,this.strictFacade=!1,this.usedModules=void 0,this.execIndex=e.length>0?e[0].execIndex:1/0;const h=new Set(e);for(const t of e){this.isEmpty&&t.isIncluded()&&(this.isEmpty=!1),(t.isEntryPoint||s.preserveModules)&&this.entryModules.push(t);for(const e of t.includedDynamicImporters)h.has(e)||this.dynamicEntryModules.push(t);t.implicitlyLoadedAfter.size>0&&this.implicitEntryModules.push(t)}this.variableName=we(this.generateVariableName())}static generateFacade(e,t,s,i,n,r,a,o){const h=new fn([],e,t,s,i,n,r,null);h.assignFacadeName(o,a),r.has(a)||r.set(a,h);for(const e of a.getDependenciesToBeIncluded())h.dependencies.add(e instanceof mi?n.get(e):e);return!h.dependencies.has(n.get(a))&&a.moduleSideEffects&&a.hasEffects()&&h.dependencies.add(n.get(a)),h.ensureReexportsAreAvailableForModule(a),h.facadeModule=a,h.strictFacade=!0,h}canModuleBeFacade(e,t){const s=e.getExportNamesByVariable();for(const t of this.exports)if(!s.has(t))return 0===s.size&&e.isUserDefinedEntryPoint&&"strict"===e.preserveSignature&&this.unsetOptions.has("preserveEntrySignatures")&&this.inputOptions.onwarn({code:"EMPTY_FACADE",id:e.id,message:`To preserve the export signature of the entry module "${Dt(e.id)}", an empty facade chunk was created. This often happens when creating a bundle for a web app where chunks are placed in script tags and exports are ignored. In this case it is recommended to set "preserveEntrySignatures: false" to avoid this and reduce the number of chunks. Otherwise if this is intentional, set "preserveEntrySignatures: 'strict'" explicitly to silence this warning.`,url:"https://rollupjs.org/guide/en/#preserveentrysignatures"}),!1;for(const i of t)if(!s.has(i)&&i.module!==e)return!1;return!0}generateExports(){this.sortedExportNames=null,this.exportsByName=Object.create(null),this.exportNamesByVariable=new Map;const e=new Set(this.exports);if(null!==this.facadeModule&&(!1!==this.facadeModule.preserveSignature||this.strictFacade)){const t=this.facadeModule.getExportNamesByVariable();for(const[s,i]of t){this.exportNamesByVariable.set(s,[...i]);for(const e of i)this.exportsByName[e]=s;e.delete(s)}}this.outputOptions.minifyInternalExports?function(e,t,s){let i=0;for(const n of e){let e=n.name[0];if(t[e])do{e=L(++i),49===e.charCodeAt(0)&&(i+=9*64**(e.length-1),e=L(i))}while(R[e]||t[e]);t[e]=n,s.set(n,[e])}}(e,this.exportsByName,this.exportNamesByVariable):function(e,t,s){for(const i of e){let e=0,n=i.name;for(;t[n];)n=i.name+"$"+ ++e;t[n]=i,s.set(i,[n])}}(e,this.exportsByName,this.exportNamesByVariable),(this.outputOptions.preserveModules||this.facadeModule&&this.facadeModule.isEntryPoint)&&(this.exportMode=on(this,this.outputOptions,this.facadeModule.id,this.inputOptions.onwarn))}generateFacades(){var e;const t=[],s=new Set([...this.entryModules,...this.implicitEntryModules]),i=new Set(this.dynamicEntryModules.map(e=>e.namespace));for(const e of s)if(e.preserveSignature)for(const t of e.getExportNamesByVariable().keys())i.add(t);for(const e of s){const s=Array.from(e.userChunkNames,e=>({name:e}));0===s.length&&e.isUserDefinedEntryPoint&&s.push({}),s.push(...Array.from(e.chunkFileNames,e=>({fileName:e}))),0===s.length&&s.push({}),this.facadeModule||!this.outputOptions.preserveModules&&"strict"===e.preserveSignature&&!this.canModuleBeFacade(e,i)||(this.facadeModule=e,this.facadeChunkByModule.set(e,this),e.preserveSignature&&(this.strictFacade="strict"===e.preserveSignature,this.ensureReexportsAreAvailableForModule(e)),this.assignFacadeName(s.shift(),e));for(const i of s)t.push(fn.generateFacade(this.inputOptions,this.outputOptions,this.unsetOptions,this.modulesById,this.chunkByModule,this.facadeChunkByModule,e,i))}for(const t of this.dynamicEntryModules)!this.facadeModule&&this.canModuleBeFacade(t,i)?(this.facadeModule=t,this.facadeChunkByModule.set(t,this),this.strictFacade=!0,this.assignFacadeName({},t)):this.facadeModule===t&&!this.strictFacade&&this.canModuleBeFacade(t,i)?this.strictFacade=!0:(null===(e=this.facadeChunkByModule.get(t))||void 0===e?void 0:e.strictFacade)||(t.namespace.include(),this.exports.add(t.namespace));return t}generateId(e,t,s,i,n){if(null!==this.fileName)return this.fileName;const[r,a]=this.facadeModule&&this.facadeModule.isUserDefinedEntryPoint?[t.entryFileNames,"output.entryFileNames"]:[t.chunkFileNames,"output.chunkFileNames"];return un(cn(r,a,{format:()=>t.format,hash:()=>i?this.computeContentHashWithDependencies(e,t,s,n):"[hash]",name:()=>this.getChunkName()}),s)}generateIdPreserveModules(e,t,s,i){const n=this.orderedModules[0].id,r=Rt(n);let a;if(Ie(n)){const s=Re(n),o=i.has("entryFileNames")?dn.includes(s)?"[name].js":"[name][extname].js":t.entryFileNames;a=b(e,`${Le(r)}/${cn(o,"output.entryFileNames",{ext:()=>s.substr(1),extname:()=>s,format:()=>t.format,name:()=>this.getChunkName()})}`)}else a="_virtual/"+Me(r);return un(Te(a),s)}getChunkName(){return this.name||(this.name=Rt(this.getFallbackChunkName()))}getExportNames(){return this.sortedExportNames||(this.sortedExportNames=Object.keys(this.exportsByName).sort())}getPrerenderedChunk(){const e=this.facadeModule,t=this.getChunkName.bind(this);return{code:void 0,dynamicImports:Array.from(this.dynamicDependencies,Us),exports:this.getExportNames(),facadeModuleId:e&&e.id,fileName:void 0,implicitlyLoadedBefore:Array.from(this.implicitlyLoadedBefore,Us),imports:Array.from(this.dependencies,Us),isDynamicEntry:this.dynamicEntryModules.length>0,isEntry:null!==e&&e.isEntryPoint,isImplicitEntry:this.implicitEntryModules.length>0,map:void 0,modules:this.renderedModules,get name(){return t()},type:"chunk"}}getRenderedHash(e){if(this.renderedHash)return this.renderedHash;const t=Ki(),s=e.hookReduceValueSync("augmentChunkHash","",[this.getPrerenderedChunk()],(e,t)=>(t&&(e+=t),e));return t.update(s),t.update(this.renderedSource.toString()),t.update(this.getExportNames().map(e=>{const t=this.exportsByName[e];return`${Dt(t.module.id).replace(/\\/g,"/")}:${t.name}:${e}`}).join(",")),this.renderedHash=t.digest("hex")}getVariableExportName(e){return this.outputOptions.preserveModules&&e instanceof St?"*":this.exportNamesByVariable.get(e)[0]}link(){for(const e of this.orderedModules)this.addDependenciesToChunk(e.getDependenciesToBeIncluded(),this.dependencies),this.addDependenciesToChunk(e.dynamicDependencies,this.dynamicDependencies),this.addDependenciesToChunk(e.implicitlyLoadedBefore,this.implicitlyLoadedBefore),this.setUpChunkImportsAndExportsForModule(e)}preRender(e,t,s){const i=new v({separator:e.compact?"":"\n\n"});this.usedModules=[],this.indentString=function(e,t){if(!0!==t.indent)return t.indent;for(let t=0;te.reexports&&0!==e.reexports.length);let o=!1;const h=new Set;for(const e of this.orderedModules){e.usesTopLevelAwait&&(o=!0);const t=e.scope.accessedGlobalVariablesByFormat,s=t&&t.get(n);if(s)for(const e of s)h.add(e)}if(o&&"es"!==n&&"system"!==n)return Bt({code:"INVALID_TLA_FORMAT",message:`Module format ${n} does not support top-level await. Use the "es" or "system" output formats rather.`});const c=r(this.renderedSource,{accessedGlobals:h,dependencies:[...this.renderedDependencies.values()],exports:this.renderedExports,hasExports:a,indentString:this.indentString,intro:t.intro,isEntryModuleFacade:this.outputOptions.preserveModules||null!==this.facadeModule&&this.facadeModule.isEntryPoint,namedExportsMode:"default"!==this.exportMode,outro:t.outro,usesTopLevelAwait:o,varOrConst:e.preferConst?"const":"var",warn:this.inputOptions.onwarn},e);t.banner&&c.prepend(t.banner),t.footer&&c.append(t.footer);const u=c.toString();hi("render format",2);let d=null;const p=[];let f=await function({code:e,options:t,outputPluginDriver:s,renderChunk:i,sourcemapChain:n}){return s.hookReduceArg0("renderChunk",[e,i,t],(e,t,s)=>{if(null==t)return e;if("string"==typeof t&&(t={code:t,map:void 0}),null!==t.map){const e=ln(t.map);n.push(e||{missing:!0,plugin:s.name})}return t.code})}({code:u,options:e,outputPluginDriver:i,renderChunk:s,sourcemapChain:p});if(e.sourcemap){let t;oi("sourcemap",2),t=e.file?De(e.sourcemapFile||e.file):e.dir?De(e.dir,this.id):De(this.id);const s=c.generateDecodedMap({});d=function(e,t,s,i,n,r){const a=xi(r),o=s.filter(e=>!e.excludeFromSourcemap).map(e=>Ei(e.id,e.originalCode,e.originalSourcemap,e.sourcemapChain,a));let h=new yi(t,o);h=i.reduce(a,h);let{sources:c,sourcesContent:u,names:d,mappings:p}=h.traceMappings();if(e){const t=Le(e);c=c.map(e=>Oe(t,e)),e=Me(e)}return u=n?null:u,new l({file:e,sources:c,sourcesContent:u,names:d,mappings:p})}(t,s,this.usedModules,p,e.sourcemapExcludeSources,this.inputOptions.onwarn),d.sources=d.sources.map(s=>{const{sourcemapPathTransform:i}=e;if(i){const e=i(s,t+".map");return"string"!=typeof e&&Bt(Gt("sourcemapPathTransform function must return a string.")),e}return s}).map(Te),hi("sourcemap",2)}return!0!==e.compact&&"\n"!==f[f.length-1]&&(f+="\n"),{code:f,map:d}}addDependenciesToChunk(e,t){for(const s of e)if(s instanceof mi){const e=this.chunkByModule.get(s);e&&e!==this&&t.add(e)}else t.add(s)}assignFacadeName({fileName:e,name:t},s){e?this.fileName=e:this.name=Rt(t||s.chunkName||Ot(s.id))}computeContentHashWithDependencies(e,t,s,i){const n=Ki();n.update([e.intro,e.outro,e.banner,e.footer].map(e=>e||"").join(":")),n.update(t.format);const r=new Set([this]);for(const a of r)if(a instanceof Ve?n.update(":"+a.renderPath):(n.update(a.getRenderedHash(i)),n.update(a.generateId(e,t,s,!1,i))),!(a instanceof Ve))for(const e of[...a.dependencies,...a.dynamicDependencies])r.add(e);return n.digest("hex").substr(0,8)}ensureReexportsAreAvailableForModule(e){const t=e.getExportNamesByVariable();for(const e of t.keys()){const t=e instanceof At,s=t?e.getBaseVariable():e;if(!(s instanceof St&&this.outputOptions.preserveModules)){const e=s.module;if(e instanceof mi){const i=this.chunkByModule.get(e);i&&i!==this&&(i.exports.add(s),t&&this.imports.add(s))}}}}finaliseDynamicImports(e){const t="amd"===e.format;for(const[s,i]of this.renderedModuleSources)for(const{node:n,resolution:r}of s.dynamicImports){const s=this.chunkByModule.get(r),a=this.facadeChunkByModule.get(r);if(!r||!n.included||s===this)continue;const o=r instanceof mi?`'${this.getRelativePath((a||s).id,t)}'`:r instanceof Ve?`'${r.renormalizeRenderPath?this.getRelativePath(r.renderPath,t):r.renderPath}'`:r;n.renderFinalResolution(i,o,r instanceof mi&&!(null==a?void 0:a.strictFacade)&&s.exportNamesByVariable.get(r.namespace)[0],e)}}finaliseImportMetas(e,t){for(const[s,i]of this.renderedModuleSources)for(const n of s.importMetas)n.renderFinalMechanism(i,this.id,e,t)}generateVariableName(){if(this.manualChunkAlias)return this.manualChunkAlias;const e=this.entryModules[0]||this.implicitEntryModules[0]||this.dynamicEntryModules[0]||this.orderedModules[this.orderedModules.length-1];return e?e.chunkName||Ot(e.id):"chunk"}getChunkDependencyDeclarations(e){const t=new Map;for(let s of this.getExportNames()){let i,n,r=!1;if("*"===s[0])r=e.externalLiveBindings,i=this.modulesById.get(s.substr(1)),n=s="*";else{const t=this.exportsByName[s];if(t instanceof At)continue;const a=t.module;if(a instanceof mi){if(i=this.chunkByModule.get(a),i===this)continue;n=i.getVariableExportName(t),r=t.isReassigned}else i=a,n=t.name,r=e.externalLiveBindings}let a=t.get(i);a||t.set(i,a=[]),a.push({imported:n,reexported:s,needsLiveBinding:r})}const s=new Set,i=new Map;for(const n of this.dependencies){const r=[];for(const e of this.imports)(e.module instanceof mi?this.chunkByModule.get(e.module)!==n:e.module!==n)||s.has(e)||(s.add(e),r.push({imported:e.module instanceof Ve?e.name:this.chunkByModule.get(e.module).getVariableExportName(e),local:e.getName()}));const a=t.get(n);let o,h,l=!0;n instanceof Ve?(o=n.exportsNames||n.exportsNamespace,h="default"in n.declarations):(o=!0,h=!1,l="default"!==n.exportMode),i.set(n,{exportsDefault:h,exportsNames:o,globalName:n instanceof Ve&&("umd"===e.format||"iife"===e.format)&&pn(n,e.globals,o||h,this.inputOptions.onwarn),id:void 0,imports:r.length>0?r:null,isChunk:n instanceof fn,name:n.variableName,namedExportsMode:l,reexports:a})}return i}getChunkExportDeclarations(e){const t=[];for(const s of this.getExportNames()){if("*"===s[0])continue;const i=this.exportsByName[s];if(!(i instanceof At)){const e=i.module;if(e&&this.chunkByModule.get(e)!==this)continue}let n=null,r=!1,a=!1,o=i.getName();if(i instanceof Ue){i.init===K&&(a=!0);for(const e of i.declarations)if(e.parent instanceof yt||e instanceof xt&&e.declaration instanceof yt){r=!0;break}}else i instanceof At&&(n=o,"es"===e&&"default"!==s&&(o=i.renderName));t.push({exported:s,expression:n,hoisted:r,local:o,uninitialized:a})}return t}getFallbackChunkName(){return this.manualChunkAlias?this.manualChunkAlias:this.fileName?Ot(this.fileName):Ot(this.orderedModules[this.orderedModules.length-1].id)}getRelativePath(e,t){let s=Te(b(Le(this.id),e));return t&&s.endsWith(".js")&&(s=s.slice(0,-3)),".."===s?"../../"+Me(e):""===s?"../"+Me(e):s.startsWith("../")?s:"./"+s}inlineChunkDependencies(e){for(const t of e.dependencies)this.dependencies.has(t)||(this.dependencies.add(t),t instanceof fn&&this.inlineChunkDependencies(t))}prepareDynamicImports(){for(const e of this.orderedModules)for(const{node:t,resolution:s}of e.dynamicImports)if(t.included)if(s instanceof mi){const e=this.chunkByModule.get(s);e===this?t.setInternalResolution(s.namespace):t.setExternalResolution(e.exportMode,s)}else t.setExternalResolution("auto",s)}setExternalRenderPaths(e,t){for(const s of[...this.dependencies,...this.dynamicDependencies])s instanceof Ve&&s.setRenderPath(e,t)}setIdentifierRenderResolutions(e){const t=new Set;for(const s of this.getExportNames()){const i=this.exportsByName[s];i instanceof bt&&(this.needsExportsShim=!0),"es"!==e.format&&"system"!==e.format&&i.isReassigned&&!i.isId?i.setRenderNames("exports",s):i instanceof At?t.add(i):i.setRenderNames(null,null)}const s=new Set;switch(this.needsExportsShim&&s.add("_missingExportShim"),e.format){case"es":break;case"cjs":s.add("_interopDefault").add("require").add("__filename").add("__dirname");case"system":s.add("module");default:s.add("exports")}Yi(this.orderedModules,this.dependencies,this.imports,s,e.format,e.interop,this.outputOptions.preserveModules,this.chunkByModule,t,this.exportNamesByVariable)}setUpChunkImportsAndExportsForModule(e){const t=new Set(e.imports);if(!this.outputOptions.preserveModules){const s=e.namespace;if(s.included){const e=s.getMemberVariables();for(const s of Object.keys(e))t.add(e[s])}}for(let e of t){e instanceof vt&&(e=e.getOriginalVariable()),e instanceof At&&(e=e.getBaseVariable());const t=this.chunkByModule.get(e.module);t!==this&&(this.imports.add(e),!(e instanceof St&&this.outputOptions.preserveModules)&&e.module instanceof mi&&t.exports.add(e))}(e.namespace.included||e.isEntryPoint&&!1!==e.preserveSignature||e.includedDynamicImporters.some(e=>this.chunkByModule.get(e)!==this))&&this.ensureReexportsAreAvailableForModule(e);for(const{node:t,resolution:s}of e.dynamicImports)t.included&&s instanceof mi&&this.chunkByModule.get(s)===this&&!s.namespace.included&&(s.namespace.include(),this.ensureReexportsAreAvailableForModule(s))}}const mn=(e,t)=>t?`${e}\n${t}`:e,gn=(e,t)=>t?`${e}\n\n${t}`:e;function yn(e,t){const s=[],i=new Set(t.keys()),n=Object.create(null);for(const[e,s]of t){xn(e,n[s]=n[s]||[],i)}for(const[e,t]of Object.entries(n))s.push({alias:e,modules:t});const r=new Map,{dependentEntryPointsByModule:a,dynamicEntryModules:o}=function(e){const t=new Set,s=new Map,i=new Set(e);for(const e of i){const n=new Set([e]);for(const r of n){En(s,r).add(e);for(const e of r.getDependenciesToBeIncluded())e instanceof Ve||n.add(e);for(const{resolution:e}of r.dynamicImports)e instanceof mi&&e.includedDynamicImporters.length>0&&(t.add(e),i.add(e));for(const e of r.implicitlyLoadedBefore)t.add(e),i.add(e)}}return{dependentEntryPointsByModule:s,dynamicEntryModules:t}}(e),h=function(e,t){const s=new Map;for(const i of t){const t=En(s,i);for(const s of[...i.includedDynamicImporters,...i.implicitlyLoadedAfter])for(const i of e.get(s))t.add(i)}return s}(a,o),l=new Set(e);function c(e,t){const s=new Set([e]);for(const n of s){const o=En(r,n);if(!t||!u(t,a.get(n))){o.add(e);for(const e of n.getDependenciesToBeIncluded())e instanceof Ve||i.has(e)||s.add(e)}}}function u(e,t){const s=new Set(e);for(const e of s)if(!t.has(e)){if(l.has(e))return!1;const t=h.get(e);for(const e of t)s.add(e)}return!0}for(const t of e)i.has(t)||c(t,null);for(const e of o)i.has(e)||c(e,h.get(e));return s.push(...function(e,t){const s=Object.create(null);for(const[i,n]of t){let t="";for(const s of e)t+=n.has(s)?"X":"_";const r=s[t];r?r.push(i):s[t]=[i]}return Object.keys(s).map(e=>({alias:null,modules:s[e]}))}([...e,...o],r)),s}function xn(e,t,s){const i=new Set([e]);for(const e of i){s.add(e),t.push(e);for(const t of e.dependencies)t instanceof Ve||s.has(t)||i.add(t)}}function En(e,t){const s=e.get(t)||new Set;return e.set(t,s),s}var vn;function bn(e,t,s){e in t&&s(function(e){return{code:Wt.FILE_NAME_CONFLICT,message:`The emitted file "${e}" overwrites a previously emitted file of the same name.`}}(e)),t[e]=Sn}!function(e){e[e.LOAD_AND_PARSE=0]="LOAD_AND_PARSE",e[e.ANALYSE=1]="ANALYSE",e[e.GENERATE=2]="GENERATE"}(vn||(vn={}));const Sn={type:"placeholder"};function An(e,t,s){if(!("string"==typeof e||e instanceof Uint8Array)){const e=t.fileName||t.name||s;return Bt(Gt(`Could not set source for ${"string"==typeof e?`asset "${e}"`:"unnamed asset"}, asset source needs to be a string, Uint8Array or Buffer.`))}return e}function Pn(e,t){return"string"!=typeof e.fileName?Bt((s=e.name||t,{code:Wt.ASSET_NOT_FINALISED,message:`Plugin error - Unable to get file name for asset "${s}". Ensure that the source is set and that generate is called first.`})):e.fileName;var s}function Cn(e,t){var s;const i=e.fileName||e.module&&(null===(s=null==t?void 0:t.get(e.module))||void 0===s?void 0:s.id);return i||Bt((n=e.fileName||e.name,{code:Wt.CHUNK_NOT_GENERATED,message:`Plugin error - Unable to get file name for chunk "${n}". Ensure that generate is called first.`}));var n}class kn{constructor(e,t,s){this.graph=e,this.options=t,this.facadeChunkByModule=null,this.output=null,this.assertAssetsFinalized=()=>{for(const[t,s]of this.filesByReferenceId.entries())if("asset"===s.type&&"string"!=typeof s.fileName)return Bt((e=s.name||t,{code:Wt.ASSET_SOURCE_MISSING,message:`Plugin error creating asset "${e}" - no asset source set.`}));var e},this.emitFile=e=>function(e){return e&&("asset"===e.type||"chunk"===e.type)}(e)?function(e){const t=e.fileName||e.name;return!t||"string"==typeof t&&Vt(t)}(e)?"chunk"===e.type?this.emitChunk(e):this.emitAsset(e):Bt(Gt(`The "fileName" or "name" properties of emitted files must be strings that are neither absolute nor relative paths and do not contain invalid characters, received "${e.fileName||e.name}".`)):Bt(Gt(`Emitted files must be of type "asset" or "chunk", received "${e&&e.type}".`)),this.getFileName=e=>{const t=this.filesByReferenceId.get(e);return t?"chunk"===t.type?Cn(t,this.facadeChunkByModule):Pn(t,e):Bt((s=e,{code:Wt.FILE_NOT_FOUND,message:`Plugin error - Unable to get file name for unknown file "${s}".`}));var s},this.setAssetSource=(e,t)=>{const s=this.filesByReferenceId.get(e);if(!s)return Bt((i=e,{code:Wt.ASSET_NOT_FOUND,message:`Plugin error - Unable to set the source for unknown asset "${i}".`}));var i,n;if("asset"!==s.type)return Bt(Gt(`Asset sources can only be set for emitted assets but "${e}" is an emitted chunk.`));if(void 0!==s.source)return Bt((n=s.name||e,{code:Wt.ASSET_SOURCE_ALREADY_SET,message:`Unable to set the source for asset "${n}", source already set.`}));const r=An(t,s,e);this.output?this.finalizeAsset(s,r,e,this.output):s.source=r},this.setOutputBundle=(e,t,s)=>{this.output={assetFileNames:t,bundle:e},this.facadeChunkByModule=s;for(const e of this.filesByReferenceId.values())e.fileName&&bn(e.fileName,this.output.bundle,this.options.onwarn);for(const[e,t]of this.filesByReferenceId.entries())"asset"===t.type&&void 0!==t.source&&this.finalizeAsset(t,t.source,e,this.output)},this.filesByReferenceId=s?new Map(s.filesByReferenceId):new Map}assignReferenceId(e,t){let s;do{const e=Ki();s?e.update(s):e.update(t),s=e.digest("hex").substr(0,8)}while(this.filesByReferenceId.has(s));return this.filesByReferenceId.set(s,e),s}emitAsset(e){const t=void 0!==e.source?An(e.source,e,null):void 0,s={fileName:e.fileName,name:e.name,source:t,type:"asset"},i=this.assignReferenceId(s,e.fileName||e.name||e.type);return this.output&&(e.fileName&&bn(e.fileName,this.output.bundle,this.options.onwarn),void 0!==t&&this.finalizeAsset(s,t,i,this.output)),i}emitChunk(e){if(this.graph.phase>vn.LOAD_AND_PARSE)return Bt({code:Wt.INVALID_ROLLUP_PHASE,message:"Cannot emit chunks after module loading has finished."});if("string"!=typeof e.id)return Bt(Gt(`Emitted chunks need to have a valid string id, received "${e.id}"`));const t={fileName:e.fileName,module:null,name:e.name||e.id,type:"chunk"};return this.graph.moduleLoader.emitChunk(e).then(e=>t.module=e).catch(()=>{}),this.assignReferenceId(t,e.id)}finalizeAsset(e,t,s,i){const n=e.fileName||function(e,t){for(const s of Object.keys(e)){const i=e[s];if("asset"===i.type&&wn(t,i.source))return s}return null}(i.bundle,t)||function(e,t,s){const i=e||"asset";return un(cn(s.assetFileNames,"output.assetFileNames",{hash(){const e=Ki();return e.update(i),e.update(":"),e.update(t),e.digest("hex").substr(0,8)},ext:()=>Re(i).substr(1),extname:()=>Re(i),name:()=>i.substr(0,i.length-Re(i).length)}),s.bundle)}(e.name,t,i),r={...e,source:t,fileName:n};this.filesByReferenceId.set(s,r);const a=this.options;i.bundle[n]={fileName:n,get isAsset(){return Ht('Accessing "isAsset" on files in the bundle is deprecated, please use "type === \'asset\'" instead',!0,a),!0},source:t,type:"asset"}}}function wn(e,t){if("string"==typeof e)return e===t;if("string"==typeof t)return!1;if("equals"in e)return e.equals(t);if(e.length!==t.length)return!1;for(let s=0;s1&&function(e){if("umd"===e.format||"iife"===e.format)return Bt({code:"INVALID_OPTION",message:"UMD and IIFE output formats are not supported for code-splitting builds."});if("string"==typeof e.file)return Bt({code:"INVALID_OPTION",message:'When building multiple chunks, the "output.dir" option must be used, not "output.file". To inline dynamic imports, set the "inlineDynamicImports" option.'});if(e.sourcemapFile)Bt({code:"INVALID_OPTION",message:'"output.sourcemapFile" is only supported for single-file builds.'})}(this.outputOptions);const s=function(e){if(0===e.length)return"/";if(1===e.length)return Le(e[0]);const t=e.slice(1).reduce((e,t)=>{const s=t.split(/\/+|\\+/);let i;for(i=0;e[i]===s[i]&&i1?t.join("/"):"/"}(function(e){const t=[];for(const s of e)for(const e of s.entryModules)Ie(e.id)&&t.push(e.id);return t}(e));hi("generate chunks",2),oi("render modules",2);const i=await async function(e,t){try{let[s,i,n,r]=await Promise.all([t.hookReduceValue("banner",e.banner(),[],mn),t.hookReduceValue("footer",e.footer(),[],mn),t.hookReduceValue("intro",e.intro(),[],gn),t.hookReduceValue("outro",e.outro(),[],gn)]);return n&&(n+="\n\n"),r&&(r="\n\n"+r),s.length&&(s+="\n"),i.length&&(i="\n"+i),{intro:n,outro:r,banner:s,footer:i}}catch(e){return Bt({code:"ADDON_ERROR",message:`Could not retrieve ${e.hook}. Check configuration of plugin ${e.plugin}.\n\tError Message: ${e.message}`})}}(this.outputOptions,this.pluginDriver);this.prerenderChunks(e,s),hi("render modules",2),await this.addFinalizedChunksToBundle(e,s,i,t)}catch(e){throw await this.pluginDriver.hookParallel("renderError",[e]),e}return await this.pluginDriver.hookSeq("generateBundle",[this.outputOptions,t,e]),this.finaliseAssets(t),hi("GENERATE",1),t}async addFinalizedChunksToBundle(e,t,s,i){this.assignChunkIds(e,t,s,i);for(const t of e){(i[t.id]=t.getPrerenderedChunk()).fileName=t.id}await Promise.all(e.map(e=>{const t=i[e.id];return e.render(this.outputOptions,s,t,this.pluginDriver).then(e=>{t.code=e.code,t.map=e.map})}))}async addManualChunks(e){const t=new Map,s=await Promise.all(Object.keys(e).map(async t=>({alias:t,entries:await this.graph.moduleLoader.addAdditionalModules(e[t])})));for(const{alias:e,entries:i}of s)for(const s of i)In(e,s,t);return t}assignChunkIds(e,t,s,i){const n=[],r=[];for(const t of e)(t.facadeModule&&t.facadeModule.isUserDefinedEntryPoint?n:r).push(t);const a=n.concat(r);for(const e of a)this.outputOptions.file?e.id=Me(this.outputOptions.file):this.outputOptions.preserveModules?e.id=e.generateIdPreserveModules(t,this.outputOptions,i,this.unsetOptions):e.id=e.generateId(s,this.outputOptions,i,!0,this.pluginDriver),i[e.id]=Sn}assignManualChunks(e){const t=new Map,s={getModuleIds:()=>this.graph.modulesById.keys(),getModuleInfo:this.graph.getModuleInfo};for(const i of this.graph.modulesById.values())if(i instanceof mi){const n=e(i.id,s);"string"==typeof n&&In(n,i,t)}return t}finaliseAssets(e){for(const t of Object.keys(e)){const s=e[t];s.type||(Ht('A plugin is directly adding properties to the bundle object in the "generateBundle" hook. This is deprecated and will be removed in a future Rollup version, please use "this.emitFile" instead.',!0,this.inputOptions),s.type="asset")}this.pluginDriver.finaliseAssets()}async generateChunks(){const{manualChunks:e}=this.outputOptions,t="object"==typeof e?await this.addManualChunks(e):this.assignManualChunks(e),s=[],i=new Map;for(const{alias:e,modules:n}of this.outputOptions.inlineDynamicImports?[{alias:null,modules:_n(this.graph.modulesById)}]:this.outputOptions.preserveModules?_n(this.graph.modulesById).map(e=>({alias:null,modules:[e]})):yn(this.graph.entryModules,t)){rn(n);const t=new fn(n,this.inputOptions,this.outputOptions,this.unsetOptions,this.graph.modulesById,i,this.facadeChunkByModule,e);s.push(t);for(const e of n)i.set(e,t)}for(const e of s)e.link();const n=[];for(const e of s)n.push(...e.generateFacades());return[...s,...n]}prerenderChunks(e,t){for(const t of e)t.generateExports();for(const s of e)s.preRender(this.outputOptions,t,this.pluginDriver)}}function _n(e){return[...e.values()].filter(e=>e instanceof mi&&(e.isIncluded()||e.isEntryPoint||e.includedDynamicImporters.length>0))}function In(e,t,s){const i=s.get(t);if("string"==typeof i&&i!==e)return Bt((n=t.id,r=e,a=i,{code:Wt.INVALID_CHUNK,message:`Cannot assign ${Dt(n)} to the "${r}" chunk as it is already in the "${a}" chunk.`}));var n,r,a;s.set(t,e)}var $n={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},Tn="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",Mn={5:Tn,"5module":Tn+" export import",6:Tn+" const class extends export import super"},Ln=/^in(stanceof)?$/,Rn="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࢠ-ࢴࢶ-ࣇऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲈᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-鿼ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞿꟂ-ꟊꟵ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",On="‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛࣓-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-ໍ໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠐-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿᫀᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷹᷻-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_",Dn=new RegExp("["+Rn+"]"),Vn=new RegExp("["+Rn+On+"]");Rn=On=null;var Bn=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,157,310,10,21,11,7,153,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,107,20,28,22,13,52,76,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,85,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,230,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,35,56,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,190,0,80,921,103,110,18,195,2749,1070,4050,582,8634,568,8,30,114,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8952,286,50,2,18,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,2357,44,11,6,17,0,370,43,1301,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42717,35,4148,12,221,3,5761,15,7472,3104,541,1507,4938],Fn=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,154,10,176,2,54,14,32,9,16,3,46,10,54,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,161,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,19306,9,135,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,5319,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,262,6,10,9,419,13,1495,6,110,6,6,9,4759,9,787719,239];function Wn(e,t){for(var s=65536,i=0;ie)return!1;if((s+=t[i+1])>=e)return!0}}function Un(e,t){return e<65?36===e:e<91||(e<97?95===e:e<123||(e<=65535?e>=170&&Dn.test(String.fromCharCode(e)):!1!==t&&Wn(e,Bn)))}function zn(e,t){return e<48?36===e:e<58||!(e<65)&&(e<91||(e<97?95===e:e<123||(e<=65535?e>=170&&Vn.test(String.fromCharCode(e)):!1!==t&&(Wn(e,Bn)||Wn(e,Fn)))))}var jn=function(e,t){void 0===t&&(t={}),this.label=e,this.keyword=t.keyword,this.beforeExpr=!!t.beforeExpr,this.startsExpr=!!t.startsExpr,this.isLoop=!!t.isLoop,this.isAssign=!!t.isAssign,this.prefix=!!t.prefix,this.postfix=!!t.postfix,this.binop=t.binop||null,this.updateContext=null};function Gn(e,t){return new jn(e,{beforeExpr:!0,binop:t})}var Hn={beforeExpr:!0},qn={startsExpr:!0},Kn={};function Xn(e,t){return void 0===t&&(t={}),t.keyword=e,Kn[e]=new jn(e,t)}var Yn={num:new jn("num",qn),regexp:new jn("regexp",qn),string:new jn("string",qn),name:new jn("name",qn),eof:new jn("eof"),bracketL:new jn("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new jn("]"),braceL:new jn("{",{beforeExpr:!0,startsExpr:!0}),braceR:new jn("}"),parenL:new jn("(",{beforeExpr:!0,startsExpr:!0}),parenR:new jn(")"),comma:new jn(",",Hn),semi:new jn(";",Hn),colon:new jn(":",Hn),dot:new jn("."),question:new jn("?",Hn),questionDot:new jn("?."),arrow:new jn("=>",Hn),template:new jn("template"),invalidTemplate:new jn("invalidTemplate"),ellipsis:new jn("...",Hn),backQuote:new jn("`",qn),dollarBraceL:new jn("${",{beforeExpr:!0,startsExpr:!0}),eq:new jn("=",{beforeExpr:!0,isAssign:!0}),assign:new jn("_=",{beforeExpr:!0,isAssign:!0}),incDec:new jn("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new jn("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:Gn("||",1),logicalAND:Gn("&&",2),bitwiseOR:Gn("|",3),bitwiseXOR:Gn("^",4),bitwiseAND:Gn("&",5),equality:Gn("==/!=/===/!==",6),relational:Gn("/<=/>=",7),bitShift:Gn("<>/>>>",8),plusMin:new jn("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:Gn("%",10),star:Gn("*",10),slash:Gn("/",10),starstar:new jn("**",{beforeExpr:!0}),coalesce:Gn("??",1),_break:Xn("break"),_case:Xn("case",Hn),_catch:Xn("catch"),_continue:Xn("continue"),_debugger:Xn("debugger"),_default:Xn("default",Hn),_do:Xn("do",{isLoop:!0,beforeExpr:!0}),_else:Xn("else",Hn),_finally:Xn("finally"),_for:Xn("for",{isLoop:!0}),_function:Xn("function",qn),_if:Xn("if"),_return:Xn("return",Hn),_switch:Xn("switch"),_throw:Xn("throw",Hn),_try:Xn("try"),_var:Xn("var"),_const:Xn("const"),_while:Xn("while",{isLoop:!0}),_with:Xn("with"),_new:Xn("new",{beforeExpr:!0,startsExpr:!0}),_this:Xn("this",qn),_super:Xn("super",qn),_class:Xn("class",qn),_extends:Xn("extends",Hn),_export:Xn("export"),_import:Xn("import",qn),_null:Xn("null",qn),_true:Xn("true",qn),_false:Xn("false",qn),_in:Xn("in",{beforeExpr:!0,binop:7}),_instanceof:Xn("instanceof",{beforeExpr:!0,binop:7}),_typeof:Xn("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:Xn("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:Xn("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},Qn=/\r\n?|\n|\u2028|\u2029/,Jn=new RegExp(Qn.source,"g");function Zn(e,t){return 10===e||13===e||!t&&(8232===e||8233===e)}var er=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,tr=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,sr=Object.prototype,ir=sr.hasOwnProperty,nr=sr.toString;function rr(e,t){return ir.call(e,t)}var ar=Array.isArray||function(e){return"[object Array]"===nr.call(e)};function or(e){return new RegExp("^(?:"+e.replace(/ /g,"|")+")$")}var hr=function(e,t){this.line=e,this.column=t};hr.prototype.offset=function(e){return new hr(this.line,this.column+e)};var lr=function(e,t,s){this.start=t,this.end=s,null!==e.sourceFile&&(this.source=e.sourceFile)};function cr(e,t){for(var s=1,i=0;;){Jn.lastIndex=i;var n=Jn.exec(e);if(!(n&&n.index=2015&&(t.ecmaVersion-=2009),null==t.allowReserved&&(t.allowReserved=t.ecmaVersion<5),ar(t.onToken)){var i=t.onToken;t.onToken=function(e){return i.push(e)}}return ar(t.onComment)&&(t.onComment=function(e,t){return function(s,i,n,r,a,o){var h={type:s?"Block":"Line",value:i,start:n,end:r};e.locations&&(h.loc=new lr(this,a,o)),e.ranges&&(h.range=[n,r]),t.push(h)}}(t,t.onComment)),t}function pr(e,t){return 2|(e?4:0)|(t?8:0)}var fr=function(e,t,s){this.options=e=dr(e),this.sourceFile=e.sourceFile,this.keywords=or(Mn[e.ecmaVersion>=6?6:"module"===e.sourceType?"5module":5]);var i="";if(!0!==e.allowReserved){for(var n=e.ecmaVersion;!(i=$n[n]);n--);"module"===e.sourceType&&(i+=" await")}this.reservedWords=or(i);var r=(i?i+" ":"")+$n.strict;this.reservedWordsStrict=or(r),this.reservedWordsStrictBind=or(r+" "+$n.strictBind),this.input=String(t),this.containsEsc=!1,s?(this.pos=s,this.lineStart=this.input.lastIndexOf("\n",s-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(Qn).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=Yn.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule="module"===e.sourceType,this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports={},0===this.pos&&e.allowHashBang&&"#!"===this.input.slice(0,2)&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(1),this.regexpState=null},mr={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0}};fr.prototype.parse=function(){var e=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(e)},mr.inFunction.get=function(){return(2&this.currentVarScope().flags)>0},mr.inGenerator.get=function(){return(8&this.currentVarScope().flags)>0},mr.inAsync.get=function(){return(4&this.currentVarScope().flags)>0},mr.allowSuper.get=function(){return(64&this.currentThisScope().flags)>0},mr.allowDirectSuper.get=function(){return(128&this.currentThisScope().flags)>0},mr.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},fr.prototype.inNonArrowFunction=function(){return(2&this.currentThisScope().flags)>0},fr.extend=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];for(var s=this,i=0;i=,?^&]/.test(n)||"!"===n&&"="===this.input.charAt(i+1))}e+=t[0].length,tr.lastIndex=e,e+=tr.exec(this.input)[0].length,";"===this.input[e]&&e++}},gr.eat=function(e){return this.type===e&&(this.next(),!0)},gr.isContextual=function(e){return this.type===Yn.name&&this.value===e&&!this.containsEsc},gr.eatContextual=function(e){return!!this.isContextual(e)&&(this.next(),!0)},gr.expectContextual=function(e){this.eatContextual(e)||this.unexpected()},gr.canInsertSemicolon=function(){return this.type===Yn.eof||this.type===Yn.braceR||Qn.test(this.input.slice(this.lastTokEnd,this.start))},gr.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},gr.semicolon=function(){this.eat(Yn.semi)||this.insertSemicolon()||this.unexpected()},gr.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0},gr.expect=function(e){this.eat(e)||this.unexpected()},gr.unexpected=function(e){this.raise(null!=e?e:this.start,"Unexpected token")},gr.checkPatternErrors=function(e,t){if(e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element");var s=t?e.parenthesizedAssign:e.parenthesizedBind;s>-1&&this.raiseRecoverable(s,"Parenthesized pattern")}},gr.checkExpressionErrors=function(e,t){if(!e)return!1;var s=e.shorthandAssign,i=e.doubleProto;if(!t)return s>=0||i>=0;s>=0&&this.raise(s,"Shorthand property assignments are valid only in destructuring patterns"),i>=0&&this.raiseRecoverable(i,"Redefinition of __proto__ property")},gr.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos=6&&this.unexpected(),this.parseFunctionStatement(r,!1,!e);case Yn._class:return e&&this.unexpected(),this.parseClass(r,!0);case Yn._if:return this.parseIfStatement(r);case Yn._return:return this.parseReturnStatement(r);case Yn._switch:return this.parseSwitchStatement(r);case Yn._throw:return this.parseThrowStatement(r);case Yn._try:return this.parseTryStatement(r);case Yn._const:case Yn._var:return i=i||this.value,e&&"var"!==i&&this.unexpected(),this.parseVarStatement(r,i);case Yn._while:return this.parseWhileStatement(r);case Yn._with:return this.parseWithStatement(r);case Yn.braceL:return this.parseBlock(!0,r);case Yn.semi:return this.parseEmptyStatement(r);case Yn._export:case Yn._import:if(this.options.ecmaVersion>10&&n===Yn._import){tr.lastIndex=this.pos;var a=tr.exec(this.input),o=this.pos+a[0].length,h=this.input.charCodeAt(o);if(40===h||46===h)return this.parseExpressionStatement(r,this.parseExpression())}return this.options.allowImportExportEverywhere||(t||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),n===Yn._import?this.parseImport(r):this.parseExport(r,s);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(r,!0,!e);var l=this.value,c=this.parseExpression();return n===Yn.name&&"Identifier"===c.type&&this.eat(Yn.colon)?this.parseLabeledStatement(r,l,c,e):this.parseExpressionStatement(r,c)}},Er.parseBreakContinueStatement=function(e,t){var s="break"===t;this.next(),this.eat(Yn.semi)||this.insertSemicolon()?e.label=null:this.type!==Yn.name?this.unexpected():(e.label=this.parseIdent(),this.semicolon());for(var i=0;i=6?this.eat(Yn.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")},Er.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&(this.inAsync||!this.inFunction&&this.options.allowAwaitOutsideFunction)&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(vr),this.enterScope(0),this.expect(Yn.parenL),this.type===Yn.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var s=this.isLet();if(this.type===Yn._var||this.type===Yn._const||s){var i=this.startNode(),n=s?"let":this.value;return this.next(),this.parseVar(i,!0,n),this.finishNode(i,"VariableDeclaration"),(this.type===Yn._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&1===i.declarations.length?(this.options.ecmaVersion>=9&&(this.type===Yn._in?t>-1&&this.unexpected(t):e.await=t>-1),this.parseForIn(e,i)):(t>-1&&this.unexpected(t),this.parseFor(e,i))}var r=new xr,a=this.parseExpression(!0,r);return this.type===Yn._in||this.options.ecmaVersion>=6&&this.isContextual("of")?(this.options.ecmaVersion>=9&&(this.type===Yn._in?t>-1&&this.unexpected(t):e.await=t>-1),this.toAssignable(a,!1,r),this.checkLVal(a),this.parseForIn(e,a)):(this.checkExpressionErrors(r,!0),t>-1&&this.unexpected(t),this.parseFor(e,a))},Er.parseFunctionStatement=function(e,t,s){return this.next(),this.parseFunction(e,Ar|(s?0:Pr),!1,t)},Er.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement("if"),e.alternate=this.eat(Yn._else)?this.parseStatement("if"):null,this.finishNode(e,"IfStatement")},Er.parseReturnStatement=function(e){return this.inFunction||this.options.allowReturnOutsideFunction||this.raise(this.start,"'return' outside of function"),this.next(),this.eat(Yn.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")},Er.parseSwitchStatement=function(e){var t;this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(Yn.braceL),this.labels.push(br),this.enterScope(0);for(var s=!1;this.type!==Yn.braceR;)if(this.type===Yn._case||this.type===Yn._default){var i=this.type===Yn._case;t&&this.finishNode(t,"SwitchCase"),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),i?t.test=this.parseExpression():(s&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),s=!0,t.test=null),this.expect(Yn.colon)}else t||this.unexpected(),t.consequent.push(this.parseStatement(null));return this.exitScope(),t&&this.finishNode(t,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(e,"SwitchStatement")},Er.parseThrowStatement=function(e){return this.next(),Qn.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")};var Sr=[];Er.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===Yn._catch){var t=this.startNode();if(this.next(),this.eat(Yn.parenL)){t.param=this.parseBindingAtom();var s="Identifier"===t.param.type;this.enterScope(s?32:0),this.checkLVal(t.param,s?4:2),this.expect(Yn.parenR)}else this.options.ecmaVersion<10&&this.unexpected(),t.param=null,this.enterScope(0);t.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(t,"CatchClause")}return e.finalizer=this.eat(Yn._finally)?this.parseBlock():null,e.handler||e.finalizer||this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")},Er.parseVarStatement=function(e,t){return this.next(),this.parseVar(e,!1,t),this.semicolon(),this.finishNode(e,"VariableDeclaration")},Er.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(vr),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")},Er.parseWithStatement=function(e){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement("with"),this.finishNode(e,"WithStatement")},Er.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")},Er.parseLabeledStatement=function(e,t,s,i){for(var n=0,r=this.labels;n=0;o--){var h=this.labels[o];if(h.statementStart!==e.start)break;h.statementStart=this.start,h.kind=a}return this.labels.push({name:t,kind:a,statementStart:this.start}),e.body=this.parseStatement(i?-1===i.indexOf("label")?i+"label":i:"label"),this.labels.pop(),e.label=s,this.finishNode(e,"LabeledStatement")},Er.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")},Er.parseBlock=function(e,t,s){for(void 0===e&&(e=!0),void 0===t&&(t=this.startNode()),t.body=[],this.expect(Yn.braceL),e&&this.enterScope(0);this.type!==Yn.braceR;){var i=this.parseStatement(null);t.body.push(i)}return s&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(t,"BlockStatement")},Er.parseFor=function(e,t){return e.init=t,this.expect(Yn.semi),e.test=this.type===Yn.semi?null:this.parseExpression(),this.expect(Yn.semi),e.update=this.type===Yn.parenR?null:this.parseExpression(),this.expect(Yn.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,"ForStatement")},Er.parseForIn=function(e,t){var s=this.type===Yn._in;return this.next(),"VariableDeclaration"===t.type&&null!=t.declarations[0].init&&(!s||this.options.ecmaVersion<8||this.strict||"var"!==t.kind||"Identifier"!==t.declarations[0].id.type)?this.raise(t.start,(s?"for-in":"for-of")+" loop variable declaration may not have an initializer"):"AssignmentPattern"===t.type&&this.raise(t.start,"Invalid left-hand side in for-loop"),e.left=t,e.right=s?this.parseExpression():this.parseMaybeAssign(),this.expect(Yn.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,s?"ForInStatement":"ForOfStatement")},Er.parseVar=function(e,t,s){for(e.declarations=[],e.kind=s;;){var i=this.startNode();if(this.parseVarId(i,s),this.eat(Yn.eq)?i.init=this.parseMaybeAssign(t):"const"!==s||this.type===Yn._in||this.options.ecmaVersion>=6&&this.isContextual("of")?"Identifier"===i.id.type||t&&(this.type===Yn._in||this.isContextual("of"))?i.init=null:this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):this.unexpected(),e.declarations.push(this.finishNode(i,"VariableDeclarator")),!this.eat(Yn.comma))break}return e},Er.parseVarId=function(e,t){e.id=this.parseBindingAtom(),this.checkLVal(e.id,"var"===t?1:2,!1)};var Ar=1,Pr=2;Er.parseFunction=function(e,t,s,i){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!i)&&(this.type===Yn.star&&t&Pr&&this.unexpected(),e.generator=this.eat(Yn.star)),this.options.ecmaVersion>=8&&(e.async=!!i),t&Ar&&(e.id=4&t&&this.type!==Yn.name?null:this.parseIdent(),!e.id||t&Pr||this.checkLVal(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?1:2:3));var n=this.yieldPos,r=this.awaitPos,a=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(pr(e.async,e.generator)),t&Ar||(e.id=this.type===Yn.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,s,!1),this.yieldPos=n,this.awaitPos=r,this.awaitIdentPos=a,this.finishNode(e,t&Ar?"FunctionDeclaration":"FunctionExpression")},Er.parseFunctionParams=function(e){this.expect(Yn.parenL),e.params=this.parseBindingList(Yn.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},Er.parseClass=function(e,t){this.next();var s=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var i=this.startNode(),n=!1;for(i.body=[],this.expect(Yn.braceL);this.type!==Yn.braceR;){var r=this.parseClassElement(null!==e.superClass);r&&(i.body.push(r),"MethodDefinition"===r.type&&"constructor"===r.kind&&(n&&this.raise(r.start,"Duplicate constructor in the same class"),n=!0))}return this.strict=s,this.next(),e.body=this.finishNode(i,"ClassBody"),this.finishNode(e,t?"ClassDeclaration":"ClassExpression")},Er.parseClassElement=function(e){var t=this;if(this.eat(Yn.semi))return null;var s=this.startNode(),i=function(e,i){void 0===i&&(i=!1);var n=t.start,r=t.startLoc;return!!t.eatContextual(e)&&(!(t.type===Yn.parenL||i&&t.canInsertSemicolon())||(s.key&&t.unexpected(),s.computed=!1,s.key=t.startNodeAt(n,r),s.key.name=e,t.finishNode(s.key,"Identifier"),!1))};s.kind="method",s.static=i("static");var n=this.eat(Yn.star),r=!1;n||(this.options.ecmaVersion>=8&&i("async",!0)?(r=!0,n=this.options.ecmaVersion>=9&&this.eat(Yn.star)):i("get")?s.kind="get":i("set")&&(s.kind="set")),s.key||this.parsePropertyName(s);var a=s.key,o=!1;return s.computed||s.static||!("Identifier"===a.type&&"constructor"===a.name||"Literal"===a.type&&"constructor"===a.value)?s.static&&"Identifier"===a.type&&"prototype"===a.name&&this.raise(a.start,"Classes may not have a static property named prototype"):("method"!==s.kind&&this.raise(a.start,"Constructor can't have get/set modifier"),n&&this.raise(a.start,"Constructor can't be a generator"),r&&this.raise(a.start,"Constructor can't be an async method"),s.kind="constructor",o=e),this.parseClassMethod(s,n,r,o),"get"===s.kind&&0!==s.value.params.length&&this.raiseRecoverable(s.value.start,"getter should have no params"),"set"===s.kind&&1!==s.value.params.length&&this.raiseRecoverable(s.value.start,"setter should have exactly one param"),"set"===s.kind&&"RestElement"===s.value.params[0].type&&this.raiseRecoverable(s.value.params[0].start,"Setter cannot use rest params"),s},Er.parseClassMethod=function(e,t,s,i){return e.value=this.parseMethod(t,s,i),this.finishNode(e,"MethodDefinition")},Er.parseClassId=function(e,t){this.type===Yn.name?(e.id=this.parseIdent(),t&&this.checkLVal(e.id,2,!1)):(!0===t&&this.unexpected(),e.id=null)},Er.parseClassSuper=function(e){e.superClass=this.eat(Yn._extends)?this.parseExprSubscripts():null},Er.parseExport=function(e,t){if(this.next(),this.eat(Yn.star))return this.options.ecmaVersion>=11&&(this.eatContextual("as")?(e.exported=this.parseIdent(!0),this.checkExport(t,e.exported.name,this.lastTokStart)):e.exported=null),this.expectContextual("from"),this.type!==Yn.string&&this.unexpected(),e.source=this.parseExprAtom(),this.semicolon(),this.finishNode(e,"ExportAllDeclaration");if(this.eat(Yn._default)){var s;if(this.checkExport(t,"default",this.lastTokStart),this.type===Yn._function||(s=this.isAsyncFunction())){var i=this.startNode();this.next(),s&&this.next(),e.declaration=this.parseFunction(i,4|Ar,!1,s)}else if(this.type===Yn._class){var n=this.startNode();e.declaration=this.parseClass(n,"nullableID")}else e.declaration=this.parseMaybeAssign(),this.semicolon();return this.finishNode(e,"ExportDefaultDeclaration")}if(this.shouldParseExportStatement())e.declaration=this.parseStatement(null),"VariableDeclaration"===e.declaration.type?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id.name,e.declaration.id.start),e.specifiers=[],e.source=null;else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual("from"))this.type!==Yn.string&&this.unexpected(),e.source=this.parseExprAtom();else{for(var r=0,a=e.specifiers;r=6&&e)switch(e.type){case"Identifier":this.inAsync&&"await"===e.name&&this.raise(e.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"RestElement":break;case"ObjectExpression":e.type="ObjectPattern",s&&this.checkPatternErrors(s,!0);for(var i=0,n=e.properties;i=8&&!r&&"async"===a.name&&!this.canInsertSemicolon()&&this.eat(Yn._function))return this.parseFunction(this.startNodeAt(i,n),0,!1,!0);if(s&&!this.canInsertSemicolon()){if(this.eat(Yn.arrow))return this.parseArrowExpression(this.startNodeAt(i,n),[a],!1);if(this.options.ecmaVersion>=8&&"async"===a.name&&this.type===Yn.name&&!r)return a=this.parseIdent(!1),!this.canInsertSemicolon()&&this.eat(Yn.arrow)||this.unexpected(),this.parseArrowExpression(this.startNodeAt(i,n),[a],!0)}return a;case Yn.regexp:var o=this.value;return(t=this.parseLiteral(o.value)).regex={pattern:o.pattern,flags:o.flags},t;case Yn.num:case Yn.string:return this.parseLiteral(this.value);case Yn._null:case Yn._true:case Yn._false:return(t=this.startNode()).value=this.type===Yn._null?null:this.type===Yn._true,t.raw=this.type.keyword,this.next(),this.finishNode(t,"Literal");case Yn.parenL:var h=this.start,l=this.parseParenAndDistinguishExpression(s);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(l)&&(e.parenthesizedAssign=h),e.parenthesizedBind<0&&(e.parenthesizedBind=h)),l;case Yn.bracketL:return t=this.startNode(),this.next(),t.elements=this.parseExprList(Yn.bracketR,!0,!0,e),this.finishNode(t,"ArrayExpression");case Yn.braceL:return this.parseObj(!1,e);case Yn._function:return t=this.startNode(),this.next(),this.parseFunction(t,0);case Yn._class:return this.parseClass(this.startNode(),!1);case Yn._new:return this.parseNew();case Yn.backQuote:return this.parseTemplate();case Yn._import:return this.options.ecmaVersion>=11?this.parseExprImport():this.unexpected();default:this.unexpected()}},kr.parseExprImport=function(){var e=this.startNode();this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import");var t=this.parseIdent(!0);switch(this.type){case Yn.parenL:return this.parseDynamicImport(e);case Yn.dot:return e.meta=t,this.parseImportMeta(e);default:this.unexpected()}},kr.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),!this.eat(Yn.parenR)){var t=this.start;this.eat(Yn.comma)&&this.eat(Yn.parenR)?this.raiseRecoverable(t,"Trailing comma is not allowed in import()"):this.unexpected(t)}return this.finishNode(e,"ImportExpression")},kr.parseImportMeta=function(e){this.next();var t=this.containsEsc;return e.property=this.parseIdent(!0),"meta"!==e.property.name&&this.raiseRecoverable(e.property.start,"The only valid meta property for import is 'import.meta'"),t&&this.raiseRecoverable(e.start,"'import.meta' must not contain escaped characters"),"module"!==this.options.sourceType&&this.raiseRecoverable(e.start,"Cannot use 'import.meta' outside a module"),this.finishNode(e,"MetaProperty")},kr.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),110===t.raw.charCodeAt(t.raw.length-1)&&(t.bigint=t.raw.slice(0,-1)),this.next(),this.finishNode(t,"Literal")},kr.parseParenExpression=function(){this.expect(Yn.parenL);var e=this.parseExpression();return this.expect(Yn.parenR),e},kr.parseParenAndDistinguishExpression=function(e){var t,s=this.start,i=this.startLoc,n=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var r,a=this.start,o=this.startLoc,h=[],l=!0,c=!1,u=new xr,d=this.yieldPos,p=this.awaitPos;for(this.yieldPos=0,this.awaitPos=0;this.type!==Yn.parenR;){if(l?l=!1:this.expect(Yn.comma),n&&this.afterTrailingComma(Yn.parenR,!0)){c=!0;break}if(this.type===Yn.ellipsis){r=this.start,h.push(this.parseParenItem(this.parseRestBinding())),this.type===Yn.comma&&this.raise(this.start,"Comma is not permitted after the rest element");break}h.push(this.parseMaybeAssign(!1,u,this.parseParenItem))}var f=this.start,m=this.startLoc;if(this.expect(Yn.parenR),e&&!this.canInsertSemicolon()&&this.eat(Yn.arrow))return this.checkPatternErrors(u,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=d,this.awaitPos=p,this.parseParenArrowList(s,i,h);h.length&&!c||this.unexpected(this.lastTokStart),r&&this.unexpected(r),this.checkExpressionErrors(u,!0),this.yieldPos=d||this.yieldPos,this.awaitPos=p||this.awaitPos,h.length>1?((t=this.startNodeAt(a,o)).expressions=h,this.finishNodeAt(t,"SequenceExpression",f,m)):t=h[0]}else t=this.parseParenExpression();if(this.options.preserveParens){var g=this.startNodeAt(s,i);return g.expression=t,this.finishNode(g,"ParenthesizedExpression")}return t},kr.parseParenItem=function(e){return e},kr.parseParenArrowList=function(e,t,s){return this.parseArrowExpression(this.startNodeAt(e,t),s)};var wr=[];kr.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var e=this.startNode(),t=this.parseIdent(!0);if(this.options.ecmaVersion>=6&&this.eat(Yn.dot)){e.meta=t;var s=this.containsEsc;return e.property=this.parseIdent(!0),"target"!==e.property.name&&this.raiseRecoverable(e.property.start,"The only valid meta property for new is 'new.target'"),s&&this.raiseRecoverable(e.start,"'new.target' must not contain escaped characters"),this.inNonArrowFunction()||this.raiseRecoverable(e.start,"'new.target' can only be used in functions"),this.finishNode(e,"MetaProperty")}var i=this.start,n=this.startLoc,r=this.type===Yn._import;return e.callee=this.parseSubscripts(this.parseExprAtom(),i,n,!0),r&&"ImportExpression"===e.callee.type&&this.raise(i,"Cannot use new with import()"),this.eat(Yn.parenL)?e.arguments=this.parseExprList(Yn.parenR,this.options.ecmaVersion>=8,!1):e.arguments=wr,this.finishNode(e,"NewExpression")},kr.parseTemplateElement=function(e){var t=e.isTagged,s=this.startNode();return this.type===Yn.invalidTemplate?(t||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),s.value={raw:this.value,cooked:null}):s.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,"\n"),cooked:this.value},this.next(),s.tail=this.type===Yn.backQuote,this.finishNode(s,"TemplateElement")},kr.parseTemplate=function(e){void 0===e&&(e={});var t=e.isTagged;void 0===t&&(t=!1);var s=this.startNode();this.next(),s.expressions=[];var i=this.parseTemplateElement({isTagged:t});for(s.quasis=[i];!i.tail;)this.type===Yn.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(Yn.dollarBraceL),s.expressions.push(this.parseExpression()),this.expect(Yn.braceR),s.quasis.push(i=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(s,"TemplateLiteral")},kr.isAsyncProp=function(e){return!e.computed&&"Identifier"===e.key.type&&"async"===e.key.name&&(this.type===Yn.name||this.type===Yn.num||this.type===Yn.string||this.type===Yn.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===Yn.star)&&!Qn.test(this.input.slice(this.lastTokEnd,this.start))},kr.parseObj=function(e,t){var s=this.startNode(),i=!0,n={};for(s.properties=[],this.next();!this.eat(Yn.braceR);){if(i)i=!1;else if(this.expect(Yn.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(Yn.braceR))break;var r=this.parseProperty(e,t);e||this.checkPropClash(r,n,t),s.properties.push(r)}return this.finishNode(s,e?"ObjectPattern":"ObjectExpression")},kr.parseProperty=function(e,t){var s,i,n,r,a=this.startNode();if(this.options.ecmaVersion>=9&&this.eat(Yn.ellipsis))return e?(a.argument=this.parseIdent(!1),this.type===Yn.comma&&this.raise(this.start,"Comma is not permitted after the rest element"),this.finishNode(a,"RestElement")):(this.type===Yn.parenL&&t&&(t.parenthesizedAssign<0&&(t.parenthesizedAssign=this.start),t.parenthesizedBind<0&&(t.parenthesizedBind=this.start)),a.argument=this.parseMaybeAssign(!1,t),this.type===Yn.comma&&t&&t.trailingComma<0&&(t.trailingComma=this.start),this.finishNode(a,"SpreadElement"));this.options.ecmaVersion>=6&&(a.method=!1,a.shorthand=!1,(e||t)&&(n=this.start,r=this.startLoc),e||(s=this.eat(Yn.star)));var o=this.containsEsc;return this.parsePropertyName(a),!e&&!o&&this.options.ecmaVersion>=8&&!s&&this.isAsyncProp(a)?(i=!0,s=this.options.ecmaVersion>=9&&this.eat(Yn.star),this.parsePropertyName(a,t)):i=!1,this.parsePropertyValue(a,e,s,i,n,r,t,o),this.finishNode(a,"Property")},kr.parsePropertyValue=function(e,t,s,i,n,r,a,o){if((s||i)&&this.type===Yn.colon&&this.unexpected(),this.eat(Yn.colon))e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,a),e.kind="init";else if(this.options.ecmaVersion>=6&&this.type===Yn.parenL)t&&this.unexpected(),e.kind="init",e.method=!0,e.value=this.parseMethod(s,i);else if(t||o||!(this.options.ecmaVersion>=5)||e.computed||"Identifier"!==e.key.type||"get"!==e.key.name&&"set"!==e.key.name||this.type===Yn.comma||this.type===Yn.braceR||this.type===Yn.eq)this.options.ecmaVersion>=6&&!e.computed&&"Identifier"===e.key.type?((s||i)&&this.unexpected(),this.checkUnreserved(e.key),"await"!==e.key.name||this.awaitIdentPos||(this.awaitIdentPos=n),e.kind="init",t?e.value=this.parseMaybeDefault(n,r,e.key):this.type===Yn.eq&&a?(a.shorthandAssign<0&&(a.shorthandAssign=this.start),e.value=this.parseMaybeDefault(n,r,e.key)):e.value=e.key,e.shorthand=!0):this.unexpected();else{(s||i)&&this.unexpected(),e.kind=e.key.name,this.parsePropertyName(e),e.value=this.parseMethod(!1);var h="get"===e.kind?0:1;if(e.value.params.length!==h){var l=e.value.start;"get"===e.kind?this.raiseRecoverable(l,"getter should have no params"):this.raiseRecoverable(l,"setter should have exactly one param")}else"set"===e.kind&&"RestElement"===e.value.params[0].type&&this.raiseRecoverable(e.value.params[0].start,"Setter cannot use rest params")}},kr.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(Yn.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(Yn.bracketR),e.key;e.computed=!1}return e.key=this.type===Yn.num||this.type===Yn.string?this.parseExprAtom():this.parseIdent("never"!==this.options.allowReserved)},kr.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)},kr.parseMethod=function(e,t,s){var i=this.startNode(),n=this.yieldPos,r=this.awaitPos,a=this.awaitIdentPos;return this.initFunction(i),this.options.ecmaVersion>=6&&(i.generator=e),this.options.ecmaVersion>=8&&(i.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(64|pr(t,i.generator)|(s?128:0)),this.expect(Yn.parenL),i.params=this.parseBindingList(Yn.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(i,!1,!0),this.yieldPos=n,this.awaitPos=r,this.awaitIdentPos=a,this.finishNode(i,"FunctionExpression")},kr.parseArrowExpression=function(e,t,s){var i=this.yieldPos,n=this.awaitPos,r=this.awaitIdentPos;return this.enterScope(16|pr(s,!1)),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!s),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0,!1),this.yieldPos=i,this.awaitPos=n,this.awaitIdentPos=r,this.finishNode(e,"ArrowFunctionExpression")},kr.parseFunctionBody=function(e,t,s){var i=t&&this.type!==Yn.braceL,n=this.strict,r=!1;if(i)e.body=this.parseMaybeAssign(),e.expression=!0,this.checkParams(e,!1);else{var a=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);n&&!a||(r=this.strictDirective(this.end))&&a&&this.raiseRecoverable(e.start,"Illegal 'use strict' directive in function with non-simple parameter list");var o=this.labels;this.labels=[],r&&(this.strict=!0),this.checkParams(e,!n&&!r&&!t&&!s&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLVal(e.id,5),e.body=this.parseBlock(!1,void 0,r&&!n),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=o}this.exitScope()},kr.isSimpleParamList=function(e){for(var t=0,s=e;t-1||n.functions.indexOf(e)>-1||n.var.indexOf(e)>-1,n.lexical.push(e),this.inModule&&1&n.flags&&delete this.undefinedExports[e]}else if(4===t){this.currentScope().lexical.push(e)}else if(3===t){var r=this.currentScope();i=this.treatFunctionsAsVar?r.lexical.indexOf(e)>-1:r.lexical.indexOf(e)>-1||r.var.indexOf(e)>-1,r.functions.push(e)}else for(var a=this.scopeStack.length-1;a>=0;--a){var o=this.scopeStack[a];if(o.lexical.indexOf(e)>-1&&!(32&o.flags&&o.lexical[0]===e)||!this.treatFunctionsAsVarInScope(o)&&o.functions.indexOf(e)>-1){i=!0;break}if(o.var.push(e),this.inModule&&1&o.flags&&delete this.undefinedExports[e],3&o.flags)break}i&&this.raiseRecoverable(s,"Identifier '"+e+"' has already been declared")},_r.checkLocalExport=function(e){-1===this.scopeStack[0].lexical.indexOf(e.name)&&-1===this.scopeStack[0].var.indexOf(e.name)&&(this.undefinedExports[e.name]=e)},_r.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},_r.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(3&t.flags)return t}},_r.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(3&t.flags&&!(16&t.flags))return t}};var $r=function(e,t,s){this.type="",this.start=t,this.end=0,e.options.locations&&(this.loc=new lr(e,s)),e.options.directSourceFile&&(this.sourceFile=e.options.directSourceFile),e.options.ranges&&(this.range=[t,0])},Tr=fr.prototype;function Mr(e,t,s,i){return e.type=t,e.end=s,this.options.locations&&(e.loc.end=i),this.options.ranges&&(e.range[1]=s),e}Tr.startNode=function(){return new $r(this,this.start,this.startLoc)},Tr.startNodeAt=function(e,t){return new $r(this,e,t)},Tr.finishNode=function(e,t){return Mr.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)},Tr.finishNodeAt=function(e,t,s,i){return Mr.call(this,e,t,s,i)};var Lr=function(e,t,s,i,n){this.token=e,this.isExpr=!!t,this.preserveSpace=!!s,this.override=i,this.generator=!!n},Rr={b_stat:new Lr("{",!1),b_expr:new Lr("{",!0),b_tmpl:new Lr("${",!1),p_stat:new Lr("(",!1),p_expr:new Lr("(",!0),q_tmpl:new Lr("`",!0,!0,(function(e){return e.tryReadTemplateToken()})),f_stat:new Lr("function",!1),f_expr:new Lr("function",!0),f_expr_gen:new Lr("function",!0,!1,null,!0),f_gen:new Lr("function",!1,!1,null,!0)},Or=fr.prototype;Or.initialContext=function(){return[Rr.b_stat]},Or.braceIsBlock=function(e){var t=this.curContext();return t===Rr.f_expr||t===Rr.f_stat||(e!==Yn.colon||t!==Rr.b_stat&&t!==Rr.b_expr?e===Yn._return||e===Yn.name&&this.exprAllowed?Qn.test(this.input.slice(this.lastTokEnd,this.start)):e===Yn._else||e===Yn.semi||e===Yn.eof||e===Yn.parenR||e===Yn.arrow||(e===Yn.braceL?t===Rr.b_stat:e!==Yn._var&&e!==Yn._const&&e!==Yn.name&&!this.exprAllowed):!t.isExpr)},Or.inGeneratorContext=function(){for(var e=this.context.length-1;e>=1;e--){var t=this.context[e];if("function"===t.token)return t.generator}return!1},Or.updateContext=function(e){var t,s=this.type;s.keyword&&e===Yn.dot?this.exprAllowed=!1:(t=s.updateContext)?t.call(this,e):this.exprAllowed=s.beforeExpr},Yn.parenR.updateContext=Yn.braceR.updateContext=function(){if(1!==this.context.length){var e=this.context.pop();e===Rr.b_stat&&"function"===this.curContext().token&&(e=this.context.pop()),this.exprAllowed=!e.isExpr}else this.exprAllowed=!0},Yn.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?Rr.b_stat:Rr.b_expr),this.exprAllowed=!0},Yn.dollarBraceL.updateContext=function(){this.context.push(Rr.b_tmpl),this.exprAllowed=!0},Yn.parenL.updateContext=function(e){var t=e===Yn._if||e===Yn._for||e===Yn._with||e===Yn._while;this.context.push(t?Rr.p_stat:Rr.p_expr),this.exprAllowed=!0},Yn.incDec.updateContext=function(){},Yn._function.updateContext=Yn._class.updateContext=function(e){!e.beforeExpr||e===Yn.semi||e===Yn._else||e===Yn._return&&Qn.test(this.input.slice(this.lastTokEnd,this.start))||(e===Yn.colon||e===Yn.braceL)&&this.curContext()===Rr.b_stat?this.context.push(Rr.f_stat):this.context.push(Rr.f_expr),this.exprAllowed=!1},Yn.backQuote.updateContext=function(){this.curContext()===Rr.q_tmpl?this.context.pop():this.context.push(Rr.q_tmpl),this.exprAllowed=!1},Yn.star.updateContext=function(e){if(e===Yn._function){var t=this.context.length-1;this.context[t]===Rr.f_expr?this.context[t]=Rr.f_expr_gen:this.context[t]=Rr.f_gen}this.exprAllowed=!0},Yn.name.updateContext=function(e){var t=!1;this.options.ecmaVersion>=6&&e!==Yn.dot&&("of"===this.value&&!this.exprAllowed||"yield"===this.value&&this.inGeneratorContext())&&(t=!0),this.exprAllowed=t};var Dr="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",Vr=Dr+" Extended_Pictographic",Br={9:Dr,10:Vr,11:"ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS Extended_Pictographic"},Fr="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",Wr="Adlam Adlm Ahom Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",Ur=Wr+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",zr={9:Wr,10:Ur,11:"Adlam Adlm Ahom Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho"},jr={};function Gr(e){var t=jr[e]={binary:or(Br[e]+" "+Fr),nonBinary:{General_Category:or(Fr),Script:or(zr[e])}};t.nonBinary.Script_Extensions=t.nonBinary.Script,t.nonBinary.gc=t.nonBinary.General_Category,t.nonBinary.sc=t.nonBinary.Script,t.nonBinary.scx=t.nonBinary.Script_Extensions}Gr(9),Gr(10),Gr(11);var Hr=fr.prototype,qr=function(e){this.parser=e,this.validFlags="gim"+(e.options.ecmaVersion>=6?"uy":"")+(e.options.ecmaVersion>=9?"s":""),this.unicodeProperties=jr[e.options.ecmaVersion>=11?11:e.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=[],this.backReferenceNames=[]};function Kr(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}function Xr(e){return 36===e||e>=40&&e<=43||46===e||63===e||e>=91&&e<=94||e>=123&&e<=125}function Yr(e){return e>=65&&e<=90||e>=97&&e<=122}function Qr(e){return Yr(e)||95===e}function Jr(e){return Qr(e)||Zr(e)}function Zr(e){return e>=48&&e<=57}function ea(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function ta(e){return e>=65&&e<=70?e-65+10:e>=97&&e<=102?e-97+10:e-48}function sa(e){return e>=48&&e<=55}qr.prototype.reset=function(e,t,s){var i=-1!==s.indexOf("u");this.start=0|e,this.source=t+"",this.flags=s,this.switchU=i&&this.parser.options.ecmaVersion>=6,this.switchN=i&&this.parser.options.ecmaVersion>=9},qr.prototype.raise=function(e){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+e)},qr.prototype.at=function(e,t){void 0===t&&(t=!1);var s=this.source,i=s.length;if(e>=i)return-1;var n=s.charCodeAt(e);if(!t&&!this.switchU||n<=55295||n>=57344||e+1>=i)return n;var r=s.charCodeAt(e+1);return r>=56320&&r<=57343?(n<<10)+r-56613888:n},qr.prototype.nextIndex=function(e,t){void 0===t&&(t=!1);var s=this.source,i=s.length;if(e>=i)return i;var n,r=s.charCodeAt(e);return!t&&!this.switchU||r<=55295||r>=57344||e+1>=i||(n=s.charCodeAt(e+1))<56320||n>57343?e+1:e+2},qr.prototype.current=function(e){return void 0===e&&(e=!1),this.at(this.pos,e)},qr.prototype.lookahead=function(e){return void 0===e&&(e=!1),this.at(this.nextIndex(this.pos,e),e)},qr.prototype.advance=function(e){void 0===e&&(e=!1),this.pos=this.nextIndex(this.pos,e)},qr.prototype.eat=function(e,t){return void 0===t&&(t=!1),this.current(t)===e&&(this.advance(t),!0)},Hr.validateRegExpFlags=function(e){for(var t=e.validFlags,s=e.flags,i=0;i-1&&this.raise(e.start,"Duplicate regular expression flag")}},Hr.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&e.groupNames.length>0&&(e.switchN=!0,this.regexp_pattern(e))},Hr.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue="",e.lastAssertionIsQuantifiable=!1,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames.length=0,e.backReferenceNames.length=0,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise("Unmatched ')'"),(e.eat(93)||e.eat(125))&&e.raise("Lone quantifier brackets")),e.maxBackReference>e.numCapturingParens&&e.raise("Invalid escape");for(var t=0,s=e.backReferenceNames;t=9&&(s=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise("Unterminated group"),e.lastAssertionIsQuantifiable=!s,!0}return e.pos=t,!1},Hr.regexp_eatQuantifier=function(e,t){return void 0===t&&(t=!1),!!this.regexp_eatQuantifierPrefix(e,t)&&(e.eat(63),!0)},Hr.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)},Hr.regexp_eatBracedQuantifier=function(e,t){var s=e.pos;if(e.eat(123)){var i=0,n=-1;if(this.regexp_eatDecimalDigits(e)&&(i=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(n=e.lastIntValue),e.eat(125)))return-1!==n&&n=9?this.regexp_groupSpecifier(e):63===e.current()&&e.raise("Invalid group"),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,!0;e.raise("Unterminated group")}return!1},Hr.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)},Hr.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise("Nothing to repeat"),!1},Hr.regexp_eatSyntaxCharacter=function(e){var t=e.current();return!!Xr(t)&&(e.lastIntValue=t,e.advance(),!0)},Hr.regexp_eatPatternCharacters=function(e){for(var t=e.pos,s=0;-1!==(s=e.current())&&!Xr(s);)e.advance();return e.pos!==t},Hr.regexp_eatExtendedPatternCharacter=function(e){var t=e.current();return!(-1===t||36===t||t>=40&&t<=43||46===t||63===t||91===t||94===t||124===t)&&(e.advance(),!0)},Hr.regexp_groupSpecifier=function(e){if(e.eat(63)){if(this.regexp_eatGroupName(e))return-1!==e.groupNames.indexOf(e.lastStringValue)&&e.raise("Duplicate capture group name"),void e.groupNames.push(e.lastStringValue);e.raise("Invalid group")}},Hr.regexp_eatGroupName=function(e){if(e.lastStringValue="",e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62))return!0;e.raise("Invalid capture group name")}return!1},Hr.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue="",this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=Kr(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=Kr(e.lastIntValue);return!0}return!1},Hr.regexp_eatRegExpIdentifierStart=function(e){var t=e.pos,s=this.options.ecmaVersion>=11,i=e.current(s);return e.advance(s),92===i&&this.regexp_eatRegExpUnicodeEscapeSequence(e,s)&&(i=e.lastIntValue),function(e){return Un(e,!0)||36===e||95===e}(i)?(e.lastIntValue=i,!0):(e.pos=t,!1)},Hr.regexp_eatRegExpIdentifierPart=function(e){var t=e.pos,s=this.options.ecmaVersion>=11,i=e.current(s);return e.advance(s),92===i&&this.regexp_eatRegExpUnicodeEscapeSequence(e,s)&&(i=e.lastIntValue),function(e){return zn(e,!0)||36===e||95===e||8204===e||8205===e}(i)?(e.lastIntValue=i,!0):(e.pos=t,!1)},Hr.regexp_eatAtomEscape=function(e){return!!(this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e))||(e.switchU&&(99===e.current()&&e.raise("Invalid unicode escape"),e.raise("Invalid escape")),!1)},Hr.regexp_eatBackReference=function(e){var t=e.pos;if(this.regexp_eatDecimalEscape(e)){var s=e.lastIntValue;if(e.switchU)return s>e.maxBackReference&&(e.maxBackReference=s),!0;if(s<=e.numCapturingParens)return!0;e.pos=t}return!1},Hr.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise("Invalid named reference")}return!1},Hr.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,!1)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)},Hr.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1},Hr.regexp_eatZero=function(e){return 48===e.current()&&!Zr(e.lookahead())&&(e.lastIntValue=0,e.advance(),!0)},Hr.regexp_eatControlEscape=function(e){var t=e.current();return 116===t?(e.lastIntValue=9,e.advance(),!0):110===t?(e.lastIntValue=10,e.advance(),!0):118===t?(e.lastIntValue=11,e.advance(),!0):102===t?(e.lastIntValue=12,e.advance(),!0):114===t&&(e.lastIntValue=13,e.advance(),!0)},Hr.regexp_eatControlLetter=function(e){var t=e.current();return!!Yr(t)&&(e.lastIntValue=t%32,e.advance(),!0)},Hr.regexp_eatRegExpUnicodeEscapeSequence=function(e,t){void 0===t&&(t=!1);var s,i=e.pos,n=t||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var r=e.lastIntValue;if(n&&r>=55296&&r<=56319){var a=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var o=e.lastIntValue;if(o>=56320&&o<=57343)return e.lastIntValue=1024*(r-55296)+(o-56320)+65536,!0}e.pos=a,e.lastIntValue=r}return!0}if(n&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&((s=e.lastIntValue)>=0&&s<=1114111))return!0;n&&e.raise("Invalid unicode escape"),e.pos=i}return!1},Hr.regexp_eatIdentityEscape=function(e){if(e.switchU)return!!this.regexp_eatSyntaxCharacter(e)||!!e.eat(47)&&(e.lastIntValue=47,!0);var t=e.current();return!(99===t||e.switchN&&107===t)&&(e.lastIntValue=t,e.advance(),!0)},Hr.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var t=e.current();if(t>=49&&t<=57){do{e.lastIntValue=10*e.lastIntValue+(t-48),e.advance()}while((t=e.current())>=48&&t<=57);return!0}return!1},Hr.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(function(e){return 100===e||68===e||115===e||83===e||119===e||87===e}(t))return e.lastIntValue=-1,e.advance(),!0;if(e.switchU&&this.options.ecmaVersion>=9&&(80===t||112===t)){if(e.lastIntValue=-1,e.advance(),e.eat(123)&&this.regexp_eatUnicodePropertyValueExpression(e)&&e.eat(125))return!0;e.raise("Invalid property name")}return!1},Hr.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var s=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var i=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,s,i),!0}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var n=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,n),!0}return!1},Hr.regexp_validateUnicodePropertyNameAndValue=function(e,t,s){rr(e.unicodeProperties.nonBinary,t)||e.raise("Invalid property name"),e.unicodeProperties.nonBinary[t].test(s)||e.raise("Invalid property value")},Hr.regexp_validateUnicodePropertyNameOrValue=function(e,t){e.unicodeProperties.binary.test(t)||e.raise("Invalid property name")},Hr.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue="";Qr(t=e.current());)e.lastStringValue+=Kr(t),e.advance();return""!==e.lastStringValue},Hr.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue="";Jr(t=e.current());)e.lastStringValue+=Kr(t),e.advance();return""!==e.lastStringValue},Hr.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)},Hr.regexp_eatCharacterClass=function(e){if(e.eat(91)){if(e.eat(94),this.regexp_classRanges(e),e.eat(93))return!0;e.raise("Unterminated character class")}return!1},Hr.regexp_classRanges=function(e){for(;this.regexp_eatClassAtom(e);){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var s=e.lastIntValue;!e.switchU||-1!==t&&-1!==s||e.raise("Invalid character class"),-1!==t&&-1!==s&&t>s&&e.raise("Range out of order in character class")}}},Hr.regexp_eatClassAtom=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){var s=e.current();(99===s||sa(s))&&e.raise("Invalid class escape"),e.raise("Invalid escape")}e.pos=t}var i=e.current();return 93!==i&&(e.lastIntValue=i,e.advance(),!0)},Hr.regexp_eatClassEscape=function(e){var t=e.pos;if(e.eat(98))return e.lastIntValue=8,!0;if(e.switchU&&e.eat(45))return e.lastIntValue=45,!0;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return!0;e.pos=t}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)},Hr.regexp_eatClassControlLetter=function(e){var t=e.current();return!(!Zr(t)&&95!==t)&&(e.lastIntValue=t%32,e.advance(),!0)},Hr.regexp_eatHexEscapeSequence=function(e){var t=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return!0;e.switchU&&e.raise("Invalid escape"),e.pos=t}return!1},Hr.regexp_eatDecimalDigits=function(e){var t=e.pos,s=0;for(e.lastIntValue=0;Zr(s=e.current());)e.lastIntValue=10*e.lastIntValue+(s-48),e.advance();return e.pos!==t},Hr.regexp_eatHexDigits=function(e){var t=e.pos,s=0;for(e.lastIntValue=0;ea(s=e.current());)e.lastIntValue=16*e.lastIntValue+ta(s),e.advance();return e.pos!==t},Hr.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var s=e.lastIntValue;t<=3&&this.regexp_eatOctalDigit(e)?e.lastIntValue=64*t+8*s+e.lastIntValue:e.lastIntValue=8*t+s}else e.lastIntValue=t;return!0}return!1},Hr.regexp_eatOctalDigit=function(e){var t=e.current();return sa(t)?(e.lastIntValue=t-48,e.advance(),!0):(e.lastIntValue=0,!1)},Hr.regexp_eatFixedHexDigits=function(e,t){var s=e.pos;e.lastIntValue=0;for(var i=0;i>10),56320+(1023&e)))}na.next=function(e){!e&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword),this.options.onToken&&this.options.onToken(new ia(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},na.getToken=function(){return this.next(),new ia(this)},"undefined"!=typeof Symbol&&(na[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===Yn.eof,value:t}}}}),na.curContext=function(){return this.context[this.context.length-1]},na.nextToken=function(){var e=this.curContext();return e&&e.preserveSpace||this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length?this.finishToken(Yn.eof):e.override?e.override(this):void this.readToken(this.fullCharCodeAtPos())},na.readToken=function(e){return Un(e,this.options.ecmaVersion>=6)||92===e?this.readWord():this.getTokenFromCode(e)},na.fullCharCodeAtPos=function(){var e=this.input.charCodeAt(this.pos);return e<=55295||e>=57344?e:(e<<10)+this.input.charCodeAt(this.pos+1)-56613888},na.skipBlockComment=function(){var e,t=this.options.onComment&&this.curPosition(),s=this.pos,i=this.input.indexOf("*/",this.pos+=2);if(-1===i&&this.raise(this.pos-2,"Unterminated comment"),this.pos=i+2,this.options.locations)for(Jn.lastIndex=s;(e=Jn.exec(this.input))&&e.index8&&e<14||e>=5760&&er.test(String.fromCharCode(e))))break e;++this.pos}}},na.finishToken=function(e,t){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var s=this.type;this.type=e,this.value=t,this.updateContext(s)},na.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var t=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&46===e&&46===t?(this.pos+=3,this.finishToken(Yn.ellipsis)):(++this.pos,this.finishToken(Yn.dot))},na.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):61===e?this.finishOp(Yn.assign,2):this.finishOp(Yn.slash,1)},na.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),s=1,i=42===e?Yn.star:Yn.modulo;return this.options.ecmaVersion>=7&&42===e&&42===t&&(++s,i=Yn.starstar,t=this.input.charCodeAt(this.pos+2)),61===t?this.finishOp(Yn.assign,s+1):this.finishOp(i,s)},na.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?this.finishOp(124===e?Yn.logicalOR:Yn.logicalAND,2):61===t?this.finishOp(Yn.assign,2):this.finishOp(124===e?Yn.bitwiseOR:Yn.bitwiseAND,1)},na.readToken_caret=function(){return 61===this.input.charCodeAt(this.pos+1)?this.finishOp(Yn.assign,2):this.finishOp(Yn.bitwiseXOR,1)},na.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?45!==t||this.inModule||62!==this.input.charCodeAt(this.pos+2)||0!==this.lastTokEnd&&!Qn.test(this.input.slice(this.lastTokEnd,this.pos))?this.finishOp(Yn.incDec,2):(this.skipLineComment(3),this.skipSpace(),this.nextToken()):61===t?this.finishOp(Yn.assign,2):this.finishOp(Yn.plusMin,1)},na.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),s=1;return t===e?(s=62===e&&62===this.input.charCodeAt(this.pos+2)?3:2,61===this.input.charCodeAt(this.pos+s)?this.finishOp(Yn.assign,s+1):this.finishOp(Yn.bitShift,s)):33!==t||60!==e||this.inModule||45!==this.input.charCodeAt(this.pos+2)||45!==this.input.charCodeAt(this.pos+3)?(61===t&&(s=2),this.finishOp(Yn.relational,s)):(this.skipLineComment(4),this.skipSpace(),this.nextToken())},na.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return 61===t?this.finishOp(Yn.equality,61===this.input.charCodeAt(this.pos+2)?3:2):61===e&&62===t&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(Yn.arrow)):this.finishOp(61===e?Yn.eq:Yn.prefix,1)},na.readToken_question=function(){if(this.options.ecmaVersion>=11){var e=this.input.charCodeAt(this.pos+1);if(46===e){var t=this.input.charCodeAt(this.pos+2);if(t<48||t>57)return this.finishOp(Yn.questionDot,2)}if(63===e)return this.finishOp(Yn.coalesce,2)}return this.finishOp(Yn.question,1)},na.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(Yn.parenL);case 41:return++this.pos,this.finishToken(Yn.parenR);case 59:return++this.pos,this.finishToken(Yn.semi);case 44:return++this.pos,this.finishToken(Yn.comma);case 91:return++this.pos,this.finishToken(Yn.bracketL);case 93:return++this.pos,this.finishToken(Yn.bracketR);case 123:return++this.pos,this.finishToken(Yn.braceL);case 125:return++this.pos,this.finishToken(Yn.braceR);case 58:return++this.pos,this.finishToken(Yn.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(Yn.backQuote);case 48:var t=this.input.charCodeAt(this.pos+1);if(120===t||88===t)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(111===t||79===t)return this.readRadixNumber(8);if(98===t||66===t)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(Yn.prefix,1)}this.raise(this.pos,"Unexpected character '"+ra(e)+"'")},na.finishOp=function(e,t){var s=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,s)},na.readRegexp=function(){for(var e,t,s=this.pos;;){this.pos>=this.input.length&&this.raise(s,"Unterminated regular expression");var i=this.input.charAt(this.pos);if(Qn.test(i)&&this.raise(s,"Unterminated regular expression"),e)e=!1;else{if("["===i)t=!0;else if("]"===i&&t)t=!1;else if("/"===i&&!t)break;e="\\"===i}++this.pos}var n=this.input.slice(s,this.pos);++this.pos;var r=this.pos,a=this.readWord1();this.containsEsc&&this.unexpected(r);var o=this.regexpState||(this.regexpState=new qr(this));o.reset(s,n,a),this.validateRegExpFlags(o),this.validateRegExpPattern(o);var h=null;try{h=new RegExp(n,a)}catch(e){}return this.finishToken(Yn.regexp,{pattern:n,flags:a,value:h})},na.readInt=function(e,t){for(var s=this.pos,i=0,n=0,r=null==t?1/0:t;n=97?a-97+10:a>=65?a-65+10:a>=48&&a<=57?a-48:1/0)>=e)break;++this.pos,i=i*e+o}return this.pos===s||null!=t&&this.pos-s!==t?null:i},na.readRadixNumber=function(e){var t=this.pos;this.pos+=2;var s=this.readInt(e);return null==s&&this.raise(this.start+2,"Expected number in radix "+e),this.options.ecmaVersion>=11&&110===this.input.charCodeAt(this.pos)?(s="undefined"!=typeof BigInt?BigInt(this.input.slice(t,this.pos)):null,++this.pos):Un(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(Yn.num,s)},na.readNumber=function(e){var t=this.pos;e||null!==this.readInt(10)||this.raise(t,"Invalid number");var s=this.pos-t>=2&&48===this.input.charCodeAt(t);s&&this.strict&&this.raise(t,"Invalid number");var i=this.input.charCodeAt(this.pos);if(!s&&!e&&this.options.ecmaVersion>=11&&110===i){var n=this.input.slice(t,this.pos),r="undefined"!=typeof BigInt?BigInt(n):null;return++this.pos,Un(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(Yn.num,r)}s&&/[89]/.test(this.input.slice(t,this.pos))&&(s=!1),46!==i||s||(++this.pos,this.readInt(10),i=this.input.charCodeAt(this.pos)),69!==i&&101!==i||s||(43!==(i=this.input.charCodeAt(++this.pos))&&45!==i||++this.pos,null===this.readInt(10)&&this.raise(t,"Invalid number")),Un(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var a=this.input.slice(t,this.pos),o=s?parseInt(a,8):parseFloat(a);return this.finishToken(Yn.num,o)},na.readCodePoint=function(){var e;if(123===this.input.charCodeAt(this.pos)){this.options.ecmaVersion<6&&this.unexpected();var t=++this.pos;e=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,e>1114111&&this.invalidStringToken(t,"Code point out of bounds")}else e=this.readHexChar(4);return e},na.readString=function(e){for(var t="",s=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var i=this.input.charCodeAt(this.pos);if(i===e)break;92===i?(t+=this.input.slice(s,this.pos),t+=this.readEscapedChar(!1),s=this.pos):(Zn(i,this.options.ecmaVersion>=10)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return t+=this.input.slice(s,this.pos++),this.finishToken(Yn.string,t)};var aa={};na.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e!==aa)throw e;this.readInvalidTemplateToken()}this.inTemplateElement=!1},na.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw aa;this.raise(e,t)},na.readTmplToken=function(){for(var e="",t=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var s=this.input.charCodeAt(this.pos);if(96===s||36===s&&123===this.input.charCodeAt(this.pos+1))return this.pos!==this.start||this.type!==Yn.template&&this.type!==Yn.invalidTemplate?(e+=this.input.slice(t,this.pos),this.finishToken(Yn.template,e)):36===s?(this.pos+=2,this.finishToken(Yn.dollarBraceL)):(++this.pos,this.finishToken(Yn.backQuote));if(92===s)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(!0),t=this.pos;else if(Zn(s)){switch(e+=this.input.slice(t,this.pos),++this.pos,s){case 13:10===this.input.charCodeAt(this.pos)&&++this.pos;case 10:e+="\n";break;default:e+=String.fromCharCode(s)}this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos}else++this.pos}},na.readInvalidTemplateToken=function(){for(;this.pos=48&&t<=55){var i=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],n=parseInt(i,8);return n>255&&(i=i.slice(0,-1),n=parseInt(i,8)),this.pos+=i.length-1,t=this.input.charCodeAt(this.pos),"0"===i&&56!==t&&57!==t||!this.strict&&!e||this.invalidStringToken(this.pos-1-i.length,e?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(n)}return Zn(t)?"":String.fromCharCode(t)}},na.readHexChar=function(e){var t=this.pos,s=this.readInt(16,e);return null===s&&this.invalidStringToken(t,"Bad character escape sequence"),s},na.readWord1=function(){this.containsEsc=!1;for(var e="",t=!0,s=this.pos,i=this.options.ecmaVersion>=6;this.pos(...t)=>{throw Object.assign(new Error(`Cannot access the file system (via "fs.${e}") when using the browser build of Rollup. Make sure you supply a plugin with custom resolveId and load hooks to Rollup.`),{code:"NO_FS_IN_BROWSER",url:"https://rollupjs.org/guide/en/#a-simple-example"})},ca=la("lstatSync"),ua=la("readdirSync"),da=la("readFile"),pa=la("realpathSync"),fa=la("writeFile");async function ma(e,t,s,i,n){const r=await i.hookFirst("resolveId",[e,t],null,n);return null!=r?r:void 0===t||Ie(e)||"."===e[0]?function(e,t){let s=ga(e,t);return s||(s=ga(e+".mjs",t),s||(s=ga(e+".js",t),s))}(De(t?Le(t):De(),e),s):null}function ga(e,t){try{const s=ca(e);if(!t&&s.isSymbolicLink())return ga(pa(e),t);if(t&&s.isSymbolicLink()||s.isFile()){const t=Me(e);if(-1!==ua(Le(e)).indexOf(t))return e}}catch(e){}}function ya(e,t,{hook:s,id:i}={}){return"string"==typeof e&&(e={message:e}),e.code&&e.code!==Wt.PLUGIN_ERROR&&(e.pluginCode=e.code),e.code=Wt.PLUGIN_ERROR,e.plugin=t,s&&(e.hook=s),i&&(e.id=i),Bt(e)}const xa=[{active:!0,deprecated:"resolveAssetUrl",replacement:"resolveFileUrl"}];const Ea={has:()=>!1,get(){},set(){},delete:()=>!1};function va(e){return e.startsWith("at position ")||e.startsWith("at output position ")?Bt({code:"ANONYMOUS_PLUGIN_CACHE",message:"A plugin is trying to use the Rollup cache but is not declaring a plugin name or cacheKey."}):Bt({code:"DUPLICATE_PLUGIN_NAME",message:`The plugin name ${e} is being used twice in the same build. Plugin names must be distinct or provide a cacheKey (please post an issue to the plugin if you are a plugin user).`})}function ba(e,t,s,i){const n=t.id,r=[];let a=null===e.map?null:ln(e.map);const o=e.code;let h=e.ast;const c=[],u=[];let d=!1;const p=()=>d=!0;let f,m=null,g=null;const y=e.code;return s.hookReduceArg0("transform",[y,n],(function(e,t,s){if("string"==typeof t)t={ast:void 0,code:t,map:void 0};else{if(!t||"object"!=typeof t)return e;"string"==typeof t.map&&(t.map=JSON.parse(t.map)),"boolean"==typeof t.moduleSideEffects&&(m=t.moduleSideEffects),"boolean"==typeof t.syntheticNamedExports&&(g=t.syntheticNamedExports)}if(null!==t.map){const e=ln(t.map);r.push(e||{missing:!0,plugin:s.name})}return h=t.ast,t.code}),(e,t)=>{return f=t,{...e,cache:d?e.cache:(h=e.cache,m=p,{has:e=>(m(),h.has(e)),get:e=>(m(),h.get(e)),set:(e,t)=>(m(),h.set(e,t)),delete:e=>(m(),h.delete(e))}),warn(t,s){"string"==typeof t&&(t={message:t}),s&&Ft(t,s,y,n),t.id=n,t.hook="transform",e.warn(t)},error:(t,s)=>("string"==typeof t&&(t={message:t}),s&&Ft(t,s,y,n),t.id=n,t.hook="transform",e.error(t)),emitAsset(e,t){const i={type:"asset",name:e,source:t};return u.push({...i}),s.emitFile(i)},emitChunk(e,t){const i={type:"chunk",id:e,name:t&&t.name};return u.push({...i}),s.emitFile(i)},emitFile:e=>(u.push(e),s.emitFile(e)),addWatchFile(t){c.push(t),e.addWatchFile(t)},setAssetSource(){return this.error({code:"INVALID_SETASSETSOURCE",message:"setAssetSource cannot be called in transform for caching reasons. Use emitFile with a source, or call setAssetSource in another hook."})},getCombinedSourcemap(){const e=function(e,t,s,i,n){return i.length?{version:3,...Ei(e,t,s,i,xi(n)).traceMappings()}:s}(n,o,a,r,i);if(!e){return new x(o).generateMap({includeContent:!0,hires:!0,source:n})}return a!==e&&(a=e,r.length=0),new l({...e,file:null,sourcesContent:e.sourcesContent})}};var h,m}).catch(e=>ya(e,f.name,{hook:"transform",id:n})).then(e=>(d||u.length&&(t.transformFiles=u),{ast:h,code:e,customTransformCache:d,moduleSideEffects:m,originalCode:o,originalSourcemap:a,sourcemapChain:r,syntheticNamedExports:g,transformDependencies:c}))}class Sa{constructor(e,t,s,i){this.graph=e,this.modulesById=t,this.options=s,this.pluginDriver=i,this.implicitEntryModules=new Set,this.indexedEntryModules=[],this.latestLoadModulesPromise=Promise.resolve(),this.nextEntryModuleIndex=0,this.hasModuleSideEffects=s.treeshake?s.treeshake.moduleSideEffects:()=>!0}async addAdditionalModules(e){const t=this.extendLoadModulesPromise(Promise.all(e.map(e=>this.loadEntryModule(e,!1,void 0,null))));return await this.awaitLoadModulesPromise(),t}async addEntryModules(e,t){const s=this.nextEntryModuleIndex;this.nextEntryModuleIndex+=e.length;const i=await this.extendLoadModulesPromise(Promise.all(e.map(({id:e,importer:t})=>this.loadEntryModule(e,!0,t,null))).then(i=>{let n=s;for(let s=0;se.module===r);a?a.index=Math.min(a.index,n):this.indexedEntryModules.push({module:r,index:n}),n++}return this.indexedEntryModules.sort(({index:e},{index:t})=>e>t?1:-1),i}));return await this.awaitLoadModulesPromise(),{entryModules:this.indexedEntryModules.map(({module:e})=>e),implicitEntryModules:[...this.implicitEntryModules],newEntryModules:i}}async emitChunk({fileName:e,id:t,importer:s,name:i,implicitlyLoadedAfterOneOf:n,preserveSignature:r}){const a={fileName:e||null,id:t,importer:s,name:i||null},o=n?await this.addEntryWithImplicitDependants(a,n):(await this.addEntryModules([a],!1)).newEntryModules[0];return null!=r&&(o.preserveSignature=r),o}async resolveId(e,t,s=null){return this.normalizeResolveIdResult(!this.options.external(e,t,!1)&&await ma(e,t,this.options.preserveSymlinks,this.pluginDriver,s),t,e)}addEntryWithImplicitDependants(e,t){return this.extendLoadModulesPromise(this.loadEntryModule(e.id,!1,e.importer,null).then(async s=>{if(Pa(s,e,!1),!s.isEntryPoint){this.implicitEntryModules.add(s);const i=await Promise.all(t.map(t=>this.loadEntryModule(t,!1,e.importer,s.id)));for(const e of i)s.implicitlyLoadedAfter.add(e);for(const e of s.implicitlyLoadedAfter)e.implicitlyLoadedBefore.add(s)}return s}))}async addModuleSource(e,t,s){var i;let n;oi("load modules",3);try{n=null!==(i=await this.pluginDriver.hookFirst("load",[e]))&&void 0!==i?i:await da(e)}catch(s){hi("load modules",3);let i="Could not load "+e;throw t&&(i+=` (imported by ${Dt(t)})`),i+=": "+s.message,s.message=i,s}hi("load modules",3);const r="string"==typeof n?{code:n}:"object"==typeof n&&"string"==typeof n.code?n:Bt(function(e){return{code:Wt.BAD_LOADER,message:`Error loading ${Dt(e)}: plugin load hook should return a string, a { code, map } object, or nothing/null`}}(e)),a=this.graph.cachedModules.get(e);if(a&&!a.customTransformCache&&a.originalCode===r.code){if(a.transformFiles)for(const e of a.transformFiles)this.pluginDriver.emitFile(e);s.setSource(a)}else"boolean"==typeof r.moduleSideEffects&&(s.moduleSideEffects=r.moduleSideEffects),"boolean"==typeof r.syntheticNamedExports&&(s.syntheticNamedExports=r.syntheticNamedExports),s.setSource(await ba(r,s,this.pluginDriver,this.options.onwarn))}async awaitLoadModulesPromise(){let e;do{e=this.latestLoadModulesPromise,await e}while(e!==this.latestLoadModulesPromise)}extendLoadModulesPromise(e){return this.latestLoadModulesPromise=Promise.all([e,this.latestLoadModulesPromise]),this.latestLoadModulesPromise.catch(()=>{}),e}async fetchDynamicDependencies(e){const t=await Promise.all(e.dynamicImports.map(async t=>{const s=await this.resolveDynamicImport(e,t.argument,e.id);return null===s?null:"string"==typeof s?(t.resolution=s,null):t.resolution=await this.fetchResolvedDependency(Dt(s.id),e.id,s)}));for(const s of t)s&&(e.dynamicDependencies.add(s),s.dynamicImporters.push(e.id))}async fetchModule(e,t,s,i,n){const r=this.modulesById.get(e);if(r instanceof mi){if(n){r.isEntryPoint=!0,this.implicitEntryModules.delete(r);for(const e of r.implicitlyLoadedAfter)e.implicitlyLoadedBefore.delete(r);r.implicitlyLoadedAfter.clear()}return r}const a=new mi(this.graph,e,this.options,s,i,n);return this.modulesById.set(e,a),this.graph.watchFiles[e]=!0,await this.addModuleSource(e,t,a),await Promise.all([this.fetchStaticDependencies(a),this.fetchDynamicDependencies(a)]),a.linkImports(),a}fetchResolvedDependency(e,t,s){if(s.external){this.modulesById.has(s.id)||this.modulesById.set(s.id,new Ve(this.options,s.id,s.moduleSideEffects));const i=this.modulesById.get(s.id);return i instanceof Ve?Promise.resolve(i):Bt(function(e,t){return{code:Wt.INVALID_EXTERNAL_ID,message:`'${e}' is imported as an external by ${Dt(t)}, but is already an existing non-external module id.`}}(e,t))}return this.fetchModule(s.id,t,s.moduleSideEffects,s.syntheticNamedExports,!1)}async fetchStaticDependencies(e){for(const t of await Promise.all(Array.from(e.sources,async t=>this.fetchResolvedDependency(t,e.id,e.resolvedIds[t]=e.resolvedIds[t]||this.handleResolveId(await this.resolveId(t,e.id),t,e.id)))))e.dependencies.add(t),t.importers.push(e.id)}handleResolveId(e,t,s){return null===e?$e(t)?Bt(function(e,t){return{code:Wt.UNRESOLVED_IMPORT,message:`Could not resolve '${e}' from ${Dt(t)}`}}(t,s)):(this.options.onwarn(function(e,t){return{code:Wt.UNRESOLVED_IMPORT,importer:Dt(t),message:`'${e}' is imported by ${Dt(t)}, but could not be resolved – treating it as an external dependency`,source:e,url:"https://rollupjs.org/guide/en/#warning-treating-module-as-external-dependency"}}(t,s)),{external:!0,id:t,moduleSideEffects:this.hasModuleSideEffects(t,!0),syntheticNamedExports:!1}):(e.external&&e.syntheticNamedExports&&this.options.onwarn(function(e,t){return{code:Wt.EXTERNAL_SYNTHETIC_EXPORTS,importer:Dt(t),message:`External '${e}' can not have 'syntheticNamedExports' enabled.`,source:e}}(t,s)),e)}async loadEntryModule(e,t,s,i){const n=await ma(e,s,this.options.preserveSymlinks,this.pluginDriver,null);if(!1===n||n&&"object"==typeof n&&n.external)return Bt(null===i?function(e){return{code:Wt.UNRESOLVED_ENTRY,message:`Entry module cannot be external (${Dt(e)}).`}}(e):function(e,t){return{code:Wt.MISSING_IMPLICIT_DEPENDANT,message:`Module "${Dt(e)}" that should be implicitly loaded before "${Dt(t)}" cannot be external.`}}(e,i));const r=n&&"object"==typeof n?n.id:n;return"string"==typeof r?this.fetchModule(r,void 0,!0,!1,t):Bt(null===i?function(e){return{code:Wt.UNRESOLVED_ENTRY,message:`Could not resolve entry module (${Dt(e)}).`}}(e):function(e,t){return{code:Wt.MISSING_IMPLICIT_DEPENDANT,message:`Module "${Dt(e)}" that should be implicitly loaded before "${Dt(t)}" could not be resolved.`}}(e,i))}normalizeResolveIdResult(e,t,s){let i="",n=!1,r=null,a=!1;if(e)"object"==typeof e?(i=e.id,e.external&&(n=!0),"boolean"==typeof e.moduleSideEffects&&(r=e.moduleSideEffects),"boolean"==typeof e.syntheticNamedExports&&(a=e.syntheticNamedExports)):(this.options.external(e,t,!0)&&(n=!0),i=n?Aa(e,t):e);else{if(i=Aa(s,t),!1!==e&&!this.options.external(i,t,!0))return null;n=!0}return{external:n,id:i,moduleSideEffects:"boolean"==typeof r?r:this.hasModuleSideEffects(i,n),syntheticNamedExports:a}}async resolveDynamicImport(e,t,s){const i=await this.pluginDriver.hookFirst("resolveDynamicImport",[t,s]);return"string"!=typeof t?"string"==typeof i?i:i?{external:!1,moduleSideEffects:!0,...i}:null:null==i?e.resolvedIds[t]=e.resolvedIds[t]||this.handleResolveId(await this.resolveId(t,e.id),t,e.id):this.handleResolveId(this.normalizeResolveIdResult(i,s,t),t,s)}}function Aa(e,t){return $e(e)?t?De(t,"..",e):De(e):e}function Pa(e,{fileName:t,name:s},i){null!==t?e.chunkFileNames.add(t):null!==s&&(null===e.chunkName&&(e.chunkName=s),i&&e.userChunkNames.add(s))}function Ca(e,t,s,i,n,r){let a=!1;return(...o)=>(a||(a=!0,Ht({message:`The "this.${t}" plugin context function used by plugin ${i} is deprecated. The "this.${s}" plugin context function should be used instead.`,plugin:i},n,r)),e(...o))}function ka(e,t,s,i){const n=new Set;return(r,a)=>{let o,h=!0;if("string"!=typeof r.cacheKey&&(r.name.startsWith("at position ")||r.name.startsWith("at output position ")||n.has(r.name)?h=!1:n.add(r.name)),e)if(h){const t=r.cacheKey||r.name;c=e[t]||(e[t]=Object.create(null)),o={has(e){const t=c[e];return!!t&&(t[0]=0,!0)},get(e){const t=c[e];if(t)return t[0]=0,t[1]},set(e,t){c[e]=[0,t]},delete:e=>delete c[e]}}else l=r.name,o={has:()=>va(l),get:()=>va(l),set:()=>va(l),delete:()=>va(l)};else o=Ea;var l,c;return{addWatchFile(e){if(t.phase>=vn.GENERATE)return this.error({code:Wt.INVALID_ROLLUP_PHASE,message:"Cannot call addWatchFile after the build has finished."});t.watchFiles[e]=!0},cache:o,emitAsset:Ca((e,t)=>i.emitFile({type:"asset",name:e,source:t}),"emitAsset","emitFile",r.name,!0,s),emitChunk:Ca((e,t)=>i.emitFile({type:"chunk",id:e,name:t&&t.name}),"emitChunk","emitFile",r.name,!0,s),emitFile:i.emitFile,error:e=>ya(e,r.name),getAssetFileName:Ca(i.getFileName,"getAssetFileName","getFileName",r.name,!0,s),getChunkFileName:Ca(i.getFileName,"getChunkFileName","getFileName",r.name,!0,s),getFileName:i.getFileName,getModuleIds:()=>t.modulesById.keys(),getModuleInfo:t.getModuleInfo,isExternal:Ca((e,t,i=!1)=>s.external(e,t,i),"isExternal","resolve",r.name,!0,s),meta:{rollupVersion:"2.18.0",watchMode:t.watchMode},get moduleIds(){const e=t.modulesById.keys();return function*(){Ht({message:`Accessing "this.moduleIds" on the plugin context by plugin ${r.name} is deprecated. The "this.getModuleIds" plugin context function should be used instead.`,plugin:r.name},!1,s),yield*e}()},parse:t.contextParse,resolve:(e,s,i)=>t.moduleLoader.resolveId(e,s,i&&i.skipSelf?a:null),resolveId:Ca((e,s)=>t.moduleLoader.resolveId(e,s).then(e=>e&&e.id),"resolveId","resolve",r.name,!0,s),setAssetSource:i.setAssetSource,warn(e){"string"==typeof e&&(e={message:e}),e.code&&(e.pluginCode=e.code),e.code="PLUGIN_WARNING",e.plugin=r.name,s.onwarn(e)}}}}const wa=Object.keys({buildEnd:1,buildStart:1,load:1,options:1,resolveDynamicImport:1,resolveId:1,transform:1,watchChange:1});function Na(e,t){return Bt({code:"INVALID_PLUGIN_HOOK",message:`Error running plugin hook ${e} for ${t}, expected a function hook.`})}class _a{constructor(e,t,s,i,n){if(this.graph=e,this.options=t,function(e,t){for(const{active:s,deprecated:i,replacement:n}of xa)for(const r of e)i in r&&Ht({message:`The "${i}" hook used by plugin ${r.name} is deprecated. The "${n}" hook should be used instead.`,plugin:r.name},s,t)}(s,t),this.pluginCache=i,this.fileEmitter=new kn(e,t,n&&n.fileEmitter),this.emitFile=this.fileEmitter.emitFile,this.getFileName=this.fileEmitter.getFileName,this.finaliseAssets=this.fileEmitter.assertAssetsFinalized,this.setOutputBundle=this.fileEmitter.setOutputBundle,this.plugins=s.concat(n?n.plugins:[]),this.pluginContexts=this.plugins.map(ka(i,e,t,this.fileEmitter)),n)for(const e of s)for(const s of wa)s in e&&t.onwarn((r=e.name,a=s,{code:Wt.INPUT_HOOK_IN_OUTPUT_PLUGIN,message:`The "${a}" hook used by the output plugin ${r} is a build time hook and will not be run for that plugin. Either this plugin cannot be used as an output plugin, or it should have an option to configure it as an output plugin.`}));var r,a}createOutputPluginDriver(e){return new _a(this.graph,this.options,e,this.pluginCache,this)}hookFirst(e,t,s,i){let n=Promise.resolve(void 0);for(let r=0;rnull!=i?i:this.runHook(e,t,r,!1,s)));return n}hookFirstSync(e,t,s){for(let i=0;i{})}hookReduceArg0(e,[t,...s],i,n){let r=Promise.resolve(t);for(let t=0;t{const a=[r,...s],o=this.runHook(e,a,t,!1,n);return o?o.then(e=>i.call(this.pluginContexts[t],r,e,this.plugins[t])):r});return r}hookReduceArg0Sync(e,[t,...s],i,n){for(let r=0;r{const a=this.runHook(e,s,t,!0,n);return a?a.then(e=>i.call(this.pluginContexts[t],r,e,this.plugins[t])):r});return r}hookReduceValueSync(e,t,s,i,n){let r=t;for(let t=0;tthis.runHook(e,t,n,!1,s));return i}hookSeqSync(e,t,s){for(let i=0;i"function"!=typeof a?i?a:Na(e,r.name):a.apply(o,t)).catch(t=>ya(t,r.name,{hook:e}))}runHookSync(e,t,s,i){const n=this.plugins[s],r=n[e];if(!r)return;let a=this.pluginContexts[s];i&&(a=i(a,n));try{return"function"!=typeof r?Na(e,n.name):r.apply(a,t)}catch(t){return ya(t,n.name,{hook:e})}}}class Ia{constructor(e,t){var s,i;if(this.options=e,this.entryModules=[],this.modulesById=new Map,this.needsTreeshakingPass=!1,this.phase=vn.LOAD_AND_PARSE,this.watchFiles=Object.create(null),this.watchMode=!1,this.externalModules=[],this.implicitEntryModules=[],this.modules=[],this.getModuleInfo=e=>{const t=this.modulesById.get(e);if(null==t)throw new Error("Unable to find module "+e);const s=[],i=[];if(t instanceof mi){for(const e of t.sources)s.push(t.resolvedIds[e].id);for(const{resolution:e}of t.dynamicImports)(e instanceof mi||e instanceof Ve)&&i.push(e.id)}return{dynamicallyImportedIds:i,dynamicImporters:t.dynamicImporters.sort(),hasModuleSideEffects:t.moduleSideEffects,id:t.id,implicitlyLoadedAfterOneOf:t instanceof mi?Array.from(t.implicitlyLoadedAfter,Us):[],implicitlyLoadedBefore:t instanceof mi?Array.from(t.implicitlyLoadedBefore,Us):[],importedIds:s,importers:t.importers.sort(),isEntry:t instanceof mi&&t.isEntryPoint,isExternal:t instanceof Ve}},this.deoptimizationTracker=new U,this.cachedModules=new Map,!1!==e.cache){if(null===(s=e.cache)||void 0===s?void 0:s.modules)for(const t of e.cache.modules)this.cachedModules.set(t.id,t);this.pluginCache=(null===(i=e.cache)||void 0===i?void 0:i.plugins)||Object.create(null);for(const e in this.pluginCache){const t=this.pluginCache[e];for(const e of Object.keys(t))t[e][0]++}}if(this.contextParse=(e,t={})=>this.acornParser.parse(e,{...this.options.acorn,...t}),t){this.watchMode=!0;const e=e=>this.pluginDriver.hookSeqSync("watchChange",[e]);t.on("change",e),t.once("restart",()=>{t.removeListener("change",e)})}this.pluginDriver=new _a(this,e,e.plugins,this.pluginCache),this.scope=new ha,this.acornParser=fr.extend(...e.acornInjectPlugins),this.moduleLoader=new Sa(this,this.modulesById,this.options,this.pluginDriver)}async build(){oi("generate module graph",2),await this.generateModuleGraph(),hi("generate module graph",2),oi("sort modules",2),this.phase=vn.ANALYSE,this.sortModules(),hi("sort modules",2),oi("mark included statements",2),this.includeStatements(),hi("mark included statements",2),this.phase=vn.GENERATE}getCache(){for(const e in this.pluginCache){const t=this.pluginCache[e];let s=!0;for(const e of Object.keys(t))t[e][0]>=this.options.experimentalCacheExpiry?delete t[e]:s=!1;s&&delete this.pluginCache[e]}return{modules:this.modules.map(e=>e.toJSON()),plugins:this.pluginCache}}async generateModuleGraph(){var e;if(({entryModules:this.entryModules,implicitEntryModules:this.implicitEntryModules}=await this.moduleLoader.addEntryModules((e=this.options.input,Array.isArray(e)?e.map(e=>({fileName:null,id:e,implicitlyLoadedAfter:[],importer:void 0,name:null})):Object.keys(e).map(t=>({fileName:null,id:e[t],implicitlyLoadedAfter:[],importer:void 0,name:t}))),!0)),0===this.entryModules.length)throw new Error("You must supply options.input to rollup");for(const e of this.modulesById.values())e instanceof mi?this.modules.push(e):this.externalModules.push(e)}includeStatements(){for(const e of[...this.entryModules,...this.implicitEntryModules])!1!==e.preserveSignature?e.includeAllExports():Be(e);if(this.options.treeshake){let e=1;do{oi("treeshaking pass "+e,3),this.needsTreeshakingPass=!1;for(const e of this.modules)e.isExecuted&&e.include();hi("treeshaking pass "+e++,3)}while(this.needsTreeshakingPass)}else for(const e of this.modules)e.includeAllInBundle();for(const e of this.externalModules)e.warnUnusedImports();for(const e of this.implicitEntryModules)for(const t of e.implicitlyLoadedAfter)t.isEntryPoint||t.isIncluded()||Bt(zt(t))}sortModules(){const{orderedModules:e,cyclePaths:t}=function(e){let t=0;const s=[],i=new Set,n=new Set,r=new Map,a=[],o=e=>{if(e instanceof mi){for(const t of e.dependencies)r.has(t)?i.has(t)||s.push(an(t,e,r)):(r.set(t,e),o(t));for(const t of e.implicitlyLoadedBefore)n.add(t);for(const{resolution:t}of e.dynamicImports)t instanceof mi&&n.add(t);a.push(e)}e.execIndex=t++,i.add(e)};for(const t of e)r.has(t)||(r.set(t,null),o(t));for(const e of n)r.has(e)||(r.set(e,null),o(e));return{orderedModules:a,cyclePaths:s}}(this.entryModules);for(const e of t)this.options.onwarn({code:"CIRCULAR_DEPENDENCY",cycle:e,importer:e[0],message:"Circular dependency: "+e.join(" -> ")});this.modules=e;for(const e of this.modules)e.bindReferences();this.warnForMissingExports()}warnForMissingExports(){for(const e of this.modules)for(const t of Object.keys(e.importDescriptions)){const s=e.importDescriptions[t];"*"===s.name||s.module.getVariableForExportName(s.name)||e.warn({code:"NON_EXISTENT_EXPORT",message:`Non-existent export '${s.name}' is imported from ${Dt(s.module.id)}`,name:s.name,source:s.module.id},s.start)}}}function $a(e){return Array.isArray(e)?e.filter(Boolean):e?[e]:[]}var Ta=function(e){return e&&e.default||e}(oa);const Ma=Object.getPrototypeOf||(e=>e.__proto__);var La=function(e){if(e.prototype.parsePrivateName)return e;const t=(e=>{if(e.acorn)return e.acorn;const t=Ta;if(0!=t.version.indexOf("6.")&&0==t.version.indexOf("6.0.")&&0!=t.version.indexOf("7."))throw new Error("acorn-private-class-elements requires acorn@^6.1.0 or acorn@7.0.0, not "+t.version);for(let s=e;s&&s!==t.Parser;s=Ma(s))if(s!==t.Parser)throw new Error("acorn-private-class-elements does not support mixing different acorn copies");return t})(e);return(e=class extends e{_branch(){return this.__branch=this.__branch||new e({ecmaVersion:this.options.ecmaVersion},this.input),this.__branch.end=this.end,this.__branch.pos=this.pos,this.__branch.type=this.type,this.__branch.value=this.value,this.__branch.containsEsc=this.containsEsc,this.__branch}parsePrivateClassElementName(e){e.computed=!1,e.key=this.parsePrivateName(),"constructor"==e.key.name&&this.raise(e.key.start,"Classes may not have a private element named constructor");const t={get:"set",set:"get"}[e.kind],s=this._privateBoundNames;return Object.prototype.hasOwnProperty.call(s,e.key.name)&&s[e.key.name]!==t&&this.raise(e.start,"Duplicate private element"),s[e.key.name]=e.kind||!0,delete this._unresolvedPrivateNames[e.key.name],e.key}parsePrivateName(){const e=this.startNode();return e.name=this.value,this.next(),this.finishNode(e,"PrivateName"),"never"==this.options.allowReserved&&this.checkUnreserved(e),e}getTokenFromCode(e){if(35===e){++this.pos;const e=this.readWord1();return this.finishToken(this.privateNameToken,e)}return super.getTokenFromCode(e)}parseClass(e,t){const s=this._outerPrivateBoundNames;this._outerPrivateBoundNames=this._privateBoundNames,this._privateBoundNames=Object.create(this._privateBoundNames||null);const i=this._outerUnresolvedPrivateNames;this._outerUnresolvedPrivateNames=this._unresolvedPrivateNames,this._unresolvedPrivateNames=Object.create(null);const n=super.parseClass(e,t),r=this._unresolvedPrivateNames;if(this._privateBoundNames=this._outerPrivateBoundNames,this._outerPrivateBoundNames=s,this._unresolvedPrivateNames=this._outerUnresolvedPrivateNames,this._outerUnresolvedPrivateNames=i,this._unresolvedPrivateNames)Object.assign(this._unresolvedPrivateNames,r);else{const e=Object.keys(r);e.length&&(e.sort((e,t)=>r[e]-r[t]),this.raise(r[e[0]],"Usage of undeclared private name"))}return n}parseClassSuper(e){const t=this._privateBoundNames;this._privateBoundNames=this._outerPrivateBoundNames;const s=this._unresolvedPrivateNames;this._unresolvedPrivateNames=this._outerUnresolvedPrivateNames;const i=super.parseClassSuper(e);return this._privateBoundNames=t,this._unresolvedPrivateNames=s,i}parseSubscript(e,s,i,n,r,a){const o=this.options.ecmaVersion>=11&&t.tokTypes.questionDot,h=this._branch();if(!(h.eat(t.tokTypes.dot)||o&&h.eat(t.tokTypes.questionDot))||h.type!=this.privateNameToken)return super.parseSubscript.apply(this,arguments);let l=!1;this.eat(t.tokTypes.dot)||(this.expect(t.tokTypes.questionDot),l=!0);let c=this.startNodeAt(s,i);return c.object=e,c.computed=!1,o&&(c.optional=l),this.type==this.privateNameToken?("Super"==e.type&&this.raise(this.start,"Cannot access private element on super"),c.property=this.parsePrivateName(),this._privateBoundNames&&this._privateBoundNames[c.property.name]||(this._unresolvedPrivateNames||this.raise(c.property.start,"Usage of undeclared private name"),this._unresolvedPrivateNames[c.property.name]=c.property.start)):c.property=this.parseIdent(!0),this.finishNode(c,"MemberExpression")}parseMaybeUnary(e,t){const s=super.parseMaybeUnary(e,t);return"delete"==s.operator&&"MemberExpression"==s.argument.type&&"PrivateName"==s.argument.property.type&&this.raise(s.start,"Private elements may not be deleted"),s}}).prototype.privateNameToken=new t.TokenType("privateName"),e},Ra=function(e){const t=(e.acorn||Ta).tokTypes;return e=La(e),class extends e{_maybeParseFieldValue(e){if(this.eat(t.eq)){const t=this._inFieldValue;this._inFieldValue=!0,e.value=this.parseExpression(),this._inFieldValue=t}else e.value=null}parseClassElement(e){if(this.options.ecmaVersion>=8&&(this.type==t.name||this.type.keyword||this.type==this.privateNameToken||this.type==t.bracketL||this.type==t.string||this.type==t.num)){const e=this._branch();if(e.type==t.bracketL){let s=0;do{e.eat(t.bracketL)?++s:e.eat(t.bracketR)?--s:e.next()}while(s>0)}else e.next(!0);if(e.type==t.eq||e.canInsertSemicolon()||e.type==t.semi){const e=this.startNode();return this.type==this.privateNameToken?this.parsePrivateClassElementName(e):this.parsePropertyName(e),("Identifier"===e.key.type&&"constructor"===e.key.name||"Literal"===e.key.type&&"constructor"===e.key.value)&&this.raise(e.key.start,"Classes may not have a field called constructor"),this.enterScope(67),this._maybeParseFieldValue(e),this.exitScope(),this.finishNode(e,"FieldDefinition"),this.semicolon(),e}}return super.parseClassElement.apply(this,arguments)}parseIdent(e,t){const s=super.parseIdent(e,t);return this._inFieldValue&&"arguments"==s.name&&this.raise(s.start,"A class field initializer may not contain arguments"),s}}};var Oa=function(e){const t=e.acorn||Ta;return t.version.startsWith("6.")&&!(t.version.startsWith("6.0.")||t.version.startsWith("6.1."))||t.version.startsWith("7.")?function(e,t){return class extends t{readInt(e,t){if(null!=t)return super.readInt(e,t);let s=this.pos,i=0,n=!1;for(;;){let t,s=this.input.charCodeAt(this.pos);if(s>=97)t=s-97+10;else{if(95==s){n||this.raise(this.pos,"Invalid numeric separator"),++this.pos,n=!1;continue}t=s>=65?s-65+10:s>=48&&s<=57?s-48:1/0}if(t>=e)break;++this.pos,i=i*e+t,n=!0}return this.pos===s?null:(n||this.raise(this.pos-1,"Invalid numeric separator"),i)}readNumber(t){let s=this.pos;t||null!==this.readInt(10)||this.raise(s,"Invalid number");let i=this.pos-s>=2&&48===this.input.charCodeAt(s),n=!1;i&&this.strict&&this.raise(s,"Invalid number");let r=this.input.charCodeAt(this.pos);if(!i&&!t&&this.options.ecmaVersion>=11&&110===r){let t=this.getNumberInput(s,this.pos),i="undefined"!=typeof BigInt?BigInt(t):null;return++this.pos,e.isIdentifierStart(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(e.tokTypes.num,i)}i&&/[89]/.test(this.input.slice(s,this.pos))&&(i=!1,n=!0),46!==r||i||(++this.pos,this.readInt(10),r=this.input.charCodeAt(this.pos)),69!==r&&101!==r||i||(r=this.input.charCodeAt(++this.pos),43!==r&&45!==r||++this.pos,null===this.readInt(10)&&this.raise(s,"Invalid number")),e.isIdentifierStart(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");let a=this.getNumberInput(s,this.pos);(i||n)&&a.length=11&&110===this.input.charCodeAt(this.pos)){let e=this.getNumberInput(s,this.pos);i="undefined"!=typeof BigInt?BigInt(e):null,++this.pos}else e.isIdentifierStart(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");return this.finishToken(e.tokTypes.num,i)}getNumberInput(e,t){return this.input.slice(e,t).replace(/_/g,"")}}}(t,e):function(e,t){return class extends t{readInt(e,t){if(null!=t)return super.readInt(e,t);let s=this.pos,i=0,n=!1;for(;;){let t,s=this.input.charCodeAt(this.pos);if(s>=97)t=s-97+10;else{if(95==s){n||this.raise(this.pos,"Invalid numeric separator"),++this.pos,n=!1;continue}t=s>=65?s-65+10:s>=48&&s<=57?s-48:1/0}if(t>=e)break;++this.pos,i=i*e+t,n=!0}return this.pos===s?null:(n||this.raise(this.pos-1,"Invalid numeric separator"),i)}readNumber(e){const t=super.readNumber(e);let s=this.end-this.start>=2&&48===this.input.charCodeAt(this.start);const i=this.getNumberInput(this.start,this.end);return i.length0)}else t.next();if(t.type!=s.eq&&!t.canInsertSemicolon()&&t.type!=s.semi)return super.parseClassElement.apply(this,arguments);const i=this.startNode();return i.static=this.eatContextual("static"),this.type==this.privateNameToken?this.parsePrivateClassElementName(i):this.parsePropertyName(i),("Identifier"===i.key.type&&"constructor"===i.key.name||"Literal"===i.key.type&&!i.computed&&"constructor"===i.key.value)&&this.raise(i.key.start,"Classes may not have a field called constructor"),"prototype"!==(i.key.name||i.key.value)||i.computed||this.raise(i.key.start,"Classes may not have a static property named prototype"),this._maybeParseFieldValue(i),this.finishNode(i,"FieldDefinition"),this.semicolon(),i}parsePropertyName(e){e.static&&this.type==this.privateNameToken?this.parsePrivateClassElementName(e):super.parsePropertyName(e)}parseIdent(e,t){const s=super.parseIdent(e,t);return this._inStaticFieldScope&&this.currentThisScope()===this._inStaticFieldScope&&"arguments"==s.name&&this.raise(s.start,"A static class field initializer may not contain arguments"),s}}};const Va=e=>console.warn(e.message||e);function Ba(e,t,s,i,n=/$./){const r=new Set(t),a=Object.keys(e).filter(e=>!(r.has(e)||n.test(e)));a.length>0&&i({code:"UNKNOWN_OPTION",message:`Unknown ${s}: ${a.join(", ")}. Allowed options: ${[...r].sort().join(", ")}`})}const Fa=e=>e.onwarn?t=>{t.toString=()=>{let e="";return t.plugin&&(e+=`(${t.plugin} plugin) `),t.loc&&(e+=`${Dt(t.loc.file)} (${t.loc.line}:${t.loc.column}) `),e+=t.message,e},e.onwarn(t,Va)}:Va,Wa=e=>({allowAwaitOutsideFunction:!0,ecmaVersion:2020,preserveParens:!1,sourceType:"module",...e.acorn}),Ua=e=>[Ra,Da,Oa,...$a(e.acornInjectPlugins)],za=e=>{var t;return(null===(t=e.cache)||void 0===t?void 0:t.cache)||e.cache},ja=e=>{if(!0===e)return()=>!0;if("function"==typeof e)return(t,...s)=>!t.startsWith("\0")&&e(t,...s)||!1;if(e){const t=new Set,s=[];for(const i of $a(e))i instanceof RegExp?s.push(i):t.add(i);return e=>t.has(e)||s.some(t=>t.test(e))}return()=>!1},Ga=(e,t,s)=>{const i=e.inlineDynamicImports;return i&&qt('The "inlineDynamicImports" option is deprecated. Use the "output.inlineDynamicImports" option instead.',!1,t,s),i},Ha=e=>{const t=e.input;return null==t?[]:"string"==typeof t?[t]:t},qa=(e,t,s)=>{const i=e.manualChunks;return i&&qt('The "manualChunks" option is deprecated. Use the "output.manualChunks" option instead.',!1,t,s),i},Ka=(e,t)=>{const s=e.moduleContext;if("function"==typeof s)return e=>{var i;return null!==(i=s(e))&&void 0!==i?i:t};if(s){const e=Object.create(null);for(const t of Object.keys(s))e[De(t)]=s[t];return s=>e[s]||t}return()=>t},Xa=(e,t)=>{const s=e.preserveEntrySignatures;return null==s&&t.add("preserveEntrySignatures"),null!=s?s:"strict"},Ya=(e,t,s)=>{const i=e.preserveModules;return i&&qt('The "preserveModules" option is deprecated. Use the "output.preserveModules" option instead.',!1,t,s),i},Qa=(e,t,s)=>{const i=e.treeshake;return!1!==i&&(i&&!0!==i?(void 0!==i.pureExternalModules&&qt('The "treeshake.pureExternalModules" option is deprecated. The "treeshake.moduleSideEffects" option should be used instead. "treeshake.pureExternalModules: true" is equivalent to "treeshake.moduleSideEffects: \'no-external\'"',!0,t,s),{annotations:!1!==i.annotations,moduleSideEffects:Ja(i.moduleSideEffects,i.pureExternalModules,t),propertyReadSideEffects:!1!==i.propertyReadSideEffects,tryCatchDeoptimization:!1!==i.tryCatchDeoptimization,unknownGlobalSideEffects:!1!==i.unknownGlobalSideEffects}):{annotations:!0,moduleSideEffects:()=>!0,propertyReadSideEffects:!0,tryCatchDeoptimization:!0,unknownGlobalSideEffects:!0})},Ja=(e,t,s)=>{if("boolean"==typeof e)return()=>e;if("no-external"===e)return(e,t)=>!t;if("function"==typeof e)return(t,s)=>!!t.startsWith("\0")||!1!==e(t,s);if(Array.isArray(e)){const t=new Set(e);return e=>t.has(e)}var i,n;e&&s((i="treeshake.moduleSideEffects",n='please use one of false, "no-external", a function or an array',{code:Wt.INVALID_OPTION,message:`Invalid value for option "${i}" - ${n}.`}));const r=ja(t);return(e,t)=>!(t&&r(e))};const Za=(e,t,s)=>{const i=e.file;if("string"==typeof i){if(t)return Bt({code:"INVALID_OPTION",message:'You must set "output.dir" instead of "output.file" when using the "output.preserveModules" option.'});if(!Array.isArray(s.input))return Bt({code:"INVALID_OPTION",message:'You must set "output.dir" instead of "output.file" when providing named inputs.'})}return i},eo=e=>{const t=e.format;switch(t){case void 0:case"es":case"esm":case"module":return"es";case"cjs":case"commonjs":return"cjs";case"system":case"systemjs":return"system";case"amd":case"iife":case"umd":return t;default:return Bt({message:'You must specify "output.format", which can be one of "amd", "cjs", "system", "es", "iife" or "umd".',url:"https://rollupjs.org/guide/en/#output-format"})}},to=(e,t)=>{var s;const i=(null!==(s=e.inlineDynamicImports)&&void 0!==s?s:t.inlineDynamicImports)||!1,{input:n}=t;return i&&(Array.isArray(n)?n:Object.keys(n)).length>1?Bt({code:"INVALID_OPTION",message:'Multiple inputs are not supported for "output.inlineDynamicImports".'}):i},so=(e,t,s)=>{var i;const n=(null!==(i=e.preserveModules)&&void 0!==i?i:s.preserveModules)||!1;if(n){if(t)return Bt({code:"INVALID_OPTION",message:'The "output.inlineDynamicImports" option is not supported for "output.preserveModules".'});if(!1===s.preserveEntrySignatures)return Bt({code:"INVALID_OPTION",message:'Setting "preserveEntrySignatures" to "false" is not supported for "output.preserveModules".'})}return n},io=e=>({define:"define",...e.amd}),no=(e,t)=>{const s=e[t];return"function"==typeof s?s:()=>s||""},ro=(e,t)=>{const s=e.dir;return"string"==typeof s&&"string"==typeof t?Bt({code:"INVALID_OPTION",message:'You must set either "output.file" for a single-file build or "output.dir" when generating multiple chunks.'}):s},ao=(e,t)=>{const s=e.dynamicImportFunction;return s&&Ht('The "output.dynamicImportFunction" option is deprecated. Use the "renderDynamicImport" plugin hook instead.',!1,t),s},oo=(e,t)=>{const s=e.entryFileNames;return null==s&&t.add("entryFileNames"),null!=s?s:"[name].js"};function ho(e){const t=e.exports;return t&&!["default","named","none","auto"].includes(t)?Bt((s=t,{code:Wt.INVALID_EXPORT_OPTION,message:`"output.exports" must be "default", "named", "none", "auto", or left unspecified (defaults to "auto"), received "${s}"`,url:"https://rollupjs.org/guide/en/#output-exports"})):t||"auto";var s}const lo=(e,t)=>{if(t)return"";const s=e.indent;return!1===s?"":null==s||s},co=(e,t,s,i)=>{const n=e.manualChunks||i.manualChunks;if(n){if(t)return Bt({code:"INVALID_OPTION",message:'The "output.manualChunks" option is not supported for "output.inlineDynamicImports".'});if(s)return Bt({code:"INVALID_OPTION",message:'The "output.manualChunks" option is not supported for "output.preserveModules".'})}return n||{}},uo=(e,t,s)=>{var i;return null!==(i=e.minifyInternalExports)&&void 0!==i?i:s||"es"===t||"system"===t};function po(e){return async function(e,t){const{options:s,unsetOptions:i}=function(e,t){if(!e)throw new Error("You must supply an options object to rollup");const s=$a(e.plugins),{options:i,unsetOptions:n}=function(e){var t,s;const i=new Set,n=null!==(t=e.context)&&void 0!==t?t:"undefined",r=Fa(e),a=e.strictDeprecations||!1,o={acorn:Wa(e),acornInjectPlugins:Ua(e),cache:za(e),context:n,experimentalCacheExpiry:null!==(s=e.experimentalCacheExpiry)&&void 0!==s?s:10,external:ja(e.external),inlineDynamicImports:Ga(e,r,a),input:Ha(e),manualChunks:qa(e,r,a),moduleContext:Ka(e,n),onwarn:r,perf:e.perf||!1,plugins:$a(e.plugins),preserveEntrySignatures:Xa(e,i),preserveModules:Ya(e,r,a),preserveSymlinks:e.preserveSymlinks||!1,shimMissingExports:e.shimMissingExports||!1,strictDeprecations:a,treeshake:Qa(e,r,a)};return Ba(e,[...Object.keys(o),"watch"],"input options",o.onwarn,/^(output)$/),{options:o,unsetOptions:i}}(s.reduce(function(e){return(t,s)=>s.options&&s.options.call({meta:{rollupVersion:"2.18.0",watchMode:e}},t)||t}(t),e));return fo(i.plugins,"at position "),{options:i,unsetOptions:n}}(e,null!==t);ui(s);const n=new Ia(s,t),r=!1!==e.cache;delete s.cache,delete e.cache,oi("BUILD",1);try{await n.pluginDriver.hookParallel("buildStart",[s]),await n.build()}catch(e){const t=Object.keys(n.watchFiles);throw t.length>0&&(e.watchFiles=t),await n.pluginDriver.hookParallel("buildEnd",[e]),e}await n.pluginDriver.hookParallel("buildEnd",[]),hi("BUILD",1);const a={cache:r?n.getCache():void 0,generate:async e=>mo(!1,s,i,e,n),watchFiles:Object.keys(n.watchFiles),write:async e=>mo(!0,s,i,e,n)};s.perf&&(a.getTimings=ai);return a}(e,null)}function fo(e,t){for(let s=0;sfunction(e,t){const s=De(t.dir||Le(t.file),e.fileName);let i,n;if("asset"===e.type)n=e.source;else if(n=e.code,t.sourcemap&&e.map){let r;"inline"===t.sourcemap?r=e.map.toUrl():(r=Me(e.fileName)+".map",i=fa(s+".map",e.map.toString())),"hidden"!==t.sourcemap&&(n+=`//# sourceMappingURL=${r}\n`)}return Promise.all([fa(s,n),i])}(l[e],r))),await a.hookParallel("writeBundle",[r,l])}return c=l,{output:Object.keys(c).map(e=>c[e]).filter(e=>Object.keys(e).length>0).sort((e,t)=>{const s=xo(e),i=xo(t);return s===i?0:st||e,e=>{const t=()=>e.error({code:Wt.CANNOT_EMIT_FROM_OPTIONS_HOOK,message:'Cannot emit files or set asset sources in the "outputOptions" hook, use the "renderStart" hook instead.'});return{...e,emitFile:t,setAssetSource:t}}),e,t)}var yo;function xo(e){return"asset"===e.type?yo.ASSET:e.isEntry?yo.ENTRY_CHUNK:yo.SECONDARY_CHUNK}!function(e){e[e.ENTRY_CHUNK=0]="ENTRY_CHUNK",e[e.SECONDARY_CHUNK=1]="SECONDARY_CHUNK",e[e.ASSET=2]="ASSET"}(yo||(yo={}));export{e as VERSION,po as rollup}; +for(var e="2.79.1",t={},i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",s=0;s>>=5)>0&&(s|=32),t+=i[s]}while(e>0);return t}class a{constructor(e){this.bits=e instanceof a?e.bits.slice():[]}add(e){this.bits[e>>5]|=1<<(31&e)}has(e){return!!(this.bits[e>>5]&1<<(31&e))}}class o{constructor(e,t,i){this.start=e,this.end=t,this.original=i,this.intro="",this.outro="",this.content=i,this.storeName=!1,this.edited=!1,Object.defineProperties(this,{previous:{writable:!0,value:null},next:{writable:!0,value:null}})}appendLeft(e){this.outro+=e}appendRight(e){this.intro=this.intro+e}clone(){const e=new o(this.start,this.end,this.original);return e.intro=this.intro,e.outro=this.outro,e.content=this.content,e.storeName=this.storeName,e.edited=this.edited,e}contains(e){return this.start{throw new Error("Unsupported environment: `window.btoa` or `Buffer` should be supported.")};"undefined"!=typeof window&&"function"==typeof window.btoa?l=e=>window.btoa(unescape(encodeURIComponent(e))):"function"==typeof Buffer&&(l=e=>Buffer.from(e,"utf-8").toString("base64"));class h{constructor(e){this.version=3,this.file=e.file,this.sources=e.sources,this.sourcesContent=e.sourcesContent,this.names=e.names,this.mappings=function(e){for(var t=0,i=0,s=0,n=0,a="",o=0;o0&&(a+=";"),0!==l.length){for(var h=0,c=[],u=0,d=l;u1&&(f+=r(p[1]-t)+r(p[2]-i)+r(p[3]-s),t=p[1],i=p[2],s=p[3]),5===p.length&&(f+=r(p[4]-n),n=p[4]),c.push(f)}a+=c.join(",")}}return a}(e.mappings)}toString(){return JSON.stringify(this)}toUrl(){return"data:application/json;charset=utf-8;base64,"+l(this.toString())}}function c(e){const t=e.split("\n"),i=t.filter((e=>/^\t+/.test(e))),s=t.filter((e=>/^ {2,}/.test(e)));if(0===i.length&&0===s.length)return null;if(i.length>=s.length)return"\t";const n=s.reduce(((e,t)=>{const i=/^ +/.exec(t)[0].length;return Math.min(i,e)}),1/0);return new Array(n+1).join(" ")}function u(e,t){const i=e.split(/[/\\]/),s=t.split(/[/\\]/);for(i.pop();i[0]===s[0];)i.shift(),s.shift();if(i.length){let e=i.length;for(;e--;)i[e]=".."}return i.concat(s).join("/")}const d=Object.prototype.toString;function p(e){return"[object Object]"===d.call(e)}function f(e){const t=e.split("\n"),i=[];for(let e=0,s=0;e>1;e=0&&t.push(s),this.rawSegments.push(t)}else this.pending&&this.rawSegments.push(this.pending);this.advance(t),this.pending=null}addUneditedChunk(e,t,i,s,n){let r=t.start,a=!0;for(;r1){for(let e=0;e{const n=s(e.start);e.intro.length&&i.advance(e.intro),e.edited?i.addEdit(0,e.content,n,e.storeName?t.indexOf(e.original):-1):i.addUneditedChunk(0,e,this.original,n,this.sourcemapLocations),e.outro.length&&i.advance(e.outro)})),{file:e.file?e.file.split(/[/\\]/).pop():null,sources:[e.source?u(e.file||"",e.source):null],sourcesContent:e.includeContent?[this.original]:[null],names:t,mappings:i.raw}}generateMap(e){return new h(this.generateDecodedMap(e))}getIndentString(){return null===this.indentStr?"\t":this.indentStr}indent(e,t){const i=/^[^\r\n]/gm;if(p(e)&&(t=e,e=void 0),""===(e=void 0!==e?e:this.indentStr||"\t"))return this;const s={};if((t=t||{}).exclude){("number"==typeof t.exclude[0]?[t.exclude]:t.exclude).forEach((e=>{for(let t=e[0];tn?`${e}${t}`:(n=!0,t);this.intro=this.intro.replace(i,r);let a=0,o=this.firstChunk;for(;o;){const t=o.end;if(o.edited)s[a]||(o.content=o.content.replace(i,r),o.content.length&&(n="\n"===o.content[o.content.length-1]));else for(a=o.start;a=e&&i<=t)throw new Error("Cannot move a selection inside itself");this._split(e),this._split(t),this._split(i);const s=this.byStart[e],n=this.byEnd[t],r=s.previous,a=n.next,o=this.byStart[i];if(!o&&n===this.lastChunk)return this;const l=o?o.previous:this.lastChunk;return r&&(r.next=a),a&&(a.previous=r),l&&(l.next=s),o&&(o.previous=n),s.previous||(this.firstChunk=n.next),n.next||(this.lastChunk=s.previous,this.lastChunk.next=null),s.previous=l,n.next=o||null,l||(this.firstChunk=s),o||(this.lastChunk=n),this}overwrite(e,t,i,s){if("string"!=typeof i)throw new TypeError("replacement content must be a string");for(;e<0;)e+=this.original.length;for(;t<0;)t+=this.original.length;if(t>this.original.length)throw new Error("end is out of bounds");if(e===t)throw new Error("Cannot overwrite a zero-length range – use appendLeft or prependRight instead");this._split(e),this._split(t),!0===s&&(y.storeName||(console.warn("The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string"),y.storeName=!0),s={storeName:!0});const n=void 0!==s&&s.storeName,r=void 0!==s&&s.contentOnly;if(n){const i=this.original.slice(e,t);Object.defineProperty(this.storedNames,i,{writable:!0,value:!0,enumerable:!0})}const a=this.byStart[e],l=this.byEnd[t];if(a){let e=a;for(;e!==l;){if(e.next!==this.byStart[e.end])throw new Error("Cannot overwrite across a split point");e=e.next,e.edit("",!1)}a.edit(i,n,r)}else{const s=new o(e,t,"").edit(i,n);l.next=s,s.previous=l}return this}prepend(e){if("string"!=typeof e)throw new TypeError("outro content must be a string");return this.intro=e+this.intro,this}prependLeft(e,t){if("string"!=typeof t)throw new TypeError("inserted content must be a string");this._split(e);const i=this.byEnd[e];return i?i.prependLeft(t):this.intro=t+this.intro,this}prependRight(e,t){if("string"!=typeof t)throw new TypeError("inserted content must be a string");this._split(e);const i=this.byStart[e];return i?i.prependRight(t):this.outro=t+this.outro,this}remove(e,t){for(;e<0;)e+=this.original.length;for(;t<0;)t+=this.original.length;if(e===t)return this;if(e<0||t>this.original.length)throw new Error("Character is out of bounds");if(e>t)throw new Error("end must be greater than start");this._split(e),this._split(t);let i=this.byStart[e];for(;i;)i.intro="",i.outro="",i.edit(""),i=t>i.end?this.byStart[i.end]:null;return this}lastChar(){if(this.outro.length)return this.outro[this.outro.length-1];let e=this.lastChunk;do{if(e.outro.length)return e.outro[e.outro.length-1];if(e.content.length)return e.content[e.content.length-1];if(e.intro.length)return e.intro[e.intro.length-1]}while(e=e.previous);return this.intro.length?this.intro[this.intro.length-1]:""}lastLine(){let e=this.outro.lastIndexOf(g);if(-1!==e)return this.outro.substr(e+1);let t=this.outro,i=this.lastChunk;do{if(i.outro.length>0){if(e=i.outro.lastIndexOf(g),-1!==e)return i.outro.substr(e+1)+t;t=i.outro+t}if(i.content.length>0){if(e=i.content.lastIndexOf(g),-1!==e)return i.content.substr(e+1)+t;t=i.content+t}if(i.intro.length>0){if(e=i.intro.lastIndexOf(g),-1!==e)return i.intro.substr(e+1)+t;t=i.intro+t}}while(i=i.previous);return e=this.intro.lastIndexOf(g),-1!==e?this.intro.substr(e+1)+t:this.intro+t}slice(e=0,t=this.original.length){for(;e<0;)e+=this.original.length;for(;t<0;)t+=this.original.length;let i="",s=this.firstChunk;for(;s&&(s.start>e||s.end<=e);){if(s.start=t)return i;s=s.next}if(s&&s.edited&&s.start!==e)throw new Error(`Cannot use replaced character ${e} as slice start anchor.`);const n=s;for(;s;){!s.intro||n===s&&s.start!==e||(i+=s.intro);const r=s.start=t;if(r&&s.edited&&s.end!==t)throw new Error(`Cannot use replaced character ${t} as slice end anchor.`);const a=n===s?e-s.start:0,o=r?s.content.length+t-s.end:s.content.length;if(i+=s.content.slice(a,o),!s.outro||r&&s.end!==t||(i+=s.outro),r)break;s=s.next}return i}snip(e,t){const i=this.clone();return i.remove(0,e),i.remove(t,i.original.length),i}_split(e){if(this.byStart[e]||this.byEnd[e])return;let t=this.lastSearchedChunk;const i=e>t.end;for(;t;){if(t.contains(e))return this._splitChunk(t,e);t=i?this.byStart[t.end]:this.byEnd[t.start]}}_splitChunk(e,t){if(e.edited&&e.content.length){const i=f(this.original)(t);throw new Error(`Cannot split a chunk that has already been edited (${i.line}:${i.column} – "${e.original}")`)}const i=e.split(t);return this.byEnd[t]=e,this.byStart[t]=i,this.byEnd[i.end]=i,e===this.lastChunk&&(this.lastChunk=i),this.lastSearchedChunk=e,!0}toString(){let e=this.intro,t=this.firstChunk;for(;t;)e+=t.toString(),t=t.next;return e+this.outro}isEmpty(){let e=this.firstChunk;do{if(e.intro.length&&e.intro.trim()||e.content.length&&e.content.trim()||e.outro.length&&e.outro.trim())return!1}while(e=e.next);return!0}length(){let e=this.firstChunk,t=0;do{t+=e.intro.length+e.content.length+e.outro.length}while(e=e.next);return t}trimLines(){return this.trim("[\\r\\n]")}trim(e){return this.trimStart(e).trimEnd(e)}trimEndAborted(e){const t=new RegExp((e||"\\s")+"+$");if(this.outro=this.outro.replace(t,""),this.outro.length)return!0;let i=this.lastChunk;do{const e=i.end,s=i.trimEnd(t);if(i.end!==e&&(this.lastChunk===i&&(this.lastChunk=i.next),this.byEnd[i.end]=i,this.byStart[i.next.start]=i.next,this.byEnd[i.next.end]=i.next),s)return!0;i=i.previous}while(i);return!1}trimEnd(e){return this.trimEndAborted(e),this}trimStartAborted(e){const t=new RegExp("^"+(e||"\\s")+"+");if(this.intro=this.intro.replace(t,""),this.intro.length)return!0;let i=this.firstChunk;do{const e=i.end,s=i.trimStart(t);if(i.end!==e&&(i===this.lastChunk&&(this.lastChunk=i.next),this.byEnd[i.end]=i,this.byStart[i.next.start]=i.next,this.byEnd[i.next.end]=i.next),s)return!0;i=i.next}while(i);return!1}trimStart(e){return this.trimStartAborted(e),this}hasChanged(){return this.original!==this.toString()}replace(e,t){function i(e,i){return"string"==typeof t?t.replace(/\$(\$|&|\d+)/g,((t,i)=>{if("$"===i)return"$";if("&"===i)return e[0];return+i{null!=e.index&&this.overwrite(e.index,e.index+e[0].length,i(e,this.original))}))}else{const t=this.original.match(e);t&&null!=t.index&&this.overwrite(t.index,t.index+t[0].length,i(t,this.original))}return this}}const E=Object.prototype.hasOwnProperty;class b{constructor(e={}){this.intro=e.intro||"",this.separator=void 0!==e.separator?e.separator:"\n",this.sources=[],this.uniqueSources=[],this.uniqueSourceIndexByFilename={}}addSource(e){if(e instanceof x)return this.addSource({content:e,filename:e.filename,separator:this.separator});if(!p(e)||!e.content)throw new Error("bundle.addSource() takes an object with a `content` property, which should be an instance of MagicString, and an optional `filename`");if(["filename","indentExclusionRanges","separator"].forEach((t=>{E.call(e,t)||(e[t]=e.content[t])})),void 0===e.separator&&(e.separator=this.separator),e.filename)if(E.call(this.uniqueSourceIndexByFilename,e.filename)){const t=this.uniqueSources[this.uniqueSourceIndexByFilename[e.filename]];if(e.content.original!==t.content)throw new Error(`Illegal source: same filename (${e.filename}), different contents`)}else this.uniqueSourceIndexByFilename[e.filename]=this.uniqueSources.length,this.uniqueSources.push({filename:e.filename,content:e.content.original});return this.sources.push(e),this}append(e,t){return this.addSource({content:new x(e),separator:t&&t.separator||""}),this}clone(){const e=new b({intro:this.intro,separator:this.separator});return this.sources.forEach((t=>{e.addSource({filename:t.filename,content:t.content.clone(),separator:t.separator})})),e}generateDecodedMap(e={}){const t=[];this.sources.forEach((e=>{Object.keys(e.content.storedNames).forEach((e=>{~t.indexOf(e)||t.push(e)}))}));const i=new m(e.hires);return this.intro&&i.advance(this.intro),this.sources.forEach(((e,s)=>{s>0&&i.advance(this.separator);const n=e.filename?this.uniqueSourceIndexByFilename[e.filename]:-1,r=e.content,a=f(r.original);r.intro&&i.advance(r.intro),r.firstChunk.eachNext((s=>{const o=a(s.start);s.intro.length&&i.advance(s.intro),e.filename?s.edited?i.addEdit(n,s.content,o,s.storeName?t.indexOf(s.original):-1):i.addUneditedChunk(n,s,r.original,o,r.sourcemapLocations):i.advance(s.content),s.outro.length&&i.advance(s.outro)})),r.outro&&i.advance(r.outro)})),{file:e.file?e.file.split(/[/\\]/).pop():null,sources:this.uniqueSources.map((t=>e.file?u(e.file,t.filename):t.filename)),sourcesContent:this.uniqueSources.map((t=>e.includeContent?t.content:null)),names:t,mappings:i.raw}}generateMap(e){return new h(this.generateDecodedMap(e))}getIndentString(){const e={};return this.sources.forEach((t=>{const i=t.content.indentStr;null!==i&&(e[i]||(e[i]=0),e[i]+=1)})),Object.keys(e).sort(((t,i)=>e[t]-e[i]))[0]||"\t"}indent(e){if(arguments.length||(e=this.getIndentString()),""===e)return this;let t=!this.intro||"\n"===this.intro.slice(-1);return this.sources.forEach(((i,s)=>{const n=void 0!==i.separator?i.separator:this.separator,r=t||s>0&&/\r?\n$/.test(n);i.content.indent(e,{exclude:i.indentExclusionRanges,indentStart:r}),t="\n"===i.content.lastChar()})),this.intro&&(this.intro=e+this.intro.replace(/^[^\n]/gm,((t,i)=>i>0?e+t:t))),this}prepend(e){return this.intro=e+this.intro,this}toString(){const e=this.sources.map(((e,t)=>{const i=void 0!==e.separator?e.separator:this.separator;return(t>0?i:"")+e.content.toString()})).join("");return this.intro+e}isEmpty(){return(!this.intro.length||!this.intro.trim())&&!this.sources.some((e=>!e.content.isEmpty()))}length(){return this.sources.reduce(((e,t)=>e+t.content.length()),this.intro.length)}trimLines(){return this.trim("[\\r\\n]")}trim(e){return this.trimStart(e).trimEnd(e)}trimStart(e){const t=new RegExp("^"+(e||"\\s")+"+");if(this.intro=this.intro.replace(t,""),!this.intro){let t,i=0;do{if(t=this.sources[i++],!t)break}while(!t.content.trimStartAborted(e))}return this}trimEnd(e){const t=new RegExp((e||"\\s")+"+$");let i,s=this.sources.length-1;do{if(i=this.sources[s--],!i){this.intro=this.intro.replace(t,"");break}}while(!i.content.trimEndAborted(e));return this}}const v=/^(?:\/|(?:[A-Za-z]:)?[\\|/])/,S=/^\.?\.\//,A=/\\/g,I=/[/\\]/,P=/\.[^.]+$/;function k(e){return v.test(e)}function w(e){return S.test(e)}function C(e){return e.replace(A,"/")}function _(e){return e.split(I).pop()||""}function N(e){const t=/[/\\][^/\\]*$/.exec(e);if(!t)return".";const i=e.slice(0,-t[0].length);return i||"/"}function $(e){const t=P.exec(_(e));return t?t[0]:""}function T(e,t){const i=e.split(I).filter(Boolean),s=t.split(I).filter(Boolean);for("."===i[0]&&i.shift(),"."===s[0]&&s.shift();i[0]&&s[0]&&i[0]===s[0];)i.shift(),s.shift();for(;".."===s[0]&&i.length>0;)s.shift(),i.pop();for(;i.pop();)s.unshift("..");return s.join("/")}function O(...e){const t=e.shift();if(!t)return"/";let i=t.split(I);for(const t of e)if(k(t))i=t.split(I);else{const e=t.split(I);for(;"."===e[0]||".."===e[0];){".."===e.shift()&&i.pop()}i.push(...e)}return i.join("/")}function R(e,t,i){const s=e.get(t);if(s)return s;const n=i();return e.set(t,n),n}const M=Symbol("Unknown Key"),D=Symbol("Unknown Non-Accessor Key"),L=Symbol("Unknown Integer"),V=[],B=[M],F=[D],z=[L],j=Symbol("Entities");class U{constructor(){this.entityPaths=Object.create(null,{[j]:{value:new Set}})}trackEntityAtPathAndGetIfTracked(e,t){const i=this.getEntities(e);return!!i.has(t)||(i.add(t),!1)}withTrackedEntityAtPath(e,t,i,s){const n=this.getEntities(e);if(n.has(t))return s;n.add(t);const r=i();return n.delete(t),r}getEntities(e){let t=this.entityPaths;for(const i of e)t=t[i]=t[i]||Object.create(null,{[j]:{value:new Set}});return t[j]}}const G=new U;class H{constructor(){this.entityPaths=Object.create(null,{[j]:{value:new Map}})}trackEntityAtPathAndGetIfTracked(e,t,i){let s=this.entityPaths;for(const t of e)s=s[t]=s[t]||Object.create(null,{[j]:{value:new Map}});const n=R(s[j],t,(()=>new Set));return!!n.has(i)||(n.add(i),!1)}}const W=Symbol("Unknown Value"),q=Symbol("Unknown Truthy Value");class K{constructor(){this.included=!1}deoptimizePath(e){}deoptimizeThisOnInteractionAtPath({thisArg:e},t,i){e.deoptimizePath(B)}getLiteralValueAtPath(e,t,i){return W}getReturnExpressionWhenCalledAtPath(e,t,i,s){return X}hasEffectsOnInteractionAtPath(e,t,i){return!0}include(e,t,i){this.included=!0}includeCallArguments(e,t){for(const i of t)i.include(e,!1)}shouldBeIncluded(e){return!0}}const X=new class extends K{},Y={thisArg:null,type:0},Q={args:[X],thisArg:null,type:1},J=[],Z={args:J,thisArg:null,type:2,withNew:!1};class ee extends K{constructor(e){super(),this.name=e,this.alwaysRendered=!1,this.initReached=!1,this.isId=!1,this.isReassigned=!1,this.kind=null,this.renderBaseName=null,this.renderName=null}addReference(e){}getBaseVariableName(){return this.renderBaseName||this.renderName||this.name}getName(e){const t=this.renderName||this.name;return this.renderBaseName?`${this.renderBaseName}${e(t)}`:t}hasEffectsOnInteractionAtPath(e,{type:t},i){return 0!==t||e.length>0}include(){this.included=!0}markCalledFromTryStatement(){}setRenderNames(e,t){this.renderBaseName=e,this.renderName=t}}class te extends ee{constructor(e,t){super(t),this.referenced=!1,this.module=e,this.isNamespace="*"===t}addReference(e){this.referenced=!0,"default"!==this.name&&"*"!==this.name||this.module.suggestName(e.name)}hasEffectsOnInteractionAtPath(e,{type:t}){return 0!==t||e.length>(this.isNamespace?1:0)}include(){this.included||(this.included=!0,this.module.used=!0)}}const ie=Object.freeze(Object.create(null)),se=Object.freeze({}),ne=Object.freeze([]);function re(e,t,i){if("number"==typeof i)throw new Error("locate takes a { startIndex, offsetLine, offsetColumn } object as the third argument");return function(e,t){void 0===t&&(t={});var i=t.offsetLine||0,s=t.offsetColumn||0,n=e.split("\n"),r=0,a=n.map((function(e,t){var i=r+e.length+1,s={start:r,end:i,line:t};return r=i,s})),o=0;function l(e,t){return e.start<=t&&t=s.end?1:-1;s;){if(l(s,t))return h(s,t);s=a[o+=n]}}}(e,i)(t,i&&i.startIndex)}function ae(e){return e.replace(/^\t+/,(e=>e.split("\t").join(" ")))}function oe(e,t){const i=e.length<=1,s=e.map((e=>`"${e}"`));let n=i?s[0]:`${s.slice(0,-1).join(", ")} and ${s.slice(-1)[0]}`;return t&&(n+=` ${i?t[0]:t[1]}`),n}function le(e){const t=_(e);return t.substring(0,t.length-$(e).length)}function he(e){return k(e)?T(O(),e):e}function ce(e){return"/"===e[0]||"."===e[0]&&("/"===e[1]||"."===e[1])||k(e)}const ue=/^(\.\.\/)*\.\.$/;function de(e,t,i,s){let n=C(T(N(e),t));if(i&&n.endsWith(".js")&&(n=n.slice(0,-3)),s){if(""===n)return"../"+_(t);if(ue.test(n))return n.split("/").concat(["..",_(t)]).join("/")}return n?n.startsWith("..")?n:"./"+n:"."}function pe(e){throw e instanceof Error||(e=Object.assign(new Error(e.message),e)),e}function fe(e,t,i,s){if("object"==typeof t){const{line:i,column:n}=t;e.loc={column:n,file:s,line:i}}else{e.pos=t;const{line:n,column:r}=re(i,t,{offsetLine:1});e.loc={column:r,file:s,line:n}}if(void 0===e.frame){const{line:t,column:s}=e.loc;e.frame=function(e,t,i){let s=e.split("\n");const n=Math.max(0,t-3);let r=Math.min(t+2,s.length);for(s=s.slice(n,r);!/\S/.test(s[s.length-1]);)s.pop(),r-=1;const a=String(r).length;return s.map(((e,s)=>{const r=n+s+1===t;let o=String(s+n+1);for(;o.lengthhe(e.id))).sort();return{code:me.MISSING_IMPLICIT_DEPENDANT,message:`Module "${he(e.id)}" that should be implicitly loaded before ${oe(t)} is not included in the module graph. Either it was not imported by an included module or only via a tree-shaken dynamic import, or no imported bindings were used and it had otherwise no side-effects.`}}function ve(e,t,i){const s=i?"reexport":"import";return{code:me.UNEXPECTED_NAMED_IMPORT,id:e,message:`The named export "${t}" was ${s}ed from the external module ${he(e)} even though its interop type is "defaultOnly". Either remove or change this ${s} or change the value of the "output.interop" option.`,url:"https://rollupjs.org/guide/en/#outputinterop"}}function Se(e){return{code:me.UNEXPECTED_NAMED_IMPORT,id:e,message:`There was a namespace "*" reexport from the external module ${he(e)} even though its interop type is "defaultOnly". This will be ignored as namespace reexports only reexport named exports. If this is not intended, either remove or change this reexport or change the value of the "output.interop" option.`,url:"https://rollupjs.org/guide/en/#outputinterop"}}function Ae(e){return{code:me.VALIDATION_ERROR,message:e}}function Ie(){return{code:me.ALREADY_CLOSED,message:'Bundle is already closed, no more calls to "generate" or "write" are allowed.'}}function Pe(e,t,i){ke(e,t,i.onwarn,i.strictDeprecations)}function ke(e,t,i,s){if(t||s){const t=function(e){return{code:me.DEPRECATED_FEATURE,..."string"==typeof e?{message:e}:e}}(e);if(s)return pe(t);i(t)}}!function(e){e.ALREADY_CLOSED="ALREADY_CLOSED",e.ASSET_NOT_FINALISED="ASSET_NOT_FINALISED",e.ASSET_NOT_FOUND="ASSET_NOT_FOUND",e.ASSET_SOURCE_ALREADY_SET="ASSET_SOURCE_ALREADY_SET",e.ASSET_SOURCE_MISSING="ASSET_SOURCE_MISSING",e.BAD_LOADER="BAD_LOADER",e.CANNOT_EMIT_FROM_OPTIONS_HOOK="CANNOT_EMIT_FROM_OPTIONS_HOOK",e.CHUNK_NOT_GENERATED="CHUNK_NOT_GENERATED",e.CHUNK_INVALID="CHUNK_INVALID",e.CIRCULAR_REEXPORT="CIRCULAR_REEXPORT",e.CYCLIC_CROSS_CHUNK_REEXPORT="CYCLIC_CROSS_CHUNK_REEXPORT",e.DEPRECATED_FEATURE="DEPRECATED_FEATURE",e.EXTERNAL_SYNTHETIC_EXPORTS="EXTERNAL_SYNTHETIC_EXPORTS",e.FILE_NAME_CONFLICT="FILE_NAME_CONFLICT",e.FILE_NOT_FOUND="FILE_NOT_FOUND",e.INPUT_HOOK_IN_OUTPUT_PLUGIN="INPUT_HOOK_IN_OUTPUT_PLUGIN",e.INVALID_CHUNK="INVALID_CHUNK",e.INVALID_EXPORT_OPTION="INVALID_EXPORT_OPTION",e.INVALID_EXTERNAL_ID="INVALID_EXTERNAL_ID",e.INVALID_OPTION="INVALID_OPTION",e.INVALID_PLUGIN_HOOK="INVALID_PLUGIN_HOOK",e.INVALID_ROLLUP_PHASE="INVALID_ROLLUP_PHASE",e.MISSING_EXPORT="MISSING_EXPORT",e.MISSING_IMPLICIT_DEPENDANT="MISSING_IMPLICIT_DEPENDANT",e.MIXED_EXPORTS="MIXED_EXPORTS",e.NAMESPACE_CONFLICT="NAMESPACE_CONFLICT",e.AMBIGUOUS_EXTERNAL_NAMESPACES="AMBIGUOUS_EXTERNAL_NAMESPACES",e.NO_TRANSFORM_MAP_OR_AST_WITHOUT_CODE="NO_TRANSFORM_MAP_OR_AST_WITHOUT_CODE",e.PLUGIN_ERROR="PLUGIN_ERROR",e.PREFER_NAMED_EXPORTS="PREFER_NAMED_EXPORTS",e.SYNTHETIC_NAMED_EXPORTS_NEED_NAMESPACE_EXPORT="SYNTHETIC_NAMED_EXPORTS_NEED_NAMESPACE_EXPORT",e.UNEXPECTED_NAMED_IMPORT="UNEXPECTED_NAMED_IMPORT",e.UNRESOLVED_ENTRY="UNRESOLVED_ENTRY",e.UNRESOLVED_IMPORT="UNRESOLVED_IMPORT",e.VALIDATION_ERROR="VALIDATION_ERROR"}(me||(me={}));var we=new Set(["await","break","case","catch","class","const","continue","debugger","default","delete","do","else","enum","eval","export","extends","false","finally","for","function","if","implements","import","in","instanceof","interface","let","NaN","new","null","package","private","protected","public","return","static","super","switch","this","throw","true","try","typeof","undefined","var","void","while","with","yield"]);const Ce=/[^$_a-zA-Z0-9]/g,_e=e=>(e=>/\d/.test(e[0]))(e)||we.has(e)||"arguments"===e;function Ne(e){return e=e.replace(/-(\w)/g,((e,t)=>t.toUpperCase())).replace(Ce,"_"),_e(e)&&(e=`_${e}`),e||"_"}class $e{constructor(e,t,i,s,n){this.options=e,this.id=t,this.renormalizeRenderPath=n,this.declarations=new Map,this.defaultVariableName="",this.dynamicImporters=[],this.execIndex=1/0,this.exportedVariables=new Map,this.importers=[],this.mostCommonSuggestion=0,this.nameSuggestions=new Map,this.namespaceVariableName="",this.reexported=!1,this.renderPath=void 0,this.used=!1,this.variableName="",this.suggestedVariableName=Ne(t.split(/[\\/]/).pop());const{importers:r,dynamicImporters:a}=this,o=this.info={ast:null,code:null,dynamicallyImportedIdResolutions:ne,dynamicallyImportedIds:ne,get dynamicImporters(){return a.sort()},hasDefaultExport:null,get hasModuleSideEffects(){return Pe("Accessing ModuleInfo.hasModuleSideEffects from plugins is deprecated. Please use ModuleInfo.moduleSideEffects instead.",!1,e),o.moduleSideEffects},id:t,implicitlyLoadedAfterOneOf:ne,implicitlyLoadedBefore:ne,importedIdResolutions:ne,importedIds:ne,get importers(){return r.sort()},isEntry:!1,isExternal:!0,isIncluded:null,meta:s,moduleSideEffects:i,syntheticNamedExports:!1};Object.defineProperty(this.info,"hasModuleSideEffects",{enumerable:!1})}getVariableForExportName(e){const t=this.declarations.get(e);if(t)return[t];const i=new te(this,e);return this.declarations.set(e,i),this.exportedVariables.set(i,e),[i]}setRenderPath(e,t){this.renderPath="function"==typeof e.paths?e.paths(this.id):e.paths[this.id],this.renderPath||(this.renderPath=this.renormalizeRenderPath?C(T(t,this.id)):this.id)}suggestName(e){var t;const i=(null!==(t=this.nameSuggestions.get(e))&&void 0!==t?t:0)+1;this.nameSuggestions.set(e,i),i>this.mostCommonSuggestion&&(this.mostCommonSuggestion=i,this.suggestedVariableName=e)}warnUnusedImports(){const e=Array.from(this.declarations).filter((([e,t])=>"*"!==e&&!t.included&&!this.reexported&&!t.referenced)).map((([e])=>e));if(0===e.length)return;const t=new Set;for(const i of e)for(const e of this.declarations.get(i).module.importers)t.add(e);const i=[...t];this.options.onwarn({code:"UNUSED_EXTERNAL_IMPORT",message:`${oe(e,["is","are"])} imported from external module "${this.id}" but never used in ${oe(i.map((e=>he(e))))}.`,names:e,source:this.id,sources:i})}}const Te={ArrayPattern(e,t){for(const i of t.elements)i&&Te[i.type](e,i)},AssignmentPattern(e,t){Te[t.left.type](e,t.left)},Identifier(e,t){e.push(t.name)},MemberExpression(){},ObjectPattern(e,t){for(const i of t.properties)"RestElement"===i.type?Te.RestElement(e,i):Te[i.value.type](e,i.value)},RestElement(e,t){Te[t.argument.type](e,t.argument)}},Oe=function(e){const t=[];return Te[e.type](t,e),t};new Set("break case class catch const continue debugger default delete do else export extends finally for function if import in instanceof let new return super switch this throw try typeof var void while with yield enum await implements package protected static interface private public arguments Infinity NaN undefined null true false eval uneval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Symbol Error EvalError InternalError RangeError ReferenceError SyntaxError TypeError URIError Number Math Date String RegExp Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array Map Set WeakMap WeakSet SIMD ArrayBuffer DataView JSON Promise Generator GeneratorFunction Reflect Proxy Intl".split(" ")).add("");function Re(){return{brokenFlow:0,includedCallArguments:new Set,includedLabels:new Set}}function Me(){return{accessed:new U,assigned:new U,brokenFlow:0,called:new H,ignore:{breaks:!1,continues:!1,labels:new Set,returnYield:!1},includedLabels:new Set,instantiated:new H,replacedVariableInits:new Map}}function De(e,t=null){return Object.create(t,e)}const Le=new class extends K{getLiteralValueAtPath(){}},Ve={value:{hasEffectsWhenCalled:null,returns:X}},Be=new class extends K{getReturnExpressionWhenCalledAtPath(e){return 1===e.length?Qe(qe,e[0]):X}hasEffectsOnInteractionAtPath(e,t,i){return 0===t.type?e.length>1:2!==t.type||1!==e.length||Ye(qe,e[0],t,i)}},Fe={value:{hasEffectsWhenCalled:null,returns:Be}},ze=new class extends K{getReturnExpressionWhenCalledAtPath(e){return 1===e.length?Qe(Ke,e[0]):X}hasEffectsOnInteractionAtPath(e,t,i){return 0===t.type?e.length>1:2!==t.type||1!==e.length||Ye(Ke,e[0],t,i)}},je={value:{hasEffectsWhenCalled:null,returns:ze}},Ue=new class extends K{getReturnExpressionWhenCalledAtPath(e){return 1===e.length?Qe(Xe,e[0]):X}hasEffectsOnInteractionAtPath(e,t,i){return 0===t.type?e.length>1:2!==t.type||1!==e.length||Ye(Xe,e[0],t,i)}},Ge={value:{hasEffectsWhenCalled:null,returns:Ue}},He={value:{hasEffectsWhenCalled({args:e},t){const i=e[1];return e.length<2||"symbol"==typeof i.getLiteralValueAtPath(V,G,{deoptimizeCache(){}})&&i.hasEffectsOnInteractionAtPath(V,Z,t)},returns:Ue}},We=De({hasOwnProperty:Fe,isPrototypeOf:Fe,propertyIsEnumerable:Fe,toLocaleString:Ge,toString:Ge,valueOf:Ve}),qe=De({valueOf:Fe},We),Ke=De({toExponential:Ge,toFixed:Ge,toLocaleString:Ge,toPrecision:Ge,valueOf:je},We),Xe=De({anchor:Ge,at:Ve,big:Ge,blink:Ge,bold:Ge,charAt:Ge,charCodeAt:je,codePointAt:Ve,concat:Ge,endsWith:Fe,fixed:Ge,fontcolor:Ge,fontsize:Ge,includes:Fe,indexOf:je,italics:Ge,lastIndexOf:je,link:Ge,localeCompare:je,match:Ve,matchAll:Ve,normalize:Ge,padEnd:Ge,padStart:Ge,repeat:Ge,replace:He,replaceAll:He,search:je,slice:Ge,small:Ge,split:Ve,startsWith:Fe,strike:Ge,sub:Ge,substr:Ge,substring:Ge,sup:Ge,toLocaleLowerCase:Ge,toLocaleUpperCase:Ge,toLowerCase:Ge,toString:Ge,toUpperCase:Ge,trim:Ge,trimEnd:Ge,trimLeft:Ge,trimRight:Ge,trimStart:Ge,valueOf:Ge},We);function Ye(e,t,i,s){var n,r;return"string"!=typeof t||!e[t]||((null===(r=(n=e[t]).hasEffectsWhenCalled)||void 0===r?void 0:r.call(n,i,s))||!1)}function Qe(e,t){return"string"==typeof t&&e[t]?e[t].returns:X}function Je(e,t,i){i(e,t)}function Ze(e,t,i){}var et={};et.Program=et.BlockStatement=et.StaticBlock=function(e,t,i){for(var s=0,n=e.body;s=n.end;)at(e,n,t.code),n=s[++t.annotationIndex];if(n&&n.end<=e.end)for(et[i](e,t,st);(n=s[t.annotationIndex])&&n.end<=e.end;)++t.annotationIndex,ht(e,n,!1)}const nt=/[^\s(]/g,rt=/\S/g;function at(e,t,i){const s=[];let n;if(ot(i.slice(t.end,e.start),nt)){const t=e.start;for(;;){switch(s.push(e),e.type){case"ExpressionStatement":case"ChainExpression":e=e.expression;continue;case"SequenceExpression":if(ot(i.slice(t,e.start),rt)){e=e.expressions[0];continue}n=!0;break;case"ConditionalExpression":if(ot(i.slice(t,e.start),rt)){e=e.test;continue}n=!0;break;case"LogicalExpression":case"BinaryExpression":if(ot(i.slice(t,e.start),rt)){e=e.left;continue}n=!0;break;case"CallExpression":case"NewExpression":break;default:n=!0}break}}else n=!0;if(n)ht(e,t,!1);else for(const e of s)ht(e,t,!0)}function ot(e,t){let i;for(;null!==(i=t.exec(e));){if("/"===i[0]){const i=e.charCodeAt(t.lastIndex);if(42===i){t.lastIndex=e.indexOf("*/",t.lastIndex+1)+2;continue}if(47===i){t.lastIndex=e.indexOf("\n",t.lastIndex+1)+1;continue}}return t.lastIndex=0,!1}return!0}const lt=/[@#]__PURE__/;function ht(e,t,i){const s=i?"_rollupAnnotations":"_rollupRemoved",n=e[s];n?n.push(t):e[s]=[t]}const ct={Literal:[],Program:["body"]};class ut extends K{constructor(e,t,i){super(),this.deoptimized=!1,this.esTreeNode=e,this.keys=ct[e.type]||function(e){return ct[e.type]=Object.keys(e).filter((t=>"object"==typeof e[t]&&95!==t.charCodeAt(0))),ct[e.type]}(e),this.parent=t,this.context=t.context,this.createScope(i),this.parseNode(e),this.initialise(),this.context.magicString.addSourcemapLocation(this.start),this.context.magicString.addSourcemapLocation(this.end)}addExportedVariables(e,t){}bind(){for(const e of this.keys){const t=this[e];if(null!==t)if(Array.isArray(t))for(const e of t)null==e||e.bind();else t.bind()}}createScope(e){this.scope=e}hasEffects(e){this.deoptimized||this.applyDeoptimizations();for(const t of this.keys){const i=this[t];if(null!==i)if(Array.isArray(i)){for(const t of i)if(null==t?void 0:t.hasEffects(e))return!0}else if(i.hasEffects(e))return!0}return!1}hasEffectsAsAssignmentTarget(e,t){return this.hasEffects(e)||this.hasEffectsOnInteractionAtPath(V,this.assignmentInteraction,e)}include(e,t,i){this.deoptimized||this.applyDeoptimizations(),this.included=!0;for(const i of this.keys){const s=this[i];if(null!==s)if(Array.isArray(s))for(const i of s)null==i||i.include(e,t);else s.include(e,t)}}includeAsAssignmentTarget(e,t,i){this.include(e,t)}initialise(){}insertSemicolon(e){";"!==e.original[this.end-1]&&e.appendLeft(this.end,";")}parseNode(e){for(const[t,i]of Object.entries(e))if(!this.hasOwnProperty(t))if(95===t.charCodeAt(0)){if("_rollupAnnotations"===t)this.annotations=i;else if("_rollupRemoved"===t)for(const{start:e,end:t}of i)this.context.magicString.remove(e,t)}else if("object"!=typeof i||null===i)this[t]=i;else if(Array.isArray(i)){this[t]=[];for(const e of i)this[t].push(null===e?null:new(this.context.getNodeConstructor(e.type))(e,this,this.scope))}else this[t]=new(this.context.getNodeConstructor(i.type))(i,this,this.scope)}render(e,t){for(const i of this.keys){const s=this[i];if(null!==s)if(Array.isArray(s))for(const i of s)null==i||i.render(e,t);else s.render(e,t)}}setAssignedValue(e){this.assignmentInteraction={args:[e],thisArg:null,type:1}}shouldBeIncluded(e){return this.included||!e.brokenFlow&&this.hasEffects(Me())}applyDeoptimizations(){this.deoptimized=!0;for(const e of this.keys){const t=this[e];if(null!==t)if(Array.isArray(t))for(const e of t)null==e||e.deoptimizePath(B);else t.deoptimizePath(B)}this.context.requestTreeshakingPass()}}class dt extends ut{deoptimizeThisOnInteractionAtPath(e,t,i){t.length>0&&this.argument.deoptimizeThisOnInteractionAtPath(e,[M,...t],i)}hasEffects(e){this.deoptimized||this.applyDeoptimizations();const{propertyReadSideEffects:t}=this.context.options.treeshake;return this.argument.hasEffects(e)||t&&("always"===t||this.argument.hasEffectsOnInteractionAtPath(B,Y,e))}applyDeoptimizations(){this.deoptimized=!0,this.argument.deoptimizePath([M,M]),this.context.requestTreeshakingPass()}}class pt extends K{constructor(e){super(),this.description=e}deoptimizeThisOnInteractionAtPath({type:e,thisArg:t},i){2===e&&0===i.length&&this.description.mutatesSelfAsArray&&t.deoptimizePath(z)}getReturnExpressionWhenCalledAtPath(e,{thisArg:t}){return e.length>0?X:this.description.returnsPrimitive||("self"===this.description.returns?t||X:this.description.returns())}hasEffectsOnInteractionAtPath(e,t,i){var s,n;const{type:r}=t;if(e.length>(0===r?1:0))return!0;if(2===r){if(!0===this.description.mutatesSelfAsArray&&(null===(s=t.thisArg)||void 0===s?void 0:s.hasEffectsOnInteractionAtPath(z,Q,i)))return!0;if(this.description.callsArgs)for(const e of this.description.callsArgs)if(null===(n=t.args[e])||void 0===n?void 0:n.hasEffectsOnInteractionAtPath(V,Z,i))return!0}return!1}}const ft=[new pt({callsArgs:null,mutatesSelfAsArray:!1,returns:null,returnsPrimitive:Be})],mt=[new pt({callsArgs:null,mutatesSelfAsArray:!1,returns:null,returnsPrimitive:Ue})],gt=[new pt({callsArgs:null,mutatesSelfAsArray:!1,returns:null,returnsPrimitive:ze})],yt=[new pt({callsArgs:null,mutatesSelfAsArray:!1,returns:null,returnsPrimitive:X})],xt=/^\d+$/;class Et extends K{constructor(e,t,i=!1){if(super(),this.prototypeExpression=t,this.immutable=i,this.allProperties=[],this.deoptimizedPaths=Object.create(null),this.expressionsToBeDeoptimizedByKey=Object.create(null),this.gettersByKey=Object.create(null),this.hasLostTrack=!1,this.hasUnknownDeoptimizedInteger=!1,this.hasUnknownDeoptimizedProperty=!1,this.propertiesAndGettersByKey=Object.create(null),this.propertiesAndSettersByKey=Object.create(null),this.settersByKey=Object.create(null),this.thisParametersToBeDeoptimized=new Set,this.unknownIntegerProps=[],this.unmatchableGetters=[],this.unmatchablePropertiesAndGetters=[],this.unmatchableSetters=[],Array.isArray(e))this.buildPropertyMaps(e);else{this.propertiesAndGettersByKey=this.propertiesAndSettersByKey=e;for(const t of Object.values(e))this.allProperties.push(...t)}}deoptimizeAllProperties(e){var t;const i=this.hasLostTrack||this.hasUnknownDeoptimizedProperty;if(e?this.hasUnknownDeoptimizedProperty=!0:this.hasLostTrack=!0,!i){for(const e of Object.values(this.propertiesAndGettersByKey).concat(Object.values(this.settersByKey)))for(const t of e)t.deoptimizePath(B);null===(t=this.prototypeExpression)||void 0===t||t.deoptimizePath([M,M]),this.deoptimizeCachedEntities()}}deoptimizeIntegerProperties(){if(!(this.hasLostTrack||this.hasUnknownDeoptimizedProperty||this.hasUnknownDeoptimizedInteger)){this.hasUnknownDeoptimizedInteger=!0;for(const[e,t]of Object.entries(this.propertiesAndGettersByKey))if(xt.test(e))for(const e of t)e.deoptimizePath(B);this.deoptimizeCachedIntegerEntities()}}deoptimizePath(e){var t;if(this.hasLostTrack||this.immutable)return;const i=e[0];if(1===e.length){if("string"!=typeof i)return i===L?this.deoptimizeIntegerProperties():this.deoptimizeAllProperties(i===D);if(!this.deoptimizedPaths[i]){this.deoptimizedPaths[i]=!0;const e=this.expressionsToBeDeoptimizedByKey[i];if(e)for(const t of e)t.deoptimizeCache()}}const s=1===e.length?B:e.slice(1);for(const e of"string"==typeof i?(this.propertiesAndGettersByKey[i]||this.unmatchablePropertiesAndGetters).concat(this.settersByKey[i]||this.unmatchableSetters):this.allProperties)e.deoptimizePath(s);null===(t=this.prototypeExpression)||void 0===t||t.deoptimizePath(1===e.length?[...e,M]:e)}deoptimizeThisOnInteractionAtPath(e,t,i){var s;const[n,...r]=t;if(this.hasLostTrack||(2===e.type||t.length>1)&&(this.hasUnknownDeoptimizedProperty||"string"==typeof n&&this.deoptimizedPaths[n]))return void e.thisArg.deoptimizePath(B);const[a,o,l]=2===e.type||t.length>1?[this.propertiesAndGettersByKey,this.propertiesAndGettersByKey,this.unmatchablePropertiesAndGetters]:0===e.type?[this.propertiesAndGettersByKey,this.gettersByKey,this.unmatchableGetters]:[this.propertiesAndSettersByKey,this.settersByKey,this.unmatchableSetters];if("string"==typeof n){if(a[n]){const t=o[n];if(t)for(const s of t)s.deoptimizeThisOnInteractionAtPath(e,r,i);return void(this.immutable||this.thisParametersToBeDeoptimized.add(e.thisArg))}for(const t of l)t.deoptimizeThisOnInteractionAtPath(e,r,i);if(xt.test(n))for(const t of this.unknownIntegerProps)t.deoptimizeThisOnInteractionAtPath(e,r,i)}else{for(const t of Object.values(o).concat([l]))for(const s of t)s.deoptimizeThisOnInteractionAtPath(e,r,i);for(const t of this.unknownIntegerProps)t.deoptimizeThisOnInteractionAtPath(e,r,i)}this.immutable||this.thisParametersToBeDeoptimized.add(e.thisArg),null===(s=this.prototypeExpression)||void 0===s||s.deoptimizeThisOnInteractionAtPath(e,t,i)}getLiteralValueAtPath(e,t,i){if(0===e.length)return q;const s=e[0],n=this.getMemberExpressionAndTrackDeopt(s,i);return n?n.getLiteralValueAtPath(e.slice(1),t,i):this.prototypeExpression?this.prototypeExpression.getLiteralValueAtPath(e,t,i):1!==e.length?W:void 0}getReturnExpressionWhenCalledAtPath(e,t,i,s){if(0===e.length)return X;const[n,...r]=e,a=this.getMemberExpressionAndTrackDeopt(n,s);return a?a.getReturnExpressionWhenCalledAtPath(r,t,i,s):this.prototypeExpression?this.prototypeExpression.getReturnExpressionWhenCalledAtPath(e,t,i,s):X}hasEffectsOnInteractionAtPath(e,t,i){const[s,...n]=e;if(n.length||2===t.type){const r=this.getMemberExpression(s);return r?r.hasEffectsOnInteractionAtPath(n,t,i):!this.prototypeExpression||this.prototypeExpression.hasEffectsOnInteractionAtPath(e,t,i)}if(s===D)return!1;if(this.hasLostTrack)return!0;const[r,a,o]=0===t.type?[this.propertiesAndGettersByKey,this.gettersByKey,this.unmatchableGetters]:[this.propertiesAndSettersByKey,this.settersByKey,this.unmatchableSetters];if("string"==typeof s){if(r[s]){const e=a[s];if(e)for(const s of e)if(s.hasEffectsOnInteractionAtPath(n,t,i))return!0;return!1}for(const e of o)if(e.hasEffectsOnInteractionAtPath(n,t,i))return!0}else for(const e of Object.values(a).concat([o]))for(const s of e)if(s.hasEffectsOnInteractionAtPath(n,t,i))return!0;return!!this.prototypeExpression&&this.prototypeExpression.hasEffectsOnInteractionAtPath(e,t,i)}buildPropertyMaps(e){const{allProperties:t,propertiesAndGettersByKey:i,propertiesAndSettersByKey:s,settersByKey:n,gettersByKey:r,unknownIntegerProps:a,unmatchablePropertiesAndGetters:o,unmatchableGetters:l,unmatchableSetters:h}=this,c=[];for(let u=e.length-1;u>=0;u--){const{key:d,kind:p,property:f}=e[u];if(t.push(f),"string"!=typeof d){if(d===L){a.push(f);continue}"set"===p&&h.push(f),"get"===p&&l.push(f),"get"!==p&&c.push(f),"set"!==p&&o.push(f)}else"set"===p?s[d]||(s[d]=[f,...c],n[d]=[f,...h]):"get"===p?i[d]||(i[d]=[f,...o],r[d]=[f,...l]):(s[d]||(s[d]=[f,...c]),i[d]||(i[d]=[f,...o]))}}deoptimizeCachedEntities(){for(const e of Object.values(this.expressionsToBeDeoptimizedByKey))for(const t of e)t.deoptimizeCache();for(const e of this.thisParametersToBeDeoptimized)e.deoptimizePath(B)}deoptimizeCachedIntegerEntities(){for(const[e,t]of Object.entries(this.expressionsToBeDeoptimizedByKey))if(xt.test(e))for(const e of t)e.deoptimizeCache();for(const e of this.thisParametersToBeDeoptimized)e.deoptimizePath(z)}getMemberExpression(e){if(this.hasLostTrack||this.hasUnknownDeoptimizedProperty||"string"!=typeof e||this.hasUnknownDeoptimizedInteger&&xt.test(e)||this.deoptimizedPaths[e])return X;const t=this.propertiesAndGettersByKey[e];return 1===(null==t?void 0:t.length)?t[0]:t||this.unmatchablePropertiesAndGetters.length>0||this.unknownIntegerProps.length&&xt.test(e)?X:null}getMemberExpressionAndTrackDeopt(e,t){if("string"!=typeof e)return X;const i=this.getMemberExpression(e);if(i!==X&&!this.immutable){(this.expressionsToBeDeoptimizedByKey[e]=this.expressionsToBeDeoptimizedByKey[e]||[]).push(t)}return i}}const bt=e=>"string"==typeof e&&/^\d+$/.test(e),vt=new class extends K{deoptimizeThisOnInteractionAtPath({type:e,thisArg:t},i){2!==e||1!==i.length||bt(i[0])||t.deoptimizePath(B)}getLiteralValueAtPath(e){return 1===e.length&&bt(e[0])?void 0:W}hasEffectsOnInteractionAtPath(e,{type:t}){return e.length>1||2===t}},St=new Et({__proto__:null,hasOwnProperty:ft,isPrototypeOf:ft,propertyIsEnumerable:ft,toLocaleString:mt,toString:mt,valueOf:yt},vt,!0),At=[{key:L,kind:"init",property:X},{key:"length",kind:"init",property:ze}],It=[new pt({callsArgs:[0],mutatesSelfAsArray:"deopt-only",returns:null,returnsPrimitive:Be})],Pt=[new pt({callsArgs:[0],mutatesSelfAsArray:"deopt-only",returns:null,returnsPrimitive:ze})],kt=[new pt({callsArgs:null,mutatesSelfAsArray:!0,returns:()=>new Et(At,Mt),returnsPrimitive:null})],wt=[new pt({callsArgs:null,mutatesSelfAsArray:"deopt-only",returns:()=>new Et(At,Mt),returnsPrimitive:null})],Ct=[new pt({callsArgs:[0],mutatesSelfAsArray:"deopt-only",returns:()=>new Et(At,Mt),returnsPrimitive:null})],_t=[new pt({callsArgs:null,mutatesSelfAsArray:!0,returns:null,returnsPrimitive:ze})],Nt=[new pt({callsArgs:null,mutatesSelfAsArray:!0,returns:null,returnsPrimitive:X})],$t=[new pt({callsArgs:null,mutatesSelfAsArray:"deopt-only",returns:null,returnsPrimitive:X})],Tt=[new pt({callsArgs:[0],mutatesSelfAsArray:"deopt-only",returns:null,returnsPrimitive:X})],Ot=[new pt({callsArgs:null,mutatesSelfAsArray:!0,returns:"self",returnsPrimitive:null})],Rt=[new pt({callsArgs:[0],mutatesSelfAsArray:!0,returns:"self",returnsPrimitive:null})],Mt=new Et({__proto__:null,at:$t,concat:wt,copyWithin:Ot,entries:wt,every:It,fill:Ot,filter:Ct,find:Tt,findIndex:Pt,findLast:Tt,findLastIndex:Pt,flat:wt,flatMap:Ct,forEach:Tt,group:Tt,groupToMap:Tt,includes:ft,indexOf:gt,join:mt,keys:yt,lastIndexOf:gt,map:Ct,pop:Nt,push:_t,reduce:Tt,reduceRight:Tt,reverse:Ot,shift:Nt,slice:wt,some:It,sort:Rt,splice:kt,toLocaleString:mt,toString:mt,unshift:_t,values:$t},St,!0);class Dt extends ee{constructor(e,t,i,s){super(e),this.calledFromTryStatement=!1,this.additionalInitializers=null,this.expressionsToBeDeoptimized=[],this.declarations=t?[t]:[],this.init=i,this.deoptimizationTracker=s.deoptimizationTracker,this.module=s.module}addDeclaration(e,t){this.declarations.push(e);const i=this.markInitializersForDeoptimization();null!==t&&i.push(t)}consolidateInitializers(){if(null!==this.additionalInitializers){for(const e of this.additionalInitializers)e.deoptimizePath(B);this.additionalInitializers=null}}deoptimizePath(e){var t,i;if(!this.isReassigned&&!this.deoptimizationTracker.trackEntityAtPathAndGetIfTracked(e,this))if(0===e.length){if(!this.isReassigned){this.isReassigned=!0;const e=this.expressionsToBeDeoptimized;this.expressionsToBeDeoptimized=[];for(const t of e)t.deoptimizeCache();null===(t=this.init)||void 0===t||t.deoptimizePath(B)}}else null===(i=this.init)||void 0===i||i.deoptimizePath(e)}deoptimizeThisOnInteractionAtPath(e,t,i){if(this.isReassigned||!this.init)return e.thisArg.deoptimizePath(B);i.withTrackedEntityAtPath(t,this.init,(()=>this.init.deoptimizeThisOnInteractionAtPath(e,t,i)),void 0)}getLiteralValueAtPath(e,t,i){return this.isReassigned||!this.init?W:t.withTrackedEntityAtPath(e,this.init,(()=>(this.expressionsToBeDeoptimized.push(i),this.init.getLiteralValueAtPath(e,t,i))),W)}getReturnExpressionWhenCalledAtPath(e,t,i,s){return this.isReassigned||!this.init?X:i.withTrackedEntityAtPath(e,this.init,(()=>(this.expressionsToBeDeoptimized.push(s),this.init.getReturnExpressionWhenCalledAtPath(e,t,i,s))),X)}hasEffectsOnInteractionAtPath(e,t,i){switch(t.type){case 0:return!!this.isReassigned||this.init&&!i.accessed.trackEntityAtPathAndGetIfTracked(e,this)&&this.init.hasEffectsOnInteractionAtPath(e,t,i);case 1:return!!this.included||0!==e.length&&(!!this.isReassigned||this.init&&!i.assigned.trackEntityAtPathAndGetIfTracked(e,this)&&this.init.hasEffectsOnInteractionAtPath(e,t,i));case 2:return!!this.isReassigned||this.init&&!(t.withNew?i.instantiated:i.called).trackEntityAtPathAndGetIfTracked(e,t.args,this)&&this.init.hasEffectsOnInteractionAtPath(e,t,i)}}include(){if(!this.included){this.included=!0;for(const e of this.declarations){e.included||e.include(Re(),!1);let t=e.parent;for(;!t.included&&(t.included=!0,"Program"!==t.type);)t=t.parent}}}includeCallArguments(e,t){if(this.isReassigned||this.init&&e.includedCallArguments.has(this.init))for(const i of t)i.include(e,!1);else this.init&&(e.includedCallArguments.add(this.init),this.init.includeCallArguments(e,t),e.includedCallArguments.delete(this.init))}markCalledFromTryStatement(){this.calledFromTryStatement=!0}markInitializersForDeoptimization(){return null===this.additionalInitializers&&(this.additionalInitializers=null===this.init?[]:[this.init],this.init=X,this.isReassigned=!0),this.additionalInitializers}}function Lt(e){let t="";do{const i=e%64;e=Math.floor(e/64),t="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_$"[i]+t}while(0!==e);return t}function Vt(e,t){let i=e,s=1;for(;t.has(i)||we.has(i);)i=`${e}$${Lt(s++)}`;return t.add(i),i}class Bt{constructor(){this.children=[],this.variables=new Map}addDeclaration(e,t,i,s){const n=e.name;let r=this.variables.get(n);return r?r.addDeclaration(e,i):(r=new Dt(e.name,e,i||Le,t),this.variables.set(n,r)),r}contains(e){return this.variables.has(e)}findVariable(e){throw new Error("Internal Error: findVariable needs to be implemented by a subclass")}}class Ft extends Bt{constructor(e){super(),this.accessedOutsideVariables=new Map,this.parent=e,e.children.push(this)}addAccessedDynamicImport(e){(this.accessedDynamicImports||(this.accessedDynamicImports=new Set)).add(e),this.parent instanceof Ft&&this.parent.addAccessedDynamicImport(e)}addAccessedGlobals(e,t){const i=t.get(this)||new Set;for(const t of e)i.add(t);t.set(this,i),this.parent instanceof Ft&&this.parent.addAccessedGlobals(e,t)}addNamespaceMemberAccess(e,t){this.accessedOutsideVariables.set(e,t),this.parent.addNamespaceMemberAccess(e,t)}addReturnExpression(e){this.parent instanceof Ft&&this.parent.addReturnExpression(e)}addUsedOutsideNames(e,t,i,s){for(const s of this.accessedOutsideVariables.values())s.included&&(e.add(s.getBaseVariableName()),"system"===t&&i.has(s)&&e.add("exports"));const n=s.get(this);if(n)for(const t of n)e.add(t)}contains(e){return this.variables.has(e)||this.parent.contains(e)}deconflict(e,t,i){const s=new Set;if(this.addUsedOutsideNames(s,e,t,i),this.accessedDynamicImports)for(const e of this.accessedDynamicImports)e.inlineNamespace&&s.add(e.inlineNamespace.getBaseVariableName());for(const[e,t]of this.variables)(t.included||t.alwaysRendered)&&t.setRenderNames(null,Vt(e,s));for(const s of this.children)s.deconflict(e,t,i)}findLexicalBoundary(){return this.parent.findLexicalBoundary()}findVariable(e){const t=this.variables.get(e)||this.accessedOutsideVariables.get(e);if(t)return t;const i=this.parent.findVariable(e);return this.accessedOutsideVariables.set(e,i),i}}class zt extends Ft{constructor(e,t){super(e),this.parameters=[],this.hasRest=!1,this.context=t,this.hoistedBodyVarScope=new Ft(this)}addParameterDeclaration(e){const t=e.name;let i=this.hoistedBodyVarScope.variables.get(t);return i?i.addDeclaration(e,null):i=new Dt(t,e,X,this.context),this.variables.set(t,i),i}addParameterVariables(e,t){this.parameters=e;for(const t of e)for(const e of t)e.alwaysRendered=!0;this.hasRest=t}includeCallArguments(e,t){let i=!1,s=!1;const n=this.hasRest&&this.parameters[this.parameters.length-1];for(const i of t)if(i instanceof dt){for(const i of t)i.include(e,!1);break}for(let r=t.length-1;r>=0;r--){const a=this.parameters[r]||n,o=t[r];if(a)if(i=!1,0===a.length)s=!0;else for(const e of a)e.included&&(s=!0),e.calledFromTryStatement&&(i=!0);!s&&o.shouldBeIncluded(e)&&(s=!0),s&&o.include(e,i)}}}class jt extends zt{constructor(){super(...arguments),this.returnExpression=null,this.returnExpressions=[]}addReturnExpression(e){this.returnExpressions.push(e)}getReturnExpression(){return null===this.returnExpression&&this.updateReturnExpression(),this.returnExpression}updateReturnExpression(){if(1===this.returnExpressions.length)this.returnExpression=this.returnExpressions[0];else{this.returnExpression=X;for(const e of this.returnExpressions)e.deoptimizePath(B)}}}function Ut(e,t){if("MemberExpression"===e.type)return!e.computed&&Ut(e.object,e);if("Identifier"===e.type){if(!t)return!0;switch(t.type){case"MemberExpression":return t.computed||e===t.object;case"MethodDefinition":return t.computed;case"PropertyDefinition":case"Property":return t.computed||e===t.value;case"ExportSpecifier":case"ImportSpecifier":return e===t.local;case"LabeledStatement":case"BreakStatement":case"ContinueStatement":return!1;default:return!0}}return!1}const Gt=Symbol("Value Properties"),Ht={hasEffectsWhenCalled:()=>!1},Wt={hasEffectsWhenCalled:()=>!0},qt={__proto__:null,[Gt]:Wt},Kt={__proto__:null,[Gt]:Ht},Xt={__proto__:null,[Gt]:{hasEffectsWhenCalled:({args:e},t)=>!e.length||e[0].hasEffectsOnInteractionAtPath(F,Q,t)}},Yt={__proto__:null,[Gt]:Wt,prototype:qt},Qt={__proto__:null,[Gt]:Ht,prototype:qt},Jt={__proto__:null,[Gt]:Ht,from:Kt,of:Kt,prototype:qt},Zt={__proto__:null,[Gt]:Ht,supportedLocalesOf:Qt},ei={global:qt,globalThis:qt,self:qt,window:qt,__proto__:null,[Gt]:Wt,Array:{__proto__:null,[Gt]:Wt,from:qt,isArray:Kt,of:Kt,prototype:qt},ArrayBuffer:{__proto__:null,[Gt]:Ht,isView:Kt,prototype:qt},Atomics:qt,BigInt:Yt,BigInt64Array:Yt,BigUint64Array:Yt,Boolean:Qt,constructor:Yt,DataView:Qt,Date:{__proto__:null,[Gt]:Ht,now:Kt,parse:Kt,prototype:qt,UTC:Kt},decodeURI:Kt,decodeURIComponent:Kt,encodeURI:Kt,encodeURIComponent:Kt,Error:Qt,escape:Kt,eval:qt,EvalError:Qt,Float32Array:Jt,Float64Array:Jt,Function:Yt,hasOwnProperty:qt,Infinity:qt,Int16Array:Jt,Int32Array:Jt,Int8Array:Jt,isFinite:Kt,isNaN:Kt,isPrototypeOf:qt,JSON:qt,Map:Qt,Math:{__proto__:null,[Gt]:Wt,abs:Kt,acos:Kt,acosh:Kt,asin:Kt,asinh:Kt,atan:Kt,atan2:Kt,atanh:Kt,cbrt:Kt,ceil:Kt,clz32:Kt,cos:Kt,cosh:Kt,exp:Kt,expm1:Kt,floor:Kt,fround:Kt,hypot:Kt,imul:Kt,log:Kt,log10:Kt,log1p:Kt,log2:Kt,max:Kt,min:Kt,pow:Kt,random:Kt,round:Kt,sign:Kt,sin:Kt,sinh:Kt,sqrt:Kt,tan:Kt,tanh:Kt,trunc:Kt},NaN:qt,Number:{__proto__:null,[Gt]:Ht,isFinite:Kt,isInteger:Kt,isNaN:Kt,isSafeInteger:Kt,parseFloat:Kt,parseInt:Kt,prototype:qt},Object:{__proto__:null,[Gt]:Ht,create:Kt,defineProperty:Xt,defineProperties:Xt,getOwnPropertyDescriptor:Kt,getOwnPropertyNames:Kt,getOwnPropertySymbols:Kt,getPrototypeOf:Kt,hasOwn:Kt,is:Kt,isExtensible:Kt,isFrozen:Kt,isSealed:Kt,keys:Kt,fromEntries:Kt,entries:Kt,prototype:qt},parseFloat:Kt,parseInt:Kt,Promise:{__proto__:null,[Gt]:Wt,all:qt,prototype:qt,race:qt,reject:qt,resolve:qt},propertyIsEnumerable:qt,Proxy:qt,RangeError:Qt,ReferenceError:Qt,Reflect:qt,RegExp:Qt,Set:Qt,SharedArrayBuffer:Yt,String:{__proto__:null,[Gt]:Ht,fromCharCode:Kt,fromCodePoint:Kt,prototype:qt,raw:Kt},Symbol:{__proto__:null,[Gt]:Ht,for:Kt,keyFor:Kt,prototype:qt},SyntaxError:Qt,toLocaleString:qt,toString:qt,TypeError:Qt,Uint16Array:Jt,Uint32Array:Jt,Uint8Array:Jt,Uint8ClampedArray:Jt,unescape:Kt,URIError:Qt,valueOf:qt,WeakMap:Qt,WeakSet:Qt,clearInterval:Yt,clearTimeout:Yt,console:qt,Intl:{__proto__:null,[Gt]:Wt,Collator:Zt,DateTimeFormat:Zt,ListFormat:Zt,NumberFormat:Zt,PluralRules:Zt,RelativeTimeFormat:Zt},setInterval:Yt,setTimeout:Yt,TextDecoder:Yt,TextEncoder:Yt,URL:Yt,URLSearchParams:Yt,AbortController:Yt,AbortSignal:Yt,addEventListener:qt,alert:qt,AnalyserNode:Yt,Animation:Yt,AnimationEvent:Yt,applicationCache:qt,ApplicationCache:Yt,ApplicationCacheErrorEvent:Yt,atob:qt,Attr:Yt,Audio:Yt,AudioBuffer:Yt,AudioBufferSourceNode:Yt,AudioContext:Yt,AudioDestinationNode:Yt,AudioListener:Yt,AudioNode:Yt,AudioParam:Yt,AudioProcessingEvent:Yt,AudioScheduledSourceNode:Yt,AudioWorkletNode:Yt,BarProp:Yt,BaseAudioContext:Yt,BatteryManager:Yt,BeforeUnloadEvent:Yt,BiquadFilterNode:Yt,Blob:Yt,BlobEvent:Yt,blur:qt,BroadcastChannel:Yt,btoa:qt,ByteLengthQueuingStrategy:Yt,Cache:Yt,caches:qt,CacheStorage:Yt,cancelAnimationFrame:qt,cancelIdleCallback:qt,CanvasCaptureMediaStreamTrack:Yt,CanvasGradient:Yt,CanvasPattern:Yt,CanvasRenderingContext2D:Yt,ChannelMergerNode:Yt,ChannelSplitterNode:Yt,CharacterData:Yt,clientInformation:qt,ClipboardEvent:Yt,close:qt,closed:qt,CloseEvent:Yt,Comment:Yt,CompositionEvent:Yt,confirm:qt,ConstantSourceNode:Yt,ConvolverNode:Yt,CountQueuingStrategy:Yt,createImageBitmap:qt,Credential:Yt,CredentialsContainer:Yt,crypto:qt,Crypto:Yt,CryptoKey:Yt,CSS:Yt,CSSConditionRule:Yt,CSSFontFaceRule:Yt,CSSGroupingRule:Yt,CSSImportRule:Yt,CSSKeyframeRule:Yt,CSSKeyframesRule:Yt,CSSMediaRule:Yt,CSSNamespaceRule:Yt,CSSPageRule:Yt,CSSRule:Yt,CSSRuleList:Yt,CSSStyleDeclaration:Yt,CSSStyleRule:Yt,CSSStyleSheet:Yt,CSSSupportsRule:Yt,CustomElementRegistry:Yt,customElements:qt,CustomEvent:Yt,DataTransfer:Yt,DataTransferItem:Yt,DataTransferItemList:Yt,defaultstatus:qt,defaultStatus:qt,DelayNode:Yt,DeviceMotionEvent:Yt,DeviceOrientationEvent:Yt,devicePixelRatio:qt,dispatchEvent:qt,document:qt,Document:Yt,DocumentFragment:Yt,DocumentType:Yt,DOMError:Yt,DOMException:Yt,DOMImplementation:Yt,DOMMatrix:Yt,DOMMatrixReadOnly:Yt,DOMParser:Yt,DOMPoint:Yt,DOMPointReadOnly:Yt,DOMQuad:Yt,DOMRect:Yt,DOMRectReadOnly:Yt,DOMStringList:Yt,DOMStringMap:Yt,DOMTokenList:Yt,DragEvent:Yt,DynamicsCompressorNode:Yt,Element:Yt,ErrorEvent:Yt,Event:Yt,EventSource:Yt,EventTarget:Yt,external:qt,fetch:qt,File:Yt,FileList:Yt,FileReader:Yt,find:qt,focus:qt,FocusEvent:Yt,FontFace:Yt,FontFaceSetLoadEvent:Yt,FormData:Yt,frames:qt,GainNode:Yt,Gamepad:Yt,GamepadButton:Yt,GamepadEvent:Yt,getComputedStyle:qt,getSelection:qt,HashChangeEvent:Yt,Headers:Yt,history:qt,History:Yt,HTMLAllCollection:Yt,HTMLAnchorElement:Yt,HTMLAreaElement:Yt,HTMLAudioElement:Yt,HTMLBaseElement:Yt,HTMLBodyElement:Yt,HTMLBRElement:Yt,HTMLButtonElement:Yt,HTMLCanvasElement:Yt,HTMLCollection:Yt,HTMLContentElement:Yt,HTMLDataElement:Yt,HTMLDataListElement:Yt,HTMLDetailsElement:Yt,HTMLDialogElement:Yt,HTMLDirectoryElement:Yt,HTMLDivElement:Yt,HTMLDListElement:Yt,HTMLDocument:Yt,HTMLElement:Yt,HTMLEmbedElement:Yt,HTMLFieldSetElement:Yt,HTMLFontElement:Yt,HTMLFormControlsCollection:Yt,HTMLFormElement:Yt,HTMLFrameElement:Yt,HTMLFrameSetElement:Yt,HTMLHeadElement:Yt,HTMLHeadingElement:Yt,HTMLHRElement:Yt,HTMLHtmlElement:Yt,HTMLIFrameElement:Yt,HTMLImageElement:Yt,HTMLInputElement:Yt,HTMLLabelElement:Yt,HTMLLegendElement:Yt,HTMLLIElement:Yt,HTMLLinkElement:Yt,HTMLMapElement:Yt,HTMLMarqueeElement:Yt,HTMLMediaElement:Yt,HTMLMenuElement:Yt,HTMLMetaElement:Yt,HTMLMeterElement:Yt,HTMLModElement:Yt,HTMLObjectElement:Yt,HTMLOListElement:Yt,HTMLOptGroupElement:Yt,HTMLOptionElement:Yt,HTMLOptionsCollection:Yt,HTMLOutputElement:Yt,HTMLParagraphElement:Yt,HTMLParamElement:Yt,HTMLPictureElement:Yt,HTMLPreElement:Yt,HTMLProgressElement:Yt,HTMLQuoteElement:Yt,HTMLScriptElement:Yt,HTMLSelectElement:Yt,HTMLShadowElement:Yt,HTMLSlotElement:Yt,HTMLSourceElement:Yt,HTMLSpanElement:Yt,HTMLStyleElement:Yt,HTMLTableCaptionElement:Yt,HTMLTableCellElement:Yt,HTMLTableColElement:Yt,HTMLTableElement:Yt,HTMLTableRowElement:Yt,HTMLTableSectionElement:Yt,HTMLTemplateElement:Yt,HTMLTextAreaElement:Yt,HTMLTimeElement:Yt,HTMLTitleElement:Yt,HTMLTrackElement:Yt,HTMLUListElement:Yt,HTMLUnknownElement:Yt,HTMLVideoElement:Yt,IDBCursor:Yt,IDBCursorWithValue:Yt,IDBDatabase:Yt,IDBFactory:Yt,IDBIndex:Yt,IDBKeyRange:Yt,IDBObjectStore:Yt,IDBOpenDBRequest:Yt,IDBRequest:Yt,IDBTransaction:Yt,IDBVersionChangeEvent:Yt,IdleDeadline:Yt,IIRFilterNode:Yt,Image:Yt,ImageBitmap:Yt,ImageBitmapRenderingContext:Yt,ImageCapture:Yt,ImageData:Yt,indexedDB:qt,innerHeight:qt,innerWidth:qt,InputEvent:Yt,IntersectionObserver:Yt,IntersectionObserverEntry:Yt,isSecureContext:qt,KeyboardEvent:Yt,KeyframeEffect:Yt,length:qt,localStorage:qt,location:qt,Location:Yt,locationbar:qt,matchMedia:qt,MediaDeviceInfo:Yt,MediaDevices:Yt,MediaElementAudioSourceNode:Yt,MediaEncryptedEvent:Yt,MediaError:Yt,MediaKeyMessageEvent:Yt,MediaKeySession:Yt,MediaKeyStatusMap:Yt,MediaKeySystemAccess:Yt,MediaList:Yt,MediaQueryList:Yt,MediaQueryListEvent:Yt,MediaRecorder:Yt,MediaSettingsRange:Yt,MediaSource:Yt,MediaStream:Yt,MediaStreamAudioDestinationNode:Yt,MediaStreamAudioSourceNode:Yt,MediaStreamEvent:Yt,MediaStreamTrack:Yt,MediaStreamTrackEvent:Yt,menubar:qt,MessageChannel:Yt,MessageEvent:Yt,MessagePort:Yt,MIDIAccess:Yt,MIDIConnectionEvent:Yt,MIDIInput:Yt,MIDIInputMap:Yt,MIDIMessageEvent:Yt,MIDIOutput:Yt,MIDIOutputMap:Yt,MIDIPort:Yt,MimeType:Yt,MimeTypeArray:Yt,MouseEvent:Yt,moveBy:qt,moveTo:qt,MutationEvent:Yt,MutationObserver:Yt,MutationRecord:Yt,name:qt,NamedNodeMap:Yt,NavigationPreloadManager:Yt,navigator:qt,Navigator:Yt,NetworkInformation:Yt,Node:Yt,NodeFilter:qt,NodeIterator:Yt,NodeList:Yt,Notification:Yt,OfflineAudioCompletionEvent:Yt,OfflineAudioContext:Yt,offscreenBuffering:qt,OffscreenCanvas:Yt,open:qt,openDatabase:qt,Option:Yt,origin:qt,OscillatorNode:Yt,outerHeight:qt,outerWidth:qt,PageTransitionEvent:Yt,pageXOffset:qt,pageYOffset:qt,PannerNode:Yt,parent:qt,Path2D:Yt,PaymentAddress:Yt,PaymentRequest:Yt,PaymentRequestUpdateEvent:Yt,PaymentResponse:Yt,performance:qt,Performance:Yt,PerformanceEntry:Yt,PerformanceLongTaskTiming:Yt,PerformanceMark:Yt,PerformanceMeasure:Yt,PerformanceNavigation:Yt,PerformanceNavigationTiming:Yt,PerformanceObserver:Yt,PerformanceObserverEntryList:Yt,PerformancePaintTiming:Yt,PerformanceResourceTiming:Yt,PerformanceTiming:Yt,PeriodicWave:Yt,Permissions:Yt,PermissionStatus:Yt,personalbar:qt,PhotoCapabilities:Yt,Plugin:Yt,PluginArray:Yt,PointerEvent:Yt,PopStateEvent:Yt,postMessage:qt,Presentation:Yt,PresentationAvailability:Yt,PresentationConnection:Yt,PresentationConnectionAvailableEvent:Yt,PresentationConnectionCloseEvent:Yt,PresentationConnectionList:Yt,PresentationReceiver:Yt,PresentationRequest:Yt,print:qt,ProcessingInstruction:Yt,ProgressEvent:Yt,PromiseRejectionEvent:Yt,prompt:qt,PushManager:Yt,PushSubscription:Yt,PushSubscriptionOptions:Yt,queueMicrotask:qt,RadioNodeList:Yt,Range:Yt,ReadableStream:Yt,RemotePlayback:Yt,removeEventListener:qt,Request:Yt,requestAnimationFrame:qt,requestIdleCallback:qt,resizeBy:qt,ResizeObserver:Yt,ResizeObserverEntry:Yt,resizeTo:qt,Response:Yt,RTCCertificate:Yt,RTCDataChannel:Yt,RTCDataChannelEvent:Yt,RTCDtlsTransport:Yt,RTCIceCandidate:Yt,RTCIceTransport:Yt,RTCPeerConnection:Yt,RTCPeerConnectionIceEvent:Yt,RTCRtpReceiver:Yt,RTCRtpSender:Yt,RTCSctpTransport:Yt,RTCSessionDescription:Yt,RTCStatsReport:Yt,RTCTrackEvent:Yt,screen:qt,Screen:Yt,screenLeft:qt,ScreenOrientation:Yt,screenTop:qt,screenX:qt,screenY:qt,ScriptProcessorNode:Yt,scroll:qt,scrollbars:qt,scrollBy:qt,scrollTo:qt,scrollX:qt,scrollY:qt,SecurityPolicyViolationEvent:Yt,Selection:Yt,ServiceWorker:Yt,ServiceWorkerContainer:Yt,ServiceWorkerRegistration:Yt,sessionStorage:qt,ShadowRoot:Yt,SharedWorker:Yt,SourceBuffer:Yt,SourceBufferList:Yt,speechSynthesis:qt,SpeechSynthesisEvent:Yt,SpeechSynthesisUtterance:Yt,StaticRange:Yt,status:qt,statusbar:qt,StereoPannerNode:Yt,stop:qt,Storage:Yt,StorageEvent:Yt,StorageManager:Yt,styleMedia:qt,StyleSheet:Yt,StyleSheetList:Yt,SubtleCrypto:Yt,SVGAElement:Yt,SVGAngle:Yt,SVGAnimatedAngle:Yt,SVGAnimatedBoolean:Yt,SVGAnimatedEnumeration:Yt,SVGAnimatedInteger:Yt,SVGAnimatedLength:Yt,SVGAnimatedLengthList:Yt,SVGAnimatedNumber:Yt,SVGAnimatedNumberList:Yt,SVGAnimatedPreserveAspectRatio:Yt,SVGAnimatedRect:Yt,SVGAnimatedString:Yt,SVGAnimatedTransformList:Yt,SVGAnimateElement:Yt,SVGAnimateMotionElement:Yt,SVGAnimateTransformElement:Yt,SVGAnimationElement:Yt,SVGCircleElement:Yt,SVGClipPathElement:Yt,SVGComponentTransferFunctionElement:Yt,SVGDefsElement:Yt,SVGDescElement:Yt,SVGDiscardElement:Yt,SVGElement:Yt,SVGEllipseElement:Yt,SVGFEBlendElement:Yt,SVGFEColorMatrixElement:Yt,SVGFEComponentTransferElement:Yt,SVGFECompositeElement:Yt,SVGFEConvolveMatrixElement:Yt,SVGFEDiffuseLightingElement:Yt,SVGFEDisplacementMapElement:Yt,SVGFEDistantLightElement:Yt,SVGFEDropShadowElement:Yt,SVGFEFloodElement:Yt,SVGFEFuncAElement:Yt,SVGFEFuncBElement:Yt,SVGFEFuncGElement:Yt,SVGFEFuncRElement:Yt,SVGFEGaussianBlurElement:Yt,SVGFEImageElement:Yt,SVGFEMergeElement:Yt,SVGFEMergeNodeElement:Yt,SVGFEMorphologyElement:Yt,SVGFEOffsetElement:Yt,SVGFEPointLightElement:Yt,SVGFESpecularLightingElement:Yt,SVGFESpotLightElement:Yt,SVGFETileElement:Yt,SVGFETurbulenceElement:Yt,SVGFilterElement:Yt,SVGForeignObjectElement:Yt,SVGGElement:Yt,SVGGeometryElement:Yt,SVGGradientElement:Yt,SVGGraphicsElement:Yt,SVGImageElement:Yt,SVGLength:Yt,SVGLengthList:Yt,SVGLinearGradientElement:Yt,SVGLineElement:Yt,SVGMarkerElement:Yt,SVGMaskElement:Yt,SVGMatrix:Yt,SVGMetadataElement:Yt,SVGMPathElement:Yt,SVGNumber:Yt,SVGNumberList:Yt,SVGPathElement:Yt,SVGPatternElement:Yt,SVGPoint:Yt,SVGPointList:Yt,SVGPolygonElement:Yt,SVGPolylineElement:Yt,SVGPreserveAspectRatio:Yt,SVGRadialGradientElement:Yt,SVGRect:Yt,SVGRectElement:Yt,SVGScriptElement:Yt,SVGSetElement:Yt,SVGStopElement:Yt,SVGStringList:Yt,SVGStyleElement:Yt,SVGSVGElement:Yt,SVGSwitchElement:Yt,SVGSymbolElement:Yt,SVGTextContentElement:Yt,SVGTextElement:Yt,SVGTextPathElement:Yt,SVGTextPositioningElement:Yt,SVGTitleElement:Yt,SVGTransform:Yt,SVGTransformList:Yt,SVGTSpanElement:Yt,SVGUnitTypes:Yt,SVGUseElement:Yt,SVGViewElement:Yt,TaskAttributionTiming:Yt,Text:Yt,TextEvent:Yt,TextMetrics:Yt,TextTrack:Yt,TextTrackCue:Yt,TextTrackCueList:Yt,TextTrackList:Yt,TimeRanges:Yt,toolbar:qt,top:qt,Touch:Yt,TouchEvent:Yt,TouchList:Yt,TrackEvent:Yt,TransitionEvent:Yt,TreeWalker:Yt,UIEvent:Yt,ValidityState:Yt,visualViewport:qt,VisualViewport:Yt,VTTCue:Yt,WaveShaperNode:Yt,WebAssembly:qt,WebGL2RenderingContext:Yt,WebGLActiveInfo:Yt,WebGLBuffer:Yt,WebGLContextEvent:Yt,WebGLFramebuffer:Yt,WebGLProgram:Yt,WebGLQuery:Yt,WebGLRenderbuffer:Yt,WebGLRenderingContext:Yt,WebGLSampler:Yt,WebGLShader:Yt,WebGLShaderPrecisionFormat:Yt,WebGLSync:Yt,WebGLTexture:Yt,WebGLTransformFeedback:Yt,WebGLUniformLocation:Yt,WebGLVertexArrayObject:Yt,WebSocket:Yt,WheelEvent:Yt,Window:Yt,Worker:Yt,WritableStream:Yt,XMLDocument:Yt,XMLHttpRequest:Yt,XMLHttpRequestEventTarget:Yt,XMLHttpRequestUpload:Yt,XMLSerializer:Yt,XPathEvaluator:Yt,XPathExpression:Yt,XPathResult:Yt,XSLTProcessor:Yt};for(const e of["window","global","self","globalThis"])ei[e]=ei;function ti(e){let t=ei;for(const i of e){if("string"!=typeof i)return null;if(t=t[i],!t)return null}return t[Gt]}class ii extends ee{constructor(){super(...arguments),this.isReassigned=!0}getLiteralValueAtPath(e,t,i){return ti([this.name,...e])?q:W}hasEffectsOnInteractionAtPath(e,t,i){switch(t.type){case 0:return 0===e.length?"undefined"!==this.name&&!ti([this.name]):!ti([this.name,...e].slice(0,-1));case 1:return!0;case 2:{const s=ti([this.name,...e]);return!s||s.hasEffectsWhenCalled(t,i)}}}}const si={__proto__:null,class:!0,const:!0,let:!0,var:!0};class ni extends ut{constructor(){super(...arguments),this.variable=null,this.isTDZAccess=null}addExportedVariables(e,t){t.has(this.variable)&&e.push(this.variable)}bind(){!this.variable&&Ut(this,this.parent)&&(this.variable=this.scope.findVariable(this.name),this.variable.addReference(this))}declare(e,t){let i;const{treeshake:s}=this.context.options;switch(e){case"var":i=this.scope.addDeclaration(this,this.context,t,!0),s&&s.correctVarValueBeforeDeclaration&&i.markInitializersForDeoptimization();break;case"function":case"let":case"const":case"class":i=this.scope.addDeclaration(this,this.context,t,!1);break;case"parameter":i=this.scope.addParameterDeclaration(this);break;default:throw new Error(`Internal Error: Unexpected identifier kind ${e}.`)}return i.kind=e,[this.variable=i]}deoptimizePath(e){var t;0!==e.length||this.scope.contains(this.name)||this.disallowImportReassignment(),null===(t=this.variable)||void 0===t||t.deoptimizePath(e)}deoptimizeThisOnInteractionAtPath(e,t,i){this.variable.deoptimizeThisOnInteractionAtPath(e,t,i)}getLiteralValueAtPath(e,t,i){return this.getVariableRespectingTDZ().getLiteralValueAtPath(e,t,i)}getReturnExpressionWhenCalledAtPath(e,t,i,s){return this.getVariableRespectingTDZ().getReturnExpressionWhenCalledAtPath(e,t,i,s)}hasEffects(e){return this.deoptimized||this.applyDeoptimizations(),!(!this.isPossibleTDZ()||"var"===this.variable.kind)||this.context.options.treeshake.unknownGlobalSideEffects&&this.variable instanceof ii&&this.variable.hasEffectsOnInteractionAtPath(V,Y,e)}hasEffectsOnInteractionAtPath(e,t,i){switch(t.type){case 0:return null!==this.variable&&this.getVariableRespectingTDZ().hasEffectsOnInteractionAtPath(e,t,i);case 1:return(e.length>0?this.getVariableRespectingTDZ():this.variable).hasEffectsOnInteractionAtPath(e,t,i);case 2:return this.getVariableRespectingTDZ().hasEffectsOnInteractionAtPath(e,t,i)}}include(){this.deoptimized||this.applyDeoptimizations(),this.included||(this.included=!0,null!==this.variable&&this.context.includeVariableInModule(this.variable))}includeCallArguments(e,t){this.variable.includeCallArguments(e,t)}isPossibleTDZ(){if(null!==this.isTDZAccess)return this.isTDZAccess;if(!(this.variable instanceof Dt&&this.variable.kind&&this.variable.kind in si))return this.isTDZAccess=!1;let e;return this.variable.declarations&&1===this.variable.declarations.length&&(e=this.variable.declarations[0])&&this.start=s)return s;n=e.charCodeAt(++i),++i,(i=47===n?e.indexOf("\n",i)+1:e.indexOf("*/",i)+2)>s&&(s=e.indexOf(t,i))}}const ci=/\S/g;function ui(e,t){ci.lastIndex=t;return ci.exec(e).index}function di(e){let t,i,s=0;for(t=e.indexOf("\n",s);;){if(s=e.indexOf("/",s),-1===s||s>t)return[t,t+1];if(i=e.charCodeAt(s+1),47===i)return[s,t+1];s=e.indexOf("*/",s+3)+2,s>t&&(t=e.indexOf("\n",s))}}function pi(e,t,i,s,n){let r,a,o,l,h=e[0],c=!h.included||h.needsBoundaries;c&&(l=i+di(t.original.slice(i,h.start))[1]);for(let i=1;i<=e.length;i++)r=h,a=l,o=c,h=e[i],c=void 0!==h&&(!h.included||h.needsBoundaries),o||c?(l=r.end+di(t.original.slice(r.end,void 0===h?s:h.start))[1],r.included?o?r.render(t,n,{end:l,start:a}):r.render(t,n):ai(r,t,a,l)):r.render(t,n)}function fi(e,t,i,s){const n=[];let r,a,o,l,h,c=i-1;for(let s=0;s0||this.argument.hasEffectsOnInteractionAtPath(V,t,i)}markDeclarationReached(){this.argument.markDeclarationReached()}applyDeoptimizations(){this.deoptimized=!0,null!==this.declarationInit&&(this.declarationInit.deoptimizePath([M,M]),this.context.requestTreeshakingPass())}}class bi extends ut{constructor(){super(...arguments),this.objectEntity=null,this.deoptimizedReturn=!1}deoptimizePath(e){this.getObjectEntity().deoptimizePath(e),1===e.length&&e[0]===M&&this.scope.getReturnExpression().deoptimizePath(B)}deoptimizeThisOnInteractionAtPath(e,t,i){t.length>0&&this.getObjectEntity().deoptimizeThisOnInteractionAtPath(e,t,i)}getLiteralValueAtPath(e,t,i){return this.getObjectEntity().getLiteralValueAtPath(e,t,i)}getReturnExpressionWhenCalledAtPath(e,t,i,s){return e.length>0?this.getObjectEntity().getReturnExpressionWhenCalledAtPath(e,t,i,s):this.async?(this.deoptimizedReturn||(this.deoptimizedReturn=!0,this.scope.getReturnExpression().deoptimizePath(B),this.context.requestTreeshakingPass()),X):this.scope.getReturnExpression()}hasEffectsOnInteractionAtPath(e,t,i){if(e.length>0||2!==t.type)return this.getObjectEntity().hasEffectsOnInteractionAtPath(e,t,i);if(this.async){const{propertyReadSideEffects:e}=this.context.options.treeshake,t=this.scope.getReturnExpression();if(t.hasEffectsOnInteractionAtPath(["then"],Z,i)||e&&("always"===e||t.hasEffectsOnInteractionAtPath(["then"],Y,i)))return!0}for(const e of this.params)if(e.hasEffects(i))return!0;return!1}include(e,t){this.deoptimized||this.applyDeoptimizations(),this.included=!0;const{brokenFlow:i}=e;e.brokenFlow=0,this.body.include(e,t),e.brokenFlow=i}includeCallArguments(e,t){this.scope.includeCallArguments(e,t)}initialise(){this.scope.addParameterVariables(this.params.map((e=>e.declare("parameter",X))),this.params[this.params.length-1]instanceof Ei),this.body instanceof xi?this.body.addImplicitReturnExpressionToScope():this.scope.addReturnExpression(this.body)}parseNode(e){"BlockStatement"===e.body.type&&(this.body=new xi(e.body,this,this.scope.hoistedBodyVarScope)),super.parseNode(e)}applyDeoptimizations(){}}bi.prototype.preventChildBlockScope=!0;class vi extends bi{constructor(){super(...arguments),this.objectEntity=null}createScope(e){this.scope=new jt(e,this.context)}hasEffects(){return this.deoptimized||this.applyDeoptimizations(),!1}hasEffectsOnInteractionAtPath(e,t,i){if(super.hasEffectsOnInteractionAtPath(e,t,i))return!0;if(2===t.type){const{ignore:e,brokenFlow:t}=i;if(i.ignore={breaks:!1,continues:!1,labels:new Set,returnYield:!0},this.body.hasEffects(i))return!0;i.ignore=e,i.brokenFlow=t}return!1}include(e,t){super.include(e,t);for(const i of this.params)i instanceof ni||i.include(e,t)}getObjectEntity(){return null!==this.objectEntity?this.objectEntity:this.objectEntity=new Et([],St)}}function Si(e,{exportNamesByVariable:t,snippets:{_:i,getObject:s,getPropertyAccess:n}},r=""){if(1===e.length&&1===t.get(e[0]).length){const s=e[0];return`exports('${t.get(s)}',${i}${s.getName(n)}${r})`}{const i=[];for(const s of e)for(const e of t.get(s))i.push([e,s.getName(n)+r]);return`exports(${s(i,{lineBreakIndent:null})})`}}function Ai(e,t,i,s,{exportNamesByVariable:n,snippets:{_:r}}){s.prependRight(t,`exports('${n.get(e)}',${r}`),s.appendLeft(i,")")}function Ii(e,t,i,s,n,r){const{_:a,getPropertyAccess:o}=r.snippets;n.appendLeft(i,`,${a}${Si([e],r)},${a}${e.getName(o)}`),s&&(n.prependRight(t,"("),n.appendLeft(i,")"))}class Pi extends ut{addExportedVariables(e,t){for(const i of this.properties)"Property"===i.type?i.value.addExportedVariables(e,t):i.argument.addExportedVariables(e,t)}declare(e,t){const i=[];for(const s of this.properties)i.push(...s.declare(e,t));return i}deoptimizePath(e){if(0===e.length)for(const t of this.properties)t.deoptimizePath(e)}hasEffectsOnInteractionAtPath(e,t,i){for(const e of this.properties)if(e.hasEffectsOnInteractionAtPath(V,t,i))return!0;return!1}markDeclarationReached(){for(const e of this.properties)e.markDeclarationReached()}}class ki extends Dt{constructor(e){super("arguments",null,X,e)}hasEffectsOnInteractionAtPath(e,{type:t}){return 0!==t||e.length>1}}class wi extends Dt{constructor(e){super("this",null,null,e),this.deoptimizedPaths=[],this.entitiesToBeDeoptimized=new Set,this.thisDeoptimizationList=[],this.thisDeoptimizations=new H}addEntityToBeDeoptimized(e){for(const t of this.deoptimizedPaths)e.deoptimizePath(t);for(const{interaction:t,path:i}of this.thisDeoptimizationList)e.deoptimizeThisOnInteractionAtPath(t,i,G);this.entitiesToBeDeoptimized.add(e)}deoptimizePath(e){if(0!==e.length&&!this.deoptimizationTracker.trackEntityAtPathAndGetIfTracked(e,this)){this.deoptimizedPaths.push(e);for(const t of this.entitiesToBeDeoptimized)t.deoptimizePath(e)}}deoptimizeThisOnInteractionAtPath(e,t){const i={interaction:e,path:t};if(!this.thisDeoptimizations.trackEntityAtPathAndGetIfTracked(t,e.type,e.thisArg)){for(const i of this.entitiesToBeDeoptimized)i.deoptimizeThisOnInteractionAtPath(e,t,G);this.thisDeoptimizationList.push(i)}}hasEffectsOnInteractionAtPath(e,t,i){return this.getInit(i).hasEffectsOnInteractionAtPath(e,t,i)||super.hasEffectsOnInteractionAtPath(e,t,i)}getInit(e){return e.replacedVariableInits.get(this)||X}}class Ci extends jt{constructor(e,t){super(e,t),this.variables.set("arguments",this.argumentsVariable=new ki(t)),this.variables.set("this",this.thisVariable=new wi(t))}findLexicalBoundary(){return this}includeCallArguments(e,t){if(super.includeCallArguments(e,t),this.argumentsVariable.included)for(const i of t)i.included||i.include(e,!1)}}class _i extends bi{constructor(){super(...arguments),this.objectEntity=null}createScope(e){this.scope=new Ci(e,this.context)}deoptimizeThisOnInteractionAtPath(e,t,i){super.deoptimizeThisOnInteractionAtPath(e,t,i),2===e.type&&0===t.length&&this.scope.thisVariable.addEntityToBeDeoptimized(e.thisArg)}hasEffects(e){var t;return this.deoptimized||this.applyDeoptimizations(),!!(null===(t=this.id)||void 0===t?void 0:t.hasEffects(e))}hasEffectsOnInteractionAtPath(e,t,i){if(super.hasEffectsOnInteractionAtPath(e,t,i))return!0;if(2===t.type){const e=i.replacedVariableInits.get(this.scope.thisVariable);i.replacedVariableInits.set(this.scope.thisVariable,t.withNew?new Et(Object.create(null),St):X);const{brokenFlow:s,ignore:n}=i;if(i.ignore={breaks:!1,continues:!1,labels:new Set,returnYield:!0},this.body.hasEffects(i))return!0;i.brokenFlow=s,e?i.replacedVariableInits.set(this.scope.thisVariable,e):i.replacedVariableInits.delete(this.scope.thisVariable),i.ignore=n}return!1}include(e,t){var i;super.include(e,t),null===(i=this.id)||void 0===i||i.include();const s=this.scope.argumentsVariable.included;for(const i of this.params)i instanceof ni&&!s||i.include(e,t)}initialise(){var e;super.initialise(),null===(e=this.id)||void 0===e||e.declare("function",this)}getObjectEntity(){return null!==this.objectEntity?this.objectEntity:this.objectEntity=new Et([{key:"prototype",kind:"init",property:new Et([],St)}],St)}}const Ni={"!=":(e,t)=>e!=t,"!==":(e,t)=>e!==t,"%":(e,t)=>e%t,"&":(e,t)=>e&t,"*":(e,t)=>e*t,"**":(e,t)=>e**t,"+":(e,t)=>e+t,"-":(e,t)=>e-t,"/":(e,t)=>e/t,"<":(e,t)=>ee<e<=t,"==":(e,t)=>e==t,"===":(e,t)=>e===t,">":(e,t)=>e>t,">=":(e,t)=>e>=t,">>":(e,t)=>e>>t,">>>":(e,t)=>e>>>t,"^":(e,t)=>e^t,"|":(e,t)=>e|t};function $i(e,t,i){if(i.arguments.length>0)if(i.arguments[i.arguments.length-1].included)for(const s of i.arguments)s.render(e,t);else{let s=i.arguments.length-2;for(;s>=0&&!i.arguments[s].included;)s--;if(s>=0){for(let n=0;n<=s;n++)i.arguments[n].render(e,t);e.remove(hi(e.original,",",i.arguments[s].end),i.end-1)}else e.remove(hi(e.original,"(",i.callee.end)+1,i.end-1)}}class Ti extends ut{deoptimizeThisOnInteractionAtPath(){}getLiteralValueAtPath(e){return e.length>0||null===this.value&&110!==this.context.code.charCodeAt(this.start)||"bigint"==typeof this.value||47===this.context.code.charCodeAt(this.start)?W:this.value}getReturnExpressionWhenCalledAtPath(e){return 1!==e.length?X:Qe(this.members,e[0])}hasEffectsOnInteractionAtPath(e,t,i){switch(t.type){case 0:return e.length>(null===this.value?0:1);case 1:return!0;case 2:return 1!==e.length||Ye(this.members,e[0],t,i)}}initialise(){this.members=function(e){switch(typeof e){case"boolean":return qe;case"number":return Ke;case"string":return Xe}return Object.create(null)}(this.value)}parseNode(e){this.value=e.value,this.regex=e.regex,super.parseNode(e)}render(e){"string"==typeof this.value&&e.indentExclusionRanges.push([this.start+1,this.end-1])}}function Oi(e){return e.computed?function(e){if(e instanceof Ti)return String(e.value);return null}(e.property):e.property.name}function Ri(e){const t=e.propertyKey,i=e.object;if("string"==typeof t){if(i instanceof ni)return[{key:i.name,pos:i.start},{key:t,pos:e.property.start}];if(i instanceof Mi){const s=Ri(i);return s&&[...s,{key:t,pos:e.property.start}]}}return null}class Mi extends ut{constructor(){super(...arguments),this.variable=null,this.assignmentDeoptimized=!1,this.bound=!1,this.expressionsToBeDeoptimized=[],this.replacement=null}bind(){this.bound=!0;const e=Ri(this),t=e&&this.scope.findVariable(e[0].key);if(t&&t.isNamespace){const i=Di(t,e.slice(1),this.context);i?"string"==typeof i?this.replacement=i:(this.variable=i,this.scope.addNamespaceMemberAccess(function(e){let t=e[0].key;for(let i=1;i{this.expressionsToBeDeoptimized.add(e.thisArg),s.deoptimizeThisOnInteractionAtPath(e,t,i)}),void 0)}getLiteralValueAtPath(e,t,i){const s=this.getReturnExpression(t);return s===X?W:t.withTrackedEntityAtPath(e,s,(()=>(this.deoptimizableDependentExpressions.push(i),s.getLiteralValueAtPath(e,t,i))),W)}getReturnExpressionWhenCalledAtPath(e,t,i,s){const n=this.getReturnExpression(i);return this.returnExpression===X?X:i.withTrackedEntityAtPath(e,n,(()=>(this.deoptimizableDependentExpressions.push(s),n.getReturnExpressionWhenCalledAtPath(e,t,i,s))),X)}hasEffectsOnInteractionAtPath(e,t,i){const{type:s}=t;if(2===s){if((t.withNew?i.instantiated:i.called).trackEntityAtPathAndGetIfTracked(e,t.args,this))return!1}else if((1===s?i.assigned:i.accessed).trackEntityAtPathAndGetIfTracked(e,this))return!1;return this.getReturnExpression().hasEffectsOnInteractionAtPath(e,t,i)}}class Vi extends zt{addDeclaration(e,t,i,s){const n=this.variables.get(e.name);return n?(this.parent.addDeclaration(e,t,Le,s),n.addDeclaration(e,i),n):this.parent.addDeclaration(e,t,i,s)}}class Bi extends Ft{constructor(e,t,i){super(e),this.variables.set("this",this.thisVariable=new Dt("this",null,t,i)),this.instanceScope=new Ft(this),this.instanceScope.variables.set("this",new wi(i))}findLexicalBoundary(){return this}}class Fi extends ut{constructor(){super(...arguments),this.accessedValue=null}deoptimizeCache(){}deoptimizePath(e){this.getAccessedValue().deoptimizePath(e)}deoptimizeThisOnInteractionAtPath(e,t,i){return 0===e.type&&"get"===this.kind&&0===t.length?this.value.deoptimizeThisOnInteractionAtPath({args:J,thisArg:e.thisArg,type:2,withNew:!1},V,i):1===e.type&&"set"===this.kind&&0===t.length?this.value.deoptimizeThisOnInteractionAtPath({args:e.args,thisArg:e.thisArg,type:2,withNew:!1},V,i):void this.getAccessedValue().deoptimizeThisOnInteractionAtPath(e,t,i)}getLiteralValueAtPath(e,t,i){return this.getAccessedValue().getLiteralValueAtPath(e,t,i)}getReturnExpressionWhenCalledAtPath(e,t,i,s){return this.getAccessedValue().getReturnExpressionWhenCalledAtPath(e,t,i,s)}hasEffects(e){return this.key.hasEffects(e)}hasEffectsOnInteractionAtPath(e,t,i){return"get"===this.kind&&0===t.type&&0===e.length?this.value.hasEffectsOnInteractionAtPath(V,{args:J,thisArg:t.thisArg,type:2,withNew:!1},i):"set"===this.kind&&1===t.type?this.value.hasEffectsOnInteractionAtPath(V,{args:t.args,thisArg:t.thisArg,type:2,withNew:!1},i):this.getAccessedValue().hasEffectsOnInteractionAtPath(e,t,i)}applyDeoptimizations(){}getAccessedValue(){return null===this.accessedValue?"get"===this.kind?(this.accessedValue=X,this.accessedValue=this.value.getReturnExpressionWhenCalledAtPath(V,Z,G,this)):this.accessedValue=this.value:this.accessedValue}}class zi extends Fi{applyDeoptimizations(){}}class ji extends K{constructor(e,t){super(),this.object=e,this.key=t}deoptimizePath(e){this.object.deoptimizePath([this.key,...e])}deoptimizeThisOnInteractionAtPath(e,t,i){this.object.deoptimizeThisOnInteractionAtPath(e,[this.key,...t],i)}getLiteralValueAtPath(e,t,i){return this.object.getLiteralValueAtPath([this.key,...e],t,i)}getReturnExpressionWhenCalledAtPath(e,t,i,s){return this.object.getReturnExpressionWhenCalledAtPath([this.key,...e],t,i,s)}hasEffectsOnInteractionAtPath(e,t,i){return this.object.hasEffectsOnInteractionAtPath([this.key,...e],t,i)}}class Ui extends ut{constructor(){super(...arguments),this.objectEntity=null}createScope(e){this.scope=new Ft(e)}deoptimizeCache(){this.getObjectEntity().deoptimizeAllProperties()}deoptimizePath(e){this.getObjectEntity().deoptimizePath(e)}deoptimizeThisOnInteractionAtPath(e,t,i){this.getObjectEntity().deoptimizeThisOnInteractionAtPath(e,t,i)}getLiteralValueAtPath(e,t,i){return this.getObjectEntity().getLiteralValueAtPath(e,t,i)}getReturnExpressionWhenCalledAtPath(e,t,i,s){return this.getObjectEntity().getReturnExpressionWhenCalledAtPath(e,t,i,s)}hasEffects(e){var t,i;this.deoptimized||this.applyDeoptimizations();const s=(null===(t=this.superClass)||void 0===t?void 0:t.hasEffects(e))||this.body.hasEffects(e);return null===(i=this.id)||void 0===i||i.markDeclarationReached(),s||super.hasEffects(e)}hasEffectsOnInteractionAtPath(e,t,i){var s;return 2===t.type&&0===e.length?!t.withNew||(null!==this.classConstructor?this.classConstructor.hasEffectsOnInteractionAtPath(e,t,i):null===(s=this.superClass)||void 0===s?void 0:s.hasEffectsOnInteractionAtPath(e,t,i))||!1:this.getObjectEntity().hasEffectsOnInteractionAtPath(e,t,i)}include(e,t){var i;this.deoptimized||this.applyDeoptimizations(),this.included=!0,null===(i=this.superClass)||void 0===i||i.include(e,t),this.body.include(e,t),this.id&&(this.id.markDeclarationReached(),this.id.include())}initialise(){var e;null===(e=this.id)||void 0===e||e.declare("class",this);for(const e of this.body.body)if(e instanceof zi&&"constructor"===e.kind)return void(this.classConstructor=e);this.classConstructor=null}applyDeoptimizations(){this.deoptimized=!0;for(const e of this.body.body)e.static||e instanceof zi&&"constructor"===e.kind||e.deoptimizePath(B);this.context.requestTreeshakingPass()}getObjectEntity(){if(null!==this.objectEntity)return this.objectEntity;const e=[],t=[];for(const i of this.body.body){const s=i.static?e:t,n=i.kind;if(s===t&&!n)continue;const r="set"===n||"get"===n?n:"init";let a;if(i.computed){const e=i.key.getLiteralValueAtPath(V,G,this);if("symbol"==typeof e){s.push({key:M,kind:r,property:i});continue}a=String(e)}else a=i.key instanceof ni?i.key.name:String(i.key.value);s.push({key:a,kind:r,property:i})}return e.unshift({key:"prototype",kind:"init",property:new Et(t,this.superClass?new ji(this.superClass,"prototype"):St)}),this.objectEntity=new Et(e,this.superClass||St)}}class Gi extends Ui{initialise(){super.initialise(),null!==this.id&&(this.id.variable.isId=!0)}parseNode(e){null!==e.id&&(this.id=new ni(e.id,this,this.scope.parent)),super.parseNode(e)}render(e,t){const{exportNamesByVariable:i,format:s,snippets:{_:n}}=t;"system"===s&&this.id&&i.has(this.id.variable)&&e.appendLeft(this.end,`${n}${Si([this.id.variable],t)};`),super.render(e,t)}}class Hi extends K{constructor(e){super(),this.expressions=e,this.included=!1}deoptimizePath(e){for(const t of this.expressions)t.deoptimizePath(e)}getReturnExpressionWhenCalledAtPath(e,t,i,s){return new Hi(this.expressions.map((n=>n.getReturnExpressionWhenCalledAtPath(e,t,i,s))))}hasEffectsOnInteractionAtPath(e,t,i){for(const s of this.expressions)if(s.hasEffectsOnInteractionAtPath(e,t,i))return!0;return!1}}class Wi extends ut{hasEffects(){return!1}initialise(){this.context.addExport(this)}render(e,t,i){e.remove(i.start,i.end)}applyDeoptimizations(){}}Wi.prototype.needsBoundaries=!0;class qi extends _i{initialise(){super.initialise(),null!==this.id&&(this.id.variable.isId=!0)}parseNode(e){null!==e.id&&(this.id=new ni(e.id,this,this.scope.parent)),super.parseNode(e)}}class Ki extends ut{include(e,t){super.include(e,t),t&&this.context.includeVariableInModule(this.variable)}initialise(){const e=this.declaration;this.declarationName=e.id&&e.id.name||this.declaration.name,this.variable=this.scope.addExportDefaultDeclaration(this.declarationName||this.context.getModuleName(),this,this.context),this.context.addExport(this)}render(e,t,i){const{start:s,end:n}=i,r=function(e,t){return ui(e,hi(e,"default",t)+7)}(e.original,this.start);if(this.declaration instanceof qi)this.renderNamedDeclaration(e,r,"function","(",null===this.declaration.id,t);else if(this.declaration instanceof Gi)this.renderNamedDeclaration(e,r,"class","{",null===this.declaration.id,t);else{if(this.variable.getOriginalVariable()!==this.variable)return void ai(this,e,s,n);if(!this.variable.included)return e.remove(this.start,r),this.declaration.render(e,t,{renderedSurroundingElement:"ExpressionStatement"}),void(";"!==e.original[this.end-1]&&e.appendLeft(this.end,";"));this.renderVariableDeclaration(e,r,t)}this.declaration.render(e,t)}applyDeoptimizations(){}renderNamedDeclaration(e,t,i,s,n,r){const{exportNamesByVariable:a,format:o,snippets:{getPropertyAccess:l}}=r,h=this.variable.getName(l);e.remove(this.start,t),n&&e.appendLeft(function(e,t,i,s){const n=hi(e,t,s)+t.length;e=e.slice(n,hi(e,i,n));const r=hi(e,"*");return-1===r?n:n+r+1}(e.original,i,s,t),` ${h}`),"system"===o&&this.declaration instanceof Gi&&a.has(this.variable)&&e.appendLeft(this.end,` ${Si([this.variable],r)};`)}renderVariableDeclaration(e,t,{format:i,exportNamesByVariable:s,snippets:{cnst:n,getPropertyAccess:r}}){const a=59===e.original.charCodeAt(this.end-1),o="system"===i&&s.get(this.variable);o?(e.overwrite(this.start,t,`${n} ${this.variable.getName(r)} = exports('${o[0]}', `),e.appendRight(a?this.end-1:this.end,")"+(a?"":";"))):(e.overwrite(this.start,t,`${n} ${this.variable.getName(r)} = `),a||e.appendLeft(this.end,";"))}}Ki.prototype.needsBoundaries=!0;class Xi extends ut{bind(){var e;null===(e=this.declaration)||void 0===e||e.bind()}hasEffects(e){var t;return!!(null===(t=this.declaration)||void 0===t?void 0:t.hasEffects(e))}initialise(){this.context.addExport(this)}render(e,t,i){const{start:s,end:n}=i;null===this.declaration?e.remove(s,n):(e.remove(this.start,this.declaration.start),this.declaration.render(e,t,{end:n,start:s}))}applyDeoptimizations(){}}Xi.prototype.needsBoundaries=!0;class Yi extends gi{constructor(){super(...arguments),this.hoistedDeclarations=[]}addDeclaration(e,t,i,s){return this.hoistedDeclarations.push(e),super.addDeclaration(e,t,i,s)}}const Qi=Symbol("unset");class Ji extends ut{constructor(){super(...arguments),this.testValue=Qi}deoptimizeCache(){this.testValue=W}hasEffects(e){var t;if(this.test.hasEffects(e))return!0;const i=this.getTestValue();if("symbol"==typeof i){const{brokenFlow:t}=e;if(this.consequent.hasEffects(e))return!0;const i=e.brokenFlow;return e.brokenFlow=t,null===this.alternate?!1:!!this.alternate.hasEffects(e)||(e.brokenFlow=e.brokenFlow{const t=e.variable;return t.included?t.getName(i):""})))].filter(Boolean).join(", ");if(s){const e=this.parent.type,i="Program"!==e&&"BlockStatement"!==e;t.prependRight(this.start,`${i?"{ ":""}var ${s}; `),i&&t.appendLeft(this.end," }")}}shouldKeepAlternateBranch(){let e=this.parent;do{if(e instanceof Ji&&e.alternate)return!0;if(e instanceof xi)return!1;e=e.parent}while(e);return!1}}class Zi extends ut{bind(){}hasEffects(){return!1}initialise(){this.context.addImport(this)}render(e,t,i){e.remove(i.start,i.end)}applyDeoptimizations(){}}Zi.prototype.needsBoundaries=!0;const es={auto:"_interopDefault",default:null,defaultOnly:null,esModule:null,false:null,true:"_interopDefaultLegacy"},ts=(e,t)=>"esModule"===e||t&&("auto"===e||"true"===e),is={auto:"_interopNamespace",default:"_interopNamespaceDefault",defaultOnly:"_interopNamespaceDefaultOnly",esModule:null,false:null,true:"_interopNamespace"},ss=(e,t)=>ts(e,t)&&"_interopDefault"===es[e],ns=(e,t,i,s,n,r,a)=>{const o=new Set(e);for(const e of ys)t.has(e)&&o.add(e);return ys.map((e=>o.has(e)?rs[e](i,s,n,r,a,o):"")).join("")},rs={_interopDefaultLegacy(e,t,i){const{_:s,getDirectReturnFunction:n,n:r}=t,[a,o]=n(["e"],{functionReturn:!0,lineBreakIndent:null,name:"_interopDefaultLegacy"});return`${a}e${s}&&${s}typeof e${s}===${s}'object'${s}&&${s}'default'${s}in e${s}?${s}${i?as(t):os(t)}${o}${r}${r}`},_interopDefault(e,t,i){const{_:s,getDirectReturnFunction:n,n:r}=t,[a,o]=n(["e"],{functionReturn:!0,lineBreakIndent:null,name:"_interopDefault"});return`${a}e${s}&&${s}e.__esModule${s}?${s}${i?as(t):os(t)}${o}${r}${r}`},_interopNamespaceDefaultOnly(e,t,i,s,n){const{getDirectReturnFunction:r,getObject:a,n:o}=t,[l,h]=r(["e"],{functionReturn:!0,lineBreakIndent:null,name:"_interopNamespaceDefaultOnly"});return`${l}${ms(s,gs(n,a([["__proto__","null"],["default","e"]],{lineBreakIndent:null}),t))}${h}${o}${o}`},_interopNamespaceDefault(e,t,i,s,n){const{_:r,n:a}=t;return`function _interopNamespaceDefault(e)${r}{${a}`+ls(e,e,t,i,s,n)+`}${a}${a}`},_interopNamespace(e,t,i,s,n,r){const{_:a,getDirectReturnFunction:o,n:l}=t;if(r.has("_interopNamespaceDefault")){const[e,t]=o(["e"],{functionReturn:!0,lineBreakIndent:null,name:"_interopNamespace"});return`${e}e${a}&&${a}e.__esModule${a}?${a}e${a}:${a}_interopNamespaceDefault(e)${t}${l}${l}`}return`function _interopNamespace(e)${a}{${l}${e}if${a}(e${a}&&${a}e.__esModule)${a}return e;${l}`+ls(e,e,t,i,s,n)+`}${l}${l}`},_mergeNamespaces(e,t,i,s,n){const{_:r,cnst:a,n:o}=t,l="var"===a&&i;return`function _mergeNamespaces(n, m)${r}{${o}${e}${cs(`{${o}${e}${e}${e}if${r}(k${r}!==${r}'default'${r}&&${r}!(k in n))${r}{${o}`+(i?l?ds:ps:fs)(e,e+e+e+e,t)+`${e}${e}${e}}${o}`+`${e}${e}}`,l,e,t)}${o}${e}return ${ms(s,gs(n,"n",t))};${o}}${o}${o}`}},as=({_:e,getObject:t})=>`e${e}:${e}${t([["default","e"]],{lineBreakIndent:null})}`,os=({_:e,getPropertyAccess:t})=>`e${t("default")}${e}:${e}e`,ls=(e,t,i,s,n,r)=>{const{_:a,cnst:o,getObject:l,getPropertyAccess:h,n:c,s:u}=i,d=`{${c}`+(s?us:fs)(e,t+e+e,i)+`${t}${e}}`;return`${t}${o} n${a}=${a}Object.create(null${r?`,${a}{${a}[Symbol.toStringTag]:${a}${xs(l)}${a}}`:""});${c}${t}if${a}(e)${a}{${c}${t}${e}${hs(d,!s,i)}${c}${t}}${c}${t}n${h("default")}${a}=${a}e;${c}${t}return ${ms(n,"n")}${u}${c}`},hs=(e,t,{_:i,cnst:s,getFunctionIntro:n,s:r})=>"var"!==s||t?`for${i}(${s} k in e)${i}${e}`:`Object.keys(e).forEach(${n(["k"],{isAsync:!1,name:null})}${e})${r}`,cs=(e,t,i,{_:s,cnst:n,getDirectReturnFunction:r,getFunctionIntro:a,n:o})=>{if(t){const[t,n]=r(["e"],{functionReturn:!1,lineBreakIndent:{base:i,t:i},name:null});return`m.forEach(${t}e${s}&&${s}typeof e${s}!==${s}'string'${s}&&${s}!Array.isArray(e)${s}&&${s}Object.keys(e).forEach(${a(["k"],{isAsync:!1,name:null})}${e})${n});`}return`for${s}(var i${s}=${s}0;${s}i${s}<${s}m.length;${s}i++)${s}{${o}${i}${i}${n} e${s}=${s}m[i];${o}${i}${i}if${s}(typeof e${s}!==${s}'string'${s}&&${s}!Array.isArray(e))${s}{${s}for${s}(${n} k in e)${s}${e}${s}}${o}${i}}`},us=(e,t,i)=>{const{_:s,n:n}=i;return`${t}if${s}(k${s}!==${s}'default')${s}{${n}`+ds(e,t+e,i)+`${t}}${n}`},ds=(e,t,{_:i,cnst:s,getDirectReturnFunction:n,n:r})=>{const[a,o]=n([],{functionReturn:!0,lineBreakIndent:null,name:null});return`${t}${s} d${i}=${i}Object.getOwnPropertyDescriptor(e,${i}k);${r}${t}Object.defineProperty(n,${i}k,${i}d.get${i}?${i}d${i}:${i}{${r}${t}${e}enumerable:${i}true,${r}${t}${e}get:${i}${a}e[k]${o}${r}${t}});${r}`},ps=(e,t,{_:i,cnst:s,getDirectReturnFunction:n,n:r})=>{const[a,o]=n([],{functionReturn:!0,lineBreakIndent:null,name:null});return`${t}${s} d${i}=${i}Object.getOwnPropertyDescriptor(e,${i}k);${r}${t}if${i}(d)${i}{${r}${t}${e}Object.defineProperty(n,${i}k,${i}d.get${i}?${i}d${i}:${i}{${r}${t}${e}${e}enumerable:${i}true,${r}${t}${e}${e}get:${i}${a}e[k]${o}${r}${t}${e}});${r}${t}}${r}`},fs=(e,t,{_:i,n:s})=>`${t}n[k]${i}=${i}e[k];${s}`,ms=(e,t)=>e?`Object.freeze(${t})`:t,gs=(e,t,{_:i,getObject:s})=>e?`Object.defineProperty(${t},${i}Symbol.toStringTag,${i}${xs(s)})`:t,ys=Object.keys(rs);function xs(e){return e([["value","'Module'"]],{lineBreakIndent:null})}function Es(e,t,i){return"external"===t?is[String(i(e instanceof $e?e.id:null))]:"default"===t?"_interopNamespaceDefaultOnly":null}const bs={amd:["require"],cjs:["require"],system:["module"]};const vs="ROLLUP_ASSET_URL_",Ss="ROLLUP_FILE_URL_";const As={amd:["document","module","URL"],cjs:["document","require","URL"],es:[],iife:["document","URL"],system:["module"],umd:["document","require","URL"]},Is={amd:["document","require","URL"],cjs:["document","require","URL"],es:[],iife:["document","URL"],system:["module","URL"],umd:["document","require","URL"]},Ps=(e,t="URL")=>`new ${t}(${e}).href`,ks=(e,t=!1)=>Ps(`'${e}', ${t?"typeof document === 'undefined' ? location.href : ":""}document.currentScript && document.currentScript.src || document.baseURI`),ws=e=>(t,{chunkId:i})=>{const s=e(i);return null===t?`({ url: ${s} })`:"url"===t?s:"undefined"},Cs=(e,t=!1)=>`${t?"typeof document === 'undefined' ? location.href : ":""}(document.currentScript && document.currentScript.src || new URL('${e}', document.baseURI).href)`,_s={amd:e=>("."!==e[0]&&(e="./"+e),Ps(`require.toUrl('${e}'), document.baseURI`)),cjs:e=>`(typeof document === 'undefined' ? ${Ps(`'file:' + __dirname + '/${e}'`,"(require('u' + 'rl').URL)")} : ${ks(e)})`,es:e=>Ps(`'${e}', import.meta.url`),iife:e=>ks(e),system:e=>Ps(`'${e}', module.meta.url`),umd:e=>`(typeof document === 'undefined' && typeof location === 'undefined' ? ${Ps(`'file:' + __dirname + '/${e}'`,"(require('u' + 'rl').URL)")} : ${ks(e,!0)})`},Ns={amd:ws((()=>Ps("module.uri, document.baseURI"))),cjs:ws((e=>`(typeof document === 'undefined' ? ${Ps("'file:' + __filename","(require('u' + 'rl').URL)")} : ${Cs(e)})`)),iife:ws((e=>Cs(e))),system:(e,{snippets:{getPropertyAccess:t}})=>null===e?"module.meta":`module.meta${t(e)}`,umd:ws((e=>`(typeof document === 'undefined' && typeof location === 'undefined' ? ${Ps("'file:' + __filename","(require('u' + 'rl').URL)")} : ${Cs(e,!0)})`))};class $s extends ut{constructor(){super(...arguments),this.hasCachedEffect=!1}hasEffects(e){if(this.hasCachedEffect)return!0;for(const t of this.body)if(t.hasEffects(e))return this.hasCachedEffect=!0;return!1}include(e,t){this.included=!0;for(const i of this.body)(t||i.shouldBeIncluded(e))&&i.include(e,t)}render(e,t){this.body.length?pi(this.body,e,this.start,this.end,t):super.render(e,t)}applyDeoptimizations(){}}class Ts extends ut{hasEffects(e){var t;if(null===(t=this.test)||void 0===t?void 0:t.hasEffects(e))return!0;for(const t of this.consequent){if(e.brokenFlow)break;if(t.hasEffects(e))return!0}return!1}include(e,t){var i;this.included=!0,null===(i=this.test)||void 0===i||i.include(e,t);for(const i of this.consequent)(t||i.shouldBeIncluded(e))&&i.include(e,t)}render(e,t,i){if(this.consequent.length){this.test&&this.test.render(e,t);const s=this.test?this.test.end:hi(e.original,"default",this.start)+7,n=hi(e.original,":",s)+1;pi(this.consequent,e,n,i.end,t)}else super.render(e,t)}}Ts.prototype.needsBoundaries=!0;class Os extends ut{deoptimizeThisOnInteractionAtPath(){}getLiteralValueAtPath(e){return e.length>0||1!==this.quasis.length?W:this.quasis[0].value.cooked}getReturnExpressionWhenCalledAtPath(e){return 1!==e.length?X:Qe(Xe,e[0])}hasEffectsOnInteractionAtPath(e,t,i){return 0===t.type?e.length>1:2!==t.type||1!==e.length||Ye(Xe,e[0],t,i)}render(e,t){e.indentExclusionRanges.push([this.start,this.end]),super.render(e,t)}}class Rs extends ee{constructor(){super("undefined")}getLiteralValueAtPath(){}}class Ms extends Dt{constructor(e,t,i){super(e,t,t.declaration,i),this.hasId=!1,this.originalId=null,this.originalVariable=null;const s=t.declaration;(s instanceof qi||s instanceof Gi)&&s.id?(this.hasId=!0,this.originalId=s.id):s instanceof ni&&(this.originalId=s)}addReference(e){this.hasId||(this.name=e.name)}getAssignedVariableName(){return this.originalId&&this.originalId.name||null}getBaseVariableName(){const e=this.getOriginalVariable();return e===this?super.getBaseVariableName():e.getBaseVariableName()}getDirectOriginalVariable(){return!this.originalId||!this.hasId&&(this.originalId.isPossibleTDZ()||this.originalId.variable.isReassigned||this.originalId.variable instanceof Rs||"syntheticNamespace"in this.originalId.variable)?null:this.originalId.variable}getName(e){const t=this.getOriginalVariable();return t===this?super.getName(e):t.getName(e)}getOriginalVariable(){if(this.originalVariable)return this.originalVariable;let e,t=this;const i=new Set;do{i.add(t),e=t,t=e.getDirectOriginalVariable()}while(t instanceof Ms&&!i.has(t));return this.originalVariable=t||e}}class Ds extends Ft{constructor(e,t){super(e),this.context=t,this.variables.set("this",new Dt("this",null,Le,t))}addExportDefaultDeclaration(e,t,i){const s=new Ms(e,t,i);return this.variables.set("default",s),s}addNamespaceMemberAccess(){}deconflict(e,t,i){for(const s of this.children)s.deconflict(e,t,i)}findLexicalBoundary(){return this}findVariable(e){const t=this.variables.get(e)||this.accessedOutsideVariables.get(e);if(t)return t;const i=this.context.traceVariable(e)||this.parent.findVariable(e);return i instanceof ii&&this.accessedOutsideVariables.set(e,i),i}}const Ls={"!":e=>!e,"+":e=>+e,"-":e=>-e,delete:()=>W,typeof:e=>typeof e,void:()=>{},"~":e=>~e};function Vs(e,t){return null!==e.renderBaseName&&t.has(e)&&e.isReassigned}class Bs extends ut{deoptimizePath(){for(const e of this.declarations)e.deoptimizePath(V)}hasEffectsOnInteractionAtPath(){return!1}include(e,t,{asSingleStatement:i}=ie){this.included=!0;for(const s of this.declarations)(t||s.shouldBeIncluded(e))&&s.include(e,t),i&&s.id.include(e,t)}initialise(){for(const e of this.declarations)e.declareDeclarator(this.kind)}render(e,t,i=ie){if(function(e,t){for(const i of e){if(!i.id.included)return!1;if("Identifier"===i.id.type){if(t.has(i.id.variable))return!1}else{const e=[];if(i.id.addExportedVariables(e,t),e.length>0)return!1}}return!0}(this.declarations,t.exportNamesByVariable)){for(const i of this.declarations)i.render(e,t);i.isNoStatement||59===e.original.charCodeAt(this.end-1)||e.appendLeft(this.end,";")}else this.renderReplacedDeclarations(e,t)}applyDeoptimizations(){}renderDeclarationEnd(e,t,i,s,n,r,a){59===e.original.charCodeAt(this.end-1)&&e.remove(this.end-1,this.end),t+=";",null!==i?(10!==e.original.charCodeAt(s-1)||10!==e.original.charCodeAt(this.end)&&13!==e.original.charCodeAt(this.end)||(s--,13===e.original.charCodeAt(s)&&s--),s===i+1?e.overwrite(i,n,t):(e.overwrite(i,i+1,t),e.remove(s,n))):e.appendLeft(n,t),r.length>0&&e.appendLeft(n,` ${Si(r,a)};`)}renderReplacedDeclarations(e,t){const i=fi(this.declarations,e,this.start+this.kind.length,this.end-(59===e.original.charCodeAt(this.end-1)?1:0));let s,n;n=ui(e.original,this.start+this.kind.length);let r=n-1;e.remove(this.start,r);let a,o,l=!1,h=!1,c="";const u=[],d=function(e,t,i){var s;let n=null;if("system"===t.format){for(const{node:r}of e)r.id instanceof ni&&r.init&&0===i.length&&1===(null===(s=t.exportNamesByVariable.get(r.id.variable))||void 0===s?void 0:s.length)?(n=r.id.variable,i.push(n)):r.id.addExportedVariables(i,t.exportNamesByVariable);i.length>1?n=null:n&&(i.length=0)}return n}(i,t,u);for(const{node:u,start:p,separator:f,contentEnd:m,end:g}of i)if(u.included){if(u.render(e,t),a="",o="",!u.id.included||u.id instanceof ni&&Vs(u.id.variable,t.exportNamesByVariable))h&&(c+=";"),l=!1;else{if(d&&d===u.id.variable){const i=hi(e.original,"=",u.id.end);Ai(d,ui(e.original,i+1),null===f?m:f,e,t)}l?c+=",":(h&&(c+=";"),a+=`${this.kind} `,l=!0)}n===r+1?e.overwrite(r,n,c+a):(e.overwrite(r,r+1,c),e.appendLeft(n,a)),s=m,n=g,h=!0,r=f,c=""}else e.remove(p,g);this.renderDeclarationEnd(e,c,r,s,n,u,t)}}const Fs={ArrayExpression:class extends ut{constructor(){super(...arguments),this.objectEntity=null}deoptimizePath(e){this.getObjectEntity().deoptimizePath(e)}deoptimizeThisOnInteractionAtPath(e,t,i){this.getObjectEntity().deoptimizeThisOnInteractionAtPath(e,t,i)}getLiteralValueAtPath(e,t,i){return this.getObjectEntity().getLiteralValueAtPath(e,t,i)}getReturnExpressionWhenCalledAtPath(e,t,i,s){return this.getObjectEntity().getReturnExpressionWhenCalledAtPath(e,t,i,s)}hasEffectsOnInteractionAtPath(e,t,i){return this.getObjectEntity().hasEffectsOnInteractionAtPath(e,t,i)}applyDeoptimizations(){this.deoptimized=!0;let e=!1;for(let t=0;t0)return void function(e,t,i,s,n,r){const{_:a,getDirectReturnIifeLeft:o}=r.snippets;n.prependRight(t,o(["v"],`${Si(e,r)},${a}v`,{needsArrowReturnParens:!0,needsWrappedFunction:s})),n.appendLeft(i,")")}(i,o,l,"ExpressionStatement"===n,e,t)}r.included&&r instanceof Pi&&("ExpressionStatement"===n||"ArrowFunctionExpression"===n)&&(e.appendRight(o,"("),e.prependLeft(l,")"))}applyDeoptimizations(){this.deoptimized=!0,this.left.deoptimizePath(V),this.right.deoptimizePath(B),this.context.requestTreeshakingPass()}},AssignmentPattern:class extends ut{addExportedVariables(e,t){this.left.addExportedVariables(e,t)}declare(e,t){return this.left.declare(e,t)}deoptimizePath(e){0===e.length&&this.left.deoptimizePath(e)}hasEffectsOnInteractionAtPath(e,t,i){return e.length>0||this.left.hasEffectsOnInteractionAtPath(V,t,i)}markDeclarationReached(){this.left.markDeclarationReached()}render(e,t,{isShorthandProperty:i}=ie){this.left.render(e,t,{isShorthandProperty:i}),this.right.render(e,t)}applyDeoptimizations(){this.deoptimized=!0,this.left.deoptimizePath(V),this.right.deoptimizePath(B),this.context.requestTreeshakingPass()}},AwaitExpression:class extends ut{hasEffects(){return this.deoptimized||this.applyDeoptimizations(),!0}include(e,t){if(this.deoptimized||this.applyDeoptimizations(),!this.included){this.included=!0;e:if(!this.context.usesTopLevelAwait){let e=this.parent;do{if(e instanceof _i||e instanceof vi)break e}while(e=e.parent);this.context.usesTopLevelAwait=!0}}this.argument.include(e,t)}},BinaryExpression:class extends ut{deoptimizeCache(){}getLiteralValueAtPath(e,t,i){if(e.length>0)return W;const s=this.left.getLiteralValueAtPath(V,t,i);if("symbol"==typeof s)return W;const n=this.right.getLiteralValueAtPath(V,t,i);if("symbol"==typeof n)return W;const r=Ni[this.operator];return r?r(s,n):W}hasEffects(e){return"+"===this.operator&&this.parent instanceof yi&&""===this.left.getLiteralValueAtPath(V,G,this)||super.hasEffects(e)}hasEffectsOnInteractionAtPath(e,{type:t}){return 0!==t||e.length>1}render(e,t,{renderedSurroundingElement:i}=ie){this.left.render(e,t,{renderedSurroundingElement:i}),this.right.render(e,t)}},BlockStatement:xi,BreakStatement:class extends ut{hasEffects(e){if(this.label){if(!e.ignore.labels.has(this.label.name))return!0;e.includedLabels.add(this.label.name),e.brokenFlow=2}else{if(!e.ignore.breaks)return!0;e.brokenFlow=1}return!1}include(e){this.included=!0,this.label&&(this.label.include(),e.includedLabels.add(this.label.name)),e.brokenFlow=this.label?2:1}},CallExpression:class extends Li{bind(){if(super.bind(),this.callee instanceof ni){this.scope.findVariable(this.callee.name).isNamespace&&this.context.warn({code:"CANNOT_CALL_NAMESPACE",message:`Cannot call a namespace ('${this.callee.name}')`},this.start),"eval"===this.callee.name&&this.context.warn({code:"EVAL",message:"Use of eval is strongly discouraged, as it poses security risks and may cause issues with minification",url:"https://rollupjs.org/guide/en/#avoiding-eval"},this.start)}this.interaction={args:this.arguments,thisArg:this.callee instanceof Mi&&!this.callee.variable?this.callee.object:null,type:2,withNew:!1}}hasEffects(e){try{for(const t of this.arguments)if(t.hasEffects(e))return!0;return(!this.context.options.treeshake.annotations||!this.annotations)&&(this.callee.hasEffects(e)||this.callee.hasEffectsOnInteractionAtPath(V,this.interaction,e))}finally{this.deoptimized||this.applyDeoptimizations()}}include(e,t){this.deoptimized||this.applyDeoptimizations(),t?(super.include(e,t),"variables"===t&&this.callee instanceof ni&&this.callee.variable&&this.callee.variable.markCalledFromTryStatement()):(this.included=!0,this.callee.include(e,!1)),this.callee.includeCallArguments(e,this.arguments)}render(e,t,{renderedSurroundingElement:i}=ie){this.callee.render(e,t,{isCalleeOfRenderedParent:!0,renderedSurroundingElement:i}),$i(e,t,this)}applyDeoptimizations(){this.deoptimized=!0,this.interaction.thisArg&&this.callee.deoptimizeThisOnInteractionAtPath(this.interaction,V,G);for(const e of this.arguments)e.deoptimizePath(B);this.context.requestTreeshakingPass()}getReturnExpression(e=G){return null===this.returnExpression?(this.returnExpression=X,this.returnExpression=this.callee.getReturnExpressionWhenCalledAtPath(V,this.interaction,e,this)):this.returnExpression}},CatchClause:class extends ut{createScope(e){this.scope=new Vi(e,this.context)}parseNode(e){const{param:t}=e;t&&(this.param=new(this.context.getNodeConstructor(t.type))(t,this,this.scope),this.param.declare("parameter",X)),super.parseNode(e)}},ChainExpression:class extends ut{},ClassBody:class extends ut{createScope(e){this.scope=new Bi(e,this.parent,this.context)}include(e,t){this.included=!0,this.context.includeVariableInModule(this.scope.thisVariable);for(const i of this.body)i.include(e,t)}parseNode(e){const t=this.body=[];for(const i of e.body)t.push(new(this.context.getNodeConstructor(i.type))(i,this,i.static?this.scope:this.scope.instanceScope));super.parseNode(e)}applyDeoptimizations(){}},ClassDeclaration:Gi,ClassExpression:class extends Ui{render(e,t,{renderedSurroundingElement:i}=ie){super.render(e,t),"ExpressionStatement"===i&&(e.appendRight(this.start,"("),e.prependLeft(this.end,")"))}},ConditionalExpression:class extends ut{constructor(){super(...arguments),this.expressionsToBeDeoptimized=[],this.isBranchResolutionAnalysed=!1,this.usedBranch=null}deoptimizeCache(){if(null!==this.usedBranch){const e=this.usedBranch===this.consequent?this.alternate:this.consequent;this.usedBranch=null,e.deoptimizePath(B);for(const e of this.expressionsToBeDeoptimized)e.deoptimizeCache()}}deoptimizePath(e){const t=this.getUsedBranch();t?t.deoptimizePath(e):(this.consequent.deoptimizePath(e),this.alternate.deoptimizePath(e))}deoptimizeThisOnInteractionAtPath(e,t,i){this.consequent.deoptimizeThisOnInteractionAtPath(e,t,i),this.alternate.deoptimizeThisOnInteractionAtPath(e,t,i)}getLiteralValueAtPath(e,t,i){const s=this.getUsedBranch();return s?(this.expressionsToBeDeoptimized.push(i),s.getLiteralValueAtPath(e,t,i)):W}getReturnExpressionWhenCalledAtPath(e,t,i,s){const n=this.getUsedBranch();return n?(this.expressionsToBeDeoptimized.push(s),n.getReturnExpressionWhenCalledAtPath(e,t,i,s)):new Hi([this.consequent.getReturnExpressionWhenCalledAtPath(e,t,i,s),this.alternate.getReturnExpressionWhenCalledAtPath(e,t,i,s)])}hasEffects(e){if(this.test.hasEffects(e))return!0;const t=this.getUsedBranch();return t?t.hasEffects(e):this.consequent.hasEffects(e)||this.alternate.hasEffects(e)}hasEffectsOnInteractionAtPath(e,t,i){const s=this.getUsedBranch();return s?s.hasEffectsOnInteractionAtPath(e,t,i):this.consequent.hasEffectsOnInteractionAtPath(e,t,i)||this.alternate.hasEffectsOnInteractionAtPath(e,t,i)}include(e,t){this.included=!0;const i=this.getUsedBranch();t||this.test.shouldBeIncluded(e)||null===i?(this.test.include(e,t),this.consequent.include(e,t),this.alternate.include(e,t)):i.include(e,t)}includeCallArguments(e,t){const i=this.getUsedBranch();i?i.includeCallArguments(e,t):(this.consequent.includeCallArguments(e,t),this.alternate.includeCallArguments(e,t))}render(e,t,{isCalleeOfRenderedParent:i,preventASI:s,renderedParentType:n,renderedSurroundingElement:r}=ie){const a=this.getUsedBranch();if(this.test.included)this.test.render(e,t,{renderedSurroundingElement:r}),this.consequent.render(e,t),this.alternate.render(e,t);else{const o=hi(e.original,":",this.consequent.end),l=ui(e.original,(this.consequent.included?hi(e.original,"?",this.test.end):o)+1);s&&mi(e,l,a.start),e.remove(this.start,l),this.consequent.included&&e.remove(o,this.end),oi(this,e),a.render(e,t,{isCalleeOfRenderedParent:i,preventASI:!0,renderedParentType:n||this.parent.type,renderedSurroundingElement:r||this.parent.type})}}getUsedBranch(){if(this.isBranchResolutionAnalysed)return this.usedBranch;this.isBranchResolutionAnalysed=!0;const e=this.test.getLiteralValueAtPath(V,G,this);return"symbol"==typeof e?null:this.usedBranch=e?this.consequent:this.alternate}},ContinueStatement:class extends ut{hasEffects(e){if(this.label){if(!e.ignore.labels.has(this.label.name))return!0;e.includedLabels.add(this.label.name),e.brokenFlow=2}else{if(!e.ignore.continues)return!0;e.brokenFlow=1}return!1}include(e){this.included=!0,this.label&&(this.label.include(),e.includedLabels.add(this.label.name)),e.brokenFlow=this.label?2:1}},DoWhileStatement:class extends ut{hasEffects(e){if(this.test.hasEffects(e))return!0;const{brokenFlow:t,ignore:{breaks:i,continues:s}}=e;return e.ignore.breaks=!0,e.ignore.continues=!0,!!this.body.hasEffects(e)||(e.ignore.breaks=i,e.ignore.continues=s,e.brokenFlow=t,!1)}include(e,t){this.included=!0,this.test.include(e,t);const{brokenFlow:i}=e;this.body.include(e,t,{asSingleStatement:!0}),e.brokenFlow=i}},EmptyStatement:class extends ut{hasEffects(){return!1}},ExportAllDeclaration:Wi,ExportDefaultDeclaration:Ki,ExportNamedDeclaration:Xi,ExportSpecifier:class extends ut{applyDeoptimizations(){}},ExpressionStatement:yi,ForInStatement:class extends ut{createScope(e){this.scope=new gi(e)}hasEffects(e){const{deoptimized:t,left:i,right:s}=this;if(t||this.applyDeoptimizations(),i.hasEffectsAsAssignmentTarget(e,!1)||s.hasEffects(e))return!0;const{brokenFlow:n,ignore:{breaks:r,continues:a}}=e;return e.ignore.breaks=!0,e.ignore.continues=!0,!!this.body.hasEffects(e)||(e.ignore.breaks=r,e.ignore.continues=a,e.brokenFlow=n,!1)}include(e,t){const{body:i,deoptimized:s,left:n,right:r}=this;s||this.applyDeoptimizations(),this.included=!0,n.includeAsAssignmentTarget(e,t||!0,!1),r.include(e,t);const{brokenFlow:a}=e;i.include(e,t,{asSingleStatement:!0}),e.brokenFlow=a}initialise(){this.left.setAssignedValue(X)}render(e,t){this.left.render(e,t,li),this.right.render(e,t,li),110===e.original.charCodeAt(this.right.start-1)&&e.prependLeft(this.right.start," "),this.body.render(e,t)}applyDeoptimizations(){this.deoptimized=!0,this.left.deoptimizePath(V),this.context.requestTreeshakingPass()}},ForOfStatement:class extends ut{createScope(e){this.scope=new gi(e)}hasEffects(){return this.deoptimized||this.applyDeoptimizations(),!0}include(e,t){const{body:i,deoptimized:s,left:n,right:r}=this;s||this.applyDeoptimizations(),this.included=!0,n.includeAsAssignmentTarget(e,t||!0,!1),r.include(e,t);const{brokenFlow:a}=e;i.include(e,t,{asSingleStatement:!0}),e.brokenFlow=a}initialise(){this.left.setAssignedValue(X)}render(e,t){this.left.render(e,t,li),this.right.render(e,t,li),102===e.original.charCodeAt(this.right.start-1)&&e.prependLeft(this.right.start," "),this.body.render(e,t)}applyDeoptimizations(){this.deoptimized=!0,this.left.deoptimizePath(V),this.context.requestTreeshakingPass()}},ForStatement:class extends ut{createScope(e){this.scope=new gi(e)}hasEffects(e){var t,i,s;if((null===(t=this.init)||void 0===t?void 0:t.hasEffects(e))||(null===(i=this.test)||void 0===i?void 0:i.hasEffects(e))||(null===(s=this.update)||void 0===s?void 0:s.hasEffects(e)))return!0;const{brokenFlow:n,ignore:{breaks:r,continues:a}}=e;return e.ignore.breaks=!0,e.ignore.continues=!0,!!this.body.hasEffects(e)||(e.ignore.breaks=r,e.ignore.continues=a,e.brokenFlow=n,!1)}include(e,t){var i,s,n;this.included=!0,null===(i=this.init)||void 0===i||i.include(e,t,{asSingleStatement:!0}),null===(s=this.test)||void 0===s||s.include(e,t);const{brokenFlow:r}=e;null===(n=this.update)||void 0===n||n.include(e,t),this.body.include(e,t,{asSingleStatement:!0}),e.brokenFlow=r}render(e,t){var i,s,n;null===(i=this.init)||void 0===i||i.render(e,t,li),null===(s=this.test)||void 0===s||s.render(e,t,li),null===(n=this.update)||void 0===n||n.render(e,t,li),this.body.render(e,t)}},FunctionDeclaration:qi,FunctionExpression:class extends _i{render(e,t,{renderedSurroundingElement:i}=ie){super.render(e,t),"ExpressionStatement"===i&&(e.appendRight(this.start,"("),e.prependLeft(this.end,")"))}},Identifier:ni,IfStatement:Ji,ImportDeclaration:Zi,ImportDefaultSpecifier:class extends ut{applyDeoptimizations(){}},ImportExpression:class extends ut{constructor(){super(...arguments),this.inlineNamespace=null,this.mechanism=null,this.resolution=null}hasEffects(){return!0}include(e,t){this.included||(this.included=!0,this.context.includeDynamicImport(this),this.scope.addAccessedDynamicImport(this)),this.source.include(e,t)}initialise(){this.context.addDynamicImport(this)}render(e,t){if(this.inlineNamespace){const{snippets:{getDirectReturnFunction:i,getPropertyAccess:s}}=t,[n,r]=i([],{functionReturn:!0,lineBreakIndent:null,name:null});e.overwrite(this.start,this.end,`Promise.resolve().then(${n}${this.inlineNamespace.getName(s)}${r})`,{contentOnly:!0})}else this.mechanism&&(e.overwrite(this.start,hi(e.original,"(",this.start+6)+1,this.mechanism.left,{contentOnly:!0}),e.overwrite(this.end-1,this.end,this.mechanism.right,{contentOnly:!0})),this.source.render(e,t)}renderFinalResolution(e,t,i,{getDirectReturnFunction:s}){if(e.overwrite(this.source.start,this.source.end,t),i){const[t,n]=s(["n"],{functionReturn:!0,lineBreakIndent:null,name:null});e.prependLeft(this.end,`.then(${t}n.${i}${n})`)}}setExternalResolution(e,t,i,s,n,r){const{format:a}=i;this.inlineNamespace=null,this.resolution=t;const o=[...bs[a]||[]];let l;({helper:l,mechanism:this.mechanism}=this.getDynamicImportMechanismAndHelper(t,e,i,s,n)),l&&o.push(l),o.length>0&&this.scope.addAccessedGlobals(o,r)}setInternalResolution(e){this.inlineNamespace=e}applyDeoptimizations(){}getDynamicImportMechanismAndHelper(e,t,{compact:i,dynamicImportFunction:s,format:n,generatedCode:{arrowFunctions:r},interop:a},{_:o,getDirectReturnFunction:l,getDirectReturnIifeLeft:h},c){const u=c.hookFirstSync("renderDynamicImport",[{customResolution:"string"==typeof this.resolution?this.resolution:null,format:n,moduleId:this.context.module.id,targetModuleId:this.resolution&&"string"!=typeof this.resolution?this.resolution.id:null}]);if(u)return{helper:null,mechanism:u};const d=!this.resolution||"string"==typeof this.resolution;switch(n){case"cjs":{const i=Es(e,t,a);let s="require(",n=")";i&&(s=`/*#__PURE__*/${i}(${s}`,n+=")");const[o,c]=l([],{functionReturn:!0,lineBreakIndent:null,name:null});return s=`Promise.resolve().then(${o}${s}`,n+=`${c})`,!r&&d&&(s=h(["t"],`${s}t${n}`,{needsArrowReturnParens:!1,needsWrappedFunction:!0}),n=")"),{helper:i,mechanism:{left:s,right:n}}}case"amd":{const s=i?"c":"resolve",n=i?"e":"reject",c=Es(e,t,a),[u,p]=l(["m"],{functionReturn:!1,lineBreakIndent:null,name:null}),f=c?`${u}${s}(/*#__PURE__*/${c}(m))${p}`:s,[m,g]=l([s,n],{functionReturn:!1,lineBreakIndent:null,name:null});let y=`new Promise(${m}require([`,x=`],${o}${f},${o}${n})${g})`;return!r&&d&&(y=h(["t"],`${y}t${x}`,{needsArrowReturnParens:!1,needsWrappedFunction:!0}),x=")"),{helper:c,mechanism:{left:y,right:x}}}case"system":return{helper:null,mechanism:{left:"module.import(",right:")"}};case"es":if(s)return{helper:null,mechanism:{left:`${s}(`,right:")"}}}return{helper:null,mechanism:null}}},ImportNamespaceSpecifier:class extends ut{applyDeoptimizations(){}},ImportSpecifier:class extends ut{applyDeoptimizations(){}},LabeledStatement:class extends ut{hasEffects(e){const t=e.brokenFlow;return e.ignore.labels.add(this.label.name),!!this.body.hasEffects(e)||(e.ignore.labels.delete(this.label.name),e.includedLabels.has(this.label.name)&&(e.includedLabels.delete(this.label.name),e.brokenFlow=t),!1)}include(e,t){this.included=!0;const i=e.brokenFlow;this.body.include(e,t),(t||e.includedLabels.has(this.label.name))&&(this.label.include(),e.includedLabels.delete(this.label.name),e.brokenFlow=i)}render(e,t){this.label.included?this.label.render(e,t):e.remove(this.start,ui(e.original,hi(e.original,":",this.label.end)+1)),this.body.render(e,t)}},Literal:Ti,LogicalExpression:class extends ut{constructor(){super(...arguments),this.expressionsToBeDeoptimized=[],this.isBranchResolutionAnalysed=!1,this.usedBranch=null}deoptimizeCache(){if(this.usedBranch){const e=this.usedBranch===this.left?this.right:this.left;this.usedBranch=null,e.deoptimizePath(B);for(const e of this.expressionsToBeDeoptimized)e.deoptimizeCache();this.context.requestTreeshakingPass()}}deoptimizePath(e){const t=this.getUsedBranch();t?t.deoptimizePath(e):(this.left.deoptimizePath(e),this.right.deoptimizePath(e))}deoptimizeThisOnInteractionAtPath(e,t,i){this.left.deoptimizeThisOnInteractionAtPath(e,t,i),this.right.deoptimizeThisOnInteractionAtPath(e,t,i)}getLiteralValueAtPath(e,t,i){const s=this.getUsedBranch();return s?(this.expressionsToBeDeoptimized.push(i),s.getLiteralValueAtPath(e,t,i)):W}getReturnExpressionWhenCalledAtPath(e,t,i,s){const n=this.getUsedBranch();return n?(this.expressionsToBeDeoptimized.push(s),n.getReturnExpressionWhenCalledAtPath(e,t,i,s)):new Hi([this.left.getReturnExpressionWhenCalledAtPath(e,t,i,s),this.right.getReturnExpressionWhenCalledAtPath(e,t,i,s)])}hasEffects(e){return!!this.left.hasEffects(e)||this.getUsedBranch()!==this.left&&this.right.hasEffects(e)}hasEffectsOnInteractionAtPath(e,t,i){const s=this.getUsedBranch();return s?s.hasEffectsOnInteractionAtPath(e,t,i):this.left.hasEffectsOnInteractionAtPath(e,t,i)||this.right.hasEffectsOnInteractionAtPath(e,t,i)}include(e,t){this.included=!0;const i=this.getUsedBranch();t||i===this.right&&this.left.shouldBeIncluded(e)||!i?(this.left.include(e,t),this.right.include(e,t)):i.include(e,t)}render(e,t,{isCalleeOfRenderedParent:i,preventASI:s,renderedParentType:n,renderedSurroundingElement:r}=ie){if(this.left.included&&this.right.included)this.left.render(e,t,{preventASI:s,renderedSurroundingElement:r}),this.right.render(e,t);else{const a=hi(e.original,this.operator,this.left.end);if(this.right.included){const t=ui(e.original,a+2);e.remove(this.start,t),s&&mi(e,t,this.right.start)}else e.remove(a,this.end);oi(this,e),this.getUsedBranch().render(e,t,{isCalleeOfRenderedParent:i,preventASI:s,renderedParentType:n||this.parent.type,renderedSurroundingElement:r||this.parent.type})}}getUsedBranch(){if(!this.isBranchResolutionAnalysed){this.isBranchResolutionAnalysed=!0;const e=this.left.getLiteralValueAtPath(V,G,this);if("symbol"==typeof e)return null;this.usedBranch="||"===this.operator&&e||"&&"===this.operator&&!e||"??"===this.operator&&null!=e?this.left:this.right}return this.usedBranch}},MemberExpression:Mi,MetaProperty:class extends ut{addAccessedGlobals(e,t){const i=this.metaProperty,s=(i&&(i.startsWith(Ss)||i.startsWith(vs)||i.startsWith("ROLLUP_CHUNK_URL_"))?Is:As)[e];s.length>0&&this.scope.addAccessedGlobals(s,t)}getReferencedFileName(e){const t=this.metaProperty;return t&&t.startsWith(Ss)?e.getFileName(t.substring(Ss.length)):null}hasEffects(){return!1}hasEffectsOnInteractionAtPath(e,{type:t}){return e.length>1||0!==t}include(){if(!this.included&&(this.included=!0,"import"===this.meta.name)){this.context.addImportMeta(this);const e=this.parent;this.metaProperty=e instanceof Mi&&"string"==typeof e.propertyKey?e.propertyKey:null}}renderFinalMechanism(e,t,i,s,n){var r;const a=this.parent,o=this.metaProperty;if(o&&(o.startsWith(Ss)||o.startsWith(vs)||o.startsWith("ROLLUP_CHUNK_URL_"))){let s,r=null,l=null,h=null;o.startsWith(Ss)?(r=o.substring(Ss.length),s=n.getFileName(r)):o.startsWith(vs)?(Pe(`Using the "${vs}" prefix to reference files is deprecated. Use the "${Ss}" prefix instead.`,!0,this.context.options),l=o.substring(vs.length),s=n.getFileName(l)):(Pe(`Using the "ROLLUP_CHUNK_URL_" prefix to reference files is deprecated. Use the "${Ss}" prefix instead.`,!0,this.context.options),h=o.substring("ROLLUP_CHUNK_URL_".length),s=n.getFileName(h));const c=C(T(N(t),s));let u;return null!==l&&(u=n.hookFirstSync("resolveAssetUrl",[{assetFileName:s,chunkId:t,format:i,moduleId:this.context.module.id,relativeAssetPath:c}])),u||(u=n.hookFirstSync("resolveFileUrl",[{assetReferenceId:l,chunkId:t,chunkReferenceId:h,fileName:s,format:i,moduleId:this.context.module.id,referenceId:r||l||h,relativePath:c}])||_s[i](c)),void e.overwrite(a.start,a.end,u,{contentOnly:!0})}const l=n.hookFirstSync("resolveImportMeta",[o,{chunkId:t,format:i,moduleId:this.context.module.id}])||(null===(r=Ns[i])||void 0===r?void 0:r.call(Ns,o,{chunkId:t,snippets:s}));"string"==typeof l&&(a instanceof Mi?e.overwrite(a.start,a.end,l,{contentOnly:!0}):e.overwrite(this.start,this.end,l,{contentOnly:!0}))}},MethodDefinition:zi,NewExpression:class extends ut{hasEffects(e){try{for(const t of this.arguments)if(t.hasEffects(e))return!0;return(!this.context.options.treeshake.annotations||!this.annotations)&&(this.callee.hasEffects(e)||this.callee.hasEffectsOnInteractionAtPath(V,this.interaction,e))}finally{this.deoptimized||this.applyDeoptimizations()}}hasEffectsOnInteractionAtPath(e,{type:t}){return e.length>0||0!==t}include(e,t){this.deoptimized||this.applyDeoptimizations(),t?super.include(e,t):(this.included=!0,this.callee.include(e,!1)),this.callee.includeCallArguments(e,this.arguments)}initialise(){this.interaction={args:this.arguments,thisArg:null,type:2,withNew:!0}}render(e,t){this.callee.render(e,t),$i(e,t,this)}applyDeoptimizations(){this.deoptimized=!0;for(const e of this.arguments)e.deoptimizePath(B);this.context.requestTreeshakingPass()}},ObjectExpression:class extends ut{constructor(){super(...arguments),this.objectEntity=null}deoptimizeCache(){this.getObjectEntity().deoptimizeAllProperties()}deoptimizePath(e){this.getObjectEntity().deoptimizePath(e)}deoptimizeThisOnInteractionAtPath(e,t,i){this.getObjectEntity().deoptimizeThisOnInteractionAtPath(e,t,i)}getLiteralValueAtPath(e,t,i){return this.getObjectEntity().getLiteralValueAtPath(e,t,i)}getReturnExpressionWhenCalledAtPath(e,t,i,s){return this.getObjectEntity().getReturnExpressionWhenCalledAtPath(e,t,i,s)}hasEffectsOnInteractionAtPath(e,t,i){return this.getObjectEntity().hasEffectsOnInteractionAtPath(e,t,i)}render(e,t,{renderedSurroundingElement:i}=ie){super.render(e,t),"ExpressionStatement"!==i&&"ArrowFunctionExpression"!==i||(e.appendRight(this.start,"("),e.prependLeft(this.end,")"))}applyDeoptimizations(){}getObjectEntity(){if(null!==this.objectEntity)return this.objectEntity;let e=St;const t=[];for(const i of this.properties){if(i instanceof dt){t.push({key:M,kind:"init",property:i});continue}let s;if(i.computed){const e=i.key.getLiteralValueAtPath(V,G,this);if("symbol"==typeof e){t.push({key:M,kind:i.kind,property:i});continue}s=String(e)}else if(s=i.key instanceof ni?i.key.name:String(i.key.value),"__proto__"===s&&"init"===i.kind){e=i.value instanceof Ti&&null===i.value.value?null:i.value;continue}t.push({key:s,kind:i.kind,property:i})}return this.objectEntity=new Et(t,e)}},ObjectPattern:Pi,PrivateIdentifier:class extends ut{},Program:$s,Property:class extends Fi{constructor(){super(...arguments),this.declarationInit=null}declare(e,t){return this.declarationInit=t,this.value.declare(e,X)}hasEffects(e){this.deoptimized||this.applyDeoptimizations();const t=this.context.options.treeshake.propertyReadSideEffects;return"ObjectPattern"===this.parent.type&&"always"===t||this.key.hasEffects(e)||this.value.hasEffects(e)}markDeclarationReached(){this.value.markDeclarationReached()}render(e,t){this.shorthand||this.key.render(e,t),this.value.render(e,t,{isShorthandProperty:this.shorthand})}applyDeoptimizations(){this.deoptimized=!0,null!==this.declarationInit&&(this.declarationInit.deoptimizePath([M,M]),this.context.requestTreeshakingPass())}},PropertyDefinition:class extends ut{deoptimizePath(e){var t;null===(t=this.value)||void 0===t||t.deoptimizePath(e)}deoptimizeThisOnInteractionAtPath(e,t,i){var s;null===(s=this.value)||void 0===s||s.deoptimizeThisOnInteractionAtPath(e,t,i)}getLiteralValueAtPath(e,t,i){return this.value?this.value.getLiteralValueAtPath(e,t,i):W}getReturnExpressionWhenCalledAtPath(e,t,i,s){return this.value?this.value.getReturnExpressionWhenCalledAtPath(e,t,i,s):X}hasEffects(e){var t;return this.key.hasEffects(e)||this.static&&!!(null===(t=this.value)||void 0===t?void 0:t.hasEffects(e))}hasEffectsOnInteractionAtPath(e,t,i){return!this.value||this.value.hasEffectsOnInteractionAtPath(e,t,i)}applyDeoptimizations(){}},RestElement:Ei,ReturnStatement:class extends ut{hasEffects(e){var t;return!(e.ignore.returnYield&&!(null===(t=this.argument)||void 0===t?void 0:t.hasEffects(e)))||(e.brokenFlow=2,!1)}include(e,t){var i;this.included=!0,null===(i=this.argument)||void 0===i||i.include(e,t),e.brokenFlow=2}initialise(){this.scope.addReturnExpression(this.argument||X)}render(e,t){this.argument&&(this.argument.render(e,t,{preventASI:!0}),this.argument.start===this.start+6&&e.prependLeft(this.start+6," "))}},SequenceExpression:class extends ut{deoptimizePath(e){this.expressions[this.expressions.length-1].deoptimizePath(e)}deoptimizeThisOnInteractionAtPath(e,t,i){this.expressions[this.expressions.length-1].deoptimizeThisOnInteractionAtPath(e,t,i)}getLiteralValueAtPath(e,t,i){return this.expressions[this.expressions.length-1].getLiteralValueAtPath(e,t,i)}hasEffects(e){for(const t of this.expressions)if(t.hasEffects(e))return!0;return!1}hasEffectsOnInteractionAtPath(e,t,i){return this.expressions[this.expressions.length-1].hasEffectsOnInteractionAtPath(e,t,i)}include(e,t){this.included=!0;const i=this.expressions[this.expressions.length-1];for(const s of this.expressions)(t||s===i&&!(this.parent instanceof yi)||s.shouldBeIncluded(e))&&s.include(e,t)}render(e,t,{renderedParentType:i,isCalleeOfRenderedParent:s,preventASI:n}=ie){let r=0,a=null;const o=this.expressions[this.expressions.length-1];for(const{node:l,separator:h,start:c,end:u}of fi(this.expressions,e,this.start,this.end))if(l.included)if(r++,a=h,1===r&&n&&mi(e,c,l.start),1===r){const n=i||this.parent.type;l.render(e,t,{isCalleeOfRenderedParent:s&&l===o,renderedParentType:n,renderedSurroundingElement:n})}else l.render(e,t);else ai(l,e,c,u);a&&e.remove(a,this.end)}},SpreadElement:dt,StaticBlock:class extends ut{createScope(e){this.scope=new gi(e)}hasEffects(e){for(const t of this.body)if(t.hasEffects(e))return!0;return!1}include(e,t){this.included=!0;for(const i of this.body)(t||i.shouldBeIncluded(e))&&i.include(e,t)}render(e,t){this.body.length?pi(this.body,e,this.start+1,this.end-1,t):super.render(e,t)}},Super:class extends ut{bind(){this.variable=this.scope.findVariable("this")}deoptimizePath(e){this.variable.deoptimizePath(e)}deoptimizeThisOnInteractionAtPath(e,t,i){this.variable.deoptimizeThisOnInteractionAtPath(e,t,i)}include(){this.included||(this.included=!0,this.context.includeVariableInModule(this.variable))}},SwitchCase:Ts,SwitchStatement:class extends ut{createScope(e){this.scope=new gi(e)}hasEffects(e){if(this.discriminant.hasEffects(e))return!0;const{brokenFlow:t,ignore:{breaks:i}}=e;let s=1/0;e.ignore.breaks=!0;for(const i of this.cases){if(i.hasEffects(e))return!0;s=e.brokenFlow=0;r--){const a=this.cases[r];if(a.included&&(n=!0),!n){const e=Me();e.ignore.breaks=!0,n=a.hasEffects(e)}n?(a.include(e,t),s=s0&&pi(this.cases,e,this.cases[0].start,this.end-1,t)}},TaggedTemplateExpression:class extends Li{bind(){if(super.bind(),"Identifier"===this.tag.type){const e=this.tag.name;this.scope.findVariable(e).isNamespace&&this.context.warn({code:"CANNOT_CALL_NAMESPACE",message:`Cannot call a namespace ('${e}')`},this.start)}}hasEffects(e){try{for(const t of this.quasi.expressions)if(t.hasEffects(e))return!0;return this.tag.hasEffects(e)||this.tag.hasEffectsOnInteractionAtPath(V,this.interaction,e)}finally{this.deoptimized||this.applyDeoptimizations()}}include(e,t){this.deoptimized||this.applyDeoptimizations(),t?super.include(e,t):(this.included=!0,this.tag.include(e,t),this.quasi.include(e,t)),this.tag.includeCallArguments(e,this.interaction.args);const i=this.getReturnExpression();i.included||i.include(e,!1)}initialise(){this.interaction={args:[X,...this.quasi.expressions],thisArg:this.tag instanceof Mi&&!this.tag.variable?this.tag.object:null,type:2,withNew:!1}}render(e,t){this.tag.render(e,t,{isCalleeOfRenderedParent:!0}),this.quasi.render(e,t)}applyDeoptimizations(){this.deoptimized=!0,this.interaction.thisArg&&this.tag.deoptimizeThisOnInteractionAtPath(this.interaction,V,G);for(const e of this.quasi.expressions)e.deoptimizePath(B);this.context.requestTreeshakingPass()}getReturnExpression(e=G){return null===this.returnExpression?(this.returnExpression=X,this.returnExpression=this.tag.getReturnExpressionWhenCalledAtPath(V,this.interaction,e,this)):this.returnExpression}},TemplateElement:class extends ut{bind(){}hasEffects(){return!1}include(){this.included=!0}parseNode(e){this.value=e.value,super.parseNode(e)}render(){}},TemplateLiteral:Os,ThisExpression:class extends ut{bind(){this.variable=this.scope.findVariable("this")}deoptimizePath(e){this.variable.deoptimizePath(e)}deoptimizeThisOnInteractionAtPath(e,t,i){this.variable.deoptimizeThisOnInteractionAtPath(e.thisArg===this?{...e,thisArg:this.variable}:e,t,i)}hasEffectsOnInteractionAtPath(e,t,i){return 0===e.length?0!==t.type:this.variable.hasEffectsOnInteractionAtPath(e,t,i)}include(){this.included||(this.included=!0,this.context.includeVariableInModule(this.variable))}initialise(){this.alias=this.scope.findLexicalBoundary()instanceof Ds?this.context.moduleContext:null,"undefined"===this.alias&&this.context.warn({code:"THIS_IS_UNDEFINED",message:"The 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten",url:"https://rollupjs.org/guide/en/#error-this-is-undefined"},this.start)}render(e){null!==this.alias&&e.overwrite(this.start,this.end,this.alias,{contentOnly:!1,storeName:!0})}},ThrowStatement:class extends ut{hasEffects(){return!0}include(e,t){this.included=!0,this.argument.include(e,t),e.brokenFlow=2}render(e,t){this.argument.render(e,t,{preventASI:!0}),this.argument.start===this.start+5&&e.prependLeft(this.start+5," ")}},TryStatement:class extends ut{constructor(){super(...arguments),this.directlyIncluded=!1,this.includedLabelsAfterBlock=null}hasEffects(e){var t;return(this.context.options.treeshake.tryCatchDeoptimization?this.block.body.length>0:this.block.hasEffects(e))||!!(null===(t=this.finalizer)||void 0===t?void 0:t.hasEffects(e))}include(e,t){var i,s;const n=null===(i=this.context.options.treeshake)||void 0===i?void 0:i.tryCatchDeoptimization,{brokenFlow:r}=e;if(this.directlyIncluded&&n){if(this.includedLabelsAfterBlock)for(const t of this.includedLabelsAfterBlock)e.includedLabels.add(t)}else this.included=!0,this.directlyIncluded=!0,this.block.include(e,n?"variables":t),e.includedLabels.size>0&&(this.includedLabelsAfterBlock=[...e.includedLabels]),e.brokenFlow=r;null!==this.handler&&(this.handler.include(e,t),e.brokenFlow=r),null===(s=this.finalizer)||void 0===s||s.include(e,t)}},UnaryExpression:class extends ut{getLiteralValueAtPath(e,t,i){if(e.length>0)return W;const s=this.argument.getLiteralValueAtPath(V,t,i);return"symbol"==typeof s?W:Ls[this.operator](s)}hasEffects(e){return this.deoptimized||this.applyDeoptimizations(),!("typeof"===this.operator&&this.argument instanceof ni)&&(this.argument.hasEffects(e)||"delete"===this.operator&&this.argument.hasEffectsOnInteractionAtPath(V,Q,e))}hasEffectsOnInteractionAtPath(e,{type:t}){return 0!==t||e.length>("void"===this.operator?0:1)}applyDeoptimizations(){this.deoptimized=!0,"delete"===this.operator&&(this.argument.deoptimizePath(V),this.context.requestTreeshakingPass())}},UnknownNode:class extends ut{hasEffects(){return!0}include(e){super.include(e,!0)}},UpdateExpression:class extends ut{hasEffects(e){return this.deoptimized||this.applyDeoptimizations(),this.argument.hasEffectsAsAssignmentTarget(e,!0)}hasEffectsOnInteractionAtPath(e,{type:t}){return e.length>1||0!==t}include(e,t){this.deoptimized||this.applyDeoptimizations(),this.included=!0,this.argument.includeAsAssignmentTarget(e,t,!0)}initialise(){this.argument.setAssignedValue(X)}render(e,t){const{exportNamesByVariable:i,format:s,snippets:{_:n}}=t;if(this.argument.render(e,t),"system"===s){const s=this.argument.variable,r=i.get(s);if(r)if(this.prefix)1===r.length?Ai(s,this.start,this.end,e,t):Ii(s,this.start,this.end,"ExpressionStatement"!==this.parent.type,e,t);else{const i=this.operator[0];!function(e,t,i,s,n,r,a){const{_:o}=r.snippets;n.prependRight(t,`${Si([e],r,a)},${o}`),s&&(n.prependRight(t,"("),n.appendLeft(i,")"))}(s,this.start,this.end,"ExpressionStatement"!==this.parent.type,e,t,`${n}${i}${n}1`)}}}applyDeoptimizations(){if(this.deoptimized=!0,this.argument.deoptimizePath(V),this.argument instanceof ni){this.scope.findVariable(this.argument.name).isReassigned=!0}this.context.requestTreeshakingPass()}},VariableDeclaration:Bs,VariableDeclarator:class extends ut{declareDeclarator(e){this.id.declare(e,this.init||Le)}deoptimizePath(e){this.id.deoptimizePath(e)}hasEffects(e){var t;const i=null===(t=this.init)||void 0===t?void 0:t.hasEffects(e);return this.id.markDeclarationReached(),i||this.id.hasEffects(e)}include(e,t){var i;this.included=!0,null===(i=this.init)||void 0===i||i.include(e,t),this.id.markDeclarationReached(),(t||this.id.shouldBeIncluded(e))&&this.id.include(e,t)}render(e,t){const{exportNamesByVariable:i,snippets:{_:s}}=t,n=this.id.included;if(n)this.id.render(e,t);else{const t=hi(e.original,"=",this.id.end);e.remove(this.start,ui(e.original,t+1))}this.init?this.init.render(e,t,n?ie:{renderedSurroundingElement:"ExpressionStatement"}):this.id instanceof ni&&Vs(this.id.variable,i)&&e.appendLeft(this.end,`${s}=${s}void 0`)}applyDeoptimizations(){}},WhileStatement:class extends ut{hasEffects(e){if(this.test.hasEffects(e))return!0;const{brokenFlow:t,ignore:{breaks:i,continues:s}}=e;return e.ignore.breaks=!0,e.ignore.continues=!0,!!this.body.hasEffects(e)||(e.ignore.breaks=i,e.ignore.continues=s,e.brokenFlow=t,!1)}include(e,t){this.included=!0,this.test.include(e,t);const{brokenFlow:i}=e;this.body.include(e,t,{asSingleStatement:!0}),e.brokenFlow=i}},YieldExpression:class extends ut{hasEffects(e){var t;return this.deoptimized||this.applyDeoptimizations(),!(e.ignore.returnYield&&!(null===(t=this.argument)||void 0===t?void 0:t.hasEffects(e)))}render(e,t){this.argument&&(this.argument.render(e,t,{preventASI:!0}),this.argument.start===this.start+5&&e.prependLeft(this.start+5," "))}}};class zs extends ee{constructor(e){super("_missingExportShim"),this.module=e}include(){super.include(),this.module.needsExportShim=!0}}class js extends ee{constructor(e){super(e.getModuleName()),this.memberVariables=null,this.mergedNamespaces=[],this.referencedEarly=!1,this.references=[],this.context=e,this.module=e.module}addReference(e){this.references.push(e),this.name=e.name}getMemberVariables(){if(this.memberVariables)return this.memberVariables;const e=Object.create(null);for(const t of this.context.getExports().concat(this.context.getReexports()))if("*"!==t[0]&&t!==this.module.info.syntheticNamedExports){const i=this.context.traceExport(t);i&&(e[t]=i)}return this.memberVariables=e}include(){this.included=!0,this.context.includeAllExports()}prepare(e){this.mergedNamespaces.length>0&&this.module.scope.addAccessedGlobals(["_mergeNamespaces"],e)}renderBlock(e){const{exportNamesByVariable:t,format:i,freeze:s,indent:n,namespaceToStringTag:r,snippets:{_:a,cnst:o,getObject:l,getPropertyAccess:h,n:c,s:u}}=e,d=this.getMemberVariables(),p=Object.entries(d).map((([e,t])=>this.referencedEarly||t.isReassigned?[null,`get ${e}${a}()${a}{${a}return ${t.getName(h)}${u}${a}}`]:[e,t.getName(h)]));p.unshift([null,`__proto__:${a}null`]);let f=l(p,{lineBreakIndent:{base:"",t:n}});if(this.mergedNamespaces.length>0){const e=this.mergedNamespaces.map((e=>e.getName(h)));f=`/*#__PURE__*/_mergeNamespaces(${f},${a}[${e.join(`,${a}`)}])`}else r&&(f=`/*#__PURE__*/Object.defineProperty(${f},${a}Symbol.toStringTag,${a}${xs(l)})`),s&&(f=`/*#__PURE__*/Object.freeze(${f})`);return f=`${o} ${this.getName(h)}${a}=${a}${f};`,"system"===i&&t.has(this)&&(f+=`${c}${Si([this],e)};`),f}renderFirst(){return this.referencedEarly}setMergedNamespaces(e){this.mergedNamespaces=e;const t=this.context.getModuleExecIndex();for(const e of this.references)if(e.context.getModuleExecIndex()<=t){this.referencedEarly=!0;break}}}js.prototype.isNamespace=!0;class Us extends ee{constructor(e,t,i){super(t),this.baseVariable=null,this.context=e,this.module=e.module,this.syntheticNamespace=i}getBaseVariable(){if(this.baseVariable)return this.baseVariable;let e=this.syntheticNamespace;for(;e instanceof Ms||e instanceof Us;){if(e instanceof Ms){const t=e.getOriginalVariable();if(t===e)break;e=t}e instanceof Us&&(e=e.syntheticNamespace)}return this.baseVariable=e}getBaseVariableName(){return this.syntheticNamespace.getBaseVariableName()}getName(e){return`${this.syntheticNamespace.getName(e)}${e(this.name)}`}include(){this.included=!0,this.context.includeVariableInModule(this.syntheticNamespace)}setRenderNames(e,t){super.setRenderNames(e,t)}}var Gs;function Hs(e){return e.id}!function(e){e[e.LOAD_AND_PARSE=0]="LOAD_AND_PARSE",e[e.ANALYSE=1]="ANALYSE",e[e.GENERATE=2]="GENERATE"}(Gs||(Gs={}));var Ws="performance"in("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:{})?performance:{now:()=>0},qs={memoryUsage:()=>({heapUsed:0})};const Ks=()=>{};let Xs=new Map;function Ys(e,t){switch(t){case 1:return`# ${e}`;case 2:return`## ${e}`;case 3:return e;default:return`${" ".repeat(t-4)}- ${e}`}}function Qs(e,t=3){e=Ys(e,t);const i=qs.memoryUsage().heapUsed,s=Ws.now(),n=Xs.get(e);void 0===n?Xs.set(e,{memory:0,startMemory:i,startTime:s,time:0,totalMemory:0}):(n.startMemory=i,n.startTime=s)}function Js(e,t=3){e=Ys(e,t);const i=Xs.get(e);if(void 0!==i){const e=qs.memoryUsage().heapUsed;i.memory+=e-i.startMemory,i.time+=Ws.now()-i.startTime,i.totalMemory=Math.max(i.totalMemory,e)}}function Zs(){const e={};for(const[t,{memory:i,time:s,totalMemory:n}]of Xs)e[t]=[s,i,n];return e}let en=Ks,tn=Ks;const sn=["load","resolveDynamicImport","resolveId","transform"];function nn(e,t){for(const i of sn)if(i in e){let s=`plugin ${t}`;e.name&&(s+=` (${e.name})`),s+=` - ${i}`;const n=e[i];e[i]=function(...e){en(s,4);const t=n.apply(this,e);return tn(s,4),t&&"function"==typeof t.then?(en(`${s} (async)`,4),t.then((e=>(tn(`${s} (async)`,4),e)))):t}}return e}function rn(e){e.isExecuted=!0;const t=[e],i=new Set;for(const e of t)for(const s of[...e.dependencies,...e.implicitlyLoadedBefore])s instanceof $e||s.isExecuted||!s.info.moduleSideEffects&&!e.implicitlyLoadedBefore.has(s)||i.has(s.id)||(s.isExecuted=!0,i.add(s.id),t.push(s))}const an={identifier:null,localName:"_missingExportShim"};function on(e,t,i,s,n=new Map){const r=n.get(t);if(r){if(r.has(e))return s?[null]:pe((a=t,o=e.id,{code:me.CIRCULAR_REEXPORT,id:o,message:`"${a}" cannot be exported from ${he(o)} as it is a reexport that references itself.`}));r.add(e)}else n.set(t,new Set([e]));var a,o;return e.getVariableForExportName(t,{importerForSideEffects:i,isExportAllSearch:s,searchedNamesAndModules:n})}class ln{constructor(e,t,i,s,n,r,a){this.graph=e,this.id=t,this.options=i,this.alternativeReexportModules=new Map,this.chunkFileNames=new Set,this.chunkNames=[],this.cycles=new Set,this.dependencies=new Set,this.dynamicDependencies=new Set,this.dynamicImporters=[],this.dynamicImports=[],this.execIndex=1/0,this.implicitlyLoadedAfter=new Set,this.implicitlyLoadedBefore=new Set,this.importDescriptions=new Map,this.importMetas=[],this.importedFromNotTreeshaken=!1,this.importers=[],this.includedDynamicImporters=[],this.includedImports=new Set,this.isExecuted=!1,this.isUserDefinedEntryPoint=!1,this.needsExportShim=!1,this.sideEffectDependenciesByVariable=new Map,this.sources=new Set,this.usesTopLevelAwait=!1,this.allExportNames=null,this.ast=null,this.exportAllModules=[],this.exportAllSources=new Set,this.exportNamesByVariable=null,this.exportShimVariable=new zs(this),this.exports=new Map,this.namespaceReexportsByName=new Map,this.reexportDescriptions=new Map,this.relevantDependencies=null,this.syntheticExports=new Map,this.syntheticNamespace=null,this.transformDependencies=[],this.transitiveReexports=null,this.excludeFromSourcemap=/\0/.test(t),this.context=i.moduleContext(t),this.preserveSignature=this.options.preserveEntrySignatures;const o=this,{dynamicImports:l,dynamicImporters:h,implicitlyLoadedAfter:c,implicitlyLoadedBefore:u,importers:d,reexportDescriptions:p,sources:f}=this;this.info={ast:null,code:null,get dynamicallyImportedIdResolutions(){return l.map((({argument:e})=>"string"==typeof e&&o.resolvedIds[e])).filter(Boolean)},get dynamicallyImportedIds(){return l.map((({id:e})=>e)).filter((e=>null!=e))},get dynamicImporters(){return h.sort()},get hasDefaultExport(){return o.ast?o.exports.has("default")||p.has("default"):null},get hasModuleSideEffects(){return Pe("Accessing ModuleInfo.hasModuleSideEffects from plugins is deprecated. Please use ModuleInfo.moduleSideEffects instead.",!1,i),this.moduleSideEffects},id:t,get implicitlyLoadedAfterOneOf(){return Array.from(c,Hs).sort()},get implicitlyLoadedBefore(){return Array.from(u,Hs).sort()},get importedIdResolutions(){return Array.from(f,(e=>o.resolvedIds[e])).filter(Boolean)},get importedIds(){return Array.from(f,(e=>{var t;return null===(t=o.resolvedIds[e])||void 0===t?void 0:t.id})).filter(Boolean)},get importers(){return d.sort()},isEntry:s,isExternal:!1,get isIncluded(){return e.phase!==Gs.GENERATE?null:o.isIncluded()},meta:{...a},moduleSideEffects:n,syntheticNamedExports:r},Object.defineProperty(this.info,"hasModuleSideEffects",{enumerable:!1})}basename(){const e=_(this.id),t=$(this.id);return Ne(t?e.slice(0,-t.length):e)}bindReferences(){this.ast.bind()}error(e,t){return this.addLocationToLogProps(e,t),pe(e)}getAllExportNames(){if(this.allExportNames)return this.allExportNames;this.allExportNames=new Set([...this.exports.keys(),...this.reexportDescriptions.keys()]);for(const e of this.exportAllModules)if(e instanceof $e)this.allExportNames.add(`*${e.id}`);else for(const t of e.getAllExportNames())"default"!==t&&this.allExportNames.add(t);return"string"==typeof this.info.syntheticNamedExports&&this.allExportNames.delete(this.info.syntheticNamedExports),this.allExportNames}getDependenciesToBeIncluded(){if(this.relevantDependencies)return this.relevantDependencies;this.relevantDependencies=new Set;const e=new Set,t=new Set,i=new Set(this.includedImports);if(this.info.isEntry||this.includedDynamicImporters.length>0||this.namespace.included||this.implicitlyLoadedAfter.size>0)for(const e of[...this.getReexports(),...this.getExports()]){const[t]=this.getVariableForExportName(e);t&&i.add(t)}for(let s of i){const i=this.sideEffectDependenciesByVariable.get(s);if(i)for(const e of i)t.add(e);s instanceof Us?s=s.getBaseVariable():s instanceof Ms&&(s=s.getOriginalVariable()),e.add(s.module)}if(this.options.treeshake&&"no-treeshake"!==this.info.moduleSideEffects)this.addRelevantSideEffectDependencies(this.relevantDependencies,e,t);else for(const e of this.dependencies)this.relevantDependencies.add(e);for(const t of e)this.relevantDependencies.add(t);return this.relevantDependencies}getExportNamesByVariable(){if(this.exportNamesByVariable)return this.exportNamesByVariable;const e=new Map;for(const t of this.getAllExportNames()){let[i]=this.getVariableForExportName(t);if(i instanceof Ms&&(i=i.getOriginalVariable()),!i||!(i.included||i instanceof te))continue;const s=e.get(i);s?s.push(t):e.set(i,[t])}return this.exportNamesByVariable=e}getExports(){return Array.from(this.exports.keys())}getReexports(){if(this.transitiveReexports)return this.transitiveReexports;this.transitiveReexports=[];const e=new Set(this.reexportDescriptions.keys());for(const t of this.exportAllModules)if(t instanceof $e)e.add(`*${t.id}`);else for(const i of[...t.getReexports(),...t.getExports()])"default"!==i&&e.add(i);return this.transitiveReexports=[...e]}getRenderedExports(){const e=[],t=[];for(const i of this.exports.keys()){const[s]=this.getVariableForExportName(i);(s&&s.included?e:t).push(i)}return{removedExports:t,renderedExports:e}}getSyntheticNamespace(){return null===this.syntheticNamespace&&(this.syntheticNamespace=void 0,[this.syntheticNamespace]=this.getVariableForExportName("string"==typeof this.info.syntheticNamedExports?this.info.syntheticNamedExports:"default",{onlyExplicit:!0})),this.syntheticNamespace?this.syntheticNamespace:pe((e=this.id,t=this.info.syntheticNamedExports,{code:me.SYNTHETIC_NAMED_EXPORTS_NEED_NAMESPACE_EXPORT,id:e,message:`Module "${he(e)}" that is marked with 'syntheticNamedExports: ${JSON.stringify(t)}' needs ${"string"==typeof t&&"default"!==t?`an explicit export named "${t}"`:"a default export"} that does not reexport an unresolved named export of the same module.`}));var e,t}getVariableForExportName(e,{importerForSideEffects:t,isExportAllSearch:i,onlyExplicit:s,searchedNamesAndModules:n}=se){var r;if("*"===e[0]){if(1===e.length)return[this.namespace];return this.graph.modulesById.get(e.slice(1)).getVariableForExportName("*")}const a=this.reexportDescriptions.get(e);if(a){const[e]=on(a.module,a.localName,t,!1,n);return e?(t&&hn(e,t,this),[e]):this.error(Ee(a.localName,this.id,a.module.id),a.start)}const o=this.exports.get(e);if(o){if(o===an)return[this.exportShimVariable];const e=o.localName,i=this.traceVariable(e,{importerForSideEffects:t,searchedNamesAndModules:n});return t&&(R(t.sideEffectDependenciesByVariable,i,(()=>new Set)).add(this),hn(i,t,this)),[i]}if(s)return[null];if("default"!==e){const i=null!==(r=this.namespaceReexportsByName.get(e))&&void 0!==r?r:this.getVariableFromNamespaceReexports(e,t,n);if(this.namespaceReexportsByName.set(e,i),i[0])return i}return this.info.syntheticNamedExports?[R(this.syntheticExports,e,(()=>new Us(this.astContext,e,this.getSyntheticNamespace())))]:!i&&this.options.shimMissingExports?(this.shimMissingExport(e),[this.exportShimVariable]):[null]}hasEffects(){return"no-treeshake"===this.info.moduleSideEffects||this.ast.included&&this.ast.hasEffects(Me())}include(){const e=Re();this.ast.shouldBeIncluded(e)&&this.ast.include(e,!1)}includeAllExports(e){this.isExecuted||(rn(this),this.graph.needsTreeshakingPass=!0);for(const t of this.exports.keys())if(e||t!==this.info.syntheticNamedExports){const e=this.getVariableForExportName(t)[0];e.deoptimizePath(B),e.included||this.includeVariable(e)}for(const e of this.getReexports()){const[t]=this.getVariableForExportName(e);t&&(t.deoptimizePath(B),t.included||this.includeVariable(t),t instanceof te&&(t.module.reexported=!0))}e&&this.namespace.setMergedNamespaces(this.includeAndGetAdditionalMergedNamespaces())}includeAllInBundle(){this.ast.include(Re(),!0),this.includeAllExports(!1)}isIncluded(){return this.ast.included||this.namespace.included||this.importedFromNotTreeshaken}linkImports(){this.addModulesToImportDescriptions(this.importDescriptions),this.addModulesToImportDescriptions(this.reexportDescriptions);const e=[];for(const t of this.exportAllSources){const i=this.graph.modulesById.get(this.resolvedIds[t].id);i instanceof $e?e.push(i):this.exportAllModules.push(i)}this.exportAllModules.push(...e)}render(e){const t=this.magicString.clone();return this.ast.render(t,e),this.usesTopLevelAwait=this.astContext.usesTopLevelAwait,t}setSource({ast:e,code:t,customTransformCache:i,originalCode:s,originalSourcemap:n,resolvedIds:r,sourcemapChain:a,transformDependencies:o,transformFiles:l,...h}){this.info.code=t,this.originalCode=s,this.originalSourcemap=n,this.sourcemapChain=a,l&&(this.transformFiles=l),this.transformDependencies=o,this.customTransformCache=i,this.updateOptions(h),en("generate ast",3),e||(e=this.tryParse()),tn("generate ast",3),this.resolvedIds=r||Object.create(null);const c=this.id;this.magicString=new x(t,{filename:this.excludeFromSourcemap?null:c,indentExclusionRanges:[]}),en("analyse ast",3),this.astContext={addDynamicImport:this.addDynamicImport.bind(this),addExport:this.addExport.bind(this),addImport:this.addImport.bind(this),addImportMeta:this.addImportMeta.bind(this),code:t,deoptimizationTracker:this.graph.deoptimizationTracker,error:this.error.bind(this),fileName:c,getExports:this.getExports.bind(this),getModuleExecIndex:()=>this.execIndex,getModuleName:this.basename.bind(this),getNodeConstructor:e=>Fs[e]||Fs.UnknownNode,getReexports:this.getReexports.bind(this),importDescriptions:this.importDescriptions,includeAllExports:()=>this.includeAllExports(!0),includeDynamicImport:this.includeDynamicImport.bind(this),includeVariableInModule:this.includeVariableInModule.bind(this),magicString:this.magicString,module:this,moduleContext:this.context,options:this.options,requestTreeshakingPass:()=>this.graph.needsTreeshakingPass=!0,traceExport:e=>this.getVariableForExportName(e)[0],traceVariable:this.traceVariable.bind(this),usesTopLevelAwait:!1,warn:this.warn.bind(this)},this.scope=new Ds(this.graph.scope,this.astContext),this.namespace=new js(this.astContext),this.ast=new $s(e,{context:this.astContext,type:"Module"},this.scope),this.info.ast=e,tn("analyse ast",3)}toJSON(){return{ast:this.ast.esTreeNode,code:this.info.code,customTransformCache:this.customTransformCache,dependencies:Array.from(this.dependencies,Hs),id:this.id,meta:this.info.meta,moduleSideEffects:this.info.moduleSideEffects,originalCode:this.originalCode,originalSourcemap:this.originalSourcemap,resolvedIds:this.resolvedIds,sourcemapChain:this.sourcemapChain,syntheticNamedExports:this.info.syntheticNamedExports,transformDependencies:this.transformDependencies,transformFiles:this.transformFiles}}traceVariable(e,{importerForSideEffects:t,isExportAllSearch:i,searchedNamesAndModules:s}=se){const n=this.scope.variables.get(e);if(n)return n;const r=this.importDescriptions.get(e);if(r){const e=r.module;if(e instanceof ln&&"*"===r.name)return e.namespace;const[n]=on(e,r.name,t||this,i,s);return n||this.error(Ee(r.name,this.id,e.id),r.start)}return null}tryParse(){try{return this.graph.contextParse(this.info.code)}catch(e){let t=e.message.replace(/ \(\d+:\d+\)$/,"");return this.id.endsWith(".json")?t+=" (Note that you need @rollup/plugin-json to import JSON files)":this.id.endsWith(".js")||(t+=" (Note that you need plugins to import files that are not JavaScript)"),this.error({code:"PARSE_ERROR",message:t,parserError:e},e.pos)}}updateOptions({meta:e,moduleSideEffects:t,syntheticNamedExports:i}){null!=t&&(this.info.moduleSideEffects=t),null!=i&&(this.info.syntheticNamedExports=i),null!=e&&Object.assign(this.info.meta,e)}warn(e,t){this.addLocationToLogProps(e,t),this.options.onwarn(e)}addDynamicImport(e){let t=e.source;t instanceof Os?1===t.quasis.length&&t.quasis[0].value.cooked&&(t=t.quasis[0].value.cooked):t instanceof Ti&&"string"==typeof t.value&&(t=t.value),this.dynamicImports.push({argument:t,id:null,node:e,resolution:null})}addExport(e){if(e instanceof Ki)this.exports.set("default",{identifier:e.variable.getAssignedVariableName(),localName:"default"});else if(e instanceof Wi){const t=e.source.value;if(this.sources.add(t),e.exported){const i=e.exported.name;this.reexportDescriptions.set(i,{localName:"*",module:null,source:t,start:e.start})}else this.exportAllSources.add(t)}else if(e.source instanceof Ti){const t=e.source.value;this.sources.add(t);for(const i of e.specifiers){const e=i.exported.name;this.reexportDescriptions.set(e,{localName:i.local.name,module:null,source:t,start:i.start})}}else if(e.declaration){const t=e.declaration;if(t instanceof Bs)for(const e of t.declarations)for(const t of Oe(e.id))this.exports.set(t,{identifier:null,localName:t});else{const e=t.id.name;this.exports.set(e,{identifier:null,localName:e})}}else for(const t of e.specifiers){const e=t.local.name,i=t.exported.name;this.exports.set(i,{identifier:null,localName:e})}}addImport(e){const t=e.source.value;this.sources.add(t);for(const i of e.specifiers){const e="ImportDefaultSpecifier"===i.type,s="ImportNamespaceSpecifier"===i.type,n=e?"default":s?"*":i.imported.name;this.importDescriptions.set(i.local.name,{module:null,name:n,source:t,start:i.start})}}addImportMeta(e){this.importMetas.push(e)}addLocationToLogProps(e,t){e.id=this.id,e.pos=t;let i=this.info.code;const s=re(i,t,{offsetLine:1});if(s){let{column:n,line:r}=s;try{({column:n,line:r}=function(e,t){const i=e.filter((e=>!!e.mappings));e:for(;i.length>0;){const e=i.pop().mappings[t.line-1];if(e){const i=e.filter((e=>e.length>1)),s=i[i.length-1];for(const e of i)if(e[0]>=t.column||e===s){t={column:e[3],line:e[2]+1};continue e}}throw new Error("Can't resolve original location of error.")}return t}(this.sourcemapChain,{column:n,line:r})),i=this.originalCode}catch(e){this.options.onwarn({code:"SOURCEMAP_ERROR",id:this.id,loc:{column:n,file:this.id,line:r},message:`Error when using sourcemap for reporting an error: ${e.message}`,pos:t})}fe(e,{column:n,line:r},i,this.id)}}addModulesToImportDescriptions(e){for(const t of e.values()){const{id:e}=this.resolvedIds[t.source];t.module=this.graph.modulesById.get(e)}}addRelevantSideEffectDependencies(e,t,i){const s=new Set,n=r=>{for(const a of r)s.has(a)||(s.add(a),t.has(a)?e.add(a):(a.info.moduleSideEffects||i.has(a))&&(a instanceof $e||a.hasEffects()?e.add(a):n(a.dependencies)))};n(this.dependencies),n(i)}getVariableFromNamespaceReexports(e,t,i){let s=null;const n=new Map,r=new Set;for(const a of this.exportAllModules){if(a.info.syntheticNamedExports===e)continue;const[o,l]=on(a,e,t,!0,cn(i));a instanceof $e||l?r.add(o):o instanceof Us?s||(s=o):o&&n.set(o,a)}if(n.size>0){const t=[...n],i=t[0][0];return 1===t.length?[i]:(this.options.onwarn(function(e,t,i){return{code:me.NAMESPACE_CONFLICT,message:`Conflicting namespaces: "${he(t)}" re-exports "${e}" from one of the modules ${oe(i.map((e=>he(e))))} (will be ignored)`,name:e,reexporter:t,sources:i}}(e,this.id,t.map((([,e])=>e.id)))),[null])}if(r.size>0){const t=[...r],i=t[0];return t.length>1&&this.options.onwarn(function(e,t,i,s){return{code:me.AMBIGUOUS_EXTERNAL_NAMESPACES,message:`Ambiguous external namespace resolution: "${he(t)}" re-exports "${e}" from one of the external modules ${oe(s.map((e=>he(e))))}, guessing "${he(i)}".`,name:e,reexporter:t,sources:s}}(e,this.id,i.module.id,t.map((e=>e.module.id)))),[i,!0]}return s?[s]:[null]}includeAndGetAdditionalMergedNamespaces(){const e=new Set,t=new Set;for(const i of[this,...this.exportAllModules])if(i instanceof $e){const[t]=i.getVariableForExportName("*");t.include(),this.includedImports.add(t),e.add(t)}else if(i.info.syntheticNamedExports){const e=i.getSyntheticNamespace();e.include(),this.includedImports.add(e),t.add(e)}return[...t,...e]}includeDynamicImport(e){const t=this.dynamicImports.find((t=>t.node===e)).resolution;t instanceof ln&&(t.includedDynamicImporters.push(this),t.includeAllExports(!0))}includeVariable(e){if(!e.included){e.include(),this.graph.needsTreeshakingPass=!0;const t=e.module;if(t instanceof ln&&(t.isExecuted||rn(t),t!==this)){const t=function(e,t){const i=R(t.sideEffectDependenciesByVariable,e,(()=>new Set));let s=e;const n=new Set([s]);for(;;){const e=s.module;if(s=s instanceof Ms?s.getDirectOriginalVariable():s instanceof Us?s.syntheticNamespace:null,!s||n.has(s))break;n.add(s),i.add(e);const t=e.sideEffectDependenciesByVariable.get(s);if(t)for(const e of t)i.add(e)}return i}(e,this);for(const e of t)e.isExecuted||rn(e)}}}includeVariableInModule(e){this.includeVariable(e);const t=e.module;t&&t!==this&&this.includedImports.add(e)}shimMissingExport(e){this.options.onwarn({code:"SHIMMED_EXPORT",exporter:he(this.id),exportName:e,message:`Missing export "${e}" has been shimmed in module ${he(this.id)}.`}),this.exports.set(e,an)}}function hn(e,t,i){if(e.module instanceof ln&&e.module!==i){const s=e.module.cycles;if(s.size>0){const n=i.cycles;for(const r of n)if(s.has(r)){t.alternativeReexportModules.set(e,i);break}}}}const cn=e=>e&&new Map(Array.from(e,(([e,t])=>[e,new Set(t)])));function un(e){return e.endsWith(".js")?e.slice(0,-3):e}function dn(e,t){return e.autoId?`${e.basePath?e.basePath+"/":""}${un(t)}`:e.id||""}function pn(e,t,i,s,n,r,a,o="return "){const{_:l,cnst:h,getDirectReturnFunction:c,getFunctionIntro:u,getPropertyAccess:d,n:p,s:f}=n;if(!i)return`${p}${p}${o}${function(e,t,i,s,n){if(e.length>0)return e[0].local;for(const{defaultVariableName:e,id:r,isChunk:a,name:o,namedExportsMode:l,namespaceVariableName:h,reexports:c}of t)if(c)return fn(o,c[0].imported,l,a,e,h,i,r,s,n)}(e,t,s,a,d)};`;let m="";for(const{defaultVariableName:e,id:n,isChunk:o,name:h,namedExportsMode:u,namespaceVariableName:f,reexports:g}of t)if(g&&i)for(const t of g)if("*"!==t.reexported){const i=fn(h,t.imported,u,o,e,f,s,n,a,d);if(m&&(m+=p),"*"!==t.imported&&t.needsLiveBinding){const[e,s]=c([],{functionReturn:!0,lineBreakIndent:null,name:null});m+=`Object.defineProperty(exports,${l}'${t.reexported}',${l}{${p}${r}enumerable:${l}true,${p}${r}get:${l}${e}${i}${s}${p}});`}else m+=`exports${d(t.reexported)}${l}=${l}${i};`}for(const{exported:t,local:i}of e){const e=`exports${d(t)}`,s=i;e!==s&&(m&&(m+=p),m+=`${e}${l}=${l}${s};`)}for(const{name:e,reexports:s}of t)if(s&&i)for(const t of s)if("*"===t.reexported){m&&(m+=p);const i=`{${p}${r}if${l}(k${l}!==${l}'default'${l}&&${l}!exports.hasOwnProperty(k))${l}${yn(e,t.needsLiveBinding,r,n)}${f}${p}}`;m+="var"===h&&t.needsLiveBinding?`Object.keys(${e}).forEach(${u(["k"],{isAsync:!1,name:null})}${i});`:`for${l}(${h} k in ${e})${l}${i}`}return m?`${p}${p}${m}`:""}function fn(e,t,i,s,n,r,a,o,l,h){if("default"===t){if(!s){const t=String(a(o)),i=es[t]?n:e;return ts(t,l)?`${i}${h("default")}`:i}return i?`${e}${h("default")}`:e}return"*"===t?(s?!i:is[String(a(o))])?r:e:`${e}${h(t)}`}function mn(e){return e([["value","true"]],{lineBreakIndent:null})}function gn(e,t,i,{_:s,getObject:n}){if(e){if(t)return i?`Object.defineProperties(exports,${s}${n([["__esModule",mn(n)],[null,`[Symbol.toStringTag]:${s}${xs(n)}`]],{lineBreakIndent:null})});`:`Object.defineProperty(exports,${s}'__esModule',${s}${mn(n)});`;if(i)return`Object.defineProperty(exports,${s}Symbol.toStringTag,${s}${xs(n)});`}return""}const yn=(e,t,i,{_:s,getDirectReturnFunction:n,n:r})=>{if(t){const[t,a]=n([],{functionReturn:!0,lineBreakIndent:null,name:null});return`Object.defineProperty(exports,${s}k,${s}{${r}${i}${i}enumerable:${s}true,${r}${i}${i}get:${s}${t}${e}[k]${a}${r}${i}})`}return`exports[k]${s}=${s}${e}[k]`};function xn(e,t,i,s,n,r,a,o){const{_:l,cnst:h,n:c}=o,u=new Set,d=[],p=(e,t,i)=>{u.add(t),d.push(`${h} ${e}${l}=${l}/*#__PURE__*/${t}(${i});`)};for(const{defaultVariableName:i,imports:s,id:n,isChunk:r,name:a,namedExportsMode:o,namespaceVariableName:l,reexports:h}of e)if(r){for(const{imported:e,reexported:t}of[...s||[],...h||[]])if("*"===e&&"*"!==t){o||p(l,"_interopNamespaceDefaultOnly",a);break}}else{const e=String(t(n));let r=!1,o=!1;for(const{imported:t,reexported:n}of[...s||[],...h||[]]){let s,h;"default"===t?r||(r=!0,i!==l&&(h=i,s=es[e])):"*"===t&&"*"!==n&&(o||(o=!0,s=is[e],h=l)),s&&p(h,s,a)}}return`${ns(u,r,a,o,i,s,n)}${d.length>0?`${d.join(c)}${c}${c}`:""}`}function En(e,t){return"."!==e[0]?e:t?(i=e).endsWith(".js")?i:i+".js":un(e);var i}const bn={assert:!0,buffer:!0,console:!0,constants:!0,domain:!0,events:!0,http:!0,https:!0,os:!0,path:!0,process:!0,punycode:!0,querystring:!0,stream:!0,string_decoder:!0,timers:!0,tty:!0,url:!0,util:!0,vm:!0,zlib:!0};function vn(e,t){const i=t.map((({id:e})=>e)).filter((e=>e in bn));i.length&&e({code:"MISSING_NODE_BUILTINS",message:`Creating a browser bundle that depends on Node.js built-in modules (${oe(i)}). You might need to include https://github.com/FredKSchott/rollup-plugin-polyfill-node`,modules:i})}const Sn=(e,t)=>e.split(".").map(t).join("");function An(e,t,i,s,{_:n,getPropertyAccess:r}){const a=e.split(".");a[0]=("function"==typeof i?i(a[0]):i[a[0]])||a[0];const o=a.pop();let l=t,h=a.map((e=>(l+=r(e),`${l}${n}=${n}${l}${n}||${n}{}`))).concat(`${l}${r(o)}`).join(`,${n}`)+`${n}=${n}${s}`;return a.length>0&&(h=`(${h})`),h}function In(e){let t=e.length;for(;t--;){const{imports:i,reexports:s}=e[t];if(i||s)return e.slice(0,t+1)}return[]}const Pn=({dependencies:e,exports:t})=>{const i=new Set(t.map((e=>e.exported)));i.add("default");for(const{reexports:t}of e)if(t)for(const e of t)"*"!==e.reexported&&i.add(e.reexported);return i},kn=(e,t,{_:i,cnst:s,getObject:n,n:r})=>e?`${r}${t}${s} _starExcludes${i}=${i}${n([...e].map((e=>[e,"1"])),{lineBreakIndent:{base:t,t:t}})};`:"",wn=(e,t,{_:i,n:s})=>e.length?`${s}${t}var ${e.join(`,${i}`)};`:"",Cn=(e,t,i)=>_n(e.filter((e=>e.hoisted)).map((e=>({name:e.exported,value:e.local}))),t,i);function _n(e,t,{_:i,n:s}){return 0===e.length?"":1===e.length?`exports('${e[0].name}',${i}${e[0].value});${s}${s}`:`exports({${s}`+e.map((({name:e,value:s})=>`${t}${e}:${i}${s}`)).join(`,${s}`)+`${s}});${s}${s}`}const Nn=(e,t,i)=>_n(e.filter((e=>e.expression)).map((e=>({name:e.exported,value:e.local}))),t,i),$n=(e,t,i)=>_n(e.filter((e=>"_missingExportShim"===e.local)).map((e=>({name:e.exported,value:"_missingExportShim"}))),t,i);function Tn(e,t,i){return e?`${t}${Sn(e,i)}`:"null"}var On={amd:function(e,{accessedGlobals:t,dependencies:i,exports:s,hasExports:n,id:r,indent:a,intro:o,isEntryFacade:l,isModuleFacade:h,namedExportsMode:c,outro:u,snippets:d,warn:p},{amd:f,esModule:m,externalLiveBindings:g,freeze:y,interop:x,namespaceToStringTag:E,strict:b}){vn(p,i);const v=i.map((e=>`'${En(e.id,f.forceJsExtensionForImports)}'`)),S=i.map((e=>e.name)),{n:A,getNonArrowFunctionIntro:I,_:P}=d;c&&n&&(S.unshift("exports"),v.unshift("'exports'")),t.has("require")&&(S.unshift("require"),v.unshift("'require'")),t.has("module")&&(S.unshift("module"),v.unshift("'module'"));const k=dn(f,r),w=(k?`'${k}',${P}`:"")+(v.length?`[${v.join(`,${P}`)}],${P}`:""),C=b?`${P}'use strict';`:"";e.prepend(`${o}${xn(i,x,g,y,E,t,a,d)}`);const _=pn(s,i,c,x,d,a,g);let N=gn(c&&n,l&&m,h&&E,d);return N&&(N=A+A+N),e.append(`${_}${N}${u}`),e.indent(a).prepend(`${f.define}(${w}(${I(S,{isAsync:!1,name:null})}{${C}${A}${A}`).append(`${A}${A}}));`)},cjs:function(e,{accessedGlobals:t,dependencies:i,exports:s,hasExports:n,indent:r,intro:a,isEntryFacade:o,isModuleFacade:l,namedExportsMode:h,outro:c,snippets:u},{compact:d,esModule:p,externalLiveBindings:f,freeze:m,interop:g,namespaceToStringTag:y,strict:x}){const{_:E,n:b}=u,v=x?`'use strict';${b}${b}`:"";let S=gn(h&&n,o&&p,l&&y,u);S&&(S+=b+b);const A=function(e,{_:t,cnst:i,n:s},n){let r="",a=!1;for(const{id:o,name:l,reexports:h,imports:c}of e)h||c?(r+=n&&a?",":`${r?`;${s}`:""}${i} `,a=!0,r+=`${l}${t}=${t}require('${o}')`):(r&&(r+=n&&!a?",":`;${s}`),a=!1,r+=`require('${o}')`);if(r)return`${r};${s}${s}`;return""}(i,u,d),I=xn(i,g,f,m,y,t,r,u);e.prepend(`${v}${a}${S}${A}${I}`);const P=pn(s,i,h,g,u,r,f,`module.exports${E}=${E}`);return e.append(`${P}${c}`)},es:function(e,{accessedGlobals:t,indent:i,intro:s,outro:n,dependencies:r,exports:a,snippets:o},{externalLiveBindings:l,freeze:h,namespaceToStringTag:c}){const{_:u,n:d}=o,p=function(e,t){const i=[];for(const{id:s,reexports:n,imports:r,name:a}of e)if(n||r){if(r){let e=null,n=null;const a=[];for(const t of r)"default"===t.imported?e=t:"*"===t.imported?n=t:a.push(t);n&&i.push(`import${t}*${t}as ${n.local} from${t}'${s}';`),e&&0===a.length?i.push(`import ${e.local} from${t}'${s}';`):a.length>0&&i.push(`import ${e?`${e.local},${t}`:""}{${t}${a.map((e=>e.imported===e.local?e.imported:`${e.imported} as ${e.local}`)).join(`,${t}`)}${t}}${t}from${t}'${s}';`)}if(n){let e=null;const o=[],l=[];for(const t of n)"*"===t.reexported?e=t:"*"===t.imported?o.push(t):l.push(t);if(e&&i.push(`export${t}*${t}from${t}'${s}';`),o.length>0){r&&r.some((e=>"*"===e.imported&&e.local===a))||i.push(`import${t}*${t}as ${a} from${t}'${s}';`);for(const e of o)i.push(`export${t}{${t}${a===e.reexported?a:`${a} as ${e.reexported}`} };`)}l.length>0&&i.push(`export${t}{${t}${l.map((e=>e.imported===e.reexported?e.imported:`${e.imported} as ${e.reexported}`)).join(`,${t}`)}${t}}${t}from${t}'${s}';`)}}else i.push(`import${t}'${s}';`);return i}(r,u);p.length>0&&(s+=p.join(d)+d+d),(s+=ns(null,t,i,o,l,h,c))&&e.prepend(s);const f=function(e,{_:t,cnst:i}){const s=[],n=[];for(const r of e)r.expression&&s.push(`${i} ${r.local}${t}=${t}${r.expression};`),n.push(r.exported===r.local?r.local:`${r.local} as ${r.exported}`);n.length&&s.push(`export${t}{${t}${n.join(`,${t}`)}${t}};`);return s}(a,o);return f.length&&e.append(d+d+f.join(d).trim()),n&&e.append(n),e.trim()},iife:function(e,{accessedGlobals:t,dependencies:i,exports:s,hasExports:n,indent:r,intro:a,namedExportsMode:o,outro:l,snippets:h,warn:c},{compact:u,esModule:d,extend:p,freeze:f,externalLiveBindings:m,globals:g,interop:y,name:x,namespaceToStringTag:E,strict:b}){const{_:v,getNonArrowFunctionIntro:S,getPropertyAccess:A,n:I}=h,P=x&&x.includes("."),k=!p&&!P;if(x&&k&&(_e(w=x)||Ce.test(w)))return pe({code:"ILLEGAL_IDENTIFIER_AS_NAME",message:`Given name "${x}" is not a legal JS identifier. If you need this, you can try "output.extend: true".`});var w;vn(c,i);const C=In(i),_=C.map((e=>e.globalName||"null")),N=C.map((e=>e.name));n&&!x&&c({code:"MISSING_NAME_OPTION_FOR_IIFE_EXPORT",message:'If you do not supply "output.name", you may not be able to access the exports of an IIFE bundle.'}),o&&n&&(p?(_.unshift(`this${Sn(x,A)}${v}=${v}this${Sn(x,A)}${v}||${v}{}`),N.unshift("exports")):(_.unshift("{}"),N.unshift("exports")));const $=b?`${r}'use strict';${I}`:"",T=xn(i,y,m,f,E,t,r,h);e.prepend(`${a}${T}`);let O=`(${S(N,{isAsync:!1,name:null})}{${I}${$}${I}`;n&&(!x||p&&o||(O=(k?`var ${x}`:`this${Sn(x,A)}`)+`${v}=${v}${O}`),P&&(O=function(e,t,i,{_:s,getPropertyAccess:n,s:r},a){const o=e.split(".");o[0]=("function"==typeof i?i(o[0]):i[o[0]])||o[0],o.pop();let l=t;return o.map((e=>(l+=n(e),`${l}${s}=${s}${l}${s}||${s}{}${r}`))).join(a?",":"\n")+(a&&o.length?";":"\n")}(x,"this",g,h,u)+O));let R=`${I}${I}})(${_.join(`,${v}`)});`;n&&!p&&o&&(R=`${I}${I}${r}return exports;${R}`);const M=pn(s,i,o,y,h,r,m);let D=gn(o&&n,d,E,h);return D&&(D=I+I+D),e.append(`${M}${D}${l}`),e.indent(r).prepend(O).append(R)},system:function(e,{accessedGlobals:t,dependencies:i,exports:s,hasExports:n,indent:r,intro:a,snippets:o,outro:l,usesTopLevelAwait:h},{externalLiveBindings:c,freeze:u,name:d,namespaceToStringTag:p,strict:f,systemNullSetters:m}){const{_:g,getFunctionIntro:y,getNonArrowFunctionIntro:x,n:E,s:b}=o,{importBindings:v,setters:S,starExcludes:A}=function(e,t,i,{_:s,cnst:n,getObject:r,getPropertyAccess:a,n:o}){const l=[],h=[];let c=null;for(const{imports:u,reexports:d}of e){const p=[];if(u)for(const e of u)l.push(e.local),"*"===e.imported?p.push(`${e.local}${s}=${s}module;`):p.push(`${e.local}${s}=${s}module${a(e.imported)};`);if(d){const o=[];let l=!1;for(const{imported:e,reexported:t}of d)"*"===t?l=!0:o.push([t,"*"===e?"module":`module${a(e)}`]);if(o.length>1||l){const a=r(o,{lineBreakIndent:null});l?(c||(c=Pn({dependencies:e,exports:t})),p.push(`${n} setter${s}=${s}${a};`,`for${s}(${n} name in module)${s}{`,`${i}if${s}(!_starExcludes[name])${s}setter[name]${s}=${s}module[name];`,"}","exports(setter);")):p.push(`exports(${a});`)}else{const[e,t]=o[0];p.push(`exports('${e}',${s}${t});`)}}h.push(p.join(`${o}${i}${i}${i}`))}return{importBindings:l,setters:h,starExcludes:c}}(i,s,r,o),I=d?`'${d}',${g}`:"",P=t.has("module")?["exports","module"]:n?["exports"]:[];let k=`System.register(${I}[`+i.map((({id:e})=>`'${e}'`)).join(`,${g}`)+`],${g}(${x(P,{isAsync:!1,name:null})}{${E}${r}${f?"'use strict';":""}`+kn(A,r,o)+wn(v,r,o)+`${E}${r}return${g}{${S.length?`${E}${r}${r}setters:${g}[${S.map((e=>e?`${y(["module"],{isAsync:!1,name:null})}{${E}${r}${r}${r}${e}${E}${r}${r}}`:m?"null":`${y([],{isAsync:!1,name:null})}{}`)).join(`,${g}`)}],`:""}${E}`;k+=`${r}${r}execute:${g}(${x([],{isAsync:h,name:null})}{${E}${E}`;const w=`${r}${r}})${E}${r}}${b}${E}}));`;return e.prepend(a+ns(null,t,r,o,c,u,p)+Cn(s,r,o)),e.append(`${l}${E}${E}`+Nn(s,r,o)+$n(s,r,o)),e.indent(`${r}${r}${r}`).append(w).prepend(k)},umd:function(e,{accessedGlobals:t,dependencies:i,exports:s,hasExports:n,id:r,indent:a,intro:o,namedExportsMode:l,outro:h,snippets:c,warn:u},{amd:d,compact:p,esModule:f,extend:m,externalLiveBindings:g,freeze:y,interop:x,name:E,namespaceToStringTag:b,globals:v,noConflict:S,strict:A}){const{_:I,cnst:P,getFunctionIntro:k,getNonArrowFunctionIntro:w,getPropertyAccess:C,n:_,s:N}=c,$=p?"f":"factory",T=p?"g":"global";if(n&&!E)return pe({code:"MISSING_NAME_OPTION_FOR_IIFE_EXPORT",message:'You must supply "output.name" for UMD bundles that have exports so that the exports are accessible in environments without a module loader.'});vn(u,i);const O=i.map((e=>`'${En(e.id,d.forceJsExtensionForImports)}'`)),R=i.map((e=>`require('${e.id}')`)),M=In(i),D=M.map((e=>Tn(e.globalName,T,C))),L=M.map((e=>e.name));l&&(n||S)&&(O.unshift("'exports'"),R.unshift("exports"),D.unshift(An(E,T,v,(m?`${Tn(E,T,C)}${I}||${I}`:"")+"{}",c)),L.unshift("exports"));const V=dn(d,r),B=(V?`'${V}',${I}`:"")+(O.length?`[${O.join(`,${I}`)}],${I}`:""),F=d.define,z=!l&&n?`module.exports${I}=${I}`:"",j=A?`${I}'use strict';${_}`:"";let U;if(S){const e=p?"e":"exports";let t;if(!l&&n)t=`${P} ${e}${I}=${I}${An(E,T,v,`${$}(${D.join(`,${I}`)})`,c)};`;else{t=`${P} ${e}${I}=${I}${D.shift()};${_}${a}${a}${$}(${[e].concat(D).join(`,${I}`)});`}U=`(${k([],{isAsync:!1,name:null})}{${_}${a}${a}${P} current${I}=${I}${function(e,t,{_:i,getPropertyAccess:s}){let n=t;return e.split(".").map((e=>n+=s(e))).join(`${i}&&${i}`)}(E,T,c)};${_}${a}${a}${t}${_}${a}${a}${e}.noConflict${I}=${I}${k([],{isAsync:!1,name:null})}{${I}${Tn(E,T,C)}${I}=${I}current;${I}return ${e}${N}${I}};${_}${a}})()`}else U=`${$}(${D.join(`,${I}`)})`,!l&&n&&(U=An(E,T,v,U,c));const G=n||S&&l||D.length>0,H=[$];G&&H.unshift(T);const W=G?`this,${I}`:"",q=G?`(${T}${I}=${I}typeof globalThis${I}!==${I}'undefined'${I}?${I}globalThis${I}:${I}${T}${I}||${I}self,${I}`:"",K=G?")":"",X=G?`${a}typeof exports${I}===${I}'object'${I}&&${I}typeof module${I}!==${I}'undefined'${I}?${I}${z}${$}(${R.join(`,${I}`)})${I}:${_}`:"",Y=`(${w(H,{isAsync:!1,name:null})}{${_}`+X+`${a}typeof ${F}${I}===${I}'function'${I}&&${I}${F}.amd${I}?${I}${F}(${B}${$})${I}:${_}`+`${a}${q}${U}${K};${_}`+`})(${W}(${w(L,{isAsync:!1,name:null})}{${j}${_}`,Q=_+_+"}));";e.prepend(`${o}${xn(i,x,g,y,b,t,a,c)}`);const J=pn(s,i,l,x,c,a,g);let Z=gn(l&&n,f,b,c);return Z&&(Z=_+_+Z),e.append(`${J}${Z}${h}`),e.trim().indent(a).append(Q).prepend(Y)}};class Rn{constructor(e,t){this.isOriginal=!0,this.filename=e,this.content=t}traceSegment(e,t,i){return{column:t,line:e,name:i,source:this}}}class Mn{constructor(e,t){this.sources=t,this.names=e.names,this.mappings=e.mappings}traceMappings(){const e=[],t=new Map,i=[],s=[],n=new Map,r=[];for(const a of this.mappings){const o=[];for(const r of a){if(1===r.length)continue;const a=this.sources[r[1]];if(!a)continue;const l=a.traceSegment(r[2],r[3],5===r.length?this.names[r[4]]:"");if(l){const{column:a,line:h,name:c,source:{content:u,filename:d}}=l;let p=t.get(d);if(void 0===p)p=e.length,e.push(d),t.set(d,p),i[p]=u;else if(null==i[p])i[p]=u;else if(null!=u&&i[p]!==u)return pe({message:`Multiple conflicting contents for sourcemap source ${d}`});const f=[r[0],p,h,a];if(c){let e=n.get(c);void 0===e&&(e=s.length,s.push(c),n.set(c,e)),f[4]=e}o.push(f)}}r.push(o)}return{mappings:r,names:s,sources:e,sourcesContent:i}}traceSegment(e,t,i){const s=this.mappings[e];if(!s)return null;let n=0,r=s.length-1;for(;n<=r;){const e=n+r>>1,a=s[e];if(a[0]===t||n===r){if(1==a.length)return null;const e=this.sources[a[1]];return e?e.traceSegment(a[2],a[3],5===a.length?this.names[a[4]]:i):null}a[0]>t?r=e-1:n=e+1}return null}}function Dn(e){return function(t,i){return i.mappings?new Mn(i,[t]):(e({code:"SOURCEMAP_BROKEN",message:`Sourcemap is likely to be incorrect: a plugin (${i.plugin}) was used to transform files, but didn't generate a sourcemap for the transformation. Consult the plugin documentation for help`,plugin:i.plugin,url:"https://rollupjs.org/guide/en/#warning-sourcemap-is-likely-to-be-incorrect"}),new Mn({mappings:[],names:[]},[t]))}}function Ln(e,t,i,s,n){let r;if(i){const t=i.sources,s=i.sourcesContent||[],n=N(e)||".",a=i.sourceRoot||".",o=t.map(((e,t)=>new Rn(O(n,a,e),s[t])));r=new Mn(i,o)}else r=new Rn(e,t);return s.reduce(n,r)}var Vn={},Bn=Fn;function Fn(e,t){if(!e)throw new Error(t||"Assertion failed")}Fn.equal=function(e,t,i){if(e!=t)throw new Error(i||"Assertion failed: "+e+" != "+t)};var zn={exports:{}};"function"==typeof Object.create?zn.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:zn.exports=function(e,t){if(t){e.super_=t;var i=function(){};i.prototype=t.prototype,e.prototype=new i,e.prototype.constructor=e}};var jn=Bn,Un=zn.exports;function Gn(e,t){return 55296==(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1)))}function Hn(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function Wn(e){return 1===e.length?"0"+e:e}function qn(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}Vn.inherits=Un,Vn.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var i=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),n=0;n>6|192,i[s++]=63&r|128):Gn(e,n)?(r=65536+((1023&r)<<10)+(1023&e.charCodeAt(++n)),i[s++]=r>>18|240,i[s++]=r>>12&63|128,i[s++]=r>>6&63|128,i[s++]=63&r|128):(i[s++]=r>>12|224,i[s++]=r>>6&63|128,i[s++]=63&r|128)}else for(n=0;n>>0}return r},Vn.split32=function(e,t){for(var i=new Array(4*e.length),s=0,n=0;s>>24,i[n+1]=r>>>16&255,i[n+2]=r>>>8&255,i[n+3]=255&r):(i[n+3]=r>>>24,i[n+2]=r>>>16&255,i[n+1]=r>>>8&255,i[n]=255&r)}return i},Vn.rotr32=function(e,t){return e>>>t|e<<32-t},Vn.rotl32=function(e,t){return e<>>32-t},Vn.sum32=function(e,t){return e+t>>>0},Vn.sum32_3=function(e,t,i){return e+t+i>>>0},Vn.sum32_4=function(e,t,i,s){return e+t+i+s>>>0},Vn.sum32_5=function(e,t,i,s,n){return e+t+i+s+n>>>0},Vn.sum64=function(e,t,i,s){var n=e[t],r=s+e[t+1]>>>0,a=(r>>0,e[t+1]=r},Vn.sum64_hi=function(e,t,i,s){return(t+s>>>0>>0},Vn.sum64_lo=function(e,t,i,s){return t+s>>>0},Vn.sum64_4_hi=function(e,t,i,s,n,r,a,o){var l=0,h=t;return l+=(h=h+s>>>0)>>0)>>0)>>0},Vn.sum64_4_lo=function(e,t,i,s,n,r,a,o){return t+s+r+o>>>0},Vn.sum64_5_hi=function(e,t,i,s,n,r,a,o,l,h){var c=0,u=t;return c+=(u=u+s>>>0)>>0)>>0)>>0)>>0},Vn.sum64_5_lo=function(e,t,i,s,n,r,a,o,l,h){return t+s+r+o+h>>>0},Vn.rotr64_hi=function(e,t,i){return(t<<32-i|e>>>i)>>>0},Vn.rotr64_lo=function(e,t,i){return(e<<32-i|t>>>i)>>>0},Vn.shr64_hi=function(e,t,i){return e>>>i},Vn.shr64_lo=function(e,t,i){return(e<<32-i|t>>>i)>>>0};var Kn={},Xn=Vn,Yn=Bn;function Qn(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}Kn.BlockHash=Qn,Qn.prototype.update=function(e,t){if(e=Xn.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var i=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-i,e.length),0===this.pending.length&&(this.pending=null),e=Xn.join32(e,0,e.length-i,this.endian);for(var s=0;s>>24&255,s[n++]=e>>>16&255,s[n++]=e>>>8&255,s[n++]=255&e}else for(s[n++]=255&e,s[n++]=e>>>8&255,s[n++]=e>>>16&255,s[n++]=e>>>24&255,s[n++]=0,s[n++]=0,s[n++]=0,s[n++]=0,r=8;r>>3},Jn.g1_256=function(e){return Zn(e,17)^Zn(e,19)^e>>>10};var sr=Vn,nr=Kn,rr=Jn,ar=Bn,or=sr.sum32,lr=sr.sum32_4,hr=sr.sum32_5,cr=rr.ch32,ur=rr.maj32,dr=rr.s0_256,pr=rr.s1_256,fr=rr.g0_256,mr=rr.g1_256,gr=nr.BlockHash,yr=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function xr(){if(!(this instanceof xr))return new xr;gr.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=yr,this.W=new Array(64)}sr.inherits(xr,gr);var Er=xr;xr.blockSize=512,xr.outSize=256,xr.hmacStrength=192,xr.padLength=64,xr.prototype._update=function(e,t){for(var i=this.W,s=0;s<16;s++)i[s]=e[t+s];for(;sbr(),Sr={amd:Pr,cjs:Pr,es:Ir,iife:Pr,system:Ir,umd:Pr};function Ar(e,t,i,s,n,r,a,o,l,h,c,u,d){const p=e.slice().reverse();for(const e of p)e.scope.addUsedOutsideNames(s,n,c,u);!function(e,t,i){for(const s of t){for(const t of s.scope.variables.values())t.included&&!(t.renderBaseName||t instanceof Ms&&t.getOriginalVariable()!==t)&&t.setRenderNames(null,Vt(t.name,e));if(i.has(s)){const t=s.namespace;t.setRenderNames(null,Vt(t.name,e))}}}(s,p,d),Sr[n](s,i,t,r,a,o,l,h);for(const e of p)e.scope.deconflict(n,c,u)}function Ir(e,t,i,s,n,r,a,o){for(const t of i.dependencies)(n||t instanceof $e)&&(t.variableName=Vt(t.suggestedVariableName,e));for(const i of t){const t=i.module,s=i.name;i.isNamespace&&(n||t instanceof $e)?i.setRenderNames(null,(t instanceof $e?t:a.get(t)).variableName):t instanceof $e&&"default"===s?i.setRenderNames(null,Vt([...t.exportedVariables].some((([e,t])=>"*"===t&&e.included))?t.suggestedVariableName+"__default":t.suggestedVariableName,e)):i.setRenderNames(null,Vt(s,e))}for(const t of o)t.setRenderNames(null,Vt(t.name,e))}function Pr(e,t,{deconflictedDefault:i,deconflictedNamespace:s,dependencies:n},r,a,o,l){for(const t of n)t.variableName=Vt(t.suggestedVariableName,e);for(const t of s)t.namespaceVariableName=Vt(`${t.suggestedVariableName}__namespace`,e);for(const t of i)s.has(t)&&ss(String(r(t.id)),o)?t.defaultVariableName=t.namespaceVariableName:t.defaultVariableName=Vt(`${t.suggestedVariableName}__default`,e);for(const e of t){const t=e.module;if(t instanceof $e){const i=e.name;if("default"===i){const i=String(r(t.id)),s=es[i]?t.defaultVariableName:t.variableName;ts(i,o)?e.setRenderNames(s,"default"):e.setRenderNames(null,s)}else"*"===i?e.setRenderNames(null,is[String(r(t.id))]?t.namespaceVariableName:t.variableName):e.setRenderNames(t.variableName,null)}else{const i=l.get(t);a&&e.isNamespace?e.setRenderNames(null,"default"===i.exportMode?i.namespaceVariableName:i.variableName):"default"===i.exportMode?e.setRenderNames(null,i.variableName):e.setRenderNames(i.variableName,i.getVariableExportName(e))}}}const kr=/[\\'\r\n\u2028\u2029]/,wr=/(['\r\n\u2028\u2029])/g,Cr=/\\/g;function _r(e){return e.match(kr)?e.replace(Cr,"\\\\").replace(wr,"\\$1"):e}function Nr(e,{exports:t,name:i,format:s},n,r,a){const o=e.getExportNames();if("default"===t){if(1!==o.length||"default"!==o[0])return pe(ye("default",o,r))}else if("none"===t&&o.length)return pe(ye("none",o,r));return"auto"===t&&(0===o.length?t="none":1===o.length&&"default"===o[0]?("cjs"===s&&n.has("exports")&&a(function(e){const t=he(e);return{code:me.PREFER_NAMED_EXPORTS,id:e,message:`Entry module "${t}" is implicitly using "default" export mode, which means for CommonJS output that its default export is assigned to "module.exports". For many tools, such CommonJS output will not be interchangeable with the original ES module. If this is intended, explicitly set "output.exports" to either "auto" or "default", otherwise you might want to consider changing the signature of "${t}" to use named exports only.`,url:"https://rollupjs.org/guide/en/#outputexports"}}(r)),t="default"):("es"!==s&&"system"!==s&&o.includes("default")&&a(function(e,t){return{code:me.MIXED_EXPORTS,id:e,message:`Entry module "${he(e)}" is using named and default exports together. Consumers of your bundle will have to use \`${t||"chunk"}["default"]\` to access the default export, which may not be what you want. Use \`output.exports: "named"\` to disable this warning`,url:"https://rollupjs.org/guide/en/#outputexports"}}(r,i)),t="named")),t}function $r(e){const t=e.split("\n"),i=t.filter((e=>/^\t+/.test(e))),s=t.filter((e=>/^ {2,}/.test(e)));if(0===i.length&&0===s.length)return null;if(i.length>=s.length)return"\t";const n=s.reduce(((e,t)=>{const i=/^ +/.exec(t)[0].length;return Math.min(i,e)}),1/0);return new Array(n+1).join(" ")}function Tr(e,t,i,s,n){const r=e.getDependenciesToBeIncluded();for(const e of r){if(e instanceof $e){t.push(e);continue}const r=n.get(e);r===s?i.has(e)||(i.add(e),Tr(e,t,i,s,n)):t.push(r)}}function Or(e){if(!e)return null;if("string"==typeof e&&(e=JSON.parse(e)),""===e.mappings)return{mappings:[],names:[],sources:[],version:3};const i="string"==typeof e.mappings?function(e){for(var i=[],s=[],r=[0,0,0,0,0],a=0,o=0,l=0,h=0;o>>=1,p&&(h=0===h?-2147483648:-h),r[a]+=h,a++,h=l=0}}}return n(s,r,a),i.push(s),i}(e.mappings):e.mappings;return{...e,mappings:i}}const Rr=Symbol("bundleKeys"),Mr={type:"placeholder"};function Dr(e,t,i){return ce(e)?pe(Ae(`Invalid pattern "${e}" for "${t}", patterns can be neither absolute nor relative paths. If you want your files to be stored in a subdirectory, write its name without a leading slash like this: subdirectory/pattern.`)):e.replace(/\[(\w+)\]/g,((e,s)=>{if(!i.hasOwnProperty(s))return pe(Ae(`"[${s}]" is not a valid placeholder in "${t}" pattern.`));const n=i[s]();return ce(n)?pe(Ae(`Invalid substitution "${n}" for placeholder "[${s}]" in "${t}" pattern, can be neither absolute nor relative path.`)):n}))}function Lr(e,{[Rr]:t}){if(!t.has(e.toLowerCase()))return e;const i=$(e);e=e.substring(0,e.length-i.length);let s,n=1;for(;t.has((s=e+ ++n+i).toLowerCase()););return s}const Vr=[".js",".jsx",".ts",".tsx"];function Br(e,t,i,s){const n="function"==typeof t?t(e.id):t[e.id];return n||(i?(s({code:"MISSING_GLOBAL_NAME",guess:e.variableName,message:`No name was provided for external module '${e.id}' in output.globals – guessing '${e.variableName}'`,source:e.id}),e.variableName):void 0)}class Fr{constructor(e,t,i,s,n,r,a,o,l,h){this.orderedModules=e,this.inputOptions=t,this.outputOptions=i,this.unsetOptions=s,this.pluginDriver=n,this.modulesById=r,this.chunkByModule=a,this.facadeChunkByModule=o,this.includedNamespaces=l,this.manualChunkAlias=h,this.entryModules=[],this.exportMode="named",this.facadeModule=null,this.id=null,this.namespaceVariableName="",this.needsExportsShim=!1,this.variableName="",this.accessedGlobalsByScope=new Map,this.dependencies=new Set,this.dynamicDependencies=new Set,this.dynamicEntryModules=[],this.dynamicName=null,this.exportNamesByVariable=new Map,this.exports=new Set,this.exportsByName=new Map,this.fileName=null,this.implicitEntryModules=[],this.implicitlyLoadedBefore=new Set,this.imports=new Set,this.includedReexportsByModule=new Map,this.indentString=void 0,this.isEmpty=!0,this.name=null,this.renderedDependencies=null,this.renderedExports=null,this.renderedHash=void 0,this.renderedModuleSources=new Map,this.renderedModules=Object.create(null),this.renderedSource=null,this.sortedExportNames=null,this.strictFacade=!1,this.usedModules=void 0,this.execIndex=e.length>0?e[0].execIndex:1/0;const c=new Set(e);for(const t of e){t.namespace.included&&l.add(t),this.isEmpty&&t.isIncluded()&&(this.isEmpty=!1),(t.info.isEntry||i.preserveModules)&&this.entryModules.push(t);for(const e of t.includedDynamicImporters)c.has(e)||(this.dynamicEntryModules.push(t),t.info.syntheticNamedExports&&!i.preserveModules&&(l.add(t),this.exports.add(t.namespace)));t.implicitlyLoadedAfter.size>0&&this.implicitEntryModules.push(t)}this.suggestedVariableName=Ne(this.generateVariableName())}static generateFacade(e,t,i,s,n,r,a,o,l,h){const c=new Fr([],e,t,i,s,n,r,a,o,null);c.assignFacadeName(h,l),a.has(l)||a.set(l,c);for(const e of l.getDependenciesToBeIncluded())c.dependencies.add(e instanceof ln?r.get(e):e);return!c.dependencies.has(r.get(l))&&l.info.moduleSideEffects&&l.hasEffects()&&c.dependencies.add(r.get(l)),c.ensureReexportsAreAvailableForModule(l),c.facadeModule=l,c.strictFacade=!0,c}canModuleBeFacade(e,t){const i=e.getExportNamesByVariable();for(const t of this.exports)if(!i.has(t))return 0===i.size&&e.isUserDefinedEntryPoint&&"strict"===e.preserveSignature&&this.unsetOptions.has("preserveEntrySignatures")&&this.inputOptions.onwarn({code:"EMPTY_FACADE",id:e.id,message:`To preserve the export signature of the entry module "${he(e.id)}", an empty facade chunk was created. This often happens when creating a bundle for a web app where chunks are placed in script tags and exports are ignored. In this case it is recommended to set "preserveEntrySignatures: false" to avoid this and reduce the number of chunks. Otherwise if this is intentional, set "preserveEntrySignatures: 'strict'" explicitly to silence this warning.`,url:"https://rollupjs.org/guide/en/#preserveentrysignatures"}),!1;for(const s of t)if(!i.has(s)&&s.module!==e)return!1;return!0}generateExports(){this.sortedExportNames=null;const e=new Set(this.exports);if(null!==this.facadeModule&&(!1!==this.facadeModule.preserveSignature||this.strictFacade)){const t=this.facadeModule.getExportNamesByVariable();for(const[i,s]of t){this.exportNamesByVariable.set(i,[...s]);for(const e of s)this.exportsByName.set(e,i);e.delete(i)}}this.outputOptions.minifyInternalExports?function(e,t,i){let s=0;for(const n of e){let[e]=n.name;if(t.has(e))do{e=Lt(++s),49===e.charCodeAt(0)&&(s+=9*64**(e.length-1),e=Lt(s))}while(we.has(e)||t.has(e));t.set(e,n),i.set(n,[e])}}(e,this.exportsByName,this.exportNamesByVariable):function(e,t,i){for(const s of e){let e=0,n=s.name;for(;t.has(n);)n=s.name+"$"+ ++e;t.set(n,s),i.set(s,[n])}}(e,this.exportsByName,this.exportNamesByVariable),(this.outputOptions.preserveModules||this.facadeModule&&this.facadeModule.info.isEntry)&&(this.exportMode=Nr(this,this.outputOptions,this.unsetOptions,this.facadeModule.id,this.inputOptions.onwarn))}generateFacades(){var e;const t=[],i=new Set([...this.entryModules,...this.implicitEntryModules]),s=new Set(this.dynamicEntryModules.map((({namespace:e})=>e)));for(const e of i)if(e.preserveSignature)for(const t of e.getExportNamesByVariable().keys())s.add(t);for(const e of i){const i=Array.from(new Set(e.chunkNames.filter((({isUserDefined:e})=>e)).map((({name:e})=>e))),(e=>({name:e})));if(0===i.length&&e.isUserDefinedEntryPoint&&i.push({}),i.push(...Array.from(e.chunkFileNames,(e=>({fileName:e})))),0===i.length&&i.push({}),!this.facadeModule){const t="strict"===e.preserveSignature||"exports-only"===e.preserveSignature&&0!==e.getExportNamesByVariable().size;(!t||this.outputOptions.preserveModules||this.canModuleBeFacade(e,s))&&(this.facadeModule=e,this.facadeChunkByModule.set(e,this),e.preserveSignature&&(this.strictFacade=t),this.assignFacadeName(i.shift(),e))}for(const s of i)t.push(Fr.generateFacade(this.inputOptions,this.outputOptions,this.unsetOptions,this.pluginDriver,this.modulesById,this.chunkByModule,this.facadeChunkByModule,this.includedNamespaces,e,s))}for(const t of this.dynamicEntryModules)t.info.syntheticNamedExports||(!this.facadeModule&&this.canModuleBeFacade(t,s)?(this.facadeModule=t,this.facadeChunkByModule.set(t,this),this.strictFacade=!0,this.dynamicName=zr(t)):this.facadeModule===t&&!this.strictFacade&&this.canModuleBeFacade(t,s)?this.strictFacade=!0:(null===(e=this.facadeChunkByModule.get(t))||void 0===e?void 0:e.strictFacade)||(this.includedNamespaces.add(t),this.exports.add(t.namespace)));return this.outputOptions.preserveModules||this.addNecessaryImportsForFacades(),t}generateId(e,t,i,s){if(null!==this.fileName)return this.fileName;const[n,r]=this.facadeModule&&this.facadeModule.isUserDefinedEntryPoint?[t.entryFileNames,"output.entryFileNames"]:[t.chunkFileNames,"output.chunkFileNames"];return Lr(Dr("function"==typeof n?n(this.getChunkInfo()):n,r,{format:()=>t.format,hash:()=>s?this.computeContentHashWithDependencies(e,t,i):"[hash]",name:()=>this.getChunkName()}),i)}generateIdPreserveModules(e,t,i,s){const[{id:n}]=this.orderedModules,r=this.outputOptions.sanitizeFileName(n.split(jr,1)[0]);let a;const o=s.has("entryFileNames")?"[name][assetExtname].js":t.entryFileNames,l="function"==typeof o?o(this.getChunkInfo()):o;if(k(r)){const i=N(r),s=$(r),n=`${i}/${Dr(l,"output.entryFileNames",{assetExtname:()=>Vr.includes(s)?"":s,ext:()=>s.substring(1),extname:()=>s,format:()=>t.format,name:()=>this.getChunkName()})}`,{preserveModulesRoot:o}=t;a=o&&O(n).startsWith(o)?n.slice(o.length).replace(/^[\\/]/,""):T(e,n)}else{const e=$(r);a=`_virtual/${Dr(l,"output.entryFileNames",{assetExtname:()=>Vr.includes(e)?"":e,ext:()=>e.substring(1),extname:()=>e,format:()=>t.format,name:()=>le(r)})}`}return Lr(C(a),i)}getChunkInfo(){const e=this.facadeModule,t=this.getChunkName.bind(this);return{exports:this.getExportNames(),facadeModuleId:e&&e.id,isDynamicEntry:this.dynamicEntryModules.length>0,isEntry:null!==e&&e.info.isEntry,isImplicitEntry:this.implicitEntryModules.length>0,modules:this.renderedModules,get name(){return t()},type:"chunk"}}getChunkInfoWithFileNames(){return Object.assign(this.getChunkInfo(),{code:void 0,dynamicImports:Array.from(this.dynamicDependencies,Hs),fileName:this.id,implicitlyLoadedBefore:Array.from(this.implicitlyLoadedBefore,Hs),importedBindings:this.getImportedBindingsPerDependency(),imports:Array.from(this.dependencies,Hs),map:void 0,referencedFiles:this.getReferencedFiles()})}getChunkName(){var e;return null!==(e=this.name)&&void 0!==e?e:this.name=this.outputOptions.sanitizeFileName(this.getFallbackChunkName())}getExportNames(){var e;return null!==(e=this.sortedExportNames)&&void 0!==e?e:this.sortedExportNames=Array.from(this.exportsByName.keys()).sort()}getRenderedHash(){if(this.renderedHash)return this.renderedHash;const e=vr(),t=this.pluginDriver.hookReduceValueSync("augmentChunkHash","",[this.getChunkInfo()],((e,t)=>(t&&(e+=t),e)));return e.update(t),e.update(this.renderedSource.toString()),e.update(this.getExportNames().map((e=>{const t=this.exportsByName.get(e);return`${he(t.module.id).replace(/\\/g,"/")}:${t.name}:${e}`})).join(",")),this.renderedHash=e.digest("hex")}getVariableExportName(e){return this.outputOptions.preserveModules&&e instanceof js?"*":this.exportNamesByVariable.get(e)[0]}link(){this.dependencies=function(e,t,i){const s=[],n=new Set;for(let r=t.length-1;r>=0;r--){const a=t[r];if(!n.has(a)){const t=[];Tr(a,t,n,e,i),s.unshift(t)}}const r=new Set;for(const e of s)for(const t of e)r.add(t);return r}(this,this.orderedModules,this.chunkByModule);for(const e of this.orderedModules)this.addDependenciesToChunk(e.dynamicDependencies,this.dynamicDependencies),this.addDependenciesToChunk(e.implicitlyLoadedBefore,this.implicitlyLoadedBefore),this.setUpChunkImportsAndExportsForModule(e)}preRender(e,t,i){const{_:s,getPropertyAccess:n,n:r}=i,a=new b({separator:`${r}${r}`});this.usedModules=[],this.indentString=function(e,t){if(!0!==t.indent)return t.indent;for(const t of e){const e=$r(t.originalCode);if(null!==e)return e}return"\t"}(this.orderedModules,e);const o={dynamicImportFunction:e.dynamicImportFunction,exportNamesByVariable:this.exportNamesByVariable,format:e.format,freeze:e.freeze,indent:this.indentString,namespaceToStringTag:e.namespaceToStringTag,outputPluginDriver:this.pluginDriver,snippets:i};if(e.hoistTransitiveImports&&!this.outputOptions.preserveModules&&null!==this.facadeModule)for(const e of this.dependencies)e instanceof Fr&&this.inlineChunkDependencies(e);this.prepareModulesForRendering(i),this.setIdentifierRenderResolutions(e);let l="";const h=this.renderedModules;for(const t of this.orderedModules){let i=0;if(t.isIncluded()||this.includedNamespaces.has(t)){const s=t.render(o).trim();i=s.length(),i&&(e.compact&&s.lastLine().includes("//")&&s.append("\n"),this.renderedModuleSources.set(t,s),a.addSource(s),this.usedModules.push(t));const n=t.namespace;if(this.includedNamespaces.has(t)&&!this.outputOptions.preserveModules){const e=n.renderBlock(o);n.renderFirst()?l+=r+e:a.addSource(new x(e))}}const{renderedExports:s,removedExports:n}=t.getRenderedExports(),{renderedModuleSources:c}=this;h[t.id]={get code(){var e,i;return null!==(i=null===(e=c.get(t))||void 0===e?void 0:e.toString())&&void 0!==i?i:null},originalLength:t.originalCode.length,removedExports:n,renderedExports:s,renderedLength:i}}if(l&&a.prepend(l+r+r),this.needsExportsShim&&a.prepend(`${r}${i.cnst} _missingExportShim${s}=${s}void 0;${r}${r}`),e.compact?this.renderedSource=a:this.renderedSource=a.trim(),this.renderedHash=void 0,this.isEmpty&&0===this.getExportNames().length&&0===this.dependencies.size){const e=this.getChunkName();this.inputOptions.onwarn({chunkName:e,code:"EMPTY_BUNDLE",message:`Generated an empty chunk: "${e}"`})}this.setExternalRenderPaths(e,t),this.renderedDependencies=this.getChunkDependencyDeclarations(e,n),this.renderedExports="none"===this.exportMode?[]:this.getChunkExportDeclarations(e.format,n)}async render(e,t,i,s){en("render format",2);const n=e.format,r=On[n];e.dynamicImportFunction&&"es"!==n&&this.inputOptions.onwarn(xe("output.dynamicImportFunction","outputdynamicImportFunction",'this option is ignored for formats other than "es"'));for(const e of this.dependencies){const t=this.renderedDependencies.get(e);if(e instanceof $e){const i=e.renderPath;t.id=_r(e.renormalizeRenderPath?de(this.id,i,!1,!1):i)}else t.namedExportsMode="default"!==e.exportMode,t.id=_r(de(this.id,e.id,!1,!0))}this.finaliseDynamicImports(e,s),this.finaliseImportMetas(n,s);const a=0!==this.renderedExports.length||[...this.renderedDependencies.values()].some((e=>e.reexports&&0!==e.reexports.length));let o=null;const l=new Set;for(const e of this.orderedModules){e.usesTopLevelAwait&&(o=e.id);const t=this.accessedGlobalsByScope.get(e.scope);if(t)for(const e of t)l.add(e)}if(null!==o&&"es"!==n&&"system"!==n)return pe({code:"INVALID_TLA_FORMAT",id:o,message:`Module format ${n} does not support top-level await. Use the "es" or "system" output formats rather.`});if(!this.id)throw new Error("Internal Error: expecting chunk id");const c=r(this.renderedSource,{accessedGlobals:l,dependencies:[...this.renderedDependencies.values()],exports:this.renderedExports,hasExports:a,id:this.id,indent:this.indentString,intro:t.intro,isEntryFacade:this.outputOptions.preserveModules||null!==this.facadeModule&&this.facadeModule.info.isEntry,isModuleFacade:null!==this.facadeModule,namedExportsMode:"default"!==this.exportMode,outro:t.outro,snippets:s,usesTopLevelAwait:null!==o,warn:this.inputOptions.onwarn},e);t.banner&&c.prepend(t.banner),t.footer&&c.append(t.footer);const u=c.toString();tn("render format",2);let d=null;const p=[];let f=await function({code:e,options:t,outputPluginDriver:i,renderChunk:s,sourcemapChain:n}){return i.hookReduceArg0("renderChunk",[e,s,t],((e,t,i)=>{if(null==t)return e;if("string"==typeof t&&(t={code:t,map:void 0}),null!==t.map){const e=Or(t.map);n.push(e||{missing:!0,plugin:i.name})}return t.code}))}({code:u,options:e,outputPluginDriver:this.pluginDriver,renderChunk:i,sourcemapChain:p});if(e.sourcemap){let t;en("sourcemap",2),t=e.file?O(e.sourcemapFile||e.file):e.dir?O(e.dir,this.id):O(this.id);const i=c.generateDecodedMap({});d=function(e,t,i,s,n,r){const a=Dn(r),o=i.filter((e=>!e.excludeFromSourcemap)).map((e=>Ln(e.id,e.originalCode,e.originalSourcemap,e.sourcemapChain,a))),l=new Mn(t,o),c=s.reduce(a,l);let{sources:u,sourcesContent:d,names:p,mappings:f}=c.traceMappings();if(e){const t=N(e);u=u.map((e=>T(t,e))),e=_(e)}return d=n?null:d,new h({file:e,mappings:f,names:p,sources:u,sourcesContent:d})}(t,i,this.usedModules,p,e.sourcemapExcludeSources,this.inputOptions.onwarn),d.sources=d.sources.map((i=>{const{sourcemapPathTransform:s}=e;if(s){const e=s(i,`${t}.map`);return"string"!=typeof e&&pe(Ae("sourcemapPathTransform function must return a string.")),e}return i})).map(C),tn("sourcemap",2)}return e.compact||"\n"===f[f.length-1]||(f+="\n"),{code:f,map:d}}addDependenciesToChunk(e,t){for(const i of e)if(i instanceof ln){const e=this.chunkByModule.get(i);e&&e!==this&&t.add(e)}else t.add(i)}addNecessaryImportsForFacades(){for(const[e,t]of this.includedReexportsByModule)if(this.includedNamespaces.has(e))for(const e of t)this.imports.add(e)}assignFacadeName({fileName:e,name:t},i){e?this.fileName=e:this.name=this.outputOptions.sanitizeFileName(t||zr(i))}checkCircularDependencyImport(e,t){const i=e.module;if(i instanceof ln){const o=this.chunkByModule.get(i);let l;do{if(l=t.alternativeReexportModules.get(e),l){const h=this.chunkByModule.get(l);h&&h!==o&&this.inputOptions.onwarn((s=i.getExportNamesByVariable().get(e)[0],n=i.id,r=l.id,a=t.id,{code:me.CYCLIC_CROSS_CHUNK_REEXPORT,exporter:n,importer:a,message:`Export "${s}" of module ${he(n)} was reexported through module ${he(r)} while both modules are dependencies of each other and will end up in different chunks by current Rollup settings. This scenario is not well supported at the moment as it will produce a circular dependency between chunks and will likely lead to broken execution order.\nEither change the import in ${he(a)} to point directly to the exporting module or do not use "preserveModules" to ensure these modules end up in the same chunk.`,reexporter:r})),t=l}}while(l)}var s,n,r,a}computeContentHashWithDependencies(e,t,i){const s=vr();s.update([e.intro,e.outro,e.banner,e.footer].join(":")),s.update(t.format);const n=new Set([this]);for(const r of n)if(r instanceof $e?s.update(`:${r.renderPath}`):(s.update(r.getRenderedHash()),s.update(r.generateId(e,t,i,!1))),!(r instanceof $e))for(const e of[...r.dependencies,...r.dynamicDependencies])n.add(e);return s.digest("hex").substr(0,8)}ensureReexportsAreAvailableForModule(e){const t=[],i=e.getExportNamesByVariable();for(const s of i.keys()){const i=s instanceof Us,n=i?s.getBaseVariable():s;if(!(n instanceof js&&this.outputOptions.preserveModules)){this.checkCircularDependencyImport(n,e);const s=n.module;if(s instanceof ln){const e=this.chunkByModule.get(s);e&&e!==this&&(e.exports.add(n),t.push(n),i&&this.imports.add(n))}}}t.length&&this.includedReexportsByModule.set(e,t)}finaliseDynamicImports(e,t){const i="amd"===e.format&&!e.amd.forceJsExtensionForImports;for(const[e,s]of this.renderedModuleSources)for(const{node:n,resolution:r}of e.dynamicImports){const e=this.chunkByModule.get(r),a=this.facadeChunkByModule.get(r);if(!r||!n.included||e===this)continue;const o=r instanceof ln?`'${_r(de(this.id,(a||e).id,i,!0))}'`:r instanceof $e?`'${_r(r.renormalizeRenderPath?de(this.id,r.renderPath,i,!1):r.renderPath)}'`:r;n.renderFinalResolution(s,o,r instanceof ln&&!(null==a?void 0:a.strictFacade)&&e.exportNamesByVariable.get(r.namespace)[0],t)}}finaliseImportMetas(e,t){for(const[i,s]of this.renderedModuleSources)for(const n of i.importMetas)n.renderFinalMechanism(s,this.id,e,t,this.pluginDriver)}generateVariableName(){if(this.manualChunkAlias)return this.manualChunkAlias;const e=this.entryModules[0]||this.implicitEntryModules[0]||this.dynamicEntryModules[0]||this.orderedModules[this.orderedModules.length-1];return e?zr(e):"chunk"}getChunkDependencyDeclarations(e,t){const i=this.getImportSpecifiers(t),s=this.getReexportSpecifiers(),n=new Map;for(const t of this.dependencies){const r=i.get(t)||null,a=s.get(t)||null,o=t instanceof $e||"default"!==t.exportMode;n.set(t,{defaultVariableName:t.defaultVariableName,globalName:t instanceof $e&&("umd"===e.format||"iife"===e.format)&&Br(t,e.globals,null!==(r||a),this.inputOptions.onwarn),id:void 0,imports:r,isChunk:t instanceof Fr,name:t.variableName,namedExportsMode:o,namespaceVariableName:t.namespaceVariableName,reexports:a})}return n}getChunkExportDeclarations(e,t){const i=[];for(const s of this.getExportNames()){if("*"===s[0])continue;const n=this.exportsByName.get(s);if(!(n instanceof Us)){const e=n.module;if(e&&this.chunkByModule.get(e)!==this)continue}let r=null,a=!1,o=n.getName(t);if(n instanceof Dt){for(const e of n.declarations)if(e.parent instanceof qi||e instanceof Ki&&e.declaration instanceof qi){a=!0;break}}else n instanceof Us&&(r=o,"es"===e&&(o=n.renderName));i.push({exported:s,expression:r,hoisted:a,local:o})}return i}getDependenciesToBeDeconflicted(e,t,i){const s=new Set,n=new Set,r=new Set;for(const t of[...this.exportNamesByVariable.keys(),...this.imports])if(e||t.isNamespace){const a=t.module;if(a instanceof $e)s.add(a),e&&("default"===t.name?es[String(i(a.id))]&&n.add(a):"*"===t.name&&is[String(i(a.id))]&&r.add(a));else{const i=this.chunkByModule.get(a);i!==this&&(s.add(i),e&&"default"===i.exportMode&&t.isNamespace&&r.add(i))}}if(t)for(const e of this.dependencies)s.add(e);return{deconflictedDefault:n,deconflictedNamespace:r,dependencies:s}}getFallbackChunkName(){return this.manualChunkAlias?this.manualChunkAlias:this.dynamicName?this.dynamicName:this.fileName?le(this.fileName):le(this.orderedModules[this.orderedModules.length-1].id)}getImportSpecifiers(e){const{interop:t}=this.outputOptions,i=new Map;for(const s of this.imports){const n=s.module;let r,a;if(n instanceof $e){if(r=n,a=s.name,"default"!==a&&"*"!==a&&"defaultOnly"===t(n.id))return pe(ve(n.id,a,!1))}else r=this.chunkByModule.get(n),a=r.getVariableExportName(s);R(i,r,(()=>[])).push({imported:a,local:s.getName(e)})}return i}getImportedBindingsPerDependency(){const e={};for(const[t,i]of this.renderedDependencies){const s=new Set;if(i.imports)for(const{imported:e}of i.imports)s.add(e);if(i.reexports)for(const{imported:e}of i.reexports)s.add(e);e[t.id]=[...s]}return e}getReexportSpecifiers(){const{externalLiveBindings:e,interop:t}=this.outputOptions,i=new Map;for(let s of this.getExportNames()){let n,r,a=!1;if("*"===s[0]){const i=s.substring(1);"defaultOnly"===t(i)&&this.inputOptions.onwarn(Se(i)),a=e,n=this.modulesById.get(i),r=s="*"}else{const i=this.exportsByName.get(s);if(i instanceof Us)continue;const o=i.module;if(o instanceof ln){if(n=this.chunkByModule.get(o),n===this)continue;r=n.getVariableExportName(i),a=i.isReassigned}else{if(n=o,r=i.name,"default"!==r&&"*"!==r&&"defaultOnly"===t(o.id))return pe(ve(o.id,r,!0));a=e&&("default"!==r||ts(String(t(o.id)),!0))}}R(i,n,(()=>[])).push({imported:r,needsLiveBinding:a,reexported:s})}return i}getReferencedFiles(){const e=[];for(const t of this.orderedModules)for(const i of t.importMetas){const t=i.getReferencedFileName(this.pluginDriver);t&&e.push(t)}return e}inlineChunkDependencies(e){for(const t of e.dependencies)this.dependencies.has(t)||(this.dependencies.add(t),t instanceof Fr&&this.inlineChunkDependencies(t))}prepareModulesForRendering(e){var t;const i=this.accessedGlobalsByScope;for(const s of this.orderedModules){for(const{node:n,resolution:r}of s.dynamicImports)if(n.included)if(r instanceof ln){const s=this.chunkByModule.get(r);s===this?n.setInternalResolution(r.namespace):n.setExternalResolution((null===(t=this.facadeChunkByModule.get(r))||void 0===t?void 0:t.exportMode)||s.exportMode,r,this.outputOptions,e,this.pluginDriver,i)}else n.setExternalResolution("external",r,this.outputOptions,e,this.pluginDriver,i);for(const e of s.importMetas)e.addAccessedGlobals(this.outputOptions.format,i);this.includedNamespaces.has(s)&&!this.outputOptions.preserveModules&&s.namespace.prepare(i)}}setExternalRenderPaths(e,t){for(const i of[...this.dependencies,...this.dynamicDependencies])i instanceof $e&&i.setRenderPath(e,t)}setIdentifierRenderResolutions({format:e,interop:t,namespaceToStringTag:i}){const s=new Set;for(const t of this.getExportNames()){const i=this.exportsByName.get(t);"es"!==e&&"system"!==e&&i.isReassigned&&!i.isId?i.setRenderNames("exports",t):i instanceof Us?s.add(i):i.setRenderNames(null,null)}for(const e of this.orderedModules)if(e.needsExportShim){this.needsExportsShim=!0;break}const n=new Set(["Object","Promise"]);switch(this.needsExportsShim&&n.add("_missingExportShim"),i&&n.add("Symbol"),e){case"system":n.add("module").add("exports");break;case"es":break;case"cjs":n.add("module").add("require").add("__filename").add("__dirname");default:n.add("exports");for(const e of ys)n.add(e)}Ar(this.orderedModules,this.getDependenciesToBeDeconflicted("es"!==e&&"system"!==e,"amd"===e||"umd"===e||"iife"===e,t),this.imports,n,e,t,this.outputOptions.preserveModules,this.outputOptions.externalLiveBindings,this.chunkByModule,s,this.exportNamesByVariable,this.accessedGlobalsByScope,this.includedNamespaces)}setUpChunkImportsAndExportsForModule(e){const t=new Set(e.includedImports);if(!this.outputOptions.preserveModules&&this.includedNamespaces.has(e)){const i=e.namespace.getMemberVariables();for(const e of Object.values(i))t.add(e)}for(let i of t){i instanceof Ms&&(i=i.getOriginalVariable()),i instanceof Us&&(i=i.getBaseVariable());const t=this.chunkByModule.get(i.module);t!==this&&(this.imports.add(i),!(i instanceof js&&this.outputOptions.preserveModules)&&i.module instanceof ln&&(t.exports.add(i),this.checkCircularDependencyImport(i,e)))}(this.includedNamespaces.has(e)||e.info.isEntry&&!1!==e.preserveSignature||e.includedDynamicImporters.some((e=>this.chunkByModule.get(e)!==this)))&&this.ensureReexportsAreAvailableForModule(e);for(const{node:t,resolution:i}of e.dynamicImports)t.included&&i instanceof ln&&this.chunkByModule.get(i)===this&&!this.includedNamespaces.has(i)&&(this.includedNamespaces.add(i),this.ensureReexportsAreAvailableForModule(i))}}function zr(e){var t,i,s,n;return null!==(n=null!==(i=null===(t=e.chunkNames.find((({isUserDefined:e})=>e)))||void 0===t?void 0:t.name)&&void 0!==i?i:null===(s=e.chunkNames[0])||void 0===s?void 0:s.name)&&void 0!==n?n:le(e.id)}const jr=/[?#]/,Ur=(e,t)=>t?`${e}\n${t}`:e,Gr=(e,t)=>t?`${e}\n\n${t}`:e;function Hr(e,t){const i=[],s=new Set(t.keys()),n=Object.create(null);for(const[e,i]of t){Wr(e,n[i]=n[i]||[],s)}for(const[e,t]of Object.entries(n))i.push({alias:e,modules:t});const r=new Map,{dependentEntryPointsByModule:a,dynamicEntryModules:o}=function(e){const t=new Set,i=new Map,s=new Set(e);for(const e of s){const n=new Set([e]);for(const r of n){R(i,r,(()=>new Set)).add(e);for(const e of r.getDependenciesToBeIncluded())e instanceof $e||n.add(e);for(const{resolution:e}of r.dynamicImports)e instanceof ln&&e.includedDynamicImporters.length>0&&(t.add(e),s.add(e));for(const e of r.implicitlyLoadedBefore)t.add(e),s.add(e)}}return{dependentEntryPointsByModule:i,dynamicEntryModules:t}}(e),l=function(e,t){const i=new Map;for(const s of t){const t=R(i,s,(()=>new Set));for(const i of[...s.includedDynamicImporters,...s.implicitlyLoadedAfter])for(const s of e.get(i))t.add(s)}return i}(a,o),h=new Set(e);function c(e,t){const i=new Set([e]);for(const n of i){const o=R(r,n,(()=>new Set));if(!t||!u(t,a.get(n))){o.add(e);for(const e of n.getDependenciesToBeIncluded())e instanceof $e||s.has(e)||i.add(e)}}}function u(e,t){const i=new Set(e);for(const e of i)if(!t.has(e)){if(h.has(e))return!1;const t=l.get(e);for(const e of t)i.add(e)}return!0}for(const t of e)s.has(t)||c(t,null);for(const e of o)s.has(e)||c(e,l.get(e));return i.push(...function(e,t){const i=Object.create(null);for(const[s,n]of t){let t="";for(const i of e)t+=n.has(i)?"X":"_";const r=i[t];r?r.push(s):i[t]=[s]}return Object.values(i).map((e=>({alias:null,modules:e})))}([...e,...o],r)),i}function Wr(e,t,i){const s=new Set([e]);for(const e of s){i.add(e),t.push(e);for(const t of e.dependencies)t instanceof $e||i.has(t)||s.add(t)}}const qr=(e,t)=>e.execIndex>t.execIndex?1:-1;function Kr(e,t,i){const s=Symbol(e.id),n=[he(e.id)];let r=t;for(e.cycles.add(s);r!==e;)r.cycles.add(s),n.push(he(r.id)),r=i.get(r);return n.push(n[0]),n.reverse(),n}const Xr=(e,t)=>t?`(${e})`:e,Yr=/^(?!\d)[\w$]+$/;class Qr{constructor(e,t,i,s,n){this.outputOptions=e,this.unsetOptions=t,this.inputOptions=i,this.pluginDriver=s,this.graph=n,this.facadeChunkByModule=new Map,this.includedNamespaces=new Set}async generate(e){en("GENERATE",1);const t=Object.create(null),i=(e=>{const t=new Set;return new Proxy(e,{deleteProperty:(e,i)=>("string"==typeof i&&t.delete(i.toLowerCase()),Reflect.deleteProperty(e,i)),get:(e,i)=>i===Rr?t:Reflect.get(e,i),set:(e,i,s)=>("string"==typeof i&&t.add(i.toLowerCase()),Reflect.set(e,i,s))})})(t);this.pluginDriver.setOutputBundle(i,this.outputOptions,this.facadeChunkByModule);try{await this.pluginDriver.hookParallel("renderStart",[this.outputOptions,this.inputOptions]),en("generate chunks",2);const e=await this.generateChunks();e.length>1&&function(e,t){if("umd"===e.format||"iife"===e.format)return pe(xe("output.format","outputformat","UMD and IIFE output formats are not supported for code-splitting builds",e.format));if("string"==typeof e.file)return pe(xe("output.file","outputdir",'when building multiple chunks, the "output.dir" option must be used, not "output.file". To inline dynamic imports, set the "inlineDynamicImports" option'));if(e.sourcemapFile)return pe(xe("output.sourcemapFile","outputsourcemapfile",'"output.sourcemapFile" is only supported for single-file builds'));!e.amd.autoId&&e.amd.id&&t(xe("output.amd.id","outputamd",'this option is only properly supported for single-file builds. Use "output.amd.autoId" and "output.amd.basePath" instead'))}(this.outputOptions,this.inputOptions.onwarn);const t=function(e){if(0===e.length)return"/";if(1===e.length)return N(e[0]);const t=e.slice(1).reduce(((e,t)=>{const i=t.split(/\/+|\\+/);let s;for(s=0;e[s]===i[s]&&s1?t.join("/"):"/"}(function(e){const t=[];for(const i of e)for(const e of i.entryModules)k(e.id)&&t.push(e.id);return t}(e));tn("generate chunks",2),en("render modules",2);const s=await async function(e,t){try{let[i,s,n,r]=await Promise.all([t.hookReduceValue("banner",e.banner(),[],Ur),t.hookReduceValue("footer",e.footer(),[],Ur),t.hookReduceValue("intro",e.intro(),[],Gr),t.hookReduceValue("outro",e.outro(),[],Gr)]);return n&&(n+="\n\n"),r&&(r=`\n\n${r}`),i.length&&(i+="\n"),s.length&&(s="\n"+s),{banner:i,footer:s,intro:n,outro:r}}catch(e){return pe({code:"ADDON_ERROR",message:`Could not retrieve ${e.hook}. Check configuration of plugin ${e.plugin}.\n\tError Message: ${e.message}`})}}(this.outputOptions,this.pluginDriver),n=function({compact:e,generatedCode:{arrowFunctions:t,constBindings:i,objectShorthand:s,reservedNamesAsProps:n}}){const{_:r,n:a,s:o}=e?{_:"",n:"",s:""}:{_:" ",n:"\n",s:";"},l=i?"const":"var",h=(e,{isAsync:t,name:i})=>`${t?"async ":""}function${i?` ${i}`:""}${r}(${e.join(`,${r}`)})${r}`,c=t?(e,{isAsync:t,name:i})=>{const s=1===e.length;return`${i?`${l} ${i}${r}=${r}`:""}${t?`async${s?" ":r}`:""}${s?e[0]:`(${e.join(`,${r}`)})`}${r}=>${r}`}:h,u=(e,{functionReturn:i,lineBreakIndent:s,name:n})=>[`${c(e,{isAsync:!1,name:n})}${t?s?`${a}${s.base}${s.t}`:"":`{${s?`${a}${s.base}${s.t}`:r}${i?"return ":""}`}`,t?`${n?";":""}${s?`${a}${s.base}`:""}`:`${o}${s?`${a}${s.base}`:r}}`],d=n?e=>Yr.test(e):e=>!we.has(e)&&Yr.test(e);return{_:r,cnst:l,getDirectReturnFunction:u,getDirectReturnIifeLeft:(e,i,{needsArrowReturnParens:s,needsWrappedFunction:n})=>{const[r,a]=u(e,{functionReturn:!0,lineBreakIndent:null,name:null});return`${Xr(`${r}${Xr(i,t&&s)}${a}`,t||n)}(`},getFunctionIntro:c,getNonArrowFunctionIntro:h,getObject(e,{lineBreakIndent:t}){const i=t?`${a}${t.base}${t.t}`:r;return`{${e.map((([e,t])=>{if(null===e)return`${i}${t}`;const n=!d(e);return e===t&&s&&!n?i+e:`${i}${n?`'${e}'`:e}:${r}${t}`})).join(",")}${0===e.length?"":t?`${a}${t.base}`:r}}`},getPropertyAccess:e=>d(e)?`.${e}`:`[${JSON.stringify(e)}]`,n:a,s:o}}(this.outputOptions);this.prerenderChunks(e,t,n),tn("render modules",2),await this.addFinalizedChunksToBundle(e,t,s,i,n)}catch(e){throw await this.pluginDriver.hookParallel("renderError",[e]),e}return await this.pluginDriver.hookSeq("generateBundle",[this.outputOptions,i,e]),this.finaliseAssets(i),tn("GENERATE",1),t}async addFinalizedChunksToBundle(e,t,i,s,n){this.assignChunkIds(e,t,i,s);for(const t of e)s[t.id]=t.getChunkInfoWithFileNames();await Promise.all(e.map((async e=>{const t=s[e.id];Object.assign(t,await e.render(this.outputOptions,i,t,n))})))}async addManualChunks(e){const t=new Map,i=await Promise.all(Object.entries(e).map((async([e,t])=>({alias:e,entries:await this.graph.moduleLoader.addAdditionalModules(t)}))));for(const{alias:e,entries:s}of i)for(const i of s)Zr(e,i,t);return t}assignChunkIds(e,t,i,s){const n=[],r=[];for(const t of e)(t.facadeModule&&t.facadeModule.isUserDefinedEntryPoint?n:r).push(t);const a=n.concat(r);for(const e of a)this.outputOptions.file?e.id=_(this.outputOptions.file):this.outputOptions.preserveModules?e.id=e.generateIdPreserveModules(t,this.outputOptions,s,this.unsetOptions):e.id=e.generateId(i,this.outputOptions,s,!0),s[e.id]=Mr}assignManualChunks(e){const t=[],i={getModuleIds:()=>this.graph.modulesById.keys(),getModuleInfo:this.graph.getModuleInfo};for(const s of this.graph.modulesById.values())if(s instanceof ln){const n=e(s.id,i);"string"==typeof n&&t.push([n,s])}t.sort((([e],[t])=>e>t?1:e({alias:null,modules:[e]}))):Hr(this.graph.entryModules,t)){n.sort(qr);const t=new Fr(n,this.inputOptions,this.outputOptions,this.unsetOptions,this.pluginDriver,this.graph.modulesById,s,this.facadeChunkByModule,this.includedNamespaces,e);i.push(t);for(const e of n)s.set(e,t)}for(const e of i)e.link();const n=[];for(const e of i)n.push(...e.generateFacades());return[...i,...n]}prerenderChunks(e,t,i){for(const t of e)t.generateExports();for(const s of e)s.preRender(this.outputOptions,t,i)}}function Jr(e){return[...e.values()].filter((e=>e instanceof ln&&(e.isIncluded()||e.info.isEntry||e.includedDynamicImporters.length>0)))}function Zr(e,t,i){const s=i.get(t);if("string"==typeof s&&s!==e)return pe((n=t.id,r=e,a=s,{code:me.INVALID_CHUNK,message:`Cannot assign ${he(n)} to the "${r}" chunk as it is already in the "${a}" chunk.`}));var n,r,a;i.set(t,e)}var ea=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,154,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,161,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,19306,9,87,9,39,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,4706,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,262,6,10,9,357,0,62,13,1495,6,110,6,6,9,4759,9,787719,239],ta=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,68,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,85,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,190,0,80,921,103,110,18,195,2637,96,16,1070,4050,582,8634,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8936,3,2,6,2,1,2,290,46,2,18,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,482,44,11,6,17,0,322,29,19,43,1269,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4152,8,221,3,5761,15,7472,3104,541,1507,4938],ia="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢎࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೝೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲈᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꟊꟐꟑꟓꟕ-ꟙꟲ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",sa={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},na="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",ra={5:na,"5module":na+" export import",6:na+" const class extends export import super"},aa=/^in(stanceof)?$/,oa=new RegExp("["+ia+"]"),la=new RegExp("["+ia+"‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛࢘-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-ໍ໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-ᫎᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_]");function ha(e,t){for(var i=65536,s=0;se)return!1;if((i+=t[s+1])>=e)return!0}}function ca(e,t){return e<65?36===e:e<91||(e<97?95===e:e<123||(e<=65535?e>=170&&oa.test(String.fromCharCode(e)):!1!==t&&ha(e,ta)))}function ua(e,t){return e<48?36===e:e<58||!(e<65)&&(e<91||(e<97?95===e:e<123||(e<=65535?e>=170&&la.test(String.fromCharCode(e)):!1!==t&&(ha(e,ta)||ha(e,ea)))))}var da=function(e,t){void 0===t&&(t={}),this.label=e,this.keyword=t.keyword,this.beforeExpr=!!t.beforeExpr,this.startsExpr=!!t.startsExpr,this.isLoop=!!t.isLoop,this.isAssign=!!t.isAssign,this.prefix=!!t.prefix,this.postfix=!!t.postfix,this.binop=t.binop||null,this.updateContext=null};function pa(e,t){return new da(e,{beforeExpr:!0,binop:t})}var fa={beforeExpr:!0},ma={startsExpr:!0},ga={};function ya(e,t){return void 0===t&&(t={}),t.keyword=e,ga[e]=new da(e,t)}var xa={num:new da("num",ma),regexp:new da("regexp",ma),string:new da("string",ma),name:new da("name",ma),privateId:new da("privateId",ma),eof:new da("eof"),bracketL:new da("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new da("]"),braceL:new da("{",{beforeExpr:!0,startsExpr:!0}),braceR:new da("}"),parenL:new da("(",{beforeExpr:!0,startsExpr:!0}),parenR:new da(")"),comma:new da(",",fa),semi:new da(";",fa),colon:new da(":",fa),dot:new da("."),question:new da("?",fa),questionDot:new da("?."),arrow:new da("=>",fa),template:new da("template"),invalidTemplate:new da("invalidTemplate"),ellipsis:new da("...",fa),backQuote:new da("`",ma),dollarBraceL:new da("${",{beforeExpr:!0,startsExpr:!0}),eq:new da("=",{beforeExpr:!0,isAssign:!0}),assign:new da("_=",{beforeExpr:!0,isAssign:!0}),incDec:new da("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new da("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:pa("||",1),logicalAND:pa("&&",2),bitwiseOR:pa("|",3),bitwiseXOR:pa("^",4),bitwiseAND:pa("&",5),equality:pa("==/!=/===/!==",6),relational:pa("/<=/>=",7),bitShift:pa("<>/>>>",8),plusMin:new da("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:pa("%",10),star:pa("*",10),slash:pa("/",10),starstar:new da("**",{beforeExpr:!0}),coalesce:pa("??",1),_break:ya("break"),_case:ya("case",fa),_catch:ya("catch"),_continue:ya("continue"),_debugger:ya("debugger"),_default:ya("default",fa),_do:ya("do",{isLoop:!0,beforeExpr:!0}),_else:ya("else",fa),_finally:ya("finally"),_for:ya("for",{isLoop:!0}),_function:ya("function",ma),_if:ya("if"),_return:ya("return",fa),_switch:ya("switch"),_throw:ya("throw",fa),_try:ya("try"),_var:ya("var"),_const:ya("const"),_while:ya("while",{isLoop:!0}),_with:ya("with"),_new:ya("new",{beforeExpr:!0,startsExpr:!0}),_this:ya("this",ma),_super:ya("super",ma),_class:ya("class",ma),_extends:ya("extends",fa),_export:ya("export"),_import:ya("import",ma),_null:ya("null",ma),_true:ya("true",ma),_false:ya("false",ma),_in:ya("in",{beforeExpr:!0,binop:7}),_instanceof:ya("instanceof",{beforeExpr:!0,binop:7}),_typeof:ya("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:ya("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:ya("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},Ea=/\r\n?|\n|\u2028|\u2029/,ba=new RegExp(Ea.source,"g");function va(e){return 10===e||13===e||8232===e||8233===e}function Sa(e,t,i){void 0===i&&(i=e.length);for(var s=t;s>10),56320+(1023&e)))}var Ta=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,Oa=function(e,t){this.line=e,this.column=t};Oa.prototype.offset=function(e){return new Oa(this.line,this.column+e)};var Ra=function(e,t,i){this.start=t,this.end=i,null!==e.sourceFile&&(this.source=e.sourceFile)};function Ma(e,t){for(var i=1,s=0;;){var n=Sa(e,s,t);if(n<0)return new Oa(i,t-s);++i,s=n}}var Da={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},La=!1;function Va(e){var t={};for(var i in Da)t[i]=e&&Ca(e,i)?e[i]:Da[i];if("latest"===t.ecmaVersion?t.ecmaVersion=1e8:null==t.ecmaVersion?(!La&&"object"==typeof console&&console.warn&&(La=!0,console.warn("Since Acorn 8.0.0, options.ecmaVersion is required.\nDefaulting to 2020, but this will stop working in the future.")),t.ecmaVersion=11):t.ecmaVersion>=2015&&(t.ecmaVersion-=2009),null==t.allowReserved&&(t.allowReserved=t.ecmaVersion<5),_a(t.onToken)){var s=t.onToken;t.onToken=function(e){return s.push(e)}}return _a(t.onComment)&&(t.onComment=function(e,t){return function(i,s,n,r,a,o){var l={type:i?"Block":"Line",value:s,start:n,end:r};e.locations&&(l.loc=new Ra(this,a,o)),e.ranges&&(l.range=[n,r]),t.push(l)}}(t,t.onComment)),t}function Ba(e,t){return 2|(e?4:0)|(t?8:0)}var Fa=function(e,t,i){this.options=e=Va(e),this.sourceFile=e.sourceFile,this.keywords=Na(ra[e.ecmaVersion>=6?6:"module"===e.sourceType?"5module":5]);var s="";!0!==e.allowReserved&&(s=sa[e.ecmaVersion>=6?6:5===e.ecmaVersion?5:3],"module"===e.sourceType&&(s+=" await")),this.reservedWords=Na(s);var n=(s?s+" ":"")+sa.strict;this.reservedWordsStrict=Na(n),this.reservedWordsStrictBind=Na(n+" "+sa.strictBind),this.input=String(t),this.containsEsc=!1,i?(this.pos=i,this.lineStart=this.input.lastIndexOf("\n",i-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(Ea).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=xa.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule="module"===e.sourceType,this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),0===this.pos&&e.allowHashBang&&"#!"===this.input.slice(0,2)&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(1),this.regexpState=null,this.privateNameStack=[]},za={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},inClassStaticBlock:{configurable:!0}};Fa.prototype.parse=function(){var e=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(e)},za.inFunction.get=function(){return(2&this.currentVarScope().flags)>0},za.inGenerator.get=function(){return(8&this.currentVarScope().flags)>0&&!this.currentVarScope().inClassFieldInit},za.inAsync.get=function(){return(4&this.currentVarScope().flags)>0&&!this.currentVarScope().inClassFieldInit},za.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e];if(t.inClassFieldInit||256&t.flags)return!1;if(2&t.flags)return(4&t.flags)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction},za.allowSuper.get=function(){var e=this.currentThisScope(),t=e.flags,i=e.inClassFieldInit;return(64&t)>0||i||this.options.allowSuperOutsideMethod},za.allowDirectSuper.get=function(){return(128&this.currentThisScope().flags)>0},za.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},za.allowNewDotTarget.get=function(){var e=this.currentThisScope(),t=e.flags,i=e.inClassFieldInit;return(258&t)>0||i},za.inClassStaticBlock.get=function(){return(256&this.currentVarScope().flags)>0},Fa.extend=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];for(var i=this,s=0;s=,?^&]/.test(n)||"!"===n&&"="===this.input.charAt(s+1))}e+=t[0].length,Ia.lastIndex=e,e+=Ia.exec(this.input)[0].length,";"===this.input[e]&&e++}},ja.eat=function(e){return this.type===e&&(this.next(),!0)},ja.isContextual=function(e){return this.type===xa.name&&this.value===e&&!this.containsEsc},ja.eatContextual=function(e){return!!this.isContextual(e)&&(this.next(),!0)},ja.expectContextual=function(e){this.eatContextual(e)||this.unexpected()},ja.canInsertSemicolon=function(){return this.type===xa.eof||this.type===xa.braceR||Ea.test(this.input.slice(this.lastTokEnd,this.start))},ja.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},ja.semicolon=function(){this.eat(xa.semi)||this.insertSemicolon()||this.unexpected()},ja.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0},ja.expect=function(e){this.eat(e)||this.unexpected()},ja.unexpected=function(e){this.raise(null!=e?e:this.start,"Unexpected token")};var Ga=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};ja.checkPatternErrors=function(e,t){if(e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element");var i=t?e.parenthesizedAssign:e.parenthesizedBind;i>-1&&this.raiseRecoverable(i,"Parenthesized pattern")}},ja.checkExpressionErrors=function(e,t){if(!e)return!1;var i=e.shorthandAssign,s=e.doubleProto;if(!t)return i>=0||s>=0;i>=0&&this.raise(i,"Shorthand property assignments are valid only in destructuring patterns"),s>=0&&this.raiseRecoverable(s,"Redefinition of __proto__ property")},ja.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos55295&&s<56320)return!0;if(e)return!1;if(123===s)return!0;if(ca(s,!0)){for(var n=i+1;ua(s=this.input.charCodeAt(n),!0);)++n;if(92===s||s>55295&&s<56320)return!0;var r=this.input.slice(i,n);if(!aa.test(r))return!0}return!1},Ha.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;Ia.lastIndex=this.pos;var e,t=Ia.exec(this.input),i=this.pos+t[0].length;return!(Ea.test(this.input.slice(this.pos,i))||"function"!==this.input.slice(i,i+8)||i+8!==this.input.length&&(ua(e=this.input.charCodeAt(i+8))||e>55295&&e<56320))},Ha.parseStatement=function(e,t,i){var s,n=this.type,r=this.startNode();switch(this.isLet(e)&&(n=xa._var,s="let"),n){case xa._break:case xa._continue:return this.parseBreakContinueStatement(r,n.keyword);case xa._debugger:return this.parseDebuggerStatement(r);case xa._do:return this.parseDoStatement(r);case xa._for:return this.parseForStatement(r);case xa._function:return e&&(this.strict||"if"!==e&&"label"!==e)&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(r,!1,!e);case xa._class:return e&&this.unexpected(),this.parseClass(r,!0);case xa._if:return this.parseIfStatement(r);case xa._return:return this.parseReturnStatement(r);case xa._switch:return this.parseSwitchStatement(r);case xa._throw:return this.parseThrowStatement(r);case xa._try:return this.parseTryStatement(r);case xa._const:case xa._var:return s=s||this.value,e&&"var"!==s&&this.unexpected(),this.parseVarStatement(r,s);case xa._while:return this.parseWhileStatement(r);case xa._with:return this.parseWithStatement(r);case xa.braceL:return this.parseBlock(!0,r);case xa.semi:return this.parseEmptyStatement(r);case xa._export:case xa._import:if(this.options.ecmaVersion>10&&n===xa._import){Ia.lastIndex=this.pos;var a=Ia.exec(this.input),o=this.pos+a[0].length,l=this.input.charCodeAt(o);if(40===l||46===l)return this.parseExpressionStatement(r,this.parseExpression())}return this.options.allowImportExportEverywhere||(t||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),n===xa._import?this.parseImport(r):this.parseExport(r,i);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(r,!0,!e);var h=this.value,c=this.parseExpression();return n===xa.name&&"Identifier"===c.type&&this.eat(xa.colon)?this.parseLabeledStatement(r,h,c,e):this.parseExpressionStatement(r,c)}},Ha.parseBreakContinueStatement=function(e,t){var i="break"===t;this.next(),this.eat(xa.semi)||this.insertSemicolon()?e.label=null:this.type!==xa.name?this.unexpected():(e.label=this.parseIdent(),this.semicolon());for(var s=0;s=6?this.eat(xa.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")},Ha.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(Wa),this.enterScope(0),this.expect(xa.parenL),this.type===xa.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var i=this.isLet();if(this.type===xa._var||this.type===xa._const||i){var s=this.startNode(),n=i?"let":this.value;return this.next(),this.parseVar(s,!0,n),this.finishNode(s,"VariableDeclaration"),(this.type===xa._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&1===s.declarations.length?(this.options.ecmaVersion>=9&&(this.type===xa._in?t>-1&&this.unexpected(t):e.await=t>-1),this.parseForIn(e,s)):(t>-1&&this.unexpected(t),this.parseFor(e,s))}var r=this.isContextual("let"),a=!1,o=new Ga,l=this.parseExpression(!(t>-1)||"await",o);return this.type===xa._in||(a=this.options.ecmaVersion>=6&&this.isContextual("of"))?(this.options.ecmaVersion>=9&&(this.type===xa._in?t>-1&&this.unexpected(t):e.await=t>-1),r&&a&&this.raise(l.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(l,!1,o),this.checkLValPattern(l),this.parseForIn(e,l)):(this.checkExpressionErrors(o,!0),t>-1&&this.unexpected(t),this.parseFor(e,l))},Ha.parseFunctionStatement=function(e,t,i){return this.next(),this.parseFunction(e,Xa|(i?0:Ya),!1,t)},Ha.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement("if"),e.alternate=this.eat(xa._else)?this.parseStatement("if"):null,this.finishNode(e,"IfStatement")},Ha.parseReturnStatement=function(e){return this.inFunction||this.options.allowReturnOutsideFunction||this.raise(this.start,"'return' outside of function"),this.next(),this.eat(xa.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")},Ha.parseSwitchStatement=function(e){var t;this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(xa.braceL),this.labels.push(qa),this.enterScope(0);for(var i=!1;this.type!==xa.braceR;)if(this.type===xa._case||this.type===xa._default){var s=this.type===xa._case;t&&this.finishNode(t,"SwitchCase"),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),s?t.test=this.parseExpression():(i&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),i=!0,t.test=null),this.expect(xa.colon)}else t||this.unexpected(),t.consequent.push(this.parseStatement(null));return this.exitScope(),t&&this.finishNode(t,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(e,"SwitchStatement")},Ha.parseThrowStatement=function(e){return this.next(),Ea.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")};var Ka=[];Ha.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===xa._catch){var t=this.startNode();if(this.next(),this.eat(xa.parenL)){t.param=this.parseBindingAtom();var i="Identifier"===t.param.type;this.enterScope(i?32:0),this.checkLValPattern(t.param,i?4:2),this.expect(xa.parenR)}else this.options.ecmaVersion<10&&this.unexpected(),t.param=null,this.enterScope(0);t.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(t,"CatchClause")}return e.finalizer=this.eat(xa._finally)?this.parseBlock():null,e.handler||e.finalizer||this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")},Ha.parseVarStatement=function(e,t){return this.next(),this.parseVar(e,!1,t),this.semicolon(),this.finishNode(e,"VariableDeclaration")},Ha.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(Wa),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")},Ha.parseWithStatement=function(e){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement("with"),this.finishNode(e,"WithStatement")},Ha.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")},Ha.parseLabeledStatement=function(e,t,i,s){for(var n=0,r=this.labels;n=0;o--){var l=this.labels[o];if(l.statementStart!==e.start)break;l.statementStart=this.start,l.kind=a}return this.labels.push({name:t,kind:a,statementStart:this.start}),e.body=this.parseStatement(s?-1===s.indexOf("label")?s+"label":s:"label"),this.labels.pop(),e.label=i,this.finishNode(e,"LabeledStatement")},Ha.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")},Ha.parseBlock=function(e,t,i){for(void 0===e&&(e=!0),void 0===t&&(t=this.startNode()),t.body=[],this.expect(xa.braceL),e&&this.enterScope(0);this.type!==xa.braceR;){var s=this.parseStatement(null);t.body.push(s)}return i&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(t,"BlockStatement")},Ha.parseFor=function(e,t){return e.init=t,this.expect(xa.semi),e.test=this.type===xa.semi?null:this.parseExpression(),this.expect(xa.semi),e.update=this.type===xa.parenR?null:this.parseExpression(),this.expect(xa.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,"ForStatement")},Ha.parseForIn=function(e,t){var i=this.type===xa._in;return this.next(),"VariableDeclaration"===t.type&&null!=t.declarations[0].init&&(!i||this.options.ecmaVersion<8||this.strict||"var"!==t.kind||"Identifier"!==t.declarations[0].id.type)&&this.raise(t.start,(i?"for-in":"for-of")+" loop variable declaration may not have an initializer"),e.left=t,e.right=i?this.parseExpression():this.parseMaybeAssign(),this.expect(xa.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,i?"ForInStatement":"ForOfStatement")},Ha.parseVar=function(e,t,i){for(e.declarations=[],e.kind=i;;){var s=this.startNode();if(this.parseVarId(s,i),this.eat(xa.eq)?s.init=this.parseMaybeAssign(t):"const"!==i||this.type===xa._in||this.options.ecmaVersion>=6&&this.isContextual("of")?"Identifier"===s.id.type||t&&(this.type===xa._in||this.isContextual("of"))?s.init=null:this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):this.unexpected(),e.declarations.push(this.finishNode(s,"VariableDeclarator")),!this.eat(xa.comma))break}return e},Ha.parseVarId=function(e,t){e.id=this.parseBindingAtom(),this.checkLValPattern(e.id,"var"===t?1:2,!1)};var Xa=1,Ya=2;function Qa(e,t){var i=t.key.name,s=e[i],n="true";return"MethodDefinition"!==t.type||"get"!==t.kind&&"set"!==t.kind||(n=(t.static?"s":"i")+t.kind),"iget"===s&&"iset"===n||"iset"===s&&"iget"===n||"sget"===s&&"sset"===n||"sset"===s&&"sget"===n?(e[i]="true",!1):!!s||(e[i]=n,!1)}function Ja(e,t){var i=e.computed,s=e.key;return!i&&("Identifier"===s.type&&s.name===t||"Literal"===s.type&&s.value===t)}Ha.parseFunction=function(e,t,i,s,n){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!s)&&(this.type===xa.star&&t&Ya&&this.unexpected(),e.generator=this.eat(xa.star)),this.options.ecmaVersion>=8&&(e.async=!!s),t&Xa&&(e.id=4&t&&this.type!==xa.name?null:this.parseIdent(),!e.id||t&Ya||this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?1:2:3));var r=this.yieldPos,a=this.awaitPos,o=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Ba(e.async,e.generator)),t&Xa||(e.id=this.type===xa.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,i,!1,n),this.yieldPos=r,this.awaitPos=a,this.awaitIdentPos=o,this.finishNode(e,t&Xa?"FunctionDeclaration":"FunctionExpression")},Ha.parseFunctionParams=function(e){this.expect(xa.parenL),e.params=this.parseBindingList(xa.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},Ha.parseClass=function(e,t){this.next();var i=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var s=this.enterClassBody(),n=this.startNode(),r=!1;for(n.body=[],this.expect(xa.braceL);this.type!==xa.braceR;){var a=this.parseClassElement(null!==e.superClass);a&&(n.body.push(a),"MethodDefinition"===a.type&&"constructor"===a.kind?(r&&this.raise(a.start,"Duplicate constructor in the same class"),r=!0):a.key&&"PrivateIdentifier"===a.key.type&&Qa(s,a)&&this.raiseRecoverable(a.key.start,"Identifier '#"+a.key.name+"' has already been declared"))}return this.strict=i,this.next(),e.body=this.finishNode(n,"ClassBody"),this.exitClassBody(),this.finishNode(e,t?"ClassDeclaration":"ClassExpression")},Ha.parseClassElement=function(e){if(this.eat(xa.semi))return null;var t=this.options.ecmaVersion,i=this.startNode(),s="",n=!1,r=!1,a="method",o=!1;if(this.eatContextual("static")){if(t>=13&&this.eat(xa.braceL))return this.parseClassStaticBlock(i),i;this.isClassElementNameStart()||this.type===xa.star?o=!0:s="static"}if(i.static=o,!s&&t>=8&&this.eatContextual("async")&&(!this.isClassElementNameStart()&&this.type!==xa.star||this.canInsertSemicolon()?s="async":r=!0),!s&&(t>=9||!r)&&this.eat(xa.star)&&(n=!0),!s&&!r&&!n){var l=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?a=l:s=l)}if(s?(i.computed=!1,i.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),i.key.name=s,this.finishNode(i.key,"Identifier")):this.parseClassElementName(i),t<13||this.type===xa.parenL||"method"!==a||n||r){var h=!i.static&&Ja(i,"constructor"),c=h&&e;h&&"method"!==a&&this.raise(i.key.start,"Constructor can't have get/set modifier"),i.kind=h?"constructor":a,this.parseClassMethod(i,n,r,c)}else this.parseClassField(i);return i},Ha.isClassElementNameStart=function(){return this.type===xa.name||this.type===xa.privateId||this.type===xa.num||this.type===xa.string||this.type===xa.bracketL||this.type.keyword},Ha.parseClassElementName=function(e){this.type===xa.privateId?("constructor"===this.value&&this.raise(this.start,"Classes can't have an element named '#constructor'"),e.computed=!1,e.key=this.parsePrivateIdent()):this.parsePropertyName(e)},Ha.parseClassMethod=function(e,t,i,s){var n=e.key;"constructor"===e.kind?(t&&this.raise(n.start,"Constructor can't be a generator"),i&&this.raise(n.start,"Constructor can't be an async method")):e.static&&Ja(e,"prototype")&&this.raise(n.start,"Classes may not have a static property named prototype");var r=e.value=this.parseMethod(t,i,s);return"get"===e.kind&&0!==r.params.length&&this.raiseRecoverable(r.start,"getter should have no params"),"set"===e.kind&&1!==r.params.length&&this.raiseRecoverable(r.start,"setter should have exactly one param"),"set"===e.kind&&"RestElement"===r.params[0].type&&this.raiseRecoverable(r.params[0].start,"Setter cannot use rest params"),this.finishNode(e,"MethodDefinition")},Ha.parseClassField=function(e){if(Ja(e,"constructor")?this.raise(e.key.start,"Classes can't have a field named 'constructor'"):e.static&&Ja(e,"prototype")&&this.raise(e.key.start,"Classes can't have a static field named 'prototype'"),this.eat(xa.eq)){var t=this.currentThisScope(),i=t.inClassFieldInit;t.inClassFieldInit=!0,e.value=this.parseMaybeAssign(),t.inClassFieldInit=i}else e.value=null;return this.semicolon(),this.finishNode(e,"PropertyDefinition")},Ha.parseClassStaticBlock=function(e){e.body=[];var t=this.labels;for(this.labels=[],this.enterScope(320);this.type!==xa.braceR;){var i=this.parseStatement(null);e.body.push(i)}return this.next(),this.exitScope(),this.labels=t,this.finishNode(e,"StaticBlock")},Ha.parseClassId=function(e,t){this.type===xa.name?(e.id=this.parseIdent(),t&&this.checkLValSimple(e.id,2,!1)):(!0===t&&this.unexpected(),e.id=null)},Ha.parseClassSuper=function(e){e.superClass=this.eat(xa._extends)?this.parseExprSubscripts(!1):null},Ha.enterClassBody=function(){var e={declared:Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared},Ha.exitClassBody=function(){for(var e=this.privateNameStack.pop(),t=e.declared,i=e.used,s=this.privateNameStack.length,n=0===s?null:this.privateNameStack[s-1],r=0;r=11&&(this.eatContextual("as")?(e.exported=this.parseModuleExportName(),this.checkExport(t,e.exported,this.lastTokStart)):e.exported=null),this.expectContextual("from"),this.type!==xa.string&&this.unexpected(),e.source=this.parseExprAtom(),this.semicolon(),this.finishNode(e,"ExportAllDeclaration");if(this.eat(xa._default)){var i;if(this.checkExport(t,"default",this.lastTokStart),this.type===xa._function||(i=this.isAsyncFunction())){var s=this.startNode();this.next(),i&&this.next(),e.declaration=this.parseFunction(s,4|Xa,!1,i)}else if(this.type===xa._class){var n=this.startNode();e.declaration=this.parseClass(n,"nullableID")}else e.declaration=this.parseMaybeAssign(),this.semicolon();return this.finishNode(e,"ExportDefaultDeclaration")}if(this.shouldParseExportStatement())e.declaration=this.parseStatement(null),"VariableDeclaration"===e.declaration.type?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id,e.declaration.id.start),e.specifiers=[],e.source=null;else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual("from"))this.type!==xa.string&&this.unexpected(),e.source=this.parseExprAtom();else{for(var r=0,a=e.specifiers;r=13&&this.type===xa.string){var e=this.parseLiteral(this.value);return Ta.test(e.value)&&this.raise(e.start,"An export name cannot include a lone surrogate."),e}return this.parseIdent(!0)},Ha.adaptDirectivePrologue=function(e){for(var t=0;t=6&&e)switch(e.type){case"Identifier":this.inAsync&&"await"===e.name&&this.raise(e.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":e.type="ObjectPattern",i&&this.checkPatternErrors(i,!0);for(var s=0,n=e.properties;s=8&&!a&&"async"===o.name&&!this.canInsertSemicolon()&&this.eat(xa._function))return this.overrideContext(to.f_expr),this.parseFunction(this.startNodeAt(n,r),0,!1,!0,t);if(s&&!this.canInsertSemicolon()){if(this.eat(xa.arrow))return this.parseArrowExpression(this.startNodeAt(n,r),[o],!1,t);if(this.options.ecmaVersion>=8&&"async"===o.name&&this.type===xa.name&&!a&&(!this.potentialArrowInForAwait||"of"!==this.value||this.containsEsc))return o=this.parseIdent(!1),!this.canInsertSemicolon()&&this.eat(xa.arrow)||this.unexpected(),this.parseArrowExpression(this.startNodeAt(n,r),[o],!0,t)}return o;case xa.regexp:var l=this.value;return(i=this.parseLiteral(l.value)).regex={pattern:l.pattern,flags:l.flags},i;case xa.num:case xa.string:return this.parseLiteral(this.value);case xa._null:case xa._true:case xa._false:return(i=this.startNode()).value=this.type===xa._null?null:this.type===xa._true,i.raw=this.type.keyword,this.next(),this.finishNode(i,"Literal");case xa.parenL:var h=this.start,c=this.parseParenAndDistinguishExpression(s,t);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(c)&&(e.parenthesizedAssign=h),e.parenthesizedBind<0&&(e.parenthesizedBind=h)),c;case xa.bracketL:return i=this.startNode(),this.next(),i.elements=this.parseExprList(xa.bracketR,!0,!0,e),this.finishNode(i,"ArrayExpression");case xa.braceL:return this.overrideContext(to.b_expr),this.parseObj(!1,e);case xa._function:return i=this.startNode(),this.next(),this.parseFunction(i,0);case xa._class:return this.parseClass(this.startNode(),!1);case xa._new:return this.parseNew();case xa.backQuote:return this.parseTemplate();case xa._import:return this.options.ecmaVersion>=11?this.parseExprImport():this.unexpected();default:this.unexpected()}},so.parseExprImport=function(){var e=this.startNode();this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import");var t=this.parseIdent(!0);switch(this.type){case xa.parenL:return this.parseDynamicImport(e);case xa.dot:return e.meta=t,this.parseImportMeta(e);default:this.unexpected()}},so.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),!this.eat(xa.parenR)){var t=this.start;this.eat(xa.comma)&&this.eat(xa.parenR)?this.raiseRecoverable(t,"Trailing comma is not allowed in import()"):this.unexpected(t)}return this.finishNode(e,"ImportExpression")},so.parseImportMeta=function(e){this.next();var t=this.containsEsc;return e.property=this.parseIdent(!0),"meta"!==e.property.name&&this.raiseRecoverable(e.property.start,"The only valid meta property for import is 'import.meta'"),t&&this.raiseRecoverable(e.start,"'import.meta' must not contain escaped characters"),"module"===this.options.sourceType||this.options.allowImportExportEverywhere||this.raiseRecoverable(e.start,"Cannot use 'import.meta' outside a module"),this.finishNode(e,"MetaProperty")},so.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),110===t.raw.charCodeAt(t.raw.length-1)&&(t.bigint=t.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(t,"Literal")},so.parseParenExpression=function(){this.expect(xa.parenL);var e=this.parseExpression();return this.expect(xa.parenR),e},so.parseParenAndDistinguishExpression=function(e,t){var i,s=this.start,n=this.startLoc,r=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var a,o=this.start,l=this.startLoc,h=[],c=!0,u=!1,d=new Ga,p=this.yieldPos,f=this.awaitPos;for(this.yieldPos=0,this.awaitPos=0;this.type!==xa.parenR;){if(c?c=!1:this.expect(xa.comma),r&&this.afterTrailingComma(xa.parenR,!0)){u=!0;break}if(this.type===xa.ellipsis){a=this.start,h.push(this.parseParenItem(this.parseRestBinding())),this.type===xa.comma&&this.raise(this.start,"Comma is not permitted after the rest element");break}h.push(this.parseMaybeAssign(!1,d,this.parseParenItem))}var m=this.lastTokEnd,g=this.lastTokEndLoc;if(this.expect(xa.parenR),e&&!this.canInsertSemicolon()&&this.eat(xa.arrow))return this.checkPatternErrors(d,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=p,this.awaitPos=f,this.parseParenArrowList(s,n,h,t);h.length&&!u||this.unexpected(this.lastTokStart),a&&this.unexpected(a),this.checkExpressionErrors(d,!0),this.yieldPos=p||this.yieldPos,this.awaitPos=f||this.awaitPos,h.length>1?((i=this.startNodeAt(o,l)).expressions=h,this.finishNodeAt(i,"SequenceExpression",m,g)):i=h[0]}else i=this.parseParenExpression();if(this.options.preserveParens){var y=this.startNodeAt(s,n);return y.expression=i,this.finishNode(y,"ParenthesizedExpression")}return i},so.parseParenItem=function(e){return e},so.parseParenArrowList=function(e,t,i,s){return this.parseArrowExpression(this.startNodeAt(e,t),i,!1,s)};var ro=[];so.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var e=this.startNode(),t=this.parseIdent(!0);if(this.options.ecmaVersion>=6&&this.eat(xa.dot)){e.meta=t;var i=this.containsEsc;return e.property=this.parseIdent(!0),"target"!==e.property.name&&this.raiseRecoverable(e.property.start,"The only valid meta property for new is 'new.target'"),i&&this.raiseRecoverable(e.start,"'new.target' must not contain escaped characters"),this.allowNewDotTarget||this.raiseRecoverable(e.start,"'new.target' can only be used in functions and class static block"),this.finishNode(e,"MetaProperty")}var s=this.start,n=this.startLoc,r=this.type===xa._import;return e.callee=this.parseSubscripts(this.parseExprAtom(),s,n,!0,!1),r&&"ImportExpression"===e.callee.type&&this.raise(s,"Cannot use new with import()"),this.eat(xa.parenL)?e.arguments=this.parseExprList(xa.parenR,this.options.ecmaVersion>=8,!1):e.arguments=ro,this.finishNode(e,"NewExpression")},so.parseTemplateElement=function(e){var t=e.isTagged,i=this.startNode();return this.type===xa.invalidTemplate?(t||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),i.value={raw:this.value,cooked:null}):i.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,"\n"),cooked:this.value},this.next(),i.tail=this.type===xa.backQuote,this.finishNode(i,"TemplateElement")},so.parseTemplate=function(e){void 0===e&&(e={});var t=e.isTagged;void 0===t&&(t=!1);var i=this.startNode();this.next(),i.expressions=[];var s=this.parseTemplateElement({isTagged:t});for(i.quasis=[s];!s.tail;)this.type===xa.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(xa.dollarBraceL),i.expressions.push(this.parseExpression()),this.expect(xa.braceR),i.quasis.push(s=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(i,"TemplateLiteral")},so.isAsyncProp=function(e){return!e.computed&&"Identifier"===e.key.type&&"async"===e.key.name&&(this.type===xa.name||this.type===xa.num||this.type===xa.string||this.type===xa.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===xa.star)&&!Ea.test(this.input.slice(this.lastTokEnd,this.start))},so.parseObj=function(e,t){var i=this.startNode(),s=!0,n={};for(i.properties=[],this.next();!this.eat(xa.braceR);){if(s)s=!1;else if(this.expect(xa.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(xa.braceR))break;var r=this.parseProperty(e,t);e||this.checkPropClash(r,n,t),i.properties.push(r)}return this.finishNode(i,e?"ObjectPattern":"ObjectExpression")},so.parseProperty=function(e,t){var i,s,n,r,a=this.startNode();if(this.options.ecmaVersion>=9&&this.eat(xa.ellipsis))return e?(a.argument=this.parseIdent(!1),this.type===xa.comma&&this.raise(this.start,"Comma is not permitted after the rest element"),this.finishNode(a,"RestElement")):(this.type===xa.parenL&&t&&(t.parenthesizedAssign<0&&(t.parenthesizedAssign=this.start),t.parenthesizedBind<0&&(t.parenthesizedBind=this.start)),a.argument=this.parseMaybeAssign(!1,t),this.type===xa.comma&&t&&t.trailingComma<0&&(t.trailingComma=this.start),this.finishNode(a,"SpreadElement"));this.options.ecmaVersion>=6&&(a.method=!1,a.shorthand=!1,(e||t)&&(n=this.start,r=this.startLoc),e||(i=this.eat(xa.star)));var o=this.containsEsc;return this.parsePropertyName(a),!e&&!o&&this.options.ecmaVersion>=8&&!i&&this.isAsyncProp(a)?(s=!0,i=this.options.ecmaVersion>=9&&this.eat(xa.star),this.parsePropertyName(a,t)):s=!1,this.parsePropertyValue(a,e,i,s,n,r,t,o),this.finishNode(a,"Property")},so.parsePropertyValue=function(e,t,i,s,n,r,a,o){if((i||s)&&this.type===xa.colon&&this.unexpected(),this.eat(xa.colon))e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,a),e.kind="init";else if(this.options.ecmaVersion>=6&&this.type===xa.parenL)t&&this.unexpected(),e.kind="init",e.method=!0,e.value=this.parseMethod(i,s);else if(t||o||!(this.options.ecmaVersion>=5)||e.computed||"Identifier"!==e.key.type||"get"!==e.key.name&&"set"!==e.key.name||this.type===xa.comma||this.type===xa.braceR||this.type===xa.eq)this.options.ecmaVersion>=6&&!e.computed&&"Identifier"===e.key.type?((i||s)&&this.unexpected(),this.checkUnreserved(e.key),"await"!==e.key.name||this.awaitIdentPos||(this.awaitIdentPos=n),e.kind="init",t?e.value=this.parseMaybeDefault(n,r,this.copyNode(e.key)):this.type===xa.eq&&a?(a.shorthandAssign<0&&(a.shorthandAssign=this.start),e.value=this.parseMaybeDefault(n,r,this.copyNode(e.key))):e.value=this.copyNode(e.key),e.shorthand=!0):this.unexpected();else{(i||s)&&this.unexpected(),e.kind=e.key.name,this.parsePropertyName(e),e.value=this.parseMethod(!1);var l="get"===e.kind?0:1;if(e.value.params.length!==l){var h=e.value.start;"get"===e.kind?this.raiseRecoverable(h,"getter should have no params"):this.raiseRecoverable(h,"setter should have exactly one param")}else"set"===e.kind&&"RestElement"===e.value.params[0].type&&this.raiseRecoverable(e.value.params[0].start,"Setter cannot use rest params")}},so.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(xa.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(xa.bracketR),e.key;e.computed=!1}return e.key=this.type===xa.num||this.type===xa.string?this.parseExprAtom():this.parseIdent("never"!==this.options.allowReserved)},so.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)},so.parseMethod=function(e,t,i){var s=this.startNode(),n=this.yieldPos,r=this.awaitPos,a=this.awaitIdentPos;return this.initFunction(s),this.options.ecmaVersion>=6&&(s.generator=e),this.options.ecmaVersion>=8&&(s.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(64|Ba(t,s.generator)|(i?128:0)),this.expect(xa.parenL),s.params=this.parseBindingList(xa.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(s,!1,!0,!1),this.yieldPos=n,this.awaitPos=r,this.awaitIdentPos=a,this.finishNode(s,"FunctionExpression")},so.parseArrowExpression=function(e,t,i,s){var n=this.yieldPos,r=this.awaitPos,a=this.awaitIdentPos;return this.enterScope(16|Ba(i,!1)),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!i),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0,!1,s),this.yieldPos=n,this.awaitPos=r,this.awaitIdentPos=a,this.finishNode(e,"ArrowFunctionExpression")},so.parseFunctionBody=function(e,t,i,s){var n=t&&this.type!==xa.braceL,r=this.strict,a=!1;if(n)e.body=this.parseMaybeAssign(s),e.expression=!0,this.checkParams(e,!1);else{var o=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);r&&!o||(a=this.strictDirective(this.end))&&o&&this.raiseRecoverable(e.start,"Illegal 'use strict' directive in function with non-simple parameter list");var l=this.labels;this.labels=[],a&&(this.strict=!0),this.checkParams(e,!r&&!a&&!t&&!i&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLValSimple(e.id,5),e.body=this.parseBlock(!1,void 0,a&&!r),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=l}this.exitScope()},so.isSimpleParamList=function(e){for(var t=0,i=e;t-1||n.functions.indexOf(e)>-1||n.var.indexOf(e)>-1,n.lexical.push(e),this.inModule&&1&n.flags&&delete this.undefinedExports[e]}else if(4===t){this.currentScope().lexical.push(e)}else if(3===t){var r=this.currentScope();s=this.treatFunctionsAsVar?r.lexical.indexOf(e)>-1:r.lexical.indexOf(e)>-1||r.var.indexOf(e)>-1,r.functions.push(e)}else for(var a=this.scopeStack.length-1;a>=0;--a){var o=this.scopeStack[a];if(o.lexical.indexOf(e)>-1&&!(32&o.flags&&o.lexical[0]===e)||!this.treatFunctionsAsVarInScope(o)&&o.functions.indexOf(e)>-1){s=!0;break}if(o.var.push(e),this.inModule&&1&o.flags&&delete this.undefinedExports[e],259&o.flags)break}s&&this.raiseRecoverable(i,"Identifier '"+e+"' has already been declared")},oo.checkLocalExport=function(e){-1===this.scopeStack[0].lexical.indexOf(e.name)&&-1===this.scopeStack[0].var.indexOf(e.name)&&(this.undefinedExports[e.name]=e)},oo.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},oo.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(259&t.flags)return t}},oo.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(259&t.flags&&!(16&t.flags))return t}};var ho=function(e,t,i){this.type="",this.start=t,this.end=0,e.options.locations&&(this.loc=new Ra(e,i)),e.options.directSourceFile&&(this.sourceFile=e.options.directSourceFile),e.options.ranges&&(this.range=[t,0])},co=Fa.prototype;function uo(e,t,i,s){return e.type=t,e.end=i,this.options.locations&&(e.loc.end=s),this.options.ranges&&(e.range[1]=i),e}co.startNode=function(){return new ho(this,this.start,this.startLoc)},co.startNodeAt=function(e,t){return new ho(this,e,t)},co.finishNode=function(e,t){return uo.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)},co.finishNodeAt=function(e,t,i,s){return uo.call(this,e,t,i,s)},co.copyNode=function(e){var t=new ho(this,e.start,this.startLoc);for(var i in e)t[i]=e[i];return t};var po="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",fo=po+" Extended_Pictographic",mo=fo+" EBase EComp EMod EPres ExtPict",go={9:po,10:fo,11:fo,12:mo,13:"ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS Extended_Pictographic EBase EComp EMod EPres ExtPict"},yo="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",xo="Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",Eo=xo+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",bo=Eo+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",vo=bo+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",So={9:xo,10:Eo,11:bo,12:vo,13:"Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith"},Ao={};function Io(e){var t=Ao[e]={binary:Na(go[e]+" "+yo),nonBinary:{General_Category:Na(yo),Script:Na(So[e])}};t.nonBinary.Script_Extensions=t.nonBinary.Script,t.nonBinary.gc=t.nonBinary.General_Category,t.nonBinary.sc=t.nonBinary.Script,t.nonBinary.scx=t.nonBinary.Script_Extensions}for(var Po=0,ko=[9,10,11,12,13];Po=6?"uy":"")+(e.options.ecmaVersion>=9?"s":"")+(e.options.ecmaVersion>=13?"d":""),this.unicodeProperties=Ao[e.options.ecmaVersion>=13?13:e.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=[],this.backReferenceNames=[]};function _o(e){return 36===e||e>=40&&e<=43||46===e||63===e||e>=91&&e<=94||e>=123&&e<=125}function No(e){return e>=65&&e<=90||e>=97&&e<=122}function $o(e){return No(e)||95===e}function To(e){return $o(e)||Oo(e)}function Oo(e){return e>=48&&e<=57}function Ro(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function Mo(e){return e>=65&&e<=70?e-65+10:e>=97&&e<=102?e-97+10:e-48}function Do(e){return e>=48&&e<=55}Co.prototype.reset=function(e,t,i){var s=-1!==i.indexOf("u");this.start=0|e,this.source=t+"",this.flags=i,this.switchU=s&&this.parser.options.ecmaVersion>=6,this.switchN=s&&this.parser.options.ecmaVersion>=9},Co.prototype.raise=function(e){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+e)},Co.prototype.at=function(e,t){void 0===t&&(t=!1);var i=this.source,s=i.length;if(e>=s)return-1;var n=i.charCodeAt(e);if(!t&&!this.switchU||n<=55295||n>=57344||e+1>=s)return n;var r=i.charCodeAt(e+1);return r>=56320&&r<=57343?(n<<10)+r-56613888:n},Co.prototype.nextIndex=function(e,t){void 0===t&&(t=!1);var i=this.source,s=i.length;if(e>=s)return s;var n,r=i.charCodeAt(e);return!t&&!this.switchU||r<=55295||r>=57344||e+1>=s||(n=i.charCodeAt(e+1))<56320||n>57343?e+1:e+2},Co.prototype.current=function(e){return void 0===e&&(e=!1),this.at(this.pos,e)},Co.prototype.lookahead=function(e){return void 0===e&&(e=!1),this.at(this.nextIndex(this.pos,e),e)},Co.prototype.advance=function(e){void 0===e&&(e=!1),this.pos=this.nextIndex(this.pos,e)},Co.prototype.eat=function(e,t){return void 0===t&&(t=!1),this.current(t)===e&&(this.advance(t),!0)},wo.validateRegExpFlags=function(e){for(var t=e.validFlags,i=e.flags,s=0;s-1&&this.raise(e.start,"Duplicate regular expression flag")}},wo.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&e.groupNames.length>0&&(e.switchN=!0,this.regexp_pattern(e))},wo.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue="",e.lastAssertionIsQuantifiable=!1,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames.length=0,e.backReferenceNames.length=0,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise("Unmatched ')'"),(e.eat(93)||e.eat(125))&&e.raise("Lone quantifier brackets")),e.maxBackReference>e.numCapturingParens&&e.raise("Invalid escape");for(var t=0,i=e.backReferenceNames;t=9&&(i=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise("Unterminated group"),e.lastAssertionIsQuantifiable=!i,!0}return e.pos=t,!1},wo.regexp_eatQuantifier=function(e,t){return void 0===t&&(t=!1),!!this.regexp_eatQuantifierPrefix(e,t)&&(e.eat(63),!0)},wo.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)},wo.regexp_eatBracedQuantifier=function(e,t){var i=e.pos;if(e.eat(123)){var s=0,n=-1;if(this.regexp_eatDecimalDigits(e)&&(s=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(n=e.lastIntValue),e.eat(125)))return-1!==n&&n=9?this.regexp_groupSpecifier(e):63===e.current()&&e.raise("Invalid group"),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,!0;e.raise("Unterminated group")}return!1},wo.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)},wo.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise("Nothing to repeat"),!1},wo.regexp_eatSyntaxCharacter=function(e){var t=e.current();return!!_o(t)&&(e.lastIntValue=t,e.advance(),!0)},wo.regexp_eatPatternCharacters=function(e){for(var t=e.pos,i=0;-1!==(i=e.current())&&!_o(i);)e.advance();return e.pos!==t},wo.regexp_eatExtendedPatternCharacter=function(e){var t=e.current();return!(-1===t||36===t||t>=40&&t<=43||46===t||63===t||91===t||94===t||124===t)&&(e.advance(),!0)},wo.regexp_groupSpecifier=function(e){if(e.eat(63)){if(this.regexp_eatGroupName(e))return-1!==e.groupNames.indexOf(e.lastStringValue)&&e.raise("Duplicate capture group name"),void e.groupNames.push(e.lastStringValue);e.raise("Invalid group")}},wo.regexp_eatGroupName=function(e){if(e.lastStringValue="",e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62))return!0;e.raise("Invalid capture group name")}return!1},wo.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue="",this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=$a(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=$a(e.lastIntValue);return!0}return!1},wo.regexp_eatRegExpIdentifierStart=function(e){var t=e.pos,i=this.options.ecmaVersion>=11,s=e.current(i);return e.advance(i),92===s&&this.regexp_eatRegExpUnicodeEscapeSequence(e,i)&&(s=e.lastIntValue),function(e){return ca(e,!0)||36===e||95===e}(s)?(e.lastIntValue=s,!0):(e.pos=t,!1)},wo.regexp_eatRegExpIdentifierPart=function(e){var t=e.pos,i=this.options.ecmaVersion>=11,s=e.current(i);return e.advance(i),92===s&&this.regexp_eatRegExpUnicodeEscapeSequence(e,i)&&(s=e.lastIntValue),function(e){return ua(e,!0)||36===e||95===e||8204===e||8205===e}(s)?(e.lastIntValue=s,!0):(e.pos=t,!1)},wo.regexp_eatAtomEscape=function(e){return!!(this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e))||(e.switchU&&(99===e.current()&&e.raise("Invalid unicode escape"),e.raise("Invalid escape")),!1)},wo.regexp_eatBackReference=function(e){var t=e.pos;if(this.regexp_eatDecimalEscape(e)){var i=e.lastIntValue;if(e.switchU)return i>e.maxBackReference&&(e.maxBackReference=i),!0;if(i<=e.numCapturingParens)return!0;e.pos=t}return!1},wo.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise("Invalid named reference")}return!1},wo.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,!1)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)},wo.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1},wo.regexp_eatZero=function(e){return 48===e.current()&&!Oo(e.lookahead())&&(e.lastIntValue=0,e.advance(),!0)},wo.regexp_eatControlEscape=function(e){var t=e.current();return 116===t?(e.lastIntValue=9,e.advance(),!0):110===t?(e.lastIntValue=10,e.advance(),!0):118===t?(e.lastIntValue=11,e.advance(),!0):102===t?(e.lastIntValue=12,e.advance(),!0):114===t&&(e.lastIntValue=13,e.advance(),!0)},wo.regexp_eatControlLetter=function(e){var t=e.current();return!!No(t)&&(e.lastIntValue=t%32,e.advance(),!0)},wo.regexp_eatRegExpUnicodeEscapeSequence=function(e,t){void 0===t&&(t=!1);var i,s=e.pos,n=t||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var r=e.lastIntValue;if(n&&r>=55296&&r<=56319){var a=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var o=e.lastIntValue;if(o>=56320&&o<=57343)return e.lastIntValue=1024*(r-55296)+(o-56320)+65536,!0}e.pos=a,e.lastIntValue=r}return!0}if(n&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&((i=e.lastIntValue)>=0&&i<=1114111))return!0;n&&e.raise("Invalid unicode escape"),e.pos=s}return!1},wo.regexp_eatIdentityEscape=function(e){if(e.switchU)return!!this.regexp_eatSyntaxCharacter(e)||!!e.eat(47)&&(e.lastIntValue=47,!0);var t=e.current();return!(99===t||e.switchN&&107===t)&&(e.lastIntValue=t,e.advance(),!0)},wo.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var t=e.current();if(t>=49&&t<=57){do{e.lastIntValue=10*e.lastIntValue+(t-48),e.advance()}while((t=e.current())>=48&&t<=57);return!0}return!1},wo.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(function(e){return 100===e||68===e||115===e||83===e||119===e||87===e}(t))return e.lastIntValue=-1,e.advance(),!0;if(e.switchU&&this.options.ecmaVersion>=9&&(80===t||112===t)){if(e.lastIntValue=-1,e.advance(),e.eat(123)&&this.regexp_eatUnicodePropertyValueExpression(e)&&e.eat(125))return!0;e.raise("Invalid property name")}return!1},wo.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var i=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var s=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,i,s),!0}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var n=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,n),!0}return!1},wo.regexp_validateUnicodePropertyNameAndValue=function(e,t,i){Ca(e.unicodeProperties.nonBinary,t)||e.raise("Invalid property name"),e.unicodeProperties.nonBinary[t].test(i)||e.raise("Invalid property value")},wo.regexp_validateUnicodePropertyNameOrValue=function(e,t){e.unicodeProperties.binary.test(t)||e.raise("Invalid property name")},wo.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue="";$o(t=e.current());)e.lastStringValue+=$a(t),e.advance();return""!==e.lastStringValue},wo.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue="";To(t=e.current());)e.lastStringValue+=$a(t),e.advance();return""!==e.lastStringValue},wo.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)},wo.regexp_eatCharacterClass=function(e){if(e.eat(91)){if(e.eat(94),this.regexp_classRanges(e),e.eat(93))return!0;e.raise("Unterminated character class")}return!1},wo.regexp_classRanges=function(e){for(;this.regexp_eatClassAtom(e);){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var i=e.lastIntValue;!e.switchU||-1!==t&&-1!==i||e.raise("Invalid character class"),-1!==t&&-1!==i&&t>i&&e.raise("Range out of order in character class")}}},wo.regexp_eatClassAtom=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){var i=e.current();(99===i||Do(i))&&e.raise("Invalid class escape"),e.raise("Invalid escape")}e.pos=t}var s=e.current();return 93!==s&&(e.lastIntValue=s,e.advance(),!0)},wo.regexp_eatClassEscape=function(e){var t=e.pos;if(e.eat(98))return e.lastIntValue=8,!0;if(e.switchU&&e.eat(45))return e.lastIntValue=45,!0;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return!0;e.pos=t}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)},wo.regexp_eatClassControlLetter=function(e){var t=e.current();return!(!Oo(t)&&95!==t)&&(e.lastIntValue=t%32,e.advance(),!0)},wo.regexp_eatHexEscapeSequence=function(e){var t=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return!0;e.switchU&&e.raise("Invalid escape"),e.pos=t}return!1},wo.regexp_eatDecimalDigits=function(e){var t=e.pos,i=0;for(e.lastIntValue=0;Oo(i=e.current());)e.lastIntValue=10*e.lastIntValue+(i-48),e.advance();return e.pos!==t},wo.regexp_eatHexDigits=function(e){var t=e.pos,i=0;for(e.lastIntValue=0;Ro(i=e.current());)e.lastIntValue=16*e.lastIntValue+Mo(i),e.advance();return e.pos!==t},wo.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var i=e.lastIntValue;t<=3&&this.regexp_eatOctalDigit(e)?e.lastIntValue=64*t+8*i+e.lastIntValue:e.lastIntValue=8*t+i}else e.lastIntValue=t;return!0}return!1},wo.regexp_eatOctalDigit=function(e){var t=e.current();return Do(t)?(e.lastIntValue=t-48,e.advance(),!0):(e.lastIntValue=0,!1)},wo.regexp_eatFixedHexDigits=function(e,t){var i=e.pos;e.lastIntValue=0;for(var s=0;s=this.input.length?this.finishToken(xa.eof):e.override?e.override(this):void this.readToken(this.fullCharCodeAtPos())},Vo.readToken=function(e){return ca(e,this.options.ecmaVersion>=6)||92===e?this.readWord():this.getTokenFromCode(e)},Vo.fullCharCodeAtPos=function(){var e=this.input.charCodeAt(this.pos);if(e<=55295||e>=56320)return e;var t=this.input.charCodeAt(this.pos+1);return t<=56319||t>=57344?e:(e<<10)+t-56613888},Vo.skipBlockComment=function(){var e=this.options.onComment&&this.curPosition(),t=this.pos,i=this.input.indexOf("*/",this.pos+=2);if(-1===i&&this.raise(this.pos-2,"Unterminated comment"),this.pos=i+2,this.options.locations)for(var s=void 0,n=t;(s=Sa(this.input,n,this.pos))>-1;)++this.curLine,n=this.lineStart=s;this.options.onComment&&this.options.onComment(!0,this.input.slice(t+2,i),t,this.pos,e,this.curPosition())},Vo.skipLineComment=function(e){for(var t=this.pos,i=this.options.onComment&&this.curPosition(),s=this.input.charCodeAt(this.pos+=e);this.pos8&&e<14||e>=5760&&Aa.test(String.fromCharCode(e))))break e;++this.pos}}},Vo.finishToken=function(e,t){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var i=this.type;this.type=e,this.value=t,this.updateContext(i)},Vo.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var t=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&46===e&&46===t?(this.pos+=3,this.finishToken(xa.ellipsis)):(++this.pos,this.finishToken(xa.dot))},Vo.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):61===e?this.finishOp(xa.assign,2):this.finishOp(xa.slash,1)},Vo.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),i=1,s=42===e?xa.star:xa.modulo;return this.options.ecmaVersion>=7&&42===e&&42===t&&(++i,s=xa.starstar,t=this.input.charCodeAt(this.pos+2)),61===t?this.finishOp(xa.assign,i+1):this.finishOp(s,i)},Vo.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);if(t===e){if(this.options.ecmaVersion>=12)if(61===this.input.charCodeAt(this.pos+2))return this.finishOp(xa.assign,3);return this.finishOp(124===e?xa.logicalOR:xa.logicalAND,2)}return 61===t?this.finishOp(xa.assign,2):this.finishOp(124===e?xa.bitwiseOR:xa.bitwiseAND,1)},Vo.readToken_caret=function(){return 61===this.input.charCodeAt(this.pos+1)?this.finishOp(xa.assign,2):this.finishOp(xa.bitwiseXOR,1)},Vo.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?45!==t||this.inModule||62!==this.input.charCodeAt(this.pos+2)||0!==this.lastTokEnd&&!Ea.test(this.input.slice(this.lastTokEnd,this.pos))?this.finishOp(xa.incDec,2):(this.skipLineComment(3),this.skipSpace(),this.nextToken()):61===t?this.finishOp(xa.assign,2):this.finishOp(xa.plusMin,1)},Vo.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),i=1;return t===e?(i=62===e&&62===this.input.charCodeAt(this.pos+2)?3:2,61===this.input.charCodeAt(this.pos+i)?this.finishOp(xa.assign,i+1):this.finishOp(xa.bitShift,i)):33!==t||60!==e||this.inModule||45!==this.input.charCodeAt(this.pos+2)||45!==this.input.charCodeAt(this.pos+3)?(61===t&&(i=2),this.finishOp(xa.relational,i)):(this.skipLineComment(4),this.skipSpace(),this.nextToken())},Vo.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return 61===t?this.finishOp(xa.equality,61===this.input.charCodeAt(this.pos+2)?3:2):61===e&&62===t&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(xa.arrow)):this.finishOp(61===e?xa.eq:xa.prefix,1)},Vo.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var t=this.input.charCodeAt(this.pos+1);if(46===t){var i=this.input.charCodeAt(this.pos+2);if(i<48||i>57)return this.finishOp(xa.questionDot,2)}if(63===t){if(e>=12)if(61===this.input.charCodeAt(this.pos+2))return this.finishOp(xa.assign,3);return this.finishOp(xa.coalesce,2)}}return this.finishOp(xa.question,1)},Vo.readToken_numberSign=function(){var e=35;if(this.options.ecmaVersion>=13&&(++this.pos,ca(e=this.fullCharCodeAtPos(),!0)||92===e))return this.finishToken(xa.privateId,this.readWord1());this.raise(this.pos,"Unexpected character '"+$a(e)+"'")},Vo.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(xa.parenL);case 41:return++this.pos,this.finishToken(xa.parenR);case 59:return++this.pos,this.finishToken(xa.semi);case 44:return++this.pos,this.finishToken(xa.comma);case 91:return++this.pos,this.finishToken(xa.bracketL);case 93:return++this.pos,this.finishToken(xa.bracketR);case 123:return++this.pos,this.finishToken(xa.braceL);case 125:return++this.pos,this.finishToken(xa.braceR);case 58:return++this.pos,this.finishToken(xa.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(xa.backQuote);case 48:var t=this.input.charCodeAt(this.pos+1);if(120===t||88===t)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(111===t||79===t)return this.readRadixNumber(8);if(98===t||66===t)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(xa.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+$a(e)+"'")},Vo.finishOp=function(e,t){var i=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,i)},Vo.readRegexp=function(){for(var e,t,i=this.pos;;){this.pos>=this.input.length&&this.raise(i,"Unterminated regular expression");var s=this.input.charAt(this.pos);if(Ea.test(s)&&this.raise(i,"Unterminated regular expression"),e)e=!1;else{if("["===s)t=!0;else if("]"===s&&t)t=!1;else if("/"===s&&!t)break;e="\\"===s}++this.pos}var n=this.input.slice(i,this.pos);++this.pos;var r=this.pos,a=this.readWord1();this.containsEsc&&this.unexpected(r);var o=this.regexpState||(this.regexpState=new Co(this));o.reset(i,n,a),this.validateRegExpFlags(o),this.validateRegExpPattern(o);var l=null;try{l=new RegExp(n,a)}catch(e){}return this.finishToken(xa.regexp,{pattern:n,flags:a,value:l})},Vo.readInt=function(e,t,i){for(var s=this.options.ecmaVersion>=12&&void 0===t,n=i&&48===this.input.charCodeAt(this.pos),r=this.pos,a=0,o=0,l=0,h=null==t?1/0:t;l=97?c-97+10:c>=65?c-65+10:c>=48&&c<=57?c-48:1/0)>=e)break;o=c,a=a*e+u}}return s&&95===o&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===r||null!=t&&this.pos-r!==t?null:a},Vo.readRadixNumber=function(e){var t=this.pos;this.pos+=2;var i=this.readInt(e);return null==i&&this.raise(this.start+2,"Expected number in radix "+e),this.options.ecmaVersion>=11&&110===this.input.charCodeAt(this.pos)?(i=Bo(this.input.slice(t,this.pos)),++this.pos):ca(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(xa.num,i)},Vo.readNumber=function(e){var t=this.pos;e||null!==this.readInt(10,void 0,!0)||this.raise(t,"Invalid number");var i=this.pos-t>=2&&48===this.input.charCodeAt(t);i&&this.strict&&this.raise(t,"Invalid number");var s=this.input.charCodeAt(this.pos);if(!i&&!e&&this.options.ecmaVersion>=11&&110===s){var n=Bo(this.input.slice(t,this.pos));return++this.pos,ca(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(xa.num,n)}i&&/[89]/.test(this.input.slice(t,this.pos))&&(i=!1),46!==s||i||(++this.pos,this.readInt(10),s=this.input.charCodeAt(this.pos)),69!==s&&101!==s||i||(43!==(s=this.input.charCodeAt(++this.pos))&&45!==s||++this.pos,null===this.readInt(10)&&this.raise(t,"Invalid number")),ca(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var r,a=(r=this.input.slice(t,this.pos),i?parseInt(r,8):parseFloat(r.replace(/_/g,"")));return this.finishToken(xa.num,a)},Vo.readCodePoint=function(){var e;if(123===this.input.charCodeAt(this.pos)){this.options.ecmaVersion<6&&this.unexpected();var t=++this.pos;e=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,e>1114111&&this.invalidStringToken(t,"Code point out of bounds")}else e=this.readHexChar(4);return e},Vo.readString=function(e){for(var t="",i=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var s=this.input.charCodeAt(this.pos);if(s===e)break;92===s?(t+=this.input.slice(i,this.pos),t+=this.readEscapedChar(!1),i=this.pos):8232===s||8233===s?(this.options.ecmaVersion<10&&this.raise(this.start,"Unterminated string constant"),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(va(s)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return t+=this.input.slice(i,this.pos++),this.finishToken(xa.string,t)};var Fo={};Vo.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e!==Fo)throw e;this.readInvalidTemplateToken()}this.inTemplateElement=!1},Vo.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw Fo;this.raise(e,t)},Vo.readTmplToken=function(){for(var e="",t=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var i=this.input.charCodeAt(this.pos);if(96===i||36===i&&123===this.input.charCodeAt(this.pos+1))return this.pos!==this.start||this.type!==xa.template&&this.type!==xa.invalidTemplate?(e+=this.input.slice(t,this.pos),this.finishToken(xa.template,e)):36===i?(this.pos+=2,this.finishToken(xa.dollarBraceL)):(++this.pos,this.finishToken(xa.backQuote));if(92===i)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(!0),t=this.pos;else if(va(i)){switch(e+=this.input.slice(t,this.pos),++this.pos,i){case 13:10===this.input.charCodeAt(this.pos)&&++this.pos;case 10:e+="\n";break;default:e+=String.fromCharCode(i)}this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos}else++this.pos}},Vo.readInvalidTemplateToken=function(){for(;this.pos=48&&t<=55){var s=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],n=parseInt(s,8);return n>255&&(s=s.slice(0,-1),n=parseInt(s,8)),this.pos+=s.length-1,t=this.input.charCodeAt(this.pos),"0"===s&&56!==t&&57!==t||!this.strict&&!e||this.invalidStringToken(this.pos-1-s.length,e?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(n)}return va(t)?"":String.fromCharCode(t)}},Vo.readHexChar=function(e){var t=this.pos,i=this.readInt(16,e);return null===i&&this.invalidStringToken(t,"Bad character escape sequence"),i},Vo.readWord1=function(){this.containsEsc=!1;for(var e="",t=!0,i=this.pos,s=this.options.ecmaVersion>=6;this.pos()=>{pe({code:"NO_FS_IN_BROWSER",message:`Cannot access the file system (via "${e}") when using the browser build of Rollup. Make sure you supply a plugin with custom resolveId and load hooks to Rollup.`,url:"https://rollupjs.org/guide/en/#a-simple-example"})},jo={mkdir:zo("fs.mkdir"),readFile:zo("fs.readFile"),writeFile:zo("fs.writeFile")};async function Uo(e,t,i,s,n,r,a,o){const l=await function(e,t,i,s,n,r,a){let o=null,l=null;if(n){o=new Set;for(const i of n)e===i.source&&t===i.importer&&o.add(i.plugin);l=(e,t)=>({...e,resolve:(e,i,{custom:r,isEntry:a,skipSelf:o}=ie)=>s(e,i,r,a,o?[...n,{importer:i,plugin:t,source:e}]:n)})}return i.hookFirst("resolveId",[e,t,{custom:r,isEntry:a}],l,o)}(e,t,s,n,r,a,o);return null==l&&zo("path.resolve"),l}function Go(e,t,{hook:i,id:s}={}){return"string"==typeof e&&(e={message:e}),e.code&&e.code!==me.PLUGIN_ERROR&&(e.pluginCode=e.code),e.code=me.PLUGIN_ERROR,e.plugin=t,i&&(e.hook=i),s&&(e.id=s),pe(e)}const Ho=[{active:!0,deprecated:"resolveAssetUrl",replacement:"resolveFileUrl"}];const Wo={delete:()=>!1,get(){},has:()=>!1,set(){}};function qo(e){return e.startsWith("at position ")||e.startsWith("at output position ")?pe({code:"ANONYMOUS_PLUGIN_CACHE",message:"A plugin is trying to use the Rollup cache but is not declaring a plugin name or cacheKey."}):pe({code:"DUPLICATE_PLUGIN_NAME",message:`The plugin name ${e} is being used twice in the same build. Plugin names must be distinct or provide a cacheKey (please post an issue to the plugin if you are a plugin user).`})}async function Ko(e,t,i,s){const n=t.id,r=[];let a=null===e.map?null:Or(e.map);const o=e.code;let l=e.ast;const c=[],u=[];let d=!1;const p=()=>d=!0;let f="";const m=e.code;let g;try{g=await i.hookReduceArg0("transform",[m,n],(function(e,i,n){let a,o;if("string"==typeof i)a=i;else{if(!i||"object"!=typeof i)return e;if(t.updateOptions(i),null==i.code)return(i.map||i.ast)&&s(function(e){return{code:me.NO_TRANSFORM_MAP_OR_AST_WITHOUT_CODE,message:`The plugin "${e}" returned a "map" or "ast" without returning a "code". This will be ignored.`}}(n.name)),e;({code:a,map:o,ast:l}=i)}return null!==o&&r.push(Or("string"==typeof o?JSON.parse(o):o)||{missing:!0,plugin:n.name}),a}),((e,t)=>{return f=t.name,{...e,addWatchFile(t){c.push(t),e.addWatchFile(t)},cache:d?e.cache:(l=e.cache,g=p,{delete:e=>(g(),l.delete(e)),get:e=>(g(),l.get(e)),has:e=>(g(),l.has(e)),set:(e,t)=>(g(),l.set(e,t))}),emitAsset:(t,i)=>(u.push({name:t,source:i,type:"asset"}),e.emitAsset(t,i)),emitChunk:(t,i)=>(u.push({id:t,name:i&&i.name,type:"chunk"}),e.emitChunk(t,i)),emitFile:e=>(u.push(e),i.emitFile(e)),error:(t,i)=>("string"==typeof t&&(t={message:t}),i&&fe(t,i,m,n),t.id=n,t.hook="transform",e.error(t)),getCombinedSourcemap(){const e=function(e,t,i,s,n){return s.length?{version:3,...Ln(e,t,i,s,Dn(n)).traceMappings()}:i}(n,o,a,r,s);if(!e){return new x(o).generateMap({hires:!0,includeContent:!0,source:n})}return a!==e&&(a=e,r.length=0),new h({...e,file:null,sourcesContent:e.sourcesContent})},setAssetSource(){return this.error({code:"INVALID_SETASSETSOURCE",message:"setAssetSource cannot be called in transform for caching reasons. Use emitFile with a source, or call setAssetSource in another hook."})},warn(t,i){"string"==typeof t&&(t={message:t}),i&&fe(t,i,m,n),t.id=n,t.hook="transform",e.warn(t)}};var l,g}))}catch(e){Go(e,f,{hook:"transform",id:n})}return d||u.length&&(t.transformFiles=u),{ast:l,code:g,customTransformCache:d,originalCode:o,originalSourcemap:a,sourcemapChain:r,transformDependencies:c}}class Xo{constructor(e,t,i,s){this.graph=e,this.modulesById=t,this.options=i,this.pluginDriver=s,this.implicitEntryModules=new Set,this.indexedEntryModules=[],this.latestLoadModulesPromise=Promise.resolve(),this.moduleLoadPromises=new Map,this.modulesWithLoadedDependencies=new Set,this.nextChunkNamePriority=0,this.nextEntryModuleIndex=0,this.resolveId=async(e,t,i,s,n=null)=>this.getResolvedIdWithDefaults(this.getNormalizedResolvedIdWithoutDefaults(!this.options.external(e,t,!1)&&await Uo(e,t,this.options.preserveSymlinks,this.pluginDriver,this.resolveId,n,i,"boolean"==typeof s?s:!t),t,e)),this.hasModuleSideEffects=i.treeshake?i.treeshake.moduleSideEffects:()=>!0}async addAdditionalModules(e){const t=this.extendLoadModulesPromise(Promise.all(e.map((e=>this.loadEntryModule(e,!1,void 0,null)))));return await this.awaitLoadModulesPromise(),t}async addEntryModules(e,t){const i=this.nextEntryModuleIndex;this.nextEntryModuleIndex+=e.length;const s=this.nextChunkNamePriority;this.nextChunkNamePriority+=e.length;const n=await this.extendLoadModulesPromise(Promise.all(e.map((({id:e,importer:t})=>this.loadEntryModule(e,!0,t,null)))).then((n=>{for(let r=0;re.module===a));o?o.index=Math.min(o.index,i+r):this.indexedEntryModules.push({index:i+r,module:a})}return this.indexedEntryModules.sort((({index:e},{index:t})=>e>t?1:-1)),n})));return await this.awaitLoadModulesPromise(),{entryModules:this.indexedEntryModules.map((({module:e})=>e)),implicitEntryModules:[...this.implicitEntryModules],newEntryModules:n}}async emitChunk({fileName:e,id:t,importer:i,name:s,implicitlyLoadedAfterOneOf:n,preserveSignature:r}){const a={fileName:e||null,id:t,importer:i,name:s||null},o=n?await this.addEntryWithImplicitDependants(a,n):(await this.addEntryModules([a],!1)).newEntryModules[0];return null!=r&&(o.preserveSignature=r),o}async preloadModule(e){return(await this.fetchModule(this.getResolvedIdWithDefaults(e),void 0,!1,!e.resolveDependencies||"resolveDependencies")).info}addEntryWithImplicitDependants(e,t){const i=this.nextChunkNamePriority++;return this.extendLoadModulesPromise(this.loadEntryModule(e.id,!1,e.importer,null).then((async s=>{if(Qo(s,e,!1,i),!s.info.isEntry){this.implicitEntryModules.add(s);const i=await Promise.all(t.map((t=>this.loadEntryModule(t,!1,e.importer,s.id))));for(const e of i)s.implicitlyLoadedAfter.add(e);for(const e of s.implicitlyLoadedAfter)e.implicitlyLoadedBefore.add(s)}return s})))}async addModuleSource(e,t,i){let s;en("load modules",3);try{s=await this.graph.fileOperationQueue.run((async()=>{var t;return null!==(t=await this.pluginDriver.hookFirst("load",[e]))&&void 0!==t?t:await jo.readFile(e,"utf8")}))}catch(i){tn("load modules",3);let s=`Could not load ${e}`;throw t&&(s+=` (imported by ${he(t)})`),s+=`: ${i.message}`,i.message=s,i}tn("load modules",3);const n="string"==typeof s?{code:s}:null!=s&&"object"==typeof s&&"string"==typeof s.code?s:pe(function(e){return{code:me.BAD_LOADER,message:`Error loading ${he(e)}: plugin load hook should return a string, a { code, map } object, or nothing/null`}}(e)),r=this.graph.cachedModules.get(e);if(!r||r.customTransformCache||r.originalCode!==n.code||await this.pluginDriver.hookFirst("shouldTransformCachedModule",[{ast:r.ast,code:r.code,id:r.id,meta:r.meta,moduleSideEffects:r.moduleSideEffects,resolvedSources:r.resolvedIds,syntheticNamedExports:r.syntheticNamedExports}]))i.updateOptions(n),i.setSource(await Ko(n,i,this.pluginDriver,this.options.onwarn));else{if(r.transformFiles)for(const e of r.transformFiles)this.pluginDriver.emitFile(e);i.setSource(r)}}async awaitLoadModulesPromise(){let e;do{e=this.latestLoadModulesPromise,await e}while(e!==this.latestLoadModulesPromise)}extendLoadModulesPromise(e){return this.latestLoadModulesPromise=Promise.all([e,this.latestLoadModulesPromise]),this.latestLoadModulesPromise.catch((()=>{})),e}async fetchDynamicDependencies(e,t){const i=await Promise.all(t.map((t=>t.then((async([t,i])=>null===i?null:"string"==typeof i?(t.resolution=i,null):t.resolution=await this.fetchResolvedDependency(he(i.id),e.id,i))))));for(const t of i)t&&(e.dynamicDependencies.add(t),t.dynamicImporters.push(e.id))}async fetchModule({id:e,meta:t,moduleSideEffects:i,syntheticNamedExports:s},n,r,a){const o=this.modulesById.get(e);if(o instanceof ln)return await this.handleExistingModule(o,r,a),o;const l=new ln(this.graph,e,this.options,r,i,s,t);this.modulesById.set(e,l),this.graph.watchFiles[e]=!0;const h=this.addModuleSource(e,n,l).then((()=>[this.getResolveStaticDependencyPromises(l),this.getResolveDynamicImportPromises(l),c])),c=Zo(h).then((()=>this.pluginDriver.hookParallel("moduleParsed",[l.info])));c.catch((()=>{})),this.moduleLoadPromises.set(l,h);const u=await h;return a?"resolveDependencies"===a&&await c:await this.fetchModuleDependencies(l,...u),l}async fetchModuleDependencies(e,t,i,s){this.modulesWithLoadedDependencies.has(e)||(this.modulesWithLoadedDependencies.add(e),await Promise.all([this.fetchStaticDependencies(e,t),this.fetchDynamicDependencies(e,i)]),e.linkImports(),await s)}fetchResolvedDependency(e,t,i){if(i.external){const{external:s,id:n,moduleSideEffects:r,meta:a}=i;this.modulesById.has(n)||this.modulesById.set(n,new $e(this.options,n,r,a,"absolute"!==s&&k(n)));const o=this.modulesById.get(n);return o instanceof $e?Promise.resolve(o):pe(function(e,t){return{code:me.INVALID_EXTERNAL_ID,message:`'${e}' is imported as an external by ${he(t)}, but is already an existing non-external module id.`}}(e,t))}return this.fetchModule(i,t,!1,!1)}async fetchStaticDependencies(e,t){for(const i of await Promise.all(t.map((t=>t.then((([t,i])=>this.fetchResolvedDependency(t,e.id,i)))))))e.dependencies.add(i),i.importers.push(e.id);if(!this.options.treeshake||"no-treeshake"===e.info.moduleSideEffects)for(const t of e.dependencies)t instanceof ln&&(t.importedFromNotTreeshaken=!0)}getNormalizedResolvedIdWithoutDefaults(e,t,i){const{makeAbsoluteExternalsRelative:s}=this.options;if(e){if("object"==typeof e){const n=e.external||this.options.external(e.id,t,!0);return{...e,external:n&&("relative"===n||!k(e.id)||!0===n&&Jo(e.id,i,s)||"absolute")}}const n=this.options.external(e,t,!0);return{external:n&&(Jo(e,i,s)||"absolute"),id:n&&s?Yo(e,t):e}}const n=s?Yo(i,t):i;return!1===e||this.options.external(n,t,!0)?{external:Jo(n,i,s)||"absolute",id:n}:null}getResolveDynamicImportPromises(e){return e.dynamicImports.map((async t=>{const i=await this.resolveDynamicImport(e,"string"==typeof t.argument?t.argument:t.argument.esTreeNode,e.id);return i&&"object"==typeof i&&(t.id=i.id),[t,i]}))}getResolveStaticDependencyPromises(e){return Array.from(e.sources,(async t=>[t,e.resolvedIds[t]=e.resolvedIds[t]||this.handleResolveId(await this.resolveId(t,e.id,se,!1),t,e.id)]))}getResolvedIdWithDefaults(e){var t,i;if(!e)return null;const s=e.external||!1;return{external:s,id:e.id,meta:e.meta||{},moduleSideEffects:null!==(t=e.moduleSideEffects)&&void 0!==t?t:this.hasModuleSideEffects(e.id,!!s),syntheticNamedExports:null!==(i=e.syntheticNamedExports)&&void 0!==i&&i}}async handleExistingModule(e,t,i){const s=this.moduleLoadPromises.get(e);if(i)return"resolveDependencies"===i?Zo(s):s;if(t){e.info.isEntry=!0,this.implicitEntryModules.delete(e);for(const t of e.implicitlyLoadedAfter)t.implicitlyLoadedBefore.delete(e);e.implicitlyLoadedAfter.clear()}return this.fetchModuleDependencies(e,...await s)}handleResolveId(e,t,i){return null===e?w(t)?pe(function(e,t){return{code:me.UNRESOLVED_IMPORT,message:`Could not resolve '${e}' from ${he(t)}`}}(t,i)):(this.options.onwarn(function(e,t){return{code:me.UNRESOLVED_IMPORT,importer:he(t),message:`'${e}' is imported by ${he(t)}, but could not be resolved – treating it as an external dependency`,source:e,url:"https://rollupjs.org/guide/en/#warning-treating-module-as-external-dependency"}}(t,i)),{external:!0,id:t,meta:{},moduleSideEffects:this.hasModuleSideEffects(t,!0),syntheticNamedExports:!1}):(e.external&&e.syntheticNamedExports&&this.options.onwarn(function(e,t){return{code:me.EXTERNAL_SYNTHETIC_EXPORTS,importer:he(t),message:`External '${e}' can not have 'syntheticNamedExports' enabled.`,source:e}}(t,i)),e)}async loadEntryModule(e,t,i,s){const n=await Uo(e,i,this.options.preserveSymlinks,this.pluginDriver,this.resolveId,null,se,!0);return null==n?pe(null===s?function(e){return{code:me.UNRESOLVED_ENTRY,message:`Could not resolve entry module (${he(e)}).`}}(e):function(e,t){return{code:me.MISSING_IMPLICIT_DEPENDANT,message:`Module "${he(e)}" that should be implicitly loaded before "${he(t)}" could not be resolved.`}}(e,s)):!1===n||"object"==typeof n&&n.external?pe(null===s?function(e){return{code:me.UNRESOLVED_ENTRY,message:`Entry module cannot be external (${he(e)}).`}}(e):function(e,t){return{code:me.MISSING_IMPLICIT_DEPENDANT,message:`Module "${he(e)}" that should be implicitly loaded before "${he(t)}" cannot be external.`}}(e,s)):this.fetchModule(this.getResolvedIdWithDefaults("object"==typeof n?n:{id:n}),void 0,t,!1)}async resolveDynamicImport(e,t,i){var s,n;const r=await this.pluginDriver.hookFirst("resolveDynamicImport",[t,i]);return"string"!=typeof t?"string"==typeof r?r:r?{external:!1,moduleSideEffects:!0,...r}:null:null==r?null!==(s=(n=e.resolvedIds)[t])&&void 0!==s?s:n[t]=this.handleResolveId(await this.resolveId(t,e.id,se,!1),t,e.id):this.handleResolveId(this.getResolvedIdWithDefaults(this.getNormalizedResolvedIdWithoutDefaults(r,i,t)),t,i)}}function Yo(e,t){return w(e)?t?O(t,"..",e):O(e):e}function Qo(e,{fileName:t,name:i},s,n){var r;if(null!==t)e.chunkFileNames.add(t);else if(null!==i){let t=0;for(;(null===(r=e.chunkNames[t])||void 0===r?void 0:r.priority){for(const[t,i]of this.filesByReferenceId)if("asset"===i.type&&"string"!=typeof i.fileName)return pe((e=i.name||t,{code:me.ASSET_SOURCE_MISSING,message:`Plugin error creating asset "${e}" - no asset source set.`}));var e},this.emitFile=e=>function(e){return Boolean(e&&("asset"===e.type||"chunk"===e.type))}(e)?function(e){const t=e.fileName||e.name;return!t||"string"==typeof t&&!ce(t)}(e)?"chunk"===e.type?this.emitChunk(e):this.emitAsset(e):pe(Ae(`The "fileName" or "name" properties of emitted files must be strings that are neither absolute nor relative paths, received "${e.fileName||e.name}".`)):pe(Ae(`Emitted files must be of type "asset" or "chunk", received "${e&&e.type}".`)),this.getFileName=e=>{const t=this.filesByReferenceId.get(e);return t?"chunk"===t.type?nl(t,this.facadeChunkByModule):sl(t,e):pe((i=e,{code:me.FILE_NOT_FOUND,message:`Plugin error - Unable to get file name for unknown file "${i}".`}));var i},this.setAssetSource=(e,t)=>{const i=this.filesByReferenceId.get(e);if(!i)return pe((s=e,{code:me.ASSET_NOT_FOUND,message:`Plugin error - Unable to set the source for unknown asset "${s}".`}));var s,n;if("asset"!==i.type)return pe(Ae(`Asset sources can only be set for emitted assets but "${e}" is an emitted chunk.`));if(void 0!==i.source)return pe((n=i.name||e,{code:me.ASSET_SOURCE_ALREADY_SET,message:`Unable to set the source for asset "${n}", source already set.`}));const r=il(t,i,e);this.bundle?this.finalizeAsset(i,r,e,this.bundle):i.source=r},this.setOutputBundle=(e,t,i)=>{this.outputOptions=t,this.bundle=e,this.facadeChunkByModule=i;for(const{fileName:t}of this.filesByReferenceId.values())t&&tl(t,e,this.options.onwarn);for(const[t,i]of this.filesByReferenceId)"asset"===i.type&&void 0!==i.source&&this.finalizeAsset(i,i.source,t,e)},this.filesByReferenceId=i?new Map(i.filesByReferenceId):new Map}assignReferenceId(e,t){let i;do{i=vr().update(i||t).digest("hex").substring(0,8)}while(this.filesByReferenceId.has(i));return this.filesByReferenceId.set(i,e),i}emitAsset(e){const t=void 0!==e.source?il(e.source,e,null):void 0,i={fileName:e.fileName,name:e.name,source:t,type:"asset"},s=this.assignReferenceId(i,e.fileName||e.name||e.type);return this.bundle&&(e.fileName&&tl(e.fileName,this.bundle,this.options.onwarn),void 0!==t&&this.finalizeAsset(i,t,s,this.bundle)),s}emitChunk(e){if(this.graph.phase>Gs.LOAD_AND_PARSE)return pe({code:me.INVALID_ROLLUP_PHASE,message:"Cannot emit chunks after module loading has finished."});if("string"!=typeof e.id)return pe(Ae(`Emitted chunks need to have a valid string id, received "${e.id}"`));const t={fileName:e.fileName,module:null,name:e.name||e.id,type:"chunk"};return this.graph.moduleLoader.emitChunk(e).then((e=>t.module=e)).catch((()=>{})),this.assignReferenceId(t,e.id)}finalizeAsset(e,t,i,s){const n=e.fileName||function(e,t){for(const[i,s]of Object.entries(e))if("asset"===s.type&&al(t,s.source))return i;return null}(s,t)||function(e,t,i,s){const n=i.sanitizeFileName(e||"asset");return Lr(Dr("function"==typeof i.assetFileNames?i.assetFileNames({name:e,source:t,type:"asset"}):i.assetFileNames,"output.assetFileNames",{ext:()=>$(n).substring(1),extname:()=>$(n),hash:()=>vr().update(n).update(":").update(t).digest("hex").substring(0,8),name:()=>n.substring(0,n.length-$(n).length)}),s)}(e.name,t,this.outputOptions,s),r={...e,fileName:n,source:t};this.filesByReferenceId.set(i,r);const{options:a}=this;s[n]={fileName:n,get isAsset(){return Pe('Accessing "isAsset" on files in the bundle is deprecated, please use "type === \'asset\'" instead',!0,a),!0},name:e.name,source:t,type:"asset"}}}function al(e,t){if("string"==typeof e)return e===t;if("string"==typeof t)return!1;if("equals"in e)return e.equals(t);if(e.length!==t.length)return!1;for(let i=0;i(a||(a=!0,Pe({message:`The "this.${t}" plugin context function used by plugin ${s} is deprecated. The "this.${i}" plugin context function should be used instead.`,plugin:s},n,r)),e(...o))}function ll(e,t,i,s,n,r){let a,o=!0;if("string"!=typeof e.cacheKey&&(e.name.startsWith("at position ")||e.name.startsWith("at output position ")||r.has(e.name)?o=!1:r.add(e.name)),t)if(o){const i=e.cacheKey||e.name;h=t[i]||(t[i]=Object.create(null)),a={delete:e=>delete h[e],get(e){const t=h[e];if(t)return t[0]=0,t[1]},has(e){const t=h[e];return!!t&&(t[0]=0,!0)},set(e,t){h[e]=[0,t]}}}else l=e.name,a={delete:()=>qo(l),get:()=>qo(l),has:()=>qo(l),set:()=>qo(l)};else a=Wo;var l,h;return{addWatchFile(e){if(i.phase>=Gs.GENERATE)return this.error({code:me.INVALID_ROLLUP_PHASE,message:"Cannot call addWatchFile after the build has finished."});i.watchFiles[e]=!0},cache:a,emitAsset:ol(((e,t)=>n.emitFile({name:e,source:t,type:"asset"})),"emitAsset","emitFile",e.name,!0,s),emitChunk:ol(((e,t)=>n.emitFile({id:e,name:t&&t.name,type:"chunk"})),"emitChunk","emitFile",e.name,!0,s),emitFile:n.emitFile.bind(n),error:t=>Go(t,e.name),getAssetFileName:ol(n.getFileName,"getAssetFileName","getFileName",e.name,!0,s),getChunkFileName:ol(n.getFileName,"getChunkFileName","getFileName",e.name,!0,s),getFileName:n.getFileName,getModuleIds:()=>i.modulesById.keys(),getModuleInfo:i.getModuleInfo,getWatchFiles:()=>Object.keys(i.watchFiles),isExternal:ol(((e,t,i=!1)=>s.external(e,t,i)),"isExternal","resolve",e.name,!0,s),load:e=>i.moduleLoader.preloadModule(e),meta:{rollupVersion:"2.79.1",watchMode:i.watchMode},get moduleIds(){const t=i.modulesById.keys();return function*(){Pe({message:`Accessing "this.moduleIds" on the plugin context by plugin ${e.name} is deprecated. The "this.getModuleIds" plugin context function should be used instead.`,plugin:e.name},!1,s),yield*t}()},parse:i.contextParse.bind(i),resolve:(t,s,{custom:n,isEntry:r,skipSelf:a}=ie)=>i.moduleLoader.resolveId(t,s,n,r,a?[{importer:s,plugin:e,source:t}]:null),resolveId:ol(((e,t)=>i.moduleLoader.resolveId(e,t,ie,void 0).then((e=>e&&e.id))),"resolveId","resolve",e.name,!0,s),setAssetSource:n.setAssetSource,warn(t){"string"==typeof t&&(t={message:t}),t.code&&(t.pluginCode=t.code),t.code="PLUGIN_WARNING",t.plugin=e.name,s.onwarn(t)}}}const hl=Object.keys({buildEnd:1,buildStart:1,closeBundle:1,closeWatcher:1,load:1,moduleParsed:1,options:1,resolveDynamicImport:1,resolveId:1,shouldTransformCachedModule:1,transform:1,watchChange:1});class cl{constructor(e,t,i,s,n){this.graph=e,this.options=t,this.pluginCache=s,this.sortedPlugins=new Map,this.unfulfilledActions=new Set,function(e,t){for(const{active:i,deprecated:s,replacement:n}of Ho)for(const r of e)s in r&&Pe({message:`The "${s}" hook used by plugin ${r.name} is deprecated. The "${n}" hook should be used instead.`,plugin:r.name},i,t)}(i,t),this.fileEmitter=new rl(e,t,n&&n.fileEmitter),this.emitFile=this.fileEmitter.emitFile.bind(this.fileEmitter),this.getFileName=this.fileEmitter.getFileName.bind(this.fileEmitter),this.finaliseAssets=this.fileEmitter.assertAssetsFinalized.bind(this.fileEmitter),this.setOutputBundle=this.fileEmitter.setOutputBundle.bind(this.fileEmitter),this.plugins=i.concat(n?n.plugins:[]);const r=new Set;if(this.pluginContexts=new Map(this.plugins.map((i=>[i,ll(i,s,e,t,this.fileEmitter,r)]))),n)for(const e of i)for(const i of hl)i in e&&t.onwarn((a=e.name,o=i,{code:me.INPUT_HOOK_IN_OUTPUT_PLUGIN,message:`The "${o}" hook used by the output plugin ${a} is a build time hook and will not be run for that plugin. Either this plugin cannot be used as an output plugin, or it should have an option to configure it as an output plugin.`}));var a,o}createOutputPluginDriver(e){return new cl(this.graph,this.options,e,this.pluginCache,this)}getUnfulfilledHookActions(){return this.unfulfilledActions}hookFirst(e,t,i,s){let n=Promise.resolve(null);for(const r of this.getSortedPlugins(e))s&&s.has(r)||(n=n.then((s=>null!=s?s:this.runHook(e,t,r,i))));return n}hookFirstSync(e,t,i){for(const s of this.getSortedPlugins(e)){const n=this.runHookSync(e,t,s,i);if(null!=n)return n}return null}async hookParallel(e,t,i){const s=[];for(const n of this.getSortedPlugins(e))n[e].sequential?(await Promise.all(s),s.length=0,await this.runHook(e,t,n,i)):s.push(this.runHook(e,t,n,i));await Promise.all(s)}hookReduceArg0(e,[t,...i],s,n){let r=Promise.resolve(t);for(const t of this.getSortedPlugins(e))r=r.then((r=>this.runHook(e,[r,...i],t,n).then((e=>s.call(this.pluginContexts.get(t),r,e,t)))));return r}hookReduceArg0Sync(e,[t,...i],s,n){for(const r of this.getSortedPlugins(e)){const a=[t,...i],o=this.runHookSync(e,a,r,n);t=s.call(this.pluginContexts.get(r),t,o,r)}return t}async hookReduceValue(e,t,i,s){const n=[],r=[];for(const t of this.getSortedPlugins(e,pl))t[e].sequential?(n.push(...await Promise.all(r)),r.length=0,n.push(await this.runHook(e,i,t))):r.push(this.runHook(e,i,t));return n.push(...await Promise.all(r)),n.reduce(s,await t)}hookReduceValueSync(e,t,i,s,n){let r=t;for(const t of this.getSortedPlugins(e)){const a=this.runHookSync(e,i,t,n);r=s.call(this.pluginContexts.get(t),r,a,t)}return r}hookSeq(e,t,i){let s=Promise.resolve();for(const n of this.getSortedPlugins(e))s=s.then((()=>this.runHook(e,t,n,i)));return s.then(fl)}getSortedPlugins(e,t){return R(this.sortedPlugins,e,(()=>ul(e,this.plugins,t)))}runHook(e,t,i,s){const n=i[e],r="object"==typeof n?n.handler:n;let a=this.pluginContexts.get(i);s&&(a=s(a,i));let o=null;return Promise.resolve().then((()=>{if("function"!=typeof r)return r;const s=r.apply(a,t);return(null==s?void 0:s.then)?(o=[i.name,e,t],this.unfulfilledActions.add(o),Promise.resolve(s).then((e=>(this.unfulfilledActions.delete(o),e)))):s})).catch((t=>(null!==o&&this.unfulfilledActions.delete(o),Go(t,i.name,{hook:e}))))}runHookSync(e,t,i,s){const n=i[e],r="object"==typeof n?n.handler:n;let a=this.pluginContexts.get(i);s&&(a=s(a,i));try{return r.apply(a,t)}catch(t){return Go(t,i.name,{hook:e})}}}function ul(e,t,i=dl){const s=[],n=[],r=[];for(const a of t){const t=a[e];if(t){if("object"==typeof t){if(i(t.handler,e,a),"pre"===t.order){s.push(a);continue}if("post"===t.order){r.push(a);continue}}else i(t,e,a);n.push(a)}}return[...s,...n,...r]}function dl(e,t,i){"function"!=typeof e&&pe(function(e,t){return{code:me.INVALID_PLUGIN_HOOK,hook:e,message:`Error running plugin hook ${e} for plugin ${t}, expected a function hook or an object with a "handler" function.`,plugin:t}}(t,i.name))}function pl(e,t,i){if("string"!=typeof e&&"function"!=typeof e)return pe(function(e,t){return{code:me.INVALID_PLUGIN_HOOK,hook:e,message:`Error running plugin hook ${e} for plugin ${t}, expected a string, a function hook or an object with a "handler" string or function.`,plugin:t}}(t,i.name))}function fl(){}class ml{constructor(e){this.maxParallel=e,this.queue=[],this.workerCount=0}run(e){return new Promise(((t,i)=>{this.queue.push({reject:i,resolve:t,task:e}),this.work()}))}async work(){if(this.workerCount>=this.maxParallel)return;let e;for(this.workerCount++;e=this.queue.shift();){const{reject:t,resolve:i,task:s}=e;try{i(await s())}catch(e){t(e)}}this.workerCount--}}class gl{constructor(e,t){var i,s;if(this.options=e,this.cachedModules=new Map,this.deoptimizationTracker=new U,this.entryModules=[],this.modulesById=new Map,this.needsTreeshakingPass=!1,this.phase=Gs.LOAD_AND_PARSE,this.scope=new el,this.watchFiles=Object.create(null),this.watchMode=!1,this.externalModules=[],this.implicitEntryModules=[],this.modules=[],this.getModuleInfo=e=>{const t=this.modulesById.get(e);return t?t.info:null},!1!==e.cache){if(null===(i=e.cache)||void 0===i?void 0:i.modules)for(const t of e.cache.modules)this.cachedModules.set(t.id,t);this.pluginCache=(null===(s=e.cache)||void 0===s?void 0:s.plugins)||Object.create(null);for(const e in this.pluginCache){const t=this.pluginCache[e];for(const e of Object.values(t))e[0]++}}if(t){this.watchMode=!0;const e=(...e)=>this.pluginDriver.hookParallel("watchChange",e),i=()=>this.pluginDriver.hookParallel("closeWatcher",[]);t.onCurrentAwaited("change",e),t.onCurrentAwaited("close",i)}this.pluginDriver=new cl(this,e,e.plugins,this.pluginCache),this.acornParser=Fa.extend(...e.acornInjectPlugins),this.moduleLoader=new Xo(this,this.modulesById,this.options,this.pluginDriver),this.fileOperationQueue=new ml(e.maxParallelFileOps)}async build(){en("generate module graph",2),await this.generateModuleGraph(),tn("generate module graph",2),en("sort modules",2),this.phase=Gs.ANALYSE,this.sortModules(),tn("sort modules",2),en("mark included statements",2),this.includeStatements(),tn("mark included statements",2),this.phase=Gs.GENERATE}contextParse(e,t={}){const i=t.onComment,s=[];t.onComment=i&&"function"==typeof i?(e,n,r,a,...o)=>(s.push({end:a,start:r,type:e?"Block":"Line",value:n}),i.call(t,e,n,r,a,...o)):s;const n=this.acornParser.parse(e,{...this.options.acorn,...t});return"object"==typeof i&&i.push(...s),t.onComment=i,function(e,t,i){const s=[],n=[];for(const t of e)lt.test(t.value)?s.push(t):it.test(t.value)&&n.push(t);for(const e of n)ht(t,e,!1);st(t,{annotationIndex:0,annotations:s,code:i})}(s,n,e),n}getCache(){for(const e in this.pluginCache){const t=this.pluginCache[e];let i=!0;for(const[e,s]of Object.entries(t))s[0]>=this.options.experimentalCacheExpiry?delete t[e]:i=!1;i&&delete this.pluginCache[e]}return{modules:this.modules.map((e=>e.toJSON())),plugins:this.pluginCache}}async generateModuleGraph(){var e;if(({entryModules:this.entryModules,implicitEntryModules:this.implicitEntryModules}=await this.moduleLoader.addEntryModules((e=this.options.input,Array.isArray(e)?e.map((e=>({fileName:null,id:e,implicitlyLoadedAfter:[],importer:void 0,name:null}))):Object.entries(e).map((([e,t])=>({fileName:null,id:t,implicitlyLoadedAfter:[],importer:void 0,name:e})))),!0)),0===this.entryModules.length)throw new Error("You must supply options.input to rollup");for(const e of this.modulesById.values())e instanceof ln?this.modules.push(e):this.externalModules.push(e)}includeStatements(){for(const e of[...this.entryModules,...this.implicitEntryModules])rn(e);if(this.options.treeshake){let e=1;do{en(`treeshaking pass ${e}`,3),this.needsTreeshakingPass=!1;for(const e of this.modules)e.isExecuted&&("no-treeshake"===e.info.moduleSideEffects?e.includeAllInBundle():e.include());if(1===e)for(const e of[...this.entryModules,...this.implicitEntryModules])!1!==e.preserveSignature&&(e.includeAllExports(!1),this.needsTreeshakingPass=!0);tn("treeshaking pass "+e++,3)}while(this.needsTreeshakingPass)}else for(const e of this.modules)e.includeAllInBundle();for(const e of this.externalModules)e.warnUnusedImports();for(const e of this.implicitEntryModules)for(const t of e.implicitlyLoadedAfter)t.info.isEntry||t.isIncluded()||pe(be(t))}sortModules(){const{orderedModules:e,cyclePaths:t}=function(e){let t=0;const i=[],s=new Set,n=new Set,r=new Map,a=[],o=e=>{if(e instanceof ln){for(const t of e.dependencies)r.has(t)?s.has(t)||i.push(Kr(t,e,r)):(r.set(t,e),o(t));for(const t of e.implicitlyLoadedBefore)n.add(t);for(const{resolution:t}of e.dynamicImports)t instanceof ln&&n.add(t);a.push(e)}e.execIndex=t++,s.add(e)};for(const t of e)r.has(t)||(r.set(t,null),o(t));for(const e of n)r.has(e)||(r.set(e,null),o(e));return{cyclePaths:i,orderedModules:a}}(this.entryModules);for(const e of t)this.options.onwarn({code:"CIRCULAR_DEPENDENCY",cycle:e,importer:e[0],message:`Circular dependency: ${e.join(" -> ")}`});this.modules=e;for(const e of this.modules)e.bindReferences();this.warnForMissingExports()}warnForMissingExports(){for(const e of this.modules)for(const t of e.importDescriptions.values())"*"===t.name||t.module.getVariableForExportName(t.name)[0]||e.warn({code:"NON_EXISTENT_EXPORT",message:`Non-existent export '${t.name}' is imported from ${he(t.module.id)}`,name:t.name,source:t.module.id},t.start)}}function yl(e){return Array.isArray(e)?e.filter(Boolean):e?[e]:[]}function xl(e,t){return t()}const El=e=>console.warn(e.message||e);function bl(e,t,i,s,n=/$./){const r=new Set(t),a=Object.keys(e).filter((e=>!(r.has(e)||n.test(e))));a.length>0&&s({code:"UNKNOWN_OPTION",message:`Unknown ${i}: ${a.join(", ")}. Allowed options: ${[...r].sort().join(", ")}`})}const vl={recommended:{annotations:!0,correctVarValueBeforeDeclaration:!1,moduleSideEffects:()=>!0,propertyReadSideEffects:!0,tryCatchDeoptimization:!0,unknownGlobalSideEffects:!1},safest:{annotations:!0,correctVarValueBeforeDeclaration:!0,moduleSideEffects:()=>!0,propertyReadSideEffects:!0,tryCatchDeoptimization:!0,unknownGlobalSideEffects:!0},smallest:{annotations:!0,correctVarValueBeforeDeclaration:!1,moduleSideEffects:()=>!1,propertyReadSideEffects:!1,tryCatchDeoptimization:!1,unknownGlobalSideEffects:!1}},Sl={es2015:{arrowFunctions:!0,constBindings:!0,objectShorthand:!0,reservedNamesAsProps:!0,symbols:!0},es5:{arrowFunctions:!1,constBindings:!1,objectShorthand:!1,reservedNamesAsProps:!0,symbols:!1}},Al=(e,t,i,s)=>{const n=null==e?void 0:e.preset;if(n){const s=t[n];if(s)return{...s,...e};pe(xe(`${i}.preset`,Il(i),`valid values are ${oe(Object.keys(t))}`,n))}return((e,t,i)=>s=>{if("string"==typeof s){const n=e[s];if(n)return n;pe(xe(t,Il(t),`valid values are ${i}${oe(Object.keys(e))}. You can also supply an object for more fine-grained control`,s))}return(e=>e&&"object"==typeof e?e:{})(s)})(t,i,s)(e)},Il=e=>e.split(".").join("").toLowerCase();const Pl=e=>{const{onwarn:t}=e;return t?e=>{e.toString=()=>{let t="";return e.plugin&&(t+=`(${e.plugin} plugin) `),e.loc&&(t+=`${he(e.loc.file)} (${e.loc.line}:${e.loc.column}) `),t+=e.message,t},t(e,El)}:El},kl=e=>({allowAwaitOutsideFunction:!0,ecmaVersion:"latest",preserveParens:!1,sourceType:"module",...e.acorn}),wl=e=>yl(e.acornInjectPlugins),Cl=e=>{var t;return(null===(t=e.cache)||void 0===t?void 0:t.cache)||e.cache},_l=e=>{if(!0===e)return()=>!0;if("function"==typeof e)return(t,...i)=>!t.startsWith("\0")&&e(t,...i)||!1;if(e){const t=new Set,i=[];for(const s of yl(e))s instanceof RegExp?i.push(s):t.add(s);return(e,...s)=>t.has(e)||i.some((t=>t.test(e)))}return()=>!1},Nl=(e,t,i)=>{const s=e.inlineDynamicImports;return s&&ke('The "inlineDynamicImports" option is deprecated. Use the "output.inlineDynamicImports" option instead.',!1,t,i),s},$l=e=>{const t=e.input;return null==t?[]:"string"==typeof t?[t]:t},Tl=(e,t,i)=>{const s=e.manualChunks;return s&&ke('The "manualChunks" option is deprecated. Use the "output.manualChunks" option instead.',!1,t,i),s},Ol=(e,t,i)=>{var s;const n=e.maxParallelFileReads;"number"==typeof n&&ke('The "maxParallelFileReads" option is deprecated. Use the "maxParallelFileOps" option instead.',!1,t,i);const r=null!==(s=e.maxParallelFileOps)&&void 0!==s?s:n;return"number"==typeof r?r<=0?1/0:r:20},Rl=(e,t)=>{const i=e.moduleContext;if("function"==typeof i)return e=>{var s;return null!==(s=i(e))&&void 0!==s?s:t};if(i){const e=Object.create(null);for(const[t,s]of Object.entries(i))e[O(t)]=s;return i=>e[i]||t}return()=>t},Ml=(e,t)=>{const i=e.preserveEntrySignatures;return null==i&&t.add("preserveEntrySignatures"),null!=i?i:"strict"},Dl=(e,t,i)=>{const s=e.preserveModules;return s&&ke('The "preserveModules" option is deprecated. Use the "output.preserveModules" option instead.',!1,t,i),s},Ll=(e,t,i)=>{const s=e.treeshake;if(!1===s)return!1;const n=Al(e.treeshake,vl,"treeshake","false, true, ");return void 0!==n.pureExternalModules&&ke('The "treeshake.pureExternalModules" option is deprecated. The "treeshake.moduleSideEffects" option should be used instead. "treeshake.pureExternalModules: true" is equivalent to "treeshake.moduleSideEffects: \'no-external\'"',!0,t,i),{annotations:!1!==n.annotations,correctVarValueBeforeDeclaration:!0===n.correctVarValueBeforeDeclaration,moduleSideEffects:"object"==typeof s&&s.pureExternalModules?Vl(s.moduleSideEffects,s.pureExternalModules):Vl(n.moduleSideEffects,void 0),propertyReadSideEffects:"always"===n.propertyReadSideEffects?"always":!1!==n.propertyReadSideEffects,tryCatchDeoptimization:!1!==n.tryCatchDeoptimization,unknownGlobalSideEffects:!1!==n.unknownGlobalSideEffects}},Vl=(e,t)=>{if("boolean"==typeof e)return()=>e;if("no-external"===e)return(e,t)=>!t;if("function"==typeof e)return(t,i)=>!!t.startsWith("\0")||!1!==e(t,i);if(Array.isArray(e)){const t=new Set(e);return e=>t.has(e)}e&&pe(xe("treeshake.moduleSideEffects","treeshake",'please use one of false, "no-external", a function or an array'));const i=_l(t);return(e,t)=>!(t&&i(e))},Bl=/[\x00-\x1F\x7F<>*#"{}|^[\]`;?:&=+$,]/g,Fl=/^[a-z]:/i;function zl(e){const t=Fl.exec(e),i=t?t[0]:"";return i+e.substr(i.length).replace(Bl,"_")}const jl=(e,t,i)=>{const{file:s}=e;if("string"==typeof s){if(t)return pe(xe("output.file","outputdir",'you must set "output.dir" instead of "output.file" when using the "output.preserveModules" option'));if(!Array.isArray(i.input))return pe(xe("output.file","outputdir",'you must set "output.dir" instead of "output.file" when providing named inputs'))}return s},Ul=e=>{const t=e.format;switch(t){case void 0:case"es":case"esm":case"module":return"es";case"cjs":case"commonjs":return"cjs";case"system":case"systemjs":return"system";case"amd":case"iife":case"umd":return t;default:return pe({message:'You must specify "output.format", which can be one of "amd", "cjs", "system", "es", "iife" or "umd".',url:"https://rollupjs.org/guide/en/#outputformat"})}},Gl=(e,t)=>{var i;const s=(null!==(i=e.inlineDynamicImports)&&void 0!==i?i:t.inlineDynamicImports)||!1,{input:n}=t;return s&&(Array.isArray(n)?n:Object.keys(n)).length>1?pe(xe("output.inlineDynamicImports","outputinlinedynamicimports",'multiple inputs are not supported when "output.inlineDynamicImports" is true')):s},Hl=(e,t,i)=>{var s;const n=(null!==(s=e.preserveModules)&&void 0!==s?s:i.preserveModules)||!1;if(n){if(t)return pe(xe("output.inlineDynamicImports","outputinlinedynamicimports",'this option is not supported for "output.preserveModules"'));if(!1===i.preserveEntrySignatures)return pe(xe("preserveEntrySignatures","preserveentrysignatures",'setting this option to false is not supported for "output.preserveModules"'))}return n},Wl=(e,t)=>{const i=e.preferConst;return null!=i&&Pe('The "output.preferConst" option is deprecated. Use the "output.generatedCode.constBindings" option instead.',!1,t),!!i},ql=e=>{const{preserveModulesRoot:t}=e;if(null!=t)return O(t)},Kl=e=>{const t={autoId:!1,basePath:"",define:"define",forceJsExtensionForImports:!1,...e.amd};if((t.autoId||t.basePath)&&t.id)return pe(xe("output.amd.id","outputamd",'this option cannot be used together with "output.amd.autoId"/"output.amd.basePath"'));if(t.basePath&&!t.autoId)return pe(xe("output.amd.basePath","outputamd",'this option only works with "output.amd.autoId"'));let i;return i=t.autoId?{autoId:!0,basePath:t.basePath,define:t.define,forceJsExtensionForImports:t.forceJsExtensionForImports}:{autoId:!1,define:t.define,forceJsExtensionForImports:t.forceJsExtensionForImports,id:t.id},i},Xl=(e,t)=>{const i=e[t];return"function"==typeof i?i:()=>i||""},Yl=(e,t)=>{const{dir:i}=e;return"string"==typeof i&&"string"==typeof t?pe(xe("output.dir","outputdir",'you must set either "output.file" for a single-file build or "output.dir" when generating multiple chunks')):i},Ql=(e,t)=>{const i=e.dynamicImportFunction;return i&&Pe('The "output.dynamicImportFunction" option is deprecated. Use the "renderDynamicImport" plugin hook instead.',!1,t),i},Jl=(e,t)=>{const i=e.entryFileNames;return null==i&&t.add("entryFileNames"),null!=i?i:"[name].js"};function Zl(e,t){const i=e.exports;if(null==i)t.add("exports");else if(!["default","named","none","auto"].includes(i))return pe((s=i,{code:me.INVALID_EXPORT_OPTION,message:`"output.exports" must be "default", "named", "none", "auto", or left unspecified (defaults to "auto"), received "${s}"`,url:"https://rollupjs.org/guide/en/#outputexports"}));var s;return i||"auto"}const eh=(e,t)=>{const i=Al(e.generatedCode,Sl,"output.generatedCode","");return{arrowFunctions:!0===i.arrowFunctions,constBindings:!0===i.constBindings||t,objectShorthand:!0===i.objectShorthand,reservedNamesAsProps:!0===i.reservedNamesAsProps,symbols:!0===i.symbols}},th=(e,t)=>{if(t)return"";const i=e.indent;return!1===i?"":null==i||i},ih=new Set(["auto","esModule","default","defaultOnly",!0,!1]),sh=(e,t)=>{const i=e.interop,s=new Set,n=e=>{if(!s.has(e)){if(s.add(e),!ih.has(e))return pe(xe("output.interop","outputinterop",`use one of ${Array.from(ih,(e=>JSON.stringify(e))).join(", ")}`,e));"boolean"==typeof e&&Pe({message:`The boolean value "${e}" for the "output.interop" option is deprecated. Use ${e?'"auto"':'"esModule", "default" or "defaultOnly"'} instead.`,url:"https://rollupjs.org/guide/en/#outputinterop"},!1,t)}return e};if("function"==typeof i){const e=Object.create(null);let t=null;return s=>null===s?t||n(t=i(s)):s in e?e[s]:n(e[s]=i(s))}return void 0===i?()=>!0:()=>n(i)},nh=(e,t,i,s)=>{const n=e.manualChunks||s.manualChunks;if(n){if(t)return pe(xe("output.manualChunks","outputmanualchunks",'this option is not supported for "output.inlineDynamicImports"'));if(i)return pe(xe("output.manualChunks","outputmanualchunks",'this option is not supported for "output.preserveModules"'))}return n||{}},rh=(e,t,i)=>{var s;return null!==(s=e.minifyInternalExports)&&void 0!==s?s:i||"es"===t||"system"===t},ah=(e,t,i)=>{const s=e.namespaceToStringTag;return null!=s?(Pe('The "output.namespaceToStringTag" option is deprecated. Use the "output.generatedCode.symbols" option instead.',!1,i),s):t.symbols||!1},oh=e=>{const{sourcemapBaseUrl:t}=e;if(t)return function(e){try{new URL(e)}catch(e){return!1}return!0}(t)?t:pe(xe("output.sourcemapBaseUrl","outputsourcemapbaseurl",`must be a valid URL, received ${JSON.stringify(t)}`))};function lh(e){return async function(e,t){const{options:i,unsetOptions:s}=await async function(e,t){if(!e)throw new Error("You must supply an options object to rollup");const i=ul("options",yl(e.plugins)),{options:s,unsetOptions:n}=function(e){var t,i,s;const n=new Set,r=null!==(t=e.context)&&void 0!==t?t:"undefined",a=Pl(e),o=e.strictDeprecations||!1,l=Ol(e,a,o),h={acorn:kl(e),acornInjectPlugins:wl(e),cache:Cl(e),context:r,experimentalCacheExpiry:null!==(i=e.experimentalCacheExpiry)&&void 0!==i?i:10,external:_l(e.external),inlineDynamicImports:Nl(e,a,o),input:$l(e),makeAbsoluteExternalsRelative:null===(s=e.makeAbsoluteExternalsRelative)||void 0===s||s,manualChunks:Tl(e,a,o),maxParallelFileOps:l,maxParallelFileReads:l,moduleContext:Rl(e,r),onwarn:a,perf:e.perf||!1,plugins:yl(e.plugins),preserveEntrySignatures:Ml(e,n),preserveModules:Dl(e,a,o),preserveSymlinks:e.preserveSymlinks||!1,shimMissingExports:e.shimMissingExports||!1,strictDeprecations:o,treeshake:Ll(e,a,o)};return bl(e,[...Object.keys(h),"watch"],"input options",h.onwarn,/^(output)$/),{options:h,unsetOptions:n}}(await i.reduce(function(e){return async(t,i)=>{const s="handler"in i.options?i.options.handler:i.options;return await s.call({meta:{rollupVersion:"2.79.1",watchMode:e}},await t)||t}}(t),Promise.resolve(e)));return hh(s.plugins,"at position "),{options:s,unsetOptions:n}}(e,null!==t);!function(e){e.perf?(Xs=new Map,en=Qs,tn=Js,e.plugins=e.plugins.map(nn)):(en=Ks,tn=Ks)}(i);const n=new gl(i,t),r=!1!==e.cache;delete i.cache,delete e.cache,en("BUILD",1),await xl(n.pluginDriver,(async()=>{try{await n.pluginDriver.hookParallel("buildStart",[i]),await n.build()}catch(e){const t=Object.keys(n.watchFiles);throw t.length>0&&(e.watchFiles=t),await n.pluginDriver.hookParallel("buildEnd",[e]),await n.pluginDriver.hookParallel("closeBundle",[]),e}await n.pluginDriver.hookParallel("buildEnd",[])})),tn("BUILD",1);const a={cache:r?n.getCache():void 0,async close(){a.closed||(a.closed=!0,await n.pluginDriver.hookParallel("closeBundle",[]))},closed:!1,generate:async e=>a.closed?pe(Ie()):ch(!1,i,s,e,n),watchFiles:Object.keys(n.watchFiles),write:async e=>a.closed?pe(Ie()):ch(!0,i,s,e,n)};i.perf&&(a.getTimings=Zs);return a}(e,null)}function hh(e,t){e.forEach(((e,i)=>{e.name||(e.name=`${t}${i+1}`)}))}function ch(e,t,i,s,n){const{options:r,outputPluginDriver:a,unsetOptions:o}=function(e,t,i,s){if(!e)throw new Error("You must supply an options object");const n=yl(e.plugins);hh(n,"at output position ");const r=t.createOutputPluginDriver(n);return{...uh(i,s,e,r),outputPluginDriver:r}}(s,n.pluginDriver,t,i);return xl(0,(async()=>{const i=new Qr(r,o,t,a,n),s=await i.generate(e);if(e){if(!r.dir&&!r.file)return pe({code:"MISSING_OPTION",message:'You must specify "output.file" or "output.dir" for the build.'});await Promise.all(Object.values(s).map((e=>n.fileOperationQueue.run((()=>async function(e,t){const i=O(t.dir||N(t.file),e.fileName);let s,n;if(await jo.mkdir(N(i),{recursive:!0}),"asset"===e.type)n=e.source;else if(n=e.code,t.sourcemap&&e.map){let r;if("inline"===t.sourcemap)r=e.map.toUrl();else{const{sourcemapBaseUrl:n}=t,a=`${_(e.fileName)}.map`;r=n?new URL(a,n).toString():a,s=jo.writeFile(`${i}.map`,e.map.toString())}"hidden"!==t.sourcemap&&(n+=`//# sourceMappingURL=${r}\n`)}return Promise.all([jo.writeFile(i,n),s])}(e,r)))))),await a.hookParallel("writeBundle",[r,s])}return l=s,{output:Object.values(l).filter((e=>Object.keys(e).length>0)).sort(((e,t)=>ph(e)-ph(t)))};var l}))}function uh(e,t,i,s){return function(e,t,i){var s,n,r,a,o,l,h;const c=new Set(i),u=e.compact||!1,d=Ul(e),p=Gl(e,t),f=Hl(e,p,t),m=jl(e,f,t),g=Wl(e,t),y=eh(e,g),x={amd:Kl(e),assetFileNames:null!==(s=e.assetFileNames)&&void 0!==s?s:"assets/[name]-[hash][extname]",banner:Xl(e,"banner"),chunkFileNames:null!==(n=e.chunkFileNames)&&void 0!==n?n:"[name]-[hash].js",compact:u,dir:Yl(e,m),dynamicImportFunction:Ql(e,t),entryFileNames:Jl(e,c),esModule:null===(r=e.esModule)||void 0===r||r,exports:Zl(e,c),extend:e.extend||!1,externalLiveBindings:null===(a=e.externalLiveBindings)||void 0===a||a,file:m,footer:Xl(e,"footer"),format:d,freeze:null===(o=e.freeze)||void 0===o||o,generatedCode:y,globals:e.globals||{},hoistTransitiveImports:null===(l=e.hoistTransitiveImports)||void 0===l||l,indent:th(e,u),inlineDynamicImports:p,interop:sh(e,t),intro:Xl(e,"intro"),manualChunks:nh(e,p,f,t),minifyInternalExports:rh(e,d,u),name:e.name,namespaceToStringTag:ah(e,y,t),noConflict:e.noConflict||!1,outro:Xl(e,"outro"),paths:e.paths||{},plugins:yl(e.plugins),preferConst:g,preserveModules:f,preserveModulesRoot:ql(e),sanitizeFileName:"function"==typeof e.sanitizeFileName?e.sanitizeFileName:!1===e.sanitizeFileName?e=>e:zl,sourcemap:e.sourcemap||!1,sourcemapBaseUrl:oh(e),sourcemapExcludeSources:e.sourcemapExcludeSources||!1,sourcemapFile:e.sourcemapFile,sourcemapPathTransform:e.sourcemapPathTransform,strict:null===(h=e.strict)||void 0===h||h,systemNullSetters:e.systemNullSetters||!1,validate:e.validate||!1};return bl(e,Object.keys(x),"output options",t.onwarn),{options:x,unsetOptions:c}}(s.hookReduceArg0Sync("outputOptions",[i.output||i],((e,t)=>t||e),(e=>{const t=()=>e.error({code:me.CANNOT_EMIT_FROM_OPTIONS_HOOK,message:'Cannot emit files or set asset sources in the "outputOptions" hook, use the "renderStart" hook instead.'});return{...e,emitFile:t,setAssetSource:t}})),e,t)}var dh;function ph(e){return"asset"===e.type?dh.ASSET:e.isEntry?dh.ENTRY_CHUNK:dh.SECONDARY_CHUNK}function fh(e){return e}!function(e){e[e.ENTRY_CHUNK=0]="ENTRY_CHUNK",e[e.SECONDARY_CHUNK=1]="SECONDARY_CHUNK",e[e.ASSET=2]="ASSET"}(dh||(dh={}));export{e as VERSION,fh as defineConfig,lh as rollup}; diff --git a/node_modules/rollup/dist/es/rollup.js b/node_modules/rollup/dist/es/rollup.js index bad325abb4da..47892c68ee37 100644 --- a/node_modules/rollup/dist/es/rollup.js +++ b/node_modules/rollup/dist/es/rollup.js @@ -1,15 +1,16 @@ /* @license - Rollup.js v2.18.0 - Mon, 22 Jun 2020 04:16:05 GMT - commit ee6ef99935fbd24a3e30ef05b0b98e4019f983c6 - + Rollup.js v2.79.1 + Thu, 22 Sep 2022 04:55:29 GMT - commit 69ff4181e701a0fe0026d0ba147f31bc86beffa8 https://github.com/rollup/rollup Released under the MIT License. */ -export { version as VERSION, rollup, watch } from './shared/rollup.js'; +export { version as VERSION, defineConfig, rollup, watch } from './shared/rollup.js'; import 'path'; +import 'process'; +import 'perf_hooks'; import 'crypto'; import 'fs'; import 'events'; diff --git a/node_modules/rollup/dist/es/shared/rollup.js b/node_modules/rollup/dist/es/shared/rollup.js index a242f11e8738..ffc305014b63 100644 --- a/node_modules/rollup/dist/es/shared/rollup.js +++ b/node_modules/rollup/dist/es/shared/rollup.js @@ -1,24 +1,25 @@ /* @license - Rollup.js v2.18.0 - Mon, 22 Jun 2020 04:16:05 GMT - commit ee6ef99935fbd24a3e30ef05b0b98e4019f983c6 - + Rollup.js v2.79.1 + Thu, 22 Sep 2022 04:55:29 GMT - commit 69ff4181e701a0fe0026d0ba147f31bc86beffa8 https://github.com/rollup/rollup Released under the MIT License. */ -import { relative as relative$1, extname, basename, dirname, resolve } from 'path'; +import require$$0, { resolve, basename, extname, dirname, relative as relative$1, win32, posix, isAbsolute as isAbsolute$1 } from 'path'; +import process$1 from 'process'; +import { performance } from 'perf_hooks'; import { createHash as createHash$1 } from 'crypto'; -import { writeFile as writeFile$1, readdirSync, mkdirSync, readFile as readFile$1, lstatSync, realpathSync } from 'fs'; +import { promises } from 'fs'; import { EventEmitter } from 'events'; -var version = "2.18.0"; +var version$1 = "2.79.1"; var charToInteger = {}; -var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; -for (var i = 0; i < chars.length; i++) { - charToInteger[chars.charCodeAt(i)] = i; +var chars$1 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; +for (var i$1 = 0; i$1 < chars$1.length; i$1++) { + charToInteger[chars$1.charCodeAt(i$1)] = i$1; } function decode(mappings) { var decoded = []; @@ -132,209 +133,213 @@ function encodeInteger(num) { if (num > 0) { clamped |= 32; } - result += chars[clamped]; + result += chars$1[clamped]; } while (num > 0); return result; } -var BitSet = function BitSet(arg) { - this.bits = arg instanceof BitSet ? arg.bits.slice() : []; -}; - -BitSet.prototype.add = function add (n) { - this.bits[n >> 5] |= 1 << (n & 31); -}; +class BitSet { + constructor(arg) { + this.bits = arg instanceof BitSet ? arg.bits.slice() : []; + } -BitSet.prototype.has = function has (n) { - return !!(this.bits[n >> 5] & (1 << (n & 31))); -}; + add(n) { + this.bits[n >> 5] |= 1 << (n & 31); + } -var Chunk = function Chunk(start, end, content) { - this.start = start; - this.end = end; - this.original = content; + has(n) { + return !!(this.bits[n >> 5] & (1 << (n & 31))); + } +} - this.intro = ''; - this.outro = ''; +class Chunk$1 { + constructor(start, end, content) { + this.start = start; + this.end = end; + this.original = content; - this.content = content; - this.storeName = false; - this.edited = false; + this.intro = ''; + this.outro = ''; - // we make these non-enumerable, for sanity while debugging - Object.defineProperties(this, { - previous: { writable: true, value: null }, - next: { writable: true, value: null } - }); -}; + this.content = content; + this.storeName = false; + this.edited = false; -Chunk.prototype.appendLeft = function appendLeft (content) { - this.outro += content; -}; + // we make these non-enumerable, for sanity while debugging + Object.defineProperties(this, { + previous: { writable: true, value: null }, + next: { writable: true, value: null }, + }); + } -Chunk.prototype.appendRight = function appendRight (content) { - this.intro = this.intro + content; -}; + appendLeft(content) { + this.outro += content; + } -Chunk.prototype.clone = function clone () { - var chunk = new Chunk(this.start, this.end, this.original); + appendRight(content) { + this.intro = this.intro + content; + } - chunk.intro = this.intro; - chunk.outro = this.outro; - chunk.content = this.content; - chunk.storeName = this.storeName; - chunk.edited = this.edited; + clone() { + const chunk = new Chunk$1(this.start, this.end, this.original); - return chunk; -}; + chunk.intro = this.intro; + chunk.outro = this.outro; + chunk.content = this.content; + chunk.storeName = this.storeName; + chunk.edited = this.edited; -Chunk.prototype.contains = function contains (index) { - return this.start < index && index < this.end; -}; + return chunk; + } -Chunk.prototype.eachNext = function eachNext (fn) { - var chunk = this; - while (chunk) { - fn(chunk); - chunk = chunk.next; + contains(index) { + return this.start < index && index < this.end; } -}; -Chunk.prototype.eachPrevious = function eachPrevious (fn) { - var chunk = this; - while (chunk) { - fn(chunk); - chunk = chunk.previous; + eachNext(fn) { + let chunk = this; + while (chunk) { + fn(chunk); + chunk = chunk.next; + } } -}; -Chunk.prototype.edit = function edit (content, storeName, contentOnly) { - this.content = content; - if (!contentOnly) { - this.intro = ''; - this.outro = ''; + eachPrevious(fn) { + let chunk = this; + while (chunk) { + fn(chunk); + chunk = chunk.previous; + } } - this.storeName = storeName; - this.edited = true; + edit(content, storeName, contentOnly) { + this.content = content; + if (!contentOnly) { + this.intro = ''; + this.outro = ''; + } + this.storeName = storeName; - return this; -}; + this.edited = true; -Chunk.prototype.prependLeft = function prependLeft (content) { - this.outro = content + this.outro; -}; + return this; + } -Chunk.prototype.prependRight = function prependRight (content) { - this.intro = content + this.intro; -}; + prependLeft(content) { + this.outro = content + this.outro; + } -Chunk.prototype.split = function split (index) { - var sliceIndex = index - this.start; + prependRight(content) { + this.intro = content + this.intro; + } - var originalBefore = this.original.slice(0, sliceIndex); - var originalAfter = this.original.slice(sliceIndex); + split(index) { + const sliceIndex = index - this.start; - this.original = originalBefore; + const originalBefore = this.original.slice(0, sliceIndex); + const originalAfter = this.original.slice(sliceIndex); - var newChunk = new Chunk(index, this.end, originalAfter); - newChunk.outro = this.outro; - this.outro = ''; + this.original = originalBefore; - this.end = index; + const newChunk = new Chunk$1(index, this.end, originalAfter); + newChunk.outro = this.outro; + this.outro = ''; - if (this.edited) { - // TODO is this block necessary?... - newChunk.edit('', false); - this.content = ''; - } else { - this.content = originalBefore; - } + this.end = index; - newChunk.next = this.next; - if (newChunk.next) { newChunk.next.previous = newChunk; } - newChunk.previous = this; - this.next = newChunk; + if (this.edited) { + // TODO is this block necessary?... + newChunk.edit('', false); + this.content = ''; + } else { + this.content = originalBefore; + } - return newChunk; -}; + newChunk.next = this.next; + if (newChunk.next) newChunk.next.previous = newChunk; + newChunk.previous = this; + this.next = newChunk; -Chunk.prototype.toString = function toString () { - return this.intro + this.content + this.outro; -}; + return newChunk; + } -Chunk.prototype.trimEnd = function trimEnd (rx) { - this.outro = this.outro.replace(rx, ''); - if (this.outro.length) { return true; } + toString() { + return this.intro + this.content + this.outro; + } - var trimmed = this.content.replace(rx, ''); + trimEnd(rx) { + this.outro = this.outro.replace(rx, ''); + if (this.outro.length) return true; - if (trimmed.length) { - if (trimmed !== this.content) { - this.split(this.start + trimmed.length).edit('', undefined, true); - } - return true; + const trimmed = this.content.replace(rx, ''); - } else { - this.edit('', undefined, true); + if (trimmed.length) { + if (trimmed !== this.content) { + this.split(this.start + trimmed.length).edit('', undefined, true); + } + return true; + } else { + this.edit('', undefined, true); - this.intro = this.intro.replace(rx, ''); - if (this.intro.length) { return true; } + this.intro = this.intro.replace(rx, ''); + if (this.intro.length) return true; + } } -}; -Chunk.prototype.trimStart = function trimStart (rx) { - this.intro = this.intro.replace(rx, ''); - if (this.intro.length) { return true; } + trimStart(rx) { + this.intro = this.intro.replace(rx, ''); + if (this.intro.length) return true; - var trimmed = this.content.replace(rx, ''); + const trimmed = this.content.replace(rx, ''); - if (trimmed.length) { - if (trimmed !== this.content) { - this.split(this.end - trimmed.length); + if (trimmed.length) { + if (trimmed !== this.content) { + this.split(this.end - trimmed.length); + this.edit('', undefined, true); + } + return true; + } else { this.edit('', undefined, true); - } - return true; - } else { - this.edit('', undefined, true); - - this.outro = this.outro.replace(rx, ''); - if (this.outro.length) { return true; } + this.outro = this.outro.replace(rx, ''); + if (this.outro.length) return true; + } } -}; +} -var btoa = function () { +let btoa = () => { throw new Error('Unsupported environment: `window.btoa` or `Buffer` should be supported.'); }; if (typeof window !== 'undefined' && typeof window.btoa === 'function') { - btoa = function (str) { return window.btoa(unescape(encodeURIComponent(str))); }; + btoa = (str) => window.btoa(unescape(encodeURIComponent(str))); } else if (typeof Buffer === 'function') { - btoa = function (str) { return Buffer.from(str, 'utf-8').toString('base64'); }; + btoa = (str) => Buffer.from(str, 'utf-8').toString('base64'); } -var SourceMap = function SourceMap(properties) { - this.version = 3; - this.file = properties.file; - this.sources = properties.sources; - this.sourcesContent = properties.sourcesContent; - this.names = properties.names; - this.mappings = encode(properties.mappings); -}; +class SourceMap { + constructor(properties) { + this.version = 3; + this.file = properties.file; + this.sources = properties.sources; + this.sourcesContent = properties.sourcesContent; + this.names = properties.names; + this.mappings = encode(properties.mappings); + } -SourceMap.prototype.toString = function toString () { - return JSON.stringify(this); -}; + toString() { + return JSON.stringify(this); + } -SourceMap.prototype.toUrl = function toUrl () { - return 'data:application/json;charset=utf-8;base64,' + btoa(this.toString()); -}; + toUrl() { + return 'data:application/json;charset=utf-8;base64,' + btoa(this.toString()); + } +} function guessIndent(code) { - var lines = code.split('\n'); + const lines = code.split('\n'); - var tabbed = lines.filter(function (line) { return /^\t+/.test(line); }); - var spaced = lines.filter(function (line) { return /^ {2,}/.test(line); }); + const tabbed = lines.filter((line) => /^\t+/.test(line)); + const spaced = lines.filter((line) => /^ {2,}/.test(line)); if (tabbed.length === 0 && spaced.length === 0) { return null; @@ -348,8 +353,8 @@ function guessIndent(code) { } // Otherwise, we need to guess the multiple - var min = spaced.reduce(function (previous, current) { - var numSpaces = /^ +/.exec(current)[0].length; + const min = spaced.reduce((previous, current) => { + const numSpaces = /^ +/.exec(current)[0].length; return Math.min(numSpaces, previous); }, Infinity); @@ -357,8 +362,8 @@ function guessIndent(code) { } function getRelativePath(from, to) { - var fromParts = from.split(/[/\\]/); - var toParts = to.split(/[/\\]/); + const fromParts = from.split(/[/\\]/); + const toParts = to.split(/[/\\]/); fromParts.pop(); // get dirname @@ -368,1081 +373,1125 @@ function getRelativePath(from, to) { } if (fromParts.length) { - var i = fromParts.length; - while (i--) { fromParts[i] = '..'; } + let i = fromParts.length; + while (i--) fromParts[i] = '..'; } return fromParts.concat(toParts).join('/'); } -var toString = Object.prototype.toString; +const toString$1 = Object.prototype.toString; -function isObject(thing) { - return toString.call(thing) === '[object Object]'; +function isObject$1(thing) { + return toString$1.call(thing) === '[object Object]'; } -function getLocator(source) { - var originalLines = source.split('\n'); - var lineOffsets = []; +function getLocator$1(source) { + const originalLines = source.split('\n'); + const lineOffsets = []; - for (var i = 0, pos = 0; i < originalLines.length; i++) { + for (let i = 0, pos = 0; i < originalLines.length; i++) { lineOffsets.push(pos); pos += originalLines[i].length + 1; } return function locate(index) { - var i = 0; - var j = lineOffsets.length; + let i = 0; + let j = lineOffsets.length; while (i < j) { - var m = (i + j) >> 1; + const m = (i + j) >> 1; if (index < lineOffsets[m]) { j = m; } else { i = m + 1; } } - var line = i - 1; - var column = index - lineOffsets[line]; - return { line: line, column: column }; + const line = i - 1; + const column = index - lineOffsets[line]; + return { line, column }; }; } -var Mappings = function Mappings(hires) { - this.hires = hires; - this.generatedCodeLine = 0; - this.generatedCodeColumn = 0; - this.raw = []; - this.rawSegments = this.raw[this.generatedCodeLine] = []; - this.pending = null; -}; +class Mappings { + constructor(hires) { + this.hires = hires; + this.generatedCodeLine = 0; + this.generatedCodeColumn = 0; + this.raw = []; + this.rawSegments = this.raw[this.generatedCodeLine] = []; + this.pending = null; + } -Mappings.prototype.addEdit = function addEdit (sourceIndex, content, loc, nameIndex) { - if (content.length) { - var segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column]; - if (nameIndex >= 0) { - segment.push(nameIndex); + addEdit(sourceIndex, content, loc, nameIndex) { + if (content.length) { + const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column]; + if (nameIndex >= 0) { + segment.push(nameIndex); + } + this.rawSegments.push(segment); + } else if (this.pending) { + this.rawSegments.push(this.pending); } - this.rawSegments.push(segment); - } else if (this.pending) { - this.rawSegments.push(this.pending); + + this.advance(content); + this.pending = null; } - this.advance(content); - this.pending = null; -}; + addUneditedChunk(sourceIndex, chunk, original, loc, sourcemapLocations) { + let originalCharIndex = chunk.start; + let first = true; -Mappings.prototype.addUneditedChunk = function addUneditedChunk (sourceIndex, chunk, original, loc, sourcemapLocations) { - var originalCharIndex = chunk.start; - var first = true; + while (originalCharIndex < chunk.end) { + if (this.hires || first || sourcemapLocations.has(originalCharIndex)) { + this.rawSegments.push([this.generatedCodeColumn, sourceIndex, loc.line, loc.column]); + } - while (originalCharIndex < chunk.end) { - if (this.hires || first || sourcemapLocations.has(originalCharIndex)) { - this.rawSegments.push([this.generatedCodeColumn, sourceIndex, loc.line, loc.column]); - } + if (original[originalCharIndex] === '\n') { + loc.line += 1; + loc.column = 0; + this.generatedCodeLine += 1; + this.raw[this.generatedCodeLine] = this.rawSegments = []; + this.generatedCodeColumn = 0; + first = true; + } else { + loc.column += 1; + this.generatedCodeColumn += 1; + first = false; + } - if (original[originalCharIndex] === '\n') { - loc.line += 1; - loc.column = 0; - this.generatedCodeLine += 1; - this.raw[this.generatedCodeLine] = this.rawSegments = []; - this.generatedCodeColumn = 0; - first = true; - } else { - loc.column += 1; - this.generatedCodeColumn += 1; - first = false; + originalCharIndex += 1; } - originalCharIndex += 1; + this.pending = null; } - this.pending = null; -}; - -Mappings.prototype.advance = function advance (str) { - if (!str) { return; } + advance(str) { + if (!str) return; - var lines = str.split('\n'); + const lines = str.split('\n'); - if (lines.length > 1) { - for (var i = 0; i < lines.length - 1; i++) { - this.generatedCodeLine++; - this.raw[this.generatedCodeLine] = this.rawSegments = []; + if (lines.length > 1) { + for (let i = 0; i < lines.length - 1; i++) { + this.generatedCodeLine++; + this.raw[this.generatedCodeLine] = this.rawSegments = []; + } + this.generatedCodeColumn = 0; } - this.generatedCodeColumn = 0; - } - this.generatedCodeColumn += lines[lines.length - 1].length; -}; + this.generatedCodeColumn += lines[lines.length - 1].length; + } +} -var n = '\n'; +const n = '\n'; -var warned = { +const warned = { insertLeft: false, insertRight: false, - storeName: false -}; - -var MagicString = function MagicString(string, options) { - if ( options === void 0 ) options = {}; - - var chunk = new Chunk(0, string.length, string); - - Object.defineProperties(this, { - original: { writable: true, value: string }, - outro: { writable: true, value: '' }, - intro: { writable: true, value: '' }, - firstChunk: { writable: true, value: chunk }, - lastChunk: { writable: true, value: chunk }, - lastSearchedChunk: { writable: true, value: chunk }, - byStart: { writable: true, value: {} }, - byEnd: { writable: true, value: {} }, - filename: { writable: true, value: options.filename }, - indentExclusionRanges: { writable: true, value: options.indentExclusionRanges }, - sourcemapLocations: { writable: true, value: new BitSet() }, - storedNames: { writable: true, value: {} }, - indentStr: { writable: true, value: guessIndent(string) } - }); - - this.byStart[0] = chunk; - this.byEnd[string.length] = chunk; -}; - -MagicString.prototype.addSourcemapLocation = function addSourcemapLocation (char) { - this.sourcemapLocations.add(char); -}; - -MagicString.prototype.append = function append (content) { - if (typeof content !== 'string') { throw new TypeError('outro content must be a string'); } - - this.outro += content; - return this; -}; + storeName: false, +}; + +class MagicString { + constructor(string, options = {}) { + const chunk = new Chunk$1(0, string.length, string); + + Object.defineProperties(this, { + original: { writable: true, value: string }, + outro: { writable: true, value: '' }, + intro: { writable: true, value: '' }, + firstChunk: { writable: true, value: chunk }, + lastChunk: { writable: true, value: chunk }, + lastSearchedChunk: { writable: true, value: chunk }, + byStart: { writable: true, value: {} }, + byEnd: { writable: true, value: {} }, + filename: { writable: true, value: options.filename }, + indentExclusionRanges: { writable: true, value: options.indentExclusionRanges }, + sourcemapLocations: { writable: true, value: new BitSet() }, + storedNames: { writable: true, value: {} }, + indentStr: { writable: true, value: guessIndent(string) }, + }); -MagicString.prototype.appendLeft = function appendLeft (index, content) { - if (typeof content !== 'string') { throw new TypeError('inserted content must be a string'); } + this.byStart[0] = chunk; + this.byEnd[string.length] = chunk; + } - this._split(index); + addSourcemapLocation(char) { + this.sourcemapLocations.add(char); + } - var chunk = this.byEnd[index]; + append(content) { + if (typeof content !== 'string') throw new TypeError('outro content must be a string'); - if (chunk) { - chunk.appendLeft(content); - } else { - this.intro += content; + this.outro += content; + return this; } - return this; -}; -MagicString.prototype.appendRight = function appendRight (index, content) { - if (typeof content !== 'string') { throw new TypeError('inserted content must be a string'); } + appendLeft(index, content) { + if (typeof content !== 'string') throw new TypeError('inserted content must be a string'); - this._split(index); + this._split(index); - var chunk = this.byStart[index]; + const chunk = this.byEnd[index]; - if (chunk) { - chunk.appendRight(content); - } else { - this.outro += content; + if (chunk) { + chunk.appendLeft(content); + } else { + this.intro += content; + } + return this; } - return this; -}; -MagicString.prototype.clone = function clone () { - var cloned = new MagicString(this.original, { filename: this.filename }); + appendRight(index, content) { + if (typeof content !== 'string') throw new TypeError('inserted content must be a string'); - var originalChunk = this.firstChunk; - var clonedChunk = (cloned.firstChunk = cloned.lastSearchedChunk = originalChunk.clone()); + this._split(index); - while (originalChunk) { - cloned.byStart[clonedChunk.start] = clonedChunk; - cloned.byEnd[clonedChunk.end] = clonedChunk; + const chunk = this.byStart[index]; - var nextOriginalChunk = originalChunk.next; - var nextClonedChunk = nextOriginalChunk && nextOriginalChunk.clone(); - - if (nextClonedChunk) { - clonedChunk.next = nextClonedChunk; - nextClonedChunk.previous = clonedChunk; - - clonedChunk = nextClonedChunk; + if (chunk) { + chunk.appendRight(content); + } else { + this.outro += content; } - - originalChunk = nextOriginalChunk; + return this; } - cloned.lastChunk = clonedChunk; + clone() { + const cloned = new MagicString(this.original, { filename: this.filename }); - if (this.indentExclusionRanges) { - cloned.indentExclusionRanges = this.indentExclusionRanges.slice(); - } + let originalChunk = this.firstChunk; + let clonedChunk = (cloned.firstChunk = cloned.lastSearchedChunk = originalChunk.clone()); - cloned.sourcemapLocations = new BitSet(this.sourcemapLocations); + while (originalChunk) { + cloned.byStart[clonedChunk.start] = clonedChunk; + cloned.byEnd[clonedChunk.end] = clonedChunk; - cloned.intro = this.intro; - cloned.outro = this.outro; + const nextOriginalChunk = originalChunk.next; + const nextClonedChunk = nextOriginalChunk && nextOriginalChunk.clone(); - return cloned; -}; + if (nextClonedChunk) { + clonedChunk.next = nextClonedChunk; + nextClonedChunk.previous = clonedChunk; + + clonedChunk = nextClonedChunk; + } -MagicString.prototype.generateDecodedMap = function generateDecodedMap (options) { - var this$1 = this; + originalChunk = nextOriginalChunk; + } + + cloned.lastChunk = clonedChunk; - options = options || {}; + if (this.indentExclusionRanges) { + cloned.indentExclusionRanges = this.indentExclusionRanges.slice(); + } - var sourceIndex = 0; - var names = Object.keys(this.storedNames); - var mappings = new Mappings(options.hires); + cloned.sourcemapLocations = new BitSet(this.sourcemapLocations); - var locate = getLocator(this.original); + cloned.intro = this.intro; + cloned.outro = this.outro; - if (this.intro) { - mappings.advance(this.intro); + return cloned; } - this.firstChunk.eachNext(function (chunk) { - var loc = locate(chunk.start); + generateDecodedMap(options) { + options = options || {}; - if (chunk.intro.length) { mappings.advance(chunk.intro); } + const sourceIndex = 0; + const names = Object.keys(this.storedNames); + const mappings = new Mappings(options.hires); - if (chunk.edited) { - mappings.addEdit( - sourceIndex, - chunk.content, - loc, - chunk.storeName ? names.indexOf(chunk.original) : -1 - ); - } else { - mappings.addUneditedChunk(sourceIndex, chunk, this$1.original, loc, this$1.sourcemapLocations); + const locate = getLocator$1(this.original); + + if (this.intro) { + mappings.advance(this.intro); } - if (chunk.outro.length) { mappings.advance(chunk.outro); } - }); + this.firstChunk.eachNext((chunk) => { + const loc = locate(chunk.start); - return { - file: options.file ? options.file.split(/[/\\]/).pop() : null, - sources: [options.source ? getRelativePath(options.file || '', options.source) : null], - sourcesContent: options.includeContent ? [this.original] : [null], - names: names, - mappings: mappings.raw - }; -}; + if (chunk.intro.length) mappings.advance(chunk.intro); -MagicString.prototype.generateMap = function generateMap (options) { - return new SourceMap(this.generateDecodedMap(options)); -}; + if (chunk.edited) { + mappings.addEdit( + sourceIndex, + chunk.content, + loc, + chunk.storeName ? names.indexOf(chunk.original) : -1 + ); + } else { + mappings.addUneditedChunk(sourceIndex, chunk, this.original, loc, this.sourcemapLocations); + } -MagicString.prototype.getIndentString = function getIndentString () { - return this.indentStr === null ? '\t' : this.indentStr; -}; + if (chunk.outro.length) mappings.advance(chunk.outro); + }); + + return { + file: options.file ? options.file.split(/[/\\]/).pop() : null, + sources: [options.source ? getRelativePath(options.file || '', options.source) : null], + sourcesContent: options.includeContent ? [this.original] : [null], + names, + mappings: mappings.raw, + }; + } -MagicString.prototype.indent = function indent (indentStr, options) { - var pattern = /^[^\r\n]/gm; + generateMap(options) { + return new SourceMap(this.generateDecodedMap(options)); + } - if (isObject(indentStr)) { - options = indentStr; - indentStr = undefined; + getIndentString() { + return this.indentStr === null ? '\t' : this.indentStr; } - indentStr = indentStr !== undefined ? indentStr : this.indentStr || '\t'; + indent(indentStr, options) { + const pattern = /^[^\r\n]/gm; - if (indentStr === '') { return this; } // noop + if (isObject$1(indentStr)) { + options = indentStr; + indentStr = undefined; + } - options = options || {}; + indentStr = indentStr !== undefined ? indentStr : this.indentStr || '\t'; - // Process exclusion ranges - var isExcluded = {}; + if (indentStr === '') return this; // noop - if (options.exclude) { - var exclusions = - typeof options.exclude[0] === 'number' ? [options.exclude] : options.exclude; - exclusions.forEach(function (exclusion) { - for (var i = exclusion[0]; i < exclusion[1]; i += 1) { - isExcluded[i] = true; - } - }); - } + options = options || {}; - var shouldIndentNextCharacter = options.indentStart !== false; - var replacer = function (match) { - if (shouldIndentNextCharacter) { return ("" + indentStr + match); } - shouldIndentNextCharacter = true; - return match; - }; + // Process exclusion ranges + const isExcluded = {}; - this.intro = this.intro.replace(pattern, replacer); + if (options.exclude) { + const exclusions = + typeof options.exclude[0] === 'number' ? [options.exclude] : options.exclude; + exclusions.forEach((exclusion) => { + for (let i = exclusion[0]; i < exclusion[1]; i += 1) { + isExcluded[i] = true; + } + }); + } - var charIndex = 0; - var chunk = this.firstChunk; + let shouldIndentNextCharacter = options.indentStart !== false; + const replacer = (match) => { + if (shouldIndentNextCharacter) return `${indentStr}${match}`; + shouldIndentNextCharacter = true; + return match; + }; - while (chunk) { - var end = chunk.end; + this.intro = this.intro.replace(pattern, replacer); - if (chunk.edited) { - if (!isExcluded[charIndex]) { - chunk.content = chunk.content.replace(pattern, replacer); + let charIndex = 0; + let chunk = this.firstChunk; - if (chunk.content.length) { - shouldIndentNextCharacter = chunk.content[chunk.content.length - 1] === '\n'; - } - } - } else { - charIndex = chunk.start; + while (chunk) { + const end = chunk.end; - while (charIndex < end) { + if (chunk.edited) { if (!isExcluded[charIndex]) { - var char = this.original[charIndex]; - - if (char === '\n') { - shouldIndentNextCharacter = true; - } else if (char !== '\r' && shouldIndentNextCharacter) { - shouldIndentNextCharacter = false; - - if (charIndex === chunk.start) { - chunk.prependRight(indentStr); - } else { - this._splitChunk(chunk, charIndex); - chunk = chunk.next; - chunk.prependRight(indentStr); - } + chunk.content = chunk.content.replace(pattern, replacer); + + if (chunk.content.length) { + shouldIndentNextCharacter = chunk.content[chunk.content.length - 1] === '\n'; } } + } else { + charIndex = chunk.start; + + while (charIndex < end) { + if (!isExcluded[charIndex]) { + const char = this.original[charIndex]; + + if (char === '\n') { + shouldIndentNextCharacter = true; + } else if (char !== '\r' && shouldIndentNextCharacter) { + shouldIndentNextCharacter = false; + + if (charIndex === chunk.start) { + chunk.prependRight(indentStr); + } else { + this._splitChunk(chunk, charIndex); + chunk = chunk.next; + chunk.prependRight(indentStr); + } + } + } - charIndex += 1; + charIndex += 1; + } } + + charIndex = chunk.end; + chunk = chunk.next; } - charIndex = chunk.end; - chunk = chunk.next; - } + this.outro = this.outro.replace(pattern, replacer); - this.outro = this.outro.replace(pattern, replacer); + return this; + } - return this; -}; + insert() { + throw new Error( + 'magicString.insert(...) is deprecated. Use prependRight(...) or appendLeft(...)' + ); + } -MagicString.prototype.insert = function insert () { - throw new Error('magicString.insert(...) is deprecated. Use prependRight(...) or appendLeft(...)'); -}; + insertLeft(index, content) { + if (!warned.insertLeft) { + console.warn( + 'magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead' + ); // eslint-disable-line no-console + warned.insertLeft = true; + } -MagicString.prototype.insertLeft = function insertLeft (index, content) { - if (!warned.insertLeft) { - console.warn('magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead'); // eslint-disable-line no-console - warned.insertLeft = true; + return this.appendLeft(index, content); } - return this.appendLeft(index, content); -}; + insertRight(index, content) { + if (!warned.insertRight) { + console.warn( + 'magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead' + ); // eslint-disable-line no-console + warned.insertRight = true; + } -MagicString.prototype.insertRight = function insertRight (index, content) { - if (!warned.insertRight) { - console.warn('magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead'); // eslint-disable-line no-console - warned.insertRight = true; + return this.prependRight(index, content); } - return this.prependRight(index, content); -}; + move(start, end, index) { + if (index >= start && index <= end) throw new Error('Cannot move a selection inside itself'); -MagicString.prototype.move = function move (start, end, index) { - if (index >= start && index <= end) { throw new Error('Cannot move a selection inside itself'); } + this._split(start); + this._split(end); + this._split(index); - this._split(start); - this._split(end); - this._split(index); + const first = this.byStart[start]; + const last = this.byEnd[end]; - var first = this.byStart[start]; - var last = this.byEnd[end]; + const oldLeft = first.previous; + const oldRight = last.next; - var oldLeft = first.previous; - var oldRight = last.next; + const newRight = this.byStart[index]; + if (!newRight && last === this.lastChunk) return this; + const newLeft = newRight ? newRight.previous : this.lastChunk; - var newRight = this.byStart[index]; - if (!newRight && last === this.lastChunk) { return this; } - var newLeft = newRight ? newRight.previous : this.lastChunk; + if (oldLeft) oldLeft.next = oldRight; + if (oldRight) oldRight.previous = oldLeft; - if (oldLeft) { oldLeft.next = oldRight; } - if (oldRight) { oldRight.previous = oldLeft; } + if (newLeft) newLeft.next = first; + if (newRight) newRight.previous = last; - if (newLeft) { newLeft.next = first; } - if (newRight) { newRight.previous = last; } + if (!first.previous) this.firstChunk = last.next; + if (!last.next) { + this.lastChunk = first.previous; + this.lastChunk.next = null; + } - if (!first.previous) { this.firstChunk = last.next; } - if (!last.next) { - this.lastChunk = first.previous; - this.lastChunk.next = null; - } + first.previous = newLeft; + last.next = newRight || null; - first.previous = newLeft; - last.next = newRight || null; + if (!newLeft) this.firstChunk = first; + if (!newRight) this.lastChunk = last; + return this; + } - if (!newLeft) { this.firstChunk = first; } - if (!newRight) { this.lastChunk = last; } - return this; -}; + overwrite(start, end, content, options) { + if (typeof content !== 'string') throw new TypeError('replacement content must be a string'); -MagicString.prototype.overwrite = function overwrite (start, end, content, options) { - if (typeof content !== 'string') { throw new TypeError('replacement content must be a string'); } + while (start < 0) start += this.original.length; + while (end < 0) end += this.original.length; - while (start < 0) { start += this.original.length; } - while (end < 0) { end += this.original.length; } + if (end > this.original.length) throw new Error('end is out of bounds'); + if (start === end) + throw new Error( + 'Cannot overwrite a zero-length range – use appendLeft or prependRight instead' + ); - if (end > this.original.length) { throw new Error('end is out of bounds'); } - if (start === end) - { throw new Error('Cannot overwrite a zero-length range – use appendLeft or prependRight instead'); } + this._split(start); + this._split(end); - this._split(start); - this._split(end); + if (options === true) { + if (!warned.storeName) { + console.warn( + 'The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string' + ); // eslint-disable-line no-console + warned.storeName = true; + } - if (options === true) { - if (!warned.storeName) { - console.warn('The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string'); // eslint-disable-line no-console - warned.storeName = true; + options = { storeName: true }; } - - options = { storeName: true }; - } - var storeName = options !== undefined ? options.storeName : false; - var contentOnly = options !== undefined ? options.contentOnly : false; - - if (storeName) { - var original = this.original.slice(start, end); - this.storedNames[original] = true; - } - - var first = this.byStart[start]; - var last = this.byEnd[end]; - - if (first) { - if (end > first.end && first.next !== this.byStart[first.end]) { - throw new Error('Cannot overwrite across a split point'); + const storeName = options !== undefined ? options.storeName : false; + const contentOnly = options !== undefined ? options.contentOnly : false; + + if (storeName) { + const original = this.original.slice(start, end); + Object.defineProperty(this.storedNames, original, { + writable: true, + value: true, + enumerable: true, + }); } - first.edit(content, storeName, contentOnly); + const first = this.byStart[start]; + const last = this.byEnd[end]; - if (first !== last) { - var chunk = first.next; + if (first) { + let chunk = first; while (chunk !== last) { - chunk.edit('', false); + if (chunk.next !== this.byStart[chunk.end]) { + throw new Error('Cannot overwrite across a split point'); + } chunk = chunk.next; + chunk.edit('', false); } - chunk.edit('', false); - } - } else { - // must be inserting at the end - var newChunk = new Chunk(start, end, '').edit(content, storeName); + first.edit(content, storeName, contentOnly); + } else { + // must be inserting at the end + const newChunk = new Chunk$1(start, end, '').edit(content, storeName); - // TODO last chunk in the array may not be the last chunk, if it's moved... - last.next = newChunk; - newChunk.previous = last; + // TODO last chunk in the array may not be the last chunk, if it's moved... + last.next = newChunk; + newChunk.previous = last; + } + return this; } - return this; -}; -MagicString.prototype.prepend = function prepend (content) { - if (typeof content !== 'string') { throw new TypeError('outro content must be a string'); } + prepend(content) { + if (typeof content !== 'string') throw new TypeError('outro content must be a string'); - this.intro = content + this.intro; - return this; -}; + this.intro = content + this.intro; + return this; + } -MagicString.prototype.prependLeft = function prependLeft (index, content) { - if (typeof content !== 'string') { throw new TypeError('inserted content must be a string'); } + prependLeft(index, content) { + if (typeof content !== 'string') throw new TypeError('inserted content must be a string'); - this._split(index); + this._split(index); - var chunk = this.byEnd[index]; + const chunk = this.byEnd[index]; - if (chunk) { - chunk.prependLeft(content); - } else { - this.intro = content + this.intro; + if (chunk) { + chunk.prependLeft(content); + } else { + this.intro = content + this.intro; + } + return this; } - return this; -}; -MagicString.prototype.prependRight = function prependRight (index, content) { - if (typeof content !== 'string') { throw new TypeError('inserted content must be a string'); } + prependRight(index, content) { + if (typeof content !== 'string') throw new TypeError('inserted content must be a string'); - this._split(index); + this._split(index); - var chunk = this.byStart[index]; + const chunk = this.byStart[index]; - if (chunk) { - chunk.prependRight(content); - } else { - this.outro = content + this.outro; + if (chunk) { + chunk.prependRight(content); + } else { + this.outro = content + this.outro; + } + return this; } - return this; -}; -MagicString.prototype.remove = function remove (start, end) { - while (start < 0) { start += this.original.length; } - while (end < 0) { end += this.original.length; } + remove(start, end) { + while (start < 0) start += this.original.length; + while (end < 0) end += this.original.length; - if (start === end) { return this; } + if (start === end) return this; - if (start < 0 || end > this.original.length) { throw new Error('Character is out of bounds'); } - if (start > end) { throw new Error('end must be greater than start'); } + if (start < 0 || end > this.original.length) throw new Error('Character is out of bounds'); + if (start > end) throw new Error('end must be greater than start'); - this._split(start); - this._split(end); + this._split(start); + this._split(end); - var chunk = this.byStart[start]; + let chunk = this.byStart[start]; - while (chunk) { - chunk.intro = ''; - chunk.outro = ''; - chunk.edit(''); + while (chunk) { + chunk.intro = ''; + chunk.outro = ''; + chunk.edit(''); - chunk = end > chunk.end ? this.byStart[chunk.end] : null; - } - return this; -}; - -MagicString.prototype.lastChar = function lastChar () { - if (this.outro.length) - { return this.outro[this.outro.length - 1]; } - var chunk = this.lastChunk; - do { - if (chunk.outro.length) - { return chunk.outro[chunk.outro.length - 1]; } - if (chunk.content.length) - { return chunk.content[chunk.content.length - 1]; } - if (chunk.intro.length) - { return chunk.intro[chunk.intro.length - 1]; } - } while (chunk = chunk.previous); - if (this.intro.length) - { return this.intro[this.intro.length - 1]; } - return ''; -}; - -MagicString.prototype.lastLine = function lastLine () { - var lineIndex = this.outro.lastIndexOf(n); - if (lineIndex !== -1) - { return this.outro.substr(lineIndex + 1); } - var lineStr = this.outro; - var chunk = this.lastChunk; - do { - if (chunk.outro.length > 0) { - lineIndex = chunk.outro.lastIndexOf(n); - if (lineIndex !== -1) - { return chunk.outro.substr(lineIndex + 1) + lineStr; } - lineStr = chunk.outro + lineStr; + chunk = end > chunk.end ? this.byStart[chunk.end] : null; } + return this; + } - if (chunk.content.length > 0) { - lineIndex = chunk.content.lastIndexOf(n); - if (lineIndex !== -1) - { return chunk.content.substr(lineIndex + 1) + lineStr; } - lineStr = chunk.content + lineStr; - } + lastChar() { + if (this.outro.length) return this.outro[this.outro.length - 1]; + let chunk = this.lastChunk; + do { + if (chunk.outro.length) return chunk.outro[chunk.outro.length - 1]; + if (chunk.content.length) return chunk.content[chunk.content.length - 1]; + if (chunk.intro.length) return chunk.intro[chunk.intro.length - 1]; + } while ((chunk = chunk.previous)); + if (this.intro.length) return this.intro[this.intro.length - 1]; + return ''; + } - if (chunk.intro.length > 0) { - lineIndex = chunk.intro.lastIndexOf(n); - if (lineIndex !== -1) - { return chunk.intro.substr(lineIndex + 1) + lineStr; } - lineStr = chunk.intro + lineStr; - } - } while (chunk = chunk.previous); - lineIndex = this.intro.lastIndexOf(n); - if (lineIndex !== -1) - { return this.intro.substr(lineIndex + 1) + lineStr; } - return this.intro + lineStr; -}; + lastLine() { + let lineIndex = this.outro.lastIndexOf(n); + if (lineIndex !== -1) return this.outro.substr(lineIndex + 1); + let lineStr = this.outro; + let chunk = this.lastChunk; + do { + if (chunk.outro.length > 0) { + lineIndex = chunk.outro.lastIndexOf(n); + if (lineIndex !== -1) return chunk.outro.substr(lineIndex + 1) + lineStr; + lineStr = chunk.outro + lineStr; + } + + if (chunk.content.length > 0) { + lineIndex = chunk.content.lastIndexOf(n); + if (lineIndex !== -1) return chunk.content.substr(lineIndex + 1) + lineStr; + lineStr = chunk.content + lineStr; + } -MagicString.prototype.slice = function slice (start, end) { - if ( start === void 0 ) start = 0; - if ( end === void 0 ) end = this.original.length; + if (chunk.intro.length > 0) { + lineIndex = chunk.intro.lastIndexOf(n); + if (lineIndex !== -1) return chunk.intro.substr(lineIndex + 1) + lineStr; + lineStr = chunk.intro + lineStr; + } + } while ((chunk = chunk.previous)); + lineIndex = this.intro.lastIndexOf(n); + if (lineIndex !== -1) return this.intro.substr(lineIndex + 1) + lineStr; + return this.intro + lineStr; + } - while (start < 0) { start += this.original.length; } - while (end < 0) { end += this.original.length; } + slice(start = 0, end = this.original.length) { + while (start < 0) start += this.original.length; + while (end < 0) end += this.original.length; - var result = ''; + let result = ''; + + // find start chunk + let chunk = this.firstChunk; + while (chunk && (chunk.start > start || chunk.end <= start)) { + // found end chunk before start + if (chunk.start < end && chunk.end >= end) { + return result; + } - // find start chunk - var chunk = this.firstChunk; - while (chunk && (chunk.start > start || chunk.end <= start)) { - // found end chunk before start - if (chunk.start < end && chunk.end >= end) { - return result; + chunk = chunk.next; } - chunk = chunk.next; - } + if (chunk && chunk.edited && chunk.start !== start) + throw new Error(`Cannot use replaced character ${start} as slice start anchor.`); - if (chunk && chunk.edited && chunk.start !== start) - { throw new Error(("Cannot use replaced character " + start + " as slice start anchor.")); } + const startChunk = chunk; + while (chunk) { + if (chunk.intro && (startChunk !== chunk || chunk.start === start)) { + result += chunk.intro; + } - var startChunk = chunk; - while (chunk) { - if (chunk.intro && (startChunk !== chunk || chunk.start === start)) { - result += chunk.intro; - } + const containsEnd = chunk.start < end && chunk.end >= end; + if (containsEnd && chunk.edited && chunk.end !== end) + throw new Error(`Cannot use replaced character ${end} as slice end anchor.`); - var containsEnd = chunk.start < end && chunk.end >= end; - if (containsEnd && chunk.edited && chunk.end !== end) - { throw new Error(("Cannot use replaced character " + end + " as slice end anchor.")); } + const sliceStart = startChunk === chunk ? start - chunk.start : 0; + const sliceEnd = containsEnd ? chunk.content.length + end - chunk.end : chunk.content.length; - var sliceStart = startChunk === chunk ? start - chunk.start : 0; - var sliceEnd = containsEnd ? chunk.content.length + end - chunk.end : chunk.content.length; + result += chunk.content.slice(sliceStart, sliceEnd); - result += chunk.content.slice(sliceStart, sliceEnd); + if (chunk.outro && (!containsEnd || chunk.end === end)) { + result += chunk.outro; + } - if (chunk.outro && (!containsEnd || chunk.end === end)) { - result += chunk.outro; - } + if (containsEnd) { + break; + } - if (containsEnd) { - break; + chunk = chunk.next; } - chunk = chunk.next; + return result; } - return result; -}; - -// TODO deprecate this? not really very useful -MagicString.prototype.snip = function snip (start, end) { - var clone = this.clone(); - clone.remove(0, start); - clone.remove(end, clone.original.length); + // TODO deprecate this? not really very useful + snip(start, end) { + const clone = this.clone(); + clone.remove(0, start); + clone.remove(end, clone.original.length); - return clone; -}; + return clone; + } -MagicString.prototype._split = function _split (index) { - if (this.byStart[index] || this.byEnd[index]) { return; } + _split(index) { + if (this.byStart[index] || this.byEnd[index]) return; - var chunk = this.lastSearchedChunk; - var searchForward = index > chunk.end; + let chunk = this.lastSearchedChunk; + const searchForward = index > chunk.end; - while (chunk) { - if (chunk.contains(index)) { return this._splitChunk(chunk, index); } + while (chunk) { + if (chunk.contains(index)) return this._splitChunk(chunk, index); - chunk = searchForward ? this.byStart[chunk.end] : this.byEnd[chunk.start]; + chunk = searchForward ? this.byStart[chunk.end] : this.byEnd[chunk.start]; + } } -}; -MagicString.prototype._splitChunk = function _splitChunk (chunk, index) { - if (chunk.edited && chunk.content.length) { - // zero-length edited chunks are a special case (overlapping replacements) - var loc = getLocator(this.original)(index); - throw new Error( - ("Cannot split a chunk that has already been edited (" + (loc.line) + ":" + (loc.column) + " – \"" + (chunk.original) + "\")") - ); - } + _splitChunk(chunk, index) { + if (chunk.edited && chunk.content.length) { + // zero-length edited chunks are a special case (overlapping replacements) + const loc = getLocator$1(this.original)(index); + throw new Error( + `Cannot split a chunk that has already been edited (${loc.line}:${loc.column} – "${chunk.original}")` + ); + } - var newChunk = chunk.split(index); + const newChunk = chunk.split(index); - this.byEnd[index] = chunk; - this.byStart[index] = newChunk; - this.byEnd[newChunk.end] = newChunk; + this.byEnd[index] = chunk; + this.byStart[index] = newChunk; + this.byEnd[newChunk.end] = newChunk; - if (chunk === this.lastChunk) { this.lastChunk = newChunk; } + if (chunk === this.lastChunk) this.lastChunk = newChunk; - this.lastSearchedChunk = chunk; - return true; -}; + this.lastSearchedChunk = chunk; + return true; + } + + toString() { + let str = this.intro; -MagicString.prototype.toString = function toString () { - var str = this.intro; + let chunk = this.firstChunk; + while (chunk) { + str += chunk.toString(); + chunk = chunk.next; + } - var chunk = this.firstChunk; - while (chunk) { - str += chunk.toString(); - chunk = chunk.next; + return str + this.outro; } - return str + this.outro; -}; + isEmpty() { + let chunk = this.firstChunk; + do { + if ( + (chunk.intro.length && chunk.intro.trim()) || + (chunk.content.length && chunk.content.trim()) || + (chunk.outro.length && chunk.outro.trim()) + ) + return false; + } while ((chunk = chunk.next)); + return true; + } -MagicString.prototype.isEmpty = function isEmpty () { - var chunk = this.firstChunk; - do { - if (chunk.intro.length && chunk.intro.trim() || - chunk.content.length && chunk.content.trim() || - chunk.outro.length && chunk.outro.trim()) - { return false; } - } while (chunk = chunk.next); - return true; -}; + length() { + let chunk = this.firstChunk; + let length = 0; + do { + length += chunk.intro.length + chunk.content.length + chunk.outro.length; + } while ((chunk = chunk.next)); + return length; + } -MagicString.prototype.length = function length () { - var chunk = this.firstChunk; - var length = 0; - do { - length += chunk.intro.length + chunk.content.length + chunk.outro.length; - } while (chunk = chunk.next); - return length; -}; + trimLines() { + return this.trim('[\\r\\n]'); + } -MagicString.prototype.trimLines = function trimLines () { - return this.trim('[\\r\\n]'); -}; + trim(charType) { + return this.trimStart(charType).trimEnd(charType); + } -MagicString.prototype.trim = function trim (charType) { - return this.trimStart(charType).trimEnd(charType); -}; + trimEndAborted(charType) { + const rx = new RegExp((charType || '\\s') + '+$'); -MagicString.prototype.trimEndAborted = function trimEndAborted (charType) { - var rx = new RegExp((charType || '\\s') + '+$'); + this.outro = this.outro.replace(rx, ''); + if (this.outro.length) return true; - this.outro = this.outro.replace(rx, ''); - if (this.outro.length) { return true; } + let chunk = this.lastChunk; - var chunk = this.lastChunk; + do { + const end = chunk.end; + const aborted = chunk.trimEnd(rx); - do { - var end = chunk.end; - var aborted = chunk.trimEnd(rx); + // if chunk was trimmed, we have a new lastChunk + if (chunk.end !== end) { + if (this.lastChunk === chunk) { + this.lastChunk = chunk.next; + } - // if chunk was trimmed, we have a new lastChunk - if (chunk.end !== end) { - if (this.lastChunk === chunk) { - this.lastChunk = chunk.next; + this.byEnd[chunk.end] = chunk; + this.byStart[chunk.next.start] = chunk.next; + this.byEnd[chunk.next.end] = chunk.next; } - this.byEnd[chunk.end] = chunk; - this.byStart[chunk.next.start] = chunk.next; - this.byEnd[chunk.next.end] = chunk.next; - } + if (aborted) return true; + chunk = chunk.previous; + } while (chunk); - if (aborted) { return true; } - chunk = chunk.previous; - } while (chunk); + return false; + } - return false; -}; + trimEnd(charType) { + this.trimEndAborted(charType); + return this; + } + trimStartAborted(charType) { + const rx = new RegExp('^' + (charType || '\\s') + '+'); -MagicString.prototype.trimEnd = function trimEnd (charType) { - this.trimEndAborted(charType); - return this; -}; -MagicString.prototype.trimStartAborted = function trimStartAborted (charType) { - var rx = new RegExp('^' + (charType || '\\s') + '+'); - - this.intro = this.intro.replace(rx, ''); - if (this.intro.length) { return true; } - - var chunk = this.firstChunk; - - do { - var end = chunk.end; - var aborted = chunk.trimStart(rx); - - if (chunk.end !== end) { - // special case... - if (chunk === this.lastChunk) { this.lastChunk = chunk.next; } - - this.byEnd[chunk.end] = chunk; - this.byStart[chunk.next.start] = chunk.next; - this.byEnd[chunk.next.end] = chunk.next; - } - - if (aborted) { return true; } - chunk = chunk.next; - } while (chunk); + this.intro = this.intro.replace(rx, ''); + if (this.intro.length) return true; - return false; -}; + let chunk = this.firstChunk; -MagicString.prototype.trimStart = function trimStart (charType) { - this.trimStartAborted(charType); - return this; -}; + do { + const end = chunk.end; + const aborted = chunk.trimStart(rx); -var hasOwnProp = Object.prototype.hasOwnProperty; + if (chunk.end !== end) { + // special case... + if (chunk === this.lastChunk) this.lastChunk = chunk.next; -var Bundle = function Bundle(options) { - if ( options === void 0 ) options = {}; + this.byEnd[chunk.end] = chunk; + this.byStart[chunk.next.start] = chunk.next; + this.byEnd[chunk.next.end] = chunk.next; + } - this.intro = options.intro || ''; - this.separator = options.separator !== undefined ? options.separator : '\n'; - this.sources = []; - this.uniqueSources = []; - this.uniqueSourceIndexByFilename = {}; -}; + if (aborted) return true; + chunk = chunk.next; + } while (chunk); -Bundle.prototype.addSource = function addSource (source) { - if (source instanceof MagicString) { - return this.addSource({ - content: source, - filename: source.filename, - separator: this.separator - }); + return false; } - if (!isObject(source) || !source.content) { - throw new Error('bundle.addSource() takes an object with a `content` property, which should be an instance of MagicString, and an optional `filename`'); + trimStart(charType) { + this.trimStartAborted(charType); + return this; } - ['filename', 'indentExclusionRanges', 'separator'].forEach(function (option) { - if (!hasOwnProp.call(source, option)) { source[option] = source.content[option]; } - }); - - if (source.separator === undefined) { - // TODO there's a bunch of this sort of thing, needs cleaning up - source.separator = this.separator; + hasChanged() { + return this.original !== this.toString(); } - if (source.filename) { - if (!hasOwnProp.call(this.uniqueSourceIndexByFilename, source.filename)) { - this.uniqueSourceIndexByFilename[source.filename] = this.uniqueSources.length; - this.uniqueSources.push({ filename: source.filename, content: source.content.original }); - } else { - var uniqueSource = this.uniqueSources[this.uniqueSourceIndexByFilename[source.filename]]; - if (source.content.original !== uniqueSource.content) { - throw new Error(("Illegal source: same filename (" + (source.filename) + "), different contents")); + replace(searchValue, replacement) { + function getReplacement(match, str) { + if (typeof replacement === 'string') { + return replacement.replace(/\$(\$|&|\d+)/g, (_, i) => { + // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace#specifying_a_string_as_a_parameter + if (i === '$') return '$'; + if (i === '&') return match[0]; + const num = +i; + if (num < match.length) return match[+i]; + return `$${i}`; + }); + } else { + return replacement(...match, match.index, str, match.groups); + } + } + function matchAll(re, str) { + let match; + const matches = []; + while ((match = re.exec(str))) { + matches.push(match); } + return matches; + } + if (typeof searchValue !== 'string' && searchValue.global) { + const matches = matchAll(searchValue, this.original); + matches.forEach((match) => { + if (match.index != null) + this.overwrite( + match.index, + match.index + match[0].length, + getReplacement(match, this.original) + ); + }); + } else { + const match = this.original.match(searchValue); + if (match && match.index != null) + this.overwrite( + match.index, + match.index + match[0].length, + getReplacement(match, this.original) + ); } + return this; } +} - this.sources.push(source); - return this; -}; +const hasOwnProp = Object.prototype.hasOwnProperty; -Bundle.prototype.append = function append (str, options) { - this.addSource({ - content: new MagicString(str), - separator: (options && options.separator) || '' - }); +class Bundle$1 { + constructor(options = {}) { + this.intro = options.intro || ''; + this.separator = options.separator !== undefined ? options.separator : '\n'; + this.sources = []; + this.uniqueSources = []; + this.uniqueSourceIndexByFilename = {}; + } - return this; -}; + addSource(source) { + if (source instanceof MagicString) { + return this.addSource({ + content: source, + filename: source.filename, + separator: this.separator, + }); + } -Bundle.prototype.clone = function clone () { - var bundle = new Bundle({ - intro: this.intro, - separator: this.separator - }); + if (!isObject$1(source) || !source.content) { + throw new Error( + 'bundle.addSource() takes an object with a `content` property, which should be an instance of MagicString, and an optional `filename`' + ); + } - this.sources.forEach(function (source) { - bundle.addSource({ - filename: source.filename, - content: source.content.clone(), - separator: source.separator + ['filename', 'indentExclusionRanges', 'separator'].forEach((option) => { + if (!hasOwnProp.call(source, option)) source[option] = source.content[option]; }); - }); - return bundle; -}; + if (source.separator === undefined) { + // TODO there's a bunch of this sort of thing, needs cleaning up + source.separator = this.separator; + } + + if (source.filename) { + if (!hasOwnProp.call(this.uniqueSourceIndexByFilename, source.filename)) { + this.uniqueSourceIndexByFilename[source.filename] = this.uniqueSources.length; + this.uniqueSources.push({ filename: source.filename, content: source.content.original }); + } else { + const uniqueSource = this.uniqueSources[this.uniqueSourceIndexByFilename[source.filename]]; + if (source.content.original !== uniqueSource.content) { + throw new Error(`Illegal source: same filename (${source.filename}), different contents`); + } + } + } -Bundle.prototype.generateDecodedMap = function generateDecodedMap (options) { - var this$1 = this; - if ( options === void 0 ) options = {}; + this.sources.push(source); + return this; + } - var names = []; - this.sources.forEach(function (source) { - Object.keys(source.content.storedNames).forEach(function (name) { - if (!~names.indexOf(name)) { names.push(name); } + append(str, options) { + this.addSource({ + content: new MagicString(str), + separator: (options && options.separator) || '', }); - }); - var mappings = new Mappings(options.hires); + return this; + } + + clone() { + const bundle = new Bundle$1({ + intro: this.intro, + separator: this.separator, + }); + + this.sources.forEach((source) => { + bundle.addSource({ + filename: source.filename, + content: source.content.clone(), + separator: source.separator, + }); + }); - if (this.intro) { - mappings.advance(this.intro); + return bundle; } - this.sources.forEach(function (source, i) { - if (i > 0) { - mappings.advance(this$1.separator); - } + generateDecodedMap(options = {}) { + const names = []; + this.sources.forEach((source) => { + Object.keys(source.content.storedNames).forEach((name) => { + if (!~names.indexOf(name)) names.push(name); + }); + }); - var sourceIndex = source.filename ? this$1.uniqueSourceIndexByFilename[source.filename] : -1; - var magicString = source.content; - var locate = getLocator(magicString.original); + const mappings = new Mappings(options.hires); - if (magicString.intro) { - mappings.advance(magicString.intro); + if (this.intro) { + mappings.advance(this.intro); } - magicString.firstChunk.eachNext(function (chunk) { - var loc = locate(chunk.start); + this.sources.forEach((source, i) => { + if (i > 0) { + mappings.advance(this.separator); + } + + const sourceIndex = source.filename ? this.uniqueSourceIndexByFilename[source.filename] : -1; + const magicString = source.content; + const locate = getLocator$1(magicString.original); - if (chunk.intro.length) { mappings.advance(chunk.intro); } + if (magicString.intro) { + mappings.advance(magicString.intro); + } - if (source.filename) { - if (chunk.edited) { - mappings.addEdit( - sourceIndex, - chunk.content, - loc, - chunk.storeName ? names.indexOf(chunk.original) : -1 - ); + magicString.firstChunk.eachNext((chunk) => { + const loc = locate(chunk.start); + + if (chunk.intro.length) mappings.advance(chunk.intro); + + if (source.filename) { + if (chunk.edited) { + mappings.addEdit( + sourceIndex, + chunk.content, + loc, + chunk.storeName ? names.indexOf(chunk.original) : -1 + ); + } else { + mappings.addUneditedChunk( + sourceIndex, + chunk, + magicString.original, + loc, + magicString.sourcemapLocations + ); + } } else { - mappings.addUneditedChunk( - sourceIndex, - chunk, - magicString.original, - loc, - magicString.sourcemapLocations - ); + mappings.advance(chunk.content); } - } else { - mappings.advance(chunk.content); - } - if (chunk.outro.length) { mappings.advance(chunk.outro); } - }); + if (chunk.outro.length) mappings.advance(chunk.outro); + }); - if (magicString.outro) { - mappings.advance(magicString.outro); - } - }); + if (magicString.outro) { + mappings.advance(magicString.outro); + } + }); - return { - file: options.file ? options.file.split(/[/\\]/).pop() : null, - sources: this.uniqueSources.map(function (source) { - return options.file ? getRelativePath(options.file, source.filename) : source.filename; - }), - sourcesContent: this.uniqueSources.map(function (source) { - return options.includeContent ? source.content : null; - }), - names: names, - mappings: mappings.raw - }; -}; + return { + file: options.file ? options.file.split(/[/\\]/).pop() : null, + sources: this.uniqueSources.map((source) => { + return options.file ? getRelativePath(options.file, source.filename) : source.filename; + }), + sourcesContent: this.uniqueSources.map((source) => { + return options.includeContent ? source.content : null; + }), + names, + mappings: mappings.raw, + }; + } -Bundle.prototype.generateMap = function generateMap (options) { - return new SourceMap(this.generateDecodedMap(options)); -}; + generateMap(options) { + return new SourceMap(this.generateDecodedMap(options)); + } -Bundle.prototype.getIndentString = function getIndentString () { - var indentStringCounts = {}; + getIndentString() { + const indentStringCounts = {}; - this.sources.forEach(function (source) { - var indentStr = source.content.indentStr; + this.sources.forEach((source) => { + const indentStr = source.content.indentStr; - if (indentStr === null) { return; } + if (indentStr === null) return; - if (!indentStringCounts[indentStr]) { indentStringCounts[indentStr] = 0; } - indentStringCounts[indentStr] += 1; - }); + if (!indentStringCounts[indentStr]) indentStringCounts[indentStr] = 0; + indentStringCounts[indentStr] += 1; + }); - return ( - Object.keys(indentStringCounts).sort(function (a, b) { - return indentStringCounts[a] - indentStringCounts[b]; - })[0] || '\t' - ); -}; + return ( + Object.keys(indentStringCounts).sort((a, b) => { + return indentStringCounts[a] - indentStringCounts[b]; + })[0] || '\t' + ); + } -Bundle.prototype.indent = function indent (indentStr) { - var this$1 = this; + indent(indentStr) { + if (!arguments.length) { + indentStr = this.getIndentString(); + } - if (!arguments.length) { - indentStr = this.getIndentString(); - } + if (indentStr === '') return this; // noop - if (indentStr === '') { return this; } // noop + let trailingNewline = !this.intro || this.intro.slice(-1) === '\n'; - var trailingNewline = !this.intro || this.intro.slice(-1) === '\n'; + this.sources.forEach((source, i) => { + const separator = source.separator !== undefined ? source.separator : this.separator; + const indentStart = trailingNewline || (i > 0 && /\r?\n$/.test(separator)); - this.sources.forEach(function (source, i) { - var separator = source.separator !== undefined ? source.separator : this$1.separator; - var indentStart = trailingNewline || (i > 0 && /\r?\n$/.test(separator)); + source.content.indent(indentStr, { + exclude: source.indentExclusionRanges, + indentStart, //: trailingNewline || /\r?\n$/.test( separator ) //true///\r?\n/.test( separator ) + }); - source.content.indent(indentStr, { - exclude: source.indentExclusionRanges, - indentStart: indentStart //: trailingNewline || /\r?\n$/.test( separator ) //true///\r?\n/.test( separator ) + trailingNewline = source.content.lastChar() === '\n'; }); - trailingNewline = source.content.lastChar() === '\n'; - }); + if (this.intro) { + this.intro = + indentStr + + this.intro.replace(/^[^\n]/gm, (match, index) => { + return index > 0 ? indentStr + match : match; + }); + } - if (this.intro) { - this.intro = - indentStr + - this.intro.replace(/^[^\n]/gm, function (match, index) { - return index > 0 ? indentStr + match : match; - }); + return this; } - return this; -}; + prepend(str) { + this.intro = str + this.intro; + return this; + } -Bundle.prototype.prepend = function prepend (str) { - this.intro = str + this.intro; - return this; -}; + toString() { + const body = this.sources + .map((source, i) => { + const separator = source.separator !== undefined ? source.separator : this.separator; + const str = (i > 0 ? separator : '') + source.content.toString(); -Bundle.prototype.toString = function toString () { - var this$1 = this; + return str; + }) + .join(''); - var body = this.sources - .map(function (source, i) { - var separator = source.separator !== undefined ? source.separator : this$1.separator; - var str = (i > 0 ? separator : '') + source.content.toString(); + return this.intro + body; + } - return str; - }) - .join(''); + isEmpty() { + if (this.intro.length && this.intro.trim()) return false; + if (this.sources.some((source) => !source.content.isEmpty())) return false; + return true; + } - return this.intro + body; -}; + length() { + return this.sources.reduce( + (length, source) => length + source.content.length(), + this.intro.length + ); + } -Bundle.prototype.isEmpty = function isEmpty () { - if (this.intro.length && this.intro.trim()) - { return false; } - if (this.sources.some(function (source) { return !source.content.isEmpty(); })) - { return false; } - return true; -}; + trimLines() { + return this.trim('[\\r\\n]'); + } -Bundle.prototype.length = function length () { - return this.sources.reduce(function (length, source) { return length + source.content.length(); }, this.intro.length); -}; + trim(charType) { + return this.trimStart(charType).trimEnd(charType); + } -Bundle.prototype.trimLines = function trimLines () { - return this.trim('[\\r\\n]'); -}; + trimStart(charType) { + const rx = new RegExp('^' + (charType || '\\s') + '+'); + this.intro = this.intro.replace(rx, ''); -Bundle.prototype.trim = function trim (charType) { - return this.trimStart(charType).trimEnd(charType); -}; + if (!this.intro) { + let source; + let i = 0; + + do { + source = this.sources[i++]; + if (!source) { + break; + } + } while (!source.content.trimStartAborted(charType)); + } -Bundle.prototype.trimStart = function trimStart (charType) { - var rx = new RegExp('^' + (charType || '\\s') + '+'); - this.intro = this.intro.replace(rx, ''); + return this; + } + + trimEnd(charType) { + const rx = new RegExp((charType || '\\s') + '+$'); - if (!this.intro) { - var source; - var i = 0; + let source; + let i = this.sources.length - 1; do { - source = this.sources[i++]; + source = this.sources[i--]; if (!source) { + this.intro = this.intro.replace(rx, ''); break; } - } while (!source.content.trimStartAborted(charType)); - } - - return this; -}; - -Bundle.prototype.trimEnd = function trimEnd (charType) { - var rx = new RegExp((charType || '\\s') + '+$'); - - var source; - var i = this.sources.length - 1; - - do { - source = this.sources[i--]; - if (!source) { - this.intro = this.intro.replace(rx, ''); - break; - } - } while (!source.content.trimEndAborted(charType)); + } while (!source.content.trimEndAborted(charType)); - return this; -}; + return this; + } +} +const ANY_SLASH_REGEX = /[/\\]/; function relative(from, to) { - const fromParts = from.split(/[/\\]/).filter(Boolean); - const toParts = to.split(/[/\\]/).filter(Boolean); + const fromParts = from.split(ANY_SLASH_REGEX).filter(Boolean); + const toParts = to.split(ANY_SLASH_REGEX).filter(Boolean); if (fromParts[0] === '.') fromParts.shift(); if (toParts[0] === '.') @@ -1461,4330 +1510,6261 @@ function relative(from, to) { return toParts.join('/'); } -const ArrowFunctionExpression = 'ArrowFunctionExpression'; -const BlockStatement = 'BlockStatement'; -const CallExpression = 'CallExpression'; -const ExpressionStatement = 'ExpressionStatement'; -const FunctionExpression = 'FunctionExpression'; -const Identifier = 'Identifier'; -const ImportDefaultSpecifier = 'ImportDefaultSpecifier'; -const ImportNamespaceSpecifier = 'ImportNamespaceSpecifier'; -const Program = 'Program'; -const Property = 'Property'; -const ReturnStatement = 'ReturnStatement'; +function getOrCreate(map, key, init) { + const existing = map.get(key); + if (existing) { + return existing; + } + const value = init(); + map.set(key, value); + return value; +} -function treeshakeNode(node, code, start, end) { - code.remove(start, end); - if (node.annotations) { - for (const annotation of node.annotations) { - if (annotation.start < start) { - code.remove(annotation.start, annotation.end); - } - else { - return; - } +const UnknownKey = Symbol('Unknown Key'); +const UnknownNonAccessorKey = Symbol('Unknown Non-Accessor Key'); +const UnknownInteger = Symbol('Unknown Integer'); +const EMPTY_PATH = []; +const UNKNOWN_PATH = [UnknownKey]; +// For deoptimizations, this means we are modifying an unknown property but did +// not lose track of the object or are creating a setter/getter; +// For assignment effects it means we do not check for setter/getter effects +// but only if something is mutated that is included, which is relevant for +// Object.defineProperty +const UNKNOWN_NON_ACCESSOR_PATH = [UnknownNonAccessorKey]; +const UNKNOWN_INTEGER_PATH = [UnknownInteger]; +const EntitiesKey = Symbol('Entities'); +class PathTracker { + constructor() { + this.entityPaths = Object.create(null, { + [EntitiesKey]: { value: new Set() } + }); + } + trackEntityAtPathAndGetIfTracked(path, entity) { + const trackedEntities = this.getEntities(path); + if (trackedEntities.has(entity)) + return true; + trackedEntities.add(entity); + return false; + } + withTrackedEntityAtPath(path, entity, onUntracked, returnIfTracked) { + const trackedEntities = this.getEntities(path); + if (trackedEntities.has(entity)) + return returnIfTracked; + trackedEntities.add(entity); + const result = onUntracked(); + trackedEntities.delete(entity); + return result; + } + getEntities(path) { + let currentPaths = this.entityPaths; + for (const pathSegment of path) { + currentPaths = currentPaths[pathSegment] = + currentPaths[pathSegment] || + Object.create(null, { [EntitiesKey]: { value: new Set() } }); } + return currentPaths[EntitiesKey]; } } -function removeAnnotations(node, code) { - if (!node.annotations && node.parent.type === ExpressionStatement) { - node = node.parent; +const SHARED_RECURSION_TRACKER = new PathTracker(); +class DiscriminatedPathTracker { + constructor() { + this.entityPaths = Object.create(null, { + [EntitiesKey]: { value: new Map() } + }); } - if (node.annotations) { - for (const annotation of node.annotations) { - code.remove(annotation.start, annotation.end); + trackEntityAtPathAndGetIfTracked(path, discriminator, entity) { + let currentPaths = this.entityPaths; + for (const pathSegment of path) { + currentPaths = currentPaths[pathSegment] = + currentPaths[pathSegment] || + Object.create(null, { [EntitiesKey]: { value: new Map() } }); } + const trackedEntities = getOrCreate(currentPaths[EntitiesKey], discriminator, () => new Set()); + if (trackedEntities.has(entity)) + return true; + trackedEntities.add(entity); + return false; } } -const NO_SEMICOLON = { isNoStatement: true }; -// This assumes there are only white-space and comments between start and the string we are looking for -function findFirstOccurrenceOutsideComment(code, searchString, start = 0) { - let searchPos, charCodeAfterSlash; - searchPos = code.indexOf(searchString, start); - while (true) { - start = code.indexOf('/', start); - if (start === -1 || start >= searchPos) - return searchPos; - charCodeAfterSlash = code.charCodeAt(++start); - ++start; - // With our assumption, '/' always starts a comment. Determine comment type: - start = - charCodeAfterSlash === 47 /*"/"*/ - ? code.indexOf('\n', start) + 1 - : code.indexOf('*/', start) + 2; - if (start > searchPos) { - searchPos = code.indexOf(searchString, start); - } +const UnknownValue = Symbol('Unknown Value'); +const UnknownTruthyValue = Symbol('Unknown Truthy Value'); +class ExpressionEntity { + constructor() { + this.included = false; } -} -const WHITESPACE = /\s/; -function findNonWhiteSpace(code, index) { - while (index < code.length && WHITESPACE.test(code[index])) - index++; - return index; -} -// This assumes "code" only contains white-space and comments -function findFirstLineBreakOutsideComment(code) { - let lineBreakPos, charCodeAfterSlash, start = 0; - lineBreakPos = code.indexOf('\n', start); - while (true) { - start = code.indexOf('/', start); - if (start === -1 || start > lineBreakPos) - return lineBreakPos; - // With our assumption, '/' always starts a comment. Determine comment type: - charCodeAfterSlash = code.charCodeAt(++start); - if (charCodeAfterSlash === 47 /*"/"*/) - return lineBreakPos; - start = code.indexOf('*/', start + 2) + 2; - if (start > lineBreakPos) { - lineBreakPos = code.indexOf('\n', start); - } + deoptimizePath(_path) { } + deoptimizeThisOnInteractionAtPath({ thisArg }, _path, _recursionTracker) { + thisArg.deoptimizePath(UNKNOWN_PATH); } -} -function renderStatementList(statements, code, start, end, options) { - let currentNode, currentNodeStart, currentNodeNeedsBoundaries, nextNodeStart; - let nextNode = statements[0]; - let nextNodeNeedsBoundaries = !nextNode.included || nextNode.needsBoundaries; - if (nextNodeNeedsBoundaries) { - nextNodeStart = - start + findFirstLineBreakOutsideComment(code.original.slice(start, nextNode.start)) + 1; + /** + * If possible it returns a stringifyable literal value for this node that can be used + * for inlining or comparing values. + * Otherwise it should return UnknownValue. + */ + getLiteralValueAtPath(_path, _recursionTracker, _origin) { + return UnknownValue; } - for (let nextIndex = 1; nextIndex <= statements.length; nextIndex++) { - currentNode = nextNode; - currentNodeStart = nextNodeStart; - currentNodeNeedsBoundaries = nextNodeNeedsBoundaries; - nextNode = statements[nextIndex]; - nextNodeNeedsBoundaries = - nextNode === undefined ? false : !nextNode.included || nextNode.needsBoundaries; - if (currentNodeNeedsBoundaries || nextNodeNeedsBoundaries) { - nextNodeStart = - currentNode.end + - findFirstLineBreakOutsideComment(code.original.slice(currentNode.end, nextNode === undefined ? end : nextNode.start)) + - 1; - if (currentNode.included) { - currentNodeNeedsBoundaries - ? currentNode.render(code, options, { - end: nextNodeStart, - start: currentNodeStart - }) - : currentNode.render(code, options); - } - else { - treeshakeNode(currentNode, code, currentNodeStart, nextNodeStart); - } - } - else { - currentNode.render(code, options); + getReturnExpressionWhenCalledAtPath(_path, _interaction, _recursionTracker, _origin) { + return UNKNOWN_EXPRESSION; + } + hasEffectsOnInteractionAtPath(_path, _interaction, _context) { + return true; + } + include(_context, _includeChildrenRecursively, _options) { + this.included = true; + } + includeCallArguments(context, args) { + for (const arg of args) { + arg.include(context, false); } } + shouldBeIncluded(_context) { + return true; + } } -// This assumes that the first character is not part of the first node -function getCommaSeparatedNodesWithBoundaries(nodes, code, start, end) { - const splitUpNodes = []; - let node, nextNode, nextNodeStart, contentEnd, char; - let separator = start - 1; - for (let nextIndex = 0; nextIndex < nodes.length; nextIndex++) { - nextNode = nodes[nextIndex]; - if (node !== undefined) { - separator = - node.end + - findFirstOccurrenceOutsideComment(code.original.slice(node.end, nextNode.start), ','); +const UNKNOWN_EXPRESSION = new (class UnknownExpression extends ExpressionEntity { +})(); + +const INTERACTION_ACCESSED = 0; +const INTERACTION_ASSIGNED = 1; +const INTERACTION_CALLED = 2; +const NODE_INTERACTION_UNKNOWN_ACCESS = { + thisArg: null, + type: INTERACTION_ACCESSED +}; +const UNKNOWN_ARG = [UNKNOWN_EXPRESSION]; +const NODE_INTERACTION_UNKNOWN_ASSIGNMENT = { + args: UNKNOWN_ARG, + thisArg: null, + type: INTERACTION_ASSIGNED +}; +const NO_ARGS = []; +// While this is technically a call without arguments, we can compare against +// this reference in places where precise values or thisArg would make a +// difference +const NODE_INTERACTION_UNKNOWN_CALL = { + args: NO_ARGS, + thisArg: null, + type: INTERACTION_CALLED, + withNew: false +}; + +class Variable extends ExpressionEntity { + constructor(name) { + super(); + this.name = name; + this.alwaysRendered = false; + this.initReached = false; + this.isId = false; + this.isReassigned = false; + this.kind = null; + this.renderBaseName = null; + this.renderName = null; + } + /** + * Binds identifiers that reference this variable to this variable. + * Necessary to be able to change variable names. + */ + addReference(_identifier) { } + getBaseVariableName() { + return this.renderBaseName || this.renderName || this.name; + } + getName(getPropertyAccess) { + const name = this.renderName || this.name; + return this.renderBaseName ? `${this.renderBaseName}${getPropertyAccess(name)}` : name; + } + hasEffectsOnInteractionAtPath(path, { type }, _context) { + return type !== INTERACTION_ACCESSED || path.length > 0; + } + /** + * Marks this variable as being part of the bundle, which is usually the case when one of + * its identifiers becomes part of the bundle. Returns true if it has not been included + * previously. + * Once a variable is included, it should take care all its declarations are included. + */ + include() { + this.included = true; + } + markCalledFromTryStatement() { } + setRenderNames(baseName, name) { + this.renderBaseName = baseName; + this.renderName = name; + } +} + +class ExternalVariable extends Variable { + constructor(module, name) { + super(name); + this.referenced = false; + this.module = module; + this.isNamespace = name === '*'; + } + addReference(identifier) { + this.referenced = true; + if (this.name === 'default' || this.name === '*') { + this.module.suggestName(identifier.name); } - nextNodeStart = contentEnd = - separator + - 2 + - findFirstLineBreakOutsideComment(code.original.slice(separator + 1, nextNode.start)); - while (((char = code.original.charCodeAt(nextNodeStart)), - char === 32 /*" "*/ || char === 9 /*"\t"*/ || char === 10 /*"\n"*/ || char === 13) /*"\r"*/) - nextNodeStart++; - if (node !== undefined) { - splitUpNodes.push({ - contentEnd, - end: nextNodeStart, - node, - separator, - start - }); + } + hasEffectsOnInteractionAtPath(path, { type }) { + return type !== INTERACTION_ACCESSED || path.length > (this.isNamespace ? 1 : 0); + } + include() { + if (!this.included) { + this.included = true; + this.module.used = true; } - node = nextNode; - start = nextNodeStart; } - splitUpNodes.push({ - contentEnd: end, - end, - node: node, - separator: null, - start - }); - return splitUpNodes; } -// This assumes there are only white-space and comments between start and end -function removeLineBreaks(code, start, end) { - while (true) { - const lineBreakPos = findFirstLineBreakOutsideComment(code.original.slice(start, end)); - if (lineBreakPos === -1) { - break; + +const BLANK = Object.freeze(Object.create(null)); +const EMPTY_OBJECT = Object.freeze({}); +const EMPTY_ARRAY = Object.freeze([]); + +function getLocator(source, options) { + if (options === void 0) { options = {}; } + var offsetLine = options.offsetLine || 0; + var offsetColumn = options.offsetColumn || 0; + var originalLines = source.split('\n'); + var start = 0; + var lineRanges = originalLines.map(function (line, i) { + var end = start + line.length + 1; + var range = { start: start, end: end, line: i }; + start = end; + return range; + }); + var i = 0; + function rangeContains(range, index) { + return range.start <= index && index < range.end; + } + function getLocation(range, index) { + return { line: offsetLine + range.line, column: offsetColumn + index - range.start, character: index }; + } + function locate(search, startIndex) { + if (typeof search === 'string') { + search = source.indexOf(search, startIndex || 0); + } + var range = lineRanges[i]; + var d = search >= range.end ? 1 : -1; + while (range) { + if (rangeContains(range, search)) + return getLocation(range, search); + i += d; + range = lineRanges[i]; } - start = start + lineBreakPos + 1; - code.remove(start - 1, start); } + return locate; } - -function getSystemExportStatement(exportedVariables, options) { - const _ = options.compact ? '' : ' '; - if (exportedVariables.length === 1 && - options.exportNamesByVariable.get(exportedVariables[0]).length === 1) { - const variable = exportedVariables[0]; - return `exports('${options.exportNamesByVariable.get(variable)}',${_}${variable.getName()})`; +function locate(source, search, options) { + if (typeof options === 'number') { + throw new Error('locate takes a { startIndex, offsetLine, offsetColumn } object as the third argument'); } - else { - return `exports({${_}${exportedVariables - .map(variable => { - return options.exportNamesByVariable - .get(variable) - .map(exportName => `${exportName}:${_}${variable.getName()}`) - .join(`,${_}`); - }) - .join(`,${_}`)}${_}})`; - } -} -function getSystemExportFunctionLeft(exportedVariables, setFromExpression, options) { - const _ = options.compact ? '' : ' '; - const s = options.compact ? '' : ';'; - return `function${_}(v)${_}{${_}return exports({${_}${exportedVariables - .map(variable => { - return options.exportNamesByVariable - .get(variable) - .map(exportName => `${exportName}:${_}${setFromExpression ? variable.getName() : 'v'}`) - .join(`,${_}`); - }) - .join(`,${_}`)}${_}}),${_}v${s}${_}}(`; + return getLocator(source, options)(search, options && options.startIndex); } -const chars$1 = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_$'; -const base = 64; -function toBase64(num) { - let outStr = ''; - do { - const curDigit = num % base; - num = Math.floor(num / base); - outStr = chars$1[curDigit] + outStr; - } while (num !== 0); - return outStr; +function spaces(i) { + let result = ''; + while (i--) + result += ' '; + return result; +} +function tabsToSpaces(str) { + return str.replace(/^\t+/, match => match.split('\t').join(' ')); +} +function getCodeFrame(source, line, column) { + let lines = source.split('\n'); + const frameStart = Math.max(0, line - 3); + let frameEnd = Math.min(line + 2, lines.length); + lines = lines.slice(frameStart, frameEnd); + while (!/\S/.test(lines[lines.length - 1])) { + lines.pop(); + frameEnd -= 1; + } + const digits = String(frameEnd).length; + return lines + .map((str, i) => { + const isErrorLine = frameStart + i + 1 === line; + let lineNum = String(i + frameStart + 1); + while (lineNum.length < digits) + lineNum = ` ${lineNum}`; + if (isErrorLine) { + const indicator = spaces(digits + 2 + tabsToSpaces(str.slice(0, column)).length) + '^'; + return `${lineNum}: ${tabsToSpaces(str)}\n${indicator}`; + } + return `${lineNum}: ${tabsToSpaces(str)}`; + }) + .join('\n'); } -// Verified on IE 6/7 that these keywords can't be used for object properties without escaping: -// break case catch class const continue debugger default delete do -// else enum export extends false finally for function if import -// in instanceof new null return super switch this throw true -// try typeof var void while with -const RESERVED_NAMES = Object.assign(Object.create(null), { - await: true, - break: true, - case: true, - catch: true, - class: true, - const: true, - continue: true, - debugger: true, - default: true, - delete: true, - do: true, - else: true, - enum: true, - eval: true, - export: true, - extends: true, - false: true, - finally: true, - for: true, - function: true, - if: true, - implements: true, - import: true, - in: true, - instanceof: true, - interface: true, - let: true, - new: true, - null: true, - package: true, - private: true, - protected: true, - public: true, - return: true, - static: true, - super: true, - switch: true, - this: true, - throw: true, - true: true, - try: true, - typeof: true, - undefined: true, - var: true, - void: true, - while: true, - with: true, - yield: true -}); - -function getSafeName(baseName, usedNames) { - let safeName = baseName; - let count = 1; - while (usedNames.has(safeName) || RESERVED_NAMES[safeName]) { - safeName = `${baseName}$${toBase64(count++)}`; +function printQuotedStringList(list, verbs) { + const isSingleItem = list.length <= 1; + const quotedList = list.map(item => `"${item}"`); + let output = isSingleItem + ? quotedList[0] + : `${quotedList.slice(0, -1).join(', ')} and ${quotedList.slice(-1)[0]}`; + if (verbs) { + output += ` ${isSingleItem ? verbs[0] : verbs[1]}`; } - usedNames.add(safeName); - return safeName; + return output; } -const NO_ARGS = []; +const ABSOLUTE_PATH_REGEX = /^(?:\/|(?:[A-Za-z]:)?[\\|/])/; +const RELATIVE_PATH_REGEX = /^\.?\.(\/|$)/; +function isAbsolute(path) { + return ABSOLUTE_PATH_REGEX.test(path); +} +function isRelative(path) { + return RELATIVE_PATH_REGEX.test(path); +} +const BACKSLASH_REGEX = /\\/g; +function normalize(path) { + return path.replace(BACKSLASH_REGEX, '/'); +} -const UnknownKey = Symbol('Unknown Key'); -const EMPTY_PATH = []; -const UNKNOWN_PATH = [UnknownKey]; -const EntitiesKey = Symbol('Entities'); -class PathTracker { - constructor() { - this.entityPaths = Object.create(null, { [EntitiesKey]: { value: new Set() } }); - } - getEntities(path) { - let currentPaths = this.entityPaths; - for (const pathSegment of path) { - currentPaths = currentPaths[pathSegment] = - currentPaths[pathSegment] || - Object.create(null, { [EntitiesKey]: { value: new Set() } }); - } - return currentPaths[EntitiesKey]; - } +function getAliasName(id) { + const base = basename(id); + return base.substring(0, base.length - extname(id).length); } -const SHARED_RECURSION_TRACKER = new PathTracker(); -class DiscriminatedPathTracker { - constructor() { - this.entityPaths = Object.create(null, { - [EntitiesKey]: { value: new Map() } - }); +function relativeId(id) { + if (!isAbsolute(id)) + return id; + return relative(resolve(), id); +} +function isPathFragment(name) { + // starting with "/", "./", "../", "C:/" + return (name[0] === '/' || (name[0] === '.' && (name[1] === '/' || name[1] === '.')) || isAbsolute(name)); +} +const UPPER_DIR_REGEX = /^(\.\.\/)*\.\.$/; +function getImportPath(importerId, targetPath, stripJsExtension, ensureFileName) { + let relativePath = normalize(relative(dirname(importerId), targetPath)); + if (stripJsExtension && relativePath.endsWith('.js')) { + relativePath = relativePath.slice(0, -3); } - getEntities(path, discriminator) { - let currentPaths = this.entityPaths; - for (const pathSegment of path) { - currentPaths = currentPaths[pathSegment] = - currentPaths[pathSegment] || - Object.create(null, { [EntitiesKey]: { value: new Map() } }); + if (ensureFileName) { + if (relativePath === '') + return '../' + basename(targetPath); + if (UPPER_DIR_REGEX.test(relativePath)) { + return relativePath + .split('/') + .concat(['..', basename(targetPath)]) + .join('/'); } - const entities = currentPaths[EntitiesKey]; - const result = entities.get(discriminator) || new Set(); - entities.set(discriminator, result); - return result; } + return !relativePath ? '.' : relativePath.startsWith('..') ? relativePath : './' + relativePath; } -function assembleMemberDescriptions(memberDescriptions, inheritedDescriptions = null) { - return Object.create(inheritedDescriptions, memberDescriptions); +function error(base) { + if (!(base instanceof Error)) + base = Object.assign(new Error(base.message), base); + throw base; } -const UnknownValue = Symbol('Unknown Value'); -const UNKNOWN_EXPRESSION = { - deoptimizePath: () => { }, - getLiteralValueAtPath: () => UnknownValue, - getReturnExpressionWhenCalledAtPath: () => UNKNOWN_EXPRESSION, - hasEffectsWhenAccessedAtPath: path => path.length > 0, - hasEffectsWhenAssignedAtPath: path => path.length > 0, - hasEffectsWhenCalledAtPath: () => true, - include: () => { }, - includeCallArguments(context, args) { - for (const arg of args) { - arg.include(context, false); - } - }, - included: true, - toString: () => '[[UNKNOWN]]' -}; -const UNDEFINED_EXPRESSION = { - deoptimizePath: () => { }, - getLiteralValueAtPath: () => undefined, - getReturnExpressionWhenCalledAtPath: () => UNKNOWN_EXPRESSION, - hasEffectsWhenAccessedAtPath: path => path.length > 0, - hasEffectsWhenAssignedAtPath: path => path.length > 0, - hasEffectsWhenCalledAtPath: () => true, - include: () => { }, - includeCallArguments() { }, - included: true, - toString: () => 'undefined' -}; -const returnsUnknown = { - value: { - callsArgs: null, - mutatesSelf: false, - returns: null, - returnsPrimitive: UNKNOWN_EXPRESSION - } -}; -const mutatesSelfReturnsUnknown = { - value: { returns: null, returnsPrimitive: UNKNOWN_EXPRESSION, callsArgs: null, mutatesSelf: true } -}; -const callsArgReturnsUnknown = { - value: { returns: null, returnsPrimitive: UNKNOWN_EXPRESSION, callsArgs: [0], mutatesSelf: false } -}; -class UnknownArrayExpression { - constructor() { - this.included = false; +function augmentCodeLocation(props, pos, source, id) { + if (typeof pos === 'object') { + const { line, column } = pos; + props.loc = { column, file: id, line }; } - deoptimizePath() { } - getLiteralValueAtPath() { - return UnknownValue; - } - getReturnExpressionWhenCalledAtPath(path) { - if (path.length === 1) { - return getMemberReturnExpressionWhenCalled(arrayMembers, path[0]); - } - return UNKNOWN_EXPRESSION; - } - hasEffectsWhenAccessedAtPath(path) { - return path.length > 1; - } - hasEffectsWhenAssignedAtPath(path) { - return path.length > 1; - } - hasEffectsWhenCalledAtPath(path, callOptions, context) { - if (path.length === 1) { - return hasMemberEffectWhenCalled(arrayMembers, path[0], this.included, callOptions, context); - } - return true; - } - include() { - this.included = true; - } - includeCallArguments(context, args) { - for (const arg of args) { - arg.include(context, false); - } + else { + props.pos = pos; + const { line, column } = locate(source, pos, { offsetLine: 1 }); + props.loc = { column, file: id, line }; } - toString() { - return '[[UNKNOWN ARRAY]]'; + if (props.frame === undefined) { + const { line, column } = props.loc; + props.frame = getCodeFrame(source, line, column); } } -const returnsArray = { - value: { - callsArgs: null, - mutatesSelf: false, - returns: UnknownArrayExpression, - returnsPrimitive: null - } -}; -const mutatesSelfReturnsArray = { - value: { - callsArgs: null, - mutatesSelf: true, - returns: UnknownArrayExpression, - returnsPrimitive: null - } -}; -const callsArgReturnsArray = { - value: { - callsArgs: [0], - mutatesSelf: false, - returns: UnknownArrayExpression, - returnsPrimitive: null - } -}; -const callsArgMutatesSelfReturnsArray = { - value: { - callsArgs: [0], - mutatesSelf: true, - returns: UnknownArrayExpression, - returnsPrimitive: null - } -}; -const UNKNOWN_LITERAL_BOOLEAN = { - deoptimizePath: () => { }, - getLiteralValueAtPath: () => UnknownValue, - getReturnExpressionWhenCalledAtPath: path => { - if (path.length === 1) { - return getMemberReturnExpressionWhenCalled(literalBooleanMembers, path[0]); - } - return UNKNOWN_EXPRESSION; - }, - hasEffectsWhenAccessedAtPath: path => path.length > 1, - hasEffectsWhenAssignedAtPath: path => path.length > 0, - hasEffectsWhenCalledAtPath: path => { - if (path.length === 1) { - const subPath = path[0]; - return typeof subPath !== 'string' || !literalBooleanMembers[subPath]; - } - return true; - }, - include: () => { }, - includeCallArguments(context, args) { - for (const arg of args) { - arg.include(context, false); - } - }, - included: true, - toString: () => '[[UNKNOWN BOOLEAN]]' -}; -const returnsBoolean = { - value: { - callsArgs: null, - mutatesSelf: false, - returns: null, - returnsPrimitive: UNKNOWN_LITERAL_BOOLEAN - } -}; -const callsArgReturnsBoolean = { - value: { - callsArgs: [0], - mutatesSelf: false, - returns: null, - returnsPrimitive: UNKNOWN_LITERAL_BOOLEAN - } -}; -const UNKNOWN_LITERAL_NUMBER = { - deoptimizePath: () => { }, - getLiteralValueAtPath: () => UnknownValue, - getReturnExpressionWhenCalledAtPath: path => { - if (path.length === 1) { - return getMemberReturnExpressionWhenCalled(literalNumberMembers, path[0]); - } - return UNKNOWN_EXPRESSION; - }, - hasEffectsWhenAccessedAtPath: path => path.length > 1, - hasEffectsWhenAssignedAtPath: path => path.length > 0, - hasEffectsWhenCalledAtPath: path => { - if (path.length === 1) { - const subPath = path[0]; - return typeof subPath !== 'string' || !literalNumberMembers[subPath]; - } - return true; - }, - include: () => { }, - includeCallArguments(context, args) { - for (const arg of args) { - arg.include(context, false); - } - }, - included: true, - toString: () => '[[UNKNOWN NUMBER]]' -}; -const returnsNumber = { - value: { - callsArgs: null, - mutatesSelf: false, - returns: null, - returnsPrimitive: UNKNOWN_LITERAL_NUMBER - } -}; -const mutatesSelfReturnsNumber = { - value: { - callsArgs: null, - mutatesSelf: true, - returns: null, - returnsPrimitive: UNKNOWN_LITERAL_NUMBER - } -}; -const callsArgReturnsNumber = { - value: { - callsArgs: [0], - mutatesSelf: false, - returns: null, - returnsPrimitive: UNKNOWN_LITERAL_NUMBER - } -}; -const UNKNOWN_LITERAL_STRING = { - deoptimizePath: () => { }, - getLiteralValueAtPath: () => UnknownValue, - getReturnExpressionWhenCalledAtPath: path => { - if (path.length === 1) { - return getMemberReturnExpressionWhenCalled(literalStringMembers, path[0]); - } - return UNKNOWN_EXPRESSION; - }, - hasEffectsWhenAccessedAtPath: path => path.length > 1, - hasEffectsWhenAssignedAtPath: path => path.length > 0, - hasEffectsWhenCalledAtPath: (path, callOptions, context) => { - if (path.length === 1) { - return hasMemberEffectWhenCalled(literalStringMembers, path[0], true, callOptions, context); - } - return true; - }, - include: () => { }, - includeCallArguments(context, args) { - for (const arg of args) { - arg.include(context, false); - } - }, - included: true, - toString: () => '[[UNKNOWN STRING]]' -}; -const returnsString = { - value: { - callsArgs: null, - mutatesSelf: false, - returns: null, - returnsPrimitive: UNKNOWN_LITERAL_STRING - } -}; -class UnknownObjectExpression { - constructor() { - this.included = false; - } - deoptimizePath() { } - getLiteralValueAtPath() { - return UnknownValue; - } - getReturnExpressionWhenCalledAtPath(path) { - if (path.length === 1) { - return getMemberReturnExpressionWhenCalled(objectMembers, path[0]); - } - return UNKNOWN_EXPRESSION; - } - hasEffectsWhenAccessedAtPath(path) { - return path.length > 1; - } - hasEffectsWhenAssignedAtPath(path) { - return path.length > 1; - } - hasEffectsWhenCalledAtPath(path, callOptions, context) { - if (path.length === 1) { - return hasMemberEffectWhenCalled(objectMembers, path[0], this.included, callOptions, context); - } - return true; - } - include() { - this.included = true; - } - includeCallArguments(context, args) { - for (const arg of args) { - arg.include(context, false); - } - } - toString() { - return '[[UNKNOWN OBJECT]]'; - } +var Errors; +(function (Errors) { + Errors["ALREADY_CLOSED"] = "ALREADY_CLOSED"; + Errors["ASSET_NOT_FINALISED"] = "ASSET_NOT_FINALISED"; + Errors["ASSET_NOT_FOUND"] = "ASSET_NOT_FOUND"; + Errors["ASSET_SOURCE_ALREADY_SET"] = "ASSET_SOURCE_ALREADY_SET"; + Errors["ASSET_SOURCE_MISSING"] = "ASSET_SOURCE_MISSING"; + Errors["BAD_LOADER"] = "BAD_LOADER"; + Errors["CANNOT_EMIT_FROM_OPTIONS_HOOK"] = "CANNOT_EMIT_FROM_OPTIONS_HOOK"; + Errors["CHUNK_NOT_GENERATED"] = "CHUNK_NOT_GENERATED"; + Errors["CHUNK_INVALID"] = "CHUNK_INVALID"; + Errors["CIRCULAR_REEXPORT"] = "CIRCULAR_REEXPORT"; + Errors["CYCLIC_CROSS_CHUNK_REEXPORT"] = "CYCLIC_CROSS_CHUNK_REEXPORT"; + Errors["DEPRECATED_FEATURE"] = "DEPRECATED_FEATURE"; + Errors["EXTERNAL_SYNTHETIC_EXPORTS"] = "EXTERNAL_SYNTHETIC_EXPORTS"; + Errors["FILE_NAME_CONFLICT"] = "FILE_NAME_CONFLICT"; + Errors["FILE_NOT_FOUND"] = "FILE_NOT_FOUND"; + Errors["INPUT_HOOK_IN_OUTPUT_PLUGIN"] = "INPUT_HOOK_IN_OUTPUT_PLUGIN"; + Errors["INVALID_CHUNK"] = "INVALID_CHUNK"; + Errors["INVALID_EXPORT_OPTION"] = "INVALID_EXPORT_OPTION"; + Errors["INVALID_EXTERNAL_ID"] = "INVALID_EXTERNAL_ID"; + Errors["INVALID_OPTION"] = "INVALID_OPTION"; + Errors["INVALID_PLUGIN_HOOK"] = "INVALID_PLUGIN_HOOK"; + Errors["INVALID_ROLLUP_PHASE"] = "INVALID_ROLLUP_PHASE"; + Errors["MISSING_EXPORT"] = "MISSING_EXPORT"; + Errors["MISSING_IMPLICIT_DEPENDANT"] = "MISSING_IMPLICIT_DEPENDANT"; + Errors["MIXED_EXPORTS"] = "MIXED_EXPORTS"; + Errors["NAMESPACE_CONFLICT"] = "NAMESPACE_CONFLICT"; + Errors["AMBIGUOUS_EXTERNAL_NAMESPACES"] = "AMBIGUOUS_EXTERNAL_NAMESPACES"; + Errors["NO_TRANSFORM_MAP_OR_AST_WITHOUT_CODE"] = "NO_TRANSFORM_MAP_OR_AST_WITHOUT_CODE"; + Errors["PLUGIN_ERROR"] = "PLUGIN_ERROR"; + Errors["PREFER_NAMED_EXPORTS"] = "PREFER_NAMED_EXPORTS"; + Errors["SYNTHETIC_NAMED_EXPORTS_NEED_NAMESPACE_EXPORT"] = "SYNTHETIC_NAMED_EXPORTS_NEED_NAMESPACE_EXPORT"; + Errors["UNEXPECTED_NAMED_IMPORT"] = "UNEXPECTED_NAMED_IMPORT"; + Errors["UNRESOLVED_ENTRY"] = "UNRESOLVED_ENTRY"; + Errors["UNRESOLVED_IMPORT"] = "UNRESOLVED_IMPORT"; + Errors["VALIDATION_ERROR"] = "VALIDATION_ERROR"; +})(Errors || (Errors = {})); +function errAssetNotFinalisedForFileName(name) { + return { + code: Errors.ASSET_NOT_FINALISED, + message: `Plugin error - Unable to get file name for asset "${name}". Ensure that the source is set and that generate is called first.` + }; } -const objectMembers = assembleMemberDescriptions({ - hasOwnProperty: returnsBoolean, - isPrototypeOf: returnsBoolean, - propertyIsEnumerable: returnsBoolean, - toLocaleString: returnsString, - toString: returnsString, - valueOf: returnsUnknown -}); -const arrayMembers = assembleMemberDescriptions({ - concat: returnsArray, - copyWithin: mutatesSelfReturnsArray, - every: callsArgReturnsBoolean, - fill: mutatesSelfReturnsArray, - filter: callsArgReturnsArray, - find: callsArgReturnsUnknown, - findIndex: callsArgReturnsNumber, - forEach: callsArgReturnsUnknown, - includes: returnsBoolean, - indexOf: returnsNumber, - join: returnsString, - lastIndexOf: returnsNumber, - map: callsArgReturnsArray, - pop: mutatesSelfReturnsUnknown, - push: mutatesSelfReturnsNumber, - reduce: callsArgReturnsUnknown, - reduceRight: callsArgReturnsUnknown, - reverse: mutatesSelfReturnsArray, - shift: mutatesSelfReturnsUnknown, - slice: returnsArray, - some: callsArgReturnsBoolean, - sort: callsArgMutatesSelfReturnsArray, - splice: mutatesSelfReturnsArray, - unshift: mutatesSelfReturnsNumber -}, objectMembers); -const literalBooleanMembers = assembleMemberDescriptions({ - valueOf: returnsBoolean -}, objectMembers); -const literalNumberMembers = assembleMemberDescriptions({ - toExponential: returnsString, - toFixed: returnsString, - toLocaleString: returnsString, - toPrecision: returnsString, - valueOf: returnsNumber -}, objectMembers); -const literalStringMembers = assembleMemberDescriptions({ - charAt: returnsString, - charCodeAt: returnsNumber, - codePointAt: returnsNumber, - concat: returnsString, - endsWith: returnsBoolean, - includes: returnsBoolean, - indexOf: returnsNumber, - lastIndexOf: returnsNumber, - localeCompare: returnsNumber, - match: returnsBoolean, - normalize: returnsString, - padEnd: returnsString, - padStart: returnsString, - repeat: returnsString, - replace: { - value: { - callsArgs: [1], - mutatesSelf: false, - returns: null, - returnsPrimitive: UNKNOWN_LITERAL_STRING - } - }, - search: returnsNumber, - slice: returnsString, - split: returnsArray, - startsWith: returnsBoolean, - substr: returnsString, - substring: returnsString, - toLocaleLowerCase: returnsString, - toLocaleUpperCase: returnsString, - toLowerCase: returnsString, - toUpperCase: returnsString, - trim: returnsString, - valueOf: returnsString -}, objectMembers); -function getLiteralMembersForValue(value) { - switch (typeof value) { - case 'boolean': - return literalBooleanMembers; - case 'number': - return literalNumberMembers; - case 'string': - return literalStringMembers; - default: - return Object.create(null); - } +function errCannotEmitFromOptionsHook() { + return { + code: Errors.CANNOT_EMIT_FROM_OPTIONS_HOOK, + message: `Cannot emit files or set asset sources in the "outputOptions" hook, use the "renderStart" hook instead.` + }; } -function hasMemberEffectWhenCalled(members, memberName, parentIncluded, callOptions, context) { - if (typeof memberName !== 'string' || - !members[memberName] || - (members[memberName].mutatesSelf && parentIncluded)) - return true; - if (!members[memberName].callsArgs) - return false; - for (const argIndex of members[memberName].callsArgs) { - if (callOptions.args[argIndex] && - callOptions.args[argIndex].hasEffectsWhenCalledAtPath(EMPTY_PATH, { - args: NO_ARGS, - withNew: false - }, context)) - return true; - } - return false; +function errChunkNotGeneratedForFileName(name) { + return { + code: Errors.CHUNK_NOT_GENERATED, + message: `Plugin error - Unable to get file name for chunk "${name}". Ensure that generate is called first.` + }; } -function getMemberReturnExpressionWhenCalled(members, memberName) { - if (typeof memberName !== 'string' || !members[memberName]) - return UNKNOWN_EXPRESSION; - return members[memberName].returnsPrimitive !== null - ? members[memberName].returnsPrimitive - : new members[memberName].returns(); +function errChunkInvalid({ fileName, code }, exception) { + const errorProps = { + code: Errors.CHUNK_INVALID, + message: `Chunk "${fileName}" is not valid JavaScript: ${exception.message}.` + }; + augmentCodeLocation(errorProps, exception.loc, code, fileName); + return errorProps; } - -class Variable { - constructor(name) { - this.alwaysRendered = false; - this.included = false; - this.isId = false; - this.isReassigned = false; - this.renderBaseName = null; - this.renderName = null; - this.name = name; - } - /** - * Binds identifiers that reference this variable to this variable. - * Necessary to be able to change variable names. - */ - addReference(_identifier) { } - deoptimizePath(_path) { } - getBaseVariableName() { - return this.renderBaseName || this.renderName || this.name; - } - getLiteralValueAtPath(_path, _recursionTracker, _origin) { - return UnknownValue; - } - getName() { - const name = this.renderName || this.name; - return this.renderBaseName ? `${this.renderBaseName}.${name}` : name; - } - getReturnExpressionWhenCalledAtPath(_path, _recursionTracker, _origin) { - return UNKNOWN_EXPRESSION; - } - hasEffectsWhenAccessedAtPath(path, _context) { - return path.length > 0; - } - hasEffectsWhenAssignedAtPath(_path, _context) { - return true; - } - hasEffectsWhenCalledAtPath(_path, _callOptions, _context) { - return true; - } - /** - * Marks this variable as being part of the bundle, which is usually the case when one of - * its identifiers becomes part of the bundle. Returns true if it has not been included - * previously. - * Once a variable is included, it should take care all its declarations are included. - */ - include() { - this.included = true; - } - includeCallArguments(context, args) { - for (const arg of args) { - arg.include(context, false); - } - } - markCalledFromTryStatement() { } - setRenderNames(baseName, name) { - this.renderBaseName = baseName; - this.renderName = name; - } - setSafeName(name) { - this.renderName = name; - } +function errCircularReexport(exportName, importedModule) { + return { + code: Errors.CIRCULAR_REEXPORT, + id: importedModule, + message: `"${exportName}" cannot be exported from ${relativeId(importedModule)} as it is a reexport that references itself.` + }; } - -class ExternalVariable extends Variable { - constructor(module, name) { - super(name); - this.module = module; - this.isNamespace = name === '*'; - this.referenced = false; - } - addReference(identifier) { - this.referenced = true; - if (this.name === 'default' || this.name === '*') { - this.module.suggestName(identifier.name); - } - } - include() { - if (!this.included) { - this.included = true; - this.module.used = true; - } - } +function errCyclicCrossChunkReexport(exportName, exporter, reexporter, importer) { + return { + code: Errors.CYCLIC_CROSS_CHUNK_REEXPORT, + exporter, + importer, + message: `Export "${exportName}" of module ${relativeId(exporter)} was reexported through module ${relativeId(reexporter)} while both modules are dependencies of each other and will end up in different chunks by current Rollup settings. This scenario is not well supported at the moment as it will produce a circular dependency between chunks and will likely lead to broken execution order.\nEither change the import in ${relativeId(importer)} to point directly to the exporting module or do not use "preserveModules" to ensure these modules end up in the same chunk.`, + reexporter + }; } - -const reservedWords = 'break case class catch const continue debugger default delete do else export extends finally for function if import in instanceof let new return super switch this throw try typeof var void while with yield enum await implements package protected static interface private public'.split(' '); -const builtins = 'Infinity NaN undefined null true false eval uneval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Symbol Error EvalError InternalError RangeError ReferenceError SyntaxError TypeError URIError Number Math Date String RegExp Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array Map Set WeakMap WeakSet SIMD ArrayBuffer DataView JSON Promise Generator GeneratorFunction Reflect Proxy Intl'.split(' '); -const blacklisted = new Set(reservedWords.concat(builtins)); -const illegalCharacters = /[^$_a-zA-Z0-9]/g; -const startsWithDigit = (str) => /\d/.test(str[0]); -function isLegal(str) { - if (startsWithDigit(str) || blacklisted.has(str)) { - return false; - } - return !illegalCharacters.test(str); +function errAssetReferenceIdNotFoundForSetSource(assetReferenceId) { + return { + code: Errors.ASSET_NOT_FOUND, + message: `Plugin error - Unable to set the source for unknown asset "${assetReferenceId}".` + }; } -function makeLegal(str) { - str = str.replace(/-(\w)/g, (_, letter) => letter.toUpperCase()).replace(illegalCharacters, '_'); - if (startsWithDigit(str) || blacklisted.has(str)) - str = `_${str}`; - return str || '_'; +function errAssetSourceAlreadySet(name) { + return { + code: Errors.ASSET_SOURCE_ALREADY_SET, + message: `Unable to set the source for asset "${name}", source already set.` + }; } - -const absolutePath = /^(?:\/|(?:[A-Za-z]:)?[\\|/])/; -const relativePath = /^\.?\.\//; -function isAbsolute(path) { - return absolutePath.test(path); +function errNoAssetSourceSet(assetName) { + return { + code: Errors.ASSET_SOURCE_MISSING, + message: `Plugin error creating asset "${assetName}" - no asset source set.` + }; } -function isRelative(path) { - return relativePath.test(path); +function errBadLoader(id) { + return { + code: Errors.BAD_LOADER, + message: `Error loading ${relativeId(id)}: plugin load hook should return a string, a { code, map } object, or nothing/null` + }; } -function normalize(path) { - if (path.indexOf('\\') == -1) - return path; - return path.replace(/\\/g, '/'); +function errDeprecation(deprecation) { + return { + code: Errors.DEPRECATED_FEATURE, + ...(typeof deprecation === 'string' ? { message: deprecation } : deprecation) + }; } - -class ExternalModule { - constructor(options, id, moduleSideEffects) { - this.options = options; - this.dynamicImporters = []; - this.exportsNames = false; - this.exportsNamespace = false; - this.importers = []; - this.mostCommonSuggestion = 0; - this.reexported = false; - this.renderPath = undefined; - this.renormalizeRenderPath = false; - this.used = false; - this.id = id; - this.execIndex = Infinity; - this.moduleSideEffects = moduleSideEffects; - const parts = id.split(/[\\/]/); - this.variableName = makeLegal(parts.pop()); - this.nameSuggestions = Object.create(null); - this.declarations = Object.create(null); - this.exportedVariables = new Map(); - } - getVariableForExportName(name) { - if (name === '*') { - this.exportsNamespace = true; - } - else if (name !== 'default') { - this.exportsNames = true; - } - let declaration = this.declarations[name]; - if (declaration) - return declaration; - this.declarations[name] = declaration = new ExternalVariable(this, name); - this.exportedVariables.set(declaration, name); - return declaration; - } - setRenderPath(options, inputBase) { - this.renderPath = - typeof options.paths === 'function' ? options.paths(this.id) : options.paths[this.id]; - if (!this.renderPath) { - if (!isAbsolute(this.id)) { - this.renderPath = this.id; - } - else { - this.renderPath = normalize(relative$1(inputBase, this.id)); - this.renormalizeRenderPath = true; - } - } - return this.renderPath; - } - suggestName(name) { - if (!this.nameSuggestions[name]) - this.nameSuggestions[name] = 0; - this.nameSuggestions[name] += 1; - if (this.nameSuggestions[name] > this.mostCommonSuggestion) { - this.mostCommonSuggestion = this.nameSuggestions[name]; - this.variableName = name; - } - } - warnUnusedImports() { - const unused = Object.keys(this.declarations).filter(name => { - if (name === '*') - return false; - const declaration = this.declarations[name]; - return !declaration.included && !this.reexported && !declaration.referenced; - }); - if (unused.length === 0) - return; - const names = unused.length === 1 - ? `'${unused[0]}' is` - : `${unused - .slice(0, -1) - .map(name => `'${name}'`) - .join(', ')} and '${unused.slice(-1)}' are`; - this.options.onwarn({ - code: 'UNUSED_EXTERNAL_IMPORT', - message: `${names} imported from external module '${this.id}' but never used`, - names: unused, - source: this.id - }); - } +function errFileReferenceIdNotFoundForFilename(assetReferenceId) { + return { + code: Errors.FILE_NOT_FOUND, + message: `Plugin error - Unable to get file name for unknown file "${assetReferenceId}".` + }; } - -function markModuleAndImpureDependenciesAsExecuted(baseModule) { - baseModule.isExecuted = true; - const modules = [baseModule]; - const visitedModules = new Set(); - for (const module of modules) { - for (const dependency of [...module.dependencies, ...module.implicitlyLoadedBefore]) { - if (!(dependency instanceof ExternalModule) && - !dependency.isExecuted && - (dependency.moduleSideEffects || module.implicitlyLoadedBefore.has(dependency)) && - !visitedModules.has(dependency.id)) { - dependency.isExecuted = true; - visitedModules.add(dependency.id); - modules.push(dependency); - } - } - } +function errFileNameConflict(fileName) { + return { + code: Errors.FILE_NAME_CONFLICT, + message: `The emitted file "${fileName}" overwrites a previously emitted file of the same name.` + }; } - -const BROKEN_FLOW_NONE = 0; -const BROKEN_FLOW_BREAK_CONTINUE = 1; -const BROKEN_FLOW_ERROR_RETURN_LABEL = 2; -function createInclusionContext() { +function errInputHookInOutputPlugin(pluginName, hookName) { return { - brokenFlow: BROKEN_FLOW_NONE, - includedCallArguments: new Set(), - includedLabels: new Set() + code: Errors.INPUT_HOOK_IN_OUTPUT_PLUGIN, + message: `The "${hookName}" hook used by the output plugin ${pluginName} is a build time hook and will not be run for that plugin. Either this plugin cannot be used as an output plugin, or it should have an option to configure it as an output plugin.` }; } -function createHasEffectsContext() { +function errCannotAssignModuleToChunk(moduleId, assignToAlias, currentAlias) { return { - accessed: new PathTracker(), - assigned: new PathTracker(), - brokenFlow: BROKEN_FLOW_NONE, - called: new DiscriminatedPathTracker(), - ignore: { - breaks: false, - continues: false, - labels: new Set(), - returnAwaitYield: false - }, - includedLabels: new Set(), - instantiated: new DiscriminatedPathTracker(), - replacedVariableInits: new Map() + code: Errors.INVALID_CHUNK, + message: `Cannot assign ${relativeId(moduleId)} to the "${assignToAlias}" chunk as it is already in the "${currentAlias}" chunk.` }; } - -// To avoid infinite recursions -const MAX_PATH_DEPTH = 7; -class LocalVariable extends Variable { - constructor(name, declarator, init, context) { - super(name); - this.additionalInitializers = null; - this.calledFromTryStatement = false; - this.expressionsToBeDeoptimized = []; - this.declarations = declarator ? [declarator] : []; - this.init = init; - this.deoptimizationTracker = context.deoptimizationTracker; - this.module = context.module; - } - addDeclaration(identifier, init) { - this.declarations.push(identifier); - if (this.additionalInitializers === null) { - this.additionalInitializers = this.init === null ? [] : [this.init]; - this.init = UNKNOWN_EXPRESSION; - this.isReassigned = true; - } - if (init !== null) { - this.additionalInitializers.push(init); - } - } - consolidateInitializers() { - if (this.additionalInitializers !== null) { - for (const initializer of this.additionalInitializers) { - initializer.deoptimizePath(UNKNOWN_PATH); - } - this.additionalInitializers = null; - } - } - deoptimizePath(path) { - if (path.length > MAX_PATH_DEPTH || this.isReassigned) - return; - const trackedEntities = this.deoptimizationTracker.getEntities(path); - if (trackedEntities.has(this)) - return; - trackedEntities.add(this); - if (path.length === 0) { - if (!this.isReassigned) { - this.isReassigned = true; - const expressionsToBeDeoptimized = this.expressionsToBeDeoptimized; - this.expressionsToBeDeoptimized = []; - for (const expression of expressionsToBeDeoptimized) { - expression.deoptimizeCache(); - } - if (this.init) { - this.init.deoptimizePath(UNKNOWN_PATH); - } - } - } - else if (this.init) { - this.init.deoptimizePath(path); - } - } - getLiteralValueAtPath(path, recursionTracker, origin) { - if (this.isReassigned || !this.init || path.length > MAX_PATH_DEPTH) { - return UnknownValue; - } - const trackedEntities = recursionTracker.getEntities(path); - if (trackedEntities.has(this.init)) { - return UnknownValue; +function errInvalidExportOptionValue(optionValue) { + return { + code: Errors.INVALID_EXPORT_OPTION, + message: `"output.exports" must be "default", "named", "none", "auto", or left unspecified (defaults to "auto"), received "${optionValue}"`, + url: `https://rollupjs.org/guide/en/#outputexports` + }; +} +function errIncompatibleExportOptionValue(optionValue, keys, entryModule) { + return { + code: 'INVALID_EXPORT_OPTION', + message: `"${optionValue}" was specified for "output.exports", but entry module "${relativeId(entryModule)}" has the following exports: ${keys.join(', ')}` + }; +} +function errInternalIdCannotBeExternal(source, importer) { + return { + code: Errors.INVALID_EXTERNAL_ID, + message: `'${source}' is imported as an external by ${relativeId(importer)}, but is already an existing non-external module id.` + }; +} +function errInvalidOption(option, urlHash, explanation, value) { + return { + code: Errors.INVALID_OPTION, + message: `Invalid value ${value !== undefined ? `${JSON.stringify(value)} ` : ''}for option "${option}" - ${explanation}.`, + url: `https://rollupjs.org/guide/en/#${urlHash}` + }; +} +function errInvalidAddonPluginHook(hook, plugin) { + return { + code: Errors.INVALID_PLUGIN_HOOK, + hook, + message: `Error running plugin hook ${hook} for plugin ${plugin}, expected a string, a function hook or an object with a "handler" string or function.`, + plugin + }; +} +function errInvalidFunctionPluginHook(hook, plugin) { + return { + code: Errors.INVALID_PLUGIN_HOOK, + hook, + message: `Error running plugin hook ${hook} for plugin ${plugin}, expected a function hook or an object with a "handler" function.`, + plugin + }; +} +function errInvalidRollupPhaseForAddWatchFile() { + return { + code: Errors.INVALID_ROLLUP_PHASE, + message: `Cannot call addWatchFile after the build has finished.` + }; +} +function errInvalidRollupPhaseForChunkEmission() { + return { + code: Errors.INVALID_ROLLUP_PHASE, + message: `Cannot emit chunks after module loading has finished.` + }; +} +function errMissingExport(exportName, importingModule, importedModule) { + return { + code: Errors.MISSING_EXPORT, + message: `'${exportName}' is not exported by ${relativeId(importedModule)}, imported by ${relativeId(importingModule)}`, + url: `https://rollupjs.org/guide/en/#error-name-is-not-exported-by-module` + }; +} +function errImplicitDependantCannotBeExternal(unresolvedId, implicitlyLoadedBefore) { + return { + code: Errors.MISSING_IMPLICIT_DEPENDANT, + message: `Module "${relativeId(unresolvedId)}" that should be implicitly loaded before "${relativeId(implicitlyLoadedBefore)}" cannot be external.` + }; +} +function errUnresolvedImplicitDependant(unresolvedId, implicitlyLoadedBefore) { + return { + code: Errors.MISSING_IMPLICIT_DEPENDANT, + message: `Module "${relativeId(unresolvedId)}" that should be implicitly loaded before "${relativeId(implicitlyLoadedBefore)}" could not be resolved.` + }; +} +function errImplicitDependantIsNotIncluded(module) { + const implicitDependencies = Array.from(module.implicitlyLoadedBefore, dependency => relativeId(dependency.id)).sort(); + return { + code: Errors.MISSING_IMPLICIT_DEPENDANT, + message: `Module "${relativeId(module.id)}" that should be implicitly loaded before ${printQuotedStringList(implicitDependencies)} is not included in the module graph. Either it was not imported by an included module or only via a tree-shaken dynamic import, or no imported bindings were used and it had otherwise no side-effects.` + }; +} +function errMixedExport(facadeModuleId, name) { + return { + code: Errors.MIXED_EXPORTS, + id: facadeModuleId, + message: `Entry module "${relativeId(facadeModuleId)}" is using named and default exports together. Consumers of your bundle will have to use \`${name || 'chunk'}["default"]\` to access the default export, which may not be what you want. Use \`output.exports: "named"\` to disable this warning`, + url: `https://rollupjs.org/guide/en/#outputexports` + }; +} +function errNamespaceConflict(name, reexportingModuleId, sources) { + return { + code: Errors.NAMESPACE_CONFLICT, + message: `Conflicting namespaces: "${relativeId(reexportingModuleId)}" re-exports "${name}" from one of the modules ${printQuotedStringList(sources.map(moduleId => relativeId(moduleId)))} (will be ignored)`, + name, + reexporter: reexportingModuleId, + sources + }; +} +function errAmbiguousExternalNamespaces(name, reexportingModule, usedModule, sources) { + return { + code: Errors.AMBIGUOUS_EXTERNAL_NAMESPACES, + message: `Ambiguous external namespace resolution: "${relativeId(reexportingModule)}" re-exports "${name}" from one of the external modules ${printQuotedStringList(sources.map(module => relativeId(module)))}, guessing "${relativeId(usedModule)}".`, + name, + reexporter: reexportingModule, + sources + }; +} +function errNoTransformMapOrAstWithoutCode(pluginName) { + return { + code: Errors.NO_TRANSFORM_MAP_OR_AST_WITHOUT_CODE, + message: `The plugin "${pluginName}" returned a "map" or "ast" without returning ` + + 'a "code". This will be ignored.' + }; +} +function errPreferNamedExports(facadeModuleId) { + const file = relativeId(facadeModuleId); + return { + code: Errors.PREFER_NAMED_EXPORTS, + id: facadeModuleId, + message: `Entry module "${file}" is implicitly using "default" export mode, which means for CommonJS output that its default export is assigned to "module.exports". For many tools, such CommonJS output will not be interchangeable with the original ES module. If this is intended, explicitly set "output.exports" to either "auto" or "default", otherwise you might want to consider changing the signature of "${file}" to use named exports only.`, + url: `https://rollupjs.org/guide/en/#outputexports` + }; +} +function errSyntheticNamedExportsNeedNamespaceExport(id, syntheticNamedExportsOption) { + return { + code: Errors.SYNTHETIC_NAMED_EXPORTS_NEED_NAMESPACE_EXPORT, + id, + message: `Module "${relativeId(id)}" that is marked with 'syntheticNamedExports: ${JSON.stringify(syntheticNamedExportsOption)}' needs ${typeof syntheticNamedExportsOption === 'string' && syntheticNamedExportsOption !== 'default' + ? `an explicit export named "${syntheticNamedExportsOption}"` + : 'a default export'} that does not reexport an unresolved named export of the same module.` + }; +} +function errUnexpectedNamedImport(id, imported, isReexport) { + const importType = isReexport ? 'reexport' : 'import'; + return { + code: Errors.UNEXPECTED_NAMED_IMPORT, + id, + message: `The named export "${imported}" was ${importType}ed from the external module ${relativeId(id)} even though its interop type is "defaultOnly". Either remove or change this ${importType} or change the value of the "output.interop" option.`, + url: 'https://rollupjs.org/guide/en/#outputinterop' + }; +} +function errUnexpectedNamespaceReexport(id) { + return { + code: Errors.UNEXPECTED_NAMED_IMPORT, + id, + message: `There was a namespace "*" reexport from the external module ${relativeId(id)} even though its interop type is "defaultOnly". This will be ignored as namespace reexports only reexport named exports. If this is not intended, either remove or change this reexport or change the value of the "output.interop" option.`, + url: 'https://rollupjs.org/guide/en/#outputinterop' + }; +} +function errEntryCannotBeExternal(unresolvedId) { + return { + code: Errors.UNRESOLVED_ENTRY, + message: `Entry module cannot be external (${relativeId(unresolvedId)}).` + }; +} +function errUnresolvedEntry(unresolvedId) { + return { + code: Errors.UNRESOLVED_ENTRY, + message: `Could not resolve entry module (${relativeId(unresolvedId)}).` + }; +} +function errUnresolvedImport(source, importer) { + return { + code: Errors.UNRESOLVED_IMPORT, + message: `Could not resolve '${source}' from ${relativeId(importer)}` + }; +} +function errUnresolvedImportTreatedAsExternal(source, importer) { + return { + code: Errors.UNRESOLVED_IMPORT, + importer: relativeId(importer), + message: `'${source}' is imported by ${relativeId(importer)}, but could not be resolved – treating it as an external dependency`, + source, + url: 'https://rollupjs.org/guide/en/#warning-treating-module-as-external-dependency' + }; +} +function errExternalSyntheticExports(source, importer) { + return { + code: Errors.EXTERNAL_SYNTHETIC_EXPORTS, + importer: relativeId(importer), + message: `External '${source}' can not have 'syntheticNamedExports' enabled.`, + source + }; +} +function errFailedValidation(message) { + return { + code: Errors.VALIDATION_ERROR, + message + }; +} +function errAlreadyClosed() { + return { + code: Errors.ALREADY_CLOSED, + message: 'Bundle is already closed, no more calls to "generate" or "write" are allowed.' + }; +} +function warnDeprecation(deprecation, activeDeprecation, options) { + warnDeprecationWithOptions(deprecation, activeDeprecation, options.onwarn, options.strictDeprecations); +} +function warnDeprecationWithOptions(deprecation, activeDeprecation, warn, strictDeprecations) { + if (activeDeprecation || strictDeprecations) { + const warning = errDeprecation(deprecation); + if (strictDeprecations) { + return error(warning); } - this.expressionsToBeDeoptimized.push(origin); - trackedEntities.add(this.init); - const value = this.init.getLiteralValueAtPath(path, recursionTracker, origin); - trackedEntities.delete(this.init); - return value; + warn(warning); } - getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin) { - if (this.isReassigned || !this.init || path.length > MAX_PATH_DEPTH) { - return UNKNOWN_EXPRESSION; - } - const trackedEntities = recursionTracker.getEntities(path); - if (trackedEntities.has(this.init)) { - return UNKNOWN_EXPRESSION; - } - this.expressionsToBeDeoptimized.push(origin); - trackedEntities.add(this.init); - const value = this.init.getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin); - trackedEntities.delete(this.init); - return value; +} + +const RESERVED_NAMES = new Set([ + 'await', + 'break', + 'case', + 'catch', + 'class', + 'const', + 'continue', + 'debugger', + 'default', + 'delete', + 'do', + 'else', + 'enum', + 'eval', + 'export', + 'extends', + 'false', + 'finally', + 'for', + 'function', + 'if', + 'implements', + 'import', + 'in', + 'instanceof', + 'interface', + 'let', + 'NaN', + 'new', + 'null', + 'package', + 'private', + 'protected', + 'public', + 'return', + 'static', + 'super', + 'switch', + 'this', + 'throw', + 'true', + 'try', + 'typeof', + 'undefined', + 'var', + 'void', + 'while', + 'with', + 'yield' +]); +const RESERVED_NAMES$1 = RESERVED_NAMES; + +const illegalCharacters = /[^$_a-zA-Z0-9]/g; +const startsWithDigit = (str) => /\d/.test(str[0]); +const needsEscape = (str) => startsWithDigit(str) || RESERVED_NAMES$1.has(str) || str === 'arguments'; +function isLegal(str) { + if (needsEscape(str)) { + return false; } - hasEffectsWhenAccessedAtPath(path, context) { - if (path.length === 0) - return false; - if (this.isReassigned || path.length > MAX_PATH_DEPTH) - return true; - const trackedExpressions = context.accessed.getEntities(path); - if (trackedExpressions.has(this)) - return false; - trackedExpressions.add(this); - return (this.init && this.init.hasEffectsWhenAccessedAtPath(path, context)); + return !illegalCharacters.test(str); +} +function makeLegal(str) { + str = str.replace(/-(\w)/g, (_, letter) => letter.toUpperCase()).replace(illegalCharacters, '_'); + if (needsEscape(str)) + str = `_${str}`; + return str || '_'; +} + +class ExternalModule { + constructor(options, id, moduleSideEffects, meta, renormalizeRenderPath) { + this.options = options; + this.id = id; + this.renormalizeRenderPath = renormalizeRenderPath; + this.declarations = new Map(); + this.defaultVariableName = ''; + this.dynamicImporters = []; + this.execIndex = Infinity; + this.exportedVariables = new Map(); + this.importers = []; + this.mostCommonSuggestion = 0; + this.nameSuggestions = new Map(); + this.namespaceVariableName = ''; + this.reexported = false; + this.renderPath = undefined; + this.used = false; + this.variableName = ''; + this.suggestedVariableName = makeLegal(id.split(/[\\/]/).pop()); + const { importers, dynamicImporters } = this; + const info = (this.info = { + ast: null, + code: null, + dynamicallyImportedIdResolutions: EMPTY_ARRAY, + dynamicallyImportedIds: EMPTY_ARRAY, + get dynamicImporters() { + return dynamicImporters.sort(); + }, + hasDefaultExport: null, + get hasModuleSideEffects() { + warnDeprecation('Accessing ModuleInfo.hasModuleSideEffects from plugins is deprecated. Please use ModuleInfo.moduleSideEffects instead.', false, options); + return info.moduleSideEffects; + }, + id, + implicitlyLoadedAfterOneOf: EMPTY_ARRAY, + implicitlyLoadedBefore: EMPTY_ARRAY, + importedIdResolutions: EMPTY_ARRAY, + importedIds: EMPTY_ARRAY, + get importers() { + return importers.sort(); + }, + isEntry: false, + isExternal: true, + isIncluded: null, + meta, + moduleSideEffects, + syntheticNamedExports: false + }); + // Hide the deprecated key so that it only warns when accessed explicitly + Object.defineProperty(this.info, 'hasModuleSideEffects', { + enumerable: false + }); } - hasEffectsWhenAssignedAtPath(path, context) { - if (this.included || path.length > MAX_PATH_DEPTH) - return true; - if (path.length === 0) - return false; - if (this.isReassigned) - return true; - const trackedExpressions = context.assigned.getEntities(path); - if (trackedExpressions.has(this)) - return false; - trackedExpressions.add(this); - return (this.init && this.init.hasEffectsWhenAssignedAtPath(path, context)); + getVariableForExportName(name) { + const declaration = this.declarations.get(name); + if (declaration) + return [declaration]; + const externalVariable = new ExternalVariable(this, name); + this.declarations.set(name, externalVariable); + this.exportedVariables.set(externalVariable, name); + return [externalVariable]; } - hasEffectsWhenCalledAtPath(path, callOptions, context) { - if (path.length > MAX_PATH_DEPTH || this.isReassigned) - return true; - const trackedExpressions = (callOptions.withNew - ? context.instantiated - : context.called).getEntities(path, callOptions); - if (trackedExpressions.has(this)) - return false; - trackedExpressions.add(this); - return (this.init && this.init.hasEffectsWhenCalledAtPath(path, callOptions, context)); + setRenderPath(options, inputBase) { + this.renderPath = + typeof options.paths === 'function' ? options.paths(this.id) : options.paths[this.id]; + if (!this.renderPath) { + this.renderPath = this.renormalizeRenderPath + ? normalize(relative$1(inputBase, this.id)) + : this.id; + } } - include() { - if (!this.included) { - this.included = true; - if (!this.module.isExecuted) { - markModuleAndImpureDependenciesAsExecuted(this.module); - } - for (const declaration of this.declarations) { - // If node is a default export, it can save a tree-shaking run to include the full declaration now - if (!declaration.included) - declaration.include(createInclusionContext(), false); - let node = declaration.parent; - while (!node.included) { - // We do not want to properly include parents in case they are part of a dead branch - // in which case .include() might pull in more dead code - node.included = true; - if (node.type === Program) - break; - node = node.parent; - } - } + suggestName(name) { + var _a; + const value = ((_a = this.nameSuggestions.get(name)) !== null && _a !== void 0 ? _a : 0) + 1; + this.nameSuggestions.set(name, value); + if (value > this.mostCommonSuggestion) { + this.mostCommonSuggestion = value; + this.suggestedVariableName = name; } } - includeCallArguments(context, args) { - if (this.isReassigned || (this.init && context.includedCallArguments.has(this.init))) { - for (const arg of args) { - arg.include(context, false); + warnUnusedImports() { + const unused = Array.from(this.declarations) + .filter(([name, declaration]) => name !== '*' && !declaration.included && !this.reexported && !declaration.referenced) + .map(([name]) => name); + if (unused.length === 0) + return; + const importersSet = new Set(); + for (const name of unused) { + for (const importer of this.declarations.get(name).module.importers) { + importersSet.add(importer); } } - else if (this.init) { - context.includedCallArguments.add(this.init); - this.init.includeCallArguments(context, args); - context.includedCallArguments.delete(this.init); - } - } - markCalledFromTryStatement() { - this.calledFromTryStatement = true; + const importersArray = [...importersSet]; + this.options.onwarn({ + code: 'UNUSED_EXTERNAL_IMPORT', + message: `${printQuotedStringList(unused, ['is', 'are'])} imported from external module "${this.id}" but never used in ${printQuotedStringList(importersArray.map(importer => relativeId(importer)))}.`, + names: unused, + source: this.id, + sources: importersArray + }); } } -class Scope { - constructor() { - this.children = []; - this.variables = new Map(); +function getDefaultExportFromCjs (x) { + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; +} + +function getAugmentedNamespace(n) { + var f = n.default; + if (typeof f == "function") { + var a = function () { + return f.apply(this, arguments); + }; + a.prototype = f.prototype; + } else a = {}; + Object.defineProperty(a, '__esModule', {value: true}); + Object.keys(n).forEach(function (k) { + var d = Object.getOwnPropertyDescriptor(n, k); + Object.defineProperty(a, k, d.get ? d : { + enumerable: true, + get: function () { + return n[k]; + } + }); + }); + return a; +} + +var picomatch$1 = {exports: {}}; + +var utils$3 = {}; + +const path$1 = require$$0; +const WIN_SLASH = '\\\\/'; +const WIN_NO_SLASH = `[^${WIN_SLASH}]`; + +/** + * Posix glob regex + */ + +const DOT_LITERAL = '\\.'; +const PLUS_LITERAL = '\\+'; +const QMARK_LITERAL = '\\?'; +const SLASH_LITERAL = '\\/'; +const ONE_CHAR = '(?=.)'; +const QMARK = '[^/]'; +const END_ANCHOR = `(?:${SLASH_LITERAL}|$)`; +const START_ANCHOR = `(?:^|${SLASH_LITERAL})`; +const DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`; +const NO_DOT = `(?!${DOT_LITERAL})`; +const NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`; +const NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`; +const NO_DOTS_SLASH = `(?!${DOTS_SLASH})`; +const QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`; +const STAR = `${QMARK}*?`; + +const POSIX_CHARS = { + DOT_LITERAL, + PLUS_LITERAL, + QMARK_LITERAL, + SLASH_LITERAL, + ONE_CHAR, + QMARK, + END_ANCHOR, + DOTS_SLASH, + NO_DOT, + NO_DOTS, + NO_DOT_SLASH, + NO_DOTS_SLASH, + QMARK_NO_DOT, + STAR, + START_ANCHOR +}; + +/** + * Windows glob regex + */ + +const WINDOWS_CHARS = { + ...POSIX_CHARS, + + SLASH_LITERAL: `[${WIN_SLASH}]`, + QMARK: WIN_NO_SLASH, + STAR: `${WIN_NO_SLASH}*?`, + DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`, + NO_DOT: `(?!${DOT_LITERAL})`, + NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`, + NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`, + NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`, + QMARK_NO_DOT: `[^.${WIN_SLASH}]`, + START_ANCHOR: `(?:^|[${WIN_SLASH}])`, + END_ANCHOR: `(?:[${WIN_SLASH}]|$)` +}; + +/** + * POSIX Bracket Regex + */ + +const POSIX_REGEX_SOURCE$1 = { + alnum: 'a-zA-Z0-9', + alpha: 'a-zA-Z', + ascii: '\\x00-\\x7F', + blank: ' \\t', + cntrl: '\\x00-\\x1F\\x7F', + digit: '0-9', + graph: '\\x21-\\x7E', + lower: 'a-z', + print: '\\x20-\\x7E ', + punct: '\\-!"#$%&\'()\\*+,./:;<=>?@[\\]^_`{|}~', + space: ' \\t\\r\\n\\v\\f', + upper: 'A-Z', + word: 'A-Za-z0-9_', + xdigit: 'A-Fa-f0-9' +}; + +var constants$2 = { + MAX_LENGTH: 1024 * 64, + POSIX_REGEX_SOURCE: POSIX_REGEX_SOURCE$1, + + // regular expressions + REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g, + REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/, + REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/, + REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g, + REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g, + REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g, + + // Replace globs with equivalent patterns to reduce parsing time. + REPLACEMENTS: { + '***': '*', + '**/**': '**', + '**/**/**': '**' + }, + + // Digits + CHAR_0: 48, /* 0 */ + CHAR_9: 57, /* 9 */ + + // Alphabet chars. + CHAR_UPPERCASE_A: 65, /* A */ + CHAR_LOWERCASE_A: 97, /* a */ + CHAR_UPPERCASE_Z: 90, /* Z */ + CHAR_LOWERCASE_Z: 122, /* z */ + + CHAR_LEFT_PARENTHESES: 40, /* ( */ + CHAR_RIGHT_PARENTHESES: 41, /* ) */ + + CHAR_ASTERISK: 42, /* * */ + + // Non-alphabetic chars. + CHAR_AMPERSAND: 38, /* & */ + CHAR_AT: 64, /* @ */ + CHAR_BACKWARD_SLASH: 92, /* \ */ + CHAR_CARRIAGE_RETURN: 13, /* \r */ + CHAR_CIRCUMFLEX_ACCENT: 94, /* ^ */ + CHAR_COLON: 58, /* : */ + CHAR_COMMA: 44, /* , */ + CHAR_DOT: 46, /* . */ + CHAR_DOUBLE_QUOTE: 34, /* " */ + CHAR_EQUAL: 61, /* = */ + CHAR_EXCLAMATION_MARK: 33, /* ! */ + CHAR_FORM_FEED: 12, /* \f */ + CHAR_FORWARD_SLASH: 47, /* / */ + CHAR_GRAVE_ACCENT: 96, /* ` */ + CHAR_HASH: 35, /* # */ + CHAR_HYPHEN_MINUS: 45, /* - */ + CHAR_LEFT_ANGLE_BRACKET: 60, /* < */ + CHAR_LEFT_CURLY_BRACE: 123, /* { */ + CHAR_LEFT_SQUARE_BRACKET: 91, /* [ */ + CHAR_LINE_FEED: 10, /* \n */ + CHAR_NO_BREAK_SPACE: 160, /* \u00A0 */ + CHAR_PERCENT: 37, /* % */ + CHAR_PLUS: 43, /* + */ + CHAR_QUESTION_MARK: 63, /* ? */ + CHAR_RIGHT_ANGLE_BRACKET: 62, /* > */ + CHAR_RIGHT_CURLY_BRACE: 125, /* } */ + CHAR_RIGHT_SQUARE_BRACKET: 93, /* ] */ + CHAR_SEMICOLON: 59, /* ; */ + CHAR_SINGLE_QUOTE: 39, /* ' */ + CHAR_SPACE: 32, /* */ + CHAR_TAB: 9, /* \t */ + CHAR_UNDERSCORE: 95, /* _ */ + CHAR_VERTICAL_LINE: 124, /* | */ + CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279, /* \uFEFF */ + + SEP: path$1.sep, + + /** + * Create EXTGLOB_CHARS + */ + + extglobChars(chars) { + return { + '!': { type: 'negate', open: '(?:(?!(?:', close: `))${chars.STAR})` }, + '?': { type: 'qmark', open: '(?:', close: ')?' }, + '+': { type: 'plus', open: '(?:', close: ')+' }, + '*': { type: 'star', open: '(?:', close: ')*' }, + '@': { type: 'at', open: '(?:', close: ')' } + }; + }, + + /** + * Create GLOB_CHARS + */ + + globChars(win32) { + return win32 === true ? WINDOWS_CHARS : POSIX_CHARS; + } +}; + +(function (exports) { + + const path = require$$0; + const win32 = process.platform === 'win32'; + const { + REGEX_BACKSLASH, + REGEX_REMOVE_BACKSLASH, + REGEX_SPECIAL_CHARS, + REGEX_SPECIAL_CHARS_GLOBAL + } = constants$2; + + exports.isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val); + exports.hasRegexChars = str => REGEX_SPECIAL_CHARS.test(str); + exports.isRegexChar = str => str.length === 1 && exports.hasRegexChars(str); + exports.escapeRegex = str => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, '\\$1'); + exports.toPosixSlashes = str => str.replace(REGEX_BACKSLASH, '/'); + + exports.removeBackslashes = str => { + return str.replace(REGEX_REMOVE_BACKSLASH, match => { + return match === '\\' ? '' : match; + }); + }; + + exports.supportsLookbehinds = () => { + const segs = process.version.slice(1).split('.').map(Number); + if (segs.length === 3 && segs[0] >= 9 || (segs[0] === 8 && segs[1] >= 10)) { + return true; + } + return false; + }; + + exports.isWindows = options => { + if (options && typeof options.windows === 'boolean') { + return options.windows; + } + return win32 === true || path.sep === '\\'; + }; + + exports.escapeLast = (input, char, lastIdx) => { + const idx = input.lastIndexOf(char, lastIdx); + if (idx === -1) return input; + if (input[idx - 1] === '\\') return exports.escapeLast(input, char, idx - 1); + return `${input.slice(0, idx)}\\${input.slice(idx)}`; + }; + + exports.removePrefix = (input, state = {}) => { + let output = input; + if (output.startsWith('./')) { + output = output.slice(2); + state.prefix = './'; + } + return output; + }; + + exports.wrapOutput = (input, state = {}, options = {}) => { + const prepend = options.contains ? '' : '^'; + const append = options.contains ? '' : '$'; + + let output = `${prepend}(?:${input})${append}`; + if (state.negated === true) { + output = `(?:^(?!${output}).*$)`; + } + return output; + }; +} (utils$3)); + +const utils$2 = utils$3; +const { + CHAR_ASTERISK, /* * */ + CHAR_AT, /* @ */ + CHAR_BACKWARD_SLASH, /* \ */ + CHAR_COMMA, /* , */ + CHAR_DOT, /* . */ + CHAR_EXCLAMATION_MARK, /* ! */ + CHAR_FORWARD_SLASH, /* / */ + CHAR_LEFT_CURLY_BRACE, /* { */ + CHAR_LEFT_PARENTHESES, /* ( */ + CHAR_LEFT_SQUARE_BRACKET, /* [ */ + CHAR_PLUS, /* + */ + CHAR_QUESTION_MARK, /* ? */ + CHAR_RIGHT_CURLY_BRACE, /* } */ + CHAR_RIGHT_PARENTHESES, /* ) */ + CHAR_RIGHT_SQUARE_BRACKET /* ] */ +} = constants$2; + +const isPathSeparator = code => { + return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH; +}; + +const depth = token => { + if (token.isPrefix !== true) { + token.depth = token.isGlobstar ? Infinity : 1; + } +}; + +/** + * Quickly scans a glob pattern and returns an object with a handful of + * useful properties, like `isGlob`, `path` (the leading non-glob, if it exists), + * `glob` (the actual pattern), `negated` (true if the path starts with `!` but not + * with `!(`) and `negatedExtglob` (true if the path starts with `!(`). + * + * ```js + * const pm = require('picomatch'); + * console.log(pm.scan('foo/bar/*.js')); + * { isGlob: true, input: 'foo/bar/*.js', base: 'foo/bar', glob: '*.js' } + * ``` + * @param {String} `str` + * @param {Object} `options` + * @return {Object} Returns an object with tokens and regex source string. + * @api public + */ + +const scan$1 = (input, options) => { + const opts = options || {}; + + const length = input.length - 1; + const scanToEnd = opts.parts === true || opts.scanToEnd === true; + const slashes = []; + const tokens = []; + const parts = []; + + let str = input; + let index = -1; + let start = 0; + let lastIndex = 0; + let isBrace = false; + let isBracket = false; + let isGlob = false; + let isExtglob = false; + let isGlobstar = false; + let braceEscaped = false; + let backslashes = false; + let negated = false; + let negatedExtglob = false; + let finished = false; + let braces = 0; + let prev; + let code; + let token = { value: '', depth: 0, isGlob: false }; + + const eos = () => index >= length; + const peek = () => str.charCodeAt(index + 1); + const advance = () => { + prev = code; + return str.charCodeAt(++index); + }; + + while (index < length) { + code = advance(); + let next; + + if (code === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + code = advance(); + + if (code === CHAR_LEFT_CURLY_BRACE) { + braceEscaped = true; + } + continue; } - addDeclaration(identifier, context, init = null, _isHoisted) { - const name = identifier.name; - let variable = this.variables.get(name); - if (variable) { - variable.addDeclaration(identifier, init); + + if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) { + braces++; + + while (eos() !== true && (code = advance())) { + if (code === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + advance(); + continue; } - else { - variable = new LocalVariable(identifier.name, identifier, init || UNDEFINED_EXPRESSION, context); - this.variables.set(name, variable); + + if (code === CHAR_LEFT_CURLY_BRACE) { + braces++; + continue; } - return variable; - } - contains(name) { - return this.variables.has(name); - } - findVariable(_name) { - throw new Error('Internal Error: findVariable needs to be implemented by a subclass'); + + if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) { + isBrace = token.isBrace = true; + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { + continue; + } + + break; + } + + if (braceEscaped !== true && code === CHAR_COMMA) { + isBrace = token.isBrace = true; + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { + continue; + } + + break; + } + + if (code === CHAR_RIGHT_CURLY_BRACE) { + braces--; + + if (braces === 0) { + braceEscaped = false; + isBrace = token.isBrace = true; + finished = true; + break; + } + } + } + + if (scanToEnd === true) { + continue; + } + + break; } -} -class ChildScope extends Scope { - constructor(parent) { - super(); - this.accessedOutsideVariables = new Map(); - this.parent = parent; - parent.children.push(this); + if (code === CHAR_FORWARD_SLASH) { + slashes.push(index); + tokens.push(token); + token = { value: '', depth: 0, isGlob: false }; + + if (finished === true) continue; + if (prev === CHAR_DOT && index === (start + 1)) { + start += 2; + continue; + } + + lastIndex = index + 1; + continue; } - addAccessedDynamicImport(importExpression) { - (this.accessedDynamicImports || (this.accessedDynamicImports = new Set())).add(importExpression); - if (this.parent instanceof ChildScope) { - this.parent.addAccessedDynamicImport(importExpression); + + if (opts.noext !== true) { + const isExtglobChar = code === CHAR_PLUS + || code === CHAR_AT + || code === CHAR_ASTERISK + || code === CHAR_QUESTION_MARK + || code === CHAR_EXCLAMATION_MARK; + + if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) { + isGlob = token.isGlob = true; + isExtglob = token.isExtglob = true; + finished = true; + if (code === CHAR_EXCLAMATION_MARK && index === start) { + negatedExtglob = true; } - } - addAccessedGlobalsByFormat(globalsByFormat) { - const accessedGlobalVariablesByFormat = this.accessedGlobalVariablesByFormat || (this.accessedGlobalVariablesByFormat = new Map()); - for (const format of Object.keys(globalsByFormat)) { - let accessedGlobalVariables = accessedGlobalVariablesByFormat.get(format); - if (!accessedGlobalVariables) { - accessedGlobalVariables = new Set(); - accessedGlobalVariablesByFormat.set(format, accessedGlobalVariables); + + if (scanToEnd === true) { + while (eos() !== true && (code = advance())) { + if (code === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + code = advance(); + continue; } - for (const name of globalsByFormat[format]) { - accessedGlobalVariables.add(name); + + if (code === CHAR_RIGHT_PARENTHESES) { + isGlob = token.isGlob = true; + finished = true; + break; } + } + continue; } - if (this.parent instanceof ChildScope) { - this.parent.addAccessedGlobalsByFormat(globalsByFormat); - } + break; + } } - addNamespaceMemberAccess(name, variable) { - this.accessedOutsideVariables.set(name, variable); - this.parent.addNamespaceMemberAccess(name, variable); + + if (code === CHAR_ASTERISK) { + if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true; + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { + continue; + } + break; } - addReturnExpression(expression) { - this.parent instanceof ChildScope && this.parent.addReturnExpression(expression); + + if (code === CHAR_QUESTION_MARK) { + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { + continue; + } + break; } - addUsedOutsideNames(usedNames, format, exportNamesByVariable) { - for (const variable of this.accessedOutsideVariables.values()) { - if (variable.included) { - usedNames.add(variable.getBaseVariableName()); - if (format === 'system' && exportNamesByVariable.has(variable)) { - usedNames.add('exports'); - } - } + + if (code === CHAR_LEFT_SQUARE_BRACKET) { + while (eos() !== true && (next = advance())) { + if (next === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + advance(); + continue; } - const accessedGlobalVariables = this.accessedGlobalVariablesByFormat && this.accessedGlobalVariablesByFormat.get(format); - if (accessedGlobalVariables) { - for (const name of accessedGlobalVariables) { - usedNames.add(name); - } + + if (next === CHAR_RIGHT_SQUARE_BRACKET) { + isBracket = token.isBracket = true; + isGlob = token.isGlob = true; + finished = true; + break; } + } + + if (scanToEnd === true) { + continue; + } + + break; } - contains(name) { - return this.variables.has(name) || this.parent.contains(name); + + if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) { + negated = token.negated = true; + start++; + continue; } - deconflict(format, exportNamesByVariable) { - const usedNames = new Set(); - this.addUsedOutsideNames(usedNames, format, exportNamesByVariable); - if (this.accessedDynamicImports) { - for (const importExpression of this.accessedDynamicImports) { - if (importExpression.inlineNamespace) { - usedNames.add(importExpression.inlineNamespace.getBaseVariableName()); - } - } - } - for (const [name, variable] of this.variables) { - if (variable.included || variable.alwaysRendered) { - variable.setSafeName(getSafeName(name, usedNames)); - } - } - for (const scope of this.children) { - scope.deconflict(format, exportNamesByVariable); + + if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) { + isGlob = token.isGlob = true; + + if (scanToEnd === true) { + while (eos() !== true && (code = advance())) { + if (code === CHAR_LEFT_PARENTHESES) { + backslashes = token.backslashes = true; + code = advance(); + continue; + } + + if (code === CHAR_RIGHT_PARENTHESES) { + finished = true; + break; + } } + continue; + } + break; } - findLexicalBoundary() { - return this.parent.findLexicalBoundary(); + + if (isGlob === true) { + finished = true; + + if (scanToEnd === true) { + continue; + } + + break; } - findVariable(name) { - const knownVariable = this.variables.get(name) || this.accessedOutsideVariables.get(name); - if (knownVariable) { - return knownVariable; - } - const variable = this.parent.findVariable(name); - this.accessedOutsideVariables.set(name, variable); - return variable; + } + + if (opts.noext === true) { + isExtglob = false; + isGlob = false; + } + + let base = str; + let prefix = ''; + let glob = ''; + + if (start > 0) { + prefix = str.slice(0, start); + str = str.slice(start); + lastIndex -= start; + } + + if (base && isGlob === true && lastIndex > 0) { + base = str.slice(0, lastIndex); + glob = str.slice(lastIndex); + } else if (isGlob === true) { + base = ''; + glob = str; + } else { + base = str; + } + + if (base && base !== '' && base !== '/' && base !== str) { + if (isPathSeparator(base.charCodeAt(base.length - 1))) { + base = base.slice(0, -1); } -} + } -function getLocator$1(source, options) { - if (options === void 0) { options = {}; } - var offsetLine = options.offsetLine || 0; - var offsetColumn = options.offsetColumn || 0; - var originalLines = source.split('\n'); - var start = 0; - var lineRanges = originalLines.map(function (line, i) { - var end = start + line.length + 1; - var range = { start: start, end: end, line: i }; - start = end; - return range; - }); - var i = 0; - function rangeContains(range, index) { - return range.start <= index && index < range.end; + if (opts.unescape === true) { + if (glob) glob = utils$2.removeBackslashes(glob); + + if (base && backslashes === true) { + base = utils$2.removeBackslashes(base); } - function getLocation(range, index) { - return { line: offsetLine + range.line, column: offsetColumn + index - range.start, character: index }; + } + + const state = { + prefix, + input, + start, + base, + glob, + isBrace, + isBracket, + isGlob, + isExtglob, + isGlobstar, + negated, + negatedExtglob + }; + + if (opts.tokens === true) { + state.maxDepth = 0; + if (!isPathSeparator(code)) { + tokens.push(token); } - function locate(search, startIndex) { - if (typeof search === 'string') { - search = source.indexOf(search, startIndex || 0); - } - var range = lineRanges[i]; - var d = search >= range.end ? 1 : -1; - while (range) { - if (rangeContains(range, search)) - return getLocation(range, search); - i += d; - range = lineRanges[i]; + state.tokens = tokens; + } + + if (opts.parts === true || opts.tokens === true) { + let prevIndex; + + for (let idx = 0; idx < slashes.length; idx++) { + const n = prevIndex ? prevIndex + 1 : start; + const i = slashes[idx]; + const value = input.slice(n, i); + if (opts.tokens) { + if (idx === 0 && start !== 0) { + tokens[idx].isPrefix = true; + tokens[idx].value = prefix; + } else { + tokens[idx].value = value; } + depth(tokens[idx]); + state.maxDepth += tokens[idx].depth; + } + if (idx !== 0 || value !== '') { + parts.push(value); + } + prevIndex = i; } - return locate; -} -function locate(source, search, options) { - if (typeof options === 'number') { - throw new Error('locate takes a { startIndex, offsetLine, offsetColumn } object as the third argument'); + + if (prevIndex && prevIndex + 1 < input.length) { + const value = input.slice(prevIndex + 1); + parts.push(value); + + if (opts.tokens) { + tokens[tokens.length - 1].value = value; + depth(tokens[tokens.length - 1]); + state.maxDepth += tokens[tokens.length - 1].depth; + } } - return getLocator$1(source, options)(search, options && options.startIndex); -} -const keys = { - Literal: [], - Program: ['body'] + state.slashes = slashes; + state.parts = parts; + } + + return state; }; -function getAndCreateKeys(esTreeNode) { - keys[esTreeNode.type] = Object.keys(esTreeNode).filter(key => typeof esTreeNode[key] === 'object'); - return keys[esTreeNode.type]; -} -const INCLUDE_PARAMETERS = 'variables'; -class NodeBase { - constructor(esTreeNode, parent, parentScope) { - this.included = false; - this.keys = keys[esTreeNode.type] || getAndCreateKeys(esTreeNode); - this.parent = parent; - this.context = parent.context; - this.createScope(parentScope); - this.parseNode(esTreeNode); - this.initialise(); - this.context.magicString.addSourcemapLocation(this.start); - this.context.magicString.addSourcemapLocation(this.end); +var scan_1 = scan$1; + +const constants$1 = constants$2; +const utils$1 = utils$3; + +/** + * Constants + */ + +const { + MAX_LENGTH, + POSIX_REGEX_SOURCE, + REGEX_NON_SPECIAL_CHARS, + REGEX_SPECIAL_CHARS_BACKREF, + REPLACEMENTS +} = constants$1; + +/** + * Helpers + */ + +const expandRange = (args, options) => { + if (typeof options.expandRange === 'function') { + return options.expandRange(...args, options); + } + + args.sort(); + const value = `[${args.join('-')}]`; + + return value; +}; + +/** + * Create the message for a syntax error + */ + +const syntaxError = (type, char) => { + return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`; +}; + +/** + * Parse the given input string. + * @param {String} input + * @param {Object} options + * @return {Object} + */ + +const parse$1 = (input, options) => { + if (typeof input !== 'string') { + throw new TypeError('Expected a string'); + } + + input = REPLACEMENTS[input] || input; + + const opts = { ...options }; + const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; + + let len = input.length; + if (len > max) { + throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`); + } + + const bos = { type: 'bos', value: '', output: opts.prepend || '' }; + const tokens = [bos]; + + const capture = opts.capture ? '' : '?:'; + const win32 = utils$1.isWindows(options); + + // create constants based on platform, for windows or posix + const PLATFORM_CHARS = constants$1.globChars(win32); + const EXTGLOB_CHARS = constants$1.extglobChars(PLATFORM_CHARS); + + const { + DOT_LITERAL, + PLUS_LITERAL, + SLASH_LITERAL, + ONE_CHAR, + DOTS_SLASH, + NO_DOT, + NO_DOT_SLASH, + NO_DOTS_SLASH, + QMARK, + QMARK_NO_DOT, + STAR, + START_ANCHOR + } = PLATFORM_CHARS; + + const globstar = opts => { + return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`; + }; + + const nodot = opts.dot ? '' : NO_DOT; + const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT; + let star = opts.bash === true ? globstar(opts) : STAR; + + if (opts.capture) { + star = `(${star})`; + } + + // minimatch options support + if (typeof opts.noext === 'boolean') { + opts.noextglob = opts.noext; + } + + const state = { + input, + index: -1, + start: 0, + dot: opts.dot === true, + consumed: '', + output: '', + prefix: '', + backtrack: false, + negated: false, + brackets: 0, + braces: 0, + parens: 0, + quotes: 0, + globstar: false, + tokens + }; + + input = utils$1.removePrefix(input, state); + len = input.length; + + const extglobs = []; + const braces = []; + const stack = []; + let prev = bos; + let value; + + /** + * Tokenizing helpers + */ + + const eos = () => state.index === len - 1; + const peek = state.peek = (n = 1) => input[state.index + n]; + const advance = state.advance = () => input[++state.index] || ''; + const remaining = () => input.slice(state.index + 1); + const consume = (value = '', num = 0) => { + state.consumed += value; + state.index += num; + }; + + const append = token => { + state.output += token.output != null ? token.output : token.value; + consume(token.value); + }; + + const negate = () => { + let count = 1; + + while (peek() === '!' && (peek(2) !== '(' || peek(3) === '?')) { + advance(); + state.start++; + count++; } - /** - * Override this to bind assignments to variables and do any initialisations that - * require the scopes to be populated with variables. - */ - bind() { - for (const key of this.keys) { - const value = this[key]; - if (value === null || key === 'annotations') - continue; - if (Array.isArray(value)) { - for (const child of value) { - if (child !== null) - child.bind(); - } - } - else { - value.bind(); - } - } + + if (count % 2 === 0) { + return false; } - /** - * Override if this node should receive a different scope than the parent scope. - */ - createScope(parentScope) { - this.scope = parentScope; + + state.negated = true; + state.start++; + return true; + }; + + const increment = type => { + state[type]++; + stack.push(type); + }; + + const decrement = type => { + state[type]--; + stack.pop(); + }; + + /** + * Push tokens onto the tokens array. This helper speeds up + * tokenizing by 1) helping us avoid backtracking as much as possible, + * and 2) helping us avoid creating extra tokens when consecutive + * characters are plain text. This improves performance and simplifies + * lookbehinds. + */ + + const push = tok => { + if (prev.type === 'globstar') { + const isBrace = state.braces > 0 && (tok.type === 'comma' || tok.type === 'brace'); + const isExtglob = tok.extglob === true || (extglobs.length && (tok.type === 'pipe' || tok.type === 'paren')); + + if (tok.type !== 'slash' && tok.type !== 'paren' && !isBrace && !isExtglob) { + state.output = state.output.slice(0, -prev.output.length); + prev.type = 'star'; + prev.value = '*'; + prev.output = star; + state.output += prev.output; + } } - declare(_kind, _init) { - return []; + + if (extglobs.length && tok.type !== 'paren') { + extglobs[extglobs.length - 1].inner += tok.value; } - deoptimizePath(_path) { } - getLiteralValueAtPath(_path, _recursionTracker, _origin) { - return UnknownValue; + + if (tok.value || tok.output) append(tok); + if (prev && prev.type === 'text' && tok.type === 'text') { + prev.value += tok.value; + prev.output = (prev.output || '') + tok.value; + return; } - getReturnExpressionWhenCalledAtPath(_path, _recursionTracker, _origin) { - return UNKNOWN_EXPRESSION; + + tok.prev = prev; + tokens.push(tok); + prev = tok; + }; + + const extglobOpen = (type, value) => { + const token = { ...EXTGLOB_CHARS[value], conditions: 1, inner: '' }; + + token.prev = prev; + token.parens = state.parens; + token.output = state.output; + const output = (opts.capture ? '(' : '') + token.open; + + increment('parens'); + push({ type, value, output: state.output ? '' : ONE_CHAR }); + push({ type: 'paren', extglob: true, value: advance(), output }); + extglobs.push(token); + }; + + const extglobClose = token => { + let output = token.close + (opts.capture ? ')' : ''); + let rest; + + if (token.type === 'negate') { + let extglobStar = star; + + if (token.inner && token.inner.length > 1 && token.inner.includes('/')) { + extglobStar = globstar(opts); + } + + if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) { + output = token.close = `)$))${extglobStar}`; + } + + if (token.inner.includes('*') && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) { + // Any non-magical string (`.ts`) or even nested expression (`.{ts,tsx}`) can follow after the closing parenthesis. + // In this case, we need to parse the string and use it in the output of the original pattern. + // Suitable patterns: `/!(*.d).ts`, `/!(*.d).{ts,tsx}`, `**/!(*-dbg).@(js)`. + // + // Disabling the `fastpaths` option due to a problem with parsing strings as `.ts` in the pattern like `**/!(*.d).ts`. + const expression = parse$1(rest, { ...options, fastpaths: false }).output; + + output = token.close = `)${expression})${extglobStar})`; + } + + if (token.prev.type === 'bos') { + state.negatedExtglob = true; + } } - hasEffects(context) { - for (const key of this.keys) { - const value = this[key]; - if (value === null || key === 'annotations') - continue; - if (Array.isArray(value)) { - for (const child of value) { - if (child !== null && child.hasEffects(context)) - return true; - } - } - else if (value.hasEffects(context)) - return true; + + push({ type: 'paren', extglob: true, value, output }); + decrement('parens'); + }; + + /** + * Fast paths + */ + + if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) { + let backslashes = false; + + let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => { + if (first === '\\') { + backslashes = true; + return m; + } + + if (first === '?') { + if (esc) { + return esc + first + (rest ? QMARK.repeat(rest.length) : ''); } - return false; - } - hasEffectsWhenAccessedAtPath(path, _context) { - return path.length > 0; - } - hasEffectsWhenAssignedAtPath(_path, _context) { - return true; - } - hasEffectsWhenCalledAtPath(_path, _callOptions, _context) { - return true; - } - include(context, includeChildrenRecursively) { - this.included = true; - for (const key of this.keys) { - const value = this[key]; - if (value === null || key === 'annotations') - continue; - if (Array.isArray(value)) { - for (const child of value) { - if (child !== null) - child.include(context, includeChildrenRecursively); - } - } - else { - value.include(context, includeChildrenRecursively); - } + if (index === 0) { + return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : ''); } - } - includeCallArguments(context, args) { - for (const arg of args) { - arg.include(context, false); + return QMARK.repeat(chars.length); + } + + if (first === '.') { + return DOT_LITERAL.repeat(chars.length); + } + + if (first === '*') { + if (esc) { + return esc + first + (rest ? star : ''); } + return star; + } + return esc ? m : `\\${m}`; + }); + + if (backslashes === true) { + if (opts.unescape === true) { + output = output.replace(/\\/g, ''); + } else { + output = output.replace(/\\+/g, m => { + return m.length % 2 === 0 ? '\\\\' : (m ? '\\' : ''); + }); + } } - includeWithAllDeclaredVariables(includeChildrenRecursively, context) { - this.include(context, includeChildrenRecursively); + + if (output === input && opts.contains === true) { + state.output = input; + return state; + } + + state.output = utils$1.wrapOutput(output, state, options); + return state; + } + + /** + * Tokenize input until we reach end-of-string + */ + + while (!eos()) { + value = advance(); + + if (value === '\u0000') { + continue; } + /** - * Override to perform special initialisation steps after the scope is initialised + * Escaped characters */ - initialise() { } - insertSemicolon(code) { - if (code.original[this.end - 1] !== ';') { - code.appendLeft(this.end, ';'); - } - } - parseNode(esTreeNode) { - for (const key of Object.keys(esTreeNode)) { - // That way, we can override this function to add custom initialisation and then call super.parseNode - if (this.hasOwnProperty(key)) - continue; - const value = esTreeNode[key]; - if (typeof value !== 'object' || value === null || key === 'annotations') { - this[key] = value; - } - else if (Array.isArray(value)) { - this[key] = []; - for (const child of value) { - this[key].push(child === null - ? null - : new (this.context.nodeConstructors[child.type] || - this.context.nodeConstructors.UnknownNode)(child, this, this.scope)); - } - } - else { - this[key] = new (this.context.nodeConstructors[value.type] || - this.context.nodeConstructors.UnknownNode)(value, this, this.scope); - } + + if (value === '\\') { + const next = peek(); + + if (next === '/' && opts.bash !== true) { + continue; + } + + if (next === '.' || next === ';') { + continue; + } + + if (!next) { + value += '\\'; + push({ type: 'text', value }); + continue; + } + + // collapse slashes to reduce potential for exploits + const match = /^\\+/.exec(remaining()); + let slashes = 0; + + if (match && match[0].length > 2) { + slashes = match[0].length; + state.index += slashes; + if (slashes % 2 !== 0) { + value += '\\'; } + } + + if (opts.unescape === true) { + value = advance(); + } else { + value += advance(); + } + + if (state.brackets === 0) { + push({ type: 'text', value }); + continue; + } } - render(code, options) { - for (const key of this.keys) { - const value = this[key]; - if (value === null || key === 'annotations') - continue; - if (Array.isArray(value)) { - for (const child of value) { - if (child !== null) - child.render(code, options); - } - } - else { - value.render(code, options); + + /** + * If we're inside a regex character class, continue + * until we reach the closing bracket. + */ + + if (state.brackets > 0 && (value !== ']' || prev.value === '[' || prev.value === '[^')) { + if (opts.posix !== false && value === ':') { + const inner = prev.value.slice(1); + if (inner.includes('[')) { + prev.posix = true; + + if (inner.includes(':')) { + const idx = prev.value.lastIndexOf('['); + const pre = prev.value.slice(0, idx); + const rest = prev.value.slice(idx + 2); + const posix = POSIX_REGEX_SOURCE[rest]; + if (posix) { + prev.value = pre + posix; + state.backtrack = true; + advance(); + + if (!bos.output && tokens.indexOf(prev) === 1) { + bos.output = ONE_CHAR; + } + continue; } + } } + } + + if ((value === '[' && peek() !== ':') || (value === '-' && peek() === ']')) { + value = `\\${value}`; + } + + if (value === ']' && (prev.value === '[' || prev.value === '[^')) { + value = `\\${value}`; + } + + if (opts.posix === true && value === '!' && prev.value === '[') { + value = '^'; + } + + prev.value += value; + append({ value }); + continue; } - shouldBeIncluded(context) { - return this.included || (!context.brokenFlow && this.hasEffects(createHasEffectsContext())); + + /** + * If we're inside a quoted string, continue + * until we reach the closing double quote. + */ + + if (state.quotes === 1 && value !== '"') { + value = utils$1.escapeRegex(value); + prev.value += value; + append({ value }); + continue; } - toString() { - return this.context.code.slice(this.start, this.end); + + /** + * Double quotes + */ + + if (value === '"') { + state.quotes = state.quotes === 1 ? 0 : 1; + if (opts.keepQuotes === true) { + push({ type: 'text', value }); + } + continue; } -} -class ClassNode extends NodeBase { - createScope(parentScope) { - this.scope = new ChildScope(parentScope); + /** + * Parentheses + */ + + if (value === '(') { + increment('parens'); + push({ type: 'paren', value }); + continue; } - hasEffectsWhenAccessedAtPath(path) { - if (path.length <= 1) - return false; - return path.length > 2 || path[0] !== 'prototype'; + + if (value === ')') { + if (state.parens === 0 && opts.strictBrackets === true) { + throw new SyntaxError(syntaxError('opening', '(')); + } + + const extglob = extglobs[extglobs.length - 1]; + if (extglob && state.parens === extglob.parens + 1) { + extglobClose(extglobs.pop()); + continue; + } + + push({ type: 'paren', value, output: state.parens ? ')' : '\\)' }); + decrement('parens'); + continue; } - hasEffectsWhenAssignedAtPath(path) { - if (path.length <= 1) - return false; - return path.length > 2 || path[0] !== 'prototype'; - } - hasEffectsWhenCalledAtPath(path, callOptions, context) { - if (!callOptions.withNew) - return true; - return (this.body.hasEffectsWhenCalledAtPath(path, callOptions, context) || - (this.superClass !== null && - this.superClass.hasEffectsWhenCalledAtPath(path, callOptions, context))); - } - initialise() { - if (this.id !== null) { - this.id.declare('class', this); + + /** + * Square brackets + */ + + if (value === '[') { + if (opts.nobracket === true || !remaining().includes(']')) { + if (opts.nobracket !== true && opts.strictBrackets === true) { + throw new SyntaxError(syntaxError('closing', ']')); } + + value = `\\${value}`; + } else { + increment('brackets'); + } + + push({ type: 'bracket', value }); + continue; } -} -class ClassDeclaration extends ClassNode { - initialise() { - super.initialise(); - if (this.id !== null) { - this.id.variable.isId = true; + if (value === ']') { + if (opts.nobracket === true || (prev && prev.type === 'bracket' && prev.value.length === 1)) { + push({ type: 'text', value, output: `\\${value}` }); + continue; + } + + if (state.brackets === 0) { + if (opts.strictBrackets === true) { + throw new SyntaxError(syntaxError('opening', '[')); } + + push({ type: 'text', value, output: `\\${value}` }); + continue; + } + + decrement('brackets'); + + const prevValue = prev.value.slice(1); + if (prev.posix !== true && prevValue[0] === '^' && !prevValue.includes('/')) { + value = `/${value}`; + } + + prev.value += value; + append({ value }); + + // when literal brackets are explicitly disabled + // assume we should match with a regex character class + if (opts.literalBrackets === false || utils$1.hasRegexChars(prevValue)) { + continue; + } + + const escaped = utils$1.escapeRegex(prev.value); + state.output = state.output.slice(0, -prev.value.length); + + // when literal brackets are explicitly enabled + // assume we should escape the brackets to match literal characters + if (opts.literalBrackets === true) { + state.output += escaped; + prev.value = escaped; + continue; + } + + // when the user specifies nothing, try to match both + prev.value = `(${capture}${escaped}|${prev.value})`; + state.output += prev.value; + continue; } - parseNode(esTreeNode) { - if (esTreeNode.id !== null) { - this.id = new this.context.nodeConstructors.Identifier(esTreeNode.id, this, this.scope.parent); - } - super.parseNode(esTreeNode); + + /** + * Braces + */ + + if (value === '{' && opts.nobrace !== true) { + increment('braces'); + + const open = { + type: 'brace', + value, + output: '(', + outputIndex: state.output.length, + tokensIndex: state.tokens.length + }; + + braces.push(open); + push(open); + continue; } - render(code, options) { - if (options.format === 'system' && - this.id && - options.exportNamesByVariable.has(this.id.variable)) { - code.appendLeft(this.end, `${options.compact ? '' : ' '}${getSystemExportStatement([this.id.variable], options)};`); + + if (value === '}') { + const brace = braces[braces.length - 1]; + + if (opts.nobrace === true || !brace) { + push({ type: 'text', value, output: value }); + continue; + } + + let output = ')'; + + if (brace.dots === true) { + const arr = tokens.slice(); + const range = []; + + for (let i = arr.length - 1; i >= 0; i--) { + tokens.pop(); + if (arr[i].type === 'brace') { + break; + } + if (arr[i].type !== 'dots') { + range.unshift(arr[i].value); + } } - super.render(code, options); - } -} -class ArgumentsVariable extends LocalVariable { - constructor(context) { - super('arguments', null, UNKNOWN_EXPRESSION, context); - } - hasEffectsWhenAccessedAtPath(path) { - return path.length > 1; - } - hasEffectsWhenAssignedAtPath() { - return true; - } - hasEffectsWhenCalledAtPath() { - return true; - } -} + output = expandRange(range, opts); + state.backtrack = true; + } -class ThisVariable extends LocalVariable { - constructor(context) { - super('this', null, null, context); - } - getLiteralValueAtPath() { - return UnknownValue; - } - hasEffectsWhenAccessedAtPath(path, context) { - return (this.getInit(context).hasEffectsWhenAccessedAtPath(path, context) || - super.hasEffectsWhenAccessedAtPath(path, context)); + if (brace.comma !== true && brace.dots !== true) { + const out = state.output.slice(0, brace.outputIndex); + const toks = state.tokens.slice(brace.tokensIndex); + brace.value = brace.output = '\\{'; + value = output = '\\}'; + state.output = out; + for (const t of toks) { + state.output += (t.output || t.value); + } + } + + push({ type: 'brace', value, output }); + decrement('braces'); + braces.pop(); + continue; } - hasEffectsWhenAssignedAtPath(path, context) { - return (this.getInit(context).hasEffectsWhenAssignedAtPath(path, context) || - super.hasEffectsWhenAssignedAtPath(path, context)); + + /** + * Pipes + */ + + if (value === '|') { + if (extglobs.length > 0) { + extglobs[extglobs.length - 1].conditions++; + } + push({ type: 'text', value }); + continue; } - hasEffectsWhenCalledAtPath(path, callOptions, context) { - return (this.getInit(context).hasEffectsWhenCalledAtPath(path, callOptions, context) || - super.hasEffectsWhenCalledAtPath(path, callOptions, context)); + + /** + * Commas + */ + + if (value === ',') { + let output = value; + + const brace = braces[braces.length - 1]; + if (brace && stack[stack.length - 1] === 'braces') { + brace.comma = true; + output = '|'; + } + + push({ type: 'comma', value, output }); + continue; } - getInit(context) { - return context.replacedVariableInits.get(this) || UNKNOWN_EXPRESSION; + + /** + * Slashes + */ + + if (value === '/') { + // if the beginning of the glob is "./", advance the start + // to the current index, and don't add the "./" characters + // to the state. This greatly simplifies lookbehinds when + // checking for BOS characters like "!" and "." (not "./") + if (prev.type === 'dot' && state.index === state.start + 1) { + state.start = state.index + 1; + state.consumed = ''; + state.output = ''; + tokens.pop(); + prev = bos; // reset "prev" to the first token + continue; + } + + push({ type: 'slash', value, output: SLASH_LITERAL }); + continue; } -} -class ParameterScope extends ChildScope { - constructor(parent, context) { - super(parent); - this.parameters = []; - this.hasRest = false; - this.context = context; - this.hoistedBodyVarScope = new ChildScope(this); + /** + * Dots + */ + + if (value === '.') { + if (state.braces > 0 && prev.type === 'dot') { + if (prev.value === '.') prev.output = DOT_LITERAL; + const brace = braces[braces.length - 1]; + prev.type = 'dots'; + prev.output += value; + prev.value += value; + brace.dots = true; + continue; + } + + if ((state.braces + state.parens) === 0 && prev.type !== 'bos' && prev.type !== 'slash') { + push({ type: 'text', value, output: DOT_LITERAL }); + continue; + } + + push({ type: 'dot', value, output: DOT_LITERAL }); + continue; } + /** - * Adds a parameter to this scope. Parameters must be added in the correct - * order, e.g. from left to right. + * Question marks */ - addParameterDeclaration(identifier) { - const name = identifier.name; - let variable = this.hoistedBodyVarScope.variables.get(name); - if (variable) { - variable.addDeclaration(identifier, null); - } - else { - variable = new LocalVariable(name, identifier, UNKNOWN_EXPRESSION, this.context); + + if (value === '?') { + const isGroup = prev && prev.value === '('; + if (!isGroup && opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { + extglobOpen('qmark', value); + continue; + } + + if (prev && prev.type === 'paren') { + const next = peek(); + let output = value; + + if (next === '<' && !utils$1.supportsLookbehinds()) { + throw new Error('Node.js v10 or higher is required for regex lookbehinds'); } - this.variables.set(name, variable); - return variable; - } - addParameterVariables(parameters, hasRest) { - this.parameters = parameters; - for (const parameterList of parameters) { - for (const parameter of parameterList) { - parameter.alwaysRendered = true; - } + + if ((prev.value === '(' && !/[!=<:]/.test(next)) || (next === '<' && !/<([!=]|\w+>)/.test(remaining()))) { + output = `\\${value}`; } - this.hasRest = hasRest; + + push({ type: 'text', value, output }); + continue; + } + + if (opts.dot !== true && (prev.type === 'slash' || prev.type === 'bos')) { + push({ type: 'qmark', value, output: QMARK_NO_DOT }); + continue; + } + + push({ type: 'qmark', value, output: QMARK }); + continue; } - includeCallArguments(context, args) { - let calledFromTryStatement = false; - let argIncluded = false; - const restParam = this.hasRest && this.parameters[this.parameters.length - 1]; - for (let index = args.length - 1; index >= 0; index--) { - const paramVars = this.parameters[index] || restParam; - const arg = args[index]; - if (paramVars) { - calledFromTryStatement = false; - for (const variable of paramVars) { - if (variable.included) { - argIncluded = true; - } - if (variable.calledFromTryStatement) { - calledFromTryStatement = true; - } - } - } - if (!argIncluded && arg.shouldBeIncluded(context)) { - argIncluded = true; - } - if (argIncluded) { - arg.include(context, calledFromTryStatement); - } + + /** + * Exclamation + */ + + if (value === '!') { + if (opts.noextglob !== true && peek() === '(') { + if (peek(2) !== '?' || !/[!=<:]/.test(peek(3))) { + extglobOpen('negate', value); + continue; } - } -} + } -class ReturnValueScope extends ParameterScope { - constructor() { - super(...arguments); - this.returnExpression = null; - this.returnExpressions = []; + if (opts.nonegate !== true && state.index === 0) { + negate(); + continue; + } } - addReturnExpression(expression) { - this.returnExpressions.push(expression); + + /** + * Plus + */ + + if (value === '+') { + if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { + extglobOpen('plus', value); + continue; + } + + if ((prev && prev.value === '(') || opts.regex === false) { + push({ type: 'plus', value, output: PLUS_LITERAL }); + continue; + } + + if ((prev && (prev.type === 'bracket' || prev.type === 'paren' || prev.type === 'brace')) || state.parens > 0) { + push({ type: 'plus', value }); + continue; + } + + push({ type: 'plus', value: PLUS_LITERAL }); + continue; } - getReturnExpression() { - if (this.returnExpression === null) - this.updateReturnExpression(); - return this.returnExpression; + + /** + * Plain text + */ + + if (value === '@') { + if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { + push({ type: 'at', extglob: true, value, output: '' }); + continue; + } + + push({ type: 'text', value }); + continue; } - updateReturnExpression() { - if (this.returnExpressions.length === 1) { - this.returnExpression = this.returnExpressions[0]; - } - else { - this.returnExpression = UNKNOWN_EXPRESSION; - for (const expression of this.returnExpressions) { - expression.deoptimizePath(UNKNOWN_PATH); - } - } + + /** + * Plain text + */ + + if (value !== '*') { + if (value === '$' || value === '^') { + value = `\\${value}`; + } + + const match = REGEX_NON_SPECIAL_CHARS.exec(remaining()); + if (match) { + value += match[0]; + state.index += match[0].length; + } + + push({ type: 'text', value }); + continue; } -} -class FunctionScope extends ReturnValueScope { - constructor(parent, context) { - super(parent, context); - this.variables.set('arguments', (this.argumentsVariable = new ArgumentsVariable(context))); - this.variables.set('this', (this.thisVariable = new ThisVariable(context))); + /** + * Stars + */ + + if (prev && (prev.type === 'globstar' || prev.star === true)) { + prev.type = 'star'; + prev.star = true; + prev.value += value; + prev.output = star; + state.backtrack = true; + state.globstar = true; + consume(value); + continue; } - findLexicalBoundary() { - return this; + + let rest = remaining(); + if (opts.noextglob !== true && /^\([^?]/.test(rest)) { + extglobOpen('star', value); + continue; } - includeCallArguments(context, args) { - super.includeCallArguments(context, args); - if (this.argumentsVariable.included) { - for (const arg of args) { - if (!arg.included) { - arg.include(context, false); - } - } + + if (prev.type === 'star') { + if (opts.noglobstar === true) { + consume(value); + continue; + } + + const prior = prev.prev; + const before = prior.prev; + const isStart = prior.type === 'slash' || prior.type === 'bos'; + const afterStar = before && (before.type === 'star' || before.type === 'globstar'); + + if (opts.bash === true && (!isStart || (rest[0] && rest[0] !== '/'))) { + push({ type: 'star', value, output: '' }); + continue; + } + + const isBrace = state.braces > 0 && (prior.type === 'comma' || prior.type === 'brace'); + const isExtglob = extglobs.length && (prior.type === 'pipe' || prior.type === 'paren'); + if (!isStart && prior.type !== 'paren' && !isBrace && !isExtglob) { + push({ type: 'star', value, output: '' }); + continue; + } + + // strip consecutive `/**/` + while (rest.slice(0, 3) === '/**') { + const after = input[state.index + 4]; + if (after && after !== '/') { + break; } - } -} + rest = rest.slice(3); + consume('/**', 3); + } -function isReference(node, parent) { - if (node.type === 'MemberExpression') { - return !node.computed && isReference(node.object, node); - } - if (node.type === 'Identifier') { - if (!parent) - return true; - switch (parent.type) { - // disregard `bar` in `foo.bar` - case 'MemberExpression': return parent.computed || node === parent.object; - // disregard the `foo` in `class {foo(){}}` but keep it in `class {[foo](){}}` - case 'MethodDefinition': return parent.computed; - // disregard the `foo` in `class {foo=bar}` but keep it in `class {[foo]=bar}` and `class {bar=foo}` - case 'FieldDefinition': return parent.computed || node === parent.value; - // disregard the `bar` in `{ bar: foo }`, but keep it in `{ [bar]: foo }` - case 'Property': return parent.computed || node === parent.value; - // disregard the `bar` in `export { foo as bar }` or - // the foo in `import { foo as bar }` - case 'ExportSpecifier': - case 'ImportSpecifier': return node === parent.local; - // disregard the `foo` in `foo: while (...) { ... break foo; ... continue foo;}` - case 'LabeledStatement': - case 'BreakStatement': - case 'ContinueStatement': return false; - default: return true; - } - } - return false; -} - -const BLANK = Object.create(null); + if (prior.type === 'bos' && eos()) { + prev.type = 'globstar'; + prev.value += value; + prev.output = globstar(opts); + state.output = prev.output; + state.globstar = true; + consume(value); + continue; + } -const ValueProperties = Symbol('Value Properties'); -const PURE = { pure: true }; -const IMPURE = { pure: false }; -// We use shortened variables to reduce file size here -/* OBJECT */ -const O = { - // @ts-ignore - __proto__: null, - [ValueProperties]: IMPURE -}; -/* PURE FUNCTION */ -const PF = { - // @ts-ignore - __proto__: null, - [ValueProperties]: PURE + if (prior.type === 'slash' && prior.prev.type !== 'bos' && !afterStar && eos()) { + state.output = state.output.slice(0, -(prior.output + prev.output).length); + prior.output = `(?:${prior.output}`; + + prev.type = 'globstar'; + prev.output = globstar(opts) + (opts.strictSlashes ? ')' : '|$)'); + prev.value += value; + state.globstar = true; + state.output += prior.output + prev.output; + consume(value); + continue; + } + + if (prior.type === 'slash' && prior.prev.type !== 'bos' && rest[0] === '/') { + const end = rest[1] !== void 0 ? '|$' : ''; + + state.output = state.output.slice(0, -(prior.output + prev.output).length); + prior.output = `(?:${prior.output}`; + + prev.type = 'globstar'; + prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`; + prev.value += value; + + state.output += prior.output + prev.output; + state.globstar = true; + + consume(value + advance()); + + push({ type: 'slash', value: '/', output: '' }); + continue; + } + + if (prior.type === 'bos' && rest[0] === '/') { + prev.type = 'globstar'; + prev.value += value; + prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`; + state.output = prev.output; + state.globstar = true; + consume(value + advance()); + push({ type: 'slash', value: '/', output: '' }); + continue; + } + + // remove single star from output + state.output = state.output.slice(0, -prev.output.length); + + // reset previous token to globstar + prev.type = 'globstar'; + prev.output = globstar(opts); + prev.value += value; + + // reset output with globstar + state.output += prev.output; + state.globstar = true; + consume(value); + continue; + } + + const token = { type: 'star', value, output: star }; + + if (opts.bash === true) { + token.output = '.*?'; + if (prev.type === 'bos' || prev.type === 'slash') { + token.output = nodot + token.output; + } + push(token); + continue; + } + + if (prev && (prev.type === 'bracket' || prev.type === 'paren') && opts.regex === true) { + token.output = value; + push(token); + continue; + } + + if (state.index === state.start || prev.type === 'slash' || prev.type === 'dot') { + if (prev.type === 'dot') { + state.output += NO_DOT_SLASH; + prev.output += NO_DOT_SLASH; + + } else if (opts.dot === true) { + state.output += NO_DOTS_SLASH; + prev.output += NO_DOTS_SLASH; + + } else { + state.output += nodot; + prev.output += nodot; + } + + if (peek() !== '*') { + state.output += ONE_CHAR; + prev.output += ONE_CHAR; + } + } + + push(token); + } + + while (state.brackets > 0) { + if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ']')); + state.output = utils$1.escapeLast(state.output, '['); + decrement('brackets'); + } + + while (state.parens > 0) { + if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ')')); + state.output = utils$1.escapeLast(state.output, '('); + decrement('parens'); + } + + while (state.braces > 0) { + if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', '}')); + state.output = utils$1.escapeLast(state.output, '{'); + decrement('braces'); + } + + if (opts.strictSlashes !== true && (prev.type === 'star' || prev.type === 'bracket')) { + push({ type: 'maybe_slash', value: '', output: `${SLASH_LITERAL}?` }); + } + + // rebuild the output if we had to backtrack at any point + if (state.backtrack === true) { + state.output = ''; + + for (const token of state.tokens) { + state.output += token.output != null ? token.output : token.value; + + if (token.suffix) { + state.output += token.suffix; + } + } + } + + return state; }; -/* CONSTRUCTOR */ -const C = { - // @ts-ignore - __proto__: null, - [ValueProperties]: IMPURE, - prototype: O + +/** + * Fast paths for creating regular expressions for common glob patterns. + * This can significantly speed up processing and has very little downside + * impact when none of the fast paths match. + */ + +parse$1.fastpaths = (input, options) => { + const opts = { ...options }; + const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; + const len = input.length; + if (len > max) { + throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`); + } + + input = REPLACEMENTS[input] || input; + const win32 = utils$1.isWindows(options); + + // create constants based on platform, for windows or posix + const { + DOT_LITERAL, + SLASH_LITERAL, + ONE_CHAR, + DOTS_SLASH, + NO_DOT, + NO_DOTS, + NO_DOTS_SLASH, + STAR, + START_ANCHOR + } = constants$1.globChars(win32); + + const nodot = opts.dot ? NO_DOTS : NO_DOT; + const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT; + const capture = opts.capture ? '' : '?:'; + const state = { negated: false, prefix: '' }; + let star = opts.bash === true ? '.*?' : STAR; + + if (opts.capture) { + star = `(${star})`; + } + + const globstar = opts => { + if (opts.noglobstar === true) return star; + return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`; + }; + + const create = str => { + switch (str) { + case '*': + return `${nodot}${ONE_CHAR}${star}`; + + case '.*': + return `${DOT_LITERAL}${ONE_CHAR}${star}`; + + case '*.*': + return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`; + + case '*/*': + return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`; + + case '**': + return nodot + globstar(opts); + + case '**/*': + return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`; + + case '**/*.*': + return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`; + + case '**/.*': + return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`; + + default: { + const match = /^(.*?)\.(\w+)$/.exec(str); + if (!match) return; + + const source = create(match[1]); + if (!source) return; + + return source + DOT_LITERAL + match[2]; + } + } + }; + + const output = utils$1.removePrefix(input, state); + let source = create(output); + + if (source && opts.strictSlashes !== true) { + source += `${SLASH_LITERAL}?`; + } + + return source; }; -/* PURE CONSTRUCTOR */ -const PC = { - // @ts-ignore - __proto__: null, - [ValueProperties]: PURE, - prototype: O + +var parse_1 = parse$1; + +const path = require$$0; +const scan = scan_1; +const parse = parse_1; +const utils = utils$3; +const constants = constants$2; +const isObject = val => val && typeof val === 'object' && !Array.isArray(val); + +/** + * Creates a matcher function from one or more glob patterns. The + * returned function takes a string to match as its first argument, + * and returns true if the string is a match. The returned matcher + * function also takes a boolean as the second argument that, when true, + * returns an object with additional information. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch(glob[, options]); + * + * const isMatch = picomatch('*.!(*a)'); + * console.log(isMatch('a.a')); //=> false + * console.log(isMatch('a.b')); //=> true + * ``` + * @name picomatch + * @param {String|Array} `globs` One or more glob patterns. + * @param {Object=} `options` + * @return {Function=} Returns a matcher function. + * @api public + */ + +const picomatch = (glob, options, returnState = false) => { + if (Array.isArray(glob)) { + const fns = glob.map(input => picomatch(input, options, returnState)); + const arrayMatcher = str => { + for (const isMatch of fns) { + const state = isMatch(str); + if (state) return state; + } + return false; + }; + return arrayMatcher; + } + + const isState = isObject(glob) && glob.tokens && glob.input; + + if (glob === '' || (typeof glob !== 'string' && !isState)) { + throw new TypeError('Expected pattern to be a non-empty string'); + } + + const opts = options || {}; + const posix = utils.isWindows(options); + const regex = isState + ? picomatch.compileRe(glob, options) + : picomatch.makeRe(glob, options, false, true); + + const state = regex.state; + delete regex.state; + + let isIgnored = () => false; + if (opts.ignore) { + const ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null }; + isIgnored = picomatch(opts.ignore, ignoreOpts, returnState); + } + + const matcher = (input, returnObject = false) => { + const { isMatch, match, output } = picomatch.test(input, regex, options, { glob, posix }); + const result = { glob, state, regex, posix, input, output, match, isMatch }; + + if (typeof opts.onResult === 'function') { + opts.onResult(result); + } + + if (isMatch === false) { + result.isMatch = false; + return returnObject ? result : false; + } + + if (isIgnored(input)) { + if (typeof opts.onIgnore === 'function') { + opts.onIgnore(result); + } + result.isMatch = false; + return returnObject ? result : false; + } + + if (typeof opts.onMatch === 'function') { + opts.onMatch(result); + } + return returnObject ? result : true; + }; + + if (returnState) { + matcher.state = state; + } + + return matcher; }; -const ARRAY_TYPE = { - // @ts-ignore - __proto__: null, - [ValueProperties]: PURE, - from: PF, - of: PF, - prototype: O + +/** + * Test `input` with the given `regex`. This is used by the main + * `picomatch()` function to test the input string. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.test(input, regex[, options]); + * + * console.log(picomatch.test('foo/bar', /^(?:([^/]*?)\/([^/]*?))$/)); + * // { isMatch: true, match: [ 'foo/', 'foo', 'bar' ], output: 'foo/bar' } + * ``` + * @param {String} `input` String to test. + * @param {RegExp} `regex` + * @return {Object} Returns an object with matching info. + * @api public + */ + +picomatch.test = (input, regex, options, { glob, posix } = {}) => { + if (typeof input !== 'string') { + throw new TypeError('Expected input to be a string'); + } + + if (input === '') { + return { isMatch: false, output: '' }; + } + + const opts = options || {}; + const format = opts.format || (posix ? utils.toPosixSlashes : null); + let match = input === glob; + let output = (match && format) ? format(input) : input; + + if (match === false) { + output = format ? format(input) : input; + match = output === glob; + } + + if (match === false || opts.capture === true) { + if (opts.matchBase === true || opts.basename === true) { + match = picomatch.matchBase(input, regex, options, posix); + } else { + match = regex.exec(output); + } + } + + return { isMatch: Boolean(match), match, output }; }; -const INTL_MEMBER = { - // @ts-ignore - __proto__: null, - [ValueProperties]: PURE, - supportedLocalesOf: PC + +/** + * Match the basename of a filepath. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.matchBase(input, glob[, options]); + * console.log(picomatch.matchBase('foo/bar.js', '*.js'); // true + * ``` + * @param {String} `input` String to test. + * @param {RegExp|String} `glob` Glob pattern or regex created by [.makeRe](#makeRe). + * @return {Boolean} + * @api public + */ + +picomatch.matchBase = (input, glob, options, posix = utils.isWindows(options)) => { + const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options); + return regex.test(path.basename(input)); }; -const knownGlobals = { - // Placeholders for global objects to avoid shape mutations - global: O, - globalThis: O, - self: O, - window: O, - // Common globals - // @ts-ignore - __proto__: null, - [ValueProperties]: IMPURE, - Array: { - // @ts-ignore - __proto__: null, - [ValueProperties]: IMPURE, - from: O, - isArray: PF, - of: PF, - prototype: O + +/** + * Returns true if **any** of the given glob `patterns` match the specified `string`. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.isMatch(string, patterns[, options]); + * + * console.log(picomatch.isMatch('a.a', ['b.*', '*.a'])); //=> true + * console.log(picomatch.isMatch('a.a', 'b.*')); //=> false + * ``` + * @param {String|Array} str The string to test. + * @param {String|Array} patterns One or more glob patterns to use for matching. + * @param {Object} [options] See available [options](#options). + * @return {Boolean} Returns true if any patterns match `str` + * @api public + */ + +picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str); + +/** + * Parse a glob pattern to create the source string for a regular + * expression. + * + * ```js + * const picomatch = require('picomatch'); + * const result = picomatch.parse(pattern[, options]); + * ``` + * @param {String} `pattern` + * @param {Object} `options` + * @return {Object} Returns an object with useful properties and output to be used as a regex source string. + * @api public + */ + +picomatch.parse = (pattern, options) => { + if (Array.isArray(pattern)) return pattern.map(p => picomatch.parse(p, options)); + return parse(pattern, { ...options, fastpaths: false }); +}; + +/** + * Scan a glob pattern to separate the pattern into segments. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.scan(input[, options]); + * + * const result = picomatch.scan('!./foo/*.js'); + * console.log(result); + * { prefix: '!./', + * input: '!./foo/*.js', + * start: 3, + * base: 'foo', + * glob: '*.js', + * isBrace: false, + * isBracket: false, + * isGlob: true, + * isExtglob: false, + * isGlobstar: false, + * negated: true } + * ``` + * @param {String} `input` Glob pattern to scan. + * @param {Object} `options` + * @return {Object} Returns an object with + * @api public + */ + +picomatch.scan = (input, options) => scan(input, options); + +/** + * Compile a regular expression from the `state` object returned by the + * [parse()](#parse) method. + * + * @param {Object} `state` + * @param {Object} `options` + * @param {Boolean} `returnOutput` Intended for implementors, this argument allows you to return the raw output from the parser. + * @param {Boolean} `returnState` Adds the state to a `state` property on the returned regex. Useful for implementors and debugging. + * @return {RegExp} + * @api public + */ + +picomatch.compileRe = (state, options, returnOutput = false, returnState = false) => { + if (returnOutput === true) { + return state.output; + } + + const opts = options || {}; + const prepend = opts.contains ? '' : '^'; + const append = opts.contains ? '' : '$'; + + let source = `${prepend}(?:${state.output})${append}`; + if (state && state.negated === true) { + source = `^(?!${source}).*$`; + } + + const regex = picomatch.toRegex(source, options); + if (returnState === true) { + regex.state = state; + } + + return regex; +}; + +/** + * Create a regular expression from a parsed glob pattern. + * + * ```js + * const picomatch = require('picomatch'); + * const state = picomatch.parse('*.js'); + * // picomatch.compileRe(state[, options]); + * + * console.log(picomatch.compileRe(state)); + * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ + * ``` + * @param {String} `state` The object returned from the `.parse` method. + * @param {Object} `options` + * @param {Boolean} `returnOutput` Implementors may use this argument to return the compiled output, instead of a regular expression. This is not exposed on the options to prevent end-users from mutating the result. + * @param {Boolean} `returnState` Implementors may use this argument to return the state from the parsed glob with the returned regular expression. + * @return {RegExp} Returns a regex created from the given pattern. + * @api public + */ + +picomatch.makeRe = (input, options = {}, returnOutput = false, returnState = false) => { + if (!input || typeof input !== 'string') { + throw new TypeError('Expected a non-empty string'); + } + + let parsed = { negated: false, fastpaths: true }; + + if (options.fastpaths !== false && (input[0] === '.' || input[0] === '*')) { + parsed.output = parse.fastpaths(input, options); + } + + if (!parsed.output) { + parsed = parse(input, options); + } + + return picomatch.compileRe(parsed, options, returnOutput, returnState); +}; + +/** + * Create a regular expression from the given regex source string. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.toRegex(source[, options]); + * + * const { output } = picomatch.parse('*.js'); + * console.log(picomatch.toRegex(output)); + * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ + * ``` + * @param {String} `source` Regular expression source string. + * @param {Object} `options` + * @return {RegExp} + * @api public + */ + +picomatch.toRegex = (source, options) => { + try { + const opts = options || {}; + return new RegExp(source, opts.flags || (opts.nocase ? 'i' : '')); + } catch (err) { + if (options && options.debug === true) throw err; + return /$^/; + } +}; + +/** + * Picomatch constants. + * @return {Object} + */ + +picomatch.constants = constants; + +/** + * Expose "picomatch" + */ + +var picomatch_1 = picomatch; + +(function (module) { + + module.exports = picomatch_1; +} (picomatch$1)); + +const pm = /*@__PURE__*/getDefaultExportFromCjs(picomatch$1.exports); + +const extractors = { + ArrayPattern(names, param) { + for (const element of param.elements) { + if (element) + extractors[element.type](names, element); + } }, - ArrayBuffer: { - // @ts-ignore - __proto__: null, - [ValueProperties]: PURE, - isView: PF, - prototype: O + AssignmentPattern(names, param) { + extractors[param.left.type](names, param.left); }, - Atomics: O, - BigInt: C, - BigInt64Array: C, - BigUint64Array: C, - Boolean: PC, - // @ts-ignore - constructor: C, - DataView: PC, - Date: { - // @ts-ignore - __proto__: null, - [ValueProperties]: PURE, - now: PF, - parse: PF, - prototype: O, - UTC: PF - }, - decodeURI: PF, - decodeURIComponent: PF, - encodeURI: PF, - encodeURIComponent: PF, - Error: PC, - escape: PF, - eval: O, - EvalError: PC, - Float32Array: ARRAY_TYPE, - Float64Array: ARRAY_TYPE, - Function: C, - // @ts-ignore - hasOwnProperty: O, - Infinity: O, - Int16Array: ARRAY_TYPE, - Int32Array: ARRAY_TYPE, - Int8Array: ARRAY_TYPE, - isFinite: PF, - isNaN: PF, - // @ts-ignore - isPrototypeOf: O, - JSON: O, - Map: PC, - Math: { - // @ts-ignore - __proto__: null, - [ValueProperties]: IMPURE, - abs: PF, - acos: PF, - acosh: PF, - asin: PF, - asinh: PF, - atan: PF, - atan2: PF, - atanh: PF, - cbrt: PF, - ceil: PF, - clz32: PF, - cos: PF, - cosh: PF, - exp: PF, - expm1: PF, - floor: PF, - fround: PF, - hypot: PF, - imul: PF, - log: PF, - log10: PF, - log1p: PF, - log2: PF, - max: PF, - min: PF, - pow: PF, - random: PF, - round: PF, - sign: PF, - sin: PF, - sinh: PF, - sqrt: PF, - tan: PF, - tanh: PF, - trunc: PF - }, - NaN: O, - Number: { - // @ts-ignore - __proto__: null, - [ValueProperties]: PURE, - isFinite: PF, - isInteger: PF, - isNaN: PF, - isSafeInteger: PF, - parseFloat: PF, - parseInt: PF, - prototype: O - }, - Object: { - // @ts-ignore - __proto__: null, - [ValueProperties]: PURE, - create: PF, - getNotifier: PF, - getOwn: PF, - getOwnPropertyDescriptor: PF, - getOwnPropertyNames: PF, - getOwnPropertySymbols: PF, - getPrototypeOf: PF, - is: PF, - isExtensible: PF, - isFrozen: PF, - isSealed: PF, - keys: PF, - prototype: O - }, - parseFloat: PF, - parseInt: PF, - Promise: { - // @ts-ignore - __proto__: null, - [ValueProperties]: IMPURE, - all: PF, - prototype: O, - race: PF, - resolve: PF - }, - // @ts-ignore - propertyIsEnumerable: O, - Proxy: O, - RangeError: PC, - ReferenceError: PC, - Reflect: O, - RegExp: PC, - Set: PC, - SharedArrayBuffer: C, - String: { - // @ts-ignore - __proto__: null, - [ValueProperties]: PURE, - fromCharCode: PF, - fromCodePoint: PF, - prototype: O, - raw: PF - }, - Symbol: { - // @ts-ignore - __proto__: null, - [ValueProperties]: PURE, - for: PF, - keyFor: PF, - prototype: O + Identifier(names, param) { + names.push(param.name); }, - SyntaxError: PC, - // @ts-ignore - toLocaleString: O, - // @ts-ignore - toString: O, - TypeError: PC, - Uint16Array: ARRAY_TYPE, - Uint32Array: ARRAY_TYPE, - Uint8Array: ARRAY_TYPE, - Uint8ClampedArray: ARRAY_TYPE, - // Technically, this is a global, but it needs special handling - // undefined: ?, - unescape: PF, - URIError: PC, - // @ts-ignore - valueOf: O, - WeakMap: PC, - WeakSet: PC, - // Additional globals shared by Node and Browser that are not strictly part of the language - clearInterval: C, - clearTimeout: C, - console: O, - Intl: { - // @ts-ignore - __proto__: null, - [ValueProperties]: IMPURE, - Collator: INTL_MEMBER, - DateTimeFormat: INTL_MEMBER, - ListFormat: INTL_MEMBER, - NumberFormat: INTL_MEMBER, - PluralRules: INTL_MEMBER, - RelativeTimeFormat: INTL_MEMBER + MemberExpression() { }, + ObjectPattern(names, param) { + for (const prop of param.properties) { + // @ts-ignore Typescript reports that this is not a valid type + if (prop.type === 'RestElement') { + extractors.RestElement(names, prop); + } + else { + extractors[prop.value.type](names, prop.value); + } + } }, - setInterval: C, - setTimeout: C, - TextDecoder: C, - TextEncoder: C, - URL: C, - URLSearchParams: C, - // Browser specific globals - AbortController: C, - AbortSignal: C, - addEventListener: O, - alert: O, - AnalyserNode: C, - Animation: C, - AnimationEvent: C, - applicationCache: O, - ApplicationCache: C, - ApplicationCacheErrorEvent: C, - atob: O, - Attr: C, - Audio: C, - AudioBuffer: C, - AudioBufferSourceNode: C, - AudioContext: C, - AudioDestinationNode: C, - AudioListener: C, - AudioNode: C, - AudioParam: C, - AudioProcessingEvent: C, - AudioScheduledSourceNode: C, - AudioWorkletNode: C, - BarProp: C, - BaseAudioContext: C, - BatteryManager: C, - BeforeUnloadEvent: C, - BiquadFilterNode: C, - Blob: C, - BlobEvent: C, - blur: O, - BroadcastChannel: C, - btoa: O, - ByteLengthQueuingStrategy: C, - Cache: C, - caches: O, - CacheStorage: C, - cancelAnimationFrame: O, - cancelIdleCallback: O, - CanvasCaptureMediaStreamTrack: C, - CanvasGradient: C, - CanvasPattern: C, - CanvasRenderingContext2D: C, - ChannelMergerNode: C, - ChannelSplitterNode: C, - CharacterData: C, - clientInformation: O, - ClipboardEvent: C, - close: O, - closed: O, - CloseEvent: C, - Comment: C, - CompositionEvent: C, - confirm: O, - ConstantSourceNode: C, - ConvolverNode: C, - CountQueuingStrategy: C, - createImageBitmap: O, - Credential: C, - CredentialsContainer: C, - crypto: O, - Crypto: C, - CryptoKey: C, - CSS: C, - CSSConditionRule: C, - CSSFontFaceRule: C, - CSSGroupingRule: C, - CSSImportRule: C, - CSSKeyframeRule: C, - CSSKeyframesRule: C, - CSSMediaRule: C, - CSSNamespaceRule: C, - CSSPageRule: C, - CSSRule: C, - CSSRuleList: C, - CSSStyleDeclaration: C, - CSSStyleRule: C, - CSSStyleSheet: C, - CSSSupportsRule: C, - CustomElementRegistry: C, - customElements: O, - CustomEvent: C, - DataTransfer: C, - DataTransferItem: C, - DataTransferItemList: C, - defaultstatus: O, - defaultStatus: O, - DelayNode: C, - DeviceMotionEvent: C, - DeviceOrientationEvent: C, - devicePixelRatio: O, - dispatchEvent: O, - document: O, - Document: C, - DocumentFragment: C, - DocumentType: C, - DOMError: C, - DOMException: C, - DOMImplementation: C, - DOMMatrix: C, - DOMMatrixReadOnly: C, - DOMParser: C, - DOMPoint: C, - DOMPointReadOnly: C, - DOMQuad: C, - DOMRect: C, - DOMRectReadOnly: C, - DOMStringList: C, - DOMStringMap: C, - DOMTokenList: C, - DragEvent: C, - DynamicsCompressorNode: C, - Element: C, - ErrorEvent: C, - Event: C, - EventSource: C, - EventTarget: C, - external: O, - fetch: O, - File: C, - FileList: C, - FileReader: C, - find: O, - focus: O, - FocusEvent: C, - FontFace: C, - FontFaceSetLoadEvent: C, - FormData: C, - frames: O, - GainNode: C, - Gamepad: C, - GamepadButton: C, - GamepadEvent: C, - getComputedStyle: O, - getSelection: O, - HashChangeEvent: C, - Headers: C, - history: O, - History: C, - HTMLAllCollection: C, - HTMLAnchorElement: C, - HTMLAreaElement: C, - HTMLAudioElement: C, - HTMLBaseElement: C, - HTMLBodyElement: C, - HTMLBRElement: C, - HTMLButtonElement: C, - HTMLCanvasElement: C, - HTMLCollection: C, - HTMLContentElement: C, - HTMLDataElement: C, - HTMLDataListElement: C, - HTMLDetailsElement: C, - HTMLDialogElement: C, - HTMLDirectoryElement: C, - HTMLDivElement: C, - HTMLDListElement: C, - HTMLDocument: C, - HTMLElement: C, - HTMLEmbedElement: C, - HTMLFieldSetElement: C, - HTMLFontElement: C, - HTMLFormControlsCollection: C, - HTMLFormElement: C, - HTMLFrameElement: C, - HTMLFrameSetElement: C, - HTMLHeadElement: C, - HTMLHeadingElement: C, - HTMLHRElement: C, - HTMLHtmlElement: C, - HTMLIFrameElement: C, - HTMLImageElement: C, - HTMLInputElement: C, - HTMLLabelElement: C, - HTMLLegendElement: C, - HTMLLIElement: C, - HTMLLinkElement: C, - HTMLMapElement: C, - HTMLMarqueeElement: C, - HTMLMediaElement: C, - HTMLMenuElement: C, - HTMLMetaElement: C, - HTMLMeterElement: C, - HTMLModElement: C, - HTMLObjectElement: C, - HTMLOListElement: C, - HTMLOptGroupElement: C, - HTMLOptionElement: C, - HTMLOptionsCollection: C, - HTMLOutputElement: C, - HTMLParagraphElement: C, - HTMLParamElement: C, - HTMLPictureElement: C, - HTMLPreElement: C, - HTMLProgressElement: C, - HTMLQuoteElement: C, - HTMLScriptElement: C, - HTMLSelectElement: C, - HTMLShadowElement: C, - HTMLSlotElement: C, - HTMLSourceElement: C, - HTMLSpanElement: C, - HTMLStyleElement: C, - HTMLTableCaptionElement: C, - HTMLTableCellElement: C, - HTMLTableColElement: C, - HTMLTableElement: C, - HTMLTableRowElement: C, - HTMLTableSectionElement: C, - HTMLTemplateElement: C, - HTMLTextAreaElement: C, - HTMLTimeElement: C, - HTMLTitleElement: C, - HTMLTrackElement: C, - HTMLUListElement: C, - HTMLUnknownElement: C, - HTMLVideoElement: C, - IDBCursor: C, - IDBCursorWithValue: C, - IDBDatabase: C, - IDBFactory: C, - IDBIndex: C, - IDBKeyRange: C, - IDBObjectStore: C, - IDBOpenDBRequest: C, - IDBRequest: C, - IDBTransaction: C, - IDBVersionChangeEvent: C, - IdleDeadline: C, - IIRFilterNode: C, - Image: C, - ImageBitmap: C, - ImageBitmapRenderingContext: C, - ImageCapture: C, - ImageData: C, - indexedDB: O, - innerHeight: O, - innerWidth: O, - InputEvent: C, - IntersectionObserver: C, - IntersectionObserverEntry: C, - isSecureContext: O, - KeyboardEvent: C, - KeyframeEffect: C, - length: O, - localStorage: O, - location: O, - Location: C, - locationbar: O, - matchMedia: O, - MediaDeviceInfo: C, - MediaDevices: C, - MediaElementAudioSourceNode: C, - MediaEncryptedEvent: C, - MediaError: C, - MediaKeyMessageEvent: C, - MediaKeySession: C, - MediaKeyStatusMap: C, - MediaKeySystemAccess: C, - MediaList: C, - MediaQueryList: C, - MediaQueryListEvent: C, - MediaRecorder: C, - MediaSettingsRange: C, - MediaSource: C, - MediaStream: C, - MediaStreamAudioDestinationNode: C, - MediaStreamAudioSourceNode: C, - MediaStreamEvent: C, - MediaStreamTrack: C, - MediaStreamTrackEvent: C, - menubar: O, - MessageChannel: C, - MessageEvent: C, - MessagePort: C, - MIDIAccess: C, - MIDIConnectionEvent: C, - MIDIInput: C, - MIDIInputMap: C, - MIDIMessageEvent: C, - MIDIOutput: C, - MIDIOutputMap: C, - MIDIPort: C, - MimeType: C, - MimeTypeArray: C, - MouseEvent: C, - moveBy: O, - moveTo: O, - MutationEvent: C, - MutationObserver: C, - MutationRecord: C, - name: O, - NamedNodeMap: C, - NavigationPreloadManager: C, - navigator: O, - Navigator: C, - NetworkInformation: C, - Node: C, - NodeFilter: O, - NodeIterator: C, - NodeList: C, - Notification: C, - OfflineAudioCompletionEvent: C, - OfflineAudioContext: C, - offscreenBuffering: O, - OffscreenCanvas: C, - open: O, - openDatabase: O, - Option: C, - origin: O, - OscillatorNode: C, - outerHeight: O, - outerWidth: O, - PageTransitionEvent: C, - pageXOffset: O, - pageYOffset: O, - PannerNode: C, - parent: O, - Path2D: C, - PaymentAddress: C, - PaymentRequest: C, - PaymentRequestUpdateEvent: C, - PaymentResponse: C, - performance: O, - Performance: C, - PerformanceEntry: C, - PerformanceLongTaskTiming: C, - PerformanceMark: C, - PerformanceMeasure: C, - PerformanceNavigation: C, - PerformanceNavigationTiming: C, - PerformanceObserver: C, - PerformanceObserverEntryList: C, - PerformancePaintTiming: C, - PerformanceResourceTiming: C, - PerformanceTiming: C, - PeriodicWave: C, - Permissions: C, - PermissionStatus: C, - personalbar: O, - PhotoCapabilities: C, - Plugin: C, - PluginArray: C, - PointerEvent: C, - PopStateEvent: C, - postMessage: O, - Presentation: C, - PresentationAvailability: C, - PresentationConnection: C, - PresentationConnectionAvailableEvent: C, - PresentationConnectionCloseEvent: C, - PresentationConnectionList: C, - PresentationReceiver: C, - PresentationRequest: C, - print: O, - ProcessingInstruction: C, - ProgressEvent: C, - PromiseRejectionEvent: C, - prompt: O, - PushManager: C, - PushSubscription: C, - PushSubscriptionOptions: C, - queueMicrotask: O, - RadioNodeList: C, - Range: C, - ReadableStream: C, - RemotePlayback: C, - removeEventListener: O, - Request: C, - requestAnimationFrame: O, - requestIdleCallback: O, - resizeBy: O, - ResizeObserver: C, - ResizeObserverEntry: C, - resizeTo: O, - Response: C, - RTCCertificate: C, - RTCDataChannel: C, - RTCDataChannelEvent: C, - RTCDtlsTransport: C, - RTCIceCandidate: C, - RTCIceTransport: C, - RTCPeerConnection: C, - RTCPeerConnectionIceEvent: C, - RTCRtpReceiver: C, - RTCRtpSender: C, - RTCSctpTransport: C, - RTCSessionDescription: C, - RTCStatsReport: C, - RTCTrackEvent: C, - screen: O, - Screen: C, - screenLeft: O, - ScreenOrientation: C, - screenTop: O, - screenX: O, - screenY: O, - ScriptProcessorNode: C, - scroll: O, - scrollbars: O, - scrollBy: O, - scrollTo: O, - scrollX: O, - scrollY: O, - SecurityPolicyViolationEvent: C, - Selection: C, - ServiceWorker: C, - ServiceWorkerContainer: C, - ServiceWorkerRegistration: C, - sessionStorage: O, - ShadowRoot: C, - SharedWorker: C, - SourceBuffer: C, - SourceBufferList: C, - speechSynthesis: O, - SpeechSynthesisEvent: C, - SpeechSynthesisUtterance: C, - StaticRange: C, - status: O, - statusbar: O, - StereoPannerNode: C, - stop: O, - Storage: C, - StorageEvent: C, - StorageManager: C, - styleMedia: O, - StyleSheet: C, - StyleSheetList: C, - SubtleCrypto: C, - SVGAElement: C, - SVGAngle: C, - SVGAnimatedAngle: C, - SVGAnimatedBoolean: C, - SVGAnimatedEnumeration: C, - SVGAnimatedInteger: C, - SVGAnimatedLength: C, - SVGAnimatedLengthList: C, - SVGAnimatedNumber: C, - SVGAnimatedNumberList: C, - SVGAnimatedPreserveAspectRatio: C, - SVGAnimatedRect: C, - SVGAnimatedString: C, - SVGAnimatedTransformList: C, - SVGAnimateElement: C, - SVGAnimateMotionElement: C, - SVGAnimateTransformElement: C, - SVGAnimationElement: C, - SVGCircleElement: C, - SVGClipPathElement: C, - SVGComponentTransferFunctionElement: C, - SVGDefsElement: C, - SVGDescElement: C, - SVGDiscardElement: C, - SVGElement: C, - SVGEllipseElement: C, - SVGFEBlendElement: C, - SVGFEColorMatrixElement: C, - SVGFEComponentTransferElement: C, - SVGFECompositeElement: C, - SVGFEConvolveMatrixElement: C, - SVGFEDiffuseLightingElement: C, - SVGFEDisplacementMapElement: C, - SVGFEDistantLightElement: C, - SVGFEDropShadowElement: C, - SVGFEFloodElement: C, - SVGFEFuncAElement: C, - SVGFEFuncBElement: C, - SVGFEFuncGElement: C, - SVGFEFuncRElement: C, - SVGFEGaussianBlurElement: C, - SVGFEImageElement: C, - SVGFEMergeElement: C, - SVGFEMergeNodeElement: C, - SVGFEMorphologyElement: C, - SVGFEOffsetElement: C, - SVGFEPointLightElement: C, - SVGFESpecularLightingElement: C, - SVGFESpotLightElement: C, - SVGFETileElement: C, - SVGFETurbulenceElement: C, - SVGFilterElement: C, - SVGForeignObjectElement: C, - SVGGElement: C, - SVGGeometryElement: C, - SVGGradientElement: C, - SVGGraphicsElement: C, - SVGImageElement: C, - SVGLength: C, - SVGLengthList: C, - SVGLinearGradientElement: C, - SVGLineElement: C, - SVGMarkerElement: C, - SVGMaskElement: C, - SVGMatrix: C, - SVGMetadataElement: C, - SVGMPathElement: C, - SVGNumber: C, - SVGNumberList: C, - SVGPathElement: C, - SVGPatternElement: C, - SVGPoint: C, - SVGPointList: C, - SVGPolygonElement: C, - SVGPolylineElement: C, - SVGPreserveAspectRatio: C, - SVGRadialGradientElement: C, - SVGRect: C, - SVGRectElement: C, - SVGScriptElement: C, - SVGSetElement: C, - SVGStopElement: C, - SVGStringList: C, - SVGStyleElement: C, - SVGSVGElement: C, - SVGSwitchElement: C, - SVGSymbolElement: C, - SVGTextContentElement: C, - SVGTextElement: C, - SVGTextPathElement: C, - SVGTextPositioningElement: C, - SVGTitleElement: C, - SVGTransform: C, - SVGTransformList: C, - SVGTSpanElement: C, - SVGUnitTypes: C, - SVGUseElement: C, - SVGViewElement: C, - TaskAttributionTiming: C, - Text: C, - TextEvent: C, - TextMetrics: C, - TextTrack: C, - TextTrackCue: C, - TextTrackCueList: C, - TextTrackList: C, - TimeRanges: C, - toolbar: O, - top: O, - Touch: C, - TouchEvent: C, - TouchList: C, - TrackEvent: C, - TransitionEvent: C, - TreeWalker: C, - UIEvent: C, - ValidityState: C, - visualViewport: O, - VisualViewport: C, - VTTCue: C, - WaveShaperNode: C, - WebAssembly: O, - WebGL2RenderingContext: C, - WebGLActiveInfo: C, - WebGLBuffer: C, - WebGLContextEvent: C, - WebGLFramebuffer: C, - WebGLProgram: C, - WebGLQuery: C, - WebGLRenderbuffer: C, - WebGLRenderingContext: C, - WebGLSampler: C, - WebGLShader: C, - WebGLShaderPrecisionFormat: C, - WebGLSync: C, - WebGLTexture: C, - WebGLTransformFeedback: C, - WebGLUniformLocation: C, - WebGLVertexArrayObject: C, - WebSocket: C, - WheelEvent: C, - Window: C, - Worker: C, - WritableStream: C, - XMLDocument: C, - XMLHttpRequest: C, - XMLHttpRequestEventTarget: C, - XMLHttpRequestUpload: C, - XMLSerializer: C, - XPathEvaluator: C, - XPathExpression: C, - XPathResult: C, - XSLTProcessor: C + RestElement(names, param) { + extractors[param.argument.type](names, param.argument); + } }; -for (const global of ['window', 'global', 'self', 'globalThis']) { - knownGlobals[global] = knownGlobals; +const extractAssignedNames = function extractAssignedNames(param) { + const names = []; + extractors[param.type](names, param); + return names; +}; + +// Helper since Typescript can't detect readonly arrays with Array.isArray +function isArray$1(arg) { + return Array.isArray(arg); } -function getGlobalAtPath(path) { - let currentGlobal = knownGlobals; - for (const pathSegment of path) { - if (typeof pathSegment !== 'string') { - return null; +function ensureArray$1(thing) { + if (isArray$1(thing)) + return thing; + if (thing == null) + return []; + return [thing]; +} + +const normalizePath = function normalizePath(filename) { + return filename.split(win32.sep).join(posix.sep); +}; + +function getMatcherString(id, resolutionBase) { + if (resolutionBase === false || isAbsolute$1(id) || id.startsWith('*')) { + return normalizePath(id); + } + // resolve('') is valid and will default to process.cwd() + const basePath = normalizePath(resolve(resolutionBase || '')) + // escape all possible (posix + win) path characters that might interfere with regex + .replace(/[-^$*+?.()|[\]{}]/g, '\\$&'); + // Note that we use posix.join because: + // 1. the basePath has been normalized to use / + // 2. the incoming glob (id) matcher, also uses / + // otherwise Node will force backslash (\) on windows + return posix.join(basePath, normalizePath(id)); +} +const createFilter = function createFilter(include, exclude, options) { + const resolutionBase = options && options.resolve; + const getMatcher = (id) => id instanceof RegExp + ? id + : { + test: (what) => { + // this refactor is a tad overly verbose but makes for easy debugging + const pattern = getMatcherString(id, resolutionBase); + const fn = pm(pattern, { dot: true }); + const result = fn(what); + return result; + } + }; + const includeMatchers = ensureArray$1(include).map(getMatcher); + const excludeMatchers = ensureArray$1(exclude).map(getMatcher); + return function result(id) { + if (typeof id !== 'string') + return false; + if (/\0/.test(id)) + return false; + const pathId = normalizePath(id); + for (let i = 0; i < excludeMatchers.length; ++i) { + const matcher = excludeMatchers[i]; + if (matcher.test(pathId)) + return false; } - currentGlobal = currentGlobal[pathSegment]; - if (!currentGlobal) { - return null; + for (let i = 0; i < includeMatchers.length; ++i) { + const matcher = includeMatchers[i]; + if (matcher.test(pathId)) + return true; } - } - return currentGlobal[ValueProperties]; -} -function isPureGlobal(path) { - const globalAtPath = getGlobalAtPath(path); - return globalAtPath !== null && globalAtPath.pure; + return !includeMatchers.length; + }; +}; + +const reservedWords$1 = 'break case class catch const continue debugger default delete do else export extends finally for function if import in instanceof let new return super switch this throw try typeof var void while with yield enum await implements package protected static interface private public'; +const builtins$1 = 'arguments Infinity NaN undefined null true false eval uneval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Symbol Error EvalError InternalError RangeError ReferenceError SyntaxError TypeError URIError Number Math Date String RegExp Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array Map Set WeakMap WeakSet SIMD ArrayBuffer DataView JSON Promise Generator GeneratorFunction Reflect Proxy Intl'; +const forbiddenIdentifiers = new Set(`${reservedWords$1} ${builtins$1}`.split(' ')); +forbiddenIdentifiers.add(''); + +const BROKEN_FLOW_NONE = 0; +const BROKEN_FLOW_BREAK_CONTINUE = 1; +const BROKEN_FLOW_ERROR_RETURN_LABEL = 2; +function createInclusionContext() { + return { + brokenFlow: BROKEN_FLOW_NONE, + includedCallArguments: new Set(), + includedLabels: new Set() + }; } -function isGlobalMember(path) { - if (path.length === 1) { - return path[0] === 'undefined' || getGlobalAtPath(path) !== null; - } - return getGlobalAtPath(path.slice(0, -1)) !== null; +function createHasEffectsContext() { + return { + accessed: new PathTracker(), + assigned: new PathTracker(), + brokenFlow: BROKEN_FLOW_NONE, + called: new DiscriminatedPathTracker(), + ignore: { + breaks: false, + continues: false, + labels: new Set(), + returnYield: false + }, + includedLabels: new Set(), + instantiated: new DiscriminatedPathTracker(), + replacedVariableInits: new Map() + }; } -class GlobalVariable extends Variable { - constructor() { - super(...arguments); - this.isReassigned = true; - } - hasEffectsWhenAccessedAtPath(path) { - return !isGlobalMember([this.name, ...path]); - } - hasEffectsWhenCalledAtPath(path) { - return !isPureGlobal([this.name, ...path]); - } +function assembleMemberDescriptions(memberDescriptions, inheritedDescriptions = null) { + return Object.create(inheritedDescriptions, memberDescriptions); } - -class Identifier$1 extends NodeBase { - constructor() { - super(...arguments); - this.variable = null; - this.bound = false; +const UNDEFINED_EXPRESSION = new (class UndefinedExpression extends ExpressionEntity { + getLiteralValueAtPath() { + return undefined; } - addExportedVariables(variables, exportNamesByVariable) { - if (this.variable !== null && exportNamesByVariable.has(this.variable)) { - variables.push(this.variable); - } +})(); +const returnsUnknown = { + value: { + hasEffectsWhenCalled: null, + returns: UNKNOWN_EXPRESSION } - bind() { - if (this.bound) - return; - this.bound = true; - if (this.variable === null && isReference(this, this.parent)) { - this.variable = this.scope.findVariable(this.name); - this.variable.addReference(this); - } - if (this.variable !== null && - this.variable instanceof LocalVariable && - this.variable.additionalInitializers !== null) { - this.variable.consolidateInitializers(); +}; +const UNKNOWN_LITERAL_BOOLEAN = new (class UnknownBoolean extends ExpressionEntity { + getReturnExpressionWhenCalledAtPath(path) { + if (path.length === 1) { + return getMemberReturnExpressionWhenCalled(literalBooleanMembers, path[0]); } + return UNKNOWN_EXPRESSION; } - declare(kind, init) { - let variable; - switch (kind) { - case 'var': - variable = this.scope.addDeclaration(this, this.context, init, true); - break; - case 'function': - variable = this.scope.addDeclaration(this, this.context, init, 'function'); - break; - case 'let': - case 'const': - case 'class': - variable = this.scope.addDeclaration(this, this.context, init, false); - break; - case 'parameter': - variable = this.scope.addParameterDeclaration(this); - break; - /* istanbul ignore next */ - default: - /* istanbul ignore next */ - throw new Error(`Internal Error: Unexpected identifier kind ${kind}.`); + hasEffectsOnInteractionAtPath(path, interaction, context) { + if (interaction.type === INTERACTION_ACCESSED) { + return path.length > 1; } - return [(this.variable = variable)]; - } - deoptimizePath(path) { - if (!this.bound) - this.bind(); - if (path.length === 0 && !this.scope.contains(this.name)) { - this.disallowImportReassignment(); + if (interaction.type === INTERACTION_CALLED && path.length === 1) { + return hasMemberEffectWhenCalled(literalBooleanMembers, path[0], interaction, context); } - this.variable.deoptimizePath(path); - } - getLiteralValueAtPath(path, recursionTracker, origin) { - if (!this.bound) - this.bind(); - return this.variable.getLiteralValueAtPath(path, recursionTracker, origin); - } - getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin) { - if (!this.bound) - this.bind(); - return this.variable.getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin); - } - hasEffects() { - return (this.context.options.treeshake.unknownGlobalSideEffects && - this.variable instanceof GlobalVariable && - this.variable.hasEffectsWhenAccessedAtPath(EMPTY_PATH)); - } - hasEffectsWhenAccessedAtPath(path, context) { - return this.variable !== null && this.variable.hasEffectsWhenAccessedAtPath(path, context); - } - hasEffectsWhenAssignedAtPath(path, context) { - return !this.variable || this.variable.hasEffectsWhenAssignedAtPath(path, context); + return true; } - hasEffectsWhenCalledAtPath(path, callOptions, context) { - return !this.variable || this.variable.hasEffectsWhenCalledAtPath(path, callOptions, context); +})(); +const returnsBoolean = { + value: { + hasEffectsWhenCalled: null, + returns: UNKNOWN_LITERAL_BOOLEAN } - include() { - if (!this.included) { - this.included = true; - if (this.variable !== null) { - this.context.includeVariable(this.variable); - } +}; +const UNKNOWN_LITERAL_NUMBER = new (class UnknownNumber extends ExpressionEntity { + getReturnExpressionWhenCalledAtPath(path) { + if (path.length === 1) { + return getMemberReturnExpressionWhenCalled(literalNumberMembers, path[0]); } + return UNKNOWN_EXPRESSION; } - includeCallArguments(context, args) { - this.variable.includeCallArguments(context, args); - } - render(code, _options, { renderedParentType, isCalleeOfRenderedParent, isShorthandProperty } = BLANK) { - if (this.variable) { - const name = this.variable.getName(); - if (name !== this.name) { - code.overwrite(this.start, this.end, name, { - contentOnly: true, - storeName: true - }); - if (isShorthandProperty) { - code.prependRight(this.start, `${this.name}: `); - } - } - // In strict mode, any variable named "eval" must be the actual "eval" function - if (name === 'eval' && - renderedParentType === CallExpression && - isCalleeOfRenderedParent) { - code.appendRight(this.start, '0, '); - } + hasEffectsOnInteractionAtPath(path, interaction, context) { + if (interaction.type === INTERACTION_ACCESSED) { + return path.length > 1; } - } - disallowImportReassignment() { - return this.context.error({ - code: 'ILLEGAL_REASSIGNMENT', - message: `Illegal reassignment to import '${this.name}'` - }, this.start); - } -} - -class RestElement extends NodeBase { - constructor() { - super(...arguments); - this.declarationInit = null; - } - addExportedVariables(variables, exportNamesByVariable) { - this.argument.addExportedVariables(variables, exportNamesByVariable); - } - bind() { - super.bind(); - if (this.declarationInit !== null) { - this.declarationInit.deoptimizePath([UnknownKey, UnknownKey]); + if (interaction.type === INTERACTION_CALLED && path.length === 1) { + return hasMemberEffectWhenCalled(literalNumberMembers, path[0], interaction, context); } + return true; } - declare(kind, init) { - this.declarationInit = init; - return this.argument.declare(kind, UNKNOWN_EXPRESSION); - } - deoptimizePath(path) { - path.length === 0 && this.argument.deoptimizePath(EMPTY_PATH); - } - hasEffectsWhenAssignedAtPath(path, context) { - return path.length > 0 || this.argument.hasEffectsWhenAssignedAtPath(EMPTY_PATH, context); - } -} - -class FunctionNode extends NodeBase { - constructor() { - super(...arguments); - this.isPrototypeDeoptimized = false; - } - createScope(parentScope) { - this.scope = new FunctionScope(parentScope, this.context); - } - deoptimizePath(path) { - if (path.length === 1) { - if (path[0] === 'prototype') { - this.isPrototypeDeoptimized = true; - } - else if (path[0] === UnknownKey) { - this.isPrototypeDeoptimized = true; - // A reassignment of UNKNOWN_PATH is considered equivalent to having lost track - // which means the return expression needs to be reassigned as well - this.scope.getReturnExpression().deoptimizePath(UNKNOWN_PATH); - } - } +})(); +const returnsNumber = { + value: { + hasEffectsWhenCalled: null, + returns: UNKNOWN_LITERAL_NUMBER } +}; +const UNKNOWN_LITERAL_STRING = new (class UnknownString extends ExpressionEntity { getReturnExpressionWhenCalledAtPath(path) { - return path.length === 0 ? this.scope.getReturnExpression() : UNKNOWN_EXPRESSION; - } - hasEffects() { - return this.id !== null && this.id.hasEffects(); - } - hasEffectsWhenAccessedAtPath(path) { - if (path.length <= 1) - return false; - return path.length > 2 || path[0] !== 'prototype' || this.isPrototypeDeoptimized; - } - hasEffectsWhenAssignedAtPath(path) { - if (path.length <= 1) { - return false; + if (path.length === 1) { + return getMemberReturnExpressionWhenCalled(literalStringMembers, path[0]); } - return path.length > 2 || path[0] !== 'prototype' || this.isPrototypeDeoptimized; + return UNKNOWN_EXPRESSION; } - hasEffectsWhenCalledAtPath(path, callOptions, context) { - if (path.length > 0) - return true; - for (const param of this.params) { - if (param.hasEffects(context)) - return true; - } - const thisInit = context.replacedVariableInits.get(this.scope.thisVariable); - context.replacedVariableInits.set(this.scope.thisVariable, callOptions.withNew ? new UnknownObjectExpression() : UNKNOWN_EXPRESSION); - const { brokenFlow, ignore } = context; - context.ignore = { - breaks: false, - continues: false, - labels: new Set(), - returnAwaitYield: true - }; - if (this.body.hasEffects(context)) - return true; - context.brokenFlow = brokenFlow; - if (thisInit) { - context.replacedVariableInits.set(this.scope.thisVariable, thisInit); + hasEffectsOnInteractionAtPath(path, interaction, context) { + if (interaction.type === INTERACTION_ACCESSED) { + return path.length > 1; } - else { - context.replacedVariableInits.delete(this.scope.thisVariable); + if (interaction.type === INTERACTION_CALLED && path.length === 1) { + return hasMemberEffectWhenCalled(literalStringMembers, path[0], interaction, context); } - context.ignore = ignore; - return false; + return true; } - include(context, includeChildrenRecursively) { - this.included = true; - if (this.id) - this.id.include(); - const hasArguments = this.scope.argumentsVariable.included; - for (const param of this.params) { - if (!(param instanceof Identifier$1) || hasArguments) { - param.include(context, includeChildrenRecursively); - } - } - const { brokenFlow } = context; - context.brokenFlow = BROKEN_FLOW_NONE; - this.body.include(context, includeChildrenRecursively); - context.brokenFlow = brokenFlow; +})(); +const returnsString = { + value: { + hasEffectsWhenCalled: null, + returns: UNKNOWN_LITERAL_STRING + } +}; +const stringReplace = { + value: { + hasEffectsWhenCalled({ args }, context) { + const arg1 = args[1]; + return (args.length < 2 || + (typeof arg1.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, { + deoptimizeCache() { } + }) === 'symbol' && + arg1.hasEffectsOnInteractionAtPath(EMPTY_PATH, NODE_INTERACTION_UNKNOWN_CALL, context))); + }, + returns: UNKNOWN_LITERAL_STRING + } +}; +const objectMembers = assembleMemberDescriptions({ + hasOwnProperty: returnsBoolean, + isPrototypeOf: returnsBoolean, + propertyIsEnumerable: returnsBoolean, + toLocaleString: returnsString, + toString: returnsString, + valueOf: returnsUnknown +}); +const literalBooleanMembers = assembleMemberDescriptions({ + valueOf: returnsBoolean +}, objectMembers); +const literalNumberMembers = assembleMemberDescriptions({ + toExponential: returnsString, + toFixed: returnsString, + toLocaleString: returnsString, + toPrecision: returnsString, + valueOf: returnsNumber +}, objectMembers); +const literalStringMembers = assembleMemberDescriptions({ + anchor: returnsString, + at: returnsUnknown, + big: returnsString, + blink: returnsString, + bold: returnsString, + charAt: returnsString, + charCodeAt: returnsNumber, + codePointAt: returnsUnknown, + concat: returnsString, + endsWith: returnsBoolean, + fixed: returnsString, + fontcolor: returnsString, + fontsize: returnsString, + includes: returnsBoolean, + indexOf: returnsNumber, + italics: returnsString, + lastIndexOf: returnsNumber, + link: returnsString, + localeCompare: returnsNumber, + match: returnsUnknown, + matchAll: returnsUnknown, + normalize: returnsString, + padEnd: returnsString, + padStart: returnsString, + repeat: returnsString, + replace: stringReplace, + replaceAll: stringReplace, + search: returnsNumber, + slice: returnsString, + small: returnsString, + split: returnsUnknown, + startsWith: returnsBoolean, + strike: returnsString, + sub: returnsString, + substr: returnsString, + substring: returnsString, + sup: returnsString, + toLocaleLowerCase: returnsString, + toLocaleUpperCase: returnsString, + toLowerCase: returnsString, + toString: returnsString, + toUpperCase: returnsString, + trim: returnsString, + trimEnd: returnsString, + trimLeft: returnsString, + trimRight: returnsString, + trimStart: returnsString, + valueOf: returnsString +}, objectMembers); +function getLiteralMembersForValue(value) { + switch (typeof value) { + case 'boolean': + return literalBooleanMembers; + case 'number': + return literalNumberMembers; + case 'string': + return literalStringMembers; } - includeCallArguments(context, args) { - this.scope.includeCallArguments(context, args); + return Object.create(null); +} +function hasMemberEffectWhenCalled(members, memberName, interaction, context) { + var _a, _b; + if (typeof memberName !== 'string' || !members[memberName]) { + return true; } - initialise() { - if (this.id !== null) { - this.id.declare('function', this); - } - this.scope.addParameterVariables(this.params.map(param => param.declare('parameter', UNKNOWN_EXPRESSION)), this.params[this.params.length - 1] instanceof RestElement); - this.body.addImplicitReturnExpressionToScope(); + return ((_b = (_a = members[memberName]).hasEffectsWhenCalled) === null || _b === void 0 ? void 0 : _b.call(_a, interaction, context)) || false; +} +function getMemberReturnExpressionWhenCalled(members, memberName) { + if (typeof memberName !== 'string' || !members[memberName]) + return UNKNOWN_EXPRESSION; + return members[memberName].returns; +} + +// AST walker module for Mozilla Parser API compatible trees + +function skipThrough(node, st, c) { c(node, st); } +function ignore(_node, _st, _c) {} + +// Node walkers. + +var base$1 = {}; + +base$1.Program = base$1.BlockStatement = base$1.StaticBlock = function (node, st, c) { + for (var i = 0, list = node.body; i < list.length; i += 1) + { + var stmt = list[i]; + + c(stmt, st, "Statement"); + } +}; +base$1.Statement = skipThrough; +base$1.EmptyStatement = ignore; +base$1.ExpressionStatement = base$1.ParenthesizedExpression = base$1.ChainExpression = + function (node, st, c) { return c(node.expression, st, "Expression"); }; +base$1.IfStatement = function (node, st, c) { + c(node.test, st, "Expression"); + c(node.consequent, st, "Statement"); + if (node.alternate) { c(node.alternate, st, "Statement"); } +}; +base$1.LabeledStatement = function (node, st, c) { return c(node.body, st, "Statement"); }; +base$1.BreakStatement = base$1.ContinueStatement = ignore; +base$1.WithStatement = function (node, st, c) { + c(node.object, st, "Expression"); + c(node.body, st, "Statement"); +}; +base$1.SwitchStatement = function (node, st, c) { + c(node.discriminant, st, "Expression"); + for (var i$1 = 0, list$1 = node.cases; i$1 < list$1.length; i$1 += 1) { + var cs = list$1[i$1]; + + if (cs.test) { c(cs.test, st, "Expression"); } + for (var i = 0, list = cs.consequent; i < list.length; i += 1) + { + var cons = list[i]; + + c(cons, st, "Statement"); } - parseNode(esTreeNode) { - this.body = new this.context.nodeConstructors.BlockStatement(esTreeNode.body, this, this.scope.hoistedBodyVarScope); - super.parseNode(esTreeNode); + } +}; +base$1.SwitchCase = function (node, st, c) { + if (node.test) { c(node.test, st, "Expression"); } + for (var i = 0, list = node.consequent; i < list.length; i += 1) + { + var cons = list[i]; + + c(cons, st, "Statement"); + } +}; +base$1.ReturnStatement = base$1.YieldExpression = base$1.AwaitExpression = function (node, st, c) { + if (node.argument) { c(node.argument, st, "Expression"); } +}; +base$1.ThrowStatement = base$1.SpreadElement = + function (node, st, c) { return c(node.argument, st, "Expression"); }; +base$1.TryStatement = function (node, st, c) { + c(node.block, st, "Statement"); + if (node.handler) { c(node.handler, st); } + if (node.finalizer) { c(node.finalizer, st, "Statement"); } +}; +base$1.CatchClause = function (node, st, c) { + if (node.param) { c(node.param, st, "Pattern"); } + c(node.body, st, "Statement"); +}; +base$1.WhileStatement = base$1.DoWhileStatement = function (node, st, c) { + c(node.test, st, "Expression"); + c(node.body, st, "Statement"); +}; +base$1.ForStatement = function (node, st, c) { + if (node.init) { c(node.init, st, "ForInit"); } + if (node.test) { c(node.test, st, "Expression"); } + if (node.update) { c(node.update, st, "Expression"); } + c(node.body, st, "Statement"); +}; +base$1.ForInStatement = base$1.ForOfStatement = function (node, st, c) { + c(node.left, st, "ForInit"); + c(node.right, st, "Expression"); + c(node.body, st, "Statement"); +}; +base$1.ForInit = function (node, st, c) { + if (node.type === "VariableDeclaration") { c(node, st); } + else { c(node, st, "Expression"); } +}; +base$1.DebuggerStatement = ignore; + +base$1.FunctionDeclaration = function (node, st, c) { return c(node, st, "Function"); }; +base$1.VariableDeclaration = function (node, st, c) { + for (var i = 0, list = node.declarations; i < list.length; i += 1) + { + var decl = list[i]; + + c(decl, st); + } +}; +base$1.VariableDeclarator = function (node, st, c) { + c(node.id, st, "Pattern"); + if (node.init) { c(node.init, st, "Expression"); } +}; + +base$1.Function = function (node, st, c) { + if (node.id) { c(node.id, st, "Pattern"); } + for (var i = 0, list = node.params; i < list.length; i += 1) + { + var param = list[i]; + + c(param, st, "Pattern"); + } + c(node.body, st, node.expression ? "Expression" : "Statement"); +}; + +base$1.Pattern = function (node, st, c) { + if (node.type === "Identifier") + { c(node, st, "VariablePattern"); } + else if (node.type === "MemberExpression") + { c(node, st, "MemberPattern"); } + else + { c(node, st); } +}; +base$1.VariablePattern = ignore; +base$1.MemberPattern = skipThrough; +base$1.RestElement = function (node, st, c) { return c(node.argument, st, "Pattern"); }; +base$1.ArrayPattern = function (node, st, c) { + for (var i = 0, list = node.elements; i < list.length; i += 1) { + var elt = list[i]; + + if (elt) { c(elt, st, "Pattern"); } + } +}; +base$1.ObjectPattern = function (node, st, c) { + for (var i = 0, list = node.properties; i < list.length; i += 1) { + var prop = list[i]; + + if (prop.type === "Property") { + if (prop.computed) { c(prop.key, st, "Expression"); } + c(prop.value, st, "Pattern"); + } else if (prop.type === "RestElement") { + c(prop.argument, st, "Pattern"); } -} -FunctionNode.prototype.preventChildBlockScope = true; + } +}; + +base$1.Expression = skipThrough; +base$1.ThisExpression = base$1.Super = base$1.MetaProperty = ignore; +base$1.ArrayExpression = function (node, st, c) { + for (var i = 0, list = node.elements; i < list.length; i += 1) { + var elt = list[i]; + + if (elt) { c(elt, st, "Expression"); } + } +}; +base$1.ObjectExpression = function (node, st, c) { + for (var i = 0, list = node.properties; i < list.length; i += 1) + { + var prop = list[i]; + + c(prop, st); + } +}; +base$1.FunctionExpression = base$1.ArrowFunctionExpression = base$1.FunctionDeclaration; +base$1.SequenceExpression = function (node, st, c) { + for (var i = 0, list = node.expressions; i < list.length; i += 1) + { + var expr = list[i]; + + c(expr, st, "Expression"); + } +}; +base$1.TemplateLiteral = function (node, st, c) { + for (var i = 0, list = node.quasis; i < list.length; i += 1) + { + var quasi = list[i]; + + c(quasi, st); + } + + for (var i$1 = 0, list$1 = node.expressions; i$1 < list$1.length; i$1 += 1) + { + var expr = list$1[i$1]; + + c(expr, st, "Expression"); + } +}; +base$1.TemplateElement = ignore; +base$1.UnaryExpression = base$1.UpdateExpression = function (node, st, c) { + c(node.argument, st, "Expression"); +}; +base$1.BinaryExpression = base$1.LogicalExpression = function (node, st, c) { + c(node.left, st, "Expression"); + c(node.right, st, "Expression"); +}; +base$1.AssignmentExpression = base$1.AssignmentPattern = function (node, st, c) { + c(node.left, st, "Pattern"); + c(node.right, st, "Expression"); +}; +base$1.ConditionalExpression = function (node, st, c) { + c(node.test, st, "Expression"); + c(node.consequent, st, "Expression"); + c(node.alternate, st, "Expression"); +}; +base$1.NewExpression = base$1.CallExpression = function (node, st, c) { + c(node.callee, st, "Expression"); + if (node.arguments) + { for (var i = 0, list = node.arguments; i < list.length; i += 1) + { + var arg = list[i]; + + c(arg, st, "Expression"); + } } +}; +base$1.MemberExpression = function (node, st, c) { + c(node.object, st, "Expression"); + if (node.computed) { c(node.property, st, "Expression"); } +}; +base$1.ExportNamedDeclaration = base$1.ExportDefaultDeclaration = function (node, st, c) { + if (node.declaration) + { c(node.declaration, st, node.type === "ExportNamedDeclaration" || node.declaration.id ? "Statement" : "Expression"); } + if (node.source) { c(node.source, st, "Expression"); } +}; +base$1.ExportAllDeclaration = function (node, st, c) { + if (node.exported) + { c(node.exported, st); } + c(node.source, st, "Expression"); +}; +base$1.ImportDeclaration = function (node, st, c) { + for (var i = 0, list = node.specifiers; i < list.length; i += 1) + { + var spec = list[i]; + + c(spec, st); + } + c(node.source, st, "Expression"); +}; +base$1.ImportExpression = function (node, st, c) { + c(node.source, st, "Expression"); +}; +base$1.ImportSpecifier = base$1.ImportDefaultSpecifier = base$1.ImportNamespaceSpecifier = base$1.Identifier = base$1.PrivateIdentifier = base$1.Literal = ignore; -class FunctionDeclaration extends FunctionNode { - initialise() { - super.initialise(); - if (this.id !== null) { - this.id.variable.isId = true; - } - } - parseNode(esTreeNode) { - if (esTreeNode.id !== null) { - this.id = new this.context.nodeConstructors.Identifier(esTreeNode.id, this, this.scope - .parent); - } - super.parseNode(esTreeNode); - } -} +base$1.TaggedTemplateExpression = function (node, st, c) { + c(node.tag, st, "Expression"); + c(node.quasi, st, "Expression"); +}; +base$1.ClassDeclaration = base$1.ClassExpression = function (node, st, c) { return c(node, st, "Class"); }; +base$1.Class = function (node, st, c) { + if (node.id) { c(node.id, st, "Pattern"); } + if (node.superClass) { c(node.superClass, st, "Expression"); } + c(node.body, st); +}; +base$1.ClassBody = function (node, st, c) { + for (var i = 0, list = node.body; i < list.length; i += 1) + { + var elt = list[i]; -// The header ends at the first non-white-space after "default" -function getDeclarationStart(code, start) { - return findNonWhiteSpace(code, findFirstOccurrenceOutsideComment(code, 'default', start) + 7); -} -function getIdInsertPosition(code, declarationKeyword, endMarker, start) { - const declarationEnd = findFirstOccurrenceOutsideComment(code, declarationKeyword, start) + declarationKeyword.length; - code = code.slice(declarationEnd, findFirstOccurrenceOutsideComment(code, endMarker, declarationEnd)); - const generatorStarPos = findFirstOccurrenceOutsideComment(code, '*'); - if (generatorStarPos === -1) { - return declarationEnd; - } - return declarationEnd + generatorStarPos + 1; -} -class ExportDefaultDeclaration extends NodeBase { - include(context, includeChildrenRecursively) { - super.include(context, includeChildrenRecursively); - if (includeChildrenRecursively) { - this.context.includeVariable(this.variable); - } - } - initialise() { - const declaration = this.declaration; - this.declarationName = - (declaration.id && declaration.id.name) || this.declaration.name; - this.variable = this.scope.addExportDefaultDeclaration(this.declarationName || this.context.getModuleName(), this, this.context); - this.context.addExport(this); - } - render(code, options, nodeRenderOptions) { - const { start, end } = nodeRenderOptions; - const declarationStart = getDeclarationStart(code.original, this.start); - if (this.declaration instanceof FunctionDeclaration) { - this.renderNamedDeclaration(code, declarationStart, 'function', '(', this.declaration.id === null, options); - } - else if (this.declaration instanceof ClassDeclaration) { - this.renderNamedDeclaration(code, declarationStart, 'class', '{', this.declaration.id === null, options); - } - else if (this.variable.getOriginalVariable() !== this.variable) { - // Remove altogether to prevent re-declaring the same variable - treeshakeNode(this, code, start, end); - return; - } - else if (this.variable.included) { - this.renderVariableDeclaration(code, declarationStart, options); - } - else { - code.remove(this.start, declarationStart); - this.declaration.render(code, options, { - isCalleeOfRenderedParent: false, - renderedParentType: ExpressionStatement - }); - if (code.original[this.end - 1] !== ';') { - code.appendLeft(this.end, ';'); - } - return; - } - this.declaration.render(code, options); - } - renderNamedDeclaration(code, declarationStart, declarationKeyword, endMarker, needsId, options) { - const name = this.variable.getName(); - // Remove `export default` - code.remove(this.start, declarationStart); - if (needsId) { - code.appendLeft(getIdInsertPosition(code.original, declarationKeyword, endMarker, declarationStart), ` ${name}`); - } - if (options.format === 'system' && - this.declaration instanceof ClassDeclaration && - options.exportNamesByVariable.has(this.variable)) { - code.appendLeft(this.end, ` ${getSystemExportStatement([this.variable], options)};`); - } - } - renderVariableDeclaration(code, declarationStart, options) { - const hasTrailingSemicolon = code.original.charCodeAt(this.end - 1) === 59; /*";"*/ - const systemExportNames = options.format === 'system' && options.exportNamesByVariable.get(this.variable); - if (systemExportNames) { - code.overwrite(this.start, declarationStart, `${options.varOrConst} ${this.variable.getName()} = exports('${systemExportNames[0]}', `); - code.appendRight(hasTrailingSemicolon ? this.end - 1 : this.end, ')' + (hasTrailingSemicolon ? '' : ';')); - } - else { - code.overwrite(this.start, declarationStart, `${options.varOrConst} ${this.variable.getName()} = `); - if (!hasTrailingSemicolon) { - code.appendLeft(this.end, ';'); - } - } - } -} -ExportDefaultDeclaration.prototype.needsBoundaries = true; + c(elt, st); + } +}; +base$1.MethodDefinition = base$1.PropertyDefinition = base$1.Property = function (node, st, c) { + if (node.computed) { c(node.key, st, "Expression"); } + if (node.value) { c(node.value, st, "Expression"); } +}; + +const ArrowFunctionExpression$1 = 'ArrowFunctionExpression'; +const BinaryExpression$1 = 'BinaryExpression'; +const BlockStatement$1 = 'BlockStatement'; +const CallExpression$1 = 'CallExpression'; +const ChainExpression$1 = 'ChainExpression'; +const ConditionalExpression$1 = 'ConditionalExpression'; +const ExpressionStatement$1 = 'ExpressionStatement'; +const Identifier$1 = 'Identifier'; +const ImportDefaultSpecifier$1 = 'ImportDefaultSpecifier'; +const ImportNamespaceSpecifier$1 = 'ImportNamespaceSpecifier'; +const LogicalExpression$1 = 'LogicalExpression'; +const NewExpression$1 = 'NewExpression'; +const Program$1 = 'Program'; +const Property$1 = 'Property'; +const ReturnStatement$1 = 'ReturnStatement'; +const SequenceExpression$1 = 'SequenceExpression'; -class UndefinedVariable extends Variable { - constructor() { - super('undefined'); - } - getLiteralValueAtPath() { - return undefined; - } -} +// this looks ridiculous, but it prevents sourcemap tooling from mistaking +// this for an actual sourceMappingURL +let SOURCEMAPPING_URL = 'sourceMa'; +SOURCEMAPPING_URL += 'ppingURL'; +const whiteSpaceNoNewline = '[ \\f\\r\\t\\v\\u00a0\\u1680\\u2000-\\u200a\\u2028\\u2029\\u202f\\u205f\\u3000\\ufeff]'; +const SOURCEMAPPING_URL_RE = new RegExp(`^#${whiteSpaceNoNewline}+${SOURCEMAPPING_URL}=.+`); -class ExportDefaultVariable extends LocalVariable { - constructor(name, exportDefaultDeclaration, context) { - super(name, exportDefaultDeclaration, exportDefaultDeclaration.declaration, context); - this.hasId = false; - // Not initialised during construction - this.originalId = null; - this.originalVariableAndDeclarationModules = null; - const declaration = exportDefaultDeclaration.declaration; - if ((declaration instanceof FunctionDeclaration || declaration instanceof ClassDeclaration) && - declaration.id) { - this.hasId = true; - this.originalId = declaration.id; - } - else if (declaration instanceof Identifier$1) { - this.originalId = declaration; - } - } - addReference(identifier) { - if (!this.hasId) { - this.name = identifier.name; - } - } - getAssignedVariableName() { - return (this.originalId && this.originalId.name) || null; - } - getBaseVariableName() { - const original = this.getOriginalVariable(); - if (original === this) { - return super.getBaseVariableName(); - } - else { - return original.getBaseVariableName(); - } - } - getName() { - const original = this.getOriginalVariable(); - if (original === this) { - return super.getName(); - } - else { - return original.getName(); - } - } - getOriginalVariable() { - return this.getOriginalVariableAndDeclarationModules().original; +const ANNOTATION_KEY = '_rollupAnnotations'; +const INVALID_COMMENT_KEY = '_rollupRemoved'; +function handlePureAnnotationsOfNode(node, state, type = node.type) { + const { annotations } = state; + let comment = annotations[state.annotationIndex]; + while (comment && node.start >= comment.end) { + markPureNode(node, comment, state.code); + comment = annotations[++state.annotationIndex]; } - getOriginalVariableAndDeclarationModules() { - if (this.originalVariableAndDeclarationModules === null) { - if (!this.originalId || - (!this.hasId && - (this.originalId.variable.isReassigned || - this.originalId.variable instanceof UndefinedVariable))) { - this.originalVariableAndDeclarationModules = { modules: [], original: this }; - } - else { - const assignedOriginal = this.originalId.variable; - if (assignedOriginal instanceof ExportDefaultVariable) { - const { modules, original } = assignedOriginal.getOriginalVariableAndDeclarationModules(); - this.originalVariableAndDeclarationModules = { - modules: modules.concat(this.module), - original - }; - } - else { - this.originalVariableAndDeclarationModules = { - modules: [this.module], - original: assignedOriginal - }; - } + if (comment && comment.end <= node.end) { + base$1[type](node, state, handlePureAnnotationsOfNode); + while ((comment = annotations[state.annotationIndex]) && comment.end <= node.end) { + ++state.annotationIndex; + annotateNode(node, comment, false); + } + } +} +const neitherWithespaceNorBrackets = /[^\s(]/g; +const noWhitespace = /\S/g; +function markPureNode(node, comment, code) { + const annotatedNodes = []; + let invalidAnnotation; + const codeInBetween = code.slice(comment.end, node.start); + if (doesNotMatchOutsideComment(codeInBetween, neitherWithespaceNorBrackets)) { + const parentStart = node.start; + while (true) { + annotatedNodes.push(node); + switch (node.type) { + case ExpressionStatement$1: + case ChainExpression$1: + node = node.expression; + continue; + case SequenceExpression$1: + // if there are parentheses, the annotation would apply to the entire expression + if (doesNotMatchOutsideComment(code.slice(parentStart, node.start), noWhitespace)) { + node = node.expressions[0]; + continue; + } + invalidAnnotation = true; + break; + case ConditionalExpression$1: + // if there are parentheses, the annotation would apply to the entire expression + if (doesNotMatchOutsideComment(code.slice(parentStart, node.start), noWhitespace)) { + node = node.test; + continue; + } + invalidAnnotation = true; + break; + case LogicalExpression$1: + case BinaryExpression$1: + // if there are parentheses, the annotation would apply to the entire expression + if (doesNotMatchOutsideComment(code.slice(parentStart, node.start), noWhitespace)) { + node = node.left; + continue; + } + invalidAnnotation = true; + break; + case CallExpression$1: + case NewExpression$1: + break; + default: + invalidAnnotation = true; } + break; } - return this.originalVariableAndDeclarationModules; - } -} - -const MISSING_EXPORT_SHIM_VARIABLE = '_missingExportShim'; -const INTEROP_DEFAULT_VARIABLE = '_interopDefault'; -const INTEROP_NAMESPACE_VARIABLE = '_interopNamespace'; - -class ExportShimVariable extends Variable { - constructor(module) { - super(MISSING_EXPORT_SHIM_VARIABLE); - this.module = module; - } -} - -class NamespaceVariable extends Variable { - constructor(context, syntheticNamedExports) { - super(context.getModuleName()); - this.memberVariables = null; - this.mergedNamespaces = []; - this.referencedEarly = false; - this.references = []; - this.context = context; - this.module = context.module; - this.syntheticNamedExports = syntheticNamedExports; - } - addReference(identifier) { - this.references.push(identifier); - this.name = identifier.name; } - // This is only called if "UNKNOWN_PATH" is reassigned as in all other situations, either the - // build fails due to an illegal namespace reassignment or MemberExpression already forwards - // the reassignment to the right variable. This means we lost track of this variable and thus - // need to reassign all exports. - deoptimizePath() { - const memberVariables = this.getMemberVariables(); - for (const key of Object.keys(memberVariables)) { - memberVariables[key].deoptimizePath(UNKNOWN_PATH); - } + else { + invalidAnnotation = true; } - getMemberVariables() { - if (this.memberVariables) { - return this.memberVariables; - } - const memberVariables = Object.create(null); - for (const name of this.context.getExports().concat(this.context.getReexports())) { - if (name[0] !== '*') { - memberVariables[name] = this.context.traceExport(name); - } - } - this.memberVariables = memberVariables; - return (this.memberVariables = memberVariables); + if (invalidAnnotation) { + annotateNode(node, comment, false); } - include() { - if (!this.included) { - this.included = true; - for (const identifier of this.references) { - if (identifier.context.getModuleExecIndex() <= this.context.getModuleExecIndex()) { - this.referencedEarly = true; - break; - } - } - this.mergedNamespaces = this.context.includeAndGetAdditionalMergedNamespaces(); - const memberVariables = this.getMemberVariables(); - // We directly include the variables instead of context.include to not automatically - // generate imports for members from other modules - for (const memberName of Object.keys(memberVariables)) - memberVariables[memberName].include(); + else { + for (const node of annotatedNodes) { + annotateNode(node, comment, true); } } - renderBlock(options) { - const _ = options.compact ? '' : ' '; - const n = options.compact ? '' : '\n'; - const t = options.indent; - const memberVariables = this.getMemberVariables(); - const members = Object.keys(memberVariables).map(name => { - const original = memberVariables[name]; - if (this.referencedEarly || original.isReassigned) { - return `${t}get ${name}${_}()${_}{${_}return ${original.getName()}${options.compact ? '' : ';'}${_}}`; - } - const safeName = RESERVED_NAMES[name] ? `'${name}'` : name; - return `${t}${safeName}: ${original.getName()}`; - }); - if (options.namespaceToStringTag) { - members.unshift(`${t}[Symbol.toStringTag]:${_}'Module'`); - } - const needsObjectAssign = this.mergedNamespaces.length > 0 || this.syntheticNamedExports; - if (!needsObjectAssign) - members.unshift(`${t}__proto__:${_}null`); - let output = `{${n}${members.join(`,${n}`)}${n}}`; - if (needsObjectAssign) { - const assignmentArgs = ['/*#__PURE__*/Object.create(null)']; - if (this.mergedNamespaces.length > 0) { - assignmentArgs.push(...this.mergedNamespaces.map(variable => variable.getName())); - } - if (this.syntheticNamedExports) { - assignmentArgs.push(this.module.getDefaultExport().getName()); +} +function doesNotMatchOutsideComment(code, forbiddenChars) { + let nextMatch; + while ((nextMatch = forbiddenChars.exec(code)) !== null) { + if (nextMatch[0] === '/') { + const charCodeAfterSlash = code.charCodeAt(forbiddenChars.lastIndex); + if (charCodeAfterSlash === 42 /*"*"*/) { + forbiddenChars.lastIndex = code.indexOf('*/', forbiddenChars.lastIndex + 1) + 2; + continue; } - if (members.length > 0) { - assignmentArgs.push(output); + else if (charCodeAfterSlash === 47 /*"/"*/) { + forbiddenChars.lastIndex = code.indexOf('\n', forbiddenChars.lastIndex + 1) + 1; + continue; } - output = `/*#__PURE__*/Object.assign(${assignmentArgs.join(`,${_}`)})`; - } - if (options.freeze) { - output = `/*#__PURE__*/Object.freeze(${output})`; - } - const name = this.getName(); - output = `${options.varOrConst} ${name}${_}=${_}${output};`; - if (options.format === 'system' && options.exportNamesByVariable.has(this)) { - output += `${n}${getSystemExportStatement([this], options)};`; - } - return output; - } - renderFirst() { - return this.referencedEarly; - } -} -NamespaceVariable.prototype.isNamespace = true; - -class SyntheticNamedExportVariable extends Variable { - constructor(context, name, defaultVariable) { - super(name); - this.context = context; - this.module = context.module; - this.defaultVariable = defaultVariable; + } + forbiddenChars.lastIndex = 0; + return false; } - getBaseVariable() { - let baseVariable = this.defaultVariable; - if (baseVariable instanceof ExportDefaultVariable) { - baseVariable = baseVariable.getOriginalVariable(); + return true; +} +const pureCommentRegex = /[@#]__PURE__/; +function addAnnotations(comments, esTreeAst, code) { + const annotations = []; + const sourceMappingComments = []; + for (const comment of comments) { + if (pureCommentRegex.test(comment.value)) { + annotations.push(comment); } - if (baseVariable instanceof SyntheticNamedExportVariable) { - baseVariable = baseVariable.getBaseVariable(); + else if (SOURCEMAPPING_URL_RE.test(comment.value)) { + sourceMappingComments.push(comment); } - return baseVariable; } - getName() { - const name = this.name; - const renderBaseName = this.defaultVariable.getName(); - return `${renderBaseName}${getPropertyAccess(name)}`; + for (const comment of sourceMappingComments) { + annotateNode(esTreeAst, comment, false); } - include() { - if (!this.included) { - this.included = true; - this.context.includeVariable(this.defaultVariable); - } + handlePureAnnotationsOfNode(esTreeAst, { + annotationIndex: 0, + annotations, + code + }); +} +function annotateNode(node, comment, valid) { + const key = valid ? ANNOTATION_KEY : INVALID_COMMENT_KEY; + const property = node[key]; + if (property) { + property.push(comment); + } + else { + node[key] = [comment]; } } -const getPropertyAccess = (name) => { - return /^(?!\d)[\w$]+$/.test(name) ? `.${name}` : `[${JSON.stringify(name)}]`; -}; -const esModuleExport = `Object.defineProperty(exports, '__esModule', { value: true });`; -const compactEsModuleExport = `Object.defineProperty(exports,'__esModule',{value:true});`; +const keys = { + Literal: [], + Program: ['body'] +}; +function getAndCreateKeys(esTreeNode) { + keys[esTreeNode.type] = Object.keys(esTreeNode).filter(key => typeof esTreeNode[key] === 'object' && key.charCodeAt(0) !== 95 /* _ */); + return keys[esTreeNode.type]; +} -function getExportBlock(exports, dependencies, namedExportsMode, interop, compact, t, mechanism = 'return ') { - const _ = compact ? '' : ' '; - const n = compact ? '' : '\n'; - if (!namedExportsMode) { - let local; - if (exports.length > 0) { - local = exports[0].local; +const INCLUDE_PARAMETERS = 'variables'; +class NodeBase extends ExpressionEntity { + constructor(esTreeNode, parent, parentScope) { + super(); + /** + * Nodes can apply custom deoptimizations once they become part of the + * executed code. To do this, they must initialize this as false, implement + * applyDeoptimizations and call this from include and hasEffects if they have + * custom handlers + */ + this.deoptimized = false; + this.esTreeNode = esTreeNode; + this.keys = keys[esTreeNode.type] || getAndCreateKeys(esTreeNode); + this.parent = parent; + this.context = parent.context; + this.createScope(parentScope); + this.parseNode(esTreeNode); + this.initialise(); + this.context.magicString.addSourcemapLocation(this.start); + this.context.magicString.addSourcemapLocation(this.end); + } + addExportedVariables(_variables, _exportNamesByVariable) { } + /** + * Override this to bind assignments to variables and do any initialisations that + * require the scopes to be populated with variables. + */ + bind() { + for (const key of this.keys) { + const value = this[key]; + if (value === null) + continue; + if (Array.isArray(value)) { + for (const child of value) { + child === null || child === void 0 ? void 0 : child.bind(); + } + } + else { + value.bind(); + } } - else { - for (const dep of dependencies) { - if (dep.reexports) { - const expt = dep.reexports[0]; - local = - dep.namedExportsMode && expt.imported !== '*' && expt.imported !== 'default' - ? `${dep.name}.${expt.imported}` - : dep.name; - break; + } + /** + * Override if this node should receive a different scope than the parent scope. + */ + createScope(parentScope) { + this.scope = parentScope; + } + hasEffects(context) { + if (!this.deoptimized) + this.applyDeoptimizations(); + for (const key of this.keys) { + const value = this[key]; + if (value === null) + continue; + if (Array.isArray(value)) { + for (const child of value) { + if (child === null || child === void 0 ? void 0 : child.hasEffects(context)) + return true; } } + else if (value.hasEffects(context)) + return true; } - return `${mechanism}${local};`; + return false; } - let exportBlock = ''; - // star exports must always output first for precedence - for (const { name, reexports } of dependencies) { - if (reexports && namedExportsMode) { - for (const specifier of reexports) { - if (specifier.reexported === '*') { - if (exportBlock) - exportBlock += n; - if (specifier.needsLiveBinding) { - exportBlock += - `Object.keys(${name}).forEach(function${_}(k)${_}{${n}` + - `${t}if${_}(k${_}!==${_}'default')${_}Object.defineProperty(exports,${_}k,${_}{${n}` + - `${t}${t}enumerable:${_}true,${n}` + - `${t}${t}get:${_}function${_}()${_}{${n}` + - `${t}${t}${t}return ${name}[k];${n}` + - `${t}${t}}${n}${t}});${n}});`; - } - else { - exportBlock += - `Object.keys(${name}).forEach(function${_}(k)${_}{${n}` + - `${t}if${_}(k${_}!==${_}'default')${_}exports[k]${_}=${_}${name}[k];${n}});`; - } + hasEffectsAsAssignmentTarget(context, _checkAccess) { + return (this.hasEffects(context) || + this.hasEffectsOnInteractionAtPath(EMPTY_PATH, this.assignmentInteraction, context)); + } + include(context, includeChildrenRecursively, _options) { + if (!this.deoptimized) + this.applyDeoptimizations(); + this.included = true; + for (const key of this.keys) { + const value = this[key]; + if (value === null) + continue; + if (Array.isArray(value)) { + for (const child of value) { + child === null || child === void 0 ? void 0 : child.include(context, includeChildrenRecursively); } } + else { + value.include(context, includeChildrenRecursively); + } } } - for (const { name, imports, reexports, isChunk, namedExportsMode: depNamedExportsMode, exportsNames } of dependencies) { - if (reexports && namedExportsMode) { - for (const specifier of reexports) { - if (specifier.imported === 'default' && !isChunk) { - if (exportBlock) - exportBlock += n; - if (exportsNames && - (reexports.some(specifier => specifier.imported === 'default' - ? specifier.reexported === 'default' - : specifier.imported !== '*') || - (imports && imports.some(specifier => specifier.imported !== 'default')))) { - exportBlock += `exports.${specifier.reexported}${_}=${_}${name}${interop !== false ? '__default' : '.default'};`; - } - else { - exportBlock += `exports.${specifier.reexported}${_}=${_}${name};`; - } + includeAsAssignmentTarget(context, includeChildrenRecursively, _deoptimizeAccess) { + this.include(context, includeChildrenRecursively); + } + /** + * Override to perform special initialisation steps after the scope is initialised + */ + initialise() { } + insertSemicolon(code) { + if (code.original[this.end - 1] !== ';') { + code.appendLeft(this.end, ';'); + } + } + parseNode(esTreeNode) { + for (const [key, value] of Object.entries(esTreeNode)) { + // That way, we can override this function to add custom initialisation and then call super.parseNode + if (this.hasOwnProperty(key)) + continue; + if (key.charCodeAt(0) === 95 /* _ */) { + if (key === ANNOTATION_KEY) { + this.annotations = value; } - else if (specifier.imported !== '*') { - if (exportBlock) - exportBlock += n; - const importName = specifier.imported === 'default' && !depNamedExportsMode - ? name - : `${name}.${specifier.imported}`; - exportBlock += specifier.needsLiveBinding - ? `Object.defineProperty(exports,${_}'${specifier.reexported}',${_}{${n}` + - `${t}enumerable:${_}true,${n}` + - `${t}get:${_}function${_}()${_}{${n}` + - `${t}${t}return ${importName};${n}${t}}${n}});` - : `exports.${specifier.reexported}${_}=${_}${importName};`; + else if (key === INVALID_COMMENT_KEY) { + for (const { start, end } of value) + this.context.magicString.remove(start, end); } - else if (specifier.reexported !== '*') { - if (exportBlock) - exportBlock += n; - exportBlock += `exports.${specifier.reexported}${_}=${_}${name};`; + } + else if (typeof value !== 'object' || value === null) { + this[key] = value; + } + else if (Array.isArray(value)) { + this[key] = []; + for (const child of value) { + this[key].push(child === null + ? null + : new (this.context.getNodeConstructor(child.type))(child, this, this.scope)); } } + else { + this[key] = new (this.context.getNodeConstructor(value.type))(value, this, this.scope); + } } } - for (const expt of exports) { - const lhs = `exports.${expt.exported}`; - const rhs = expt.local; - if (lhs !== rhs) { - if (exportBlock) - exportBlock += n; - exportBlock += `${lhs}${_}=${_}${rhs};`; + render(code, options) { + for (const key of this.keys) { + const value = this[key]; + if (value === null) + continue; + if (Array.isArray(value)) { + for (const child of value) { + child === null || child === void 0 ? void 0 : child.render(code, options); + } + } + else { + value.render(code, options); + } } } - return exportBlock; -} - -function getInteropBlock(dependencies, options, varOrConst) { - const _ = options.compact ? '' : ' '; - return dependencies - .map(({ name, exportsNames, exportsDefault, namedExportsMode }) => { - if (!(namedExportsMode && exportsDefault && options.interop)) - return null; - if (exportsNames) { - return (`${varOrConst} ${name}__default${_}=${_}'default'${_}in ${name}${_}?` + - `${_}${name}['default']${_}:${_}${name};`); + setAssignedValue(value) { + this.assignmentInteraction = { args: [value], thisArg: null, type: INTERACTION_ASSIGNED }; + } + shouldBeIncluded(context) { + return this.included || (!context.brokenFlow && this.hasEffects(createHasEffectsContext())); + } + /** + * Just deoptimize everything by default so that when e.g. we do not track + * something properly, it is deoptimized. + * @protected + */ + applyDeoptimizations() { + this.deoptimized = true; + for (const key of this.keys) { + const value = this[key]; + if (value === null) + continue; + if (Array.isArray(value)) { + for (const child of value) { + child === null || child === void 0 ? void 0 : child.deoptimizePath(UNKNOWN_PATH); + } + } + else { + value.deoptimizePath(UNKNOWN_PATH); + } } - return (`${name}${_}=${_}${name}${_}&&${_}Object.prototype.hasOwnProperty.call(${name},${_}'default')${_}?` + - `${_}${name}['default']${_}:${_}${name};`); - }) - .filter(Boolean) - .join(options.compact ? '' : '\n'); -} - -function copyPropertyLiveBinding(_, n, t, i) { - return (`${i}var d${_}=${_}Object.getOwnPropertyDescriptor(e,${_}k);${n}` + - `${i}Object.defineProperty(n,${_}k,${_}d.get${_}?${_}d${_}:${_}{${n}` + - `${i}${t}enumerable:${_}true,${n}` + - `${i}${t}get:${_}function${_}()${_}{${n}` + - `${i}${t}${t}return e[k];${n}` + - `${i}${t}}${n}` + - `${i}});${n}`); -} -function copyPropertyStatic(_, n, _t, i) { - return `${i}n[k]${_}=e${_}[k];${n}`; -} -function getInteropNamespace(_, n, t, liveBindings) { - return (`function ${INTEROP_NAMESPACE_VARIABLE}(e)${_}{${n}` + - `${t}if${_}(e${_}&&${_}e.__esModule)${_}{${_}return e;${_}}${_}else${_}{${n}` + - `${t}${t}var n${_}=${_}{};${n}` + - `${t}${t}if${_}(e)${_}{${n}` + - `${t}${t}${t}Object.keys(e).forEach(function${_}(k)${_}{${n}` + - (liveBindings ? copyPropertyLiveBinding : copyPropertyStatic)(_, n, t, t + t + t + t) + - `${t}${t}${t}});${n}` + - `${t}${t}}${n}` + - `${t}${t}n['default']${_}=${_}e;${n}` + - `${t}${t}return n;${n}` + - `${t}}${n}` + - `}${n}${n}`); -} - -const builtins$1 = { - assert: true, - buffer: true, - console: true, - constants: true, - domain: true, - events: true, - http: true, - https: true, - os: true, - path: true, - process: true, - punycode: true, - querystring: true, - stream: true, - string_decoder: true, - timers: true, - tty: true, - url: true, - util: true, - vm: true, - zlib: true -}; -function warnOnBuiltins(warn, dependencies) { - const externalBuiltins = dependencies.map(({ id }) => id).filter(id => id in builtins$1); - if (!externalBuiltins.length) - return; - const detail = externalBuiltins.length === 1 - ? `module ('${externalBuiltins[0]}')` - : `modules (${externalBuiltins - .slice(0, -1) - .map(name => `'${name}'`) - .join(', ')} and '${externalBuiltins.slice(-1)}')`; - warn({ - code: 'MISSING_NODE_BUILTINS', - message: `Creating a browser bundle that depends on Node.js built-in ${detail}. You might need to include https://github.com/ionic-team/rollup-plugin-node-polyfills`, - modules: externalBuiltins - }); + this.context.requestTreeshakingPass(); + } } -// AMD resolution will only respect the AMD baseUrl if the .js extension is omitted. -// The assumption is that this makes sense for all relative ids: -// https://requirejs.org/docs/api.html#jsfiles -function removeExtensionFromRelativeAmdId(id) { - if (id[0] === '.' && id.endsWith('.js')) { - return id.slice(0, -3); +class SpreadElement extends NodeBase { + deoptimizeThisOnInteractionAtPath(interaction, path, recursionTracker) { + if (path.length > 0) { + this.argument.deoptimizeThisOnInteractionAtPath(interaction, [UnknownKey, ...path], recursionTracker); + } } - return id; -} -function amd(magicString, { accessedGlobals, dependencies, exports, hasExports, indentString: t, intro, isEntryModuleFacade, namedExportsMode, outro, varOrConst, warn }, options) { - warnOnBuiltins(warn, dependencies); - const deps = dependencies.map(m => `'${removeExtensionFromRelativeAmdId(m.id)}'`); - const args = dependencies.map(m => m.name); - const n = options.compact ? '' : '\n'; - const _ = options.compact ? '' : ' '; - if (namedExportsMode && hasExports) { - args.unshift(`exports`); - deps.unshift(`'exports'`); + hasEffects(context) { + if (!this.deoptimized) + this.applyDeoptimizations(); + const { propertyReadSideEffects } = this.context.options + .treeshake; + return (this.argument.hasEffects(context) || + (propertyReadSideEffects && + (propertyReadSideEffects === 'always' || + this.argument.hasEffectsOnInteractionAtPath(UNKNOWN_PATH, NODE_INTERACTION_UNKNOWN_ACCESS, context)))); } - if (accessedGlobals.has('require')) { - args.unshift('require'); - deps.unshift(`'require'`); + applyDeoptimizations() { + this.deoptimized = true; + // Only properties of properties of the argument could become subject to reassignment + // This will also reassign the return values of iterators + this.argument.deoptimizePath([UnknownKey, UnknownKey]); + this.context.requestTreeshakingPass(); } - if (accessedGlobals.has('module')) { - args.unshift('module'); - deps.unshift(`'module'`); +} + +class Method extends ExpressionEntity { + constructor(description) { + super(); + this.description = description; } - const amdOptions = options.amd || {}; - const params = (amdOptions.id ? `'${amdOptions.id}',${_}` : ``) + - (deps.length ? `[${deps.join(`,${_}`)}],${_}` : ``); - const useStrict = options.strict ? `${_}'use strict';` : ``; - const wrapperStart = `${amdOptions.define}(${params}function${_}(${args.join(`,${_}`)})${_}{${useStrict}${n}${n}`; - // var foo__default = 'default' in foo ? foo['default'] : foo; - const interopBlock = getInteropBlock(dependencies, options, varOrConst); - if (interopBlock) { - magicString.prepend(interopBlock + n + n); + deoptimizeThisOnInteractionAtPath({ type, thisArg }, path) { + if (type === INTERACTION_CALLED && path.length === 0 && this.description.mutatesSelfAsArray) { + thisArg.deoptimizePath(UNKNOWN_INTEGER_PATH); + } } - if (accessedGlobals.has(INTEROP_NAMESPACE_VARIABLE)) { - magicString.prepend(getInteropNamespace(_, n, t, options.externalLiveBindings)); + getReturnExpressionWhenCalledAtPath(path, { thisArg }) { + if (path.length > 0) { + return UNKNOWN_EXPRESSION; + } + return (this.description.returnsPrimitive || + (this.description.returns === 'self' + ? thisArg || UNKNOWN_EXPRESSION + : this.description.returns())); } - if (intro) - magicString.prepend(intro); - const exportBlock = getExportBlock(exports, dependencies, namedExportsMode, options.interop, options.compact, t); - if (exportBlock) - magicString.append(n + n + exportBlock); - if (namedExportsMode && hasExports && isEntryModuleFacade && options.esModule) - magicString.append(`${n}${n}${options.compact ? compactEsModuleExport : esModuleExport}`); - if (outro) - magicString.append(outro); - return magicString - .indent(t) - .append(n + n + '});') - .prepend(wrapperStart); -} - -function cjs(magicString, { accessedGlobals, dependencies, exports, hasExports, indentString: t, intro, isEntryModuleFacade, namedExportsMode, outro, varOrConst }, options) { - const n = options.compact ? '' : '\n'; - const _ = options.compact ? '' : ' '; - intro = - (options.strict === false ? intro : `'use strict';${n}${n}${intro}`) + - (namedExportsMode && hasExports && isEntryModuleFacade && options.esModule - ? `${options.compact ? compactEsModuleExport : esModuleExport}${n}${n}` - : ''); - let needsInterop = false; - let importBlock; - let definingVariable = false; - importBlock = ''; - for (const { id, namedExportsMode, isChunk, name, reexports, imports, exportsNames, exportsDefault } of dependencies) { - if (!reexports && !imports) { - if (importBlock) { - importBlock += !options.compact || definingVariable ? `;${n}` : ','; + hasEffectsOnInteractionAtPath(path, interaction, context) { + var _a, _b; + const { type } = interaction; + if (path.length > (type === INTERACTION_ACCESSED ? 1 : 0)) { + return true; + } + if (type === INTERACTION_CALLED) { + if (this.description.mutatesSelfAsArray === true && + ((_a = interaction.thisArg) === null || _a === void 0 ? void 0 : _a.hasEffectsOnInteractionAtPath(UNKNOWN_INTEGER_PATH, NODE_INTERACTION_UNKNOWN_ASSIGNMENT, context))) { + return true; + } + if (this.description.callsArgs) { + for (const argIndex of this.description.callsArgs) { + if ((_b = interaction.args[argIndex]) === null || _b === void 0 ? void 0 : _b.hasEffectsOnInteractionAtPath(EMPTY_PATH, NODE_INTERACTION_UNKNOWN_CALL, context)) { + return true; + } + } } - definingVariable = false; - importBlock += `require('${id}')`; + } + return false; + } +} +const METHOD_RETURNS_BOOLEAN = [ + new Method({ + callsArgs: null, + mutatesSelfAsArray: false, + returns: null, + returnsPrimitive: UNKNOWN_LITERAL_BOOLEAN + }) +]; +const METHOD_RETURNS_STRING = [ + new Method({ + callsArgs: null, + mutatesSelfAsArray: false, + returns: null, + returnsPrimitive: UNKNOWN_LITERAL_STRING + }) +]; +const METHOD_RETURNS_NUMBER = [ + new Method({ + callsArgs: null, + mutatesSelfAsArray: false, + returns: null, + returnsPrimitive: UNKNOWN_LITERAL_NUMBER + }) +]; +const METHOD_RETURNS_UNKNOWN = [ + new Method({ + callsArgs: null, + mutatesSelfAsArray: false, + returns: null, + returnsPrimitive: UNKNOWN_EXPRESSION + }) +]; + +const INTEGER_REG_EXP = /^\d+$/; +class ObjectEntity extends ExpressionEntity { + // If a PropertyMap is used, this will be taken as propertiesAndGettersByKey + // and we assume there are no setters or getters + constructor(properties, prototypeExpression, immutable = false) { + super(); + this.prototypeExpression = prototypeExpression; + this.immutable = immutable; + this.allProperties = []; + this.deoptimizedPaths = Object.create(null); + this.expressionsToBeDeoptimizedByKey = Object.create(null); + this.gettersByKey = Object.create(null); + this.hasLostTrack = false; + this.hasUnknownDeoptimizedInteger = false; + this.hasUnknownDeoptimizedProperty = false; + this.propertiesAndGettersByKey = Object.create(null); + this.propertiesAndSettersByKey = Object.create(null); + this.settersByKey = Object.create(null); + this.thisParametersToBeDeoptimized = new Set(); + this.unknownIntegerProps = []; + this.unmatchableGetters = []; + this.unmatchablePropertiesAndGetters = []; + this.unmatchableSetters = []; + if (Array.isArray(properties)) { + this.buildPropertyMaps(properties); } else { - importBlock += - options.compact && definingVariable ? ',' : `${importBlock ? `;${n}` : ''}${varOrConst} `; - definingVariable = true; - if (!options.interop || isChunk || !exportsDefault || !namedExportsMode) { - importBlock += `${name}${_}=${_}require('${id}')`; + this.propertiesAndGettersByKey = this.propertiesAndSettersByKey = properties; + for (const propertiesForKey of Object.values(properties)) { + this.allProperties.push(...propertiesForKey); } - else { - needsInterop = true; - if (exportsNames) - importBlock += `${name}${_}=${_}require('${id}')${options.compact ? ',' : `;\n${varOrConst} `}${name}__default${_}=${_}${INTEROP_DEFAULT_VARIABLE}(${name})`; - else - importBlock += `${name}${_}=${_}${INTEROP_DEFAULT_VARIABLE}(require('${id}'))`; + } + } + deoptimizeAllProperties(noAccessors) { + var _a; + const isDeoptimized = this.hasLostTrack || this.hasUnknownDeoptimizedProperty; + if (noAccessors) { + this.hasUnknownDeoptimizedProperty = true; + } + else { + this.hasLostTrack = true; + } + if (isDeoptimized) { + return; + } + for (const properties of Object.values(this.propertiesAndGettersByKey).concat(Object.values(this.settersByKey))) { + for (const property of properties) { + property.deoptimizePath(UNKNOWN_PATH); } } + // While the prototype itself cannot be mutated, each property can + (_a = this.prototypeExpression) === null || _a === void 0 ? void 0 : _a.deoptimizePath([UnknownKey, UnknownKey]); + this.deoptimizeCachedEntities(); } - if (importBlock) - importBlock += ';'; - if (needsInterop) { - const ex = options.compact ? 'e' : 'ex'; - intro += - `function ${INTEROP_DEFAULT_VARIABLE}${_}(${ex})${_}{${_}return${_}` + - `(${ex}${_}&&${_}(typeof ${ex}${_}===${_}'object')${_}&&${_}'default'${_}in ${ex})${_}` + - `?${_}${ex}['default']${_}:${_}${ex}${options.compact ? '' : '; '}}${n}${n}`; + deoptimizeIntegerProperties() { + if (this.hasLostTrack || + this.hasUnknownDeoptimizedProperty || + this.hasUnknownDeoptimizedInteger) { + return; + } + this.hasUnknownDeoptimizedInteger = true; + for (const [key, propertiesAndGetters] of Object.entries(this.propertiesAndGettersByKey)) { + if (INTEGER_REG_EXP.test(key)) { + for (const property of propertiesAndGetters) { + property.deoptimizePath(UNKNOWN_PATH); + } + } + } + this.deoptimizeCachedIntegerEntities(); } - if (accessedGlobals.has(INTEROP_NAMESPACE_VARIABLE)) { - intro += getInteropNamespace(_, n, t, options.externalLiveBindings); + // Assumption: If only a specific path is deoptimized, no accessors are created + deoptimizePath(path) { + var _a; + if (this.hasLostTrack || this.immutable) { + return; + } + const key = path[0]; + if (path.length === 1) { + if (typeof key !== 'string') { + if (key === UnknownInteger) { + return this.deoptimizeIntegerProperties(); + } + return this.deoptimizeAllProperties(key === UnknownNonAccessorKey); + } + if (!this.deoptimizedPaths[key]) { + this.deoptimizedPaths[key] = true; + // we only deoptimizeCache exact matches as in all other cases, + // we do not return a literal value or return expression + const expressionsToBeDeoptimized = this.expressionsToBeDeoptimizedByKey[key]; + if (expressionsToBeDeoptimized) { + for (const expression of expressionsToBeDeoptimized) { + expression.deoptimizeCache(); + } + } + } + } + const subPath = path.length === 1 ? UNKNOWN_PATH : path.slice(1); + for (const property of typeof key === 'string' + ? (this.propertiesAndGettersByKey[key] || this.unmatchablePropertiesAndGetters).concat(this.settersByKey[key] || this.unmatchableSetters) + : this.allProperties) { + property.deoptimizePath(subPath); + } + (_a = this.prototypeExpression) === null || _a === void 0 ? void 0 : _a.deoptimizePath(path.length === 1 ? [...path, UnknownKey] : path); } - if (importBlock) - intro += importBlock + n + n; - const exportBlock = getExportBlock(exports, dependencies, namedExportsMode, options.interop, options.compact, t, `module.exports${_}=${_}`); - magicString.prepend(intro); - if (exportBlock) - magicString.append(n + n + exportBlock); - if (outro) - magicString.append(outro); - return magicString; -} - -function es(magicString, { intro, outro, dependencies, exports, varOrConst }, options) { - const _ = options.compact ? '' : ' '; - const n = options.compact ? '' : '\n'; - const importBlock = getImportBlock(dependencies, _); - if (importBlock.length > 0) - intro += importBlock.join(n) + n + n; - if (intro) - magicString.prepend(intro); - const exportBlock = getExportBlock$1(exports, _, varOrConst); - if (exportBlock.length) - magicString.append(n + n + exportBlock.join(n).trim()); - if (outro) - magicString.append(outro); - return magicString.trim(); -} -function getImportBlock(dependencies, _) { - const importBlock = []; - for (const { id, reexports, imports, name } of dependencies) { - if (!reexports && !imports) { - importBlock.push(`import${_}'${id}';`); - continue; + deoptimizeThisOnInteractionAtPath(interaction, path, recursionTracker) { + var _a; + const [key, ...subPath] = path; + if (this.hasLostTrack || + // single paths that are deoptimized will not become getters or setters + ((interaction.type === INTERACTION_CALLED || path.length > 1) && + (this.hasUnknownDeoptimizedProperty || + (typeof key === 'string' && this.deoptimizedPaths[key])))) { + interaction.thisArg.deoptimizePath(UNKNOWN_PATH); + return; } - if (imports) { - let defaultImport = null; - let starImport = null; - const importedNames = []; - for (const specifier of imports) { - if (specifier.imported === 'default') { - defaultImport = specifier; + const [propertiesForExactMatchByKey, relevantPropertiesByKey, relevantUnmatchableProperties] = interaction.type === INTERACTION_CALLED || path.length > 1 + ? [ + this.propertiesAndGettersByKey, + this.propertiesAndGettersByKey, + this.unmatchablePropertiesAndGetters + ] + : interaction.type === INTERACTION_ACCESSED + ? [this.propertiesAndGettersByKey, this.gettersByKey, this.unmatchableGetters] + : [this.propertiesAndSettersByKey, this.settersByKey, this.unmatchableSetters]; + if (typeof key === 'string') { + if (propertiesForExactMatchByKey[key]) { + const properties = relevantPropertiesByKey[key]; + if (properties) { + for (const property of properties) { + property.deoptimizeThisOnInteractionAtPath(interaction, subPath, recursionTracker); + } } - else if (specifier.imported === '*') { - starImport = specifier; + if (!this.immutable) { + this.thisParametersToBeDeoptimized.add(interaction.thisArg); } - else { - importedNames.push(specifier); + return; + } + for (const property of relevantUnmatchableProperties) { + property.deoptimizeThisOnInteractionAtPath(interaction, subPath, recursionTracker); + } + if (INTEGER_REG_EXP.test(key)) { + for (const property of this.unknownIntegerProps) { + property.deoptimizeThisOnInteractionAtPath(interaction, subPath, recursionTracker); } } - if (starImport) { - importBlock.push(`import${_}*${_}as ${starImport.local} from${_}'${id}';`); + } + else { + for (const properties of Object.values(relevantPropertiesByKey).concat([ + relevantUnmatchableProperties + ])) { + for (const property of properties) { + property.deoptimizeThisOnInteractionAtPath(interaction, subPath, recursionTracker); + } } - if (defaultImport && importedNames.length === 0) { - importBlock.push(`import ${defaultImport.local} from${_}'${id}';`); + for (const property of this.unknownIntegerProps) { + property.deoptimizeThisOnInteractionAtPath(interaction, subPath, recursionTracker); } - else if (importedNames.length > 0) { - importBlock.push(`import ${defaultImport ? `${defaultImport.local},${_}` : ''}{${_}${importedNames - .map(specifier => { - if (specifier.imported === specifier.local) { - return specifier.imported; - } - else { - return `${specifier.imported} as ${specifier.local}`; - } - }) - .join(`,${_}`)}${_}}${_}from${_}'${id}';`); + } + if (!this.immutable) { + this.thisParametersToBeDeoptimized.add(interaction.thisArg); + } + (_a = this.prototypeExpression) === null || _a === void 0 ? void 0 : _a.deoptimizeThisOnInteractionAtPath(interaction, path, recursionTracker); + } + getLiteralValueAtPath(path, recursionTracker, origin) { + if (path.length === 0) { + return UnknownTruthyValue; + } + const key = path[0]; + const expressionAtPath = this.getMemberExpressionAndTrackDeopt(key, origin); + if (expressionAtPath) { + return expressionAtPath.getLiteralValueAtPath(path.slice(1), recursionTracker, origin); + } + if (this.prototypeExpression) { + return this.prototypeExpression.getLiteralValueAtPath(path, recursionTracker, origin); + } + if (path.length === 1) { + return undefined; + } + return UnknownValue; + } + getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin) { + if (path.length === 0) { + return UNKNOWN_EXPRESSION; + } + const [key, ...subPath] = path; + const expressionAtPath = this.getMemberExpressionAndTrackDeopt(key, origin); + if (expressionAtPath) { + return expressionAtPath.getReturnExpressionWhenCalledAtPath(subPath, interaction, recursionTracker, origin); + } + if (this.prototypeExpression) { + return this.prototypeExpression.getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin); + } + return UNKNOWN_EXPRESSION; + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + const [key, ...subPath] = path; + if (subPath.length || interaction.type === INTERACTION_CALLED) { + const expressionAtPath = this.getMemberExpression(key); + if (expressionAtPath) { + return expressionAtPath.hasEffectsOnInteractionAtPath(subPath, interaction, context); } + if (this.prototypeExpression) { + return this.prototypeExpression.hasEffectsOnInteractionAtPath(path, interaction, context); + } + return true; } - if (reexports) { - let starExport = null; - const namespaceReexports = []; - const namedReexports = []; - for (const specifier of reexports) { - if (specifier.reexported === '*') { - starExport = specifier; + if (key === UnknownNonAccessorKey) + return false; + if (this.hasLostTrack) + return true; + const [propertiesAndAccessorsByKey, accessorsByKey, unmatchableAccessors] = interaction.type === INTERACTION_ACCESSED + ? [this.propertiesAndGettersByKey, this.gettersByKey, this.unmatchableGetters] + : [this.propertiesAndSettersByKey, this.settersByKey, this.unmatchableSetters]; + if (typeof key === 'string') { + if (propertiesAndAccessorsByKey[key]) { + const accessors = accessorsByKey[key]; + if (accessors) { + for (const accessor of accessors) { + if (accessor.hasEffectsOnInteractionAtPath(subPath, interaction, context)) + return true; + } } - else if (specifier.imported === '*') { - namespaceReexports.push(specifier); + return false; + } + for (const accessor of unmatchableAccessors) { + if (accessor.hasEffectsOnInteractionAtPath(subPath, interaction, context)) { + return true; } - else { - namedReexports.push(specifier); + } + } + else { + for (const accessors of Object.values(accessorsByKey).concat([unmatchableAccessors])) { + for (const accessor of accessors) { + if (accessor.hasEffectsOnInteractionAtPath(subPath, interaction, context)) + return true; } } - if (starExport) { - importBlock.push(`export${_}*${_}from${_}'${id}';`); + } + if (this.prototypeExpression) { + return this.prototypeExpression.hasEffectsOnInteractionAtPath(path, interaction, context); + } + return false; + } + buildPropertyMaps(properties) { + const { allProperties, propertiesAndGettersByKey, propertiesAndSettersByKey, settersByKey, gettersByKey, unknownIntegerProps, unmatchablePropertiesAndGetters, unmatchableGetters, unmatchableSetters } = this; + const unmatchablePropertiesAndSetters = []; + for (let index = properties.length - 1; index >= 0; index--) { + const { key, kind, property } = properties[index]; + allProperties.push(property); + if (typeof key !== 'string') { + if (key === UnknownInteger) { + unknownIntegerProps.push(property); + continue; + } + if (kind === 'set') + unmatchableSetters.push(property); + if (kind === 'get') + unmatchableGetters.push(property); + if (kind !== 'get') + unmatchablePropertiesAndSetters.push(property); + if (kind !== 'set') + unmatchablePropertiesAndGetters.push(property); } - if (namespaceReexports.length > 0) { - if (!imports || - !imports.some(specifier => specifier.imported === '*' && specifier.local === name)) { - importBlock.push(`import${_}*${_}as ${name} from${_}'${id}';`); + else { + if (kind === 'set') { + if (!propertiesAndSettersByKey[key]) { + propertiesAndSettersByKey[key] = [property, ...unmatchablePropertiesAndSetters]; + settersByKey[key] = [property, ...unmatchableSetters]; + } } - for (const specifier of namespaceReexports) { - importBlock.push(`export${_}{${_}${name === specifier.reexported ? name : `${name} as ${specifier.reexported}`} };`); + else if (kind === 'get') { + if (!propertiesAndGettersByKey[key]) { + propertiesAndGettersByKey[key] = [property, ...unmatchablePropertiesAndGetters]; + gettersByKey[key] = [property, ...unmatchableGetters]; + } } - } - if (namedReexports.length > 0) { - importBlock.push(`export${_}{${_}${namedReexports - .map(specifier => { - if (specifier.imported === specifier.reexported) { - return specifier.imported; + else { + if (!propertiesAndSettersByKey[key]) { + propertiesAndSettersByKey[key] = [property, ...unmatchablePropertiesAndSetters]; } - else { - return `${specifier.imported} as ${specifier.reexported}`; + if (!propertiesAndGettersByKey[key]) { + propertiesAndGettersByKey[key] = [property, ...unmatchablePropertiesAndGetters]; } - }) - .join(`,${_}`)}${_}}${_}from${_}'${id}';`); + } } } } - return importBlock; -} -function getExportBlock$1(exports, _, varOrConst) { - const exportBlock = []; - const exportDeclaration = []; - for (const specifier of exports) { - if (specifier.exported === 'default') { - exportBlock.push(`export default ${specifier.local};`); - } - else { - if (specifier.expression) { - exportBlock.push(`${varOrConst} ${specifier.local}${_}=${_}${specifier.expression};`); + deoptimizeCachedEntities() { + for (const expressionsToBeDeoptimized of Object.values(this.expressionsToBeDeoptimizedByKey)) { + for (const expression of expressionsToBeDeoptimized) { + expression.deoptimizeCache(); } - exportDeclaration.push(specifier.exported === specifier.local - ? specifier.local - : `${specifier.local} as ${specifier.exported}`); + } + for (const expression of this.thisParametersToBeDeoptimized) { + expression.deoptimizePath(UNKNOWN_PATH); } } - if (exportDeclaration.length) { - exportBlock.push(`export${_}{${_}${exportDeclaration.join(`,${_}`)}${_}};`); - } - return exportBlock; -} - -function spaces(i) { - let result = ''; - while (i--) - result += ' '; - return result; -} -function tabsToSpaces(str) { - return str.replace(/^\t+/, match => match.split('\t').join(' ')); -} -function getCodeFrame(source, line, column) { - let lines = source.split('\n'); - const frameStart = Math.max(0, line - 3); - let frameEnd = Math.min(line + 2, lines.length); - lines = lines.slice(frameStart, frameEnd); - while (!/\S/.test(lines[lines.length - 1])) { - lines.pop(); - frameEnd -= 1; + deoptimizeCachedIntegerEntities() { + for (const [key, expressionsToBeDeoptimized] of Object.entries(this.expressionsToBeDeoptimizedByKey)) { + if (INTEGER_REG_EXP.test(key)) { + for (const expression of expressionsToBeDeoptimized) { + expression.deoptimizeCache(); + } + } + } + for (const expression of this.thisParametersToBeDeoptimized) { + expression.deoptimizePath(UNKNOWN_INTEGER_PATH); + } } - const digits = String(frameEnd).length; - return lines - .map((str, i) => { - const isErrorLine = frameStart + i + 1 === line; - let lineNum = String(i + frameStart + 1); - while (lineNum.length < digits) - lineNum = ` ${lineNum}`; - if (isErrorLine) { - const indicator = spaces(digits + 2 + tabsToSpaces(str.slice(0, column)).length) + '^'; - return `${lineNum}: ${tabsToSpaces(str)}\n${indicator}`; + getMemberExpression(key) { + if (this.hasLostTrack || + this.hasUnknownDeoptimizedProperty || + typeof key !== 'string' || + (this.hasUnknownDeoptimizedInteger && INTEGER_REG_EXP.test(key)) || + this.deoptimizedPaths[key]) { + return UNKNOWN_EXPRESSION; + } + const properties = this.propertiesAndGettersByKey[key]; + if ((properties === null || properties === void 0 ? void 0 : properties.length) === 1) { + return properties[0]; + } + if (properties || + this.unmatchablePropertiesAndGetters.length > 0 || + (this.unknownIntegerProps.length && INTEGER_REG_EXP.test(key))) { + return UNKNOWN_EXPRESSION; } - return `${lineNum}: ${tabsToSpaces(str)}`; - }) - .join('\n'); -} - -function sanitizeFileName(name) { - return name.replace(/[\0?*]/g, '_'); + return null; + } + getMemberExpressionAndTrackDeopt(key, origin) { + if (typeof key !== 'string') { + return UNKNOWN_EXPRESSION; + } + const expression = this.getMemberExpression(key); + if (!(expression === UNKNOWN_EXPRESSION || this.immutable)) { + const expressionsToBeDeoptimized = (this.expressionsToBeDeoptimizedByKey[key] = + this.expressionsToBeDeoptimizedByKey[key] || []); + expressionsToBeDeoptimized.push(origin); + } + return expression; + } } -function getAliasName(id) { - const base = basename(id); - return base.substr(0, base.length - extname(id).length); -} -function relativeId(id) { - if (typeof process === 'undefined' || !isAbsolute(id)) - return id; - return relative$1(process.cwd(), id); -} -function isPlainPathFragment(name) { - // not starting with "/", "./", "../" - return (name[0] !== '/' && - !(name[0] === '.' && (name[1] === '/' || name[1] === '.')) && - sanitizeFileName(name) === name && - !isAbsolute(name)); -} +const isInteger = (prop) => typeof prop === 'string' && /^\d+$/.test(prop); +// This makes sure unknown properties are not handled as "undefined" but as +// "unknown" but without access side effects. An exception is done for numeric +// properties as we do not expect new builtin properties to be numbers, this +// will improve tree-shaking for out-of-bounds array properties +const OBJECT_PROTOTYPE_FALLBACK = new (class ObjectPrototypeFallbackExpression extends ExpressionEntity { + deoptimizeThisOnInteractionAtPath({ type, thisArg }, path) { + if (type === INTERACTION_CALLED && path.length === 1 && !isInteger(path[0])) { + thisArg.deoptimizePath(UNKNOWN_PATH); + } + } + getLiteralValueAtPath(path) { + // We ignore number properties as we do not expect new properties to be + // numbers and also want to keep handling out-of-bound array elements as + // "undefined" + return path.length === 1 && isInteger(path[0]) ? undefined : UnknownValue; + } + hasEffectsOnInteractionAtPath(path, { type }) { + return path.length > 1 || type === INTERACTION_CALLED; + } +})(); +const OBJECT_PROTOTYPE = new ObjectEntity({ + __proto__: null, + hasOwnProperty: METHOD_RETURNS_BOOLEAN, + isPrototypeOf: METHOD_RETURNS_BOOLEAN, + propertyIsEnumerable: METHOD_RETURNS_BOOLEAN, + toLocaleString: METHOD_RETURNS_STRING, + toString: METHOD_RETURNS_STRING, + valueOf: METHOD_RETURNS_UNKNOWN +}, OBJECT_PROTOTYPE_FALLBACK, true); + +const NEW_ARRAY_PROPERTIES = [ + { key: UnknownInteger, kind: 'init', property: UNKNOWN_EXPRESSION }, + { key: 'length', kind: 'init', property: UNKNOWN_LITERAL_NUMBER } +]; +const METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_BOOLEAN = [ + new Method({ + callsArgs: [0], + mutatesSelfAsArray: 'deopt-only', + returns: null, + returnsPrimitive: UNKNOWN_LITERAL_BOOLEAN + }) +]; +const METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_NUMBER = [ + new Method({ + callsArgs: [0], + mutatesSelfAsArray: 'deopt-only', + returns: null, + returnsPrimitive: UNKNOWN_LITERAL_NUMBER + }) +]; +const METHOD_MUTATES_SELF_RETURNS_NEW_ARRAY = [ + new Method({ + callsArgs: null, + mutatesSelfAsArray: true, + returns: () => new ObjectEntity(NEW_ARRAY_PROPERTIES, ARRAY_PROTOTYPE), + returnsPrimitive: null + }) +]; +const METHOD_DEOPTS_SELF_RETURNS_NEW_ARRAY = [ + new Method({ + callsArgs: null, + mutatesSelfAsArray: 'deopt-only', + returns: () => new ObjectEntity(NEW_ARRAY_PROPERTIES, ARRAY_PROTOTYPE), + returnsPrimitive: null + }) +]; +const METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_NEW_ARRAY = [ + new Method({ + callsArgs: [0], + mutatesSelfAsArray: 'deopt-only', + returns: () => new ObjectEntity(NEW_ARRAY_PROPERTIES, ARRAY_PROTOTYPE), + returnsPrimitive: null + }) +]; +const METHOD_MUTATES_SELF_RETURNS_NUMBER = [ + new Method({ + callsArgs: null, + mutatesSelfAsArray: true, + returns: null, + returnsPrimitive: UNKNOWN_LITERAL_NUMBER + }) +]; +const METHOD_MUTATES_SELF_RETURNS_UNKNOWN = [ + new Method({ + callsArgs: null, + mutatesSelfAsArray: true, + returns: null, + returnsPrimitive: UNKNOWN_EXPRESSION + }) +]; +const METHOD_DEOPTS_SELF_RETURNS_UNKNOWN = [ + new Method({ + callsArgs: null, + mutatesSelfAsArray: 'deopt-only', + returns: null, + returnsPrimitive: UNKNOWN_EXPRESSION + }) +]; +const METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_UNKNOWN = [ + new Method({ + callsArgs: [0], + mutatesSelfAsArray: 'deopt-only', + returns: null, + returnsPrimitive: UNKNOWN_EXPRESSION + }) +]; +const METHOD_MUTATES_SELF_RETURNS_SELF = [ + new Method({ + callsArgs: null, + mutatesSelfAsArray: true, + returns: 'self', + returnsPrimitive: null + }) +]; +const METHOD_CALLS_ARG_MUTATES_SELF_RETURNS_SELF = [ + new Method({ + callsArgs: [0], + mutatesSelfAsArray: true, + returns: 'self', + returnsPrimitive: null + }) +]; +const ARRAY_PROTOTYPE = new ObjectEntity({ + __proto__: null, + // We assume that accessors have effects as we do not track the accessed value afterwards + at: METHOD_DEOPTS_SELF_RETURNS_UNKNOWN, + concat: METHOD_DEOPTS_SELF_RETURNS_NEW_ARRAY, + copyWithin: METHOD_MUTATES_SELF_RETURNS_SELF, + entries: METHOD_DEOPTS_SELF_RETURNS_NEW_ARRAY, + every: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_BOOLEAN, + fill: METHOD_MUTATES_SELF_RETURNS_SELF, + filter: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_NEW_ARRAY, + find: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_UNKNOWN, + findIndex: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_NUMBER, + findLast: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_UNKNOWN, + findLastIndex: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_NUMBER, + flat: METHOD_DEOPTS_SELF_RETURNS_NEW_ARRAY, + flatMap: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_NEW_ARRAY, + forEach: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_UNKNOWN, + group: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_UNKNOWN, + groupToMap: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_UNKNOWN, + includes: METHOD_RETURNS_BOOLEAN, + indexOf: METHOD_RETURNS_NUMBER, + join: METHOD_RETURNS_STRING, + keys: METHOD_RETURNS_UNKNOWN, + lastIndexOf: METHOD_RETURNS_NUMBER, + map: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_NEW_ARRAY, + pop: METHOD_MUTATES_SELF_RETURNS_UNKNOWN, + push: METHOD_MUTATES_SELF_RETURNS_NUMBER, + reduce: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_UNKNOWN, + reduceRight: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_UNKNOWN, + reverse: METHOD_MUTATES_SELF_RETURNS_SELF, + shift: METHOD_MUTATES_SELF_RETURNS_UNKNOWN, + slice: METHOD_DEOPTS_SELF_RETURNS_NEW_ARRAY, + some: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_BOOLEAN, + sort: METHOD_CALLS_ARG_MUTATES_SELF_RETURNS_SELF, + splice: METHOD_MUTATES_SELF_RETURNS_NEW_ARRAY, + toLocaleString: METHOD_RETURNS_STRING, + toString: METHOD_RETURNS_STRING, + unshift: METHOD_MUTATES_SELF_RETURNS_NUMBER, + values: METHOD_DEOPTS_SELF_RETURNS_UNKNOWN +}, OBJECT_PROTOTYPE, true); -function error(base) { - if (!(base instanceof Error)) - base = Object.assign(new Error(base.message), base); - throw base; -} -function augmentCodeLocation(props, pos, source, id) { - if (typeof pos === 'object') { - const { line, column } = pos; - props.loc = { file: id, line, column }; +class ArrayExpression extends NodeBase { + constructor() { + super(...arguments); + this.objectEntity = null; } - else { - props.pos = pos; - const { line, column } = locate(source, pos, { offsetLine: 1 }); - props.loc = { file: id, line, column }; + deoptimizePath(path) { + this.getObjectEntity().deoptimizePath(path); } - if (props.frame === undefined) { - const { line, column } = props.loc; - props.frame = getCodeFrame(source, line, column); + deoptimizeThisOnInteractionAtPath(interaction, path, recursionTracker) { + this.getObjectEntity().deoptimizeThisOnInteractionAtPath(interaction, path, recursionTracker); + } + getLiteralValueAtPath(path, recursionTracker, origin) { + return this.getObjectEntity().getLiteralValueAtPath(path, recursionTracker, origin); + } + getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin) { + return this.getObjectEntity().getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin); + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + return this.getObjectEntity().hasEffectsOnInteractionAtPath(path, interaction, context); + } + applyDeoptimizations() { + this.deoptimized = true; + let hasSpread = false; + for (let index = 0; index < this.elements.length; index++) { + const element = this.elements[index]; + if (element) { + if (hasSpread || element instanceof SpreadElement) { + hasSpread = true; + element.deoptimizePath(UNKNOWN_PATH); + } + } + } + this.context.requestTreeshakingPass(); + } + getObjectEntity() { + if (this.objectEntity !== null) { + return this.objectEntity; + } + const properties = [ + { key: 'length', kind: 'init', property: UNKNOWN_LITERAL_NUMBER } + ]; + let hasSpread = false; + for (let index = 0; index < this.elements.length; index++) { + const element = this.elements[index]; + if (hasSpread || element instanceof SpreadElement) { + if (element) { + hasSpread = true; + properties.unshift({ key: UnknownInteger, kind: 'init', property: element }); + } + } + else if (!element) { + properties.push({ key: String(index), kind: 'init', property: UNDEFINED_EXPRESSION }); + } + else { + properties.push({ key: String(index), kind: 'init', property: element }); + } + } + return (this.objectEntity = new ObjectEntity(properties, ARRAY_PROTOTYPE)); } } -var Errors; -(function (Errors) { - Errors["ASSET_NOT_FINALISED"] = "ASSET_NOT_FINALISED"; - Errors["ASSET_NOT_FOUND"] = "ASSET_NOT_FOUND"; - Errors["ASSET_SOURCE_ALREADY_SET"] = "ASSET_SOURCE_ALREADY_SET"; - Errors["ASSET_SOURCE_MISSING"] = "ASSET_SOURCE_MISSING"; - Errors["BAD_LOADER"] = "BAD_LOADER"; - Errors["CANNOT_EMIT_FROM_OPTIONS_HOOK"] = "CANNOT_EMIT_FROM_OPTIONS_HOOK"; - Errors["CHUNK_NOT_GENERATED"] = "CHUNK_NOT_GENERATED"; - Errors["DEPRECATED_FEATURE"] = "DEPRECATED_FEATURE"; - Errors["FILE_NOT_FOUND"] = "FILE_NOT_FOUND"; - Errors["FILE_NAME_CONFLICT"] = "FILE_NAME_CONFLICT"; - Errors["INPUT_HOOK_IN_OUTPUT_PLUGIN"] = "INPUT_HOOK_IN_OUTPUT_PLUGIN"; - Errors["INVALID_CHUNK"] = "INVALID_CHUNK"; - Errors["INVALID_EXPORT_OPTION"] = "INVALID_EXPORT_OPTION"; - Errors["INVALID_EXTERNAL_ID"] = "INVALID_EXTERNAL_ID"; - Errors["INVALID_OPTION"] = "INVALID_OPTION"; - Errors["INVALID_PLUGIN_HOOK"] = "INVALID_PLUGIN_HOOK"; - Errors["INVALID_ROLLUP_PHASE"] = "INVALID_ROLLUP_PHASE"; - Errors["MISSING_IMPLICIT_DEPENDANT"] = "MISSING_IMPLICIT_DEPENDANT"; - Errors["MIXED_EXPORTS"] = "MIXED_EXPORTS"; - Errors["NAMESPACE_CONFLICT"] = "NAMESPACE_CONFLICT"; - Errors["PLUGIN_ERROR"] = "PLUGIN_ERROR"; - Errors["UNRESOLVED_ENTRY"] = "UNRESOLVED_ENTRY"; - Errors["UNRESOLVED_IMPORT"] = "UNRESOLVED_IMPORT"; - Errors["VALIDATION_ERROR"] = "VALIDATION_ERROR"; - Errors["EXTERNAL_SYNTHETIC_EXPORTS"] = "EXTERNAL_SYNTHETIC_EXPORTS"; - Errors["SYNTHETIC_NAMED_EXPORTS_NEED_DEFAULT"] = "SYNTHETIC_NAMED_EXPORTS_NEED_DEFAULT"; -})(Errors || (Errors = {})); -function errAssetNotFinalisedForFileName(name) { - return { - code: Errors.ASSET_NOT_FINALISED, - message: `Plugin error - Unable to get file name for asset "${name}". Ensure that the source is set and that generate is called first.` - }; -} -function errCannotEmitFromOptionsHook() { - return { - code: Errors.CANNOT_EMIT_FROM_OPTIONS_HOOK, - message: `Cannot emit files or set asset sources in the "outputOptions" hook, use the "renderStart" hook instead.` - }; -} -function errChunkNotGeneratedForFileName(name) { - return { - code: Errors.CHUNK_NOT_GENERATED, - message: `Plugin error - Unable to get file name for chunk "${name}". Ensure that generate is called first.` - }; -} -function errAssetReferenceIdNotFoundForSetSource(assetReferenceId) { - return { - code: Errors.ASSET_NOT_FOUND, - message: `Plugin error - Unable to set the source for unknown asset "${assetReferenceId}".` - }; -} -function errAssetSourceAlreadySet(name) { - return { - code: Errors.ASSET_SOURCE_ALREADY_SET, - message: `Unable to set the source for asset "${name}", source already set.` - }; -} -function errNoAssetSourceSet(assetName) { - return { - code: Errors.ASSET_SOURCE_MISSING, - message: `Plugin error creating asset "${assetName}" - no asset source set.` - }; -} -function errBadLoader(id) { - return { - code: Errors.BAD_LOADER, - message: `Error loading ${relativeId(id)}: plugin load hook should return a string, a { code, map } object, or nothing/null` - }; -} -function errDeprecation(deprecation) { - return { - code: Errors.DEPRECATED_FEATURE, - ...(typeof deprecation === 'string' ? { message: deprecation } : deprecation) - }; -} -function errFileReferenceIdNotFoundForFilename(assetReferenceId) { - return { - code: Errors.FILE_NOT_FOUND, - message: `Plugin error - Unable to get file name for unknown file "${assetReferenceId}".` - }; -} -function errFileNameConflict(fileName) { - return { - code: Errors.FILE_NAME_CONFLICT, - message: `The emitted file "${fileName}" overwrites a previously emitted file of the same name.` - }; -} -function errInputHookInOutputPlugin(pluginName, hookName) { - return { - code: Errors.INPUT_HOOK_IN_OUTPUT_PLUGIN, - message: `The "${hookName}" hook used by the output plugin ${pluginName} is a build time hook and will not be run for that plugin. Either this plugin cannot be used as an output plugin, or it should have an option to configure it as an output plugin.` - }; -} -function errCannotAssignModuleToChunk(moduleId, assignToAlias, currentAlias) { - return { - code: Errors.INVALID_CHUNK, - message: `Cannot assign ${relativeId(moduleId)} to the "${assignToAlias}" chunk as it is already in the "${currentAlias}" chunk.` - }; -} -function errInvalidExportOptionValue(optionValue) { - return { - code: Errors.INVALID_EXPORT_OPTION, - message: `"output.exports" must be "default", "named", "none", "auto", or left unspecified (defaults to "auto"), received "${optionValue}"`, - url: `https://rollupjs.org/guide/en/#output-exports` - }; -} -function errIncompatibleExportOptionValue(optionValue, keys, entryModule) { - return { - code: 'INVALID_EXPORT_OPTION', - message: `"${optionValue}" was specified for "output.exports", but entry module "${relativeId(entryModule)}" has the following exports: ${keys.join(', ')}` - }; -} -function errInternalIdCannotBeExternal(source, importer) { - return { - code: Errors.INVALID_EXTERNAL_ID, - message: `'${source}' is imported as an external by ${relativeId(importer)}, but is already an existing non-external module id.` - }; -} -function errInvalidOption(option, explanation) { - return { - code: Errors.INVALID_OPTION, - message: `Invalid value for option "${option}" - ${explanation}.` - }; -} -function errInvalidRollupPhaseForAddWatchFile() { - return { - code: Errors.INVALID_ROLLUP_PHASE, - message: `Cannot call addWatchFile after the build has finished.` - }; -} -function errInvalidRollupPhaseForChunkEmission() { - return { - code: Errors.INVALID_ROLLUP_PHASE, - message: `Cannot emit chunks after module loading has finished.` - }; -} -function errImplicitDependantCannotBeExternal(unresolvedId, implicitlyLoadedBefore) { - return { - code: Errors.MISSING_IMPLICIT_DEPENDANT, - message: `Module "${relativeId(unresolvedId)}" that should be implicitly loaded before "${relativeId(implicitlyLoadedBefore)}" cannot be external.` - }; -} -function errUnresolvedImplicitDependant(unresolvedId, implicitlyLoadedBefore) { - return { - code: Errors.MISSING_IMPLICIT_DEPENDANT, - message: `Module "${relativeId(unresolvedId)}" that should be implicitly loaded before "${relativeId(implicitlyLoadedBefore)}" could not be resolved.` - }; -} -function errImplicitDependantIsNotIncluded(module) { - const implicitDependencies = Array.from(module.implicitlyLoadedBefore, dependency => relativeId(dependency.id)).sort(); - return { - code: Errors.MISSING_IMPLICIT_DEPENDANT, - message: `Module "${relativeId(module.id)}" that should be implicitly loaded before "${implicitDependencies.length === 1 - ? implicitDependencies[0] - : `${implicitDependencies.slice(0, -1).join('", "')}" and "${implicitDependencies.slice(-1)[0]}`}" is not included in the module graph. Either it was not imported by an included module or only via a tree-shaken dynamic import, or no imported bindings were used and it had otherwise no side-effects.` - }; + +class ArrayPattern extends NodeBase { + addExportedVariables(variables, exportNamesByVariable) { + for (const element of this.elements) { + element === null || element === void 0 ? void 0 : element.addExportedVariables(variables, exportNamesByVariable); + } + } + declare(kind) { + const variables = []; + for (const element of this.elements) { + if (element !== null) { + variables.push(...element.declare(kind, UNKNOWN_EXPRESSION)); + } + } + return variables; + } + // Patterns can only be deoptimized at the empty path at the moment + deoptimizePath() { + for (const element of this.elements) { + element === null || element === void 0 ? void 0 : element.deoptimizePath(EMPTY_PATH); + } + } + // Patterns are only checked at the emtpy path at the moment + hasEffectsOnInteractionAtPath(_path, interaction, context) { + for (const element of this.elements) { + if (element === null || element === void 0 ? void 0 : element.hasEffectsOnInteractionAtPath(EMPTY_PATH, interaction, context)) + return true; + } + return false; + } + markDeclarationReached() { + for (const element of this.elements) { + element === null || element === void 0 ? void 0 : element.markDeclarationReached(); + } + } } -function errMixedExport(facadeModuleId, name) { - return { - code: Errors.MIXED_EXPORTS, - id: facadeModuleId, - message: `Entry module "${relativeId(facadeModuleId)}" is using named and default exports together. Consumers of your bundle will have to use \`${name || 'chunk'}["default"]\` to access the default export, which may not be what you want. Use \`output.exports: "named"\` to disable this warning`, - url: `https://rollupjs.org/guide/en/#output-exports` - }; + +class LocalVariable extends Variable { + constructor(name, declarator, init, context) { + super(name); + this.calledFromTryStatement = false; + this.additionalInitializers = null; + this.expressionsToBeDeoptimized = []; + this.declarations = declarator ? [declarator] : []; + this.init = init; + this.deoptimizationTracker = context.deoptimizationTracker; + this.module = context.module; + } + addDeclaration(identifier, init) { + this.declarations.push(identifier); + const additionalInitializers = this.markInitializersForDeoptimization(); + if (init !== null) { + additionalInitializers.push(init); + } + } + consolidateInitializers() { + if (this.additionalInitializers !== null) { + for (const initializer of this.additionalInitializers) { + initializer.deoptimizePath(UNKNOWN_PATH); + } + this.additionalInitializers = null; + } + } + deoptimizePath(path) { + var _a, _b; + if (this.isReassigned || + this.deoptimizationTracker.trackEntityAtPathAndGetIfTracked(path, this)) { + return; + } + if (path.length === 0) { + if (!this.isReassigned) { + this.isReassigned = true; + const expressionsToBeDeoptimized = this.expressionsToBeDeoptimized; + this.expressionsToBeDeoptimized = []; + for (const expression of expressionsToBeDeoptimized) { + expression.deoptimizeCache(); + } + (_a = this.init) === null || _a === void 0 ? void 0 : _a.deoptimizePath(UNKNOWN_PATH); + } + } + else { + (_b = this.init) === null || _b === void 0 ? void 0 : _b.deoptimizePath(path); + } + } + deoptimizeThisOnInteractionAtPath(interaction, path, recursionTracker) { + if (this.isReassigned || !this.init) { + return interaction.thisArg.deoptimizePath(UNKNOWN_PATH); + } + recursionTracker.withTrackedEntityAtPath(path, this.init, () => this.init.deoptimizeThisOnInteractionAtPath(interaction, path, recursionTracker), undefined); + } + getLiteralValueAtPath(path, recursionTracker, origin) { + if (this.isReassigned || !this.init) { + return UnknownValue; + } + return recursionTracker.withTrackedEntityAtPath(path, this.init, () => { + this.expressionsToBeDeoptimized.push(origin); + return this.init.getLiteralValueAtPath(path, recursionTracker, origin); + }, UnknownValue); + } + getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin) { + if (this.isReassigned || !this.init) { + return UNKNOWN_EXPRESSION; + } + return recursionTracker.withTrackedEntityAtPath(path, this.init, () => { + this.expressionsToBeDeoptimized.push(origin); + return this.init.getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin); + }, UNKNOWN_EXPRESSION); + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + switch (interaction.type) { + case INTERACTION_ACCESSED: + if (this.isReassigned) + return true; + return (this.init && + !context.accessed.trackEntityAtPathAndGetIfTracked(path, this) && + this.init.hasEffectsOnInteractionAtPath(path, interaction, context)); + case INTERACTION_ASSIGNED: + if (this.included) + return true; + if (path.length === 0) + return false; + if (this.isReassigned) + return true; + return (this.init && + !context.assigned.trackEntityAtPathAndGetIfTracked(path, this) && + this.init.hasEffectsOnInteractionAtPath(path, interaction, context)); + case INTERACTION_CALLED: + if (this.isReassigned) + return true; + return (this.init && + !(interaction.withNew ? context.instantiated : context.called).trackEntityAtPathAndGetIfTracked(path, interaction.args, this) && + this.init.hasEffectsOnInteractionAtPath(path, interaction, context)); + } + } + include() { + if (!this.included) { + this.included = true; + for (const declaration of this.declarations) { + // If node is a default export, it can save a tree-shaking run to include the full declaration now + if (!declaration.included) + declaration.include(createInclusionContext(), false); + let node = declaration.parent; + while (!node.included) { + // We do not want to properly include parents in case they are part of a dead branch + // in which case .include() might pull in more dead code + node.included = true; + if (node.type === Program$1) + break; + node = node.parent; + } + } + } + } + includeCallArguments(context, args) { + if (this.isReassigned || (this.init && context.includedCallArguments.has(this.init))) { + for (const arg of args) { + arg.include(context, false); + } + } + else if (this.init) { + context.includedCallArguments.add(this.init); + this.init.includeCallArguments(context, args); + context.includedCallArguments.delete(this.init); + } + } + markCalledFromTryStatement() { + this.calledFromTryStatement = true; + } + markInitializersForDeoptimization() { + if (this.additionalInitializers === null) { + this.additionalInitializers = this.init === null ? [] : [this.init]; + this.init = UNKNOWN_EXPRESSION; + this.isReassigned = true; + } + return this.additionalInitializers; + } } -function errNamespaceConflict(name, reexportingModule, additionalExportAllModule) { - return { - code: Errors.NAMESPACE_CONFLICT, - message: `Conflicting namespaces: ${relativeId(reexportingModule.id)} re-exports '${name}' from both ${relativeId(reexportingModule.exportsAll[name])} and ${relativeId(additionalExportAllModule.exportsAll[name])} (will be ignored)`, - name, - reexporter: reexportingModule.id, - sources: [reexportingModule.exportsAll[name], additionalExportAllModule.exportsAll[name]] - }; + +const chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_$'; +const base = 64; +function toBase64(num) { + let outStr = ''; + do { + const curDigit = num % base; + num = Math.floor(num / base); + outStr = chars[curDigit] + outStr; + } while (num !== 0); + return outStr; } -function errEntryCannotBeExternal(unresolvedId) { - return { - code: Errors.UNRESOLVED_ENTRY, - message: `Entry module cannot be external (${relativeId(unresolvedId)}).` - }; + +function getSafeName(baseName, usedNames) { + let safeName = baseName; + let count = 1; + while (usedNames.has(safeName) || RESERVED_NAMES$1.has(safeName)) { + safeName = `${baseName}$${toBase64(count++)}`; + } + usedNames.add(safeName); + return safeName; } -function errUnresolvedEntry(unresolvedId) { - return { - code: Errors.UNRESOLVED_ENTRY, - message: `Could not resolve entry module (${relativeId(unresolvedId)}).` - }; + +class Scope$1 { + constructor() { + this.children = []; + this.variables = new Map(); + } + addDeclaration(identifier, context, init, _isHoisted) { + const name = identifier.name; + let variable = this.variables.get(name); + if (variable) { + variable.addDeclaration(identifier, init); + } + else { + variable = new LocalVariable(identifier.name, identifier, init || UNDEFINED_EXPRESSION, context); + this.variables.set(name, variable); + } + return variable; + } + contains(name) { + return this.variables.has(name); + } + findVariable(_name) { + throw new Error('Internal Error: findVariable needs to be implemented by a subclass'); + } } -function errUnresolvedImport(source, importer) { - return { - code: Errors.UNRESOLVED_IMPORT, - message: `Could not resolve '${source}' from ${relativeId(importer)}` - }; + +class ChildScope extends Scope$1 { + constructor(parent) { + super(); + this.accessedOutsideVariables = new Map(); + this.parent = parent; + parent.children.push(this); + } + addAccessedDynamicImport(importExpression) { + (this.accessedDynamicImports || (this.accessedDynamicImports = new Set())).add(importExpression); + if (this.parent instanceof ChildScope) { + this.parent.addAccessedDynamicImport(importExpression); + } + } + addAccessedGlobals(globals, accessedGlobalsByScope) { + const accessedGlobals = accessedGlobalsByScope.get(this) || new Set(); + for (const name of globals) { + accessedGlobals.add(name); + } + accessedGlobalsByScope.set(this, accessedGlobals); + if (this.parent instanceof ChildScope) { + this.parent.addAccessedGlobals(globals, accessedGlobalsByScope); + } + } + addNamespaceMemberAccess(name, variable) { + this.accessedOutsideVariables.set(name, variable); + this.parent.addNamespaceMemberAccess(name, variable); + } + addReturnExpression(expression) { + this.parent instanceof ChildScope && this.parent.addReturnExpression(expression); + } + addUsedOutsideNames(usedNames, format, exportNamesByVariable, accessedGlobalsByScope) { + for (const variable of this.accessedOutsideVariables.values()) { + if (variable.included) { + usedNames.add(variable.getBaseVariableName()); + if (format === 'system' && exportNamesByVariable.has(variable)) { + usedNames.add('exports'); + } + } + } + const accessedGlobals = accessedGlobalsByScope.get(this); + if (accessedGlobals) { + for (const name of accessedGlobals) { + usedNames.add(name); + } + } + } + contains(name) { + return this.variables.has(name) || this.parent.contains(name); + } + deconflict(format, exportNamesByVariable, accessedGlobalsByScope) { + const usedNames = new Set(); + this.addUsedOutsideNames(usedNames, format, exportNamesByVariable, accessedGlobalsByScope); + if (this.accessedDynamicImports) { + for (const importExpression of this.accessedDynamicImports) { + if (importExpression.inlineNamespace) { + usedNames.add(importExpression.inlineNamespace.getBaseVariableName()); + } + } + } + for (const [name, variable] of this.variables) { + if (variable.included || variable.alwaysRendered) { + variable.setRenderNames(null, getSafeName(name, usedNames)); + } + } + for (const scope of this.children) { + scope.deconflict(format, exportNamesByVariable, accessedGlobalsByScope); + } + } + findLexicalBoundary() { + return this.parent.findLexicalBoundary(); + } + findVariable(name) { + const knownVariable = this.variables.get(name) || this.accessedOutsideVariables.get(name); + if (knownVariable) { + return knownVariable; + } + const variable = this.parent.findVariable(name); + this.accessedOutsideVariables.set(name, variable); + return variable; + } } -function errUnresolvedImportTreatedAsExternal(source, importer) { - return { - code: Errors.UNRESOLVED_IMPORT, - importer: relativeId(importer), - message: `'${source}' is imported by ${relativeId(importer)}, but could not be resolved – treating it as an external dependency`, - source, - url: 'https://rollupjs.org/guide/en/#warning-treating-module-as-external-dependency' - }; + +class ParameterScope extends ChildScope { + constructor(parent, context) { + super(parent); + this.parameters = []; + this.hasRest = false; + this.context = context; + this.hoistedBodyVarScope = new ChildScope(this); + } + /** + * Adds a parameter to this scope. Parameters must be added in the correct + * order, e.g. from left to right. + */ + addParameterDeclaration(identifier) { + const name = identifier.name; + let variable = this.hoistedBodyVarScope.variables.get(name); + if (variable) { + variable.addDeclaration(identifier, null); + } + else { + variable = new LocalVariable(name, identifier, UNKNOWN_EXPRESSION, this.context); + } + this.variables.set(name, variable); + return variable; + } + addParameterVariables(parameters, hasRest) { + this.parameters = parameters; + for (const parameterList of parameters) { + for (const parameter of parameterList) { + parameter.alwaysRendered = true; + } + } + this.hasRest = hasRest; + } + includeCallArguments(context, args) { + let calledFromTryStatement = false; + let argIncluded = false; + const restParam = this.hasRest && this.parameters[this.parameters.length - 1]; + for (const checkedArg of args) { + if (checkedArg instanceof SpreadElement) { + for (const arg of args) { + arg.include(context, false); + } + break; + } + } + for (let index = args.length - 1; index >= 0; index--) { + const paramVars = this.parameters[index] || restParam; + const arg = args[index]; + if (paramVars) { + calledFromTryStatement = false; + if (paramVars.length === 0) { + // handle empty destructuring + argIncluded = true; + } + else { + for (const variable of paramVars) { + if (variable.included) { + argIncluded = true; + } + if (variable.calledFromTryStatement) { + calledFromTryStatement = true; + } + } + } + } + if (!argIncluded && arg.shouldBeIncluded(context)) { + argIncluded = true; + } + if (argIncluded) { + arg.include(context, calledFromTryStatement); + } + } + } } -function errExternalSyntheticExports(source, importer) { - return { - code: Errors.EXTERNAL_SYNTHETIC_EXPORTS, - importer: relativeId(importer), - message: `External '${source}' can not have 'syntheticNamedExports' enabled.`, - source - }; + +class ReturnValueScope extends ParameterScope { + constructor() { + super(...arguments); + this.returnExpression = null; + this.returnExpressions = []; + } + addReturnExpression(expression) { + this.returnExpressions.push(expression); + } + getReturnExpression() { + if (this.returnExpression === null) + this.updateReturnExpression(); + return this.returnExpression; + } + updateReturnExpression() { + if (this.returnExpressions.length === 1) { + this.returnExpression = this.returnExpressions[0]; + } + else { + this.returnExpression = UNKNOWN_EXPRESSION; + for (const expression of this.returnExpressions) { + expression.deoptimizePath(UNKNOWN_PATH); + } + } + } } -function errFailedValidation(message) { - return { - code: Errors.VALIDATION_ERROR, - message - }; + +//@ts-check +/** @typedef { import('estree').Node} Node */ +/** @typedef {Node | { + * type: 'PropertyDefinition'; + * computed: boolean; + * value: Node + * }} NodeWithPropertyDefinition */ + +/** + * + * @param {NodeWithPropertyDefinition} node + * @param {NodeWithPropertyDefinition} parent + * @returns boolean + */ +function is_reference (node, parent) { + if (node.type === 'MemberExpression') { + return !node.computed && is_reference(node.object, node); + } + + if (node.type === 'Identifier') { + if (!parent) return true; + + switch (parent.type) { + // disregard `bar` in `foo.bar` + case 'MemberExpression': return parent.computed || node === parent.object; + + // disregard the `foo` in `class {foo(){}}` but keep it in `class {[foo](){}}` + case 'MethodDefinition': return parent.computed; + + // disregard the `foo` in `class {foo=bar}` but keep it in `class {[foo]=bar}` and `class {bar=foo}` + case 'PropertyDefinition': return parent.computed || node === parent.value; + + // disregard the `bar` in `{ bar: foo }`, but keep it in `{ [bar]: foo }` + case 'Property': return parent.computed || node === parent.value; + + // disregard the `bar` in `export { foo as bar }` or + // the foo in `import { foo as bar }` + case 'ExportSpecifier': + case 'ImportSpecifier': return node === parent.local; + + // disregard the `foo` in `foo: while (...) { ... break foo; ... continue foo;}` + case 'LabeledStatement': + case 'BreakStatement': + case 'ContinueStatement': return false; + default: return true; + } + } + + return false; } -function warnDeprecation(deprecation, activeDeprecation, options) { - warnDeprecationWithOptions(deprecation, activeDeprecation, options.onwarn, options.strictDeprecations); + +/* eslint sort-keys: "off" */ +const ValueProperties = Symbol('Value Properties'); +const PURE = { + hasEffectsWhenCalled() { + return false; + } +}; +const IMPURE = { + hasEffectsWhenCalled() { + return true; + } +}; +// We use shortened variables to reduce file size here +/* OBJECT */ +const O = { + __proto__: null, + [ValueProperties]: IMPURE +}; +/* PURE FUNCTION */ +const PF = { + __proto__: null, + [ValueProperties]: PURE +}; +/* FUNCTION THAT MUTATES FIRST ARG WITHOUT TRIGGERING ACCESSORS */ +const MUTATES_ARG_WITHOUT_ACCESSOR = { + __proto__: null, + [ValueProperties]: { + hasEffectsWhenCalled({ args }, context) { + return (!args.length || + args[0].hasEffectsOnInteractionAtPath(UNKNOWN_NON_ACCESSOR_PATH, NODE_INTERACTION_UNKNOWN_ASSIGNMENT, context)); + } + } +}; +/* CONSTRUCTOR */ +const C = { + __proto__: null, + [ValueProperties]: IMPURE, + prototype: O +}; +/* PURE CONSTRUCTOR */ +const PC = { + __proto__: null, + [ValueProperties]: PURE, + prototype: O +}; +const ARRAY_TYPE = { + __proto__: null, + [ValueProperties]: PURE, + from: PF, + of: PF, + prototype: O +}; +const INTL_MEMBER = { + __proto__: null, + [ValueProperties]: PURE, + supportedLocalesOf: PC +}; +const knownGlobals = { + // Placeholders for global objects to avoid shape mutations + global: O, + globalThis: O, + self: O, + window: O, + // Common globals + __proto__: null, + [ValueProperties]: IMPURE, + Array: { + __proto__: null, + [ValueProperties]: IMPURE, + from: O, + isArray: PF, + of: PF, + prototype: O + }, + ArrayBuffer: { + __proto__: null, + [ValueProperties]: PURE, + isView: PF, + prototype: O + }, + Atomics: O, + BigInt: C, + BigInt64Array: C, + BigUint64Array: C, + Boolean: PC, + constructor: C, + DataView: PC, + Date: { + __proto__: null, + [ValueProperties]: PURE, + now: PF, + parse: PF, + prototype: O, + UTC: PF + }, + decodeURI: PF, + decodeURIComponent: PF, + encodeURI: PF, + encodeURIComponent: PF, + Error: PC, + escape: PF, + eval: O, + EvalError: PC, + Float32Array: ARRAY_TYPE, + Float64Array: ARRAY_TYPE, + Function: C, + hasOwnProperty: O, + Infinity: O, + Int16Array: ARRAY_TYPE, + Int32Array: ARRAY_TYPE, + Int8Array: ARRAY_TYPE, + isFinite: PF, + isNaN: PF, + isPrototypeOf: O, + JSON: O, + Map: PC, + Math: { + __proto__: null, + [ValueProperties]: IMPURE, + abs: PF, + acos: PF, + acosh: PF, + asin: PF, + asinh: PF, + atan: PF, + atan2: PF, + atanh: PF, + cbrt: PF, + ceil: PF, + clz32: PF, + cos: PF, + cosh: PF, + exp: PF, + expm1: PF, + floor: PF, + fround: PF, + hypot: PF, + imul: PF, + log: PF, + log10: PF, + log1p: PF, + log2: PF, + max: PF, + min: PF, + pow: PF, + random: PF, + round: PF, + sign: PF, + sin: PF, + sinh: PF, + sqrt: PF, + tan: PF, + tanh: PF, + trunc: PF + }, + NaN: O, + Number: { + __proto__: null, + [ValueProperties]: PURE, + isFinite: PF, + isInteger: PF, + isNaN: PF, + isSafeInteger: PF, + parseFloat: PF, + parseInt: PF, + prototype: O + }, + Object: { + __proto__: null, + [ValueProperties]: PURE, + create: PF, + // Technically those can throw in certain situations, but we ignore this as + // code that relies on this will hopefully wrap this in a try-catch, which + // deoptimizes everything anyway + defineProperty: MUTATES_ARG_WITHOUT_ACCESSOR, + defineProperties: MUTATES_ARG_WITHOUT_ACCESSOR, + getOwnPropertyDescriptor: PF, + getOwnPropertyNames: PF, + getOwnPropertySymbols: PF, + getPrototypeOf: PF, + hasOwn: PF, + is: PF, + isExtensible: PF, + isFrozen: PF, + isSealed: PF, + keys: PF, + fromEntries: PF, + entries: PF, + prototype: O + }, + parseFloat: PF, + parseInt: PF, + Promise: { + __proto__: null, + [ValueProperties]: IMPURE, + all: O, + prototype: O, + race: O, + reject: O, + resolve: O + }, + propertyIsEnumerable: O, + Proxy: O, + RangeError: PC, + ReferenceError: PC, + Reflect: O, + RegExp: PC, + Set: PC, + SharedArrayBuffer: C, + String: { + __proto__: null, + [ValueProperties]: PURE, + fromCharCode: PF, + fromCodePoint: PF, + prototype: O, + raw: PF + }, + Symbol: { + __proto__: null, + [ValueProperties]: PURE, + for: PF, + keyFor: PF, + prototype: O + }, + SyntaxError: PC, + toLocaleString: O, + toString: O, + TypeError: PC, + Uint16Array: ARRAY_TYPE, + Uint32Array: ARRAY_TYPE, + Uint8Array: ARRAY_TYPE, + Uint8ClampedArray: ARRAY_TYPE, + // Technically, this is a global, but it needs special handling + // undefined: ?, + unescape: PF, + URIError: PC, + valueOf: O, + WeakMap: PC, + WeakSet: PC, + // Additional globals shared by Node and Browser that are not strictly part of the language + clearInterval: C, + clearTimeout: C, + console: O, + Intl: { + __proto__: null, + [ValueProperties]: IMPURE, + Collator: INTL_MEMBER, + DateTimeFormat: INTL_MEMBER, + ListFormat: INTL_MEMBER, + NumberFormat: INTL_MEMBER, + PluralRules: INTL_MEMBER, + RelativeTimeFormat: INTL_MEMBER + }, + setInterval: C, + setTimeout: C, + TextDecoder: C, + TextEncoder: C, + URL: C, + URLSearchParams: C, + // Browser specific globals + AbortController: C, + AbortSignal: C, + addEventListener: O, + alert: O, + AnalyserNode: C, + Animation: C, + AnimationEvent: C, + applicationCache: O, + ApplicationCache: C, + ApplicationCacheErrorEvent: C, + atob: O, + Attr: C, + Audio: C, + AudioBuffer: C, + AudioBufferSourceNode: C, + AudioContext: C, + AudioDestinationNode: C, + AudioListener: C, + AudioNode: C, + AudioParam: C, + AudioProcessingEvent: C, + AudioScheduledSourceNode: C, + AudioWorkletNode: C, + BarProp: C, + BaseAudioContext: C, + BatteryManager: C, + BeforeUnloadEvent: C, + BiquadFilterNode: C, + Blob: C, + BlobEvent: C, + blur: O, + BroadcastChannel: C, + btoa: O, + ByteLengthQueuingStrategy: C, + Cache: C, + caches: O, + CacheStorage: C, + cancelAnimationFrame: O, + cancelIdleCallback: O, + CanvasCaptureMediaStreamTrack: C, + CanvasGradient: C, + CanvasPattern: C, + CanvasRenderingContext2D: C, + ChannelMergerNode: C, + ChannelSplitterNode: C, + CharacterData: C, + clientInformation: O, + ClipboardEvent: C, + close: O, + closed: O, + CloseEvent: C, + Comment: C, + CompositionEvent: C, + confirm: O, + ConstantSourceNode: C, + ConvolverNode: C, + CountQueuingStrategy: C, + createImageBitmap: O, + Credential: C, + CredentialsContainer: C, + crypto: O, + Crypto: C, + CryptoKey: C, + CSS: C, + CSSConditionRule: C, + CSSFontFaceRule: C, + CSSGroupingRule: C, + CSSImportRule: C, + CSSKeyframeRule: C, + CSSKeyframesRule: C, + CSSMediaRule: C, + CSSNamespaceRule: C, + CSSPageRule: C, + CSSRule: C, + CSSRuleList: C, + CSSStyleDeclaration: C, + CSSStyleRule: C, + CSSStyleSheet: C, + CSSSupportsRule: C, + CustomElementRegistry: C, + customElements: O, + CustomEvent: C, + DataTransfer: C, + DataTransferItem: C, + DataTransferItemList: C, + defaultstatus: O, + defaultStatus: O, + DelayNode: C, + DeviceMotionEvent: C, + DeviceOrientationEvent: C, + devicePixelRatio: O, + dispatchEvent: O, + document: O, + Document: C, + DocumentFragment: C, + DocumentType: C, + DOMError: C, + DOMException: C, + DOMImplementation: C, + DOMMatrix: C, + DOMMatrixReadOnly: C, + DOMParser: C, + DOMPoint: C, + DOMPointReadOnly: C, + DOMQuad: C, + DOMRect: C, + DOMRectReadOnly: C, + DOMStringList: C, + DOMStringMap: C, + DOMTokenList: C, + DragEvent: C, + DynamicsCompressorNode: C, + Element: C, + ErrorEvent: C, + Event: C, + EventSource: C, + EventTarget: C, + external: O, + fetch: O, + File: C, + FileList: C, + FileReader: C, + find: O, + focus: O, + FocusEvent: C, + FontFace: C, + FontFaceSetLoadEvent: C, + FormData: C, + frames: O, + GainNode: C, + Gamepad: C, + GamepadButton: C, + GamepadEvent: C, + getComputedStyle: O, + getSelection: O, + HashChangeEvent: C, + Headers: C, + history: O, + History: C, + HTMLAllCollection: C, + HTMLAnchorElement: C, + HTMLAreaElement: C, + HTMLAudioElement: C, + HTMLBaseElement: C, + HTMLBodyElement: C, + HTMLBRElement: C, + HTMLButtonElement: C, + HTMLCanvasElement: C, + HTMLCollection: C, + HTMLContentElement: C, + HTMLDataElement: C, + HTMLDataListElement: C, + HTMLDetailsElement: C, + HTMLDialogElement: C, + HTMLDirectoryElement: C, + HTMLDivElement: C, + HTMLDListElement: C, + HTMLDocument: C, + HTMLElement: C, + HTMLEmbedElement: C, + HTMLFieldSetElement: C, + HTMLFontElement: C, + HTMLFormControlsCollection: C, + HTMLFormElement: C, + HTMLFrameElement: C, + HTMLFrameSetElement: C, + HTMLHeadElement: C, + HTMLHeadingElement: C, + HTMLHRElement: C, + HTMLHtmlElement: C, + HTMLIFrameElement: C, + HTMLImageElement: C, + HTMLInputElement: C, + HTMLLabelElement: C, + HTMLLegendElement: C, + HTMLLIElement: C, + HTMLLinkElement: C, + HTMLMapElement: C, + HTMLMarqueeElement: C, + HTMLMediaElement: C, + HTMLMenuElement: C, + HTMLMetaElement: C, + HTMLMeterElement: C, + HTMLModElement: C, + HTMLObjectElement: C, + HTMLOListElement: C, + HTMLOptGroupElement: C, + HTMLOptionElement: C, + HTMLOptionsCollection: C, + HTMLOutputElement: C, + HTMLParagraphElement: C, + HTMLParamElement: C, + HTMLPictureElement: C, + HTMLPreElement: C, + HTMLProgressElement: C, + HTMLQuoteElement: C, + HTMLScriptElement: C, + HTMLSelectElement: C, + HTMLShadowElement: C, + HTMLSlotElement: C, + HTMLSourceElement: C, + HTMLSpanElement: C, + HTMLStyleElement: C, + HTMLTableCaptionElement: C, + HTMLTableCellElement: C, + HTMLTableColElement: C, + HTMLTableElement: C, + HTMLTableRowElement: C, + HTMLTableSectionElement: C, + HTMLTemplateElement: C, + HTMLTextAreaElement: C, + HTMLTimeElement: C, + HTMLTitleElement: C, + HTMLTrackElement: C, + HTMLUListElement: C, + HTMLUnknownElement: C, + HTMLVideoElement: C, + IDBCursor: C, + IDBCursorWithValue: C, + IDBDatabase: C, + IDBFactory: C, + IDBIndex: C, + IDBKeyRange: C, + IDBObjectStore: C, + IDBOpenDBRequest: C, + IDBRequest: C, + IDBTransaction: C, + IDBVersionChangeEvent: C, + IdleDeadline: C, + IIRFilterNode: C, + Image: C, + ImageBitmap: C, + ImageBitmapRenderingContext: C, + ImageCapture: C, + ImageData: C, + indexedDB: O, + innerHeight: O, + innerWidth: O, + InputEvent: C, + IntersectionObserver: C, + IntersectionObserverEntry: C, + isSecureContext: O, + KeyboardEvent: C, + KeyframeEffect: C, + length: O, + localStorage: O, + location: O, + Location: C, + locationbar: O, + matchMedia: O, + MediaDeviceInfo: C, + MediaDevices: C, + MediaElementAudioSourceNode: C, + MediaEncryptedEvent: C, + MediaError: C, + MediaKeyMessageEvent: C, + MediaKeySession: C, + MediaKeyStatusMap: C, + MediaKeySystemAccess: C, + MediaList: C, + MediaQueryList: C, + MediaQueryListEvent: C, + MediaRecorder: C, + MediaSettingsRange: C, + MediaSource: C, + MediaStream: C, + MediaStreamAudioDestinationNode: C, + MediaStreamAudioSourceNode: C, + MediaStreamEvent: C, + MediaStreamTrack: C, + MediaStreamTrackEvent: C, + menubar: O, + MessageChannel: C, + MessageEvent: C, + MessagePort: C, + MIDIAccess: C, + MIDIConnectionEvent: C, + MIDIInput: C, + MIDIInputMap: C, + MIDIMessageEvent: C, + MIDIOutput: C, + MIDIOutputMap: C, + MIDIPort: C, + MimeType: C, + MimeTypeArray: C, + MouseEvent: C, + moveBy: O, + moveTo: O, + MutationEvent: C, + MutationObserver: C, + MutationRecord: C, + name: O, + NamedNodeMap: C, + NavigationPreloadManager: C, + navigator: O, + Navigator: C, + NetworkInformation: C, + Node: C, + NodeFilter: O, + NodeIterator: C, + NodeList: C, + Notification: C, + OfflineAudioCompletionEvent: C, + OfflineAudioContext: C, + offscreenBuffering: O, + OffscreenCanvas: C, + open: O, + openDatabase: O, + Option: C, + origin: O, + OscillatorNode: C, + outerHeight: O, + outerWidth: O, + PageTransitionEvent: C, + pageXOffset: O, + pageYOffset: O, + PannerNode: C, + parent: O, + Path2D: C, + PaymentAddress: C, + PaymentRequest: C, + PaymentRequestUpdateEvent: C, + PaymentResponse: C, + performance: O, + Performance: C, + PerformanceEntry: C, + PerformanceLongTaskTiming: C, + PerformanceMark: C, + PerformanceMeasure: C, + PerformanceNavigation: C, + PerformanceNavigationTiming: C, + PerformanceObserver: C, + PerformanceObserverEntryList: C, + PerformancePaintTiming: C, + PerformanceResourceTiming: C, + PerformanceTiming: C, + PeriodicWave: C, + Permissions: C, + PermissionStatus: C, + personalbar: O, + PhotoCapabilities: C, + Plugin: C, + PluginArray: C, + PointerEvent: C, + PopStateEvent: C, + postMessage: O, + Presentation: C, + PresentationAvailability: C, + PresentationConnection: C, + PresentationConnectionAvailableEvent: C, + PresentationConnectionCloseEvent: C, + PresentationConnectionList: C, + PresentationReceiver: C, + PresentationRequest: C, + print: O, + ProcessingInstruction: C, + ProgressEvent: C, + PromiseRejectionEvent: C, + prompt: O, + PushManager: C, + PushSubscription: C, + PushSubscriptionOptions: C, + queueMicrotask: O, + RadioNodeList: C, + Range: C, + ReadableStream: C, + RemotePlayback: C, + removeEventListener: O, + Request: C, + requestAnimationFrame: O, + requestIdleCallback: O, + resizeBy: O, + ResizeObserver: C, + ResizeObserverEntry: C, + resizeTo: O, + Response: C, + RTCCertificate: C, + RTCDataChannel: C, + RTCDataChannelEvent: C, + RTCDtlsTransport: C, + RTCIceCandidate: C, + RTCIceTransport: C, + RTCPeerConnection: C, + RTCPeerConnectionIceEvent: C, + RTCRtpReceiver: C, + RTCRtpSender: C, + RTCSctpTransport: C, + RTCSessionDescription: C, + RTCStatsReport: C, + RTCTrackEvent: C, + screen: O, + Screen: C, + screenLeft: O, + ScreenOrientation: C, + screenTop: O, + screenX: O, + screenY: O, + ScriptProcessorNode: C, + scroll: O, + scrollbars: O, + scrollBy: O, + scrollTo: O, + scrollX: O, + scrollY: O, + SecurityPolicyViolationEvent: C, + Selection: C, + ServiceWorker: C, + ServiceWorkerContainer: C, + ServiceWorkerRegistration: C, + sessionStorage: O, + ShadowRoot: C, + SharedWorker: C, + SourceBuffer: C, + SourceBufferList: C, + speechSynthesis: O, + SpeechSynthesisEvent: C, + SpeechSynthesisUtterance: C, + StaticRange: C, + status: O, + statusbar: O, + StereoPannerNode: C, + stop: O, + Storage: C, + StorageEvent: C, + StorageManager: C, + styleMedia: O, + StyleSheet: C, + StyleSheetList: C, + SubtleCrypto: C, + SVGAElement: C, + SVGAngle: C, + SVGAnimatedAngle: C, + SVGAnimatedBoolean: C, + SVGAnimatedEnumeration: C, + SVGAnimatedInteger: C, + SVGAnimatedLength: C, + SVGAnimatedLengthList: C, + SVGAnimatedNumber: C, + SVGAnimatedNumberList: C, + SVGAnimatedPreserveAspectRatio: C, + SVGAnimatedRect: C, + SVGAnimatedString: C, + SVGAnimatedTransformList: C, + SVGAnimateElement: C, + SVGAnimateMotionElement: C, + SVGAnimateTransformElement: C, + SVGAnimationElement: C, + SVGCircleElement: C, + SVGClipPathElement: C, + SVGComponentTransferFunctionElement: C, + SVGDefsElement: C, + SVGDescElement: C, + SVGDiscardElement: C, + SVGElement: C, + SVGEllipseElement: C, + SVGFEBlendElement: C, + SVGFEColorMatrixElement: C, + SVGFEComponentTransferElement: C, + SVGFECompositeElement: C, + SVGFEConvolveMatrixElement: C, + SVGFEDiffuseLightingElement: C, + SVGFEDisplacementMapElement: C, + SVGFEDistantLightElement: C, + SVGFEDropShadowElement: C, + SVGFEFloodElement: C, + SVGFEFuncAElement: C, + SVGFEFuncBElement: C, + SVGFEFuncGElement: C, + SVGFEFuncRElement: C, + SVGFEGaussianBlurElement: C, + SVGFEImageElement: C, + SVGFEMergeElement: C, + SVGFEMergeNodeElement: C, + SVGFEMorphologyElement: C, + SVGFEOffsetElement: C, + SVGFEPointLightElement: C, + SVGFESpecularLightingElement: C, + SVGFESpotLightElement: C, + SVGFETileElement: C, + SVGFETurbulenceElement: C, + SVGFilterElement: C, + SVGForeignObjectElement: C, + SVGGElement: C, + SVGGeometryElement: C, + SVGGradientElement: C, + SVGGraphicsElement: C, + SVGImageElement: C, + SVGLength: C, + SVGLengthList: C, + SVGLinearGradientElement: C, + SVGLineElement: C, + SVGMarkerElement: C, + SVGMaskElement: C, + SVGMatrix: C, + SVGMetadataElement: C, + SVGMPathElement: C, + SVGNumber: C, + SVGNumberList: C, + SVGPathElement: C, + SVGPatternElement: C, + SVGPoint: C, + SVGPointList: C, + SVGPolygonElement: C, + SVGPolylineElement: C, + SVGPreserveAspectRatio: C, + SVGRadialGradientElement: C, + SVGRect: C, + SVGRectElement: C, + SVGScriptElement: C, + SVGSetElement: C, + SVGStopElement: C, + SVGStringList: C, + SVGStyleElement: C, + SVGSVGElement: C, + SVGSwitchElement: C, + SVGSymbolElement: C, + SVGTextContentElement: C, + SVGTextElement: C, + SVGTextPathElement: C, + SVGTextPositioningElement: C, + SVGTitleElement: C, + SVGTransform: C, + SVGTransformList: C, + SVGTSpanElement: C, + SVGUnitTypes: C, + SVGUseElement: C, + SVGViewElement: C, + TaskAttributionTiming: C, + Text: C, + TextEvent: C, + TextMetrics: C, + TextTrack: C, + TextTrackCue: C, + TextTrackCueList: C, + TextTrackList: C, + TimeRanges: C, + toolbar: O, + top: O, + Touch: C, + TouchEvent: C, + TouchList: C, + TrackEvent: C, + TransitionEvent: C, + TreeWalker: C, + UIEvent: C, + ValidityState: C, + visualViewport: O, + VisualViewport: C, + VTTCue: C, + WaveShaperNode: C, + WebAssembly: O, + WebGL2RenderingContext: C, + WebGLActiveInfo: C, + WebGLBuffer: C, + WebGLContextEvent: C, + WebGLFramebuffer: C, + WebGLProgram: C, + WebGLQuery: C, + WebGLRenderbuffer: C, + WebGLRenderingContext: C, + WebGLSampler: C, + WebGLShader: C, + WebGLShaderPrecisionFormat: C, + WebGLSync: C, + WebGLTexture: C, + WebGLTransformFeedback: C, + WebGLUniformLocation: C, + WebGLVertexArrayObject: C, + WebSocket: C, + WheelEvent: C, + Window: C, + Worker: C, + WritableStream: C, + XMLDocument: C, + XMLHttpRequest: C, + XMLHttpRequestEventTarget: C, + XMLHttpRequestUpload: C, + XMLSerializer: C, + XPathEvaluator: C, + XPathExpression: C, + XPathResult: C, + XSLTProcessor: C +}; +for (const global of ['window', 'global', 'self', 'globalThis']) { + knownGlobals[global] = knownGlobals; } -function warnDeprecationWithOptions(deprecation, activeDeprecation, warn, strictDeprecations) { - if (activeDeprecation || strictDeprecations) { - const warning = errDeprecation(deprecation); - if (strictDeprecations) { - return error(warning); +function getGlobalAtPath(path) { + let currentGlobal = knownGlobals; + for (const pathSegment of path) { + if (typeof pathSegment !== 'string') { + return null; + } + currentGlobal = currentGlobal[pathSegment]; + if (!currentGlobal) { + return null; } - warn(warning); } + return currentGlobal[ValueProperties]; } -// Generate strings which dereference dotted properties, but use array notation `['prop-deref']` -// if the property name isn't trivial -const shouldUseDot = /^[a-zA-Z$_][a-zA-Z0-9$_]*$/; -function property(prop) { - return shouldUseDot.test(prop) ? `.${prop}` : `['${prop}']`; -} -function keypath(keypath) { - return keypath - .split('.') - .map(property) - .join(''); -} - -function setupNamespace(name, root, globals, compact) { - const _ = compact ? '' : ' '; - const parts = name.split('.'); - parts[0] = (typeof globals === 'function' ? globals(parts[0]) : globals[parts[0]]) || parts[0]; - parts.pop(); - let acc = root; - return (parts - .map(part => ((acc += property(part)), `${acc}${_}=${_}${acc}${_}||${_}{}${compact ? '' : ';'}`)) - .join(compact ? ',' : '\n') + (compact && parts.length ? ';' : '\n')); -} -function assignToDeepVariable(deepName, root, globals, compact, assignment) { - const _ = compact ? '' : ' '; - const parts = deepName.split('.'); - parts[0] = (typeof globals === 'function' ? globals(parts[0]) : globals[parts[0]]) || parts[0]; - const last = parts.pop(); - let acc = root; - let deepAssignment = parts - .map(part => ((acc += property(part)), `${acc}${_}=${_}${acc}${_}||${_}{}`)) - .concat(`${acc}${property(last)}`) - .join(`,${_}`) - .concat(`${_}=${_}${assignment}`); - if (parts.length > 0) { - deepAssignment = `(${deepAssignment})`; +class GlobalVariable extends Variable { + constructor() { + super(...arguments); + // Ensure we use live-bindings for globals as we do not know if they have + // been reassigned + this.isReassigned = true; } - return deepAssignment; -} - -function trimEmptyImports(dependencies) { - let i = dependencies.length; - while (i--) { - const dependency = dependencies[i]; - if (dependency.exportsDefault || dependency.exportsNames) { - return dependencies.slice(0, i + 1); + getLiteralValueAtPath(path, _recursionTracker, _origin) { + return getGlobalAtPath([this.name, ...path]) ? UnknownTruthyValue : UnknownValue; + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + switch (interaction.type) { + case INTERACTION_ACCESSED: + if (path.length === 0) { + // Technically, "undefined" is a global variable of sorts + return this.name !== 'undefined' && !getGlobalAtPath([this.name]); + } + return !getGlobalAtPath([this.name, ...path].slice(0, -1)); + case INTERACTION_ASSIGNED: + return true; + case INTERACTION_CALLED: { + const globalAtPath = getGlobalAtPath([this.name, ...path]); + return !globalAtPath || globalAtPath.hasEffectsWhenCalled(interaction, context); + } } } - return []; } -const thisProp = (name) => `this${keypath(name)}`; -function iife(magicString, { dependencies, exports, hasExports, indentString: t, intro, namedExportsMode, outro, varOrConst, warn }, options) { - const _ = options.compact ? '' : ' '; - const n = options.compact ? '' : '\n'; - const { extend, name } = options; - const isNamespaced = name && name.indexOf('.') !== -1; - const useVariableAssignment = !extend && !isNamespaced; - if (name && useVariableAssignment && !isLegal(name)) { - return error({ - code: 'ILLEGAL_IDENTIFIER_AS_NAME', - message: `Given name "${name}" is not a legal JS identifier. If you need this, you can try "output.extend: true".` - }); +const tdzVariableKinds = { + __proto__: null, + class: true, + const: true, + let: true, + var: true +}; +class Identifier extends NodeBase { + constructor() { + super(...arguments); + this.variable = null; + this.isTDZAccess = null; + } + addExportedVariables(variables, exportNamesByVariable) { + if (exportNamesByVariable.has(this.variable)) { + variables.push(this.variable); + } } - warnOnBuiltins(warn, dependencies); - const external = trimEmptyImports(dependencies); - const deps = external.map(dep => dep.globalName || 'null'); - const args = external.map(m => m.name); - if (hasExports && !name) { - warn({ - code: 'MISSING_NAME_OPTION_FOR_IIFE_EXPORT', - message: `If you do not supply "output.name", you may not be able to access the exports of an IIFE bundle.` - }); + bind() { + if (!this.variable && is_reference(this, this.parent)) { + this.variable = this.scope.findVariable(this.name); + this.variable.addReference(this); + } } - if (namedExportsMode && hasExports) { - if (extend) { - deps.unshift(`${thisProp(name)}${_}=${_}${thisProp(name)}${_}||${_}{}`); - args.unshift('exports'); + declare(kind, init) { + let variable; + const { treeshake } = this.context.options; + switch (kind) { + case 'var': + variable = this.scope.addDeclaration(this, this.context, init, true); + if (treeshake && treeshake.correctVarValueBeforeDeclaration) { + // Necessary to make sure the init is deoptimized. We cannot call deoptimizePath here. + variable.markInitializersForDeoptimization(); + } + break; + case 'function': + // in strict mode, functions are only hoisted within a scope but not across block scopes + variable = this.scope.addDeclaration(this, this.context, init, false); + break; + case 'let': + case 'const': + case 'class': + variable = this.scope.addDeclaration(this, this.context, init, false); + break; + case 'parameter': + variable = this.scope.addParameterDeclaration(this); + break; + /* istanbul ignore next */ + default: + /* istanbul ignore next */ + throw new Error(`Internal Error: Unexpected identifier kind ${kind}.`); } - else { - deps.unshift('{}'); - args.unshift('exports'); + variable.kind = kind; + return [(this.variable = variable)]; + } + deoptimizePath(path) { + var _a; + if (path.length === 0 && !this.scope.contains(this.name)) { + this.disallowImportReassignment(); } + // We keep conditional chaining because an unknown Node could have an + // Identifier as property that might be deoptimized by default + (_a = this.variable) === null || _a === void 0 ? void 0 : _a.deoptimizePath(path); } - const useStrict = options.strict ? `${t}'use strict';${n}${n}` : ``; - let wrapperIntro = `(function${_}(${args.join(`,${_}`)})${_}{${n}${useStrict}`; - if (hasExports && (!extend || !namedExportsMode) && name) { - wrapperIntro = - (useVariableAssignment ? `${varOrConst} ${name}` : thisProp(name)) + - `${_}=${_}${wrapperIntro}`; + deoptimizeThisOnInteractionAtPath(interaction, path, recursionTracker) { + this.variable.deoptimizeThisOnInteractionAtPath(interaction, path, recursionTracker); } - if (isNamespaced && hasExports) { - wrapperIntro = setupNamespace(name, 'this', options.globals, options.compact) + wrapperIntro; + getLiteralValueAtPath(path, recursionTracker, origin) { + return this.getVariableRespectingTDZ().getLiteralValueAtPath(path, recursionTracker, origin); } - let wrapperOutro = `${n}${n}}(${deps.join(`,${_}`)}));`; - if (!extend && namedExportsMode && hasExports) { - wrapperOutro = `${n}${n}${t}return exports;${wrapperOutro}`; + getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin) { + return this.getVariableRespectingTDZ().getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin); } - // var foo__default = 'default' in foo ? foo['default'] : foo; - const interopBlock = getInteropBlock(dependencies, options, varOrConst); - if (interopBlock) - magicString.prepend(interopBlock + n + n); - if (intro) - magicString.prepend(intro); - const exportBlock = getExportBlock(exports, dependencies, namedExportsMode, options.interop, options.compact, t); - if (exportBlock) - magicString.append(n + n + exportBlock); - if (outro) - magicString.append(outro); - return magicString.indent(t).prepend(wrapperIntro).append(wrapperOutro); -} - -function getStarExcludes({ dependencies, exports }) { - const starExcludes = new Set(exports.map(expt => expt.exported)); - if (!starExcludes.has('default')) - starExcludes.add('default'); - // also include reexport names - for (const { reexports } of dependencies) { - if (reexports) { - for (const reexport of reexports) { - if (reexport.imported !== '*' && !starExcludes.has(reexport.reexported)) - starExcludes.add(reexport.reexported); - } + hasEffects(context) { + if (!this.deoptimized) + this.applyDeoptimizations(); + if (this.isPossibleTDZ() && this.variable.kind !== 'var') { + return true; } + return (this.context.options.treeshake.unknownGlobalSideEffects && + this.variable instanceof GlobalVariable && + this.variable.hasEffectsOnInteractionAtPath(EMPTY_PATH, NODE_INTERACTION_UNKNOWN_ACCESS, context)); } - return starExcludes; -} -const getStarExcludesBlock = (starExcludes, varOrConst, _, t, n) => starExcludes - ? `${n}${t}${varOrConst} _starExcludes${_}=${_}{${_}${[...starExcludes] - .map(prop => `${prop}:${_}1`) - .join(`,${_}`)}${_}};` - : ''; -const getImportBindingsBlock = (importBindings, _, t, n) => (importBindings.length ? `${n}${t}var ${importBindings.join(`,${_}`)};` : ''); -function getExportsBlock(exports, _, t, n) { - if (exports.length === 0) { - return ''; - } - if (exports.length === 1) { - return `${t}${t}${t}exports('${exports[0].name}',${_}${exports[0].value});${n}${n}`; + hasEffectsOnInteractionAtPath(path, interaction, context) { + switch (interaction.type) { + case INTERACTION_ACCESSED: + return (this.variable !== null && + this.getVariableRespectingTDZ().hasEffectsOnInteractionAtPath(path, interaction, context)); + case INTERACTION_ASSIGNED: + return (path.length > 0 ? this.getVariableRespectingTDZ() : this.variable).hasEffectsOnInteractionAtPath(path, interaction, context); + case INTERACTION_CALLED: + return this.getVariableRespectingTDZ().hasEffectsOnInteractionAtPath(path, interaction, context); + } } - return (`${t}${t}${t}exports({${n}` + - exports.map(({ name, value }) => `${t}${t}${t}${t}${name}:${_}${value}`).join(`,${n}`) + - `${n}${t}${t}${t}});${n}${n}`); -} -const getHoistedExportsBlock = (exports, _, t, n) => getExportsBlock(exports - .filter(expt => expt.hoisted || expt.uninitialized) - .map(expt => ({ name: expt.exported, value: expt.uninitialized ? 'void 0' : expt.local })), _, t, n); -const getMissingExportsBlock = (exports, _, t, n) => getExportsBlock(exports - .filter(expt => expt.local === MISSING_EXPORT_SHIM_VARIABLE) - .map(expt => ({ name: expt.exported, value: MISSING_EXPORT_SHIM_VARIABLE })), _, t, n); -const getSyntheticExportsBlock = (exports, _, t, n) => getExportsBlock(exports - .filter(expt => expt.expression) - .map(expt => ({ name: expt.exported, value: expt.local })), _, t, n); -function system(magicString, { accessedGlobals, dependencies, exports, hasExports, indentString: t, intro, outro, usesTopLevelAwait, varOrConst }, options) { - const n = options.compact ? '' : '\n'; - const _ = options.compact ? '' : ' '; - const dependencyIds = dependencies.map(m => `'${m.id}'`); - const importBindings = []; - let starExcludes; - const setters = []; - for (const { imports, reexports } of dependencies) { - const setter = []; - if (imports) { - for (const specifier of imports) { - importBindings.push(specifier.local); - if (specifier.imported === '*') { - setter.push(`${specifier.local}${_}=${_}module;`); - } - else { - setter.push(`${specifier.local}${_}=${_}module.${specifier.imported};`); - } + include() { + if (!this.deoptimized) + this.applyDeoptimizations(); + if (!this.included) { + this.included = true; + if (this.variable !== null) { + this.context.includeVariableInModule(this.variable); } } - if (reexports) { - let createdSetter = false; - // bulk-reexport form - if (reexports.length > 1 || - (reexports.length === 1 && - (reexports[0].reexported === '*' || reexports[0].imported === '*'))) { - // star reexports - for (const specifier of reexports) { - if (specifier.reexported !== '*') - continue; - // need own exports list for deduping in star export case - if (!starExcludes) { - starExcludes = getStarExcludes({ dependencies, exports }); - } - if (!createdSetter) { - setter.push(`${varOrConst} _setter${_}=${_}{};`); - createdSetter = true; - } - setter.push(`for${_}(var _$p${_}in${_}module)${_}{`); - setter.push(`${t}if${_}(!_starExcludes[_$p])${_}_setter[_$p]${_}=${_}module[_$p];`); - setter.push('}'); - } - // star import reexport - for (const specifier of reexports) { - if (specifier.imported !== '*' || specifier.reexported === '*') - continue; - setter.push(`exports('${specifier.reexported}',${_}module);`); - } - // reexports - for (const specifier of reexports) { - if (specifier.reexported === '*' || specifier.imported === '*') - continue; - if (!createdSetter) { - setter.push(`${varOrConst} _setter${_}=${_}{};`); - createdSetter = true; - } - setter.push(`_setter.${specifier.reexported}${_}=${_}module.${specifier.imported};`); - } - if (createdSetter) { - setter.push('exports(_setter);'); + } + includeCallArguments(context, args) { + this.variable.includeCallArguments(context, args); + } + isPossibleTDZ() { + // return cached value to avoid issues with the next tree-shaking pass + if (this.isTDZAccess !== null) + return this.isTDZAccess; + if (!(this.variable instanceof LocalVariable) || + !this.variable.kind || + !(this.variable.kind in tdzVariableKinds)) { + return (this.isTDZAccess = false); + } + let decl_id; + if (this.variable.declarations && + this.variable.declarations.length === 1 && + (decl_id = this.variable.declarations[0]) && + this.start < decl_id.start && + closestParentFunctionOrProgram(this) === closestParentFunctionOrProgram(decl_id)) { + // a variable accessed before its declaration + // in the same function or at top level of module + return (this.isTDZAccess = true); + } + if (!this.variable.initReached) { + // Either a const/let TDZ violation or + // var use before declaration was encountered. + return (this.isTDZAccess = true); + } + return (this.isTDZAccess = false); + } + markDeclarationReached() { + this.variable.initReached = true; + } + render(code, { snippets: { getPropertyAccess } }, { renderedParentType, isCalleeOfRenderedParent, isShorthandProperty } = BLANK) { + if (this.variable) { + const name = this.variable.getName(getPropertyAccess); + if (name !== this.name) { + code.overwrite(this.start, this.end, name, { + contentOnly: true, + storeName: true + }); + if (isShorthandProperty) { + code.prependRight(this.start, `${this.name}: `); } } - else { - // single reexport - for (const specifier of reexports) { - setter.push(`exports('${specifier.reexported}',${_}module.${specifier.imported});`); - } + // In strict mode, any variable named "eval" must be the actual "eval" function + if (name === 'eval' && + renderedParentType === CallExpression$1 && + isCalleeOfRenderedParent) { + code.appendRight(this.start, '0, '); } } - setters.push(setter.join(`${n}${t}${t}${t}`)); } - const registeredName = options.name ? `'${options.name}',${_}` : ''; - const wrapperParams = accessedGlobals.has('module') - ? `exports,${_}module` - : hasExports - ? 'exports' - : ''; - let wrapperStart = `System.register(${registeredName}[` + - dependencyIds.join(`,${_}`) + - `],${_}function${_}(${wrapperParams})${_}{${n}${t}${options.strict ? "'use strict';" : ''}` + - getStarExcludesBlock(starExcludes, varOrConst, _, t, n) + - getImportBindingsBlock(importBindings, _, t, n) + - `${n}${t}return${_}{${setters.length - ? `${n}${t}${t}setters:${_}[${setters - .map(s => s - ? `function${_}(module)${_}{${n}${t}${t}${t}${s}${n}${t}${t}}` - : options.systemNullSetters - ? `null` - : `function${_}()${_}{}`) - .join(`,${_}`)}],` - : ''}${n}`; - wrapperStart += - `${t}${t}execute:${_}${usesTopLevelAwait ? `async${_}` : ''}function${_}()${_}{${n}${n}` + - getHoistedExportsBlock(exports, _, t, n); - const wrapperEnd = `${n}${n}` + - getSyntheticExportsBlock(exports, _, t, n) + - getMissingExportsBlock(exports, _, t, n) + - `${t}${t}}${n}${t}}${options.compact ? '' : ';'}${n}});`; - if (intro) - magicString.prepend(intro); - if (outro) - magicString.append(outro); - return magicString.indent(`${t}${t}${t}`).append(wrapperEnd).prepend(wrapperStart); -} - -function globalProp(name, globalVar) { - if (!name) - return 'null'; - return `${globalVar}${keypath(name)}`; -} -function safeAccess(name, globalVar, _) { - const parts = name.split('.'); - let acc = globalVar; - return parts.map(part => ((acc += property(part)), acc)).join(`${_}&&${_}`); -} -function umd(magicString, { dependencies, exports, hasExports, indentString: t, intro, namedExportsMode, outro, varOrConst, warn }, options) { - const _ = options.compact ? '' : ' '; - const n = options.compact ? '' : '\n'; - const factoryVar = options.compact ? 'f' : 'factory'; - const globalVar = options.compact ? 'g' : 'global'; - if (hasExports && !options.name) { - return error({ - code: 'MISSING_NAME_OPTION_FOR_IIFE_EXPORT', - message: 'You must supply "output.name" for UMD bundles that have exports so that the exports are accessible in environments without a module loader.' - }); + applyDeoptimizations() { + this.deoptimized = true; + if (this.variable instanceof LocalVariable) { + this.variable.consolidateInitializers(); + this.context.requestTreeshakingPass(); + } } - warnOnBuiltins(warn, dependencies); - const amdDeps = dependencies.map(m => `'${m.id}'`); - const cjsDeps = dependencies.map(m => `require('${m.id}')`); - const trimmedImports = trimEmptyImports(dependencies); - const globalDeps = trimmedImports.map(module => globalProp(module.globalName, globalVar)); - const factoryArgs = trimmedImports.map(m => m.name); - if (namedExportsMode && (hasExports || options.noConflict)) { - amdDeps.unshift(`'exports'`); - cjsDeps.unshift(`exports`); - globalDeps.unshift(assignToDeepVariable(options.name, globalVar, options.globals, options.compact, `${options.extend ? `${globalProp(options.name, globalVar)}${_}||${_}` : ''}{}`)); - factoryArgs.unshift('exports'); + disallowImportReassignment() { + return this.context.error({ + code: 'ILLEGAL_REASSIGNMENT', + message: `Illegal reassignment to import '${this.name}'` + }, this.start); } - const amdParams = (options.amd.id ? `'${options.amd.id}',${_}` : ``) + - (amdDeps.length ? `[${amdDeps.join(`,${_}`)}],${_}` : ``); - const define = options.amd.define; - const cjsExport = !namedExportsMode && hasExports ? `module.exports${_}=${_}` : ``; - const useStrict = options.strict ? `${_}'use strict';${n}` : ``; - let iifeExport; - if (options.noConflict) { - const noConflictExportsVar = options.compact ? 'e' : 'exports'; - let factory; - if (!namedExportsMode && hasExports) { - factory = `var ${noConflictExportsVar}${_}=${_}${assignToDeepVariable(options.name, globalVar, options.globals, options.compact, `${factoryVar}(${globalDeps.join(`,${_}`)})`)};`; - } - else if (namedExportsMode) { - const module = globalDeps.shift(); - factory = - `var ${noConflictExportsVar}${_}=${_}${module};${n}` + - `${t}${t}${factoryVar}(${[noConflictExportsVar].concat(globalDeps).join(`,${_}`)});`; + getVariableRespectingTDZ() { + if (this.isPossibleTDZ()) { + return UNKNOWN_EXPRESSION; } - iifeExport = - `(function${_}()${_}{${n}` + - `${t}${t}var current${_}=${_}${safeAccess(options.name, globalVar, _)};${n}` + - `${t}${t}${factory}${n}` + - `${t}${t}${noConflictExportsVar}.noConflict${_}=${_}function${_}()${_}{${_}` + - `${globalProp(options.name, globalVar)}${_}=${_}current;${_}return ${noConflictExportsVar}${options.compact ? '' : '; '}};${n}` + - `${t}}())`; + return this.variable; } - else { - iifeExport = `${factoryVar}(${globalDeps.join(`,${_}`)})`; - if (!namedExportsMode && hasExports) { - iifeExport = assignToDeepVariable(options.name, globalVar, options.globals, options.compact, iifeExport); - } +} +function closestParentFunctionOrProgram(node) { + while (node && !/^Program|Function/.test(node.type)) { + node = node.parent; } - const iifeNeedsGlobal = hasExports || (options.noConflict === true && namedExportsMode) || globalDeps.length > 0; - const globalParam = iifeNeedsGlobal ? `${globalVar},${_}` : ''; - const globalArg = iifeNeedsGlobal ? `this,${_}` : ''; - const iifeStart = iifeNeedsGlobal ? `(${globalVar}${_}=${_}${globalVar}${_}||${_}self,${_}` : ''; - const iifeEnd = iifeNeedsGlobal ? ')' : ''; - const cjsIntro = iifeNeedsGlobal - ? `${t}typeof exports${_}===${_}'object'${_}&&${_}typeof module${_}!==${_}'undefined'${_}?` + - `${_}${cjsExport}${factoryVar}(${cjsDeps.join(`,${_}`)})${_}:${n}` - : ''; - // factory function should be wrapped by parentheses to avoid lazy parsing - const wrapperIntro = `(function${_}(${globalParam}${factoryVar})${_}{${n}` + - cjsIntro + - `${t}typeof ${define}${_}===${_}'function'${_}&&${_}${define}.amd${_}?${_}${define}(${amdParams}${factoryVar})${_}:${n}` + - `${t}${iifeStart}${iifeExport}${iifeEnd};${n}` + - `}(${globalArg}(function${_}(${factoryArgs.join(', ')})${_}{${useStrict}${n}`; - const wrapperOutro = n + n + '})));'; - // var foo__default = 'default' in foo ? foo['default'] : foo; - const interopBlock = getInteropBlock(dependencies, options, varOrConst); - if (interopBlock) - magicString.prepend(interopBlock + n + n); - if (intro) - magicString.prepend(intro); - const exportBlock = getExportBlock(exports, dependencies, namedExportsMode, options.interop, options.compact, t); - if (exportBlock) - magicString.append(n + n + exportBlock); - if (namedExportsMode && hasExports && options.esModule) - magicString.append(n + n + (options.compact ? compactEsModuleExport : esModuleExport)); - if (outro) - magicString.append(outro); - return magicString.trim().indent(t).append(wrapperOutro).prepend(wrapperIntro); + // one of: ArrowFunctionExpression, FunctionDeclaration, FunctionExpression or Program + return node; } -var finalisers = { system, amd, cjs, es, iife, umd }; - -const extractors = { - ArrayPattern(names, param) { - for (const element of param.elements) { - if (element) - extractors[element.type](names, element); - } - }, - AssignmentPattern(names, param) { - extractors[param.left.type](names, param.left); - }, - Identifier(names, param) { - names.push(param.name); - }, - MemberExpression() { }, - ObjectPattern(names, param) { - for (const prop of param.properties) { - if (prop.type === 'RestElement') { - extractors.RestElement(names, prop); +function treeshakeNode(node, code, start, end) { + code.remove(start, end); + if (node.annotations) { + for (const annotation of node.annotations) { + if (annotation.start < start) { + code.remove(annotation.start, annotation.end); } else { - extractors[prop.value.type](names, prop.value); + return; } } - }, - RestElement(names, param) { - extractors[param.argument.type](names, param.argument); - } -}; -const extractAssignedNames = function extractAssignedNames(param) { - const names = []; - extractors[param.type](names, param); - return names; -}; - -class ExportAllDeclaration extends NodeBase { - hasEffects() { - return false; - } - initialise() { - this.context.addExport(this); - } - render(code, _options, nodeRenderOptions) { - code.remove(nodeRenderOptions.start, nodeRenderOptions.end); } } -ExportAllDeclaration.prototype.needsBoundaries = true; - -class ArrayExpression extends NodeBase { - bind() { - super.bind(); - for (const element of this.elements) { - if (element !== null) - element.deoptimizePath(UNKNOWN_PATH); - } - } - getReturnExpressionWhenCalledAtPath(path) { - if (path.length !== 1) - return UNKNOWN_EXPRESSION; - return getMemberReturnExpressionWhenCalled(arrayMembers, path[0]); - } - hasEffectsWhenAccessedAtPath(path) { - return path.length > 1; +function removeAnnotations(node, code) { + if (!node.annotations && node.parent.type === ExpressionStatement$1) { + node = node.parent; } - hasEffectsWhenCalledAtPath(path, callOptions, context) { - if (path.length === 1) { - return hasMemberEffectWhenCalled(arrayMembers, path[0], this.included, callOptions, context); + if (node.annotations) { + for (const annotation of node.annotations) { + code.remove(annotation.start, annotation.end); } - return true; } } -class ArrayPattern extends NodeBase { - addExportedVariables(variables, exportNamesByVariable) { - for (const element of this.elements) { - if (element !== null) { - element.addExportedVariables(variables, exportNamesByVariable); - } +const NO_SEMICOLON = { isNoStatement: true }; +// This assumes there are only white-space and comments between start and the string we are looking for +function findFirstOccurrenceOutsideComment(code, searchString, start = 0) { + let searchPos, charCodeAfterSlash; + searchPos = code.indexOf(searchString, start); + while (true) { + start = code.indexOf('/', start); + if (start === -1 || start >= searchPos) + return searchPos; + charCodeAfterSlash = code.charCodeAt(++start); + ++start; + // With our assumption, '/' always starts a comment. Determine comment type: + start = + charCodeAfterSlash === 47 /*"/"*/ + ? code.indexOf('\n', start) + 1 + : code.indexOf('*/', start) + 2; + if (start > searchPos) { + searchPos = code.indexOf(searchString, start); } } - declare(kind) { - const variables = []; - for (const element of this.elements) { - if (element !== null) { - variables.push(...element.declare(kind, UNKNOWN_EXPRESSION)); - } +} +const NON_WHITESPACE = /\S/g; +function findNonWhiteSpace(code, index) { + NON_WHITESPACE.lastIndex = index; + const result = NON_WHITESPACE.exec(code); + return result.index; +} +// This assumes "code" only contains white-space and comments +// Returns position of line-comment if applicable +function findFirstLineBreakOutsideComment(code) { + let lineBreakPos, charCodeAfterSlash, start = 0; + lineBreakPos = code.indexOf('\n', start); + while (true) { + start = code.indexOf('/', start); + if (start === -1 || start > lineBreakPos) + return [lineBreakPos, lineBreakPos + 1]; + // With our assumption, '/' always starts a comment. Determine comment type: + charCodeAfterSlash = code.charCodeAt(start + 1); + if (charCodeAfterSlash === 47 /*"/"*/) + return [start, lineBreakPos + 1]; + start = code.indexOf('*/', start + 3) + 2; + if (start > lineBreakPos) { + lineBreakPos = code.indexOf('\n', start); } - return variables; } - deoptimizePath(path) { - if (path.length === 0) { - for (const element of this.elements) { - if (element !== null) { - element.deoptimizePath(path); - } +} +function renderStatementList(statements, code, start, end, options) { + let currentNode, currentNodeStart, currentNodeNeedsBoundaries, nextNodeStart; + let nextNode = statements[0]; + let nextNodeNeedsBoundaries = !nextNode.included || nextNode.needsBoundaries; + if (nextNodeNeedsBoundaries) { + nextNodeStart = + start + findFirstLineBreakOutsideComment(code.original.slice(start, nextNode.start))[1]; + } + for (let nextIndex = 1; nextIndex <= statements.length; nextIndex++) { + currentNode = nextNode; + currentNodeStart = nextNodeStart; + currentNodeNeedsBoundaries = nextNodeNeedsBoundaries; + nextNode = statements[nextIndex]; + nextNodeNeedsBoundaries = + nextNode === undefined ? false : !nextNode.included || nextNode.needsBoundaries; + if (currentNodeNeedsBoundaries || nextNodeNeedsBoundaries) { + nextNodeStart = + currentNode.end + + findFirstLineBreakOutsideComment(code.original.slice(currentNode.end, nextNode === undefined ? end : nextNode.start))[1]; + if (currentNode.included) { + currentNodeNeedsBoundaries + ? currentNode.render(code, options, { + end: nextNodeStart, + start: currentNodeStart + }) + : currentNode.render(code, options); + } + else { + treeshakeNode(currentNode, code, currentNodeStart, nextNodeStart); } } + else { + currentNode.render(code, options); + } } - hasEffectsWhenAssignedAtPath(path, context) { - if (path.length > 0) - return true; - for (const element of this.elements) { - if (element !== null && element.hasEffectsWhenAssignedAtPath(EMPTY_PATH, context)) - return true; +} +// This assumes that the first character is not part of the first node +function getCommaSeparatedNodesWithBoundaries(nodes, code, start, end) { + const splitUpNodes = []; + let node, nextNode, nextNodeStart, contentEnd, char; + let separator = start - 1; + for (let nextIndex = 0; nextIndex < nodes.length; nextIndex++) { + nextNode = nodes[nextIndex]; + if (node !== undefined) { + separator = + node.end + + findFirstOccurrenceOutsideComment(code.original.slice(node.end, nextNode.start), ','); } - return false; + nextNodeStart = contentEnd = + separator + + 1 + + findFirstLineBreakOutsideComment(code.original.slice(separator + 1, nextNode.start))[1]; + while (((char = code.original.charCodeAt(nextNodeStart)), + char === 32 /*" "*/ || char === 9 /*"\t"*/ || char === 10 /*"\n"*/ || char === 13) /*"\r"*/) + nextNodeStart++; + if (node !== undefined) { + splitUpNodes.push({ + contentEnd, + end: nextNodeStart, + node, + separator, + start + }); + } + node = nextNode; + start = nextNodeStart; + } + splitUpNodes.push({ + contentEnd: end, + end, + node: node, + separator: null, + start + }); + return splitUpNodes; +} +// This assumes there are only white-space and comments between start and end +function removeLineBreaks(code, start, end) { + while (true) { + const [removeStart, removeEnd] = findFirstLineBreakOutsideComment(code.original.slice(start, end)); + if (removeStart === -1) { + break; + } + code.remove(start + removeStart, (start += removeEnd)); } } class BlockScope extends ChildScope { - addDeclaration(identifier, context, init = null, isHoisted) { + addDeclaration(identifier, context, init, isHoisted) { if (isHoisted) { - return this.parent.addDeclaration(identifier, context, isHoisted === 'function' ? init : UNKNOWN_EXPRESSION, isHoisted); + const variable = this.parent.addDeclaration(identifier, context, init, isHoisted); + // Necessary to make sure the init is deoptimized for conditional declarations. + // We cannot call deoptimizePath here. + variable.markInitializersForDeoptimization(); + return variable; } else { return super.addDeclaration(identifier, context, init, false); @@ -5792,11 +7772,11 @@ class BlockScope extends ChildScope { } } -class ExpressionStatement$1 extends NodeBase { +class ExpressionStatement extends NodeBase { initialise() { if (this.directive && this.directive !== 'use strict' && - this.parent.type === Program) { + this.parent.type === Program$1) { this.context.warn( // This is necessary, because either way (deleting or not) can lead to errors. { @@ -5812,19 +7792,20 @@ class ExpressionStatement$1 extends NodeBase { } shouldBeIncluded(context) { if (this.directive && this.directive !== 'use strict') - return this.parent.type !== Program; + return this.parent.type !== Program$1; return super.shouldBeIncluded(context); } + applyDeoptimizations() { } } -class BlockStatement$1 extends NodeBase { +class BlockStatement extends NodeBase { constructor() { super(...arguments); this.directlyIncluded = false; } addImplicitReturnExpressionToScope() { const lastStatement = this.body[this.body.length - 1]; - if (!lastStatement || lastStatement.type !== ReturnStatement) { + if (!lastStatement || lastStatement.type !== ReturnStatement$1) { this.scope.addReturnExpression(UNKNOWN_EXPRESSION); } } @@ -5837,15 +7818,15 @@ class BlockStatement$1 extends NodeBase { if (this.deoptimizeBody) return true; for (const node of this.body) { - if (node.hasEffects(context)) - return true; if (context.brokenFlow) break; + if (node.hasEffects(context)) + return true; } return false; } include(context, includeChildrenRecursively) { - if (!this.deoptimizeBody || !this.directlyIncluded) { + if (!(this.deoptimizeBody && this.directlyIncluded)) { this.included = true; this.directlyIncluded = true; if (this.deoptimizeBody) @@ -5859,7 +7840,7 @@ class BlockStatement$1 extends NodeBase { initialise() { const firstBodyStatement = this.body[0]; this.deoptimizeBody = - firstBodyStatement instanceof ExpressionStatement$1 && + firstBodyStatement instanceof ExpressionStatement && firstBodyStatement.directive === 'use asm'; } render(code, options) { @@ -5872,132 +7853,337 @@ class BlockStatement$1 extends NodeBase { } } -class ArrowFunctionExpression$1 extends NodeBase { - createScope(parentScope) { - this.scope = new ReturnValueScope(parentScope, this.context); +class RestElement extends NodeBase { + constructor() { + super(...arguments); + this.declarationInit = null; + } + addExportedVariables(variables, exportNamesByVariable) { + this.argument.addExportedVariables(variables, exportNamesByVariable); + } + declare(kind, init) { + this.declarationInit = init; + return this.argument.declare(kind, UNKNOWN_EXPRESSION); + } + deoptimizePath(path) { + path.length === 0 && this.argument.deoptimizePath(EMPTY_PATH); + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + return (path.length > 0 || + this.argument.hasEffectsOnInteractionAtPath(EMPTY_PATH, interaction, context)); + } + markDeclarationReached() { + this.argument.markDeclarationReached(); + } + applyDeoptimizations() { + this.deoptimized = true; + if (this.declarationInit !== null) { + this.declarationInit.deoptimizePath([UnknownKey, UnknownKey]); + this.context.requestTreeshakingPass(); + } + } +} + +class FunctionBase extends NodeBase { + constructor() { + super(...arguments); + this.objectEntity = null; + this.deoptimizedReturn = false; } deoptimizePath(path) { - // A reassignment of UNKNOWN_PATH is considered equivalent to having lost track - // which means the return expression needs to be reassigned + this.getObjectEntity().deoptimizePath(path); if (path.length === 1 && path[0] === UnknownKey) { + // A reassignment of UNKNOWN_PATH is considered equivalent to having lost track + // which means the return expression needs to be reassigned this.scope.getReturnExpression().deoptimizePath(UNKNOWN_PATH); } } - getReturnExpressionWhenCalledAtPath(path) { - return path.length === 0 ? this.scope.getReturnExpression() : UNKNOWN_EXPRESSION; - } - hasEffects() { - return false; + deoptimizeThisOnInteractionAtPath(interaction, path, recursionTracker) { + if (path.length > 0) { + this.getObjectEntity().deoptimizeThisOnInteractionAtPath(interaction, path, recursionTracker); + } } - hasEffectsWhenAccessedAtPath(path) { - return path.length > 1; + getLiteralValueAtPath(path, recursionTracker, origin) { + return this.getObjectEntity().getLiteralValueAtPath(path, recursionTracker, origin); } - hasEffectsWhenAssignedAtPath(path) { - return path.length > 1; + getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin) { + if (path.length > 0) { + return this.getObjectEntity().getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin); + } + if (this.async) { + if (!this.deoptimizedReturn) { + this.deoptimizedReturn = true; + this.scope.getReturnExpression().deoptimizePath(UNKNOWN_PATH); + this.context.requestTreeshakingPass(); + } + return UNKNOWN_EXPRESSION; + } + return this.scope.getReturnExpression(); } - hasEffectsWhenCalledAtPath(path, _callOptions, context) { - if (path.length > 0) - return true; + hasEffectsOnInteractionAtPath(path, interaction, context) { + if (path.length > 0 || interaction.type !== INTERACTION_CALLED) { + return this.getObjectEntity().hasEffectsOnInteractionAtPath(path, interaction, context); + } + if (this.async) { + const { propertyReadSideEffects } = this.context.options + .treeshake; + const returnExpression = this.scope.getReturnExpression(); + if (returnExpression.hasEffectsOnInteractionAtPath(['then'], NODE_INTERACTION_UNKNOWN_CALL, context) || + (propertyReadSideEffects && + (propertyReadSideEffects === 'always' || + returnExpression.hasEffectsOnInteractionAtPath(['then'], NODE_INTERACTION_UNKNOWN_ACCESS, context)))) { + return true; + } + } for (const param of this.params) { if (param.hasEffects(context)) return true; } - const { ignore, brokenFlow } = context; - context.ignore = { - breaks: false, - continues: false, - labels: new Set(), - returnAwaitYield: true - }; - if (this.body.hasEffects(context)) - return true; - context.ignore = ignore; + return false; + } + include(context, includeChildrenRecursively) { + if (!this.deoptimized) + this.applyDeoptimizations(); + this.included = true; + const { brokenFlow } = context; + context.brokenFlow = BROKEN_FLOW_NONE; + this.body.include(context, includeChildrenRecursively); context.brokenFlow = brokenFlow; + } + includeCallArguments(context, args) { + this.scope.includeCallArguments(context, args); + } + initialise() { + this.scope.addParameterVariables(this.params.map(param => param.declare('parameter', UNKNOWN_EXPRESSION)), this.params[this.params.length - 1] instanceof RestElement); + if (this.body instanceof BlockStatement) { + this.body.addImplicitReturnExpressionToScope(); + } + else { + this.scope.addReturnExpression(this.body); + } + } + parseNode(esTreeNode) { + if (esTreeNode.body.type === BlockStatement$1) { + this.body = new BlockStatement(esTreeNode.body, this, this.scope.hoistedBodyVarScope); + } + super.parseNode(esTreeNode); + } + applyDeoptimizations() { } +} +FunctionBase.prototype.preventChildBlockScope = true; + +class ArrowFunctionExpression extends FunctionBase { + constructor() { + super(...arguments); + this.objectEntity = null; + } + createScope(parentScope) { + this.scope = new ReturnValueScope(parentScope, this.context); + } + hasEffects() { + if (!this.deoptimized) + this.applyDeoptimizations(); + return false; + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + if (super.hasEffectsOnInteractionAtPath(path, interaction, context)) + return true; + if (interaction.type === INTERACTION_CALLED) { + const { ignore, brokenFlow } = context; + context.ignore = { + breaks: false, + continues: false, + labels: new Set(), + returnYield: true + }; + if (this.body.hasEffects(context)) + return true; + context.ignore = ignore; + context.brokenFlow = brokenFlow; + } return false; } - include(context, includeChildrenRecursively) { - this.included = true; - for (const param of this.params) { - if (!(param instanceof Identifier$1)) { - param.include(context, includeChildrenRecursively); + include(context, includeChildrenRecursively) { + super.include(context, includeChildrenRecursively); + for (const param of this.params) { + if (!(param instanceof Identifier)) { + param.include(context, includeChildrenRecursively); + } + } + } + getObjectEntity() { + if (this.objectEntity !== null) { + return this.objectEntity; + } + return (this.objectEntity = new ObjectEntity([], OBJECT_PROTOTYPE)); + } +} + +function getSystemExportStatement(exportedVariables, { exportNamesByVariable, snippets: { _, getObject, getPropertyAccess } }, modifier = '') { + if (exportedVariables.length === 1 && + exportNamesByVariable.get(exportedVariables[0]).length === 1) { + const variable = exportedVariables[0]; + return `exports('${exportNamesByVariable.get(variable)}',${_}${variable.getName(getPropertyAccess)}${modifier})`; + } + else { + const fields = []; + for (const variable of exportedVariables) { + for (const exportName of exportNamesByVariable.get(variable)) { + fields.push([exportName, variable.getName(getPropertyAccess) + modifier]); + } + } + return `exports(${getObject(fields, { lineBreakIndent: null })})`; + } +} +function renderSystemExportExpression(exportedVariable, expressionStart, expressionEnd, code, { exportNamesByVariable, snippets: { _ } }) { + code.prependRight(expressionStart, `exports('${exportNamesByVariable.get(exportedVariable)}',${_}`); + code.appendLeft(expressionEnd, ')'); +} +function renderSystemExportFunction(exportedVariables, expressionStart, expressionEnd, needsParens, code, options) { + const { _, getDirectReturnIifeLeft } = options.snippets; + code.prependRight(expressionStart, getDirectReturnIifeLeft(['v'], `${getSystemExportStatement(exportedVariables, options)},${_}v`, { needsArrowReturnParens: true, needsWrappedFunction: needsParens })); + code.appendLeft(expressionEnd, ')'); +} +function renderSystemExportSequenceAfterExpression(exportedVariable, expressionStart, expressionEnd, needsParens, code, options) { + const { _, getPropertyAccess } = options.snippets; + code.appendLeft(expressionEnd, `,${_}${getSystemExportStatement([exportedVariable], options)},${_}${exportedVariable.getName(getPropertyAccess)}`); + if (needsParens) { + code.prependRight(expressionStart, '('); + code.appendLeft(expressionEnd, ')'); + } +} +function renderSystemExportSequenceBeforeExpression(exportedVariable, expressionStart, expressionEnd, needsParens, code, options, modifier) { + const { _ } = options.snippets; + code.prependRight(expressionStart, `${getSystemExportStatement([exportedVariable], options, modifier)},${_}`); + if (needsParens) { + code.prependRight(expressionStart, '('); + code.appendLeft(expressionEnd, ')'); + } +} + +class ObjectPattern extends NodeBase { + addExportedVariables(variables, exportNamesByVariable) { + for (const property of this.properties) { + if (property.type === Property$1) { + property.value.addExportedVariables(variables, exportNamesByVariable); + } + else { + property.argument.addExportedVariables(variables, exportNamesByVariable); } } - const { brokenFlow } = context; - context.brokenFlow = BROKEN_FLOW_NONE; - this.body.include(context, includeChildrenRecursively); - context.brokenFlow = brokenFlow; } - includeCallArguments(context, args) { - this.scope.includeCallArguments(context, args); + declare(kind, init) { + const variables = []; + for (const property of this.properties) { + variables.push(...property.declare(kind, init)); + } + return variables; } - initialise() { - this.scope.addParameterVariables(this.params.map(param => param.declare('parameter', UNKNOWN_EXPRESSION)), this.params[this.params.length - 1] instanceof RestElement); - if (this.body instanceof BlockStatement$1) { - this.body.addImplicitReturnExpressionToScope(); + deoptimizePath(path) { + if (path.length === 0) { + for (const property of this.properties) { + property.deoptimizePath(path); + } } - else { - this.scope.addReturnExpression(this.body); + } + hasEffectsOnInteractionAtPath( + // At the moment, this is only triggered for assignment left-hand sides, + // where the path is empty + _path, interaction, context) { + for (const property of this.properties) { + if (property.hasEffectsOnInteractionAtPath(EMPTY_PATH, interaction, context)) + return true; } + return false; } - parseNode(esTreeNode) { - if (esTreeNode.body.type === BlockStatement) { - this.body = new this.context.nodeConstructors.BlockStatement(esTreeNode.body, this, this.scope.hoistedBodyVarScope); + markDeclarationReached() { + for (const property of this.properties) { + property.markDeclarationReached(); } - super.parseNode(esTreeNode); } } -ArrowFunctionExpression$1.prototype.preventChildBlockScope = true; class AssignmentExpression extends NodeBase { - constructor() { - super(...arguments); - this.deoptimized = false; - } hasEffects(context) { - if (!this.deoptimized) + const { deoptimized, left, right } = this; + if (!deoptimized) this.applyDeoptimizations(); - return (this.right.hasEffects(context) || - this.left.hasEffects(context) || - this.left.hasEffectsWhenAssignedAtPath(EMPTY_PATH, context)); + // MemberExpressions do not access the property before assignments if the + // operator is '='. + return (right.hasEffects(context) || left.hasEffectsAsAssignmentTarget(context, this.operator !== '=')); } - hasEffectsWhenAccessedAtPath(path, context) { - return path.length > 0 && this.right.hasEffectsWhenAccessedAtPath(path, context); + hasEffectsOnInteractionAtPath(path, interaction, context) { + return this.right.hasEffectsOnInteractionAtPath(path, interaction, context); } include(context, includeChildrenRecursively) { - if (!this.deoptimized) + const { deoptimized, left, right, operator } = this; + if (!deoptimized) this.applyDeoptimizations(); this.included = true; - this.left.include(context, includeChildrenRecursively); - this.right.include(context, includeChildrenRecursively); + if (includeChildrenRecursively || + operator !== '=' || + left.included || + left.hasEffectsAsAssignmentTarget(createHasEffectsContext(), false)) { + left.includeAsAssignmentTarget(context, includeChildrenRecursively, operator !== '='); + } + right.include(context, includeChildrenRecursively); } - render(code, options) { - this.left.render(code, options); - this.right.render(code, options); + initialise() { + this.left.setAssignedValue(this.right); + } + render(code, options, { preventASI, renderedParentType, renderedSurroundingElement } = BLANK) { + const { left, right, start, end, parent } = this; + if (left.included) { + left.render(code, options); + right.render(code, options); + } + else { + const inclusionStart = findNonWhiteSpace(code.original, findFirstOccurrenceOutsideComment(code.original, '=', left.end) + 1); + code.remove(start, inclusionStart); + if (preventASI) { + removeLineBreaks(code, inclusionStart, right.start); + } + right.render(code, options, { + renderedParentType: renderedParentType || parent.type, + renderedSurroundingElement: renderedSurroundingElement || parent.type + }); + } if (options.format === 'system') { - const exportNames = this.left.variable && options.exportNamesByVariable.get(this.left.variable); - if (this.left.type === 'Identifier' && exportNames) { - const _ = options.compact ? '' : ' '; - const operatorPos = findFirstOccurrenceOutsideComment(code.original, this.operator, this.left.end); - const operation = this.operator.length > 1 ? `${exportNames[0]}${_}${this.operator.slice(0, -1)}${_}` : ''; - code.overwrite(operatorPos, findNonWhiteSpace(code.original, operatorPos + this.operator.length), `=${_}${exportNames.length === 1 - ? `exports('${exportNames[0]}',${_}` - : getSystemExportFunctionLeft([this.left.variable], false, options)}${operation}`); - code.appendLeft(this.right.end, ')'); + if (left instanceof Identifier) { + const variable = left.variable; + const exportNames = options.exportNamesByVariable.get(variable); + if (exportNames) { + if (exportNames.length === 1) { + renderSystemExportExpression(variable, start, end, code, options); + } + else { + renderSystemExportSequenceAfterExpression(variable, start, end, parent.type !== ExpressionStatement$1, code, options); + } + return; + } } else { const systemPatternExports = []; - this.left.addExportedVariables(systemPatternExports, options.exportNamesByVariable); + left.addExportedVariables(systemPatternExports, options.exportNamesByVariable); if (systemPatternExports.length > 0) { - code.prependRight(this.start, getSystemExportFunctionLeft(systemPatternExports, true, options)); - code.appendLeft(this.end, ')'); + renderSystemExportFunction(systemPatternExports, start, end, renderedSurroundingElement === ExpressionStatement$1, code, options); + return; } } } + if (left.included && + left instanceof ObjectPattern && + (renderedSurroundingElement === ExpressionStatement$1 || + renderedSurroundingElement === ArrowFunctionExpression$1)) { + code.appendRight(start, '('); + code.prependLeft(end, ')'); + } } applyDeoptimizations() { this.deoptimized = true; this.left.deoptimizePath(EMPTY_PATH); this.right.deoptimizePath(UNKNOWN_PATH); + this.context.requestTreeshakingPass(); } } @@ -6005,37 +8191,201 @@ class AssignmentPattern extends NodeBase { addExportedVariables(variables, exportNamesByVariable) { this.left.addExportedVariables(variables, exportNamesByVariable); } - bind() { - super.bind(); - this.left.deoptimizePath(EMPTY_PATH); - this.right.deoptimizePath(UNKNOWN_PATH); - } declare(kind, init) { return this.left.declare(kind, init); } deoptimizePath(path) { path.length === 0 && this.left.deoptimizePath(path); } - hasEffectsWhenAssignedAtPath(path, context) { - return path.length > 0 || this.left.hasEffectsWhenAssignedAtPath(EMPTY_PATH, context); + hasEffectsOnInteractionAtPath(path, interaction, context) { + return (path.length > 0 || this.left.hasEffectsOnInteractionAtPath(EMPTY_PATH, interaction, context)); + } + markDeclarationReached() { + this.left.markDeclarationReached(); } render(code, options, { isShorthandProperty } = BLANK) { this.left.render(code, options, { isShorthandProperty }); this.right.render(code, options); } + applyDeoptimizations() { + this.deoptimized = true; + this.left.deoptimizePath(EMPTY_PATH); + this.right.deoptimizePath(UNKNOWN_PATH); + this.context.requestTreeshakingPass(); + } } -class AwaitExpression extends NodeBase { +class ArgumentsVariable extends LocalVariable { + constructor(context) { + super('arguments', null, UNKNOWN_EXPRESSION, context); + } + hasEffectsOnInteractionAtPath(path, { type }) { + return type !== INTERACTION_ACCESSED || path.length > 1; + } +} + +class ThisVariable extends LocalVariable { + constructor(context) { + super('this', null, null, context); + this.deoptimizedPaths = []; + this.entitiesToBeDeoptimized = new Set(); + this.thisDeoptimizationList = []; + this.thisDeoptimizations = new DiscriminatedPathTracker(); + } + addEntityToBeDeoptimized(entity) { + for (const path of this.deoptimizedPaths) { + entity.deoptimizePath(path); + } + for (const { interaction, path } of this.thisDeoptimizationList) { + entity.deoptimizeThisOnInteractionAtPath(interaction, path, SHARED_RECURSION_TRACKER); + } + this.entitiesToBeDeoptimized.add(entity); + } + deoptimizePath(path) { + if (path.length === 0 || + this.deoptimizationTracker.trackEntityAtPathAndGetIfTracked(path, this)) { + return; + } + this.deoptimizedPaths.push(path); + for (const entity of this.entitiesToBeDeoptimized) { + entity.deoptimizePath(path); + } + } + deoptimizeThisOnInteractionAtPath(interaction, path) { + const thisDeoptimization = { + interaction, + path + }; + if (!this.thisDeoptimizations.trackEntityAtPathAndGetIfTracked(path, interaction.type, interaction.thisArg)) { + for (const entity of this.entitiesToBeDeoptimized) { + entity.deoptimizeThisOnInteractionAtPath(interaction, path, SHARED_RECURSION_TRACKER); + } + this.thisDeoptimizationList.push(thisDeoptimization); + } + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + return (this.getInit(context).hasEffectsOnInteractionAtPath(path, interaction, context) || + super.hasEffectsOnInteractionAtPath(path, interaction, context)); + } + getInit(context) { + return context.replacedVariableInits.get(this) || UNKNOWN_EXPRESSION; + } +} + +class FunctionScope extends ReturnValueScope { + constructor(parent, context) { + super(parent, context); + this.variables.set('arguments', (this.argumentsVariable = new ArgumentsVariable(context))); + this.variables.set('this', (this.thisVariable = new ThisVariable(context))); + } + findLexicalBoundary() { + return this; + } + includeCallArguments(context, args) { + super.includeCallArguments(context, args); + if (this.argumentsVariable.included) { + for (const arg of args) { + if (!arg.included) { + arg.include(context, false); + } + } + } + } +} + +class FunctionNode extends FunctionBase { + constructor() { + super(...arguments); + this.objectEntity = null; + } + createScope(parentScope) { + this.scope = new FunctionScope(parentScope, this.context); + } + deoptimizeThisOnInteractionAtPath(interaction, path, recursionTracker) { + super.deoptimizeThisOnInteractionAtPath(interaction, path, recursionTracker); + if (interaction.type === INTERACTION_CALLED && path.length === 0) { + this.scope.thisVariable.addEntityToBeDeoptimized(interaction.thisArg); + } + } hasEffects(context) { - return !context.ignore.returnAwaitYield || this.argument.hasEffects(context); + var _a; + if (!this.deoptimized) + this.applyDeoptimizations(); + return !!((_a = this.id) === null || _a === void 0 ? void 0 : _a.hasEffects(context)); + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + if (super.hasEffectsOnInteractionAtPath(path, interaction, context)) + return true; + if (interaction.type === INTERACTION_CALLED) { + const thisInit = context.replacedVariableInits.get(this.scope.thisVariable); + context.replacedVariableInits.set(this.scope.thisVariable, interaction.withNew + ? new ObjectEntity(Object.create(null), OBJECT_PROTOTYPE) + : UNKNOWN_EXPRESSION); + const { brokenFlow, ignore } = context; + context.ignore = { + breaks: false, + continues: false, + labels: new Set(), + returnYield: true + }; + if (this.body.hasEffects(context)) + return true; + context.brokenFlow = brokenFlow; + if (thisInit) { + context.replacedVariableInits.set(this.scope.thisVariable, thisInit); + } + else { + context.replacedVariableInits.delete(this.scope.thisVariable); + } + context.ignore = ignore; + } + return false; + } + include(context, includeChildrenRecursively) { + var _a; + super.include(context, includeChildrenRecursively); + (_a = this.id) === null || _a === void 0 ? void 0 : _a.include(); + const hasArguments = this.scope.argumentsVariable.included; + for (const param of this.params) { + if (!(param instanceof Identifier) || hasArguments) { + param.include(context, includeChildrenRecursively); + } + } + } + initialise() { + var _a; + super.initialise(); + (_a = this.id) === null || _a === void 0 ? void 0 : _a.declare('function', this); + } + getObjectEntity() { + if (this.objectEntity !== null) { + return this.objectEntity; + } + return (this.objectEntity = new ObjectEntity([ + { + key: 'prototype', + kind: 'init', + property: new ObjectEntity([], OBJECT_PROTOTYPE) + } + ], OBJECT_PROTOTYPE)); + } +} + +class AwaitExpression extends NodeBase { + hasEffects() { + if (!this.deoptimized) + this.applyDeoptimizations(); + return true; } include(context, includeChildrenRecursively) { + if (!this.deoptimized) + this.applyDeoptimizations(); if (!this.included) { this.included = true; checkTopLevelAwait: if (!this.context.usesTopLevelAwait) { let parent = this.parent; do { - if (parent instanceof FunctionNode || parent instanceof ArrowFunctionExpression$1) + if (parent instanceof FunctionNode || parent instanceof ArrowFunctionExpression) break checkTopLevelAwait; } while ((parent = parent.parent)); this.context.usesTopLevelAwait = true; @@ -6066,9 +8416,10 @@ const binaryOperators = { '>>': (left, right) => left >> right, '>>>': (left, right) => left >>> right, '^': (left, right) => left ^ right, - in: () => UnknownValue, - instanceof: () => UnknownValue, '|': (left, right) => left | right + // We use the fallback for cases where we return something unknown + // in: () => UnknownValue, + // instanceof: () => UnknownValue, }; class BinaryExpression extends NodeBase { deoptimizeCache() { } @@ -6076,10 +8427,10 @@ class BinaryExpression extends NodeBase { if (path.length > 0) return UnknownValue; const leftValue = this.left.getLiteralValueAtPath(EMPTY_PATH, recursionTracker, origin); - if (leftValue === UnknownValue) + if (typeof leftValue === 'symbol') return UnknownValue; const rightValue = this.right.getLiteralValueAtPath(EMPTY_PATH, recursionTracker, origin); - if (rightValue === UnknownValue) + if (typeof rightValue === 'symbol') return UnknownValue; const operatorFn = binaryOperators[this.operator]; if (!operatorFn) @@ -6089,13 +8440,18 @@ class BinaryExpression extends NodeBase { hasEffects(context) { // support some implicit type coercion runtime errors if (this.operator === '+' && - this.parent instanceof ExpressionStatement$1 && - this.left.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, this) === '') + this.parent instanceof ExpressionStatement && + this.left.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, this) === '') { return true; + } return super.hasEffects(context); } - hasEffectsWhenAccessedAtPath(path) { - return path.length > 1; + hasEffectsOnInteractionAtPath(path, { type }) { + return type !== INTERACTION_ACCESSED || path.length > 1; + } + render(code, options, { renderedSurroundingElement } = BLANK) { + this.left.render(code, options, { renderedSurroundingElement }); + this.right.render(code, options); } } @@ -6124,7 +8480,33 @@ class BreakStatement extends NodeBase { } } +function renderCallArguments(code, options, node) { + if (node.arguments.length > 0) { + if (node.arguments[node.arguments.length - 1].included) { + for (const arg of node.arguments) { + arg.render(code, options); + } + } + else { + let lastIncludedIndex = node.arguments.length - 2; + while (lastIncludedIndex >= 0 && !node.arguments[lastIncludedIndex].included) { + lastIncludedIndex--; + } + if (lastIncludedIndex >= 0) { + for (let index = 0; index <= lastIncludedIndex; index++) { + node.arguments[index].render(code, options); + } + code.remove(findFirstOccurrenceOutsideComment(code.original, ',', node.arguments[lastIncludedIndex].end), node.end - 1); + } + else { + code.remove(findFirstOccurrenceOutsideComment(code.original, '(', node.callee.end) + 1, node.end - 1); + } + } + } +} + class Literal extends NodeBase { + deoptimizeThisOnInteractionAtPath() { } getLiteralValueAtPath(path) { if (path.length > 0 || // unknown literals can also be null but do not start with an "n" @@ -6141,20 +8523,16 @@ class Literal extends NodeBase { return UNKNOWN_EXPRESSION; return getMemberReturnExpressionWhenCalled(this.members, path[0]); } - hasEffectsWhenAccessedAtPath(path) { - if (this.value === null) { - return path.length > 0; - } - return path.length > 1; - } - hasEffectsWhenAssignedAtPath(path) { - return path.length > 0; - } - hasEffectsWhenCalledAtPath(path, callOptions, context) { - if (path.length === 1) { - return hasMemberEffectWhenCalled(this.members, path[0], this.included, callOptions, context); + hasEffectsOnInteractionAtPath(path, interaction, context) { + switch (interaction.type) { + case INTERACTION_ACCESSED: + return path.length > (this.value === null ? 0 : 1); + case INTERACTION_ASSIGNED: + return true; + case INTERACTION_CALLED: + return (path.length !== 1 || + hasMemberEffectWhenCalled(this.members, path[0], interaction, context)); } - return true; } initialise() { this.members = getLiteralMembersForValue(this.value); @@ -6171,6 +8549,8 @@ class Literal extends NodeBase { } } +// To avoid infinite recursions +const MAX_PATH_DEPTH = 7; function getResolvablePropertyKey(memberExpression) { return memberExpression.computed ? getResolvableComputedPropertyKey(memberExpression.property) @@ -6186,7 +8566,7 @@ function getPathIfNotComputed(memberExpression) { const nextPathKey = memberExpression.propertyKey; const object = memberExpression.object; if (typeof nextPathKey === 'string') { - if (object instanceof Identifier$1) { + if (object instanceof Identifier) { return [ { key: object.name, pos: object.start }, { key: nextPathKey, pos: memberExpression.property.start } @@ -6210,20 +8590,17 @@ class MemberExpression extends NodeBase { constructor() { super(...arguments); this.variable = null; + this.assignmentDeoptimized = false; this.bound = false; this.expressionsToBeDeoptimized = []; this.replacement = null; - this.wasPathDeoptimizedWhileOptimized = false; } - addExportedVariables() { } bind() { - if (this.bound) - return; this.bound = true; const path = getPathIfNotComputed(this); const baseVariable = path && this.scope.findVariable(path[0].key); if (baseVariable && baseVariable.isNamespace) { - const resolvedVariable = this.resolveNamespaceVariables(baseVariable, path.slice(1)); + const resolvedVariable = resolveNamespaceVariables(baseVariable, path.slice(1), this.context); if (!resolvedVariable) { super.bind(); } @@ -6231,102 +8608,121 @@ class MemberExpression extends NodeBase { this.replacement = resolvedVariable; } else { - if (resolvedVariable instanceof ExternalVariable && resolvedVariable.module) { - resolvedVariable.module.suggestName(path[0].key); - } this.variable = resolvedVariable; this.scope.addNamespaceMemberAccess(getStringFromPath(path), resolvedVariable); } } else { super.bind(); - // ensure the propertyKey is set for the tree-shaking passes - this.getPropertyKey(); } } deoptimizeCache() { const expressionsToBeDeoptimized = this.expressionsToBeDeoptimized; this.expressionsToBeDeoptimized = []; this.propertyKey = UnknownKey; - if (this.wasPathDeoptimizedWhileOptimized) { - this.object.deoptimizePath(UNKNOWN_PATH); - } + this.object.deoptimizePath(UNKNOWN_PATH); for (const expression of expressionsToBeDeoptimized) { expression.deoptimizeCache(); } } deoptimizePath(path) { - if (!this.bound) - this.bind(); if (path.length === 0) this.disallowNamespaceReassignment(); if (this.variable) { this.variable.deoptimizePath(path); } - else { - const propertyKey = this.getPropertyKey(); - if (propertyKey === UnknownKey) { - this.object.deoptimizePath(UNKNOWN_PATH); + else if (!this.replacement) { + if (path.length < MAX_PATH_DEPTH) { + const propertyKey = this.getPropertyKey(); + this.object.deoptimizePath([ + propertyKey === UnknownKey ? UnknownNonAccessorKey : propertyKey, + ...path + ]); + } + } + } + deoptimizeThisOnInteractionAtPath(interaction, path, recursionTracker) { + if (this.variable) { + this.variable.deoptimizeThisOnInteractionAtPath(interaction, path, recursionTracker); + } + else if (!this.replacement) { + if (path.length < MAX_PATH_DEPTH) { + this.object.deoptimizeThisOnInteractionAtPath(interaction, [this.getPropertyKey(), ...path], recursionTracker); } else { - this.wasPathDeoptimizedWhileOptimized = true; - this.object.deoptimizePath([propertyKey, ...path]); + interaction.thisArg.deoptimizePath(UNKNOWN_PATH); } } } getLiteralValueAtPath(path, recursionTracker, origin) { - if (!this.bound) - this.bind(); - if (this.variable !== null) { + if (this.variable) { return this.variable.getLiteralValueAtPath(path, recursionTracker, origin); } + if (this.replacement) { + return UnknownValue; + } this.expressionsToBeDeoptimized.push(origin); - return this.object.getLiteralValueAtPath([this.getPropertyKey(), ...path], recursionTracker, origin); + if (path.length < MAX_PATH_DEPTH) { + return this.object.getLiteralValueAtPath([this.getPropertyKey(), ...path], recursionTracker, origin); + } + return UnknownValue; } - getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin) { - if (!this.bound) - this.bind(); - if (this.variable !== null) { - return this.variable.getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin); + getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin) { + if (this.variable) { + return this.variable.getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin); + } + if (this.replacement) { + return UNKNOWN_EXPRESSION; } this.expressionsToBeDeoptimized.push(origin); - return this.object.getReturnExpressionWhenCalledAtPath([this.getPropertyKey(), ...path], recursionTracker, origin); + if (path.length < MAX_PATH_DEPTH) { + return this.object.getReturnExpressionWhenCalledAtPath([this.getPropertyKey(), ...path], interaction, recursionTracker, origin); + } + return UNKNOWN_EXPRESSION; } hasEffects(context) { + if (!this.deoptimized) + this.applyDeoptimizations(); return (this.property.hasEffects(context) || this.object.hasEffects(context) || - (this.context.options.treeshake.propertyReadSideEffects && - this.object.hasEffectsWhenAccessedAtPath([this.propertyKey], context))); + this.hasAccessEffect(context)); } - hasEffectsWhenAccessedAtPath(path, context) { - if (path.length === 0) - return false; - if (this.variable !== null) { - return this.variable.hasEffectsWhenAccessedAtPath(path, context); - } - return this.object.hasEffectsWhenAccessedAtPath([this.propertyKey, ...path], context); + hasEffectsAsAssignmentTarget(context, checkAccess) { + if (checkAccess && !this.deoptimized) + this.applyDeoptimizations(); + if (!this.assignmentDeoptimized) + this.applyAssignmentDeoptimization(); + return (this.property.hasEffects(context) || + this.object.hasEffects(context) || + (checkAccess && this.hasAccessEffect(context)) || + this.hasEffectsOnInteractionAtPath(EMPTY_PATH, this.assignmentInteraction, context)); } - hasEffectsWhenAssignedAtPath(path, context) { - if (this.variable !== null) { - return this.variable.hasEffectsWhenAssignedAtPath(path, context); + hasEffectsOnInteractionAtPath(path, interaction, context) { + if (this.variable) { + return this.variable.hasEffectsOnInteractionAtPath(path, interaction, context); } - return this.object.hasEffectsWhenAssignedAtPath([this.propertyKey, ...path], context); - } - hasEffectsWhenCalledAtPath(path, callOptions, context) { - if (this.variable !== null) { - return this.variable.hasEffectsWhenCalledAtPath(path, callOptions, context); + if (this.replacement) { + return true; + } + if (path.length < MAX_PATH_DEPTH) { + return this.object.hasEffectsOnInteractionAtPath([this.getPropertyKey(), ...path], interaction, context); } - return this.object.hasEffectsWhenCalledAtPath([this.propertyKey, ...path], callOptions, context); + return true; } include(context, includeChildrenRecursively) { - if (!this.included) { - this.included = true; - if (this.variable !== null) { - this.context.includeVariable(this.variable); - } + if (!this.deoptimized) + this.applyDeoptimizations(); + this.includeProperties(context, includeChildrenRecursively); + } + includeAsAssignmentTarget(context, includeChildrenRecursively, deoptimizeAccess) { + if (!this.assignmentDeoptimized) + this.applyAssignmentDeoptimization(); + if (deoptimizeAccess) { + this.include(context, includeChildrenRecursively); + } + else { + this.includeProperties(context, includeChildrenRecursively); } - this.object.include(context, includeChildrenRecursively); - this.property.include(context, includeChildrenRecursively); } includeCallArguments(context, args) { if (this.variable) { @@ -6338,12 +8734,13 @@ class MemberExpression extends NodeBase { } initialise() { this.propertyKey = getResolvablePropertyKey(this); + this.accessInteraction = { thisArg: this.object, type: INTERACTION_ACCESSED }; } - render(code, options, { renderedParentType, isCalleeOfRenderedParent } = BLANK) { - const isCalleeOfDifferentParent = renderedParentType === CallExpression && isCalleeOfRenderedParent; + render(code, options, { renderedParentType, isCalleeOfRenderedParent, renderedSurroundingElement } = BLANK) { if (this.variable || this.replacement) { - let replacement = this.variable ? this.variable.getName() : this.replacement; - if (isCalleeOfDifferentParent) + const { snippets: { getPropertyAccess } } = options; + let replacement = this.variable ? this.variable.getName(getPropertyAccess) : this.replacement; + if (renderedParentType && isCalleeOfRenderedParent) replacement = '0, ' + replacement; code.overwrite(this.start, this.end, replacement, { contentOnly: true, @@ -6351,18 +8748,53 @@ class MemberExpression extends NodeBase { }); } else { - if (isCalleeOfDifferentParent) { + if (renderedParentType && isCalleeOfRenderedParent) { code.appendRight(this.start, '0, '); } - super.render(code, options); + this.object.render(code, options, { renderedSurroundingElement }); + this.property.render(code, options); + } + } + setAssignedValue(value) { + this.assignmentInteraction = { + args: [value], + thisArg: this.object, + type: INTERACTION_ASSIGNED + }; + } + applyDeoptimizations() { + this.deoptimized = true; + const { propertyReadSideEffects } = this.context.options + .treeshake; + if ( + // Namespaces are not bound and should not be deoptimized + this.bound && + propertyReadSideEffects && + !(this.variable || this.replacement)) { + const propertyKey = this.getPropertyKey(); + this.object.deoptimizeThisOnInteractionAtPath(this.accessInteraction, [propertyKey], SHARED_RECURSION_TRACKER); + this.context.requestTreeshakingPass(); + } + } + applyAssignmentDeoptimization() { + this.assignmentDeoptimized = true; + const { propertyReadSideEffects } = this.context.options + .treeshake; + if ( + // Namespaces are not bound and should not be deoptimized + this.bound && + propertyReadSideEffects && + !(this.variable || this.replacement)) { + this.object.deoptimizeThisOnInteractionAtPath(this.assignmentInteraction, [this.getPropertyKey()], SHARED_RECURSION_TRACKER); + this.context.requestTreeshakingPass(); } } disallowNamespaceReassignment() { - if (this.object instanceof Identifier$1) { + if (this.object instanceof Identifier) { const variable = this.scope.findVariable(this.object.name); if (variable.isNamespace) { if (this.variable) { - this.context.includeVariable(this.variable); + this.context.includeVariableInModule(this.variable); } this.context.warn({ code: 'ILLEGAL_NAMESPACE_REASSIGNMENT', @@ -6375,178 +8807,181 @@ class MemberExpression extends NodeBase { if (this.propertyKey === null) { this.propertyKey = UnknownKey; const value = this.property.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, this); - return (this.propertyKey = value === UnknownValue ? UnknownKey : String(value)); + return (this.propertyKey = typeof value === 'symbol' ? UnknownKey : String(value)); } return this.propertyKey; } - resolveNamespaceVariables(baseVariable, path) { - if (path.length === 0) - return baseVariable; - if (!baseVariable.isNamespace) - return null; - const exportName = path[0].key; - const variable = baseVariable instanceof ExternalVariable - ? baseVariable.module.getVariableForExportName(exportName) - : baseVariable.context.traceExport(exportName); - if (!variable) { - const fileName = baseVariable instanceof ExternalVariable - ? baseVariable.module.id - : baseVariable.context.fileName; - this.context.warn({ - code: 'MISSING_EXPORT', - exporter: relativeId(fileName), - importer: relativeId(this.context.fileName), - message: `'${exportName}' is not exported by '${relativeId(fileName)}'`, - missing: exportName, - url: `https://rollupjs.org/guide/en/#error-name-is-not-exported-by-module` - }, path[0].pos); - return 'undefined'; + hasAccessEffect(context) { + const { propertyReadSideEffects } = this.context.options + .treeshake; + return (!(this.variable || this.replacement) && + propertyReadSideEffects && + (propertyReadSideEffects === 'always' || + this.object.hasEffectsOnInteractionAtPath([this.getPropertyKey()], this.accessInteraction, context))); + } + includeProperties(context, includeChildrenRecursively) { + if (!this.included) { + this.included = true; + if (this.variable) { + this.context.includeVariableInModule(this.variable); + } } - return this.resolveNamespaceVariables(variable, path.slice(1)); + this.object.include(context, includeChildrenRecursively); + this.property.include(context, includeChildrenRecursively); } } - -class CallExpression$1 extends NodeBase { +function resolveNamespaceVariables(baseVariable, path, astContext) { + if (path.length === 0) + return baseVariable; + if (!baseVariable.isNamespace || baseVariable instanceof ExternalVariable) + return null; + const exportName = path[0].key; + const variable = baseVariable.context.traceExport(exportName); + if (!variable) { + const fileName = baseVariable.context.fileName; + astContext.warn({ + code: 'MISSING_EXPORT', + exporter: relativeId(fileName), + importer: relativeId(astContext.fileName), + message: `'${exportName}' is not exported by '${relativeId(fileName)}'`, + missing: exportName, + url: `https://rollupjs.org/guide/en/#error-name-is-not-exported-by-module` + }, path[0].pos); + return 'undefined'; + } + return resolveNamespaceVariables(variable, path.slice(1), astContext); +} + +class CallExpressionBase extends NodeBase { constructor() { super(...arguments); - this.expressionsToBeDeoptimized = []; this.returnExpression = null; - this.wasPathDeoptmizedWhileOptimized = false; - } - bind() { - super.bind(); - if (this.callee instanceof Identifier$1) { - const variable = this.scope.findVariable(this.callee.name); - if (variable.isNamespace) { - this.context.warn({ - code: 'CANNOT_CALL_NAMESPACE', - message: `Cannot call a namespace ('${this.callee.name}')` - }, this.start); - } - if (this.callee.name === 'eval') { - this.context.warn({ - code: 'EVAL', - message: `Use of eval is strongly discouraged, as it poses security risks and may cause issues with minification`, - url: 'https://rollupjs.org/guide/en/#avoiding-eval' - }, this.start); - } - } - // ensure the returnExpression is set for the tree-shaking passes - this.getReturnExpression(SHARED_RECURSION_TRACKER); - // This deoptimizes "this" for non-namespace calls until we have a better solution - if (this.callee instanceof MemberExpression && !this.callee.variable) { - this.callee.object.deoptimizePath(UNKNOWN_PATH); - } - for (const argument of this.arguments) { - // This will make sure all properties of parameters behave as "unknown" - argument.deoptimizePath(UNKNOWN_PATH); - } + this.deoptimizableDependentExpressions = []; + this.expressionsToBeDeoptimized = new Set(); } deoptimizeCache() { if (this.returnExpression !== UNKNOWN_EXPRESSION) { - this.returnExpression = null; - const returnExpression = this.getReturnExpression(SHARED_RECURSION_TRACKER); - const expressionsToBeDeoptimized = this.expressionsToBeDeoptimized; - if (returnExpression !== UNKNOWN_EXPRESSION) { - // We need to replace here because is possible new expressions are added - // while we are deoptimizing the old ones - this.expressionsToBeDeoptimized = []; - if (this.wasPathDeoptmizedWhileOptimized) { - returnExpression.deoptimizePath(UNKNOWN_PATH); - this.wasPathDeoptmizedWhileOptimized = false; - } - } - for (const expression of expressionsToBeDeoptimized) { + this.returnExpression = UNKNOWN_EXPRESSION; + for (const expression of this.deoptimizableDependentExpressions) { expression.deoptimizeCache(); } + for (const expression of this.expressionsToBeDeoptimized) { + expression.deoptimizePath(UNKNOWN_PATH); + } } } deoptimizePath(path) { - if (path.length === 0) - return; - const trackedEntities = this.context.deoptimizationTracker.getEntities(path); - if (trackedEntities.has(this)) + if (path.length === 0 || + this.context.deoptimizationTracker.trackEntityAtPathAndGetIfTracked(path, this)) { return; - trackedEntities.add(this); - const returnExpression = this.getReturnExpression(SHARED_RECURSION_TRACKER); + } + const returnExpression = this.getReturnExpression(); if (returnExpression !== UNKNOWN_EXPRESSION) { - this.wasPathDeoptmizedWhileOptimized = true; returnExpression.deoptimizePath(path); } } - getLiteralValueAtPath(path, recursionTracker, origin) { + deoptimizeThisOnInteractionAtPath(interaction, path, recursionTracker) { const returnExpression = this.getReturnExpression(recursionTracker); if (returnExpression === UNKNOWN_EXPRESSION) { - return UnknownValue; + interaction.thisArg.deoptimizePath(UNKNOWN_PATH); + } + else { + recursionTracker.withTrackedEntityAtPath(path, returnExpression, () => { + this.expressionsToBeDeoptimized.add(interaction.thisArg); + returnExpression.deoptimizeThisOnInteractionAtPath(interaction, path, recursionTracker); + }, undefined); } - const trackedEntities = recursionTracker.getEntities(path); - if (trackedEntities.has(returnExpression)) { + } + getLiteralValueAtPath(path, recursionTracker, origin) { + const returnExpression = this.getReturnExpression(recursionTracker); + if (returnExpression === UNKNOWN_EXPRESSION) { return UnknownValue; } - this.expressionsToBeDeoptimized.push(origin); - trackedEntities.add(returnExpression); - const value = returnExpression.getLiteralValueAtPath(path, recursionTracker, origin); - trackedEntities.delete(returnExpression); - return value; + return recursionTracker.withTrackedEntityAtPath(path, returnExpression, () => { + this.deoptimizableDependentExpressions.push(origin); + return returnExpression.getLiteralValueAtPath(path, recursionTracker, origin); + }, UnknownValue); } - getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin) { + getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin) { const returnExpression = this.getReturnExpression(recursionTracker); if (this.returnExpression === UNKNOWN_EXPRESSION) { return UNKNOWN_EXPRESSION; } - const trackedEntities = recursionTracker.getEntities(path); - if (trackedEntities.has(returnExpression)) { - return UNKNOWN_EXPRESSION; - } - this.expressionsToBeDeoptimized.push(origin); - trackedEntities.add(returnExpression); - const value = returnExpression.getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin); - trackedEntities.delete(returnExpression); - return value; + return recursionTracker.withTrackedEntityAtPath(path, returnExpression, () => { + this.deoptimizableDependentExpressions.push(origin); + return returnExpression.getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin); + }, UNKNOWN_EXPRESSION); } - hasEffects(context) { - for (const argument of this.arguments) { - if (argument.hasEffects(context)) - return true; + hasEffectsOnInteractionAtPath(path, interaction, context) { + const { type } = interaction; + if (type === INTERACTION_CALLED) { + if ((interaction.withNew + ? context.instantiated + : context.called).trackEntityAtPathAndGetIfTracked(path, interaction.args, this)) { + return false; + } } - if (this.context.options.treeshake.annotations && - this.annotatedPure) + else if ((type === INTERACTION_ASSIGNED + ? context.assigned + : context.accessed).trackEntityAtPathAndGetIfTracked(path, this)) { return false; - return (this.callee.hasEffects(context) || - this.callee.hasEffectsWhenCalledAtPath(EMPTY_PATH, this.callOptions, context)); + } + return this.getReturnExpression().hasEffectsOnInteractionAtPath(path, interaction, context); } - hasEffectsWhenAccessedAtPath(path, context) { - if (path.length === 0) - return false; - const trackedExpressions = context.accessed.getEntities(path); - if (trackedExpressions.has(this)) - return false; - trackedExpressions.add(this); - return this.returnExpression.hasEffectsWhenAccessedAtPath(path, context); +} + +class CallExpression extends CallExpressionBase { + bind() { + super.bind(); + if (this.callee instanceof Identifier) { + const variable = this.scope.findVariable(this.callee.name); + if (variable.isNamespace) { + this.context.warn({ + code: 'CANNOT_CALL_NAMESPACE', + message: `Cannot call a namespace ('${this.callee.name}')` + }, this.start); + } + if (this.callee.name === 'eval') { + this.context.warn({ + code: 'EVAL', + message: `Use of eval is strongly discouraged, as it poses security risks and may cause issues with minification`, + url: 'https://rollupjs.org/guide/en/#avoiding-eval' + }, this.start); + } + } + this.interaction = { + args: this.arguments, + thisArg: this.callee instanceof MemberExpression && !this.callee.variable + ? this.callee.object + : null, + type: INTERACTION_CALLED, + withNew: false + }; } - hasEffectsWhenAssignedAtPath(path, context) { - if (path.length === 0) - return true; - const trackedExpressions = context.assigned.getEntities(path); - if (trackedExpressions.has(this)) - return false; - trackedExpressions.add(this); - return this.returnExpression.hasEffectsWhenAssignedAtPath(path, context); - } - hasEffectsWhenCalledAtPath(path, callOptions, context) { - const trackedExpressions = (callOptions.withNew - ? context.instantiated - : context.called).getEntities(path, callOptions); - if (trackedExpressions.has(this)) - return false; - trackedExpressions.add(this); - return this.returnExpression.hasEffectsWhenCalledAtPath(path, callOptions, context); + hasEffects(context) { + try { + for (const argument of this.arguments) { + if (argument.hasEffects(context)) + return true; + } + if (this.context.options.treeshake.annotations && + this.annotations) + return false; + return (this.callee.hasEffects(context) || + this.callee.hasEffectsOnInteractionAtPath(EMPTY_PATH, this.interaction, context)); + } + finally { + if (!this.deoptimized) + this.applyDeoptimizations(); + } } include(context, includeChildrenRecursively) { + if (!this.deoptimized) + this.applyDeoptimizations(); if (includeChildrenRecursively) { super.include(context, includeChildrenRecursively); if (includeChildrenRecursively === INCLUDE_PARAMETERS && - this.callee instanceof Identifier$1 && + this.callee instanceof Identifier && this.callee.variable) { this.callee.variable.markCalledFromTryStatement(); } @@ -6556,50 +8991,29 @@ class CallExpression$1 extends NodeBase { this.callee.include(context, false); } this.callee.includeCallArguments(context, this.arguments); - if (!this.returnExpression.included) { - this.returnExpression.include(context, false); - } } - initialise() { - this.callOptions = { - args: this.arguments, - withNew: false - }; + render(code, options, { renderedSurroundingElement } = BLANK) { + this.callee.render(code, options, { + isCalleeOfRenderedParent: true, + renderedSurroundingElement + }); + renderCallArguments(code, options, this); } - render(code, options, { renderedParentType } = BLANK) { - this.callee.render(code, options); - if (this.arguments.length > 0) { - if (this.arguments[this.arguments.length - 1].included) { - for (const arg of this.arguments) { - arg.render(code, options); - } - } - else { - let lastIncludedIndex = this.arguments.length - 2; - while (lastIncludedIndex >= 0 && !this.arguments[lastIncludedIndex].included) { - lastIncludedIndex--; - } - if (lastIncludedIndex >= 0) { - for (let index = 0; index <= lastIncludedIndex; index++) { - this.arguments[index].render(code, options); - } - code.remove(findFirstOccurrenceOutsideComment(code.original, ',', this.arguments[lastIncludedIndex].end), this.end - 1); - } - else { - code.remove(findFirstOccurrenceOutsideComment(code.original, '(', this.callee.end) + 1, this.end - 1); - } - } + applyDeoptimizations() { + this.deoptimized = true; + if (this.interaction.thisArg) { + this.callee.deoptimizeThisOnInteractionAtPath(this.interaction, EMPTY_PATH, SHARED_RECURSION_TRACKER); } - if (renderedParentType === ExpressionStatement && - this.callee.type === FunctionExpression) { - code.appendRight(this.start, '('); - code.prependLeft(this.end, ')'); + for (const argument of this.arguments) { + // This will make sure all properties of parameters behave as "unknown" + argument.deoptimizePath(UNKNOWN_PATH); } + this.context.requestTreeshakingPass(); } - getReturnExpression(recursionTracker) { + getReturnExpression(recursionTracker = SHARED_RECURSION_TRACKER) { if (this.returnExpression === null) { this.returnExpression = UNKNOWN_EXPRESSION; - return (this.returnExpression = this.callee.getReturnExpressionWhenCalledAtPath(EMPTY_PATH, recursionTracker, this)); + return (this.returnExpression = this.callee.getReturnExpressionWhenCalledAtPath(EMPTY_PATH, this.interaction, recursionTracker, this)); } return this.returnExpression; } @@ -6607,12 +9021,16 @@ class CallExpression$1 extends NodeBase { class CatchScope extends ParameterScope { addDeclaration(identifier, context, init, isHoisted) { - if (isHoisted) { - return this.parent.addDeclaration(identifier, context, init, isHoisted); - } - else { - return super.addDeclaration(identifier, context, init, false); + const existingParameter = this.variables.get(identifier.name); + if (existingParameter) { + // While we still create a hoisted declaration, the initializer goes to + // the parameter. Note that technically, the declaration now belongs to + // two variables, which is not correct but should not cause issues. + this.parent.addDeclaration(identifier, context, UNDEFINED_EXPRESSION, isHoisted); + existingParameter.addDeclaration(identifier, init); + return existingParameter; } + return this.parent.addDeclaration(identifier, context, init, isHoisted); } } @@ -6620,107 +9038,328 @@ class CatchClause extends NodeBase { createScope(parentScope) { this.scope = new CatchScope(parentScope, this.context); } - initialise() { - if (this.param) { + parseNode(esTreeNode) { + // Parameters need to be declared first as the logic is that initializers + // of hoisted body variables are associated with parameters of the same + // name instead of the variable + const { param } = esTreeNode; + if (param) { + this.param = new (this.context.getNodeConstructor(param.type))(param, this, this.scope); this.param.declare('parameter', UNKNOWN_EXPRESSION); } - } - parseNode(esTreeNode) { - this.body = new this.context.nodeConstructors.BlockStatement(esTreeNode.body, this, this.scope); super.parseNode(esTreeNode); } } -CatchClause.prototype.preventChildBlockScope = true; class ChainExpression extends NodeBase { } class ClassBodyScope extends ChildScope { + constructor(parent, classNode, context) { + super(parent); + this.variables.set('this', (this.thisVariable = new LocalVariable('this', null, classNode, context))); + this.instanceScope = new ChildScope(this); + this.instanceScope.variables.set('this', new ThisVariable(context)); + } findLexicalBoundary() { return this; } } -class MethodDefinition extends NodeBase { +class ClassBody extends NodeBase { + createScope(parentScope) { + this.scope = new ClassBodyScope(parentScope, this.parent, this.context); + } + include(context, includeChildrenRecursively) { + this.included = true; + this.context.includeVariableInModule(this.scope.thisVariable); + for (const definition of this.body) { + definition.include(context, includeChildrenRecursively); + } + } + parseNode(esTreeNode) { + const body = (this.body = []); + for (const definition of esTreeNode.body) { + body.push(new (this.context.getNodeConstructor(definition.type))(definition, this, definition.static ? this.scope : this.scope.instanceScope)); + } + super.parseNode(esTreeNode); + } + applyDeoptimizations() { } +} + +class MethodBase extends NodeBase { + constructor() { + super(...arguments); + this.accessedValue = null; + } + // As getter properties directly receive their values from fixed function + // expressions, there is no known situation where a getter is deoptimized. + deoptimizeCache() { } + deoptimizePath(path) { + this.getAccessedValue().deoptimizePath(path); + } + deoptimizeThisOnInteractionAtPath(interaction, path, recursionTracker) { + if (interaction.type === INTERACTION_ACCESSED && this.kind === 'get' && path.length === 0) { + return this.value.deoptimizeThisOnInteractionAtPath({ + args: NO_ARGS, + thisArg: interaction.thisArg, + type: INTERACTION_CALLED, + withNew: false + }, EMPTY_PATH, recursionTracker); + } + if (interaction.type === INTERACTION_ASSIGNED && this.kind === 'set' && path.length === 0) { + return this.value.deoptimizeThisOnInteractionAtPath({ + args: interaction.args, + thisArg: interaction.thisArg, + type: INTERACTION_CALLED, + withNew: false + }, EMPTY_PATH, recursionTracker); + } + this.getAccessedValue().deoptimizeThisOnInteractionAtPath(interaction, path, recursionTracker); + } + getLiteralValueAtPath(path, recursionTracker, origin) { + return this.getAccessedValue().getLiteralValueAtPath(path, recursionTracker, origin); + } + getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin) { + return this.getAccessedValue().getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin); + } hasEffects(context) { return this.key.hasEffects(context); } - hasEffectsWhenCalledAtPath(path, callOptions, context) { - return (path.length > 0 || this.value.hasEffectsWhenCalledAtPath(EMPTY_PATH, callOptions, context)); + hasEffectsOnInteractionAtPath(path, interaction, context) { + if (this.kind === 'get' && interaction.type === INTERACTION_ACCESSED && path.length === 0) { + return this.value.hasEffectsOnInteractionAtPath(EMPTY_PATH, { + args: NO_ARGS, + thisArg: interaction.thisArg, + type: INTERACTION_CALLED, + withNew: false + }, context); + } + // setters are only called for empty paths + if (this.kind === 'set' && interaction.type === INTERACTION_ASSIGNED) { + return this.value.hasEffectsOnInteractionAtPath(EMPTY_PATH, { + args: interaction.args, + thisArg: interaction.thisArg, + type: INTERACTION_CALLED, + withNew: false + }, context); + } + return this.getAccessedValue().hasEffectsOnInteractionAtPath(path, interaction, context); + } + applyDeoptimizations() { } + getAccessedValue() { + if (this.accessedValue === null) { + if (this.kind === 'get') { + this.accessedValue = UNKNOWN_EXPRESSION; + return (this.accessedValue = this.value.getReturnExpressionWhenCalledAtPath(EMPTY_PATH, NODE_INTERACTION_UNKNOWN_CALL, SHARED_RECURSION_TRACKER, this)); + } + else { + return (this.accessedValue = this.value); + } + } + return this.accessedValue; } } -class ClassBody extends NodeBase { +class MethodDefinition extends MethodBase { + applyDeoptimizations() { } +} + +class ObjectMember extends ExpressionEntity { + constructor(object, key) { + super(); + this.object = object; + this.key = key; + } + deoptimizePath(path) { + this.object.deoptimizePath([this.key, ...path]); + } + deoptimizeThisOnInteractionAtPath(interaction, path, recursionTracker) { + this.object.deoptimizeThisOnInteractionAtPath(interaction, [this.key, ...path], recursionTracker); + } + getLiteralValueAtPath(path, recursionTracker, origin) { + return this.object.getLiteralValueAtPath([this.key, ...path], recursionTracker, origin); + } + getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin) { + return this.object.getReturnExpressionWhenCalledAtPath([this.key, ...path], interaction, recursionTracker, origin); + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + return this.object.hasEffectsOnInteractionAtPath([this.key, ...path], interaction, context); + } +} + +class ClassNode extends NodeBase { + constructor() { + super(...arguments); + this.objectEntity = null; + } createScope(parentScope) { - this.scope = new ClassBodyScope(parentScope); + this.scope = new ChildScope(parentScope); } - hasEffectsWhenCalledAtPath(path, callOptions, context) { - if (path.length > 0) - return true; - return (this.classConstructor !== null && - this.classConstructor.hasEffectsWhenCalledAtPath(EMPTY_PATH, callOptions, context)); + deoptimizeCache() { + this.getObjectEntity().deoptimizeAllProperties(); + } + deoptimizePath(path) { + this.getObjectEntity().deoptimizePath(path); + } + deoptimizeThisOnInteractionAtPath(interaction, path, recursionTracker) { + this.getObjectEntity().deoptimizeThisOnInteractionAtPath(interaction, path, recursionTracker); + } + getLiteralValueAtPath(path, recursionTracker, origin) { + return this.getObjectEntity().getLiteralValueAtPath(path, recursionTracker, origin); + } + getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin) { + return this.getObjectEntity().getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin); + } + hasEffects(context) { + var _a, _b; + if (!this.deoptimized) + this.applyDeoptimizations(); + const initEffect = ((_a = this.superClass) === null || _a === void 0 ? void 0 : _a.hasEffects(context)) || this.body.hasEffects(context); + (_b = this.id) === null || _b === void 0 ? void 0 : _b.markDeclarationReached(); + return initEffect || super.hasEffects(context); + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + var _a; + if (interaction.type === INTERACTION_CALLED && path.length === 0) { + return (!interaction.withNew || + (this.classConstructor !== null + ? this.classConstructor.hasEffectsOnInteractionAtPath(path, interaction, context) + : (_a = this.superClass) === null || _a === void 0 ? void 0 : _a.hasEffectsOnInteractionAtPath(path, interaction, context)) || + false); + } + else { + return this.getObjectEntity().hasEffectsOnInteractionAtPath(path, interaction, context); + } + } + include(context, includeChildrenRecursively) { + var _a; + if (!this.deoptimized) + this.applyDeoptimizations(); + this.included = true; + (_a = this.superClass) === null || _a === void 0 ? void 0 : _a.include(context, includeChildrenRecursively); + this.body.include(context, includeChildrenRecursively); + if (this.id) { + this.id.markDeclarationReached(); + this.id.include(); + } } initialise() { - for (const method of this.body) { + var _a; + (_a = this.id) === null || _a === void 0 ? void 0 : _a.declare('class', this); + for (const method of this.body.body) { if (method instanceof MethodDefinition && method.kind === 'constructor') { this.classConstructor = method; return; } } - this.classConstructor = null; + this.classConstructor = null; + } + applyDeoptimizations() { + this.deoptimized = true; + for (const definition of this.body.body) { + if (!(definition.static || + (definition instanceof MethodDefinition && definition.kind === 'constructor'))) { + // Calls to methods are not tracked, ensure that the return value is deoptimized + definition.deoptimizePath(UNKNOWN_PATH); + } + } + this.context.requestTreeshakingPass(); + } + getObjectEntity() { + if (this.objectEntity !== null) { + return this.objectEntity; + } + const staticProperties = []; + const dynamicMethods = []; + for (const definition of this.body.body) { + const properties = definition.static ? staticProperties : dynamicMethods; + const definitionKind = definition.kind; + // Note that class fields do not end up on the prototype + if (properties === dynamicMethods && !definitionKind) + continue; + const kind = definitionKind === 'set' || definitionKind === 'get' ? definitionKind : 'init'; + let key; + if (definition.computed) { + const keyValue = definition.key.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, this); + if (typeof keyValue === 'symbol') { + properties.push({ key: UnknownKey, kind, property: definition }); + continue; + } + else { + key = String(keyValue); + } + } + else { + key = + definition.key instanceof Identifier + ? definition.key.name + : String(definition.key.value); + } + properties.push({ key, kind, property: definition }); + } + staticProperties.unshift({ + key: 'prototype', + kind: 'init', + property: new ObjectEntity(dynamicMethods, this.superClass ? new ObjectMember(this.superClass, 'prototype') : OBJECT_PROTOTYPE) + }); + return (this.objectEntity = new ObjectEntity(staticProperties, this.superClass || OBJECT_PROTOTYPE)); + } +} + +class ClassDeclaration extends ClassNode { + initialise() { + super.initialise(); + if (this.id !== null) { + this.id.variable.isId = true; + } + } + parseNode(esTreeNode) { + if (esTreeNode.id !== null) { + this.id = new Identifier(esTreeNode.id, this, this.scope.parent); + } + super.parseNode(esTreeNode); + } + render(code, options) { + const { exportNamesByVariable, format, snippets: { _ } } = options; + if (format === 'system' && this.id && exportNamesByVariable.has(this.id.variable)) { + code.appendLeft(this.end, `${_}${getSystemExportStatement([this.id.variable], options)};`); + } + super.render(code, options); } } class ClassExpression extends ClassNode { + render(code, options, { renderedSurroundingElement } = BLANK) { + super.render(code, options); + if (renderedSurroundingElement === ExpressionStatement$1) { + code.appendRight(this.start, '('); + code.prependLeft(this.end, ')'); + } + } } -class MultiExpression { +class MultiExpression extends ExpressionEntity { constructor(expressions) { - this.included = false; + super(); this.expressions = expressions; + this.included = false; } deoptimizePath(path) { for (const expression of this.expressions) { expression.deoptimizePath(path); } } - getLiteralValueAtPath() { - return UnknownValue; - } - getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin) { - return new MultiExpression(this.expressions.map(expression => expression.getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin))); - } - hasEffectsWhenAccessedAtPath(path, context) { - for (const expression of this.expressions) { - if (expression.hasEffectsWhenAccessedAtPath(path, context)) - return true; - } - return false; - } - hasEffectsWhenAssignedAtPath(path, context) { - for (const expression of this.expressions) { - if (expression.hasEffectsWhenAssignedAtPath(path, context)) - return true; - } - return false; + getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin) { + return new MultiExpression(this.expressions.map(expression => expression.getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin))); } - hasEffectsWhenCalledAtPath(path, callOptions, context) { + hasEffectsOnInteractionAtPath(path, interaction, context) { for (const expression of this.expressions) { - if (expression.hasEffectsWhenCalledAtPath(path, callOptions, context)) + if (expression.hasEffectsOnInteractionAtPath(path, interaction, context)) return true; } return false; } - include(context, includeChildrenRecursively) { - // This is only relevant to include values that do not have an AST representation, - // such as UnknownArrayExpression. Thus we only need to include them once. - for (const expression of this.expressions) { - if (!expression.included) { - expression.include(context, includeChildrenRecursively); - } - } - } - includeCallArguments() { } } class ConditionalExpression extends NodeBase { @@ -6729,126 +9368,113 @@ class ConditionalExpression extends NodeBase { this.expressionsToBeDeoptimized = []; this.isBranchResolutionAnalysed = false; this.usedBranch = null; - this.wasPathDeoptimizedWhileOptimized = false; - } - bind() { - super.bind(); - // ensure the usedBranch is set for the tree-shaking passes - this.getUsedBranch(); } deoptimizeCache() { if (this.usedBranch !== null) { const unusedBranch = this.usedBranch === this.consequent ? this.alternate : this.consequent; this.usedBranch = null; - const expressionsToBeDeoptimized = this.expressionsToBeDeoptimized; - this.expressionsToBeDeoptimized = []; - if (this.wasPathDeoptimizedWhileOptimized) { - unusedBranch.deoptimizePath(UNKNOWN_PATH); - } - for (const expression of expressionsToBeDeoptimized) { + unusedBranch.deoptimizePath(UNKNOWN_PATH); + for (const expression of this.expressionsToBeDeoptimized) { expression.deoptimizeCache(); } } } deoptimizePath(path) { - if (path.length > 0) { - const usedBranch = this.getUsedBranch(); - if (usedBranch === null) { - this.consequent.deoptimizePath(path); - this.alternate.deoptimizePath(path); - } - else { - this.wasPathDeoptimizedWhileOptimized = true; - usedBranch.deoptimizePath(path); - } + const usedBranch = this.getUsedBranch(); + if (!usedBranch) { + this.consequent.deoptimizePath(path); + this.alternate.deoptimizePath(path); + } + else { + usedBranch.deoptimizePath(path); } } + deoptimizeThisOnInteractionAtPath(interaction, path, recursionTracker) { + this.consequent.deoptimizeThisOnInteractionAtPath(interaction, path, recursionTracker); + this.alternate.deoptimizeThisOnInteractionAtPath(interaction, path, recursionTracker); + } getLiteralValueAtPath(path, recursionTracker, origin) { const usedBranch = this.getUsedBranch(); - if (usedBranch === null) + if (!usedBranch) return UnknownValue; this.expressionsToBeDeoptimized.push(origin); return usedBranch.getLiteralValueAtPath(path, recursionTracker, origin); } - getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin) { + getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin) { const usedBranch = this.getUsedBranch(); - if (usedBranch === null) + if (!usedBranch) return new MultiExpression([ - this.consequent.getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin), - this.alternate.getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin) + this.consequent.getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin), + this.alternate.getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin) ]); this.expressionsToBeDeoptimized.push(origin); - return usedBranch.getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin); + return usedBranch.getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin); } hasEffects(context) { if (this.test.hasEffects(context)) return true; - if (this.usedBranch === null) { + const usedBranch = this.getUsedBranch(); + if (!usedBranch) { return this.consequent.hasEffects(context) || this.alternate.hasEffects(context); } - return this.usedBranch.hasEffects(context); - } - hasEffectsWhenAccessedAtPath(path, context) { - if (path.length === 0) - return false; - if (this.usedBranch === null) { - return (this.consequent.hasEffectsWhenAccessedAtPath(path, context) || - this.alternate.hasEffectsWhenAccessedAtPath(path, context)); - } - return this.usedBranch.hasEffectsWhenAccessedAtPath(path, context); - } - hasEffectsWhenAssignedAtPath(path, context) { - if (path.length === 0) - return true; - if (this.usedBranch === null) { - return (this.consequent.hasEffectsWhenAssignedAtPath(path, context) || - this.alternate.hasEffectsWhenAssignedAtPath(path, context)); - } - return this.usedBranch.hasEffectsWhenAssignedAtPath(path, context); + return usedBranch.hasEffects(context); } - hasEffectsWhenCalledAtPath(path, callOptions, context) { - if (this.usedBranch === null) { - return (this.consequent.hasEffectsWhenCalledAtPath(path, callOptions, context) || - this.alternate.hasEffectsWhenCalledAtPath(path, callOptions, context)); + hasEffectsOnInteractionAtPath(path, interaction, context) { + const usedBranch = this.getUsedBranch(); + if (!usedBranch) { + return (this.consequent.hasEffectsOnInteractionAtPath(path, interaction, context) || + this.alternate.hasEffectsOnInteractionAtPath(path, interaction, context)); } - return this.usedBranch.hasEffectsWhenCalledAtPath(path, callOptions, context); + return usedBranch.hasEffectsOnInteractionAtPath(path, interaction, context); } include(context, includeChildrenRecursively) { this.included = true; - if (includeChildrenRecursively || - this.test.shouldBeIncluded(context) || - this.usedBranch === null) { + const usedBranch = this.getUsedBranch(); + if (includeChildrenRecursively || this.test.shouldBeIncluded(context) || usedBranch === null) { this.test.include(context, includeChildrenRecursively); this.consequent.include(context, includeChildrenRecursively); this.alternate.include(context, includeChildrenRecursively); } else { - this.usedBranch.include(context, includeChildrenRecursively); + usedBranch.include(context, includeChildrenRecursively); } } - render(code, options, { renderedParentType, isCalleeOfRenderedParent, preventASI } = BLANK) { + includeCallArguments(context, args) { + const usedBranch = this.getUsedBranch(); + if (!usedBranch) { + this.consequent.includeCallArguments(context, args); + this.alternate.includeCallArguments(context, args); + } + else { + usedBranch.includeCallArguments(context, args); + } + } + render(code, options, { isCalleeOfRenderedParent, preventASI, renderedParentType, renderedSurroundingElement } = BLANK) { + const usedBranch = this.getUsedBranch(); if (!this.test.included) { const colonPos = findFirstOccurrenceOutsideComment(code.original, ':', this.consequent.end); - const inclusionStart = (this.consequent.included + const inclusionStart = findNonWhiteSpace(code.original, (this.consequent.included ? findFirstOccurrenceOutsideComment(code.original, '?', this.test.end) - : colonPos) + 1; + : colonPos) + 1); if (preventASI) { - removeLineBreaks(code, inclusionStart, this.usedBranch.start); + removeLineBreaks(code, inclusionStart, usedBranch.start); } code.remove(this.start, inclusionStart); if (this.consequent.included) { code.remove(colonPos, this.end); } removeAnnotations(this, code); - this.usedBranch.render(code, options, { - isCalleeOfRenderedParent: renderedParentType - ? isCalleeOfRenderedParent - : this.parent.callee === this, - renderedParentType: renderedParentType || this.parent.type + usedBranch.render(code, options, { + isCalleeOfRenderedParent, + preventASI: true, + renderedParentType: renderedParentType || this.parent.type, + renderedSurroundingElement: renderedSurroundingElement || this.parent.type }); } else { - super.render(code, options); + this.test.render(code, options, { renderedSurroundingElement }); + this.consequent.render(code, options); + this.alternate.render(code, options); } } getUsedBranch() { @@ -6857,7 +9483,7 @@ class ConditionalExpression extends NodeBase { } this.isBranchResolutionAnalysed = true; const testValue = this.test.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, this); - return testValue === UnknownValue + return typeof testValue === 'symbol' ? null : (this.usedBranch = testValue ? this.consequent : this.alternate); } @@ -6906,7 +9532,7 @@ class DoWhileStatement extends NodeBase { this.included = true; this.test.include(context, includeChildrenRecursively); const { brokenFlow } = context; - this.body.include(context, includeChildrenRecursively); + this.body.include(context, includeChildrenRecursively, { asSingleStatement: true }); context.brokenFlow = brokenFlow; } } @@ -6917,14 +9543,132 @@ class EmptyStatement extends NodeBase { } } +class ExportAllDeclaration extends NodeBase { + hasEffects() { + return false; + } + initialise() { + this.context.addExport(this); + } + render(code, _options, nodeRenderOptions) { + code.remove(nodeRenderOptions.start, nodeRenderOptions.end); + } + applyDeoptimizations() { } +} +ExportAllDeclaration.prototype.needsBoundaries = true; + +class FunctionDeclaration extends FunctionNode { + initialise() { + super.initialise(); + if (this.id !== null) { + this.id.variable.isId = true; + } + } + parseNode(esTreeNode) { + if (esTreeNode.id !== null) { + this.id = new Identifier(esTreeNode.id, this, this.scope.parent); + } + super.parseNode(esTreeNode); + } +} + +// The header ends at the first non-white-space after "default" +function getDeclarationStart(code, start) { + return findNonWhiteSpace(code, findFirstOccurrenceOutsideComment(code, 'default', start) + 7); +} +function getIdInsertPosition(code, declarationKeyword, endMarker, start) { + const declarationEnd = findFirstOccurrenceOutsideComment(code, declarationKeyword, start) + declarationKeyword.length; + code = code.slice(declarationEnd, findFirstOccurrenceOutsideComment(code, endMarker, declarationEnd)); + const generatorStarPos = findFirstOccurrenceOutsideComment(code, '*'); + if (generatorStarPos === -1) { + return declarationEnd; + } + return declarationEnd + generatorStarPos + 1; +} +class ExportDefaultDeclaration extends NodeBase { + include(context, includeChildrenRecursively) { + super.include(context, includeChildrenRecursively); + if (includeChildrenRecursively) { + this.context.includeVariableInModule(this.variable); + } + } + initialise() { + const declaration = this.declaration; + this.declarationName = + (declaration.id && declaration.id.name) || this.declaration.name; + this.variable = this.scope.addExportDefaultDeclaration(this.declarationName || this.context.getModuleName(), this, this.context); + this.context.addExport(this); + } + render(code, options, nodeRenderOptions) { + const { start, end } = nodeRenderOptions; + const declarationStart = getDeclarationStart(code.original, this.start); + if (this.declaration instanceof FunctionDeclaration) { + this.renderNamedDeclaration(code, declarationStart, 'function', '(', this.declaration.id === null, options); + } + else if (this.declaration instanceof ClassDeclaration) { + this.renderNamedDeclaration(code, declarationStart, 'class', '{', this.declaration.id === null, options); + } + else if (this.variable.getOriginalVariable() !== this.variable) { + // Remove altogether to prevent re-declaring the same variable + treeshakeNode(this, code, start, end); + return; + } + else if (this.variable.included) { + this.renderVariableDeclaration(code, declarationStart, options); + } + else { + code.remove(this.start, declarationStart); + this.declaration.render(code, options, { + renderedSurroundingElement: ExpressionStatement$1 + }); + if (code.original[this.end - 1] !== ';') { + code.appendLeft(this.end, ';'); + } + return; + } + this.declaration.render(code, options); + } + applyDeoptimizations() { } + renderNamedDeclaration(code, declarationStart, declarationKeyword, endMarker, needsId, options) { + const { exportNamesByVariable, format, snippets: { getPropertyAccess } } = options; + const name = this.variable.getName(getPropertyAccess); + // Remove `export default` + code.remove(this.start, declarationStart); + if (needsId) { + code.appendLeft(getIdInsertPosition(code.original, declarationKeyword, endMarker, declarationStart), ` ${name}`); + } + if (format === 'system' && + this.declaration instanceof ClassDeclaration && + exportNamesByVariable.has(this.variable)) { + code.appendLeft(this.end, ` ${getSystemExportStatement([this.variable], options)};`); + } + } + renderVariableDeclaration(code, declarationStart, { format, exportNamesByVariable, snippets: { cnst, getPropertyAccess } }) { + const hasTrailingSemicolon = code.original.charCodeAt(this.end - 1) === 59; /*";"*/ + const systemExportNames = format === 'system' && exportNamesByVariable.get(this.variable); + if (systemExportNames) { + code.overwrite(this.start, declarationStart, `${cnst} ${this.variable.getName(getPropertyAccess)} = exports('${systemExportNames[0]}', `); + code.appendRight(hasTrailingSemicolon ? this.end - 1 : this.end, ')' + (hasTrailingSemicolon ? '' : ';')); + } + else { + code.overwrite(this.start, declarationStart, `${cnst} ${this.variable.getName(getPropertyAccess)} = `); + if (!hasTrailingSemicolon) { + code.appendLeft(this.end, ';'); + } + } + } +} +ExportDefaultDeclaration.prototype.needsBoundaries = true; + class ExportNamedDeclaration extends NodeBase { bind() { + var _a; // Do not bind specifiers - if (this.declaration !== null) - this.declaration.bind(); + (_a = this.declaration) === null || _a === void 0 ? void 0 : _a.bind(); } hasEffects(context) { - return this.declaration !== null && this.declaration.hasEffects(context); + var _a; + return !!((_a = this.declaration) === null || _a === void 0 ? void 0 : _a.hasEffects(context)); } initialise() { this.context.addExport(this); @@ -6936,37 +9680,26 @@ class ExportNamedDeclaration extends NodeBase { } else { code.remove(this.start, this.declaration.start); - this.declaration.render(code, options, { start, end }); + this.declaration.render(code, options, { end, start }); } } + applyDeoptimizations() { } } ExportNamedDeclaration.prototype.needsBoundaries = true; class ExportSpecifier extends NodeBase { -} - -class FieldDefinition extends NodeBase { - hasEffects(context) { - return (this.key.hasEffects(context) || - (this.static && this.value !== null && this.value.hasEffects(context))); - } + applyDeoptimizations() { } } class ForInStatement extends NodeBase { - bind() { - this.left.bind(); - this.left.deoptimizePath(EMPTY_PATH); - this.right.bind(); - this.body.bind(); - } createScope(parentScope) { this.scope = new BlockScope(parentScope); } hasEffects(context) { - if ((this.left && - (this.left.hasEffects(context) || - this.left.hasEffectsWhenAssignedAtPath(EMPTY_PATH, context))) || - (this.right && this.right.hasEffects(context))) + const { deoptimized, left, right } = this; + if (!deoptimized) + this.applyDeoptimizations(); + if (left.hasEffectsAsAssignmentTarget(context, false) || right.hasEffects(context)) return true; const { brokenFlow, ignore: { breaks, continues } } = context; context.ignore.breaks = true; @@ -6979,14 +9712,19 @@ class ForInStatement extends NodeBase { return false; } include(context, includeChildrenRecursively) { + const { body, deoptimized, left, right } = this; + if (!deoptimized) + this.applyDeoptimizations(); this.included = true; - this.left.includeWithAllDeclaredVariables(includeChildrenRecursively, context); - this.left.deoptimizePath(EMPTY_PATH); - this.right.include(context, includeChildrenRecursively); + left.includeAsAssignmentTarget(context, includeChildrenRecursively || true, false); + right.include(context, includeChildrenRecursively); const { brokenFlow } = context; - this.body.include(context, includeChildrenRecursively); + body.include(context, includeChildrenRecursively, { asSingleStatement: true }); context.brokenFlow = brokenFlow; } + initialise() { + this.left.setAssignedValue(UNKNOWN_EXPRESSION); + } render(code, options) { this.left.render(code, options, NO_SEMICOLON); this.right.render(code, options, NO_SEMICOLON); @@ -6996,31 +9734,37 @@ class ForInStatement extends NodeBase { } this.body.render(code, options); } + applyDeoptimizations() { + this.deoptimized = true; + this.left.deoptimizePath(EMPTY_PATH); + this.context.requestTreeshakingPass(); + } } class ForOfStatement extends NodeBase { - bind() { - this.left.bind(); - this.left.deoptimizePath(EMPTY_PATH); - this.right.bind(); - this.body.bind(); - } createScope(parentScope) { this.scope = new BlockScope(parentScope); } hasEffects() { + if (!this.deoptimized) + this.applyDeoptimizations(); // Placeholder until proper Symbol.Iterator support return true; } include(context, includeChildrenRecursively) { + const { body, deoptimized, left, right } = this; + if (!deoptimized) + this.applyDeoptimizations(); this.included = true; - this.left.includeWithAllDeclaredVariables(includeChildrenRecursively, context); - this.left.deoptimizePath(EMPTY_PATH); - this.right.include(context, includeChildrenRecursively); + left.includeAsAssignmentTarget(context, includeChildrenRecursively || true, false); + right.include(context, includeChildrenRecursively); const { brokenFlow } = context; - this.body.include(context, includeChildrenRecursively); + body.include(context, includeChildrenRecursively, { asSingleStatement: true }); context.brokenFlow = brokenFlow; } + initialise() { + this.left.setAssignedValue(UNKNOWN_EXPRESSION); + } render(code, options) { this.left.render(code, options, NO_SEMICOLON); this.right.render(code, options, NO_SEMICOLON); @@ -7030,6 +9774,11 @@ class ForOfStatement extends NodeBase { } this.body.render(code, options); } + applyDeoptimizations() { + this.deoptimized = true; + this.left.deoptimizePath(EMPTY_PATH); + this.context.requestTreeshakingPass(); + } } class ForStatement extends NodeBase { @@ -7037,9 +9786,10 @@ class ForStatement extends NodeBase { this.scope = new BlockScope(parentScope); } hasEffects(context) { - if ((this.init && this.init.hasEffects(context)) || - (this.test && this.test.hasEffects(context)) || - (this.update && this.update.hasEffects(context))) + var _a, _b, _c; + if (((_a = this.init) === null || _a === void 0 ? void 0 : _a.hasEffects(context)) || + ((_b = this.test) === null || _b === void 0 ? void 0 : _b.hasEffects(context)) || + ((_c = this.update) === null || _c === void 0 ? void 0 : _c.hasEffects(context))) return true; const { brokenFlow, ignore: { breaks, continues } } = context; context.ignore.breaks = true; @@ -7052,29 +9802,43 @@ class ForStatement extends NodeBase { return false; } include(context, includeChildrenRecursively) { + var _a, _b, _c; this.included = true; - if (this.init) - this.init.include(context, includeChildrenRecursively); - if (this.test) - this.test.include(context, includeChildrenRecursively); + (_a = this.init) === null || _a === void 0 ? void 0 : _a.include(context, includeChildrenRecursively, { asSingleStatement: true }); + (_b = this.test) === null || _b === void 0 ? void 0 : _b.include(context, includeChildrenRecursively); const { brokenFlow } = context; - if (this.update) - this.update.include(context, includeChildrenRecursively); - this.body.include(context, includeChildrenRecursively); + (_c = this.update) === null || _c === void 0 ? void 0 : _c.include(context, includeChildrenRecursively); + this.body.include(context, includeChildrenRecursively, { asSingleStatement: true }); context.brokenFlow = brokenFlow; } render(code, options) { - if (this.init) - this.init.render(code, options, NO_SEMICOLON); - if (this.test) - this.test.render(code, options, NO_SEMICOLON); - if (this.update) - this.update.render(code, options, NO_SEMICOLON); + var _a, _b, _c; + (_a = this.init) === null || _a === void 0 ? void 0 : _a.render(code, options, NO_SEMICOLON); + (_b = this.test) === null || _b === void 0 ? void 0 : _b.render(code, options, NO_SEMICOLON); + (_c = this.update) === null || _c === void 0 ? void 0 : _c.render(code, options, NO_SEMICOLON); this.body.render(code, options); } } -class FunctionExpression$1 extends FunctionNode { +class FunctionExpression extends FunctionNode { + render(code, options, { renderedSurroundingElement } = BLANK) { + super.render(code, options); + if (renderedSurroundingElement === ExpressionStatement$1) { + code.appendRight(this.start, '('); + code.prependLeft(this.end, ')'); + } + } +} + +class TrackingScope extends BlockScope { + constructor() { + super(...arguments); + this.hoistedDeclarations = []; + } + addDeclaration(identifier, context, init, isHoisted) { + this.hoistedDeclarations.push(identifier); + return super.addDeclaration(identifier, context, init, isHoisted); + } } const unset = Symbol('unset'); @@ -7087,11 +9851,12 @@ class IfStatement extends NodeBase { this.testValue = UnknownValue; } hasEffects(context) { + var _a; if (this.test.hasEffects(context)) { return true; } const testValue = this.getTestValue(); - if (testValue === UnknownValue) { + if (typeof testValue === 'symbol') { const { brokenFlow } = context; if (this.consequent.hasEffects(context)) return true; @@ -7105,9 +9870,7 @@ class IfStatement extends NodeBase { context.brokenFlow < consequentBrokenFlow ? context.brokenFlow : consequentBrokenFlow; return false; } - return testValue - ? this.consequent.hasEffects(context) - : this.alternate !== null && this.alternate.hasEffects(context); + return testValue ? this.consequent.hasEffects(context) : !!((_a = this.alternate) === null || _a === void 0 ? void 0 : _a.hasEffects(context)); } include(context, includeChildrenRecursively) { this.included = true; @@ -7116,7 +9879,7 @@ class IfStatement extends NodeBase { } else { const testValue = this.getTestValue(); - if (testValue === UnknownValue) { + if (typeof testValue === 'symbol') { this.includeUnknownTest(context); } else { @@ -7124,43 +9887,60 @@ class IfStatement extends NodeBase { } } } + parseNode(esTreeNode) { + this.consequentScope = new TrackingScope(this.scope); + this.consequent = new (this.context.getNodeConstructor(esTreeNode.consequent.type))(esTreeNode.consequent, this, this.consequentScope); + if (esTreeNode.alternate) { + this.alternateScope = new TrackingScope(this.scope); + this.alternate = new (this.context.getNodeConstructor(esTreeNode.alternate.type))(esTreeNode.alternate, this, this.alternateScope); + } + super.parseNode(esTreeNode); + } render(code, options) { + const { snippets: { getPropertyAccess } } = options; // Note that unknown test values are always included const testValue = this.getTestValue(); - if (!this.test.included && - (testValue ? this.alternate === null || !this.alternate.included : !this.consequent.included)) { - const singleRetainedBranch = (testValue ? this.consequent : this.alternate); - code.remove(this.start, singleRetainedBranch.start); - code.remove(singleRetainedBranch.end, this.end); - removeAnnotations(this, code); - singleRetainedBranch.render(code, options); + const hoistedDeclarations = []; + const includesIfElse = this.test.included; + const noTreeshake = !this.context.options.treeshake; + if (includesIfElse) { + this.test.render(code, options); } else { - if (this.test.included) { - this.test.render(code, options); - } - else { - code.overwrite(this.test.start, this.test.end, testValue ? 'true' : 'false'); - } - if (this.consequent.included) { - this.consequent.render(code, options); - } - else { - code.overwrite(this.consequent.start, this.consequent.end, ';'); - } - if (this.alternate !== null) { - if (this.alternate.included) { - if (code.original.charCodeAt(this.alternate.start - 1) === 101 /* e */) { + code.remove(this.start, this.consequent.start); + } + if (this.consequent.included && (noTreeshake || typeof testValue === 'symbol' || testValue)) { + this.consequent.render(code, options); + } + else { + code.overwrite(this.consequent.start, this.consequent.end, includesIfElse ? ';' : ''); + hoistedDeclarations.push(...this.consequentScope.hoistedDeclarations); + } + if (this.alternate) { + if (this.alternate.included && (noTreeshake || typeof testValue === 'symbol' || !testValue)) { + if (includesIfElse) { + if (code.original.charCodeAt(this.alternate.start - 1) === 101) { code.prependLeft(this.alternate.start, ' '); } - this.alternate.render(code, options); } else { - code.remove(this.consequent.end, this.alternate.end); + code.remove(this.consequent.end, this.alternate.start); + } + this.alternate.render(code, options); + } + else { + if (includesIfElse && this.shouldKeepAlternateBranch()) { + code.overwrite(this.alternate.start, this.end, ';'); + } + else { + code.remove(this.consequent.end, this.end); } + hoistedDeclarations.push(...this.alternateScope.hoistedDeclarations); } } + this.renderHoistedDeclarations(hoistedDeclarations, code, getPropertyAccess); } + applyDeoptimizations() { } getTestValue() { if (this.testValue === unset) { return (this.testValue = this.test.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, this)); @@ -7168,41 +9948,74 @@ class IfStatement extends NodeBase { return this.testValue; } includeKnownTest(context, testValue) { + var _a; if (this.test.shouldBeIncluded(context)) { this.test.include(context, false); } if (testValue && this.consequent.shouldBeIncluded(context)) { - this.consequent.include(context, false); + this.consequent.include(context, false, { asSingleStatement: true }); } - if (this.alternate !== null && !testValue && this.alternate.shouldBeIncluded(context)) { - this.alternate.include(context, false); + if (!testValue && ((_a = this.alternate) === null || _a === void 0 ? void 0 : _a.shouldBeIncluded(context))) { + this.alternate.include(context, false, { asSingleStatement: true }); } } includeRecursively(includeChildrenRecursively, context) { + var _a; this.test.include(context, includeChildrenRecursively); this.consequent.include(context, includeChildrenRecursively); - if (this.alternate !== null) { - this.alternate.include(context, includeChildrenRecursively); - } + (_a = this.alternate) === null || _a === void 0 ? void 0 : _a.include(context, includeChildrenRecursively); } includeUnknownTest(context) { + var _a; this.test.include(context, false); const { brokenFlow } = context; let consequentBrokenFlow = BROKEN_FLOW_NONE; if (this.consequent.shouldBeIncluded(context)) { - this.consequent.include(context, false); + this.consequent.include(context, false, { asSingleStatement: true }); consequentBrokenFlow = context.brokenFlow; context.brokenFlow = brokenFlow; } - if (this.alternate !== null && this.alternate.shouldBeIncluded(context)) { - this.alternate.include(context, false); + if ((_a = this.alternate) === null || _a === void 0 ? void 0 : _a.shouldBeIncluded(context)) { + this.alternate.include(context, false, { asSingleStatement: true }); context.brokenFlow = context.brokenFlow < consequentBrokenFlow ? context.brokenFlow : consequentBrokenFlow; } } + renderHoistedDeclarations(hoistedDeclarations, code, getPropertyAccess) { + const hoistedVars = [ + ...new Set(hoistedDeclarations.map(identifier => { + const variable = identifier.variable; + return variable.included ? variable.getName(getPropertyAccess) : ''; + })) + ] + .filter(Boolean) + .join(', '); + if (hoistedVars) { + const parentType = this.parent.type; + const needsBraces = parentType !== Program$1 && parentType !== BlockStatement$1; + code.prependRight(this.start, `${needsBraces ? '{ ' : ''}var ${hoistedVars}; `); + if (needsBraces) { + code.appendLeft(this.end, ` }`); + } + } + } + shouldKeepAlternateBranch() { + let currentParent = this.parent; + do { + if (currentParent instanceof IfStatement && currentParent.alternate) { + return true; + } + if (currentParent instanceof BlockStatement) { + return false; + } + currentParent = currentParent.parent; + } while (currentParent); + return false; + } } class ImportDeclaration extends NodeBase { + // Do not bind specifiers bind() { } hasEffects() { return false; @@ -7213,17 +10026,210 @@ class ImportDeclaration extends NodeBase { render(code, _options, nodeRenderOptions) { code.remove(nodeRenderOptions.start, nodeRenderOptions.end); } + applyDeoptimizations() { } } ImportDeclaration.prototype.needsBoundaries = true; -class ImportDefaultSpecifier$1 extends NodeBase { +class ImportDefaultSpecifier extends NodeBase { + applyDeoptimizations() { } } -class Import extends NodeBase { +const INTEROP_DEFAULT_VARIABLE = '_interopDefault'; +const INTEROP_DEFAULT_LEGACY_VARIABLE = '_interopDefaultLegacy'; +const INTEROP_NAMESPACE_VARIABLE = '_interopNamespace'; +const INTEROP_NAMESPACE_DEFAULT_VARIABLE = '_interopNamespaceDefault'; +const INTEROP_NAMESPACE_DEFAULT_ONLY_VARIABLE = '_interopNamespaceDefaultOnly'; +const MERGE_NAMESPACES_VARIABLE = '_mergeNamespaces'; +const defaultInteropHelpersByInteropType = { + auto: INTEROP_DEFAULT_VARIABLE, + default: null, + defaultOnly: null, + esModule: null, + false: null, + true: INTEROP_DEFAULT_LEGACY_VARIABLE +}; +const isDefaultAProperty = (interopType, externalLiveBindings) => interopType === 'esModule' || + (externalLiveBindings && (interopType === 'auto' || interopType === 'true')); +const namespaceInteropHelpersByInteropType = { + auto: INTEROP_NAMESPACE_VARIABLE, + default: INTEROP_NAMESPACE_DEFAULT_VARIABLE, + defaultOnly: INTEROP_NAMESPACE_DEFAULT_ONLY_VARIABLE, + esModule: null, + false: null, + true: INTEROP_NAMESPACE_VARIABLE +}; +const canDefaultBeTakenFromNamespace = (interopType, externalLiveBindings) => isDefaultAProperty(interopType, externalLiveBindings) && + defaultInteropHelpersByInteropType[interopType] === INTEROP_DEFAULT_VARIABLE; +const getHelpersBlock = (additionalHelpers, accessedGlobals, indent, snippets, liveBindings, freeze, namespaceToStringTag) => { + const usedHelpers = new Set(additionalHelpers); + for (const variable of HELPER_NAMES) { + if (accessedGlobals.has(variable)) { + usedHelpers.add(variable); + } + } + return HELPER_NAMES.map(variable => usedHelpers.has(variable) + ? HELPER_GENERATORS[variable](indent, snippets, liveBindings, freeze, namespaceToStringTag, usedHelpers) + : '').join(''); +}; +const HELPER_GENERATORS = { + [INTEROP_DEFAULT_LEGACY_VARIABLE](_t, snippets, liveBindings) { + const { _, getDirectReturnFunction, n } = snippets; + const [left, right] = getDirectReturnFunction(['e'], { + functionReturn: true, + lineBreakIndent: null, + name: INTEROP_DEFAULT_LEGACY_VARIABLE + }); + return (`${left}e${_}&&${_}typeof e${_}===${_}'object'${_}&&${_}'default'${_}in e${_}?${_}` + + `${liveBindings ? getDefaultLiveBinding(snippets) : getDefaultStatic(snippets)}${right}${n}${n}`); + }, + [INTEROP_DEFAULT_VARIABLE](_t, snippets, liveBindings) { + const { _, getDirectReturnFunction, n } = snippets; + const [left, right] = getDirectReturnFunction(['e'], { + functionReturn: true, + lineBreakIndent: null, + name: INTEROP_DEFAULT_VARIABLE + }); + return (`${left}e${_}&&${_}e.__esModule${_}?${_}` + + `${liveBindings ? getDefaultLiveBinding(snippets) : getDefaultStatic(snippets)}${right}${n}${n}`); + }, + [INTEROP_NAMESPACE_DEFAULT_ONLY_VARIABLE](_t, snippets, _liveBindings, freeze, namespaceToStringTag) { + const { getDirectReturnFunction, getObject, n } = snippets; + const [left, right] = getDirectReturnFunction(['e'], { + functionReturn: true, + lineBreakIndent: null, + name: INTEROP_NAMESPACE_DEFAULT_ONLY_VARIABLE + }); + return `${left}${getFrozen(freeze, getWithToStringTag(namespaceToStringTag, getObject([ + ['__proto__', 'null'], + ['default', 'e'] + ], { lineBreakIndent: null }), snippets))}${right}${n}${n}`; + }, + [INTEROP_NAMESPACE_DEFAULT_VARIABLE](t, snippets, liveBindings, freeze, namespaceToStringTag) { + const { _, n } = snippets; + return (`function ${INTEROP_NAMESPACE_DEFAULT_VARIABLE}(e)${_}{${n}` + + createNamespaceObject(t, t, snippets, liveBindings, freeze, namespaceToStringTag) + + `}${n}${n}`); + }, + [INTEROP_NAMESPACE_VARIABLE](t, snippets, liveBindings, freeze, namespaceToStringTag, usedHelpers) { + const { _, getDirectReturnFunction, n } = snippets; + if (usedHelpers.has(INTEROP_NAMESPACE_DEFAULT_VARIABLE)) { + const [left, right] = getDirectReturnFunction(['e'], { + functionReturn: true, + lineBreakIndent: null, + name: INTEROP_NAMESPACE_VARIABLE + }); + return `${left}e${_}&&${_}e.__esModule${_}?${_}e${_}:${_}${INTEROP_NAMESPACE_DEFAULT_VARIABLE}(e)${right}${n}${n}`; + } + return (`function ${INTEROP_NAMESPACE_VARIABLE}(e)${_}{${n}` + + `${t}if${_}(e${_}&&${_}e.__esModule)${_}return e;${n}` + + createNamespaceObject(t, t, snippets, liveBindings, freeze, namespaceToStringTag) + + `}${n}${n}`); + }, + [MERGE_NAMESPACES_VARIABLE](t, snippets, liveBindings, freeze, namespaceToStringTag) { + const { _, cnst, n } = snippets; + const useForEach = cnst === 'var' && liveBindings; + return (`function ${MERGE_NAMESPACES_VARIABLE}(n, m)${_}{${n}` + + `${t}${loopOverNamespaces(`{${n}` + + `${t}${t}${t}if${_}(k${_}!==${_}'default'${_}&&${_}!(k in n))${_}{${n}` + + (liveBindings + ? useForEach + ? copyOwnPropertyLiveBinding + : copyPropertyLiveBinding + : copyPropertyStatic)(t, t + t + t + t, snippets) + + `${t}${t}${t}}${n}` + + `${t}${t}}`, useForEach, t, snippets)}${n}` + + `${t}return ${getFrozen(freeze, getWithToStringTag(namespaceToStringTag, 'n', snippets))};${n}` + + `}${n}${n}`); + } +}; +const getDefaultLiveBinding = ({ _, getObject }) => `e${_}:${_}${getObject([['default', 'e']], { lineBreakIndent: null })}`; +const getDefaultStatic = ({ _, getPropertyAccess }) => `e${getPropertyAccess('default')}${_}:${_}e`; +const createNamespaceObject = (t, i, snippets, liveBindings, freeze, namespaceToStringTag) => { + const { _, cnst, getObject, getPropertyAccess, n, s } = snippets; + const copyProperty = `{${n}` + + (liveBindings ? copyNonDefaultOwnPropertyLiveBinding : copyPropertyStatic)(t, i + t + t, snippets) + + `${i}${t}}`; + return (`${i}${cnst} n${_}=${_}Object.create(null${namespaceToStringTag + ? `,${_}{${_}[Symbol.toStringTag]:${_}${getToStringTagValue(getObject)}${_}}` + : ''});${n}` + + `${i}if${_}(e)${_}{${n}` + + `${i}${t}${loopOverKeys(copyProperty, !liveBindings, snippets)}${n}` + + `${i}}${n}` + + `${i}n${getPropertyAccess('default')}${_}=${_}e;${n}` + + `${i}return ${getFrozen(freeze, 'n')}${s}${n}`); +}; +const loopOverKeys = (body, allowVarLoopVariable, { _, cnst, getFunctionIntro, s }) => cnst !== 'var' || allowVarLoopVariable + ? `for${_}(${cnst} k in e)${_}${body}` + : `Object.keys(e).forEach(${getFunctionIntro(['k'], { + isAsync: false, + name: null + })}${body})${s}`; +const loopOverNamespaces = (body, useForEach, t, { _, cnst, getDirectReturnFunction, getFunctionIntro, n }) => { + if (useForEach) { + const [left, right] = getDirectReturnFunction(['e'], { + functionReturn: false, + lineBreakIndent: { base: t, t }, + name: null + }); + return (`m.forEach(${left}` + + `e${_}&&${_}typeof e${_}!==${_}'string'${_}&&${_}!Array.isArray(e)${_}&&${_}Object.keys(e).forEach(${getFunctionIntro(['k'], { + isAsync: false, + name: null + })}${body})${right});`); + } + return (`for${_}(var i${_}=${_}0;${_}i${_}<${_}m.length;${_}i++)${_}{${n}` + + `${t}${t}${cnst} e${_}=${_}m[i];${n}` + + `${t}${t}if${_}(typeof e${_}!==${_}'string'${_}&&${_}!Array.isArray(e))${_}{${_}for${_}(${cnst} k in e)${_}${body}${_}}${n}${t}}`); +}; +const copyNonDefaultOwnPropertyLiveBinding = (t, i, snippets) => { + const { _, n } = snippets; + return (`${i}if${_}(k${_}!==${_}'default')${_}{${n}` + + copyOwnPropertyLiveBinding(t, i + t, snippets) + + `${i}}${n}`); +}; +const copyOwnPropertyLiveBinding = (t, i, { _, cnst, getDirectReturnFunction, n }) => { + const [left, right] = getDirectReturnFunction([], { + functionReturn: true, + lineBreakIndent: null, + name: null + }); + return (`${i}${cnst} d${_}=${_}Object.getOwnPropertyDescriptor(e,${_}k);${n}` + + `${i}Object.defineProperty(n,${_}k,${_}d.get${_}?${_}d${_}:${_}{${n}` + + `${i}${t}enumerable:${_}true,${n}` + + `${i}${t}get:${_}${left}e[k]${right}${n}` + + `${i}});${n}`); +}; +const copyPropertyLiveBinding = (t, i, { _, cnst, getDirectReturnFunction, n }) => { + const [left, right] = getDirectReturnFunction([], { + functionReturn: true, + lineBreakIndent: null, + name: null + }); + return (`${i}${cnst} d${_}=${_}Object.getOwnPropertyDescriptor(e,${_}k);${n}` + + `${i}if${_}(d)${_}{${n}` + + `${i}${t}Object.defineProperty(n,${_}k,${_}d.get${_}?${_}d${_}:${_}{${n}` + + `${i}${t}${t}enumerable:${_}true,${n}` + + `${i}${t}${t}get:${_}${left}e[k]${right}${n}` + + `${i}${t}});${n}` + + `${i}}${n}`); +}; +const copyPropertyStatic = (_t, i, { _, n }) => `${i}n[k]${_}=${_}e[k];${n}`; +const getFrozen = (freeze, fragment) => freeze ? `Object.freeze(${fragment})` : fragment; +const getWithToStringTag = (namespaceToStringTag, fragment, { _, getObject }) => namespaceToStringTag + ? `Object.defineProperty(${fragment},${_}Symbol.toStringTag,${_}${getToStringTagValue(getObject)})` + : fragment; +const HELPER_NAMES = Object.keys(HELPER_GENERATORS); +function getToStringTagValue(getObject) { + return getObject([['value', "'Module'"]], { + lineBreakIndent: null + }); +} + +class ImportExpression extends NodeBase { constructor() { super(...arguments); this.inlineNamespace = null; - this.exportMode = 'auto'; + this.mechanism = null; this.resolution = null; } hasEffects() { @@ -7242,114 +10248,163 @@ class Import extends NodeBase { } render(code, options) { if (this.inlineNamespace) { - const _ = options.compact ? '' : ' '; - const s = options.compact ? '' : ';'; - code.overwrite(this.start, this.end, `Promise.resolve().then(function${_}()${_}{${_}return ${this.inlineNamespace.getName()}${s}${_}})`); + const { snippets: { getDirectReturnFunction, getPropertyAccess } } = options; + const [left, right] = getDirectReturnFunction([], { + functionReturn: true, + lineBreakIndent: null, + name: null + }); + code.overwrite(this.start, this.end, `Promise.resolve().then(${left}${this.inlineNamespace.getName(getPropertyAccess)}${right})`, { contentOnly: true }); return; } - const importMechanism = this.getDynamicImportMechanism(options); - if (importMechanism) { - code.overwrite(this.start, findFirstOccurrenceOutsideComment(code.original, '(', this.start + 6) + 1, importMechanism.left); - code.overwrite(this.end - 1, this.end, importMechanism.right); + if (this.mechanism) { + code.overwrite(this.start, findFirstOccurrenceOutsideComment(code.original, '(', this.start + 6) + 1, this.mechanism.left, { contentOnly: true }); + code.overwrite(this.end - 1, this.end, this.mechanism.right, { contentOnly: true }); } this.source.render(code, options); } - renderFinalResolution(code, resolution, namespaceExportName, options) { + renderFinalResolution(code, resolution, namespaceExportName, { getDirectReturnFunction }) { code.overwrite(this.source.start, this.source.end, resolution); if (namespaceExportName) { - const _ = options.compact ? '' : ' '; - const s = options.compact ? '' : ';'; - code.appendLeft(this.end, `.then(function${_}(n)${_}{${_}return n.${namespaceExportName}${s}${_}})`); + const [left, right] = getDirectReturnFunction(['n'], { + functionReturn: true, + lineBreakIndent: null, + name: null + }); + code.prependLeft(this.end, `.then(${left}n.${namespaceExportName}${right})`); } } - setExternalResolution(exportMode, resolution) { - this.exportMode = exportMode; + setExternalResolution(exportMode, resolution, options, snippets, pluginDriver, accessedGlobalsByScope) { + const { format } = options; + this.inlineNamespace = null; this.resolution = resolution; - this.scope.addAccessedGlobalsByFormat({ - amd: ['require'], - cjs: ['require'], - system: ['module'] - }); - if (exportMode === 'auto') { - this.scope.addAccessedGlobalsByFormat({ - amd: [INTEROP_NAMESPACE_VARIABLE], - cjs: [INTEROP_NAMESPACE_VARIABLE] - }); + const accessedGlobals = [...(accessedImportGlobals[format] || [])]; + let helper; + ({ helper, mechanism: this.mechanism } = this.getDynamicImportMechanismAndHelper(resolution, exportMode, options, snippets, pluginDriver)); + if (helper) { + accessedGlobals.push(helper); + } + if (accessedGlobals.length > 0) { + this.scope.addAccessedGlobals(accessedGlobals, accessedGlobalsByScope); } } setInternalResolution(inlineNamespace) { this.inlineNamespace = inlineNamespace; } - getDynamicImportMechanism(options) { - const mechanism = options.outputPluginDriver.hookFirstSync('renderDynamicImport', [ + applyDeoptimizations() { } + getDynamicImportMechanismAndHelper(resolution, exportMode, { compact, dynamicImportFunction, format, generatedCode: { arrowFunctions }, interop }, { _, getDirectReturnFunction, getDirectReturnIifeLeft }, pluginDriver) { + const mechanism = pluginDriver.hookFirstSync('renderDynamicImport', [ { customResolution: typeof this.resolution === 'string' ? this.resolution : null, - format: options.format, + format, moduleId: this.context.module.id, targetModuleId: this.resolution && typeof this.resolution !== 'string' ? this.resolution.id : null } ]); if (mechanism) { - return mechanism; + return { helper: null, mechanism }; } - switch (options.format) { + const hasDynamicTarget = !this.resolution || typeof this.resolution === 'string'; + switch (format) { case 'cjs': { - const _ = options.compact ? '' : ' '; - const s = options.compact ? '' : ';'; - const leftStart = `Promise.resolve().then(function${_}()${_}{${_}return`; - switch (this.exportMode) { - case 'default': - return { - left: `${leftStart}${_}{${_}'default':${_}require(`, - right: `)${_}}${s}${_}})` - }; - case 'auto': - return { - left: `${leftStart} ${INTEROP_NAMESPACE_VARIABLE}(require(`, - right: `))${s}${_}})` - }; - default: - return { - left: `${leftStart} require(`, - right: `)${s}${_}})` - }; + const helper = getInteropHelper(resolution, exportMode, interop); + let left = `require(`; + let right = `)`; + if (helper) { + left = `/*#__PURE__*/${helper}(${left}`; + right += ')'; + } + const [functionLeft, functionRight] = getDirectReturnFunction([], { + functionReturn: true, + lineBreakIndent: null, + name: null + }); + left = `Promise.resolve().then(${functionLeft}${left}`; + right += `${functionRight})`; + if (!arrowFunctions && hasDynamicTarget) { + left = getDirectReturnIifeLeft(['t'], `${left}t${right}`, { + needsArrowReturnParens: false, + needsWrappedFunction: true + }); + right = ')'; } + return { + helper, + mechanism: { left, right } + }; } case 'amd': { - const _ = options.compact ? '' : ' '; - const resolve = options.compact ? 'c' : 'resolve'; - const reject = options.compact ? 'e' : 'reject'; - const resolveNamespace = this.exportMode === 'default' - ? `function${_}(m)${_}{${_}${resolve}({${_}'default':${_}m${_}});${_}}` - : this.exportMode === 'auto' - ? `function${_}(m)${_}{${_}${resolve}(${INTEROP_NAMESPACE_VARIABLE}(m));${_}}` - : resolve; + const resolve = compact ? 'c' : 'resolve'; + const reject = compact ? 'e' : 'reject'; + const helper = getInteropHelper(resolution, exportMode, interop); + const [resolveLeft, resolveRight] = getDirectReturnFunction(['m'], { + functionReturn: false, + lineBreakIndent: null, + name: null + }); + const resolveNamespace = helper + ? `${resolveLeft}${resolve}(/*#__PURE__*/${helper}(m))${resolveRight}` + : resolve; + const [handlerLeft, handlerRight] = getDirectReturnFunction([resolve, reject], { + functionReturn: false, + lineBreakIndent: null, + name: null + }); + let left = `new Promise(${handlerLeft}require([`; + let right = `],${_}${resolveNamespace},${_}${reject})${handlerRight})`; + if (!arrowFunctions && hasDynamicTarget) { + left = getDirectReturnIifeLeft(['t'], `${left}t${right}`, { + needsArrowReturnParens: false, + needsWrappedFunction: true + }); + right = ')'; + } return { - left: `new Promise(function${_}(${resolve},${_}${reject})${_}{${_}require([`, - right: `],${_}${resolveNamespace},${_}${reject})${_}})` + helper, + mechanism: { left, right } }; } case 'system': return { - left: 'module.import(', - right: ')' + helper: null, + mechanism: { + left: 'module.import(', + right: ')' + } }; case 'es': - if (options.dynamicImportFunction) { + if (dynamicImportFunction) { return { - left: `${options.dynamicImportFunction}(`, - right: ')' + helper: null, + mechanism: { + left: `${dynamicImportFunction}(`, + right: ')' + } }; } } - return null; + return { helper: null, mechanism: null }; } } +function getInteropHelper(resolution, exportMode, interop) { + return exportMode === 'external' + ? namespaceInteropHelpersByInteropType[String(interop(resolution instanceof ExternalModule ? resolution.id : null))] + : exportMode === 'default' + ? INTEROP_NAMESPACE_DEFAULT_ONLY_VARIABLE + : null; +} +const accessedImportGlobals = { + amd: ['require'], + cjs: ['require'], + system: ['module'] +}; -class ImportNamespaceSpecifier$1 extends NodeBase { +class ImportNamespaceSpecifier extends NodeBase { + applyDeoptimizations() { } } class ImportSpecifier extends NodeBase { + applyDeoptimizations() { } } class LabeledStatement extends NodeBase { @@ -7380,7 +10435,7 @@ class LabeledStatement extends NodeBase { this.label.render(code, options); } else { - code.remove(this.start, findFirstOccurrenceOutsideComment(code.original, ':', this.label.end) + 1); + code.remove(this.start, findNonWhiteSpace(code.original, findFirstOccurrenceOutsideComment(code.original, ':', this.label.end) + 1)); } this.body.render(code, options); } @@ -7392,144 +10447,125 @@ class LogicalExpression extends NodeBase { // We collect deoptimization information if usedBranch !== null this.expressionsToBeDeoptimized = []; this.isBranchResolutionAnalysed = false; - this.unusedBranch = null; this.usedBranch = null; - this.wasPathDeoptimizedWhileOptimized = false; - } - bind() { - super.bind(); - // ensure the usedBranch is set for the tree-shaking passes - this.getUsedBranch(); } deoptimizeCache() { - if (this.usedBranch !== null) { + if (this.usedBranch) { + const unusedBranch = this.usedBranch === this.left ? this.right : this.left; this.usedBranch = null; - const expressionsToBeDeoptimized = this.expressionsToBeDeoptimized; - this.expressionsToBeDeoptimized = []; - if (this.wasPathDeoptimizedWhileOptimized) { - this.unusedBranch.deoptimizePath(UNKNOWN_PATH); - } - for (const expression of expressionsToBeDeoptimized) { + unusedBranch.deoptimizePath(UNKNOWN_PATH); + for (const expression of this.expressionsToBeDeoptimized) { expression.deoptimizeCache(); } + // Request another pass because we need to ensure "include" runs again if + // it is rendered + this.context.requestTreeshakingPass(); } } deoptimizePath(path) { const usedBranch = this.getUsedBranch(); - if (usedBranch === null) { + if (!usedBranch) { this.left.deoptimizePath(path); this.right.deoptimizePath(path); } else { - this.wasPathDeoptimizedWhileOptimized = true; usedBranch.deoptimizePath(path); } } + deoptimizeThisOnInteractionAtPath(interaction, path, recursionTracker) { + this.left.deoptimizeThisOnInteractionAtPath(interaction, path, recursionTracker); + this.right.deoptimizeThisOnInteractionAtPath(interaction, path, recursionTracker); + } getLiteralValueAtPath(path, recursionTracker, origin) { const usedBranch = this.getUsedBranch(); - if (usedBranch === null) + if (!usedBranch) return UnknownValue; this.expressionsToBeDeoptimized.push(origin); return usedBranch.getLiteralValueAtPath(path, recursionTracker, origin); } - getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin) { + getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin) { const usedBranch = this.getUsedBranch(); - if (usedBranch === null) + if (!usedBranch) return new MultiExpression([ - this.left.getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin), - this.right.getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin) + this.left.getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin), + this.right.getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin) ]); this.expressionsToBeDeoptimized.push(origin); - return usedBranch.getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin); + return usedBranch.getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin); } hasEffects(context) { if (this.left.hasEffects(context)) { return true; } - if (this.usedBranch !== this.left) { + if (this.getUsedBranch() !== this.left) { return this.right.hasEffects(context); } return false; } - hasEffectsWhenAccessedAtPath(path, context) { - if (path.length === 0) - return false; - if (this.usedBranch === null) { - return (this.left.hasEffectsWhenAccessedAtPath(path, context) || - this.right.hasEffectsWhenAccessedAtPath(path, context)); - } - return this.usedBranch.hasEffectsWhenAccessedAtPath(path, context); - } - hasEffectsWhenAssignedAtPath(path, context) { - if (path.length === 0) - return true; - if (this.usedBranch === null) { - return (this.left.hasEffectsWhenAssignedAtPath(path, context) || - this.right.hasEffectsWhenAssignedAtPath(path, context)); - } - return this.usedBranch.hasEffectsWhenAssignedAtPath(path, context); - } - hasEffectsWhenCalledAtPath(path, callOptions, context) { - if (this.usedBranch === null) { - return (this.left.hasEffectsWhenCalledAtPath(path, callOptions, context) || - this.right.hasEffectsWhenCalledAtPath(path, callOptions, context)); + hasEffectsOnInteractionAtPath(path, interaction, context) { + const usedBranch = this.getUsedBranch(); + if (!usedBranch) { + return (this.left.hasEffectsOnInteractionAtPath(path, interaction, context) || + this.right.hasEffectsOnInteractionAtPath(path, interaction, context)); } - return this.usedBranch.hasEffectsWhenCalledAtPath(path, callOptions, context); + return usedBranch.hasEffectsOnInteractionAtPath(path, interaction, context); } include(context, includeChildrenRecursively) { this.included = true; + const usedBranch = this.getUsedBranch(); if (includeChildrenRecursively || - (this.usedBranch === this.right && this.left.shouldBeIncluded(context)) || - this.usedBranch === null) { + (usedBranch === this.right && this.left.shouldBeIncluded(context)) || + !usedBranch) { this.left.include(context, includeChildrenRecursively); this.right.include(context, includeChildrenRecursively); } else { - this.usedBranch.include(context, includeChildrenRecursively); + usedBranch.include(context, includeChildrenRecursively); } } - render(code, options, { renderedParentType, isCalleeOfRenderedParent, preventASI } = BLANK) { + render(code, options, { isCalleeOfRenderedParent, preventASI, renderedParentType, renderedSurroundingElement } = BLANK) { if (!this.left.included || !this.right.included) { const operatorPos = findFirstOccurrenceOutsideComment(code.original, this.operator, this.left.end); if (this.right.included) { - code.remove(this.start, operatorPos + 2); + const removePos = findNonWhiteSpace(code.original, operatorPos + 2); + code.remove(this.start, removePos); if (preventASI) { - removeLineBreaks(code, operatorPos + 2, this.right.start); + removeLineBreaks(code, removePos, this.right.start); } } else { code.remove(operatorPos, this.end); } removeAnnotations(this, code); - this.usedBranch.render(code, options, { - isCalleeOfRenderedParent: renderedParentType - ? isCalleeOfRenderedParent - : this.parent.callee === this, - renderedParentType: renderedParentType || this.parent.type + this.getUsedBranch().render(code, options, { + isCalleeOfRenderedParent, + preventASI, + renderedParentType: renderedParentType || this.parent.type, + renderedSurroundingElement: renderedSurroundingElement || this.parent.type }); } else { - super.render(code, options); + this.left.render(code, options, { + preventASI, + renderedSurroundingElement + }); + this.right.render(code, options); } } getUsedBranch() { if (!this.isBranchResolutionAnalysed) { this.isBranchResolutionAnalysed = true; const leftValue = this.left.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, this); - if (leftValue === UnknownValue) { + if (typeof leftValue === 'symbol') { return null; } else { - if ((this.operator === '||' && leftValue) || - (this.operator === '&&' && !leftValue) || - (this.operator === '??' && leftValue != null)) { - this.usedBranch = this.left; - this.unusedBranch = this.right; - } - else { - this.usedBranch = this.right; - this.unusedBranch = this.left; - } + this.usedBranch = + (this.operator === '||' && leftValue) || + (this.operator === '&&' && !leftValue) || + (this.operator === '??' && leftValue != null) + ? this.left + : this.right; } } return this.usedBranch; @@ -7540,39 +10576,46 @@ const ASSET_PREFIX = 'ROLLUP_ASSET_URL_'; const CHUNK_PREFIX = 'ROLLUP_CHUNK_URL_'; const FILE_PREFIX = 'ROLLUP_FILE_URL_'; class MetaProperty extends NodeBase { + addAccessedGlobals(format, accessedGlobalsByScope) { + const metaProperty = this.metaProperty; + const accessedGlobals = (metaProperty && + (metaProperty.startsWith(FILE_PREFIX) || + metaProperty.startsWith(ASSET_PREFIX) || + metaProperty.startsWith(CHUNK_PREFIX)) + ? accessedFileUrlGlobals + : accessedMetaUrlGlobals)[format]; + if (accessedGlobals.length > 0) { + this.scope.addAccessedGlobals(accessedGlobals, accessedGlobalsByScope); + } + } + getReferencedFileName(outputPluginDriver) { + const metaProperty = this.metaProperty; + if (metaProperty && metaProperty.startsWith(FILE_PREFIX)) { + return outputPluginDriver.getFileName(metaProperty.substring(FILE_PREFIX.length)); + } + return null; + } hasEffects() { return false; } - hasEffectsWhenAccessedAtPath(path) { - return path.length > 1; + hasEffectsOnInteractionAtPath(path, { type }) { + return path.length > 1 || type !== INTERACTION_ACCESSED; } include() { if (!this.included) { this.included = true; - const parent = this.parent; - const metaProperty = (this.metaProperty = - parent instanceof MemberExpression && typeof parent.propertyKey === 'string' - ? parent.propertyKey - : null); - if (metaProperty && - (metaProperty.startsWith(FILE_PREFIX) || - metaProperty.startsWith(ASSET_PREFIX) || - metaProperty.startsWith(CHUNK_PREFIX))) { - this.scope.addAccessedGlobalsByFormat(accessedFileUrlGlobals); - } - else { - this.scope.addAccessedGlobalsByFormat(accessedMetaUrlGlobals); + if (this.meta.name === 'import') { + this.context.addImportMeta(this); + const parent = this.parent; + this.metaProperty = + parent instanceof MemberExpression && typeof parent.propertyKey === 'string' + ? parent.propertyKey + : null; } } } - initialise() { - if (this.meta.name === 'import') { - this.context.addImportMeta(this); - } - } - renderFinalMechanism(code, chunkId, format, outputPluginDriver) { - if (!this.included) - return; + renderFinalMechanism(code, chunkId, format, snippets, outputPluginDriver) { + var _a; const parent = this.parent; const metaProperty = this.metaProperty; if (metaProperty && @@ -7584,17 +10627,17 @@ class MetaProperty extends NodeBase { let chunkReferenceId = null; let fileName; if (metaProperty.startsWith(FILE_PREFIX)) { - referenceId = metaProperty.substr(FILE_PREFIX.length); + referenceId = metaProperty.substring(FILE_PREFIX.length); fileName = outputPluginDriver.getFileName(referenceId); } else if (metaProperty.startsWith(ASSET_PREFIX)) { warnDeprecation(`Using the "${ASSET_PREFIX}" prefix to reference files is deprecated. Use the "${FILE_PREFIX}" prefix instead.`, true, this.context.options); - assetReferenceId = metaProperty.substr(ASSET_PREFIX.length); + assetReferenceId = metaProperty.substring(ASSET_PREFIX.length); fileName = outputPluginDriver.getFileName(assetReferenceId); } else { warnDeprecation(`Using the "${CHUNK_PREFIX}" prefix to reference files is deprecated. Use the "${FILE_PREFIX}" prefix instead.`, true, this.context.options); - chunkReferenceId = metaProperty.substr(CHUNK_PREFIX.length); + chunkReferenceId = metaProperty.substring(CHUNK_PREFIX.length); fileName = outputPluginDriver.getFileName(chunkReferenceId); } const relativePath = normalize(relative$1(dirname(chunkId), fileName)); @@ -7635,8 +10678,7 @@ class MetaProperty extends NodeBase { format, moduleId: this.context.module.id } - ]) || - (importMetaMechanisms[format] && importMetaMechanisms[format](metaProperty, chunkId)); + ]) || ((_a = importMetaMechanisms[format]) === null || _a === void 0 ? void 0 : _a.call(importMetaMechanisms, metaProperty, { chunkId, snippets })); if (typeof replacement === 'string') { if (parent instanceof MemberExpression) { code.overwrite(parent.start, parent.end, replacement, { contentOnly: true }); @@ -7650,6 +10692,7 @@ class MetaProperty extends NodeBase { const accessedMetaUrlGlobals = { amd: ['document', 'module', 'URL'], cjs: ['document', 'require', 'URL'], + es: [], iife: ['document', 'URL'], system: ['module'], umd: ['document', 'require', 'URL'] @@ -7657,17 +10700,22 @@ const accessedMetaUrlGlobals = { const accessedFileUrlGlobals = { amd: ['document', 'require', 'URL'], cjs: ['document', 'require', 'URL'], + es: [], iife: ['document', 'URL'], system: ['module', 'URL'], umd: ['document', 'require', 'URL'] }; const getResolveUrl = (path, URL = 'URL') => `new ${URL}(${path}).href`; -const getRelativeUrlFromDocument = (relativePath) => getResolveUrl(`'${relativePath}', document.currentScript && document.currentScript.src || document.baseURI`); -const getGenericImportMetaMechanism = (getUrl) => (prop, chunkId) => { +const getRelativeUrlFromDocument = (relativePath, umd = false) => getResolveUrl(`'${relativePath}', ${umd ? `typeof document === 'undefined' ? location.href : ` : ''}document.currentScript && document.currentScript.src || document.baseURI`); +const getGenericImportMetaMechanism = (getUrl) => (prop, { chunkId }) => { const urlMechanism = getUrl(chunkId); - return prop === null ? `({ url: ${urlMechanism} })` : prop === 'url' ? urlMechanism : 'undefined'; + return prop === null + ? `({ url: ${urlMechanism} })` + : prop === 'url' + ? urlMechanism + : 'undefined'; }; -const getUrlFromDocument = (chunkId) => `(document.currentScript && document.currentScript.src || new URL('${chunkId}', document.baseURI).href)`; +const getUrlFromDocument = (chunkId, umd = false) => `${umd ? `typeof document === 'undefined' ? location.href : ` : ''}(document.currentScript && document.currentScript.src || new URL('${chunkId}', document.baseURI).href)`; const relativeUrlMechanisms = { amd: relativePath => { if (relativePath[0] !== '.') @@ -7678,350 +10726,149 @@ const relativeUrlMechanisms = { es: relativePath => getResolveUrl(`'${relativePath}', import.meta.url`), iife: relativePath => getRelativeUrlFromDocument(relativePath), system: relativePath => getResolveUrl(`'${relativePath}', module.meta.url`), - umd: relativePath => `(typeof document === 'undefined' ? ${getResolveUrl(`'file:' + __dirname + '/${relativePath}'`, `(require('u' + 'rl').URL)`)} : ${getRelativeUrlFromDocument(relativePath)})` + umd: relativePath => `(typeof document === 'undefined' && typeof location === 'undefined' ? ${getResolveUrl(`'file:' + __dirname + '/${relativePath}'`, `(require('u' + 'rl').URL)`)} : ${getRelativeUrlFromDocument(relativePath, true)})` }; const importMetaMechanisms = { amd: getGenericImportMetaMechanism(() => getResolveUrl(`module.uri, document.baseURI`)), cjs: getGenericImportMetaMechanism(chunkId => `(typeof document === 'undefined' ? ${getResolveUrl(`'file:' + __filename`, `(require('u' + 'rl').URL)`)} : ${getUrlFromDocument(chunkId)})`), iife: getGenericImportMetaMechanism(chunkId => getUrlFromDocument(chunkId)), - system: prop => (prop === null ? `module.meta` : `module.meta.${prop}`), - umd: getGenericImportMetaMechanism(chunkId => `(typeof document === 'undefined' ? ${getResolveUrl(`'file:' + __filename`, `(require('u' + 'rl').URL)`)} : ${getUrlFromDocument(chunkId)})`) + system: (prop, { snippets: { getPropertyAccess } }) => prop === null ? `module.meta` : `module.meta${getPropertyAccess(prop)}`, + umd: getGenericImportMetaMechanism(chunkId => `(typeof document === 'undefined' && typeof location === 'undefined' ? ${getResolveUrl(`'file:' + __filename`, `(require('u' + 'rl').URL)`)} : ${getUrlFromDocument(chunkId, true)})`) }; class NewExpression extends NodeBase { - bind() { - super.bind(); - for (const argument of this.arguments) { - // This will make sure all properties of parameters behave as "unknown" - argument.deoptimizePath(UNKNOWN_PATH); - } - } hasEffects(context) { - for (const argument of this.arguments) { - if (argument.hasEffects(context)) - return true; + try { + for (const argument of this.arguments) { + if (argument.hasEffects(context)) + return true; + } + if (this.context.options.treeshake.annotations && + this.annotations) { + return false; + } + return (this.callee.hasEffects(context) || + this.callee.hasEffectsOnInteractionAtPath(EMPTY_PATH, this.interaction, context)); } - if (this.context.options.treeshake.annotations && - this.annotatedPure) - return false; - return (this.callee.hasEffects(context) || - this.callee.hasEffectsWhenCalledAtPath(EMPTY_PATH, this.callOptions, context)); + finally { + if (!this.deoptimized) + this.applyDeoptimizations(); + } + } + hasEffectsOnInteractionAtPath(path, { type }) { + return path.length > 0 || type !== INTERACTION_ACCESSED; } - hasEffectsWhenAccessedAtPath(path) { - return path.length > 1; + include(context, includeChildrenRecursively) { + if (!this.deoptimized) + this.applyDeoptimizations(); + if (includeChildrenRecursively) { + super.include(context, includeChildrenRecursively); + } + else { + this.included = true; + this.callee.include(context, false); + } + this.callee.includeCallArguments(context, this.arguments); } initialise() { - this.callOptions = { + this.interaction = { args: this.arguments, + thisArg: null, + type: INTERACTION_CALLED, withNew: true }; } -} - -class SpreadElement extends NodeBase { - bind() { - super.bind(); - // Only properties of properties of the argument could become subject to reassignment - // This will also reassign the return values of iterators - this.argument.deoptimizePath([UnknownKey, UnknownKey]); + render(code, options) { + this.callee.render(code, options); + renderCallArguments(code, options, this); + } + applyDeoptimizations() { + this.deoptimized = true; + for (const argument of this.arguments) { + // This will make sure all properties of parameters behave as "unknown" + argument.deoptimizePath(UNKNOWN_PATH); + } + this.context.requestTreeshakingPass(); } } class ObjectExpression extends NodeBase { constructor() { super(...arguments); - this.deoptimizedPaths = new Set(); - // We collect deoptimization information if we can resolve a computed property access - this.expressionsToBeDeoptimized = new Map(); - this.hasUnknownDeoptimizedProperty = false; - this.propertyMap = null; - this.unmatchablePropertiesRead = []; - this.unmatchablePropertiesWrite = []; - } - bind() { - super.bind(); - // ensure the propertyMap is set for the tree-shaking passes - this.getPropertyMap(); + this.objectEntity = null; } - // We could also track this per-property but this would quickly become much more complex deoptimizeCache() { - if (!this.hasUnknownDeoptimizedProperty) - this.deoptimizeAllProperties(); + this.getObjectEntity().deoptimizeAllProperties(); } deoptimizePath(path) { - if (this.hasUnknownDeoptimizedProperty) - return; - const propertyMap = this.getPropertyMap(); - const key = path[0]; - if (path.length === 1) { - if (typeof key !== 'string') { - this.deoptimizeAllProperties(); - return; - } - if (!this.deoptimizedPaths.has(key)) { - this.deoptimizedPaths.add(key); - // we only deoptimizeCache exact matches as in all other cases, - // we do not return a literal value or return expression - const expressionsToBeDeoptimized = this.expressionsToBeDeoptimized.get(key); - if (expressionsToBeDeoptimized) { - for (const expression of expressionsToBeDeoptimized) { - expression.deoptimizeCache(); - } - } - } - } - const subPath = path.length === 1 ? UNKNOWN_PATH : path.slice(1); - for (const property of typeof key === 'string' - ? propertyMap[key] - ? propertyMap[key].propertiesRead - : [] - : this.properties) { - property.deoptimizePath(subPath); - } - } - getLiteralValueAtPath(path, recursionTracker, origin) { - const propertyMap = this.getPropertyMap(); - const key = path[0]; - if (path.length === 0 || - this.hasUnknownDeoptimizedProperty || - typeof key !== 'string' || - this.deoptimizedPaths.has(key)) - return UnknownValue; - if (path.length === 1 && - !propertyMap[key] && - !objectMembers[key] && - this.unmatchablePropertiesRead.length === 0) { - const expressionsToBeDeoptimized = this.expressionsToBeDeoptimized.get(key); - if (expressionsToBeDeoptimized) { - expressionsToBeDeoptimized.push(origin); - } - else { - this.expressionsToBeDeoptimized.set(key, [origin]); - } - return undefined; - } - if (!propertyMap[key] || - propertyMap[key].exactMatchRead === null || - propertyMap[key].propertiesRead.length > 1) { - return UnknownValue; - } - const expressionsToBeDeoptimized = this.expressionsToBeDeoptimized.get(key); - if (expressionsToBeDeoptimized) { - expressionsToBeDeoptimized.push(origin); - } - else { - this.expressionsToBeDeoptimized.set(key, [origin]); - } - return propertyMap[key].exactMatchRead.getLiteralValueAtPath(path.slice(1), recursionTracker, origin); + this.getObjectEntity().deoptimizePath(path); } - getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin) { - const propertyMap = this.getPropertyMap(); - const key = path[0]; - if (path.length === 0 || - this.hasUnknownDeoptimizedProperty || - typeof key !== 'string' || - this.deoptimizedPaths.has(key)) - return UNKNOWN_EXPRESSION; - if (path.length === 1 && - objectMembers[key] && - this.unmatchablePropertiesRead.length === 0 && - (!propertyMap[key] || propertyMap[key].exactMatchRead === null)) - return getMemberReturnExpressionWhenCalled(objectMembers, key); - if (!propertyMap[key] || - propertyMap[key].exactMatchRead === null || - propertyMap[key].propertiesRead.length > 1) - return UNKNOWN_EXPRESSION; - const expressionsToBeDeoptimized = this.expressionsToBeDeoptimized.get(key); - if (expressionsToBeDeoptimized) { - expressionsToBeDeoptimized.push(origin); - } - else { - this.expressionsToBeDeoptimized.set(key, [origin]); - } - return propertyMap[key].exactMatchRead.getReturnExpressionWhenCalledAtPath(path.slice(1), recursionTracker, origin); + deoptimizeThisOnInteractionAtPath(interaction, path, recursionTracker) { + this.getObjectEntity().deoptimizeThisOnInteractionAtPath(interaction, path, recursionTracker); } - hasEffectsWhenAccessedAtPath(path, context) { - if (path.length === 0) - return false; - const key = path[0]; - const propertyMap = this.propertyMap; - if (path.length > 1 && - (this.hasUnknownDeoptimizedProperty || - typeof key !== 'string' || - this.deoptimizedPaths.has(key) || - !propertyMap[key] || - propertyMap[key].exactMatchRead === null)) - return true; - const subPath = path.slice(1); - for (const property of typeof key !== 'string' - ? this.properties - : propertyMap[key] - ? propertyMap[key].propertiesRead - : []) { - if (property.hasEffectsWhenAccessedAtPath(subPath, context)) - return true; - } - return false; + getLiteralValueAtPath(path, recursionTracker, origin) { + return this.getObjectEntity().getLiteralValueAtPath(path, recursionTracker, origin); } - hasEffectsWhenAssignedAtPath(path, context) { - const key = path[0]; - const propertyMap = this.propertyMap; - if (path.length > 1 && - (this.hasUnknownDeoptimizedProperty || - this.deoptimizedPaths.has(key) || - !propertyMap[key] || - propertyMap[key].exactMatchRead === null)) { - return true; - } - const subPath = path.slice(1); - for (const property of typeof key !== 'string' - ? this.properties - : path.length > 1 - ? propertyMap[key].propertiesRead - : propertyMap[key] - ? propertyMap[key].propertiesWrite - : []) { - if (property.hasEffectsWhenAssignedAtPath(subPath, context)) - return true; - } - return false; + getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin) { + return this.getObjectEntity().getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin); } - hasEffectsWhenCalledAtPath(path, callOptions, context) { - const key = path[0]; - if (typeof key !== 'string' || - this.hasUnknownDeoptimizedProperty || - this.deoptimizedPaths.has(key) || - (this.propertyMap[key] - ? !this.propertyMap[key].exactMatchRead - : path.length > 1 || !objectMembers[key])) { - return true; - } - const subPath = path.slice(1); - if (this.propertyMap[key]) { - for (const property of this.propertyMap[key].propertiesRead) { - if (property.hasEffectsWhenCalledAtPath(subPath, callOptions, context)) - return true; - } - } - if (path.length === 1 && objectMembers[key]) - return hasMemberEffectWhenCalled(objectMembers, key, this.included, callOptions, context); - return false; + hasEffectsOnInteractionAtPath(path, interaction, context) { + return this.getObjectEntity().hasEffectsOnInteractionAtPath(path, interaction, context); } - render(code, options, { renderedParentType } = BLANK) { + render(code, options, { renderedSurroundingElement } = BLANK) { super.render(code, options); - if (renderedParentType === ExpressionStatement || - renderedParentType === ArrowFunctionExpression) { + if (renderedSurroundingElement === ExpressionStatement$1 || + renderedSurroundingElement === ArrowFunctionExpression$1) { code.appendRight(this.start, '('); code.prependLeft(this.end, ')'); } } - deoptimizeAllProperties() { - this.hasUnknownDeoptimizedProperty = true; - for (const property of this.properties) { - property.deoptimizePath(UNKNOWN_PATH); - } - for (const expressionsToBeDeoptimized of this.expressionsToBeDeoptimized.values()) { - for (const expression of expressionsToBeDeoptimized) { - expression.deoptimizeCache(); - } - } - } - getPropertyMap() { - if (this.propertyMap !== null) { - return this.propertyMap; + applyDeoptimizations() { } + getObjectEntity() { + if (this.objectEntity !== null) { + return this.objectEntity; } - const propertyMap = (this.propertyMap = Object.create(null)); - for (let index = this.properties.length - 1; index >= 0; index--) { - const property = this.properties[index]; + let prototype = OBJECT_PROTOTYPE; + const properties = []; + for (const property of this.properties) { if (property instanceof SpreadElement) { - this.unmatchablePropertiesRead.push(property); + properties.push({ key: UnknownKey, kind: 'init', property }); continue; } - const isWrite = property.kind !== 'get'; - const isRead = property.kind !== 'set'; let key; if (property.computed) { const keyValue = property.key.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, this); - if (keyValue === UnknownValue) { - if (isRead) { - this.unmatchablePropertiesRead.push(property); - } - else { - this.unmatchablePropertiesWrite.push(property); - } + if (typeof keyValue === 'symbol') { + properties.push({ key: UnknownKey, kind: property.kind, property }); continue; } - key = String(keyValue); - } - else if (property.key instanceof Identifier$1) { - key = property.key.name; - } - else { - key = String(property.key.value); - } - const propertyMapProperty = propertyMap[key]; - if (!propertyMapProperty) { - propertyMap[key] = { - exactMatchRead: isRead ? property : null, - exactMatchWrite: isWrite ? property : null, - propertiesRead: isRead ? [property, ...this.unmatchablePropertiesRead] : [], - propertiesWrite: isWrite && !isRead ? [property, ...this.unmatchablePropertiesWrite] : [] - }; - continue; - } - if (isRead && propertyMapProperty.exactMatchRead === null) { - propertyMapProperty.exactMatchRead = property; - propertyMapProperty.propertiesRead.push(property, ...this.unmatchablePropertiesRead); - } - if (isWrite && !isRead && propertyMapProperty.exactMatchWrite === null) { - propertyMapProperty.exactMatchWrite = property; - propertyMapProperty.propertiesWrite.push(property, ...this.unmatchablePropertiesWrite); - } - } - return propertyMap; - } -} - -class ObjectPattern extends NodeBase { - addExportedVariables(variables, exportNamesByVariable) { - for (const property of this.properties) { - if (property.type === Property) { - property.value.addExportedVariables(variables, exportNamesByVariable); + else { + key = String(keyValue); + } } else { - property.argument.addExportedVariables(variables, exportNamesByVariable); - } - } - } - declare(kind, init) { - const variables = []; - for (const property of this.properties) { - variables.push(...property.declare(kind, init)); - } - return variables; - } - deoptimizePath(path) { - if (path.length === 0) { - for (const property of this.properties) { - property.deoptimizePath(path); + key = + property.key instanceof Identifier + ? property.key.name + : String(property.key.value); + if (key === '__proto__' && property.kind === 'init') { + prototype = + property.value instanceof Literal && property.value.value === null + ? null + : property.value; + continue; + } } + properties.push({ key, kind: property.kind, property }); } - } - hasEffectsWhenAssignedAtPath(path, context) { - if (path.length > 0) - return true; - for (const property of this.properties) { - if (property.hasEffectsWhenAssignedAtPath(EMPTY_PATH, context)) - return true; - } - return false; + return (this.objectEntity = new ObjectEntity(properties, prototype)); } } -class PrivateName extends NodeBase { +class PrivateIdentifier extends NodeBase { } -class Program$1 extends NodeBase { +class Program extends NodeBase { constructor() { super(...arguments); this.hasCachedEffect = false; @@ -8053,99 +10900,29 @@ class Program$1 extends NodeBase { super.render(code, options); } } + applyDeoptimizations() { } } -class Property$1 extends NodeBase { +class Property extends MethodBase { constructor() { super(...arguments); this.declarationInit = null; - this.returnExpression = null; - } - bind() { - super.bind(); - if (this.kind === 'get') { - // ensure the returnExpression is set for the tree-shaking passes - this.getReturnExpression(); - } - if (this.declarationInit !== null) { - this.declarationInit.deoptimizePath([UnknownKey, UnknownKey]); - } } declare(kind, init) { this.declarationInit = init; return this.value.declare(kind, UNKNOWN_EXPRESSION); } - // As getter properties directly receive their values from function expressions that always - // have a fixed return value, there is no known situation where a getter is deoptimized. - deoptimizeCache() { } - deoptimizePath(path) { - if (this.kind === 'get') { - this.getReturnExpression().deoptimizePath(path); - } - else { - this.value.deoptimizePath(path); - } - } - getLiteralValueAtPath(path, recursionTracker, origin) { - if (this.kind === 'get') { - return this.getReturnExpression().getLiteralValueAtPath(path, recursionTracker, origin); - } - return this.value.getLiteralValueAtPath(path, recursionTracker, origin); - } - getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin) { - if (this.kind === 'get') { - return this.getReturnExpression().getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin); - } - return this.value.getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin); - } hasEffects(context) { - return this.key.hasEffects(context) || this.value.hasEffects(context); - } - hasEffectsWhenAccessedAtPath(path, context) { - if (this.kind === 'get') { - const trackedExpressions = context.accessed.getEntities(path); - if (trackedExpressions.has(this)) - return false; - trackedExpressions.add(this); - return (this.value.hasEffectsWhenCalledAtPath(EMPTY_PATH, this.accessorCallOptions, context) || - (path.length > 0 && this.returnExpression.hasEffectsWhenAccessedAtPath(path, context))); - } - return this.value.hasEffectsWhenAccessedAtPath(path, context); - } - hasEffectsWhenAssignedAtPath(path, context) { - if (this.kind === 'get') { - const trackedExpressions = context.assigned.getEntities(path); - if (trackedExpressions.has(this)) - return false; - trackedExpressions.add(this); - return this.returnExpression.hasEffectsWhenAssignedAtPath(path, context); - } - if (this.kind === 'set') { - const trackedExpressions = context.assigned.getEntities(path); - if (trackedExpressions.has(this)) - return false; - trackedExpressions.add(this); - return this.value.hasEffectsWhenCalledAtPath(EMPTY_PATH, this.accessorCallOptions, context); - } - return this.value.hasEffectsWhenAssignedAtPath(path, context); - } - hasEffectsWhenCalledAtPath(path, callOptions, context) { - if (this.kind === 'get') { - const trackedExpressions = (callOptions.withNew - ? context.instantiated - : context.called).getEntities(path, callOptions); - if (trackedExpressions.has(this)) - return false; - trackedExpressions.add(this); - return this.returnExpression.hasEffectsWhenCalledAtPath(path, callOptions, context); - } - return this.value.hasEffectsWhenCalledAtPath(path, callOptions, context); + if (!this.deoptimized) + this.applyDeoptimizations(); + const propertyReadSideEffects = this.context.options.treeshake + .propertyReadSideEffects; + return ((this.parent.type === 'ObjectPattern' && propertyReadSideEffects === 'always') || + this.key.hasEffects(context) || + this.value.hasEffects(context)); } - initialise() { - this.accessorCallOptions = { - args: NO_ARGS, - withNew: false - }; + markDeclarationReached() { + this.value.markDeclarationReached(); } render(code, options) { if (!this.shorthand) { @@ -8153,28 +10930,56 @@ class Property$1 extends NodeBase { } this.value.render(code, options, { isShorthandProperty: this.shorthand }); } - getReturnExpression() { - if (this.returnExpression === null) { - this.returnExpression = UNKNOWN_EXPRESSION; - return (this.returnExpression = this.value.getReturnExpressionWhenCalledAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, this)); + applyDeoptimizations() { + this.deoptimized = true; + if (this.declarationInit !== null) { + this.declarationInit.deoptimizePath([UnknownKey, UnknownKey]); + this.context.requestTreeshakingPass(); } - return this.returnExpression; } } -class ReturnStatement$1 extends NodeBase { +class PropertyDefinition extends NodeBase { + deoptimizePath(path) { + var _a; + (_a = this.value) === null || _a === void 0 ? void 0 : _a.deoptimizePath(path); + } + deoptimizeThisOnInteractionAtPath(interaction, path, recursionTracker) { + var _a; + (_a = this.value) === null || _a === void 0 ? void 0 : _a.deoptimizeThisOnInteractionAtPath(interaction, path, recursionTracker); + } + getLiteralValueAtPath(path, recursionTracker, origin) { + return this.value + ? this.value.getLiteralValueAtPath(path, recursionTracker, origin) + : UnknownValue; + } + getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin) { + return this.value + ? this.value.getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin) + : UNKNOWN_EXPRESSION; + } + hasEffects(context) { + var _a; + return this.key.hasEffects(context) || (this.static && !!((_a = this.value) === null || _a === void 0 ? void 0 : _a.hasEffects(context))); + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + return !this.value || this.value.hasEffectsOnInteractionAtPath(path, interaction, context); + } + applyDeoptimizations() { } +} + +class ReturnStatement extends NodeBase { hasEffects(context) { - if (!context.ignore.returnAwaitYield || - (this.argument !== null && this.argument.hasEffects(context))) + var _a; + if (!context.ignore.returnYield || ((_a = this.argument) === null || _a === void 0 ? void 0 : _a.hasEffects(context))) return true; context.brokenFlow = BROKEN_FLOW_ERROR_RETURN_LABEL; return false; } include(context, includeChildrenRecursively) { + var _a; this.included = true; - if (this.argument) { - this.argument.include(context, includeChildrenRecursively); - } + (_a = this.argument) === null || _a === void 0 ? void 0 : _a.include(context, includeChildrenRecursively); context.brokenFlow = BROKEN_FLOW_ERROR_RETURN_LABEL; } initialise() { @@ -8192,8 +10997,10 @@ class ReturnStatement$1 extends NodeBase { class SequenceExpression extends NodeBase { deoptimizePath(path) { - if (path.length > 0) - this.expressions[this.expressions.length - 1].deoptimizePath(path); + this.expressions[this.expressions.length - 1].deoptimizePath(path); + } + deoptimizeThisOnInteractionAtPath(interaction, path, recursionTracker) { + this.expressions[this.expressions.length - 1].deoptimizeThisOnInteractionAtPath(interaction, path, recursionTracker); } getLiteralValueAtPath(path, recursionTracker, origin) { return this.expressions[this.expressions.length - 1].getLiteralValueAtPath(path, recursionTracker, origin); @@ -8205,58 +11012,101 @@ class SequenceExpression extends NodeBase { } return false; } - hasEffectsWhenAccessedAtPath(path, context) { - return (path.length > 0 && - this.expressions[this.expressions.length - 1].hasEffectsWhenAccessedAtPath(path, context)); - } - hasEffectsWhenAssignedAtPath(path, context) { - return (path.length === 0 || - this.expressions[this.expressions.length - 1].hasEffectsWhenAssignedAtPath(path, context)); - } - hasEffectsWhenCalledAtPath(path, callOptions, context) { - return this.expressions[this.expressions.length - 1].hasEffectsWhenCalledAtPath(path, callOptions, context); + hasEffectsOnInteractionAtPath(path, interaction, context) { + return this.expressions[this.expressions.length - 1].hasEffectsOnInteractionAtPath(path, interaction, context); } include(context, includeChildrenRecursively) { this.included = true; - for (let i = 0; i < this.expressions.length - 1; i++) { - const node = this.expressions[i]; - if (includeChildrenRecursively || node.shouldBeIncluded(context)) - node.include(context, includeChildrenRecursively); + const lastExpression = this.expressions[this.expressions.length - 1]; + for (const expression of this.expressions) { + if (includeChildrenRecursively || + (expression === lastExpression && !(this.parent instanceof ExpressionStatement)) || + expression.shouldBeIncluded(context)) + expression.include(context, includeChildrenRecursively); } - this.expressions[this.expressions.length - 1].include(context, includeChildrenRecursively); } render(code, options, { renderedParentType, isCalleeOfRenderedParent, preventASI } = BLANK) { let includedNodes = 0; - for (const { node, start, end } of getCommaSeparatedNodesWithBoundaries(this.expressions, code, this.start, this.end)) { + let lastSeparatorPos = null; + const lastNode = this.expressions[this.expressions.length - 1]; + for (const { node, separator, start, end } of getCommaSeparatedNodesWithBoundaries(this.expressions, code, this.start, this.end)) { if (!node.included) { treeshakeNode(node, code, start, end); continue; } includedNodes++; + lastSeparatorPos = separator; if (includedNodes === 1 && preventASI) { removeLineBreaks(code, start, node.start); } - if (node === this.expressions[this.expressions.length - 1] && includedNodes === 1) { + if (includedNodes === 1) { + const parentType = renderedParentType || this.parent.type; node.render(code, options, { - isCalleeOfRenderedParent: renderedParentType - ? isCalleeOfRenderedParent - : this.parent.callee === this, - renderedParentType: renderedParentType || this.parent.type + isCalleeOfRenderedParent: isCalleeOfRenderedParent && node === lastNode, + renderedParentType: parentType, + renderedSurroundingElement: parentType }); } else { node.render(code, options); } } + if (lastSeparatorPos) { + code.remove(lastSeparatorPos, this.end); + } + } +} + +class StaticBlock extends NodeBase { + createScope(parentScope) { + this.scope = new BlockScope(parentScope); + } + hasEffects(context) { + for (const node of this.body) { + if (node.hasEffects(context)) + return true; + } + return false; + } + include(context, includeChildrenRecursively) { + this.included = true; + for (const node of this.body) { + if (includeChildrenRecursively || node.shouldBeIncluded(context)) + node.include(context, includeChildrenRecursively); + } + } + render(code, options) { + if (this.body.length) { + renderStatementList(this.body, code, this.start + 1, this.end - 1, options); + } + else { + super.render(code, options); + } } } class Super extends NodeBase { + bind() { + this.variable = this.scope.findVariable('this'); + } + deoptimizePath(path) { + this.variable.deoptimizePath(path); + } + deoptimizeThisOnInteractionAtPath(interaction, path, recursionTracker) { + this.variable.deoptimizeThisOnInteractionAtPath(interaction, path, recursionTracker); + } + include() { + if (!this.included) { + this.included = true; + this.context.includeVariableInModule(this.variable); + } + } } class SwitchCase extends NodeBase { hasEffects(context) { - if (this.test && this.test.hasEffects(context)) + var _a; + if ((_a = this.test) === null || _a === void 0 ? void 0 : _a.hasEffects(context)) return true; for (const node of this.consequent) { if (context.brokenFlow) @@ -8267,9 +11117,9 @@ class SwitchCase extends NodeBase { return false; } include(context, includeChildrenRecursively) { + var _a; this.included = true; - if (this.test) - this.test.include(context, includeChildrenRecursively); + (_a = this.test) === null || _a === void 0 ? void 0 : _a.include(context, includeChildrenRecursively); for (const node of this.consequent) { if (includeChildrenRecursively || node.shouldBeIncluded(context)) node.include(context, includeChildrenRecursively); @@ -8362,40 +11212,85 @@ class SwitchStatement extends NodeBase { } } -class TaggedTemplateExpression extends NodeBase { +class TaggedTemplateExpression extends CallExpressionBase { bind() { super.bind(); - if (this.tag.type === Identifier) { + if (this.tag.type === Identifier$1) { const name = this.tag.name; const variable = this.scope.findVariable(name); if (variable.isNamespace) { this.context.warn({ code: 'CANNOT_CALL_NAMESPACE', - message: `Cannot call a namespace ('${name}')`, - }, this.start); - } - if (name === 'eval') { - this.context.warn({ - code: 'EVAL', - message: `Use of eval is strongly discouraged, as it poses security risks and may cause issues with minification`, - url: 'https://rollupjs.org/guide/en/#avoiding-eval', + message: `Cannot call a namespace ('${name}')` }, this.start); } } } hasEffects(context) { - return (super.hasEffects(context) || - this.tag.hasEffectsWhenCalledAtPath(EMPTY_PATH, this.callOptions, context)); + try { + for (const argument of this.quasi.expressions) { + if (argument.hasEffects(context)) + return true; + } + return (this.tag.hasEffects(context) || + this.tag.hasEffectsOnInteractionAtPath(EMPTY_PATH, this.interaction, context)); + } + finally { + if (!this.deoptimized) + this.applyDeoptimizations(); + } + } + include(context, includeChildrenRecursively) { + if (!this.deoptimized) + this.applyDeoptimizations(); + if (includeChildrenRecursively) { + super.include(context, includeChildrenRecursively); + } + else { + this.included = true; + this.tag.include(context, includeChildrenRecursively); + this.quasi.include(context, includeChildrenRecursively); + } + this.tag.includeCallArguments(context, this.interaction.args); + const returnExpression = this.getReturnExpression(); + if (!returnExpression.included) { + returnExpression.include(context, false); + } } initialise() { - this.callOptions = { - args: NO_ARGS, - withNew: false, + this.interaction = { + args: [UNKNOWN_EXPRESSION, ...this.quasi.expressions], + thisArg: this.tag instanceof MemberExpression && !this.tag.variable ? this.tag.object : null, + type: INTERACTION_CALLED, + withNew: false }; } + render(code, options) { + this.tag.render(code, options, { isCalleeOfRenderedParent: true }); + this.quasi.render(code, options); + } + applyDeoptimizations() { + this.deoptimized = true; + if (this.interaction.thisArg) { + this.tag.deoptimizeThisOnInteractionAtPath(this.interaction, EMPTY_PATH, SHARED_RECURSION_TRACKER); + } + for (const argument of this.quasi.expressions) { + // This will make sure all properties of parameters behave as "unknown" + argument.deoptimizePath(UNKNOWN_PATH); + } + this.context.requestTreeshakingPass(); + } + getReturnExpression(recursionTracker = SHARED_RECURSION_TRACKER) { + if (this.returnExpression === null) { + this.returnExpression = UNKNOWN_EXPRESSION; + return (this.returnExpression = this.tag.getReturnExpressionWhenCalledAtPath(EMPTY_PATH, this.interaction, recursionTracker, this)); + } + return this.returnExpression; + } } class TemplateElement extends NodeBase { + // Do not try to bind value bind() { } hasEffects() { return false; @@ -8411,18 +11306,112 @@ class TemplateElement extends NodeBase { } class TemplateLiteral extends NodeBase { + deoptimizeThisOnInteractionAtPath() { } getLiteralValueAtPath(path) { if (path.length > 0 || this.quasis.length !== 1) { return UnknownValue; } return this.quasis[0].value.cooked; } + getReturnExpressionWhenCalledAtPath(path) { + if (path.length !== 1) { + return UNKNOWN_EXPRESSION; + } + return getMemberReturnExpressionWhenCalled(literalStringMembers, path[0]); + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + if (interaction.type === INTERACTION_ACCESSED) { + return path.length > 1; + } + if (interaction.type === INTERACTION_CALLED && path.length === 1) { + return hasMemberEffectWhenCalled(literalStringMembers, path[0], interaction, context); + } + return true; + } render(code, options) { code.indentExclusionRanges.push([this.start, this.end]); super.render(code, options); } } +class UndefinedVariable extends Variable { + constructor() { + super('undefined'); + } + getLiteralValueAtPath() { + return undefined; + } +} + +class ExportDefaultVariable extends LocalVariable { + constructor(name, exportDefaultDeclaration, context) { + super(name, exportDefaultDeclaration, exportDefaultDeclaration.declaration, context); + this.hasId = false; + this.originalId = null; + this.originalVariable = null; + const declaration = exportDefaultDeclaration.declaration; + if ((declaration instanceof FunctionDeclaration || declaration instanceof ClassDeclaration) && + declaration.id) { + this.hasId = true; + this.originalId = declaration.id; + } + else if (declaration instanceof Identifier) { + this.originalId = declaration; + } + } + addReference(identifier) { + if (!this.hasId) { + this.name = identifier.name; + } + } + getAssignedVariableName() { + return (this.originalId && this.originalId.name) || null; + } + getBaseVariableName() { + const original = this.getOriginalVariable(); + if (original === this) { + return super.getBaseVariableName(); + } + else { + return original.getBaseVariableName(); + } + } + getDirectOriginalVariable() { + return this.originalId && + (this.hasId || + !(this.originalId.isPossibleTDZ() || + this.originalId.variable.isReassigned || + this.originalId.variable instanceof UndefinedVariable || + // this avoids a circular dependency + 'syntheticNamespace' in this.originalId.variable)) + ? this.originalId.variable + : null; + } + getName(getPropertyAccess) { + const original = this.getOriginalVariable(); + if (original === this) { + return super.getName(getPropertyAccess); + } + else { + return original.getName(getPropertyAccess); + } + } + getOriginalVariable() { + if (this.originalVariable) + return this.originalVariable; + // eslint-disable-next-line @typescript-eslint/no-this-alias + let original = this; + let currentVariable; + const checkedVariables = new Set(); + do { + checkedVariables.add(original); + currentVariable = original; + original = currentVariable.getDirectOriginalVariable(); + } while (original instanceof ExportDefaultVariable && !checkedVariables.has(original)); + return (this.originalVariable = original || currentVariable); + } +} + class ModuleScope extends ChildScope { constructor(parent, context) { super(parent); @@ -8434,15 +11423,11 @@ class ModuleScope extends ChildScope { this.variables.set('default', variable); return variable; } - addNamespaceMemberAccess(_name, variable) { - if (variable instanceof GlobalVariable) { - this.accessedOutsideVariables.set(variable.name, variable); - } - } - deconflict(format, exportNamesByVariable) { + addNamespaceMemberAccess() { } + deconflict(format, exportNamesByVariable, accessedGlobalsByScope) { // all module level variables are already deconflicted when deconflicting the chunk for (const scope of this.children) - scope.deconflict(format, exportNamesByVariable); + scope.deconflict(format, exportNamesByVariable, accessedGlobalsByScope); } findLexicalBoundary() { return this; @@ -8462,14 +11447,26 @@ class ModuleScope extends ChildScope { class ThisExpression extends NodeBase { bind() { - super.bind(); this.variable = this.scope.findVariable('this'); } - hasEffectsWhenAccessedAtPath(path, context) { - return path.length > 0 && this.variable.hasEffectsWhenAccessedAtPath(path, context); + deoptimizePath(path) { + this.variable.deoptimizePath(path); + } + deoptimizeThisOnInteractionAtPath(interaction, path, recursionTracker) { + // We rewrite the parameter so that a ThisVariable can detect self-mutations + this.variable.deoptimizeThisOnInteractionAtPath(interaction.thisArg === this ? { ...interaction, thisArg: this.variable } : interaction, path, recursionTracker); + } + hasEffectsOnInteractionAtPath(path, interaction, context) { + if (path.length === 0) { + return interaction.type !== INTERACTION_ACCESSED; + } + return this.variable.hasEffectsOnInteractionAtPath(path, interaction, context); } - hasEffectsWhenAssignedAtPath(path, context) { - return this.variable.hasEffectsWhenAssignedAtPath(path, context); + include() { + if (!this.included) { + this.included = true; + this.context.includeVariableInModule(this.variable); + } } initialise() { this.alias = @@ -8513,30 +11510,37 @@ class TryStatement extends NodeBase { constructor() { super(...arguments); this.directlyIncluded = false; + this.includedLabelsAfterBlock = null; } hasEffects(context) { + var _a; return ((this.context.options.treeshake.tryCatchDeoptimization ? this.block.body.length > 0 - : this.block.hasEffects(context)) || - (this.finalizer !== null && this.finalizer.hasEffects(context))); + : this.block.hasEffects(context)) || !!((_a = this.finalizer) === null || _a === void 0 ? void 0 : _a.hasEffects(context))); } include(context, includeChildrenRecursively) { - var _a; + var _a, _b; const tryCatchDeoptimization = (_a = this.context.options.treeshake) === null || _a === void 0 ? void 0 : _a.tryCatchDeoptimization; const { brokenFlow } = context; if (!this.directlyIncluded || !tryCatchDeoptimization) { this.included = true; this.directlyIncluded = true; this.block.include(context, tryCatchDeoptimization ? INCLUDE_PARAMETERS : includeChildrenRecursively); + if (context.includedLabels.size > 0) { + this.includedLabelsAfterBlock = [...context.includedLabels]; + } context.brokenFlow = brokenFlow; } + else if (this.includedLabelsAfterBlock) { + for (const label of this.includedLabelsAfterBlock) { + context.includedLabels.add(label); + } + } if (this.handler !== null) { this.handler.include(context, includeChildrenRecursively); context.brokenFlow = brokenFlow; } - if (this.finalizer !== null) { - this.finalizer.include(context, includeChildrenRecursively); - } + (_b = this.finalizer) === null || _b === void 0 ? void 0 : _b.include(context, includeChildrenRecursively); } } @@ -8550,32 +11554,32 @@ const unaryOperators = { '~': value => ~value }; class UnaryExpression extends NodeBase { - bind() { - super.bind(); - if (this.operator === 'delete') { - this.argument.deoptimizePath(EMPTY_PATH); - } - } getLiteralValueAtPath(path, recursionTracker, origin) { if (path.length > 0) return UnknownValue; const argumentValue = this.argument.getLiteralValueAtPath(EMPTY_PATH, recursionTracker, origin); - if (argumentValue === UnknownValue) + if (typeof argumentValue === 'symbol') return UnknownValue; return unaryOperators[this.operator](argumentValue); } hasEffects(context) { - if (this.operator === 'typeof' && this.argument instanceof Identifier$1) + if (!this.deoptimized) + this.applyDeoptimizations(); + if (this.operator === 'typeof' && this.argument instanceof Identifier) return false; return (this.argument.hasEffects(context) || (this.operator === 'delete' && - this.argument.hasEffectsWhenAssignedAtPath(EMPTY_PATH, context))); + this.argument.hasEffectsOnInteractionAtPath(EMPTY_PATH, NODE_INTERACTION_UNKNOWN_ASSIGNMENT, context))); + } + hasEffectsOnInteractionAtPath(path, { type }) { + return type !== INTERACTION_ACCESSED || path.length > (this.operator === 'void' ? 0 : 1); } - hasEffectsWhenAccessedAtPath(path) { - if (this.operator === 'void') { - return path.length > 0; + applyDeoptimizations() { + this.deoptimized = true; + if (this.operator === 'delete') { + this.argument.deoptimizePath(EMPTY_PATH); + this.context.requestTreeshakingPass(); } - return path.length > 1; } } @@ -8589,65 +11593,65 @@ class UnknownNode extends NodeBase { } class UpdateExpression extends NodeBase { - bind() { - super.bind(); - this.argument.deoptimizePath(EMPTY_PATH); - if (this.argument instanceof Identifier$1) { - const variable = this.scope.findVariable(this.argument.name); - variable.isReassigned = true; - } - } hasEffects(context) { - return (this.argument.hasEffects(context) || - this.argument.hasEffectsWhenAssignedAtPath(EMPTY_PATH, context)); + if (!this.deoptimized) + this.applyDeoptimizations(); + return this.argument.hasEffectsAsAssignmentTarget(context, true); + } + hasEffectsOnInteractionAtPath(path, { type }) { + return path.length > 1 || type !== INTERACTION_ACCESSED; + } + include(context, includeChildrenRecursively) { + if (!this.deoptimized) + this.applyDeoptimizations(); + this.included = true; + this.argument.includeAsAssignmentTarget(context, includeChildrenRecursively, true); } - hasEffectsWhenAccessedAtPath(path) { - return path.length > 1; + initialise() { + this.argument.setAssignedValue(UNKNOWN_EXPRESSION); } render(code, options) { + const { exportNamesByVariable, format, snippets: { _ } } = options; this.argument.render(code, options); - if (options.format === 'system') { + if (format === 'system') { const variable = this.argument.variable; - const exportNames = options.exportNamesByVariable.get(variable); - if (exportNames && exportNames.length) { - const _ = options.compact ? '' : ' '; - const name = variable.getName(); + const exportNames = exportNamesByVariable.get(variable); + if (exportNames) { if (this.prefix) { if (exportNames.length === 1) { - code.overwrite(this.start, this.end, `exports('${exportNames[0]}',${_}${this.operator}${name})`); + renderSystemExportExpression(variable, this.start, this.end, code, options); } else { - code.overwrite(this.start, this.end, `(${this.operator}${name},${_}${getSystemExportStatement([variable], options)},${_}${name})`); + renderSystemExportSequenceAfterExpression(variable, this.start, this.end, this.parent.type !== ExpressionStatement$1, code, options); } } - else if (exportNames.length > 1) { - code.overwrite(this.start, this.end, `${getSystemExportFunctionLeft([variable], false, options)}${this.operator}${name})`); - } else { - let op; - switch (this.operator) { - case '++': - op = `${name}${_}+${_}1`; - break; - case '--': - op = `${name}${_}-${_}1`; - break; - } - code.overwrite(this.start, this.end, `(exports('${exportNames[0]}',${_}${op}),${_}${name}${this.operator})`); + const operator = this.operator[0]; + renderSystemExportSequenceBeforeExpression(variable, this.start, this.end, this.parent.type !== ExpressionStatement$1, code, options, `${_}${operator}${_}1`); } } } } + applyDeoptimizations() { + this.deoptimized = true; + this.argument.deoptimizePath(EMPTY_PATH); + if (this.argument instanceof Identifier) { + const variable = this.scope.findVariable(this.argument.name); + variable.isReassigned = true; + } + this.context.requestTreeshakingPass(); + } } function isReassignedExportsMember(variable, exportNamesByVariable) { return (variable.renderBaseName !== null && exportNamesByVariable.has(variable) && variable.isReassigned); } + function areAllDeclarationsIncludedAndNotExported(declarations, exportNamesByVariable) { for (const declarator of declarations) { - if (!declarator.included) + if (!declarator.id.included) return false; - if (declarator.id.type === Identifier) { + if (declarator.id.type === Identifier$1) { if (exportNamesByVariable.has(declarator.id.variable)) return false; } @@ -8666,20 +11670,17 @@ class VariableDeclaration extends NodeBase { declarator.deoptimizePath(EMPTY_PATH); } } - hasEffectsWhenAssignedAtPath() { + hasEffectsOnInteractionAtPath() { return false; } - include(context, includeChildrenRecursively) { + include(context, includeChildrenRecursively, { asSingleStatement } = BLANK) { this.included = true; for (const declarator of this.declarations) { if (includeChildrenRecursively || declarator.shouldBeIncluded(context)) declarator.include(context, includeChildrenRecursively); - } - } - includeWithAllDeclaredVariables(includeChildrenRecursively, context) { - this.included = true; - for (const declarator of this.declarations) { - declarator.include(context, includeChildrenRecursively); + if (asSingleStatement) { + declarator.id.include(context, includeChildrenRecursively); + } } } initialise() { @@ -8698,16 +11699,15 @@ class VariableDeclaration extends NodeBase { } } else { - this.renderReplacedDeclarations(code, options, nodeRenderOptions); + this.renderReplacedDeclarations(code, options); } } - renderDeclarationEnd(code, separatorString, lastSeparatorPos, actualContentEnd, renderedContentEnd, addSemicolon, systemPatternExports, options) { + applyDeoptimizations() { } + renderDeclarationEnd(code, separatorString, lastSeparatorPos, actualContentEnd, renderedContentEnd, systemPatternExports, options) { if (code.original.charCodeAt(this.end - 1) === 59 /*";"*/) { code.remove(this.end - 1, this.end); } - if (addSemicolon) { - separatorString += ';'; - } + separatorString += ';'; if (lastSeparatorPos !== null) { if (code.original.charCodeAt(actualContentEnd - 1) === 10 /*"\n"*/ && (code.original.charCodeAt(this.end) === 10 /*"\n"*/ || @@ -8732,54 +11732,37 @@ class VariableDeclaration extends NodeBase { code.appendLeft(renderedContentEnd, ` ${getSystemExportStatement(systemPatternExports, options)};`); } } - renderReplacedDeclarations(code, options, { start = this.start, end = this.end, isNoStatement }) { + renderReplacedDeclarations(code, options) { const separatedNodes = getCommaSeparatedNodesWithBoundaries(this.declarations, code, this.start + this.kind.length, this.end - (code.original.charCodeAt(this.end - 1) === 59 /*";"*/ ? 1 : 0)); let actualContentEnd, renderedContentEnd; - if (/\n\s*$/.test(code.slice(this.start, separatedNodes[0].start))) { - renderedContentEnd = this.start + this.kind.length; - } - else { - renderedContentEnd = separatedNodes[0].start; - } + renderedContentEnd = findNonWhiteSpace(code.original, this.start + this.kind.length); let lastSeparatorPos = renderedContentEnd - 1; code.remove(this.start, lastSeparatorPos); let isInDeclaration = false; let hasRenderedContent = false; let separatorString = '', leadingString, nextSeparatorString; - const systemPatternExports = []; + const aggregatedSystemExports = []; + const singleSystemExport = gatherSystemExportsAndGetSingleExport(separatedNodes, options, aggregatedSystemExports); for (const { node, start, separator, contentEnd, end } of separatedNodes) { - if (!node.included || - (node.id instanceof Identifier$1 && - isReassignedExportsMember(node.id.variable, options.exportNamesByVariable) && - node.init === null)) { + if (!node.included) { code.remove(start, end); continue; } + node.render(code, options); leadingString = ''; nextSeparatorString = ''; - if (node.id instanceof Identifier$1 && - isReassignedExportsMember(node.id.variable, options.exportNamesByVariable)) { + if (!node.id.included || + (node.id instanceof Identifier && + isReassignedExportsMember(node.id.variable, options.exportNamesByVariable))) { if (hasRenderedContent) { separatorString += ';'; } isInDeclaration = false; } else { - if (options.format === 'system' && node.init !== null) { - if (node.id.type !== Identifier) { - node.id.addExportedVariables(systemPatternExports, options.exportNamesByVariable); - } - else { - const exportNames = options.exportNamesByVariable.get(node.id.variable); - if (exportNames) { - const _ = options.compact ? '' : ' '; - const operatorPos = findFirstOccurrenceOutsideComment(code.original, '=', node.id.end); - code.prependLeft(findNonWhiteSpace(code.original, operatorPos + 1), exportNames.length === 1 - ? `exports('${exportNames[0]}',${_}` - : getSystemExportFunctionLeft([node.id.variable], false, options)); - nextSeparatorString += ')'; - } - } + if (singleSystemExport && singleSystemExport === node.id.variable) { + const operatorPos = findFirstOccurrenceOutsideComment(code.original, '=', node.id.end); + renderSystemExportExpression(singleSystemExport, findNonWhiteSpace(code.original, operatorPos + 1), separator === null ? contentEnd : separator, code, options); } if (isInDeclaration) { separatorString += ','; @@ -8799,20 +11782,39 @@ class VariableDeclaration extends NodeBase { code.overwrite(lastSeparatorPos, lastSeparatorPos + 1, separatorString); code.appendLeft(renderedContentEnd, leadingString); } - node.render(code, options); actualContentEnd = contentEnd; renderedContentEnd = end; hasRenderedContent = true; lastSeparatorPos = separator; separatorString = nextSeparatorString; } - if (hasRenderedContent) { - this.renderDeclarationEnd(code, separatorString, lastSeparatorPos, actualContentEnd, renderedContentEnd, !isNoStatement, systemPatternExports, options); + this.renderDeclarationEnd(code, separatorString, lastSeparatorPos, actualContentEnd, renderedContentEnd, aggregatedSystemExports, options); + } +} +function gatherSystemExportsAndGetSingleExport(separatedNodes, options, aggregatedSystemExports) { + var _a; + let singleSystemExport = null; + if (options.format === 'system') { + for (const { node } of separatedNodes) { + if (node.id instanceof Identifier && + node.init && + aggregatedSystemExports.length === 0 && + ((_a = options.exportNamesByVariable.get(node.id.variable)) === null || _a === void 0 ? void 0 : _a.length) === 1) { + singleSystemExport = node.id.variable; + aggregatedSystemExports.push(singleSystemExport); + } + else { + node.id.addExportedVariables(aggregatedSystemExports, options.exportNamesByVariable); + } } - else { - code.remove(start, end); + if (aggregatedSystemExports.length > 1) { + singleSystemExport = null; + } + else if (singleSystemExport) { + aggregatedSystemExports.length = 0; } } + return singleSystemExport; } class VariableDeclarator extends NodeBase { @@ -8822,16 +11824,40 @@ class VariableDeclarator extends NodeBase { deoptimizePath(path) { this.id.deoptimizePath(path); } + hasEffects(context) { + var _a; + const initEffect = (_a = this.init) === null || _a === void 0 ? void 0 : _a.hasEffects(context); + this.id.markDeclarationReached(); + return initEffect || this.id.hasEffects(context); + } + include(context, includeChildrenRecursively) { + var _a; + this.included = true; + (_a = this.init) === null || _a === void 0 ? void 0 : _a.include(context, includeChildrenRecursively); + this.id.markDeclarationReached(); + if (includeChildrenRecursively || this.id.shouldBeIncluded(context)) { + this.id.include(context, includeChildrenRecursively); + } + } render(code, options) { - // This can happen for hoisted variables in dead branches - if (this.init !== null && !this.init.included) { - code.remove(this.id.end, this.end); + const { exportNamesByVariable, snippets: { _ } } = options; + const renderId = this.id.included; + if (renderId) { this.id.render(code, options); } else { - super.render(code, options); + const operatorPos = findFirstOccurrenceOutsideComment(code.original, '=', this.id.end); + code.remove(this.start, findNonWhiteSpace(code.original, operatorPos + 1)); + } + if (this.init) { + this.init.render(code, options, renderId ? BLANK : { renderedSurroundingElement: ExpressionStatement$1 }); + } + else if (this.id instanceof Identifier && + isReassignedExportsMember(this.id.variable, exportNamesByVariable)) { + code.appendLeft(this.end, `${_}=${_}void 0`); } } + applyDeoptimizations() { } } class WhileStatement extends NodeBase { @@ -8852,25 +11878,21 @@ class WhileStatement extends NodeBase { this.included = true; this.test.include(context, includeChildrenRecursively); const { brokenFlow } = context; - this.body.include(context, includeChildrenRecursively); + this.body.include(context, includeChildrenRecursively, { asSingleStatement: true }); context.brokenFlow = brokenFlow; } } class YieldExpression extends NodeBase { - bind() { - super.bind(); - if (this.argument !== null) { - this.argument.deoptimizePath(UNKNOWN_PATH); - } - } hasEffects(context) { - return (!context.ignore.returnAwaitYield || - (this.argument !== null && this.argument.hasEffects(context))); + var _a; + if (!this.deoptimized) + this.applyDeoptimizations(); + return !(context.ignore.returnYield && !((_a = this.argument) === null || _a === void 0 ? void 0 : _a.hasEffects(context))); } render(code, options) { if (this.argument) { - this.argument.render(code, options); + this.argument.render(code, options, { preventASI: true }); if (this.argument.start === this.start + 5 /* 'yield'.length */) { code.prependLeft(this.start + 5, ' '); } @@ -8881,14 +11903,14 @@ class YieldExpression extends NodeBase { const nodeConstructors = { ArrayExpression, ArrayPattern, - ArrowFunctionExpression: ArrowFunctionExpression$1, + ArrowFunctionExpression, AssignmentExpression, AssignmentPattern, AwaitExpression, BinaryExpression, - BlockStatement: BlockStatement$1, + BlockStatement, BreakStatement, - CallExpression: CallExpression$1, + CallExpression, CatchClause, ChainExpression, ClassBody, @@ -8902,19 +11924,18 @@ const nodeConstructors = { ExportDefaultDeclaration, ExportNamedDeclaration, ExportSpecifier, - ExpressionStatement: ExpressionStatement$1, - FieldDefinition, + ExpressionStatement, ForInStatement, ForOfStatement, ForStatement, FunctionDeclaration, - FunctionExpression: FunctionExpression$1, - Identifier: Identifier$1, + FunctionExpression, + Identifier, IfStatement, ImportDeclaration, - ImportDefaultSpecifier: ImportDefaultSpecifier$1, - ImportExpression: Import, - ImportNamespaceSpecifier: ImportNamespaceSpecifier$1, + ImportDefaultSpecifier, + ImportExpression, + ImportNamespaceSpecifier, ImportSpecifier, LabeledStatement, Literal, @@ -8925,13 +11946,15 @@ const nodeConstructors = { NewExpression, ObjectExpression, ObjectPattern, - PrivateName, - Program: Program$1, - Property: Property$1, + PrivateIdentifier, + Program, + Property, + PropertyDefinition, RestElement, - ReturnStatement: ReturnStatement$1, + ReturnStatement, SequenceExpression, SpreadElement, + StaticBlock, Super, SwitchCase, SwitchStatement, @@ -8946,1135 +11969,1930 @@ const nodeConstructors = { UpdateExpression, VariableDeclaration, VariableDeclarator, - WhileStatement, - YieldExpression -}; - -function getId(m) { - return m.id; -} - -function getOriginalLocation(sourcemapChain, location) { - // This cast is guaranteed. If it were a missing Map, it wouldn't have a mappings. - const filteredSourcemapChain = sourcemapChain.filter(sourcemap => sourcemap.mappings); - while (filteredSourcemapChain.length > 0) { - const sourcemap = filteredSourcemapChain.pop(); - const line = sourcemap.mappings[location.line - 1]; - let locationFound = false; - if (line !== undefined) { - for (const segment of line) { - if (segment[0] >= location.column) { - if (segment.length === 1) - break; - location = { - column: segment[3], - line: segment[2] + 1, - name: segment.length === 5 ? sourcemap.names[segment[4]] : undefined, - source: sourcemap.sources[segment[1]] - }; - locationFound = true; - break; - } - } - } - if (!locationFound) { - throw new Error("Can't resolve original location of error."); - } - } - return location; -} - -// AST walker module for Mozilla Parser API compatible trees - -function skipThrough(node, st, c) { c(node, st); } -function ignore(_node, _st, _c) {} - -// Node walkers. - -var base$1 = {}; - -base$1.Program = base$1.BlockStatement = function (node, st, c) { - for (var i = 0, list = node.body; i < list.length; i += 1) - { - var stmt = list[i]; - - c(stmt, st, "Statement"); - } -}; -base$1.Statement = skipThrough; -base$1.EmptyStatement = ignore; -base$1.ExpressionStatement = base$1.ParenthesizedExpression = - function (node, st, c) { return c(node.expression, st, "Expression"); }; -base$1.IfStatement = function (node, st, c) { - c(node.test, st, "Expression"); - c(node.consequent, st, "Statement"); - if (node.alternate) { c(node.alternate, st, "Statement"); } -}; -base$1.LabeledStatement = function (node, st, c) { return c(node.body, st, "Statement"); }; -base$1.BreakStatement = base$1.ContinueStatement = ignore; -base$1.WithStatement = function (node, st, c) { - c(node.object, st, "Expression"); - c(node.body, st, "Statement"); -}; -base$1.SwitchStatement = function (node, st, c) { - c(node.discriminant, st, "Expression"); - for (var i$1 = 0, list$1 = node.cases; i$1 < list$1.length; i$1 += 1) { - var cs = list$1[i$1]; - - if (cs.test) { c(cs.test, st, "Expression"); } - for (var i = 0, list = cs.consequent; i < list.length; i += 1) - { - var cons = list[i]; - - c(cons, st, "Statement"); - } - } -}; -base$1.SwitchCase = function (node, st, c) { - if (node.test) { c(node.test, st, "Expression"); } - for (var i = 0, list = node.consequent; i < list.length; i += 1) - { - var cons = list[i]; - - c(cons, st, "Statement"); - } -}; -base$1.ReturnStatement = base$1.YieldExpression = base$1.AwaitExpression = function (node, st, c) { - if (node.argument) { c(node.argument, st, "Expression"); } -}; -base$1.ThrowStatement = base$1.SpreadElement = - function (node, st, c) { return c(node.argument, st, "Expression"); }; -base$1.TryStatement = function (node, st, c) { - c(node.block, st, "Statement"); - if (node.handler) { c(node.handler, st); } - if (node.finalizer) { c(node.finalizer, st, "Statement"); } -}; -base$1.CatchClause = function (node, st, c) { - if (node.param) { c(node.param, st, "Pattern"); } - c(node.body, st, "Statement"); -}; -base$1.WhileStatement = base$1.DoWhileStatement = function (node, st, c) { - c(node.test, st, "Expression"); - c(node.body, st, "Statement"); -}; -base$1.ForStatement = function (node, st, c) { - if (node.init) { c(node.init, st, "ForInit"); } - if (node.test) { c(node.test, st, "Expression"); } - if (node.update) { c(node.update, st, "Expression"); } - c(node.body, st, "Statement"); -}; -base$1.ForInStatement = base$1.ForOfStatement = function (node, st, c) { - c(node.left, st, "ForInit"); - c(node.right, st, "Expression"); - c(node.body, st, "Statement"); -}; -base$1.ForInit = function (node, st, c) { - if (node.type === "VariableDeclaration") { c(node, st); } - else { c(node, st, "Expression"); } -}; -base$1.DebuggerStatement = ignore; - -base$1.FunctionDeclaration = function (node, st, c) { return c(node, st, "Function"); }; -base$1.VariableDeclaration = function (node, st, c) { - for (var i = 0, list = node.declarations; i < list.length; i += 1) - { - var decl = list[i]; - - c(decl, st); - } -}; -base$1.VariableDeclarator = function (node, st, c) { - c(node.id, st, "Pattern"); - if (node.init) { c(node.init, st, "Expression"); } -}; - -base$1.Function = function (node, st, c) { - if (node.id) { c(node.id, st, "Pattern"); } - for (var i = 0, list = node.params; i < list.length; i += 1) - { - var param = list[i]; - - c(param, st, "Pattern"); - } - c(node.body, st, node.expression ? "Expression" : "Statement"); -}; - -base$1.Pattern = function (node, st, c) { - if (node.type === "Identifier") - { c(node, st, "VariablePattern"); } - else if (node.type === "MemberExpression") - { c(node, st, "MemberPattern"); } - else - { c(node, st); } -}; -base$1.VariablePattern = ignore; -base$1.MemberPattern = skipThrough; -base$1.RestElement = function (node, st, c) { return c(node.argument, st, "Pattern"); }; -base$1.ArrayPattern = function (node, st, c) { - for (var i = 0, list = node.elements; i < list.length; i += 1) { - var elt = list[i]; - - if (elt) { c(elt, st, "Pattern"); } - } -}; -base$1.ObjectPattern = function (node, st, c) { - for (var i = 0, list = node.properties; i < list.length; i += 1) { - var prop = list[i]; - - if (prop.type === "Property") { - if (prop.computed) { c(prop.key, st, "Expression"); } - c(prop.value, st, "Pattern"); - } else if (prop.type === "RestElement") { - c(prop.argument, st, "Pattern"); - } - } -}; - -base$1.Expression = skipThrough; -base$1.ThisExpression = base$1.Super = base$1.MetaProperty = ignore; -base$1.ArrayExpression = function (node, st, c) { - for (var i = 0, list = node.elements; i < list.length; i += 1) { - var elt = list[i]; - - if (elt) { c(elt, st, "Expression"); } - } -}; -base$1.ObjectExpression = function (node, st, c) { - for (var i = 0, list = node.properties; i < list.length; i += 1) - { - var prop = list[i]; - - c(prop, st); - } -}; -base$1.FunctionExpression = base$1.ArrowFunctionExpression = base$1.FunctionDeclaration; -base$1.SequenceExpression = function (node, st, c) { - for (var i = 0, list = node.expressions; i < list.length; i += 1) - { - var expr = list[i]; - - c(expr, st, "Expression"); - } + WhileStatement, + YieldExpression }; -base$1.TemplateLiteral = function (node, st, c) { - for (var i = 0, list = node.quasis; i < list.length; i += 1) - { - var quasi = list[i]; - c(quasi, st); - } +const MISSING_EXPORT_SHIM_VARIABLE = '_missingExportShim'; - for (var i$1 = 0, list$1 = node.expressions; i$1 < list$1.length; i$1 += 1) - { - var expr = list$1[i$1]; +class ExportShimVariable extends Variable { + constructor(module) { + super(MISSING_EXPORT_SHIM_VARIABLE); + this.module = module; + } + include() { + super.include(); + this.module.needsExportShim = true; + } +} - c(expr, st, "Expression"); - } -}; -base$1.TemplateElement = ignore; -base$1.UnaryExpression = base$1.UpdateExpression = function (node, st, c) { - c(node.argument, st, "Expression"); -}; -base$1.BinaryExpression = base$1.LogicalExpression = function (node, st, c) { - c(node.left, st, "Expression"); - c(node.right, st, "Expression"); -}; -base$1.AssignmentExpression = base$1.AssignmentPattern = function (node, st, c) { - c(node.left, st, "Pattern"); - c(node.right, st, "Expression"); -}; -base$1.ConditionalExpression = function (node, st, c) { - c(node.test, st, "Expression"); - c(node.consequent, st, "Expression"); - c(node.alternate, st, "Expression"); -}; -base$1.NewExpression = base$1.CallExpression = function (node, st, c) { - c(node.callee, st, "Expression"); - if (node.arguments) - { for (var i = 0, list = node.arguments; i < list.length; i += 1) - { - var arg = list[i]; +class NamespaceVariable extends Variable { + constructor(context) { + super(context.getModuleName()); + this.memberVariables = null; + this.mergedNamespaces = []; + this.referencedEarly = false; + this.references = []; + this.context = context; + this.module = context.module; + } + addReference(identifier) { + this.references.push(identifier); + this.name = identifier.name; + } + getMemberVariables() { + if (this.memberVariables) { + return this.memberVariables; + } + const memberVariables = Object.create(null); + for (const name of this.context.getExports().concat(this.context.getReexports())) { + if (name[0] !== '*' && name !== this.module.info.syntheticNamedExports) { + const exportedVariable = this.context.traceExport(name); + if (exportedVariable) { + memberVariables[name] = exportedVariable; + } + } + } + return (this.memberVariables = memberVariables); + } + include() { + this.included = true; + this.context.includeAllExports(); + } + prepare(accessedGlobalsByScope) { + if (this.mergedNamespaces.length > 0) { + this.module.scope.addAccessedGlobals([MERGE_NAMESPACES_VARIABLE], accessedGlobalsByScope); + } + } + renderBlock(options) { + const { exportNamesByVariable, format, freeze, indent: t, namespaceToStringTag, snippets: { _, cnst, getObject, getPropertyAccess, n, s } } = options; + const memberVariables = this.getMemberVariables(); + const members = Object.entries(memberVariables).map(([name, original]) => { + if (this.referencedEarly || original.isReassigned) { + return [ + null, + `get ${name}${_}()${_}{${_}return ${original.getName(getPropertyAccess)}${s}${_}}` + ]; + } + return [name, original.getName(getPropertyAccess)]; + }); + members.unshift([null, `__proto__:${_}null`]); + let output = getObject(members, { lineBreakIndent: { base: '', t } }); + if (this.mergedNamespaces.length > 0) { + const assignmentArgs = this.mergedNamespaces.map(variable => variable.getName(getPropertyAccess)); + output = `/*#__PURE__*/${MERGE_NAMESPACES_VARIABLE}(${output},${_}[${assignmentArgs.join(`,${_}`)}])`; + } + else { + // The helper to merge namespaces will also take care of freezing and toStringTag + if (namespaceToStringTag) { + output = `/*#__PURE__*/Object.defineProperty(${output},${_}Symbol.toStringTag,${_}${getToStringTagValue(getObject)})`; + } + if (freeze) { + output = `/*#__PURE__*/Object.freeze(${output})`; + } + } + const name = this.getName(getPropertyAccess); + output = `${cnst} ${name}${_}=${_}${output};`; + if (format === 'system' && exportNamesByVariable.has(this)) { + output += `${n}${getSystemExportStatement([this], options)};`; + } + return output; + } + renderFirst() { + return this.referencedEarly; + } + setMergedNamespaces(mergedNamespaces) { + this.mergedNamespaces = mergedNamespaces; + const moduleExecIndex = this.context.getModuleExecIndex(); + for (const identifier of this.references) { + if (identifier.context.getModuleExecIndex() <= moduleExecIndex) { + this.referencedEarly = true; + break; + } + } + } +} +NamespaceVariable.prototype.isNamespace = true; - c(arg, st, "Expression"); - } } -}; -base$1.MemberExpression = function (node, st, c) { - c(node.object, st, "Expression"); - if (node.computed) { c(node.property, st, "Expression"); } -}; -base$1.ExportNamedDeclaration = base$1.ExportDefaultDeclaration = function (node, st, c) { - if (node.declaration) - { c(node.declaration, st, node.type === "ExportNamedDeclaration" || node.declaration.id ? "Statement" : "Expression"); } - if (node.source) { c(node.source, st, "Expression"); } -}; -base$1.ExportAllDeclaration = function (node, st, c) { - c(node.source, st, "Expression"); -}; -base$1.ImportDeclaration = function (node, st, c) { - for (var i = 0, list = node.specifiers; i < list.length; i += 1) - { - var spec = list[i]; +class SyntheticNamedExportVariable extends Variable { + constructor(context, name, syntheticNamespace) { + super(name); + this.baseVariable = null; + this.context = context; + this.module = context.module; + this.syntheticNamespace = syntheticNamespace; + } + getBaseVariable() { + if (this.baseVariable) + return this.baseVariable; + let baseVariable = this.syntheticNamespace; + while (baseVariable instanceof ExportDefaultVariable || + baseVariable instanceof SyntheticNamedExportVariable) { + if (baseVariable instanceof ExportDefaultVariable) { + const original = baseVariable.getOriginalVariable(); + if (original === baseVariable) + break; + baseVariable = original; + } + if (baseVariable instanceof SyntheticNamedExportVariable) { + baseVariable = baseVariable.syntheticNamespace; + } + } + return (this.baseVariable = baseVariable); + } + getBaseVariableName() { + return this.syntheticNamespace.getBaseVariableName(); + } + getName(getPropertyAccess) { + return `${this.syntheticNamespace.getName(getPropertyAccess)}${getPropertyAccess(this.name)}`; + } + include() { + this.included = true; + this.context.includeVariableInModule(this.syntheticNamespace); + } + setRenderNames(baseName, name) { + super.setRenderNames(baseName, name); + } +} - c(spec, st); - } - c(node.source, st, "Expression"); -}; -base$1.ImportExpression = function (node, st, c) { - c(node.source, st, "Expression"); -}; -base$1.ImportSpecifier = base$1.ImportDefaultSpecifier = base$1.ImportNamespaceSpecifier = base$1.Identifier = base$1.Literal = ignore; +var BuildPhase; +(function (BuildPhase) { + BuildPhase[BuildPhase["LOAD_AND_PARSE"] = 0] = "LOAD_AND_PARSE"; + BuildPhase[BuildPhase["ANALYSE"] = 1] = "ANALYSE"; + BuildPhase[BuildPhase["GENERATE"] = 2] = "GENERATE"; +})(BuildPhase || (BuildPhase = {})); -base$1.TaggedTemplateExpression = function (node, st, c) { - c(node.tag, st, "Expression"); - c(node.quasi, st, "Expression"); -}; -base$1.ClassDeclaration = base$1.ClassExpression = function (node, st, c) { return c(node, st, "Class"); }; -base$1.Class = function (node, st, c) { - if (node.id) { c(node.id, st, "Pattern"); } - if (node.superClass) { c(node.superClass, st, "Expression"); } - c(node.body, st); -}; -base$1.ClassBody = function (node, st, c) { - for (var i = 0, list = node.body; i < list.length; i += 1) - { - var elt = list[i]; +function getId(m) { + return m.id; +} + +function getOriginalLocation(sourcemapChain, location) { + const filteredSourcemapChain = sourcemapChain.filter((sourcemap) => !!sourcemap.mappings); + traceSourcemap: while (filteredSourcemapChain.length > 0) { + const sourcemap = filteredSourcemapChain.pop(); + const line = sourcemap.mappings[location.line - 1]; + if (line) { + const filteredLine = line.filter((segment) => segment.length > 1); + const lastSegment = filteredLine[filteredLine.length - 1]; + for (const segment of filteredLine) { + if (segment[0] >= location.column || segment === lastSegment) { + location = { + column: segment[3], + line: segment[2] + 1 + }; + continue traceSourcemap; + } + } + } + throw new Error("Can't resolve original location of error."); + } + return location; +} + +const NOOP = () => { }; +let timers = new Map(); +function getPersistedLabel(label, level) { + switch (level) { + case 1: + return `# ${label}`; + case 2: + return `## ${label}`; + case 3: + return label; + default: + return `${' '.repeat(level - 4)}- ${label}`; + } +} +function timeStartImpl(label, level = 3) { + label = getPersistedLabel(label, level); + const startMemory = process$1.memoryUsage().heapUsed; + const startTime = performance.now(); + const timer = timers.get(label); + if (timer === undefined) { + timers.set(label, { + memory: 0, + startMemory, + startTime, + time: 0, + totalMemory: 0 + }); + } + else { + timer.startMemory = startMemory; + timer.startTime = startTime; + } +} +function timeEndImpl(label, level = 3) { + label = getPersistedLabel(label, level); + const timer = timers.get(label); + if (timer !== undefined) { + const currentMemory = process$1.memoryUsage().heapUsed; + timer.memory += currentMemory - timer.startMemory; + timer.time += performance.now() - timer.startTime; + timer.totalMemory = Math.max(timer.totalMemory, currentMemory); + } +} +function getTimings() { + const newTimings = {}; + for (const [label, { memory, time, totalMemory }] of timers) { + newTimings[label] = [time, memory, totalMemory]; + } + return newTimings; +} +let timeStart = NOOP; +let timeEnd = NOOP; +const TIMED_PLUGIN_HOOKS = ['load', 'resolveDynamicImport', 'resolveId', 'transform']; +function getPluginWithTimers(plugin, index) { + for (const hook of TIMED_PLUGIN_HOOKS) { + if (hook in plugin) { + let timerLabel = `plugin ${index}`; + if (plugin.name) { + timerLabel += ` (${plugin.name})`; + } + timerLabel += ` - ${hook}`; + const func = plugin[hook]; + plugin[hook] = function (...args) { + timeStart(timerLabel, 4); + const result = func.apply(this, args); + timeEnd(timerLabel, 4); + if (result && typeof result.then === 'function') { + timeStart(`${timerLabel} (async)`, 4); + return result.then((hookResult) => { + timeEnd(`${timerLabel} (async)`, 4); + return hookResult; + }); + } + return result; + }; + } + } + return plugin; +} +function initialiseTimers(inputOptions) { + if (inputOptions.perf) { + timers = new Map(); + timeStart = timeStartImpl; + timeEnd = timeEndImpl; + inputOptions.plugins = inputOptions.plugins.map(getPluginWithTimers); + } + else { + timeStart = NOOP; + timeEnd = NOOP; + } +} + +function markModuleAndImpureDependenciesAsExecuted(baseModule) { + baseModule.isExecuted = true; + const modules = [baseModule]; + const visitedModules = new Set(); + for (const module of modules) { + for (const dependency of [...module.dependencies, ...module.implicitlyLoadedBefore]) { + if (!(dependency instanceof ExternalModule) && + !dependency.isExecuted && + (dependency.info.moduleSideEffects || module.implicitlyLoadedBefore.has(dependency)) && + !visitedModules.has(dependency.id)) { + dependency.isExecuted = true; + visitedModules.add(dependency.id); + modules.push(dependency); + } + } + } +} - c(elt, st); - } -}; -base$1.MethodDefinition = base$1.Property = function (node, st, c) { - if (node.computed) { c(node.key, st, "Expression"); } - c(node.value, st, "Expression"); +const MISSING_EXPORT_SHIM_DESCRIPTION = { + identifier: null, + localName: MISSING_EXPORT_SHIM_VARIABLE }; - -// @ts-ignore -// patch up acorn-walk until class-fields are officially supported -base$1.FieldDefinition = function (node, st, c) { - if (node.computed) { - c(node.key, st, 'Expression'); - } - if (node.value) { - c(node.value, st, 'Expression'); +function getVariableForExportNameRecursive(target, name, importerForSideEffects, isExportAllSearch, searchedNamesAndModules = new Map()) { + const searchedModules = searchedNamesAndModules.get(name); + if (searchedModules) { + if (searchedModules.has(target)) { + return isExportAllSearch ? [null] : error(errCircularReexport(name, target.id)); + } + searchedModules.add(target); } -}; -function handlePureAnnotationsOfNode(node, state, type = node.type) { - let commentNode = state.commentNodes[state.commentIndex]; - while (commentNode && node.start >= commentNode.end) { - markPureNode(node, commentNode); - commentNode = state.commentNodes[++state.commentIndex]; + else { + searchedNamesAndModules.set(name, new Set([target])); } - if (commentNode && commentNode.end <= node.end) { - base$1[type](node, state, handlePureAnnotationsOfNode); + return target.getVariableForExportName(name, { + importerForSideEffects, + isExportAllSearch, + searchedNamesAndModules + }); +} +function getAndExtendSideEffectModules(variable, module) { + const sideEffectModules = getOrCreate(module.sideEffectDependenciesByVariable, variable, () => new Set()); + let currentVariable = variable; + const referencedVariables = new Set([currentVariable]); + while (true) { + const importingModule = currentVariable.module; + currentVariable = + currentVariable instanceof ExportDefaultVariable + ? currentVariable.getDirectOriginalVariable() + : currentVariable instanceof SyntheticNamedExportVariable + ? currentVariable.syntheticNamespace + : null; + if (!currentVariable || referencedVariables.has(currentVariable)) { + break; + } + referencedVariables.add(currentVariable); + sideEffectModules.add(importingModule); + const originalSideEffects = importingModule.sideEffectDependenciesByVariable.get(currentVariable); + if (originalSideEffects) { + for (const module of originalSideEffects) { + sideEffectModules.add(module); + } + } } + return sideEffectModules; } -function markPureNode(node, comment) { - if (node.annotations) { - node.annotations.push(comment); +class Module { + constructor(graph, id, options, isEntry, moduleSideEffects, syntheticNamedExports, meta) { + this.graph = graph; + this.id = id; + this.options = options; + this.alternativeReexportModules = new Map(); + this.chunkFileNames = new Set(); + this.chunkNames = []; + this.cycles = new Set(); + this.dependencies = new Set(); + this.dynamicDependencies = new Set(); + this.dynamicImporters = []; + this.dynamicImports = []; + this.execIndex = Infinity; + this.implicitlyLoadedAfter = new Set(); + this.implicitlyLoadedBefore = new Set(); + this.importDescriptions = new Map(); + this.importMetas = []; + this.importedFromNotTreeshaken = false; + this.importers = []; + this.includedDynamicImporters = []; + this.includedImports = new Set(); + this.isExecuted = false; + this.isUserDefinedEntryPoint = false; + this.needsExportShim = false; + this.sideEffectDependenciesByVariable = new Map(); + this.sources = new Set(); + this.usesTopLevelAwait = false; + this.allExportNames = null; + this.ast = null; + this.exportAllModules = []; + this.exportAllSources = new Set(); + this.exportNamesByVariable = null; + this.exportShimVariable = new ExportShimVariable(this); + this.exports = new Map(); + this.namespaceReexportsByName = new Map(); + this.reexportDescriptions = new Map(); + this.relevantDependencies = null; + this.syntheticExports = new Map(); + this.syntheticNamespace = null; + this.transformDependencies = []; + this.transitiveReexports = null; + this.excludeFromSourcemap = /\0/.test(id); + this.context = options.moduleContext(id); + this.preserveSignature = this.options.preserveEntrySignatures; + // eslint-disable-next-line @typescript-eslint/no-this-alias + const module = this; + const { dynamicImports, dynamicImporters, implicitlyLoadedAfter, implicitlyLoadedBefore, importers, reexportDescriptions, sources } = this; + this.info = { + ast: null, + code: null, + get dynamicallyImportedIdResolutions() { + return dynamicImports + .map(({ argument }) => typeof argument === 'string' && module.resolvedIds[argument]) + .filter(Boolean); + }, + get dynamicallyImportedIds() { + // We cannot use this.dynamicDependencies because this is needed before + // dynamicDependencies are populated + return dynamicImports.map(({ id }) => id).filter((id) => id != null); + }, + get dynamicImporters() { + return dynamicImporters.sort(); + }, + get hasDefaultExport() { + // This information is only valid after parsing + if (!module.ast) { + return null; + } + return module.exports.has('default') || reexportDescriptions.has('default'); + }, + get hasModuleSideEffects() { + warnDeprecation('Accessing ModuleInfo.hasModuleSideEffects from plugins is deprecated. Please use ModuleInfo.moduleSideEffects instead.', false, options); + return this.moduleSideEffects; + }, + id, + get implicitlyLoadedAfterOneOf() { + return Array.from(implicitlyLoadedAfter, getId).sort(); + }, + get implicitlyLoadedBefore() { + return Array.from(implicitlyLoadedBefore, getId).sort(); + }, + get importedIdResolutions() { + return Array.from(sources, source => module.resolvedIds[source]).filter(Boolean); + }, + get importedIds() { + // We cannot use this.dependencies because this is needed before + // dependencies are populated + return Array.from(sources, source => { var _a; return (_a = module.resolvedIds[source]) === null || _a === void 0 ? void 0 : _a.id; }).filter(Boolean); + }, + get importers() { + return importers.sort(); + }, + isEntry, + isExternal: false, + get isIncluded() { + if (graph.phase !== BuildPhase.GENERATE) { + return null; + } + return module.isIncluded(); + }, + meta: { ...meta }, + moduleSideEffects, + syntheticNamedExports + }; + // Hide the deprecated key so that it only warns when accessed explicitly + Object.defineProperty(this.info, 'hasModuleSideEffects', { + enumerable: false + }); } - else { - node.annotations = [comment]; + basename() { + const base = basename(this.id); + const ext = extname(this.id); + return makeLegal(ext ? base.slice(0, -ext.length) : base); } - if (node.type === 'ExpressionStatement') { - node = node.expression; + bindReferences() { + this.ast.bind(); } - if (node.type === 'CallExpression' || node.type === 'NewExpression') { - node.annotatedPure = true; + error(props, pos) { + this.addLocationToLogProps(props, pos); + return error(props); } -} -const pureCommentRegex = /[@#]__PURE__/; -const isPureComment = (comment) => pureCommentRegex.test(comment.text); -function markPureCallExpressions(comments, esTreeAst) { - handlePureAnnotationsOfNode(esTreeAst, { - commentIndex: 0, - commentNodes: comments.filter(isPureComment) - }); -} - -// this looks ridiculous, but it prevents sourcemap tooling from mistaking -// this for an actual sourceMappingURL -let SOURCEMAPPING_URL = 'sourceMa'; -SOURCEMAPPING_URL += 'ppingURL'; -const SOURCEMAPPING_URL_RE = new RegExp(`^#\\s+${SOURCEMAPPING_URL}=.+\\n?`); - -const NOOP = () => { }; -let getStartTime = () => [0, 0]; -let getElapsedTime = () => 0; -let getMemory = () => 0; -let timers = {}; -const normalizeHrTime = (time) => time[0] * 1e3 + time[1] / 1e6; -function setTimeHelpers() { - if (typeof process !== 'undefined' && typeof process.hrtime === 'function') { - getStartTime = process.hrtime.bind(process); - getElapsedTime = previous => normalizeHrTime(process.hrtime(previous)); + getAllExportNames() { + if (this.allExportNames) { + return this.allExportNames; + } + this.allExportNames = new Set([...this.exports.keys(), ...this.reexportDescriptions.keys()]); + for (const module of this.exportAllModules) { + if (module instanceof ExternalModule) { + this.allExportNames.add(`*${module.id}`); + continue; + } + for (const name of module.getAllExportNames()) { + if (name !== 'default') + this.allExportNames.add(name); + } + } + // We do not count the synthetic namespace as a regular export to hide it + // from entry signatures and namespace objects + if (typeof this.info.syntheticNamedExports === 'string') { + this.allExportNames.delete(this.info.syntheticNamedExports); + } + return this.allExportNames; + } + getDependenciesToBeIncluded() { + if (this.relevantDependencies) + return this.relevantDependencies; + this.relevantDependencies = new Set(); + const necessaryDependencies = new Set(); + const alwaysCheckedDependencies = new Set(); + const dependencyVariables = new Set(this.includedImports); + if (this.info.isEntry || + this.includedDynamicImporters.length > 0 || + this.namespace.included || + this.implicitlyLoadedAfter.size > 0) { + for (const exportName of [...this.getReexports(), ...this.getExports()]) { + const [exportedVariable] = this.getVariableForExportName(exportName); + if (exportedVariable) { + dependencyVariables.add(exportedVariable); + } + } + } + for (let variable of dependencyVariables) { + const sideEffectDependencies = this.sideEffectDependenciesByVariable.get(variable); + if (sideEffectDependencies) { + for (const module of sideEffectDependencies) { + alwaysCheckedDependencies.add(module); + } + } + if (variable instanceof SyntheticNamedExportVariable) { + variable = variable.getBaseVariable(); + } + else if (variable instanceof ExportDefaultVariable) { + variable = variable.getOriginalVariable(); + } + necessaryDependencies.add(variable.module); + } + if (!this.options.treeshake || this.info.moduleSideEffects === 'no-treeshake') { + for (const dependency of this.dependencies) { + this.relevantDependencies.add(dependency); + } + } + else { + this.addRelevantSideEffectDependencies(this.relevantDependencies, necessaryDependencies, alwaysCheckedDependencies); + } + for (const dependency of necessaryDependencies) { + this.relevantDependencies.add(dependency); + } + return this.relevantDependencies; } - else if (typeof performance !== 'undefined' && typeof performance.now === 'function') { - getStartTime = () => [performance.now(), 0]; - getElapsedTime = previous => performance.now() - previous[0]; + getExportNamesByVariable() { + if (this.exportNamesByVariable) { + return this.exportNamesByVariable; + } + const exportNamesByVariable = new Map(); + for (const exportName of this.getAllExportNames()) { + let [tracedVariable] = this.getVariableForExportName(exportName); + if (tracedVariable instanceof ExportDefaultVariable) { + tracedVariable = tracedVariable.getOriginalVariable(); + } + if (!tracedVariable || + !(tracedVariable.included || tracedVariable instanceof ExternalVariable)) { + continue; + } + const existingExportNames = exportNamesByVariable.get(tracedVariable); + if (existingExportNames) { + existingExportNames.push(exportName); + } + else { + exportNamesByVariable.set(tracedVariable, [exportName]); + } + } + return (this.exportNamesByVariable = exportNamesByVariable); } - if (typeof process !== 'undefined' && typeof process.memoryUsage === 'function') { - getMemory = () => process.memoryUsage().heapUsed; + getExports() { + return Array.from(this.exports.keys()); } -} -function getPersistedLabel(label, level) { - switch (level) { - case 1: - return `# ${label}`; - case 2: - return `## ${label}`; - case 3: - return label; - default: - return `${' '.repeat(level - 4)}- ${label}`; + getReexports() { + if (this.transitiveReexports) { + return this.transitiveReexports; + } + // to avoid infinite recursion when using circular `export * from X` + this.transitiveReexports = []; + const reexports = new Set(this.reexportDescriptions.keys()); + for (const module of this.exportAllModules) { + if (module instanceof ExternalModule) { + reexports.add(`*${module.id}`); + } + else { + for (const name of [...module.getReexports(), ...module.getExports()]) { + if (name !== 'default') + reexports.add(name); + } + } + } + return (this.transitiveReexports = [...reexports]); } -} -function timeStartImpl(label, level = 3) { - label = getPersistedLabel(label, level); - if (!timers.hasOwnProperty(label)) { - timers[label] = { - memory: 0, - startMemory: undefined, - startTime: undefined, - time: 0, - totalMemory: 0 - }; + getRenderedExports() { + // only direct exports are counted here, not reexports at all + const renderedExports = []; + const removedExports = []; + for (const exportName of this.exports.keys()) { + const [variable] = this.getVariableForExportName(exportName); + (variable && variable.included ? renderedExports : removedExports).push(exportName); + } + return { removedExports, renderedExports }; } - const currentMemory = getMemory(); - timers[label].startTime = getStartTime(); - timers[label].startMemory = currentMemory; -} -function timeEndImpl(label, level = 3) { - label = getPersistedLabel(label, level); - if (timers.hasOwnProperty(label)) { - const currentMemory = getMemory(); - timers[label].time += getElapsedTime(timers[label].startTime); - timers[label].totalMemory = Math.max(timers[label].totalMemory, currentMemory); - timers[label].memory += currentMemory - timers[label].startMemory; + getSyntheticNamespace() { + if (this.syntheticNamespace === null) { + this.syntheticNamespace = undefined; + [this.syntheticNamespace] = this.getVariableForExportName(typeof this.info.syntheticNamedExports === 'string' + ? this.info.syntheticNamedExports + : 'default', { onlyExplicit: true }); + } + if (!this.syntheticNamespace) { + return error(errSyntheticNamedExportsNeedNamespaceExport(this.id, this.info.syntheticNamedExports)); + } + return this.syntheticNamespace; } -} -function getTimings() { - const newTimings = {}; - for (const label of Object.keys(timers)) { - newTimings[label] = [timers[label].time, timers[label].memory, timers[label].totalMemory]; + getVariableForExportName(name, { importerForSideEffects, isExportAllSearch, onlyExplicit, searchedNamesAndModules } = EMPTY_OBJECT) { + var _a; + if (name[0] === '*') { + if (name.length === 1) { + // export * from './other' + return [this.namespace]; + } + // export * from 'external' + const module = this.graph.modulesById.get(name.slice(1)); + return module.getVariableForExportName('*'); + } + // export { foo } from './other' + const reexportDeclaration = this.reexportDescriptions.get(name); + if (reexportDeclaration) { + const [variable] = getVariableForExportNameRecursive(reexportDeclaration.module, reexportDeclaration.localName, importerForSideEffects, false, searchedNamesAndModules); + if (!variable) { + return this.error(errMissingExport(reexportDeclaration.localName, this.id, reexportDeclaration.module.id), reexportDeclaration.start); + } + if (importerForSideEffects) { + setAlternativeExporterIfCyclic(variable, importerForSideEffects, this); + } + return [variable]; + } + const exportDeclaration = this.exports.get(name); + if (exportDeclaration) { + if (exportDeclaration === MISSING_EXPORT_SHIM_DESCRIPTION) { + return [this.exportShimVariable]; + } + const name = exportDeclaration.localName; + const variable = this.traceVariable(name, { + importerForSideEffects, + searchedNamesAndModules + }); + if (importerForSideEffects) { + getOrCreate(importerForSideEffects.sideEffectDependenciesByVariable, variable, () => new Set()).add(this); + setAlternativeExporterIfCyclic(variable, importerForSideEffects, this); + } + return [variable]; + } + if (onlyExplicit) { + return [null]; + } + if (name !== 'default') { + const foundNamespaceReexport = (_a = this.namespaceReexportsByName.get(name)) !== null && _a !== void 0 ? _a : this.getVariableFromNamespaceReexports(name, importerForSideEffects, searchedNamesAndModules); + this.namespaceReexportsByName.set(name, foundNamespaceReexport); + if (foundNamespaceReexport[0]) { + return foundNamespaceReexport; + } + } + if (this.info.syntheticNamedExports) { + return [ + getOrCreate(this.syntheticExports, name, () => new SyntheticNamedExportVariable(this.astContext, name, this.getSyntheticNamespace())) + ]; + } + // we don't want to create shims when we are just + // probing export * modules for exports + if (!isExportAllSearch) { + if (this.options.shimMissingExports) { + this.shimMissingExport(name); + return [this.exportShimVariable]; + } + } + return [null]; } - return newTimings; -} -let timeStart = NOOP, timeEnd = NOOP; -const TIMED_PLUGIN_HOOKS = { - load: true, - resolveDynamicImport: true, - resolveId: true, - transform: true -}; -function getPluginWithTimers(plugin, index) { - const timedPlugin = {}; - for (const hook of Object.keys(plugin)) { - if (TIMED_PLUGIN_HOOKS[hook] === true) { - let timerLabel = `plugin ${index}`; - if (plugin.name) { - timerLabel += ` (${plugin.name})`; + hasEffects() { + return (this.info.moduleSideEffects === 'no-treeshake' || + (this.ast.included && this.ast.hasEffects(createHasEffectsContext()))); + } + include() { + const context = createInclusionContext(); + if (this.ast.shouldBeIncluded(context)) + this.ast.include(context, false); + } + includeAllExports(includeNamespaceMembers) { + if (!this.isExecuted) { + markModuleAndImpureDependenciesAsExecuted(this); + this.graph.needsTreeshakingPass = true; + } + for (const exportName of this.exports.keys()) { + if (includeNamespaceMembers || exportName !== this.info.syntheticNamedExports) { + const variable = this.getVariableForExportName(exportName)[0]; + variable.deoptimizePath(UNKNOWN_PATH); + if (!variable.included) { + this.includeVariable(variable); + } } - timerLabel += ` - ${hook}`; - timedPlugin[hook] = function () { - timeStart(timerLabel, 4); - const result = plugin[hook].apply(this === timedPlugin ? plugin : this, arguments); - timeEnd(timerLabel, 4); - if (result && typeof result.then === 'function') { - timeStart(`${timerLabel} (async)`, 4); - result.then(() => timeEnd(`${timerLabel} (async)`, 4)); + } + for (const name of this.getReexports()) { + const [variable] = this.getVariableForExportName(name); + if (variable) { + variable.deoptimizePath(UNKNOWN_PATH); + if (!variable.included) { + this.includeVariable(variable); } - return result; - }; + if (variable instanceof ExternalVariable) { + variable.module.reexported = true; + } + } } - else { - timedPlugin[hook] = plugin[hook]; + if (includeNamespaceMembers) { + this.namespace.setMergedNamespaces(this.includeAndGetAdditionalMergedNamespaces()); } } - return timedPlugin; -} -function initialiseTimers(inputOptions) { - if (inputOptions.perf) { - timers = {}; - setTimeHelpers(); - timeStart = timeStartImpl; - timeEnd = timeEndImpl; - inputOptions.plugins = inputOptions.plugins.map(getPluginWithTimers); - } - else { - timeStart = NOOP; - timeEnd = NOOP; + includeAllInBundle() { + this.ast.include(createInclusionContext(), true); + this.includeAllExports(false); } -} - -function tryParse(module, Parser, acornOptions) { - try { - return Parser.parse(module.code, { - ...acornOptions, - onComment: (block, text, start, end) => module.comments.push({ block, text, start, end }) - }); + isIncluded() { + return this.ast.included || this.namespace.included || this.importedFromNotTreeshaken; } - catch (err) { - let message = err.message.replace(/ \(\d+:\d+\)$/, ''); - if (module.id.endsWith('.json')) { - message += ' (Note that you need @rollup/plugin-json to import JSON files)'; - } - else if (!module.id.endsWith('.js')) { - message += ' (Note that you need plugins to import files that are not JavaScript)'; + linkImports() { + this.addModulesToImportDescriptions(this.importDescriptions); + this.addModulesToImportDescriptions(this.reexportDescriptions); + const externalExportAllModules = []; + for (const source of this.exportAllSources) { + const module = this.graph.modulesById.get(this.resolvedIds[source].id); + if (module instanceof ExternalModule) { + externalExportAllModules.push(module); + continue; + } + this.exportAllModules.push(module); } - return module.error({ - code: 'PARSE_ERROR', - message, - parserError: err - }, err.pos); + this.exportAllModules.push(...externalExportAllModules); } -} -function handleMissingExport(exportName, importingModule, importedModule, importerStart) { - return importingModule.error({ - code: 'MISSING_EXPORT', - message: `'${exportName}' is not exported by ${relativeId(importedModule)}, imported by ${relativeId(importingModule.id)}`, - url: `https://rollupjs.org/guide/en/#error-name-is-not-exported-by-module` - }, importerStart); -} -const MISSING_EXPORT_SHIM_DESCRIPTION = { - identifier: null, - localName: MISSING_EXPORT_SHIM_VARIABLE -}; -function getVariableForExportNameRecursive(target, name, isExportAllSearch, searchedNamesAndModules = new Map()) { - const searchedModules = searchedNamesAndModules.get(name); - if (searchedModules) { - if (searchedModules.has(target)) { - return null; + render(options) { + const magicString = this.magicString.clone(); + this.ast.render(magicString, options); + this.usesTopLevelAwait = this.astContext.usesTopLevelAwait; + return magicString; + } + setSource({ ast, code, customTransformCache, originalCode, originalSourcemap, resolvedIds, sourcemapChain, transformDependencies, transformFiles, ...moduleOptions }) { + this.info.code = code; + this.originalCode = originalCode; + this.originalSourcemap = originalSourcemap; + this.sourcemapChain = sourcemapChain; + if (transformFiles) { + this.transformFiles = transformFiles; } - searchedModules.add(target); + this.transformDependencies = transformDependencies; + this.customTransformCache = customTransformCache; + this.updateOptions(moduleOptions); + timeStart('generate ast', 3); + if (!ast) { + ast = this.tryParse(); + } + timeEnd('generate ast', 3); + this.resolvedIds = resolvedIds || Object.create(null); + // By default, `id` is the file name. Custom resolvers and loaders + // can change that, but it makes sense to use it for the source file name + const fileName = this.id; + this.magicString = new MagicString(code, { + filename: (this.excludeFromSourcemap ? null : fileName), + indentExclusionRanges: [] + }); + timeStart('analyse ast', 3); + this.astContext = { + addDynamicImport: this.addDynamicImport.bind(this), + addExport: this.addExport.bind(this), + addImport: this.addImport.bind(this), + addImportMeta: this.addImportMeta.bind(this), + code, + deoptimizationTracker: this.graph.deoptimizationTracker, + error: this.error.bind(this), + fileName, + getExports: this.getExports.bind(this), + getModuleExecIndex: () => this.execIndex, + getModuleName: this.basename.bind(this), + getNodeConstructor: (name) => nodeConstructors[name] || nodeConstructors.UnknownNode, + getReexports: this.getReexports.bind(this), + importDescriptions: this.importDescriptions, + includeAllExports: () => this.includeAllExports(true), + includeDynamicImport: this.includeDynamicImport.bind(this), + includeVariableInModule: this.includeVariableInModule.bind(this), + magicString: this.magicString, + module: this, + moduleContext: this.context, + options: this.options, + requestTreeshakingPass: () => (this.graph.needsTreeshakingPass = true), + traceExport: (name) => this.getVariableForExportName(name)[0], + traceVariable: this.traceVariable.bind(this), + usesTopLevelAwait: false, + warn: this.warn.bind(this) + }; + this.scope = new ModuleScope(this.graph.scope, this.astContext); + this.namespace = new NamespaceVariable(this.astContext); + this.ast = new Program(ast, { context: this.astContext, type: 'Module' }, this.scope); + this.info.ast = ast; + timeEnd('analyse ast', 3); } - else { - searchedNamesAndModules.set(name, new Set([target])); + toJSON() { + return { + ast: this.ast.esTreeNode, + code: this.info.code, + customTransformCache: this.customTransformCache, + dependencies: Array.from(this.dependencies, getId), + id: this.id, + meta: this.info.meta, + moduleSideEffects: this.info.moduleSideEffects, + originalCode: this.originalCode, + originalSourcemap: this.originalSourcemap, + resolvedIds: this.resolvedIds, + sourcemapChain: this.sourcemapChain, + syntheticNamedExports: this.info.syntheticNamedExports, + transformDependencies: this.transformDependencies, + transformFiles: this.transformFiles + }; } - return target.getVariableForExportName(name, isExportAllSearch, searchedNamesAndModules); -} -class Module { - constructor(graph, id, options, moduleSideEffects, syntheticNamedExports, isEntryPoint) { - this.graph = graph; - this.id = id; - this.options = options; - this.moduleSideEffects = moduleSideEffects; - this.syntheticNamedExports = syntheticNamedExports; - this.isEntryPoint = isEntryPoint; - this.chunkFileNames = new Set(); - this.chunkName = null; - this.comments = []; - this.dependencies = new Set(); - this.dynamicDependencies = new Set(); - this.dynamicImporters = []; - this.dynamicImports = []; - this.execIndex = Infinity; - this.exportAllSources = new Set(); - this.exports = Object.create(null); - this.exportsAll = Object.create(null); - this.implicitlyLoadedAfter = new Set(); - this.implicitlyLoadedBefore = new Set(); - this.importDescriptions = Object.create(null); - this.importers = []; - this.importMetas = []; - this.imports = new Set(); - this.includedDynamicImporters = []; - this.isExecuted = false; - this.isUserDefinedEntryPoint = false; - this.preserveSignature = this.options.preserveEntrySignatures; - this.reexportDescriptions = Object.create(null); - this.sources = new Set(); - this.userChunkNames = new Set(); - this.usesTopLevelAwait = false; - this.allExportNames = null; - this.defaultExport = null; - this.exportAllModules = []; - this.exportNamesByVariable = null; - this.exportShimVariable = new ExportShimVariable(this); - this.relevantDependencies = null; - this.syntheticExports = new Map(); - this.transformDependencies = []; - this.transitiveReexports = null; - this.excludeFromSourcemap = /\0/.test(id); - this.context = options.moduleContext(id); + traceVariable(name, { importerForSideEffects, isExportAllSearch, searchedNamesAndModules } = EMPTY_OBJECT) { + const localVariable = this.scope.variables.get(name); + if (localVariable) { + return localVariable; + } + const importDeclaration = this.importDescriptions.get(name); + if (importDeclaration) { + const otherModule = importDeclaration.module; + if (otherModule instanceof Module && importDeclaration.name === '*') { + return otherModule.namespace; + } + const [declaration] = getVariableForExportNameRecursive(otherModule, importDeclaration.name, importerForSideEffects || this, isExportAllSearch, searchedNamesAndModules); + if (!declaration) { + return this.error(errMissingExport(importDeclaration.name, this.id, otherModule.id), importDeclaration.start); + } + return declaration; + } + return null; } - basename() { - const base = basename(this.id); - const ext = extname(this.id); - return makeLegal(ext ? base.slice(0, -ext.length) : base); + tryParse() { + try { + return this.graph.contextParse(this.info.code); + } + catch (err) { + let message = err.message.replace(/ \(\d+:\d+\)$/, ''); + if (this.id.endsWith('.json')) { + message += ' (Note that you need @rollup/plugin-json to import JSON files)'; + } + else if (!this.id.endsWith('.js')) { + message += ' (Note that you need plugins to import files that are not JavaScript)'; + } + return this.error({ + code: 'PARSE_ERROR', + message, + parserError: err + }, err.pos); + } } - bindReferences() { - this.ast.bind(); + updateOptions({ meta, moduleSideEffects, syntheticNamedExports }) { + if (moduleSideEffects != null) { + this.info.moduleSideEffects = moduleSideEffects; + } + if (syntheticNamedExports != null) { + this.info.syntheticNamedExports = syntheticNamedExports; + } + if (meta != null) { + Object.assign(this.info.meta, meta); + } } - error(props, pos) { + warn(props, pos) { this.addLocationToLogProps(props, pos); - return error(props); + this.options.onwarn(props); } - getAllExportNames() { - if (this.allExportNames) { - return this.allExportNames; + addDynamicImport(node) { + let argument = node.source; + if (argument instanceof TemplateLiteral) { + if (argument.quasis.length === 1 && argument.quasis[0].value.cooked) { + argument = argument.quasis[0].value.cooked; + } } - const allExportNames = (this.allExportNames = new Set()); - for (const name of Object.keys(this.exports)) { - allExportNames.add(name); + else if (argument instanceof Literal && typeof argument.value === 'string') { + argument = argument.value; } - for (const name of Object.keys(this.reexportDescriptions)) { - allExportNames.add(name); + this.dynamicImports.push({ argument, id: null, node, resolution: null }); + } + addExport(node) { + if (node instanceof ExportDefaultDeclaration) { + // export default foo; + this.exports.set('default', { + identifier: node.variable.getAssignedVariableName(), + localName: 'default' + }); } - for (const module of this.exportAllModules) { - if (module instanceof ExternalModule) { - allExportNames.add(`*${module.id}`); - continue; + else if (node instanceof ExportAllDeclaration) { + const source = node.source.value; + this.sources.add(source); + if (node.exported) { + // export * as name from './other' + const name = node.exported.name; + this.reexportDescriptions.set(name, { + localName: '*', + module: null, + source, + start: node.start + }); + } + else { + // export * from './other' + this.exportAllSources.add(source); + } + } + else if (node.source instanceof Literal) { + // export { name } from './other' + const source = node.source.value; + this.sources.add(source); + for (const specifier of node.specifiers) { + const name = specifier.exported.name; + this.reexportDescriptions.set(name, { + localName: specifier.local.name, + module: null, + source, + start: specifier.start + }); + } + } + else if (node.declaration) { + const declaration = node.declaration; + if (declaration instanceof VariableDeclaration) { + // export var { foo, bar } = ... + // export var foo = 1, bar = 2; + for (const declarator of declaration.declarations) { + for (const localName of extractAssignedNames(declarator.id)) { + this.exports.set(localName, { identifier: null, localName }); + } + } + } + else { + // export function foo () {} + const localName = declaration.id.name; + this.exports.set(localName, { identifier: null, localName }); } - for (const name of module.getAllExportNames()) { - if (name !== 'default') - allExportNames.add(name); + } + else { + // export { foo, bar, baz } + for (const specifier of node.specifiers) { + const localName = specifier.local.name; + const exportedName = specifier.exported.name; + this.exports.set(exportedName, { identifier: null, localName }); } } - return allExportNames; } - getDefaultExport() { - if (this.defaultExport === null) { - this.defaultExport = undefined; - this.defaultExport = this.getVariableForExportName('default'); - } - if (!this.defaultExport) { - return error({ - code: Errors.SYNTHETIC_NAMED_EXPORTS_NEED_DEFAULT, - id: this.id, - message: `Modules with 'syntheticNamedExports' need a default export.` + addImport(node) { + const source = node.source.value; + this.sources.add(source); + for (const specifier of node.specifiers) { + const isDefault = specifier.type === ImportDefaultSpecifier$1; + const isNamespace = specifier.type === ImportNamespaceSpecifier$1; + const name = isDefault ? 'default' : isNamespace ? '*' : specifier.imported.name; + this.importDescriptions.set(specifier.local.name, { + module: null, + name, + source, + start: specifier.start }); } - return this.defaultExport; } - getDependenciesToBeIncluded() { - if (this.relevantDependencies) - return this.relevantDependencies; - const relevantDependencies = new Set(); - const additionalSideEffectModules = new Set(); - const possibleDependencies = new Set(this.dependencies); - let dependencyVariables = this.imports; - if (this.isEntryPoint || this.includedDynamicImporters.length > 0 || this.namespace.included) { - dependencyVariables = new Set(dependencyVariables); - for (const exportName of [...this.getReexports(), ...this.getExports()]) { - dependencyVariables.add(this.getVariableForExportName(exportName)); + addImportMeta(node) { + this.importMetas.push(node); + } + addLocationToLogProps(props, pos) { + props.id = this.id; + props.pos = pos; + let code = this.info.code; + const location = locate(code, pos, { offsetLine: 1 }); + if (location) { + let { column, line } = location; + try { + ({ column, line } = getOriginalLocation(this.sourcemapChain, { column, line })); + code = this.originalCode; + } + catch (err) { + this.options.onwarn({ + code: 'SOURCEMAP_ERROR', + id: this.id, + loc: { + column, + file: this.id, + line + }, + message: `Error when using sourcemap for reporting an error: ${err.message}`, + pos + }); } + augmentCodeLocation(props, { column, line }, code, this.id); } - for (let variable of dependencyVariables) { - if (variable instanceof SyntheticNamedExportVariable) { - variable = variable.getBaseVariable(); - } - else if (variable instanceof ExportDefaultVariable) { - const { modules, original } = variable.getOriginalVariableAndDeclarationModules(); - variable = original; - for (const module of modules) { - additionalSideEffectModules.add(module); - possibleDependencies.add(module); - } - } - relevantDependencies.add(variable.module); + } + addModulesToImportDescriptions(importDescription) { + for (const specifier of importDescription.values()) { + const { id } = this.resolvedIds[specifier.source]; + specifier.module = this.graph.modulesById.get(id); } - if (this.options.treeshake) { + } + addRelevantSideEffectDependencies(relevantDependencies, necessaryDependencies, alwaysCheckedDependencies) { + const handledDependencies = new Set(); + const addSideEffectDependencies = (possibleDependencies) => { for (const dependency of possibleDependencies) { - if (!(dependency.moduleSideEffects || additionalSideEffectModules.has(dependency)) || - relevantDependencies.has(dependency)) { + if (handledDependencies.has(dependency)) { + continue; + } + handledDependencies.add(dependency); + if (necessaryDependencies.has(dependency)) { + relevantDependencies.add(dependency); + continue; + } + if (!(dependency.info.moduleSideEffects || alwaysCheckedDependencies.has(dependency))) { continue; } if (dependency instanceof ExternalModule || dependency.hasEffects()) { relevantDependencies.add(dependency); + continue; } - else { - for (const transitiveDependency of dependency.dependencies) { - possibleDependencies.add(transitiveDependency); - } + addSideEffectDependencies(dependency.dependencies); + } + }; + addSideEffectDependencies(this.dependencies); + addSideEffectDependencies(alwaysCheckedDependencies); + } + getVariableFromNamespaceReexports(name, importerForSideEffects, searchedNamesAndModules) { + let foundSyntheticDeclaration = null; + const foundInternalDeclarations = new Map(); + const foundExternalDeclarations = new Set(); + for (const module of this.exportAllModules) { + // Synthetic namespaces should not hide "regular" exports of the same name + if (module.info.syntheticNamedExports === name) { + continue; + } + const [variable, indirectExternal] = getVariableForExportNameRecursive(module, name, importerForSideEffects, true, + // We are creating a copy to handle the case where the same binding is + // imported through different namespace reexports gracefully + copyNameToModulesMap(searchedNamesAndModules)); + if (module instanceof ExternalModule || indirectExternal) { + foundExternalDeclarations.add(variable); + } + else if (variable instanceof SyntheticNamedExportVariable) { + if (!foundSyntheticDeclaration) { + foundSyntheticDeclaration = variable; } } + else if (variable) { + foundInternalDeclarations.set(variable, module); + } } - else { - for (const dependency of this.dependencies) { - relevantDependencies.add(dependency); + if (foundInternalDeclarations.size > 0) { + const foundDeclarationList = [...foundInternalDeclarations]; + const usedDeclaration = foundDeclarationList[0][0]; + if (foundDeclarationList.length === 1) { + return [usedDeclaration]; } + this.options.onwarn(errNamespaceConflict(name, this.id, foundDeclarationList.map(([, module]) => module.id))); + // TODO we are pretending it was not found while it should behave like "undefined" + return [null]; } - return (this.relevantDependencies = relevantDependencies); + if (foundExternalDeclarations.size > 0) { + const foundDeclarationList = [...foundExternalDeclarations]; + const usedDeclaration = foundDeclarationList[0]; + if (foundDeclarationList.length > 1) { + this.options.onwarn(errAmbiguousExternalNamespaces(name, this.id, usedDeclaration.module.id, foundDeclarationList.map(declaration => declaration.module.id))); + } + return [usedDeclaration, true]; + } + if (foundSyntheticDeclaration) { + return [foundSyntheticDeclaration]; + } + return [null]; } - getExportNamesByVariable() { - if (this.exportNamesByVariable) { - return this.exportNamesByVariable; + includeAndGetAdditionalMergedNamespaces() { + const externalNamespaces = new Set(); + const syntheticNamespaces = new Set(); + for (const module of [this, ...this.exportAllModules]) { + if (module instanceof ExternalModule) { + const [externalVariable] = module.getVariableForExportName('*'); + externalVariable.include(); + this.includedImports.add(externalVariable); + externalNamespaces.add(externalVariable); + } + else if (module.info.syntheticNamedExports) { + const syntheticNamespace = module.getSyntheticNamespace(); + syntheticNamespace.include(); + this.includedImports.add(syntheticNamespace); + syntheticNamespaces.add(syntheticNamespace); + } } - const exportNamesByVariable = new Map(); - for (const exportName of this.getAllExportNames()) { - let tracedVariable = this.getVariableForExportName(exportName); - if (tracedVariable instanceof ExportDefaultVariable) { - tracedVariable = tracedVariable.getOriginalVariable(); + return [...syntheticNamespaces, ...externalNamespaces]; + } + includeDynamicImport(node) { + const resolution = this.dynamicImports.find(dynamicImport => dynamicImport.node === node).resolution; + if (resolution instanceof Module) { + resolution.includedDynamicImporters.push(this); + resolution.includeAllExports(true); + } + } + includeVariable(variable) { + if (!variable.included) { + variable.include(); + this.graph.needsTreeshakingPass = true; + const variableModule = variable.module; + if (variableModule instanceof Module) { + if (!variableModule.isExecuted) { + markModuleAndImpureDependenciesAsExecuted(variableModule); + } + if (variableModule !== this) { + const sideEffectModules = getAndExtendSideEffectModules(variable, this); + for (const module of sideEffectModules) { + if (!module.isExecuted) { + markModuleAndImpureDependenciesAsExecuted(module); + } + } + } } - if (!tracedVariable || - !(tracedVariable.included || tracedVariable instanceof ExternalVariable)) { - continue; + } + } + includeVariableInModule(variable) { + this.includeVariable(variable); + const variableModule = variable.module; + if (variableModule && variableModule !== this) { + this.includedImports.add(variable); + } + } + shimMissingExport(name) { + this.options.onwarn({ + code: 'SHIMMED_EXPORT', + exporter: relativeId(this.id), + exportName: name, + message: `Missing export "${name}" has been shimmed in module ${relativeId(this.id)}.` + }); + this.exports.set(name, MISSING_EXPORT_SHIM_DESCRIPTION); + } +} +// if there is a cyclic import in the reexport chain, we should not +// import from the original module but from the cyclic module to not +// mess up execution order. +function setAlternativeExporterIfCyclic(variable, importer, reexporter) { + if (variable.module instanceof Module && variable.module !== reexporter) { + const exporterCycles = variable.module.cycles; + if (exporterCycles.size > 0) { + const importerCycles = reexporter.cycles; + for (const cycleSymbol of importerCycles) { + if (exporterCycles.has(cycleSymbol)) { + importer.alternativeReexportModules.set(variable, reexporter); + break; + } } - const existingExportNames = exportNamesByVariable.get(tracedVariable); - if (existingExportNames) { - existingExportNames.push(exportName); + } + } +} +const copyNameToModulesMap = (searchedNamesAndModules) => searchedNamesAndModules && + new Map(Array.from(searchedNamesAndModules, ([name, modules]) => [name, new Set(modules)])); + +function removeJsExtension(name) { + return name.endsWith('.js') ? name.slice(0, -3) : name; +} + +function getCompleteAmdId(options, chunkId) { + if (options.autoId) { + return `${options.basePath ? options.basePath + '/' : ''}${removeJsExtension(chunkId)}`; + } + return options.id || ''; +} + +function getExportBlock$1(exports, dependencies, namedExportsMode, interop, snippets, t, externalLiveBindings, mechanism = 'return ') { + const { _, cnst, getDirectReturnFunction, getFunctionIntro, getPropertyAccess, n, s } = snippets; + if (!namedExportsMode) { + return `${n}${n}${mechanism}${getSingleDefaultExport(exports, dependencies, interop, externalLiveBindings, getPropertyAccess)};`; + } + let exportBlock = ''; + for (const { defaultVariableName, id, isChunk, name, namedExportsMode: depNamedExportsMode, namespaceVariableName, reexports } of dependencies) { + if (reexports && namedExportsMode) { + for (const specifier of reexports) { + if (specifier.reexported !== '*') { + const importName = getReexportedImportName(name, specifier.imported, depNamedExportsMode, isChunk, defaultVariableName, namespaceVariableName, interop, id, externalLiveBindings, getPropertyAccess); + if (exportBlock) + exportBlock += n; + if (specifier.imported !== '*' && specifier.needsLiveBinding) { + const [left, right] = getDirectReturnFunction([], { + functionReturn: true, + lineBreakIndent: null, + name: null + }); + exportBlock += + `Object.defineProperty(exports,${_}'${specifier.reexported}',${_}{${n}` + + `${t}enumerable:${_}true,${n}` + + `${t}get:${_}${left}${importName}${right}${n}});`; + } + else { + exportBlock += `exports${getPropertyAccess(specifier.reexported)}${_}=${_}${importName};`; + } + } } - else { - exportNamesByVariable.set(tracedVariable, [exportName]); + } + } + for (const { exported, local } of exports) { + const lhs = `exports${getPropertyAccess(exported)}`; + const rhs = local; + if (lhs !== rhs) { + if (exportBlock) + exportBlock += n; + exportBlock += `${lhs}${_}=${_}${rhs};`; + } + } + for (const { name, reexports } of dependencies) { + if (reexports && namedExportsMode) { + for (const specifier of reexports) { + if (specifier.reexported === '*') { + if (exportBlock) + exportBlock += n; + const copyPropertyIfNecessary = `{${n}${t}if${_}(k${_}!==${_}'default'${_}&&${_}!exports.hasOwnProperty(k))${_}${getDefineProperty(name, specifier.needsLiveBinding, t, snippets)}${s}${n}}`; + exportBlock += + cnst === 'var' && specifier.needsLiveBinding + ? `Object.keys(${name}).forEach(${getFunctionIntro(['k'], { + isAsync: false, + name: null + })}${copyPropertyIfNecessary});` + : `for${_}(${cnst} k in ${name})${_}${copyPropertyIfNecessary}`; + } } } - return (this.exportNamesByVariable = exportNamesByVariable); } - getExports() { - return Object.keys(this.exports); + if (exportBlock) { + return `${n}${n}${exportBlock}`; } - getReexports() { - if (this.transitiveReexports) { - return this.transitiveReexports; + return ''; +} +function getSingleDefaultExport(exports, dependencies, interop, externalLiveBindings, getPropertyAccess) { + if (exports.length > 0) { + return exports[0].local; + } + else { + for (const { defaultVariableName, id, isChunk, name, namedExportsMode: depNamedExportsMode, namespaceVariableName, reexports } of dependencies) { + if (reexports) { + return getReexportedImportName(name, reexports[0].imported, depNamedExportsMode, isChunk, defaultVariableName, namespaceVariableName, interop, id, externalLiveBindings, getPropertyAccess); + } } - // to avoid infinite recursion when using circular `export * from X` - this.transitiveReexports = []; - const reexports = new Set(); - for (const name in this.reexportDescriptions) { - reexports.add(name); + } +} +function getReexportedImportName(moduleVariableName, imported, depNamedExportsMode, isChunk, defaultVariableName, namespaceVariableName, interop, moduleId, externalLiveBindings, getPropertyAccess) { + if (imported === 'default') { + if (!isChunk) { + const moduleInterop = String(interop(moduleId)); + const variableName = defaultInteropHelpersByInteropType[moduleInterop] + ? defaultVariableName + : moduleVariableName; + return isDefaultAProperty(moduleInterop, externalLiveBindings) + ? `${variableName}${getPropertyAccess('default')}` + : variableName; } - for (const module of this.exportAllModules) { - if (module instanceof ExternalModule) { - reexports.add(`*${module.id}`); + return depNamedExportsMode + ? `${moduleVariableName}${getPropertyAccess('default')}` + : moduleVariableName; + } + if (imported === '*') { + return (isChunk + ? !depNamedExportsMode + : namespaceInteropHelpersByInteropType[String(interop(moduleId))]) + ? namespaceVariableName + : moduleVariableName; + } + return `${moduleVariableName}${getPropertyAccess(imported)}`; +} +function getEsModuleValue(getObject) { + return getObject([['value', 'true']], { + lineBreakIndent: null + }); +} +function getNamespaceMarkers(hasNamedExports, addEsModule, addNamespaceToStringTag, { _, getObject }) { + if (hasNamedExports) { + if (addEsModule) { + if (addNamespaceToStringTag) { + return `Object.defineProperties(exports,${_}${getObject([ + ['__esModule', getEsModuleValue(getObject)], + [null, `[Symbol.toStringTag]:${_}${getToStringTagValue(getObject)}`] + ], { + lineBreakIndent: null + })});`; } - else { - for (const name of [...module.getReexports(), ...module.getExports()]) { - if (name !== 'default') - reexports.add(name); + return `Object.defineProperty(exports,${_}'__esModule',${_}${getEsModuleValue(getObject)});`; + } + if (addNamespaceToStringTag) { + return `Object.defineProperty(exports,${_}Symbol.toStringTag,${_}${getToStringTagValue(getObject)});`; + } + } + return ''; +} +const getDefineProperty = (name, needsLiveBinding, t, { _, getDirectReturnFunction, n }) => { + if (needsLiveBinding) { + const [left, right] = getDirectReturnFunction([], { + functionReturn: true, + lineBreakIndent: null, + name: null + }); + return (`Object.defineProperty(exports,${_}k,${_}{${n}` + + `${t}${t}enumerable:${_}true,${n}` + + `${t}${t}get:${_}${left}${name}[k]${right}${n}${t}})`); + } + return `exports[k]${_}=${_}${name}[k]`; +}; + +function getInteropBlock(dependencies, interop, externalLiveBindings, freeze, namespaceToStringTag, accessedGlobals, indent, snippets) { + const { _, cnst, n } = snippets; + const neededInteropHelpers = new Set(); + const interopStatements = []; + const addInteropStatement = (helperVariableName, helper, dependencyVariableName) => { + neededInteropHelpers.add(helper); + interopStatements.push(`${cnst} ${helperVariableName}${_}=${_}/*#__PURE__*/${helper}(${dependencyVariableName});`); + }; + for (const { defaultVariableName, imports, id, isChunk, name, namedExportsMode, namespaceVariableName, reexports } of dependencies) { + if (isChunk) { + for (const { imported, reexported } of [ + ...(imports || []), + ...(reexports || []) + ]) { + if (imported === '*' && reexported !== '*') { + if (!namedExportsMode) { + addInteropStatement(namespaceVariableName, INTEROP_NAMESPACE_DEFAULT_ONLY_VARIABLE, name); + } + break; } } } - return (this.transitiveReexports = [...reexports]); - } - getRenderedExports() { - // only direct exports are counted here, not reexports at all - const renderedExports = []; - const removedExports = []; - for (const exportName in this.exports) { - const variable = this.getVariableForExportName(exportName); - (variable && variable.included ? renderedExports : removedExports).push(exportName); + else { + const moduleInterop = String(interop(id)); + let hasDefault = false; + let hasNamespace = false; + for (const { imported, reexported } of [ + ...(imports || []), + ...(reexports || []) + ]) { + let helper; + let variableName; + if (imported === 'default') { + if (!hasDefault) { + hasDefault = true; + if (defaultVariableName !== namespaceVariableName) { + variableName = defaultVariableName; + helper = defaultInteropHelpersByInteropType[moduleInterop]; + } + } + } + else if (imported === '*' && reexported !== '*') { + if (!hasNamespace) { + hasNamespace = true; + helper = namespaceInteropHelpersByInteropType[moduleInterop]; + variableName = namespaceVariableName; + } + } + if (helper) { + addInteropStatement(variableName, helper, name); + } + } } - return { renderedExports, removedExports }; } - getVariableForExportName(name, isExportAllSearch, searchedNamesAndModules) { - if (name[0] === '*') { - if (name.length === 1) { - return this.namespace; - } - else { - // export * from 'external' - const module = this.graph.modulesById.get(name.slice(1)); - return module.getVariableForExportName('*'); - } - } - // export { foo } from './other' - const reexportDeclaration = this.reexportDescriptions[name]; - if (reexportDeclaration) { - const declaration = getVariableForExportNameRecursive(reexportDeclaration.module, reexportDeclaration.localName, false, searchedNamesAndModules); - if (!declaration) { - return handleMissingExport(reexportDeclaration.localName, this, reexportDeclaration.module.id, reexportDeclaration.start); - } - return declaration; - } - const exportDeclaration = this.exports[name]; - if (exportDeclaration) { - if (exportDeclaration === MISSING_EXPORT_SHIM_DESCRIPTION) { - return this.exportShimVariable; - } - const name = exportDeclaration.localName; - return this.traceVariable(name); - } - if (name !== 'default') { - for (const module of this.exportAllModules) { - const declaration = getVariableForExportNameRecursive(module, name, true, searchedNamesAndModules); - if (declaration) - return declaration; + return `${getHelpersBlock(neededInteropHelpers, accessedGlobals, indent, snippets, externalLiveBindings, freeze, namespaceToStringTag)}${interopStatements.length > 0 ? `${interopStatements.join(n)}${n}${n}` : ''}`; +} + +function addJsExtension(name) { + return name.endsWith('.js') ? name : name + '.js'; +} + +// AMD resolution will only respect the AMD baseUrl if the .js extension is omitted. +// The assumption is that this makes sense for all relative ids: +// https://requirejs.org/docs/api.html#jsfiles +function updateExtensionForRelativeAmdId(id, forceJsExtensionForImports) { + if (id[0] !== '.') { + return id; + } + return forceJsExtensionForImports ? addJsExtension(id) : removeJsExtension(id); +} + +const builtins = { + assert: true, + buffer: true, + console: true, + constants: true, + domain: true, + events: true, + http: true, + https: true, + os: true, + path: true, + process: true, + punycode: true, + querystring: true, + stream: true, + string_decoder: true, + timers: true, + tty: true, + url: true, + util: true, + vm: true, + zlib: true +}; +function warnOnBuiltins(warn, dependencies) { + const externalBuiltins = dependencies.map(({ id }) => id).filter(id => id in builtins); + if (!externalBuiltins.length) + return; + warn({ + code: 'MISSING_NODE_BUILTINS', + message: `Creating a browser bundle that depends on Node.js built-in modules (${printQuotedStringList(externalBuiltins)}). You might need to include https://github.com/FredKSchott/rollup-plugin-polyfill-node`, + modules: externalBuiltins + }); +} + +function amd(magicString, { accessedGlobals, dependencies, exports, hasExports, id, indent: t, intro, isEntryFacade, isModuleFacade, namedExportsMode, outro, snippets, warn }, { amd, esModule, externalLiveBindings, freeze, interop, namespaceToStringTag, strict }) { + warnOnBuiltins(warn, dependencies); + const deps = dependencies.map(m => `'${updateExtensionForRelativeAmdId(m.id, amd.forceJsExtensionForImports)}'`); + const args = dependencies.map(m => m.name); + const { n, getNonArrowFunctionIntro, _ } = snippets; + if (namedExportsMode && hasExports) { + args.unshift(`exports`); + deps.unshift(`'exports'`); + } + if (accessedGlobals.has('require')) { + args.unshift('require'); + deps.unshift(`'require'`); + } + if (accessedGlobals.has('module')) { + args.unshift('module'); + deps.unshift(`'module'`); + } + const completeAmdId = getCompleteAmdId(amd, id); + const params = (completeAmdId ? `'${completeAmdId}',${_}` : ``) + + (deps.length ? `[${deps.join(`,${_}`)}],${_}` : ``); + const useStrict = strict ? `${_}'use strict';` : ''; + magicString.prepend(`${intro}${getInteropBlock(dependencies, interop, externalLiveBindings, freeze, namespaceToStringTag, accessedGlobals, t, snippets)}`); + const exportBlock = getExportBlock$1(exports, dependencies, namedExportsMode, interop, snippets, t, externalLiveBindings); + let namespaceMarkers = getNamespaceMarkers(namedExportsMode && hasExports, isEntryFacade && esModule, isModuleFacade && namespaceToStringTag, snippets); + if (namespaceMarkers) { + namespaceMarkers = n + n + namespaceMarkers; + } + magicString.append(`${exportBlock}${namespaceMarkers}${outro}`); + return (magicString + .indent(t) + // factory function should be wrapped by parentheses to avoid lazy parsing, + // cf. https://v8.dev/blog/preparser#pife + .prepend(`${amd.define}(${params}(${getNonArrowFunctionIntro(args, { + isAsync: false, + name: null + })}{${useStrict}${n}${n}`) + .append(`${n}${n}}));`)); +} + +function cjs(magicString, { accessedGlobals, dependencies, exports, hasExports, indent: t, intro, isEntryFacade, isModuleFacade, namedExportsMode, outro, snippets }, { compact, esModule, externalLiveBindings, freeze, interop, namespaceToStringTag, strict }) { + const { _, n } = snippets; + const useStrict = strict ? `'use strict';${n}${n}` : ''; + let namespaceMarkers = getNamespaceMarkers(namedExportsMode && hasExports, isEntryFacade && esModule, isModuleFacade && namespaceToStringTag, snippets); + if (namespaceMarkers) { + namespaceMarkers += n + n; + } + const importBlock = getImportBlock$1(dependencies, snippets, compact); + const interopBlock = getInteropBlock(dependencies, interop, externalLiveBindings, freeze, namespaceToStringTag, accessedGlobals, t, snippets); + magicString.prepend(`${useStrict}${intro}${namespaceMarkers}${importBlock}${interopBlock}`); + const exportBlock = getExportBlock$1(exports, dependencies, namedExportsMode, interop, snippets, t, externalLiveBindings, `module.exports${_}=${_}`); + return magicString.append(`${exportBlock}${outro}`); +} +function getImportBlock$1(dependencies, { _, cnst, n }, compact) { + let importBlock = ''; + let definingVariable = false; + for (const { id, name, reexports, imports } of dependencies) { + if (!reexports && !imports) { + if (importBlock) { + importBlock += compact && !definingVariable ? ',' : `;${n}`; } + definingVariable = false; + importBlock += `require('${id}')`; } - // we don't want to create shims when we are just - // probing export * modules for exports - if (!isExportAllSearch) { - if (this.syntheticNamedExports) { - let syntheticExport = this.syntheticExports.get(name); - if (!syntheticExport) { - const defaultExport = this.getDefaultExport(); - syntheticExport = new SyntheticNamedExportVariable(this.astContext, name, defaultExport); - this.syntheticExports.set(name, syntheticExport); - return syntheticExport; - } - return syntheticExport; - } - if (this.options.shimMissingExports) { - this.shimMissingExport(name); - return this.exportShimVariable; - } + else { + importBlock += compact && definingVariable ? ',' : `${importBlock ? `;${n}` : ''}${cnst} `; + definingVariable = true; + importBlock += `${name}${_}=${_}require('${id}')`; } - return null; - } - hasEffects() { - return this.ast.included && this.ast.hasEffects(createHasEffectsContext()); } - include() { - const context = createInclusionContext(); - if (this.ast.shouldBeIncluded(context)) - this.ast.include(context, false); + if (importBlock) { + return `${importBlock};${n}${n}`; } - includeAllExports() { - if (!this.isExecuted) { - this.graph.needsTreeshakingPass = true; - markModuleAndImpureDependenciesAsExecuted(this); + return ''; +} + +function es(magicString, { accessedGlobals, indent: t, intro, outro, dependencies, exports, snippets }, { externalLiveBindings, freeze, namespaceToStringTag }) { + const { _, n } = snippets; + const importBlock = getImportBlock(dependencies, _); + if (importBlock.length > 0) + intro += importBlock.join(n) + n + n; + intro += getHelpersBlock(null, accessedGlobals, t, snippets, externalLiveBindings, freeze, namespaceToStringTag); + if (intro) + magicString.prepend(intro); + const exportBlock = getExportBlock(exports, snippets); + if (exportBlock.length) + magicString.append(n + n + exportBlock.join(n).trim()); + if (outro) + magicString.append(outro); + return magicString.trim(); +} +function getImportBlock(dependencies, _) { + const importBlock = []; + for (const { id, reexports, imports, name } of dependencies) { + if (!reexports && !imports) { + importBlock.push(`import${_}'${id}';`); + continue; } - for (const exportName of this.getExports()) { - const variable = this.getVariableForExportName(exportName); - variable.deoptimizePath(UNKNOWN_PATH); - if (!variable.included) { - variable.include(); - this.graph.needsTreeshakingPass = true; + if (imports) { + let defaultImport = null; + let starImport = null; + const importedNames = []; + for (const specifier of imports) { + if (specifier.imported === 'default') { + defaultImport = specifier; + } + else if (specifier.imported === '*') { + starImport = specifier; + } + else { + importedNames.push(specifier); + } } - } - for (const name of this.getReexports()) { - const variable = this.getVariableForExportName(name); - variable.deoptimizePath(UNKNOWN_PATH); - if (!variable.included) { - variable.include(); - this.graph.needsTreeshakingPass = true; + if (starImport) { + importBlock.push(`import${_}*${_}as ${starImport.local} from${_}'${id}';`); } - if (variable instanceof ExternalVariable) { - variable.module.reexported = true; + if (defaultImport && importedNames.length === 0) { + importBlock.push(`import ${defaultImport.local} from${_}'${id}';`); } - } - } - includeAllInBundle() { - this.ast.include(createInclusionContext(), true); - } - isIncluded() { - return this.ast.included || this.namespace.included; - } - linkImports() { - this.addModulesToImportDescriptions(this.importDescriptions); - this.addModulesToImportDescriptions(this.reexportDescriptions); - for (const name in this.exports) { - if (name !== 'default') { - this.exportsAll[name] = this.id; + else if (importedNames.length > 0) { + importBlock.push(`import ${defaultImport ? `${defaultImport.local},${_}` : ''}{${_}${importedNames + .map(specifier => { + if (specifier.imported === specifier.local) { + return specifier.imported; + } + else { + return `${specifier.imported} as ${specifier.local}`; + } + }) + .join(`,${_}`)}${_}}${_}from${_}'${id}';`); } } - const externalExportAllModules = []; - for (const source of this.exportAllSources) { - const module = this.graph.modulesById.get(this.resolvedIds[source].id); - if (module instanceof ExternalModule) { - externalExportAllModules.push(module); - continue; - } - this.exportAllModules.push(module); - for (const name in module.exportsAll) { - if (name in this.exportsAll) { - this.options.onwarn(errNamespaceConflict(name, this, module)); + if (reexports) { + let starExport = null; + const namespaceReexports = []; + const namedReexports = []; + for (const specifier of reexports) { + if (specifier.reexported === '*') { + starExport = specifier; + } + else if (specifier.imported === '*') { + namespaceReexports.push(specifier); } else { - this.exportsAll[name] = module.exportsAll[name]; + namedReexports.push(specifier); } } - } - this.exportAllModules.push(...externalExportAllModules); - } - render(options) { - const magicString = this.magicString.clone(); - this.ast.render(magicString, options); - this.usesTopLevelAwait = this.astContext.usesTopLevelAwait; - return magicString; - } - setSource({ alwaysRemovedCode, ast, code, customTransformCache, moduleSideEffects, originalCode, originalSourcemap, resolvedIds, sourcemapChain, syntheticNamedExports, transformDependencies, transformFiles }) { - this.code = code; - this.originalCode = originalCode; - this.originalSourcemap = originalSourcemap; - this.sourcemapChain = sourcemapChain; - if (transformFiles) { - this.transformFiles = transformFiles; - } - this.transformDependencies = transformDependencies; - this.customTransformCache = customTransformCache; - if (typeof moduleSideEffects === 'boolean') { - this.moduleSideEffects = moduleSideEffects; - } - if (typeof syntheticNamedExports === 'boolean') { - this.syntheticNamedExports = syntheticNamedExports; - } - timeStart('generate ast', 3); - this.alwaysRemovedCode = alwaysRemovedCode || []; - if (ast) { - this.esTreeAst = ast; - } - else { - this.esTreeAst = tryParse(this, this.graph.acornParser, this.options.acorn); - for (const comment of this.comments) { - if (!comment.block && SOURCEMAPPING_URL_RE.test(comment.text)) { - this.alwaysRemovedCode.push([comment.start, comment.end]); + if (starExport) { + importBlock.push(`export${_}*${_}from${_}'${id}';`); + } + if (namespaceReexports.length > 0) { + if (!imports || + !imports.some(specifier => specifier.imported === '*' && specifier.local === name)) { + importBlock.push(`import${_}*${_}as ${name} from${_}'${id}';`); } + for (const specifier of namespaceReexports) { + importBlock.push(`export${_}{${_}${name === specifier.reexported ? name : `${name} as ${specifier.reexported}`} };`); + } + } + if (namedReexports.length > 0) { + importBlock.push(`export${_}{${_}${namedReexports + .map(specifier => { + if (specifier.imported === specifier.reexported) { + return specifier.imported; + } + else { + return `${specifier.imported} as ${specifier.reexported}`; + } + }) + .join(`,${_}`)}${_}}${_}from${_}'${id}';`); } - markPureCallExpressions(this.comments, this.esTreeAst); } - timeEnd('generate ast', 3); - this.resolvedIds = resolvedIds || Object.create(null); - // By default, `id` is the file name. Custom resolvers and loaders - // can change that, but it makes sense to use it for the source file name - const fileName = this.id; - this.magicString = new MagicString(code, { - filename: (this.excludeFromSourcemap ? null : fileName), - indentExclusionRanges: [] - }); - for (const [start, end] of this.alwaysRemovedCode) { - this.magicString.remove(start, end); + } + return importBlock; +} +function getExportBlock(exports, { _, cnst }) { + const exportBlock = []; + const exportDeclaration = []; + for (const specifier of exports) { + if (specifier.expression) { + exportBlock.push(`${cnst} ${specifier.local}${_}=${_}${specifier.expression};`); } - timeStart('analyse ast', 3); - this.astContext = { - addDynamicImport: this.addDynamicImport.bind(this), - addExport: this.addExport.bind(this), - addImport: this.addImport.bind(this), - addImportMeta: this.addImportMeta.bind(this), - code, - deoptimizationTracker: this.graph.deoptimizationTracker, - error: this.error.bind(this), - fileName, - getExports: this.getExports.bind(this), - getModuleExecIndex: () => this.execIndex, - getModuleName: this.basename.bind(this), - getReexports: this.getReexports.bind(this), - importDescriptions: this.importDescriptions, - includeAndGetAdditionalMergedNamespaces: this.includeAndGetAdditionalMergedNamespaces.bind(this), - includeDynamicImport: this.includeDynamicImport.bind(this), - includeVariable: this.includeVariable.bind(this), - magicString: this.magicString, - module: this, - moduleContext: this.context, - nodeConstructors, - options: this.options, - traceExport: this.getVariableForExportName.bind(this), - traceVariable: this.traceVariable.bind(this), - usesTopLevelAwait: false, - warn: this.warn.bind(this) - }; - this.scope = new ModuleScope(this.graph.scope, this.astContext); - this.namespace = new NamespaceVariable(this.astContext, this.syntheticNamedExports); - this.ast = new Program$1(this.esTreeAst, { type: 'Module', context: this.astContext }, this.scope); - timeEnd('analyse ast', 3); + exportDeclaration.push(specifier.exported === specifier.local + ? specifier.local + : `${specifier.local} as ${specifier.exported}`); } - toJSON() { - return { - alwaysRemovedCode: this.alwaysRemovedCode, - ast: this.esTreeAst, - code: this.code, - customTransformCache: this.customTransformCache, - dependencies: Array.from(this.dependencies, getId), - id: this.id, - moduleSideEffects: this.moduleSideEffects, - originalCode: this.originalCode, - originalSourcemap: this.originalSourcemap, - resolvedIds: this.resolvedIds, - sourcemapChain: this.sourcemapChain, - syntheticNamedExports: this.syntheticNamedExports, - transformDependencies: this.transformDependencies, - transformFiles: this.transformFiles - }; + if (exportDeclaration.length) { + exportBlock.push(`export${_}{${_}${exportDeclaration.join(`,${_}`)}${_}};`); } - traceVariable(name) { - const localVariable = this.scope.variables.get(name); - if (localVariable) { - return localVariable; - } - if (name in this.importDescriptions) { - const importDeclaration = this.importDescriptions[name]; - const otherModule = importDeclaration.module; - if (otherModule instanceof Module && importDeclaration.name === '*') { - return otherModule.namespace; - } - const declaration = otherModule.getVariableForExportName(importDeclaration.name); - if (!declaration) { - return handleMissingExport(importDeclaration.name, this, otherModule.id, importDeclaration.start); - } - return declaration; + return exportBlock; +} + +const keypath = (keypath, getPropertyAccess) => keypath.split('.').map(getPropertyAccess).join(''); + +function setupNamespace(name, root, globals, { _, getPropertyAccess, s }, compact) { + const parts = name.split('.'); + parts[0] = (typeof globals === 'function' ? globals(parts[0]) : globals[parts[0]]) || parts[0]; + parts.pop(); + let propertyPath = root; + return (parts + .map(part => { + propertyPath += getPropertyAccess(part); + return `${propertyPath}${_}=${_}${propertyPath}${_}||${_}{}${s}`; + }) + .join(compact ? ',' : '\n') + (compact && parts.length ? ';' : '\n')); +} +function assignToDeepVariable(deepName, root, globals, assignment, { _, getPropertyAccess }) { + const parts = deepName.split('.'); + parts[0] = (typeof globals === 'function' ? globals(parts[0]) : globals[parts[0]]) || parts[0]; + const last = parts.pop(); + let propertyPath = root; + let deepAssignment = parts + .map(part => { + propertyPath += getPropertyAccess(part); + return `${propertyPath}${_}=${_}${propertyPath}${_}||${_}{}`; + }) + .concat(`${propertyPath}${getPropertyAccess(last)}`) + .join(`,${_}`) + `${_}=${_}${assignment}`; + if (parts.length > 0) { + deepAssignment = `(${deepAssignment})`; + } + return deepAssignment; +} + +function trimEmptyImports(dependencies) { + let i = dependencies.length; + while (i--) { + const { imports, reexports } = dependencies[i]; + if (imports || reexports) { + return dependencies.slice(0, i + 1); } - return null; } - warn(props, pos) { - this.addLocationToLogProps(props, pos); - this.options.onwarn(props); + return []; +} + +function iife(magicString, { accessedGlobals, dependencies, exports, hasExports, indent: t, intro, namedExportsMode, outro, snippets, warn }, { compact, esModule, extend, freeze, externalLiveBindings, globals, interop, name, namespaceToStringTag, strict }) { + const { _, getNonArrowFunctionIntro, getPropertyAccess, n } = snippets; + const isNamespaced = name && name.includes('.'); + const useVariableAssignment = !extend && !isNamespaced; + if (name && useVariableAssignment && !isLegal(name)) { + return error({ + code: 'ILLEGAL_IDENTIFIER_AS_NAME', + message: `Given name "${name}" is not a legal JS identifier. If you need this, you can try "output.extend: true".` + }); } - addDynamicImport(node) { - let argument = node.source; - if (argument instanceof TemplateLiteral) { - if (argument.quasis.length === 1 && argument.quasis[0].value.cooked) { - argument = argument.quasis[0].value.cooked; - } + warnOnBuiltins(warn, dependencies); + const external = trimEmptyImports(dependencies); + const deps = external.map(dep => dep.globalName || 'null'); + const args = external.map(m => m.name); + if (hasExports && !name) { + warn({ + code: 'MISSING_NAME_OPTION_FOR_IIFE_EXPORT', + message: `If you do not supply "output.name", you may not be able to access the exports of an IIFE bundle.` + }); + } + if (namedExportsMode && hasExports) { + if (extend) { + deps.unshift(`this${keypath(name, getPropertyAccess)}${_}=${_}this${keypath(name, getPropertyAccess)}${_}||${_}{}`); + args.unshift('exports'); } - else if (argument instanceof Literal && typeof argument.value === 'string') { - argument = argument.value; + else { + deps.unshift('{}'); + args.unshift('exports'); } - this.dynamicImports.push({ node, resolution: null, argument }); } - addExport(node) { - if (node instanceof ExportDefaultDeclaration) { - // export default foo; - this.exports.default = { - identifier: node.variable.getAssignedVariableName(), - localName: 'default' - }; + const useStrict = strict ? `${t}'use strict';${n}` : ''; + const interopBlock = getInteropBlock(dependencies, interop, externalLiveBindings, freeze, namespaceToStringTag, accessedGlobals, t, snippets); + magicString.prepend(`${intro}${interopBlock}`); + let wrapperIntro = `(${getNonArrowFunctionIntro(args, { + isAsync: false, + name: null + })}{${n}${useStrict}${n}`; + if (hasExports) { + if (name && !(extend && namedExportsMode)) { + wrapperIntro = + (useVariableAssignment ? `var ${name}` : `this${keypath(name, getPropertyAccess)}`) + + `${_}=${_}${wrapperIntro}`; } - else if (node instanceof ExportAllDeclaration) { - const source = node.source.value; - this.sources.add(source); - if (node.exported) { - // export * as name from './other' - const name = node.exported.name; - this.reexportDescriptions[name] = { - localName: '*', - module: null, - source, - start: node.start - }; - } - else { - // export * from './other' - this.exportAllSources.add(source); - } + if (isNamespaced) { + wrapperIntro = setupNamespace(name, 'this', globals, snippets, compact) + wrapperIntro; } - else if (node.source instanceof Literal) { - // export { name } from './other' - const source = node.source.value; - this.sources.add(source); - for (const specifier of node.specifiers) { - const name = specifier.exported.name; - this.reexportDescriptions[name] = { - localName: specifier.local.name, - module: null, - source, - start: specifier.start - }; + } + let wrapperOutro = `${n}${n}})(${deps.join(`,${_}`)});`; + if (hasExports && !extend && namedExportsMode) { + wrapperOutro = `${n}${n}${t}return exports;${wrapperOutro}`; + } + const exportBlock = getExportBlock$1(exports, dependencies, namedExportsMode, interop, snippets, t, externalLiveBindings); + let namespaceMarkers = getNamespaceMarkers(namedExportsMode && hasExports, esModule, namespaceToStringTag, snippets); + if (namespaceMarkers) { + namespaceMarkers = n + n + namespaceMarkers; + } + magicString.append(`${exportBlock}${namespaceMarkers}${outro}`); + return magicString.indent(t).prepend(wrapperIntro).append(wrapperOutro); +} + +function system(magicString, { accessedGlobals, dependencies, exports, hasExports, indent: t, intro, snippets, outro, usesTopLevelAwait }, { externalLiveBindings, freeze, name, namespaceToStringTag, strict, systemNullSetters }) { + const { _, getFunctionIntro, getNonArrowFunctionIntro, n, s } = snippets; + const { importBindings, setters, starExcludes } = analyzeDependencies(dependencies, exports, t, snippets); + const registeredName = name ? `'${name}',${_}` : ''; + const wrapperParams = accessedGlobals.has('module') + ? ['exports', 'module'] + : hasExports + ? ['exports'] + : []; + // factory function should be wrapped by parentheses to avoid lazy parsing, + // cf. https://v8.dev/blog/preparser#pife + let wrapperStart = `System.register(${registeredName}[` + + dependencies.map(({ id }) => `'${id}'`).join(`,${_}`) + + `],${_}(${getNonArrowFunctionIntro(wrapperParams, { isAsync: false, name: null })}{${n}${t}${strict ? "'use strict';" : ''}` + + getStarExcludesBlock(starExcludes, t, snippets) + + getImportBindingsBlock(importBindings, t, snippets) + + `${n}${t}return${_}{${setters.length + ? `${n}${t}${t}setters:${_}[${setters + .map(setter => setter + ? `${getFunctionIntro(['module'], { + isAsync: false, + name: null + })}{${n}${t}${t}${t}${setter}${n}${t}${t}}` + : systemNullSetters + ? `null` + : `${getFunctionIntro([], { isAsync: false, name: null })}{}`) + .join(`,${_}`)}],` + : ''}${n}`; + wrapperStart += `${t}${t}execute:${_}(${getNonArrowFunctionIntro([], { + isAsync: usesTopLevelAwait, + name: null + })}{${n}${n}`; + const wrapperEnd = `${t}${t}})${n}${t}}${s}${n}}));`; + magicString.prepend(intro + + getHelpersBlock(null, accessedGlobals, t, snippets, externalLiveBindings, freeze, namespaceToStringTag) + + getHoistedExportsBlock(exports, t, snippets)); + magicString.append(`${outro}${n}${n}` + + getSyntheticExportsBlock(exports, t, snippets) + + getMissingExportsBlock(exports, t, snippets)); + return magicString.indent(`${t}${t}${t}`).append(wrapperEnd).prepend(wrapperStart); +} +function analyzeDependencies(dependencies, exports, t, { _, cnst, getObject, getPropertyAccess, n }) { + const importBindings = []; + const setters = []; + let starExcludes = null; + for (const { imports, reexports } of dependencies) { + const setter = []; + if (imports) { + for (const specifier of imports) { + importBindings.push(specifier.local); + if (specifier.imported === '*') { + setter.push(`${specifier.local}${_}=${_}module;`); + } + else { + setter.push(`${specifier.local}${_}=${_}module${getPropertyAccess(specifier.imported)};`); + } } } - else if (node.declaration) { - const declaration = node.declaration; - if (declaration instanceof VariableDeclaration) { - // export var { foo, bar } = ... - // export var foo = 1, bar = 2; - for (const declarator of declaration.declarations) { - for (const localName of extractAssignedNames(declarator.id)) { - this.exports[localName] = { identifier: null, localName }; + if (reexports) { + const reexportedNames = []; + let hasStarReexport = false; + for (const { imported, reexported } of reexports) { + if (reexported === '*') { + hasStarReexport = true; + } + else { + reexportedNames.push([ + reexported, + imported === '*' ? 'module' : `module${getPropertyAccess(imported)}` + ]); + } + } + if (reexportedNames.length > 1 || hasStarReexport) { + const exportMapping = getObject(reexportedNames, { lineBreakIndent: null }); + if (hasStarReexport) { + if (!starExcludes) { + starExcludes = getStarExcludes({ dependencies, exports }); } + setter.push(`${cnst} setter${_}=${_}${exportMapping};`, `for${_}(${cnst} name in module)${_}{`, `${t}if${_}(!_starExcludes[name])${_}setter[name]${_}=${_}module[name];`, '}', 'exports(setter);'); + } + else { + setter.push(`exports(${exportMapping});`); } } else { - // export function foo () {} - const localName = declaration.id.name; - this.exports[localName] = { identifier: null, localName }; + const [key, value] = reexportedNames[0]; + setter.push(`exports('${key}',${_}${value});`); } } - else { - // export { foo, bar, baz } - for (const specifier of node.specifiers) { - const localName = specifier.local.name; - const exportedName = specifier.exported.name; - this.exports[exportedName] = { identifier: null, localName }; + setters.push(setter.join(`${n}${t}${t}${t}`)); + } + return { importBindings, setters, starExcludes }; +} +const getStarExcludes = ({ dependencies, exports }) => { + const starExcludes = new Set(exports.map(expt => expt.exported)); + starExcludes.add('default'); + for (const { reexports } of dependencies) { + if (reexports) { + for (const reexport of reexports) { + if (reexport.reexported !== '*') + starExcludes.add(reexport.reexported); } } } - addImport(node) { - const source = node.source.value; - this.sources.add(source); - for (const specifier of node.specifiers) { - const isDefault = specifier.type === ImportDefaultSpecifier; - const isNamespace = specifier.type === ImportNamespaceSpecifier; - const name = isDefault - ? 'default' - : isNamespace - ? '*' - : specifier.imported.name; - this.importDescriptions[specifier.local.name] = { - module: null, - name, - source, - start: specifier.start - }; - } + return starExcludes; +}; +const getStarExcludesBlock = (starExcludes, t, { _, cnst, getObject, n }) => starExcludes + ? `${n}${t}${cnst} _starExcludes${_}=${_}${getObject([...starExcludes].map(prop => [prop, '1']), { lineBreakIndent: { base: t, t } })};` + : ''; +const getImportBindingsBlock = (importBindings, t, { _, n }) => (importBindings.length ? `${n}${t}var ${importBindings.join(`,${_}`)};` : ''); +const getHoistedExportsBlock = (exports, t, snippets) => getExportsBlock(exports.filter(expt => expt.hoisted).map(expt => ({ name: expt.exported, value: expt.local })), t, snippets); +function getExportsBlock(exports, t, { _, n }) { + if (exports.length === 0) { + return ''; } - addImportMeta(node) { - this.importMetas.push(node); + if (exports.length === 1) { + return `exports('${exports[0].name}',${_}${exports[0].value});${n}${n}`; } - addLocationToLogProps(props, pos) { - props.id = this.id; - props.pos = pos; - let code = this.code; - let { column, line } = locate(code, pos, { offsetLine: 1 }); - try { - ({ column, line } = getOriginalLocation(this.sourcemapChain, { column, line })); - code = this.originalCode; - } - catch (e) { - this.options.onwarn({ - code: 'SOURCEMAP_ERROR', - id: this.id, - loc: { - column, - file: this.id, - line - }, - message: `Error when using sourcemap for reporting an error: ${e.message}`, - pos - }); - } - augmentCodeLocation(props, { column, line }, code, this.id); + return (`exports({${n}` + + exports.map(({ name, value }) => `${t}${name}:${_}${value}`).join(`,${n}`) + + `${n}});${n}${n}`); +} +const getSyntheticExportsBlock = (exports, t, snippets) => getExportsBlock(exports + .filter(expt => expt.expression) + .map(expt => ({ name: expt.exported, value: expt.local })), t, snippets); +const getMissingExportsBlock = (exports, t, snippets) => getExportsBlock(exports + .filter(expt => expt.local === MISSING_EXPORT_SHIM_VARIABLE) + .map(expt => ({ name: expt.exported, value: MISSING_EXPORT_SHIM_VARIABLE })), t, snippets); + +function globalProp(name, globalVar, getPropertyAccess) { + if (!name) + return 'null'; + return `${globalVar}${keypath(name, getPropertyAccess)}`; +} +function safeAccess(name, globalVar, { _, getPropertyAccess }) { + let propertyPath = globalVar; + return name + .split('.') + .map(part => (propertyPath += getPropertyAccess(part))) + .join(`${_}&&${_}`); +} +function umd(magicString, { accessedGlobals, dependencies, exports, hasExports, id, indent: t, intro, namedExportsMode, outro, snippets, warn }, { amd, compact, esModule, extend, externalLiveBindings, freeze, interop, name, namespaceToStringTag, globals, noConflict, strict }) { + const { _, cnst, getFunctionIntro, getNonArrowFunctionIntro, getPropertyAccess, n, s } = snippets; + const factoryVar = compact ? 'f' : 'factory'; + const globalVar = compact ? 'g' : 'global'; + if (hasExports && !name) { + return error({ + code: 'MISSING_NAME_OPTION_FOR_IIFE_EXPORT', + message: 'You must supply "output.name" for UMD bundles that have exports so that the exports are accessible in environments without a module loader.' + }); } - addModulesToImportDescriptions(importDescription) { - for (const name of Object.keys(importDescription)) { - const specifier = importDescription[name]; - const id = this.resolvedIds[specifier.source].id; - specifier.module = this.graph.modulesById.get(id); - } + warnOnBuiltins(warn, dependencies); + const amdDeps = dependencies.map(m => `'${updateExtensionForRelativeAmdId(m.id, amd.forceJsExtensionForImports)}'`); + const cjsDeps = dependencies.map(m => `require('${m.id}')`); + const trimmedImports = trimEmptyImports(dependencies); + const globalDeps = trimmedImports.map(module => globalProp(module.globalName, globalVar, getPropertyAccess)); + const factoryParams = trimmedImports.map(m => m.name); + if (namedExportsMode && (hasExports || noConflict)) { + amdDeps.unshift(`'exports'`); + cjsDeps.unshift(`exports`); + globalDeps.unshift(assignToDeepVariable(name, globalVar, globals, `${extend ? `${globalProp(name, globalVar, getPropertyAccess)}${_}||${_}` : ''}{}`, snippets)); + factoryParams.unshift('exports'); } - includeAndGetAdditionalMergedNamespaces() { - const mergedNamespaces = []; - for (const module of this.exportAllModules) { - if (module instanceof ExternalModule) { - const externalVariable = module.getVariableForExportName('*'); - externalVariable.include(); - this.imports.add(externalVariable); - mergedNamespaces.push(externalVariable); - } - else if (module.syntheticNamedExports) { - const syntheticNamespace = module.getDefaultExport(); - syntheticNamespace.include(); - this.imports.add(syntheticNamespace); - mergedNamespaces.push(syntheticNamespace); - } + const completeAmdId = getCompleteAmdId(amd, id); + const amdParams = (completeAmdId ? `'${completeAmdId}',${_}` : ``) + + (amdDeps.length ? `[${amdDeps.join(`,${_}`)}],${_}` : ``); + const define = amd.define; + const cjsExport = !namedExportsMode && hasExports ? `module.exports${_}=${_}` : ``; + const useStrict = strict ? `${_}'use strict';${n}` : ``; + let iifeExport; + if (noConflict) { + const noConflictExportsVar = compact ? 'e' : 'exports'; + let factory; + if (!namedExportsMode && hasExports) { + factory = `${cnst} ${noConflictExportsVar}${_}=${_}${assignToDeepVariable(name, globalVar, globals, `${factoryVar}(${globalDeps.join(`,${_}`)})`, snippets)};`; } - return mergedNamespaces; - } - includeDynamicImport(node) { - const resolution = this.dynamicImports.find(dynamicImport => dynamicImport.node === node).resolution; - if (resolution instanceof Module) { - resolution.includedDynamicImporters.push(this); - resolution.includeAllExports(); + else { + const module = globalDeps.shift(); + factory = + `${cnst} ${noConflictExportsVar}${_}=${_}${module};${n}` + + `${t}${t}${factoryVar}(${[noConflictExportsVar].concat(globalDeps).join(`,${_}`)});`; } + iifeExport = + `(${getFunctionIntro([], { isAsync: false, name: null })}{${n}` + + `${t}${t}${cnst} current${_}=${_}${safeAccess(name, globalVar, snippets)};${n}` + + `${t}${t}${factory}${n}` + + `${t}${t}${noConflictExportsVar}.noConflict${_}=${_}${getFunctionIntro([], { + isAsync: false, + name: null + })}{${_}` + + `${globalProp(name, globalVar, getPropertyAccess)}${_}=${_}current;${_}return ${noConflictExportsVar}${s}${_}};${n}` + + `${t}})()`; } - includeVariable(variable) { - const variableModule = variable.module; - if (!variable.included) { - variable.include(); - this.graph.needsTreeshakingPass = true; - } - if (variableModule && variableModule !== this) { - this.imports.add(variable); + else { + iifeExport = `${factoryVar}(${globalDeps.join(`,${_}`)})`; + if (!namedExportsMode && hasExports) { + iifeExport = assignToDeepVariable(name, globalVar, globals, iifeExport, snippets); } } - shimMissingExport(name) { - this.options.onwarn({ - code: 'SHIMMED_EXPORT', - exporter: relativeId(this.id), - exportName: name, - message: `Missing export "${name}" has been shimmed in module ${relativeId(this.id)}.` - }); - this.exports[name] = MISSING_EXPORT_SHIM_DESCRIPTION; + const iifeNeedsGlobal = hasExports || (noConflict && namedExportsMode) || globalDeps.length > 0; + const wrapperParams = [factoryVar]; + if (iifeNeedsGlobal) { + wrapperParams.unshift(globalVar); } + const globalArg = iifeNeedsGlobal ? `this,${_}` : ''; + const iifeStart = iifeNeedsGlobal + ? `(${globalVar}${_}=${_}typeof globalThis${_}!==${_}'undefined'${_}?${_}globalThis${_}:${_}${globalVar}${_}||${_}self,${_}` + : ''; + const iifeEnd = iifeNeedsGlobal ? ')' : ''; + const cjsIntro = iifeNeedsGlobal + ? `${t}typeof exports${_}===${_}'object'${_}&&${_}typeof module${_}!==${_}'undefined'${_}?` + + `${_}${cjsExport}${factoryVar}(${cjsDeps.join(`,${_}`)})${_}:${n}` + : ''; + const wrapperIntro = `(${getNonArrowFunctionIntro(wrapperParams, { isAsync: false, name: null })}{${n}` + + cjsIntro + + `${t}typeof ${define}${_}===${_}'function'${_}&&${_}${define}.amd${_}?${_}${define}(${amdParams}${factoryVar})${_}:${n}` + + `${t}${iifeStart}${iifeExport}${iifeEnd};${n}` + + // factory function should be wrapped by parentheses to avoid lazy parsing, + // cf. https://v8.dev/blog/preparser#pife + `})(${globalArg}(${getNonArrowFunctionIntro(factoryParams, { + isAsync: false, + name: null + })}{${useStrict}${n}`; + const wrapperOutro = n + n + '}));'; + magicString.prepend(`${intro}${getInteropBlock(dependencies, interop, externalLiveBindings, freeze, namespaceToStringTag, accessedGlobals, t, snippets)}`); + const exportBlock = getExportBlock$1(exports, dependencies, namedExportsMode, interop, snippets, t, externalLiveBindings); + let namespaceMarkers = getNamespaceMarkers(namedExportsMode && hasExports, esModule, namespaceToStringTag, snippets); + if (namespaceMarkers) { + namespaceMarkers = n + n + namespaceMarkers; + } + magicString.append(`${exportBlock}${namespaceMarkers}${outro}`); + return magicString.trim().indent(t).append(wrapperOutro).prepend(wrapperIntro); } +const finalisers = { amd, cjs, es, iife, system, umd }; + class Source { constructor(filename, content) { this.isOriginal = true; @@ -10082,7 +13900,7 @@ class Source { this.content = content; } traceSegment(line, column, name) { - return { line, column, name, source: this }; + return { column, line, name, source: this }; } } class Link { @@ -10093,46 +13911,44 @@ class Link { } traceMappings() { const sources = []; + const sourceIndexMap = new Map(); const sourcesContent = []; const names = []; + const nameIndexMap = new Map(); const mappings = []; for (const line of this.mappings) { const tracedLine = []; for (const segment of line) { - if (segment.length == 1) + if (segment.length === 1) continue; const source = this.sources[segment[1]]; if (!source) continue; const traced = source.traceSegment(segment[2], segment[3], segment.length === 5 ? this.names[segment[4]] : ''); if (traced) { - // newer sources are more likely to be used, so search backwards. - let sourceIndex = sources.lastIndexOf(traced.source.filename); - if (sourceIndex === -1) { + const { column, line, name, source: { content, filename } } = traced; + let sourceIndex = sourceIndexMap.get(filename); + if (sourceIndex === undefined) { sourceIndex = sources.length; - sources.push(traced.source.filename); - sourcesContent[sourceIndex] = traced.source.content; + sources.push(filename); + sourceIndexMap.set(filename, sourceIndex); + sourcesContent[sourceIndex] = content; } else if (sourcesContent[sourceIndex] == null) { - sourcesContent[sourceIndex] = traced.source.content; + sourcesContent[sourceIndex] = content; } - else if (traced.source.content != null && - sourcesContent[sourceIndex] !== traced.source.content) { + else if (content != null && sourcesContent[sourceIndex] !== content) { return error({ - message: `Multiple conflicting contents for sourcemap source ${traced.source.filename}` + message: `Multiple conflicting contents for sourcemap source ${filename}` }); } - const tracedSegment = [ - segment[0], - sourceIndex, - traced.line, - traced.column - ]; - if (traced.name) { - let nameIndex = names.indexOf(traced.name); - if (nameIndex === -1) { + const tracedSegment = [segment[0], sourceIndex, line, column]; + if (name) { + let nameIndex = nameIndexMap.get(name); + if (nameIndex === undefined) { nameIndex = names.length; - names.push(traced.name); + names.push(name); + nameIndexMap.set(name, nameIndex); } tracedSegment[4] = nameIndex; } @@ -10141,19 +13957,22 @@ class Link { } mappings.push(tracedLine); } - return { sources, sourcesContent, names, mappings }; + return { mappings, names, sources, sourcesContent }; } traceSegment(line, column, name) { const segments = this.mappings[line]; if (!segments) return null; // binary search through segments for the given column - let i = 0; - let j = segments.length - 1; - while (i <= j) { - const m = (i + j) >> 1; + let searchStart = 0; + let searchEnd = segments.length - 1; + while (searchStart <= searchEnd) { + const m = (searchStart + searchEnd) >> 1; const segment = segments[m]; - if (segment[0] === column) { + // If a sourcemap does not have sufficient resolution to contain a + // necessary mapping, e.g. because it only contains line information, we + // use the best approximation we could find + if (segment[0] === column || searchStart === searchEnd) { if (segment.length == 1) return null; const source = this.sources[segment[1]]; @@ -10162,10 +13981,10 @@ class Link { return source.traceSegment(segment[2], segment[3], segment.length === 5 ? this.names[segment[4]] : name); } if (segment[0] > column) { - j = m - 1; + searchEnd = m - 1; } else { - i = m + 1; + searchStart = m + 1; } } return null; @@ -10198,7 +14017,6 @@ function getCollapsedSourcemap(id, originalCode, originalSourcemap, sourcemapCha else { const sources = originalSourcemap.sources; const sourcesContent = originalSourcemap.sourcesContent || []; - // TODO indiscriminately treating IDs and sources as normal paths is probably bad. const directory = dirname(id) || '.'; const sourceRoot = originalSourcemap.sourceRoot || '.'; const baseSources = sources.map((source, i) => new Source(resolve(directory, sourceRoot, source), sourcesContent[i])); @@ -10211,10 +14029,8 @@ function collapseSourcemaps(file, map, modules, bundleSourcemapChain, excludeCon const moduleSources = modules .filter(module => !module.excludeFromSourcemap) .map(module => getCollapsedSourcemap(module.id, module.originalCode, module.originalSourcemap, module.sourcemapChain, linkMap)); - // DecodedSourceMap (from magic-string) uses a number[] instead of the more - // correct SourceMapSegment tuples. Cast it here to gain type safety. - let source = new Link(map, moduleSources); - source = bundleSourcemapChain.reduce(linkMap, source); + const link = new Link(map, moduleSources); + const source = bundleSourcemapChain.reduce(linkMap, link); let { sources, sourcesContent, names, mappings } = source.traceMappings(); if (file) { const directory = dirname(file); @@ -10222,7 +14038,7 @@ function collapseSourcemaps(file, map, modules, bundleSourcemapChain, excludeCon file = basename(file); } sourcesContent = (excludeContent ? null : sourcesContent); - return new SourceMap({ file, sources, sourcesContent, names, mappings }); + return new SourceMap({ file, mappings, names, sources, sourcesContent }); } function collapseSourcemap(id, originalCode, originalSourcemap, sourcemapChain, warn) { if (!sourcemapChain.length) { @@ -10238,77 +14054,96 @@ const createHash = () => createHash$1('sha256'); const DECONFLICT_IMPORTED_VARIABLES_BY_FORMAT = { amd: deconflictImportsOther, cjs: deconflictImportsOther, - es: deconflictImportsEsm, + es: deconflictImportsEsmOrSystem, iife: deconflictImportsOther, system: deconflictImportsEsmOrSystem, umd: deconflictImportsOther }; -function deconflictChunk(modules, dependencies, imports, usedNames, format, interop, preserveModules, chunkByModule, syntheticExports, exportNamesByVariable) { - for (const module of modules) { - module.scope.addUsedOutsideNames(usedNames, format, exportNamesByVariable); +function deconflictChunk(modules, dependenciesToBeDeconflicted, imports, usedNames, format, interop, preserveModules, externalLiveBindings, chunkByModule, syntheticExports, exportNamesByVariable, accessedGlobalsByScope, includedNamespaces) { + const reversedModules = modules.slice().reverse(); + for (const module of reversedModules) { + module.scope.addUsedOutsideNames(usedNames, format, exportNamesByVariable, accessedGlobalsByScope); } - deconflictTopLevelVariables(usedNames, modules); - DECONFLICT_IMPORTED_VARIABLES_BY_FORMAT[format](usedNames, imports, dependencies, interop, preserveModules, chunkByModule, syntheticExports); - for (const module of modules) { - module.scope.deconflict(format, exportNamesByVariable); + deconflictTopLevelVariables(usedNames, reversedModules, includedNamespaces); + DECONFLICT_IMPORTED_VARIABLES_BY_FORMAT[format](usedNames, imports, dependenciesToBeDeconflicted, interop, preserveModules, externalLiveBindings, chunkByModule, syntheticExports); + for (const module of reversedModules) { + module.scope.deconflict(format, exportNamesByVariable, accessedGlobalsByScope); } } -function deconflictImportsEsm(usedNames, imports, dependencies, interop, preserveModules, _chunkByModule, syntheticExports) { - // Deconflict re-exported variables of dependencies when preserveModules is true. - // However, this implementation will result in unnecessary variable renaming without - // a deeper, wider fix. - // - // TODO: https://github.com/rollup/rollup/pull/3435#discussion_r390792792 - if (preserveModules) { - for (const chunkOrExternalModule of dependencies) { - chunkOrExternalModule.variableName = getSafeName(chunkOrExternalModule.variableName, usedNames); +function deconflictImportsEsmOrSystem(usedNames, imports, dependenciesToBeDeconflicted, _interop, preserveModules, _externalLiveBindings, chunkByModule, syntheticExports) { + // This is needed for namespace reexports + for (const dependency of dependenciesToBeDeconflicted.dependencies) { + if (preserveModules || dependency instanceof ExternalModule) { + dependency.variableName = getSafeName(dependency.suggestedVariableName, usedNames); } } - deconflictImportsEsmOrSystem(usedNames, imports, dependencies, interop); - for (const variable of syntheticExports) { - variable.setSafeName(getSafeName(variable.name, usedNames)); - } -} -function deconflictImportsEsmOrSystem(usedNames, imports, _dependencies, interop) { for (const variable of imports) { const module = variable.module; const name = variable.name; - let proposedName; - if (module instanceof ExternalModule && (name === '*' || name === 'default')) { - if (name === 'default' && interop && module.exportsNamespace) { - proposedName = module.variableName + '__default'; - } - else { - proposedName = module.variableName; - } + if (variable.isNamespace && (preserveModules || module instanceof ExternalModule)) { + variable.setRenderNames(null, (module instanceof ExternalModule ? module : chunkByModule.get(module)).variableName); + } + else if (module instanceof ExternalModule && name === 'default') { + variable.setRenderNames(null, getSafeName([...module.exportedVariables].some(([exportedVariable, exportedName]) => exportedName === '*' && exportedVariable.included) + ? module.suggestedVariableName + '__default' + : module.suggestedVariableName, usedNames)); } else { - proposedName = name; + variable.setRenderNames(null, getSafeName(name, usedNames)); } - variable.setRenderNames(null, getSafeName(proposedName, usedNames)); + } + for (const variable of syntheticExports) { + variable.setRenderNames(null, getSafeName(variable.name, usedNames)); } } -function deconflictImportsOther(usedNames, imports, dependencies, interop, preserveModules, chunkByModule) { +function deconflictImportsOther(usedNames, imports, { deconflictedDefault, deconflictedNamespace, dependencies }, interop, preserveModules, externalLiveBindings, chunkByModule) { for (const chunkOrExternalModule of dependencies) { - chunkOrExternalModule.variableName = getSafeName(chunkOrExternalModule.variableName, usedNames); + chunkOrExternalModule.variableName = getSafeName(chunkOrExternalModule.suggestedVariableName, usedNames); + } + for (const externalModuleOrChunk of deconflictedNamespace) { + externalModuleOrChunk.namespaceVariableName = getSafeName(`${externalModuleOrChunk.suggestedVariableName}__namespace`, usedNames); + } + for (const externalModule of deconflictedDefault) { + if (deconflictedNamespace.has(externalModule) && + canDefaultBeTakenFromNamespace(String(interop(externalModule.id)), externalLiveBindings)) { + externalModule.defaultVariableName = externalModule.namespaceVariableName; + } + else { + externalModule.defaultVariableName = getSafeName(`${externalModule.suggestedVariableName}__default`, usedNames); + } } for (const variable of imports) { const module = variable.module; if (module instanceof ExternalModule) { const name = variable.name; - if (name === 'default' && interop && (module.exportsNamespace || module.exportsNames)) { - variable.setRenderNames(null, module.variableName + '__default'); + if (name === 'default') { + const moduleInterop = String(interop(module.id)); + const variableName = defaultInteropHelpersByInteropType[moduleInterop] + ? module.defaultVariableName + : module.variableName; + if (isDefaultAProperty(moduleInterop, externalLiveBindings)) { + variable.setRenderNames(variableName, 'default'); + } + else { + variable.setRenderNames(null, variableName); + } } - else if (name === '*' || name === 'default') { - variable.setRenderNames(null, module.variableName); + else if (name === '*') { + variable.setRenderNames(null, namespaceInteropHelpersByInteropType[String(interop(module.id))] + ? module.namespaceVariableName + : module.variableName); } else { + // if the second parameter is `null`, it uses its "name" for the property name variable.setRenderNames(module.variableName, null); } } else { const chunk = chunkByModule.get(module); - if (chunk.exportMode === 'default' || (preserveModules && variable.isNamespace)) { + if (preserveModules && variable.isNamespace) { + variable.setRenderNames(null, chunk.exportMode === 'default' ? chunk.namespaceVariableName : chunk.variableName); + } + else if (chunk.exportMode === 'default') { variable.setRenderNames(null, chunk.variableName); } else { @@ -10317,7 +14152,7 @@ function deconflictImportsOther(usedNames, imports, dependencies, interop, prese } } } -function deconflictTopLevelVariables(usedNames, modules) { +function deconflictTopLevelVariables(usedNames, modules, includedNamespaces) { for (const module of modules) { for (const variable of module.scope.variables.values()) { if (variable.included && @@ -10327,8 +14162,8 @@ function deconflictTopLevelVariables(usedNames, modules) { variable.setRenderNames(null, getSafeName(variable.name, usedNames)); } } - const namespace = module.namespace; - if (namespace.included) { + if (includedNamespaces.has(module)) { + const namespace = module.namespace; namespace.setRenderNames(null, getSafeName(namespace.name, usedNames)); } } @@ -10343,73 +14178,11 @@ function escapeId(id) { return id.replace(backSlashRegEx, '\\\\').replace(quoteNewlineRegEx, '\\$1'); } -const compareExecIndex = (unitA, unitB) => unitA.execIndex > unitB.execIndex ? 1 : -1; -function sortByExecutionOrder(units) { - units.sort(compareExecIndex); -} -function analyseModuleExecution(entryModules) { - let nextExecIndex = 0; - const cyclePaths = []; - const analysedModules = new Set(); - const dynamicImports = new Set(); - const parents = new Map(); - const orderedModules = []; - const analyseModule = (module) => { - if (module instanceof Module) { - for (const dependency of module.dependencies) { - if (parents.has(dependency)) { - if (!analysedModules.has(dependency)) { - cyclePaths.push(getCyclePath(dependency, module, parents)); - } - continue; - } - parents.set(dependency, module); - analyseModule(dependency); - } - for (const dependency of module.implicitlyLoadedBefore) { - dynamicImports.add(dependency); - } - for (const { resolution } of module.dynamicImports) { - if (resolution instanceof Module) { - dynamicImports.add(resolution); - } - } - orderedModules.push(module); - } - module.execIndex = nextExecIndex++; - analysedModules.add(module); - }; - for (const curEntry of entryModules) { - if (!parents.has(curEntry)) { - parents.set(curEntry, null); - analyseModule(curEntry); - } - } - for (const curEntry of dynamicImports) { - if (!parents.has(curEntry)) { - parents.set(curEntry, null); - analyseModule(curEntry); - } - } - return { orderedModules, cyclePaths }; -} -function getCyclePath(module, parent, parents) { - const path = [relativeId(module.id)]; - let nextModule = parent; - while (nextModule !== module) { - path.push(relativeId(nextModule.id)); - nextModule = parents.get(nextModule); - } - path.push(path[0]); - path.reverse(); - return path; -} - function assignExportsToMangledNames(exports, exportsByName, exportNamesByVariable) { let nameIndex = 0; for (const variable of exports) { - let exportName = variable.name[0]; - if (exportsByName[exportName]) { + let [exportName] = variable.name; + if (exportsByName.has(exportName)) { do { exportName = toBase64(++nameIndex); // skip past leading number identifiers @@ -10417,9 +14190,9 @@ function assignExportsToMangledNames(exports, exportsByName, exportNamesByVariab nameIndex += 9 * 64 ** (exportName.length - 1); exportName = toBase64(nameIndex); } - } while (RESERVED_NAMES[exportName] || exportsByName[exportName]); + } while (RESERVED_NAMES$1.has(exportName) || exportsByName.has(exportName)); } - exportsByName[exportName] = variable; + exportsByName.set(exportName, variable); exportNamesByVariable.set(variable, [exportName]); } } @@ -10427,15 +14200,15 @@ function assignExportsToNames(exports, exportsByName, exportNamesByVariable) { for (const variable of exports) { let nameIndex = 0; let exportName = variable.name; - while (exportsByName[exportName]) { + while (exportsByName.has(exportName)) { exportName = variable.name + '$' + ++nameIndex; } - exportsByName[exportName] = variable; + exportsByName.set(exportName, variable); exportNamesByVariable.set(variable, [exportName]); } } -function getExportMode(chunk, { exports: exportMode, name, format }, facadeModuleId, warn) { +function getExportMode(chunk, { exports: exportMode, name, format }, unsetOptions, facadeModuleId, warn) { const exportKeys = chunk.getExportNames(); if (exportMode === 'default') { if (exportKeys.length !== 1 || exportKeys[0] !== 'default') { @@ -10450,10 +14223,13 @@ function getExportMode(chunk, { exports: exportMode, name, format }, facadeModul exportMode = 'none'; } else if (exportKeys.length === 1 && exportKeys[0] === 'default') { + if (format === 'cjs' && unsetOptions.has('exports')) { + warn(errPreferNamedExports(facadeModuleId)); + } exportMode = 'default'; } else { - if (format !== 'es' && exportKeys.indexOf('default') !== -1) { + if (format !== 'es' && format !== 'system' && exportKeys.includes('default')) { warn(errMixedExport(facadeModuleId, name)); } exportMode = 'named'; @@ -10485,14 +14261,52 @@ function guessIndentString(code) { function getIndentString(modules, options) { if (options.indent !== true) return options.indent; - for (let i = 0; i < modules.length; i++) { - const indent = guessIndentString(modules[i].originalCode); + for (const module of modules) { + const indent = guessIndentString(module.originalCode); if (indent !== null) return indent; } return '\t'; } +function getStaticDependencies(chunk, orderedModules, chunkByModule) { + const staticDependencyBlocks = []; + const handledDependencies = new Set(); + for (let modulePos = orderedModules.length - 1; modulePos >= 0; modulePos--) { + const module = orderedModules[modulePos]; + if (!handledDependencies.has(module)) { + const staticDependencies = []; + addStaticDependencies(module, staticDependencies, handledDependencies, chunk, chunkByModule); + staticDependencyBlocks.unshift(staticDependencies); + } + } + const dependencies = new Set(); + for (const block of staticDependencyBlocks) { + for (const dependency of block) { + dependencies.add(dependency); + } + } + return dependencies; +} +function addStaticDependencies(module, staticDependencies, handledModules, chunk, chunkByModule) { + const dependencies = module.getDependenciesToBeIncluded(); + for (const dependency of dependencies) { + if (dependency instanceof ExternalModule) { + staticDependencies.push(dependency); + continue; + } + const dependencyChunk = chunkByModule.get(dependency); + if (dependencyChunk !== chunk) { + staticDependencies.push(dependencyChunk); + continue; + } + if (!handledModules.has(dependency)) { + handledModules.add(dependency); + addStaticDependencies(dependency, staticDependencies, handledModules, chunk, chunkByModule); + } + } +} + function decodedSourcemap(map) { if (!map) return null; @@ -10507,13 +14321,7 @@ function decodedSourcemap(map) { version: 3 }; } - let mappings; - if (typeof map.mappings === 'string') { - mappings = decode(map.mappings); - } - else { - mappings = map.mappings; - } + const mappings = typeof map.mappings === 'string' ? decode(map.mappings) : map.mappings; return { ...map, mappings }; } @@ -10536,27 +14344,54 @@ function renderChunk({ code, options, outputPluginDriver, renderChunk, sourcemap return outputPluginDriver.hookReduceArg0('renderChunk', [code, renderChunk, options], renderChunkReducer); } +const lowercaseBundleKeys = Symbol('bundleKeys'); +const FILE_PLACEHOLDER = { + type: 'placeholder' +}; +const getOutputBundle = (outputBundleBase) => { + const reservedLowercaseBundleKeys = new Set(); + return new Proxy(outputBundleBase, { + deleteProperty(target, key) { + if (typeof key === 'string') { + reservedLowercaseBundleKeys.delete(key.toLowerCase()); + } + return Reflect.deleteProperty(target, key); + }, + get(target, key) { + if (key === lowercaseBundleKeys) { + return reservedLowercaseBundleKeys; + } + return Reflect.get(target, key); + }, + set(target, key, value) { + if (typeof key === 'string') { + reservedLowercaseBundleKeys.add(key.toLowerCase()); + } + return Reflect.set(target, key, value); + } + }); +}; + function renderNamePattern(pattern, patternName, replacements) { - if (!isPlainPathFragment(pattern)) - return error(errFailedValidation(`Invalid pattern "${pattern}" for "${patternName}", patterns can be neither absolute nor relative paths and must not contain invalid characters.`)); + if (isPathFragment(pattern)) + return error(errFailedValidation(`Invalid pattern "${pattern}" for "${patternName}", patterns can be neither absolute nor relative paths. If you want your files to be stored in a subdirectory, write its name without a leading slash like this: subdirectory/pattern.`)); return pattern.replace(/\[(\w+)\]/g, (_match, type) => { if (!replacements.hasOwnProperty(type)) { return error(errFailedValidation(`"[${type}]" is not a valid placeholder in "${patternName}" pattern.`)); } const replacement = replacements[type](); - if (!isPlainPathFragment(replacement)) + if (isPathFragment(replacement)) return error(errFailedValidation(`Invalid substitution "${replacement}" for placeholder "[${type}]" in "${patternName}" pattern, can be neither absolute nor relative path.`)); return replacement; }); } -function makeUnique(name, existingNames) { - const existingNamesLowercase = new Set(Object.keys(existingNames).map(key => key.toLowerCase())); - if (!existingNamesLowercase.has(name.toLocaleLowerCase())) +function makeUnique(name, { [lowercaseBundleKeys]: reservedLowercaseBundleKeys }) { + if (!reservedLowercaseBundleKeys.has(name.toLowerCase())) return name; const ext = extname(name); - name = name.substr(0, name.length - ext.length); + name = name.substring(0, name.length - ext.length); let uniqueName, uniqueIndex = 1; - while (existingNamesLowercase.has((uniqueName = name + ++uniqueIndex + ext).toLowerCase())) + while (reservedLowercaseBundleKeys.has((uniqueName = name + ++uniqueIndex + ext).toLowerCase())) ; return uniqueName; } @@ -10577,38 +14412,47 @@ function getGlobalName(module, globals, hasExports, warn) { return module.variableName; } } -class Chunk$1 { - constructor(orderedModules, inputOptions, outputOptions, unsetOptions, modulesById, chunkByModule, facadeChunkByModule, manualChunkAlias) { +class Chunk { + constructor(orderedModules, inputOptions, outputOptions, unsetOptions, pluginDriver, modulesById, chunkByModule, facadeChunkByModule, includedNamespaces, manualChunkAlias) { this.orderedModules = orderedModules; this.inputOptions = inputOptions; this.outputOptions = outputOptions; this.unsetOptions = unsetOptions; + this.pluginDriver = pluginDriver; this.modulesById = modulesById; this.chunkByModule = chunkByModule; this.facadeChunkByModule = facadeChunkByModule; + this.includedNamespaces = includedNamespaces; this.manualChunkAlias = manualChunkAlias; this.entryModules = []; this.exportMode = 'named'; this.facadeModule = null; this.id = null; + this.namespaceVariableName = ''; + this.needsExportsShim = false; + this.variableName = ''; + this.accessedGlobalsByScope = new Map(); this.dependencies = new Set(); this.dynamicDependencies = new Set(); this.dynamicEntryModules = []; - this.exportNamesByVariable = null; + this.dynamicName = null; + this.exportNamesByVariable = new Map(); this.exports = new Set(); - this.exportsByName = null; + this.exportsByName = new Map(); this.fileName = null; this.implicitEntryModules = []; this.implicitlyLoadedBefore = new Set(); this.imports = new Set(); + this.includedReexportsByModule = new Map(); this.indentString = undefined; + // This may only be updated in the constructor this.isEmpty = true; this.name = null; - this.needsExportsShim = false; this.renderedDependencies = null; this.renderedExports = null; this.renderedHash = undefined; this.renderedModuleSources = new Map(); + this.renderedModules = Object.create(null); this.renderedSource = null; this.sortedExportNames = null; this.strictFacade = false; @@ -10616,25 +14460,33 @@ class Chunk$1 { this.execIndex = orderedModules.length > 0 ? orderedModules[0].execIndex : Infinity; const chunkModules = new Set(orderedModules); for (const module of orderedModules) { + if (module.namespace.included) { + includedNamespaces.add(module); + } if (this.isEmpty && module.isIncluded()) { this.isEmpty = false; } - if (module.isEntryPoint || outputOptions.preserveModules) { + if (module.info.isEntry || outputOptions.preserveModules) { this.entryModules.push(module); } for (const importer of module.includedDynamicImporters) { if (!chunkModules.has(importer)) { this.dynamicEntryModules.push(module); + // Modules with synthetic exports need an artificial namespace for dynamic imports + if (module.info.syntheticNamedExports && !outputOptions.preserveModules) { + includedNamespaces.add(module); + this.exports.add(module.namespace); + } } } if (module.implicitlyLoadedAfter.size > 0) { this.implicitEntryModules.push(module); } } - this.variableName = makeLegal(this.generateVariableName()); + this.suggestedVariableName = makeLegal(this.generateVariableName()); } - static generateFacade(inputOptions, outputOptions, unsetOptions, modulesById, chunkByModule, facadeChunkByModule, facadedModule, facadeName) { - const chunk = new Chunk$1([], inputOptions, outputOptions, unsetOptions, modulesById, chunkByModule, facadeChunkByModule, null); + static generateFacade(inputOptions, outputOptions, unsetOptions, pluginDriver, modulesById, chunkByModule, facadeChunkByModule, includedNamespaces, facadedModule, facadeName) { + const chunk = new Chunk([], inputOptions, outputOptions, unsetOptions, pluginDriver, modulesById, chunkByModule, facadeChunkByModule, includedNamespaces, null); chunk.assignFacadeName(facadeName, facadedModule); if (!facadeChunkByModule.has(facadedModule)) { facadeChunkByModule.set(facadedModule, chunk); @@ -10643,7 +14495,7 @@ class Chunk$1 { chunk.dependencies.add(dependency instanceof Module ? chunkByModule.get(dependency) : dependency); } if (!chunk.dependencies.has(chunkByModule.get(facadedModule)) && - facadedModule.moduleSideEffects && + facadedModule.info.moduleSideEffects && facadedModule.hasEffects()) { chunk.dependencies.add(chunkByModule.get(facadedModule)); } @@ -10679,8 +14531,6 @@ class Chunk$1 { } generateExports() { this.sortedExportNames = null; - this.exportsByName = Object.create(null); - this.exportNamesByVariable = new Map(); const remainingExports = new Set(this.exports); if (this.facadeModule !== null && (this.facadeModule.preserveSignature !== false || this.strictFacade)) { @@ -10688,7 +14538,7 @@ class Chunk$1 { for (const [variable, exportNames] of exportNamesByVariable) { this.exportNamesByVariable.set(variable, [...exportNames]); for (const exportName of exportNames) { - this.exportsByName[exportName] = variable; + this.exportsByName.set(exportName, variable); } remainingExports.delete(variable); } @@ -10699,14 +14549,14 @@ class Chunk$1 { else { assignExportsToNames(remainingExports, this.exportsByName, this.exportNamesByVariable); } - if (this.outputOptions.preserveModules || (this.facadeModule && this.facadeModule.isEntryPoint)) - this.exportMode = getExportMode(this, this.outputOptions, this.facadeModule.id, this.inputOptions.onwarn); + if (this.outputOptions.preserveModules || (this.facadeModule && this.facadeModule.info.isEntry)) + this.exportMode = getExportMode(this, this.outputOptions, this.unsetOptions, this.facadeModule.id, this.inputOptions.onwarn); } generateFacades() { var _a; const facades = []; const entryModules = new Set([...this.entryModules, ...this.implicitEntryModules]); - const exposedVariables = new Set(this.dynamicEntryModules.map(module => module.namespace)); + const exposedVariables = new Set(this.dynamicEntryModules.map(({ namespace }) => namespace)); for (const module of entryModules) { if (module.preserveSignature) { for (const exportedVariable of module.getExportNamesByVariable().keys()) { @@ -10715,7 +14565,9 @@ class Chunk$1 { } } for (const module of entryModules) { - const requiredFacades = Array.from(module.userChunkNames, name => ({ + const requiredFacades = Array.from(new Set(module.chunkNames.filter(({ isUserDefined }) => isUserDefined).map(({ name }) => name)), + // mapping must run after Set 'name' dedupe + name => ({ name })); if (requiredFacades.length === 0 && module.isUserDefinedEntryPoint) { @@ -10725,28 +14577,33 @@ class Chunk$1 { if (requiredFacades.length === 0) { requiredFacades.push({}); } - if (!this.facadeModule && - (this.outputOptions.preserveModules || - module.preserveSignature !== 'strict' || - this.canModuleBeFacade(module, exposedVariables))) { - this.facadeModule = module; - this.facadeChunkByModule.set(module, this); - if (module.preserveSignature) { - this.strictFacade = module.preserveSignature === 'strict'; - this.ensureReexportsAreAvailableForModule(module); + if (!this.facadeModule) { + const needsStrictFacade = module.preserveSignature === 'strict' || + (module.preserveSignature === 'exports-only' && + module.getExportNamesByVariable().size !== 0); + if (!needsStrictFacade || + this.outputOptions.preserveModules || + this.canModuleBeFacade(module, exposedVariables)) { + this.facadeModule = module; + this.facadeChunkByModule.set(module, this); + if (module.preserveSignature) { + this.strictFacade = needsStrictFacade; + } + this.assignFacadeName(requiredFacades.shift(), module); } - this.assignFacadeName(requiredFacades.shift(), module); } for (const facadeName of requiredFacades) { - facades.push(Chunk$1.generateFacade(this.inputOptions, this.outputOptions, this.unsetOptions, this.modulesById, this.chunkByModule, this.facadeChunkByModule, module, facadeName)); + facades.push(Chunk.generateFacade(this.inputOptions, this.outputOptions, this.unsetOptions, this.pluginDriver, this.modulesById, this.chunkByModule, this.facadeChunkByModule, this.includedNamespaces, module, facadeName)); } } for (const module of this.dynamicEntryModules) { + if (module.info.syntheticNamedExports) + continue; if (!this.facadeModule && this.canModuleBeFacade(module, exposedVariables)) { this.facadeModule = module; this.facadeChunkByModule.set(module, this); this.strictFacade = true; - this.assignFacadeName({}, module); + this.dynamicName = getChunkNameFromModule(module); } else if (this.facadeModule === module && !this.strictFacade && @@ -10754,71 +14611,79 @@ class Chunk$1 { this.strictFacade = true; } else if (!((_a = this.facadeChunkByModule.get(module)) === null || _a === void 0 ? void 0 : _a.strictFacade)) { - module.namespace.include(); + this.includedNamespaces.add(module); this.exports.add(module.namespace); } } + if (!this.outputOptions.preserveModules) { + this.addNecessaryImportsForFacades(); + } return facades; } - generateId(addons, options, existingNames, includeHash, outputPluginDriver) { + generateId(addons, options, bundle, includeHash) { if (this.fileName !== null) { return this.fileName; } const [pattern, patternName] = this.facadeModule && this.facadeModule.isUserDefinedEntryPoint ? [options.entryFileNames, 'output.entryFileNames'] : [options.chunkFileNames, 'output.chunkFileNames']; - return makeUnique(renderNamePattern(pattern, patternName, { + return makeUnique(renderNamePattern(typeof pattern === 'function' ? pattern(this.getChunkInfo()) : pattern, patternName, { format: () => options.format, hash: () => includeHash - ? this.computeContentHashWithDependencies(addons, options, existingNames, outputPluginDriver) + ? this.computeContentHashWithDependencies(addons, options, bundle) : '[hash]', name: () => this.getChunkName() - }), existingNames); + }), bundle); } - generateIdPreserveModules(preserveModulesRelativeDir, options, existingNames, unsetOptions) { - const id = this.orderedModules[0].id; - const sanitizedId = sanitizeFileName(id); + generateIdPreserveModules(preserveModulesRelativeDir, options, bundle, unsetOptions) { + const [{ id }] = this.orderedModules; + const sanitizedId = this.outputOptions.sanitizeFileName(id.split(QUERY_HASH_REGEX, 1)[0]); let path; - if (isAbsolute(id)) { - const extension = extname(id); - const pattern = unsetOptions.has('entryFileNames') - ? NON_ASSET_EXTENSIONS.includes(extension) - ? '[name].js' - : '[name][extname].js' - : options.entryFileNames; - path = relative(preserveModulesRelativeDir, `${dirname(sanitizedId)}/${renderNamePattern(pattern, 'output.entryFileNames', { - ext: () => extension.substr(1), + const patternOpt = unsetOptions.has('entryFileNames') + ? '[name][assetExtname].js' + : options.entryFileNames; + const pattern = typeof patternOpt === 'function' ? patternOpt(this.getChunkInfo()) : patternOpt; + if (isAbsolute(sanitizedId)) { + const currentDir = dirname(sanitizedId); + const extension = extname(sanitizedId); + const fileName = renderNamePattern(pattern, 'output.entryFileNames', { + assetExtname: () => (NON_ASSET_EXTENSIONS.includes(extension) ? '' : extension), + ext: () => extension.substring(1), extname: () => extension, format: () => options.format, name: () => this.getChunkName() - })}`); + }); + const currentPath = `${currentDir}/${fileName}`; + const { preserveModulesRoot } = options; + if (preserveModulesRoot && resolve(currentPath).startsWith(preserveModulesRoot)) { + path = currentPath.slice(preserveModulesRoot.length).replace(/^[\\/]/, ''); + } + else { + path = relative(preserveModulesRelativeDir, currentPath); + } } else { - path = `_virtual/${basename(sanitizedId)}`; + const extension = extname(sanitizedId); + const fileName = renderNamePattern(pattern, 'output.entryFileNames', { + assetExtname: () => (NON_ASSET_EXTENSIONS.includes(extension) ? '' : extension), + ext: () => extension.substring(1), + extname: () => extension, + format: () => options.format, + name: () => getAliasName(sanitizedId) + }); + path = `_virtual/${fileName}`; } - return makeUnique(normalize(path), existingNames); + return makeUnique(normalize(path), bundle); } - getChunkName() { - return this.name || (this.name = sanitizeFileName(this.getFallbackChunkName())); - } - getExportNames() { - return (this.sortedExportNames || (this.sortedExportNames = Object.keys(this.exportsByName).sort())); - } - getPrerenderedChunk() { + getChunkInfo() { const facadeModule = this.facadeModule; const getChunkName = this.getChunkName.bind(this); return { - code: undefined, - dynamicImports: Array.from(this.dynamicDependencies, getId), exports: this.getExportNames(), facadeModuleId: facadeModule && facadeModule.id, - fileName: undefined, - implicitlyLoadedBefore: Array.from(this.implicitlyLoadedBefore, getId), - imports: Array.from(this.dependencies, getId), isDynamicEntry: this.dynamicEntryModules.length > 0, - isEntry: facadeModule !== null && facadeModule.isEntryPoint, + isEntry: facadeModule !== null && facadeModule.info.isEntry, isImplicitEntry: this.implicitEntryModules.length > 0, - map: undefined, modules: this.renderedModules, get name() { return getChunkName(); @@ -10826,21 +14691,41 @@ class Chunk$1 { type: 'chunk' }; } - getRenderedHash(outputPluginDriver) { + getChunkInfoWithFileNames() { + return Object.assign(this.getChunkInfo(), { + code: undefined, + dynamicImports: Array.from(this.dynamicDependencies, getId), + fileName: this.id, + implicitlyLoadedBefore: Array.from(this.implicitlyLoadedBefore, getId), + importedBindings: this.getImportedBindingsPerDependency(), + imports: Array.from(this.dependencies, getId), + map: undefined, + referencedFiles: this.getReferencedFiles() + }); + } + getChunkName() { + var _a; + return ((_a = this.name) !== null && _a !== void 0 ? _a : (this.name = this.outputOptions.sanitizeFileName(this.getFallbackChunkName()))); + } + getExportNames() { + var _a; + return ((_a = this.sortedExportNames) !== null && _a !== void 0 ? _a : (this.sortedExportNames = Array.from(this.exportsByName.keys()).sort())); + } + getRenderedHash() { if (this.renderedHash) return this.renderedHash; const hash = createHash(); - const hashAugmentation = outputPluginDriver.hookReduceValueSync('augmentChunkHash', '', [this.getPrerenderedChunk()], (hashAugmentation, pluginHash) => { + const hashAugmentation = this.pluginDriver.hookReduceValueSync('augmentChunkHash', '', [this.getChunkInfo()], (augmentation, pluginHash) => { if (pluginHash) { - hashAugmentation += pluginHash; + augmentation += pluginHash; } - return hashAugmentation; + return augmentation; }); hash.update(hashAugmentation); hash.update(this.renderedSource.toString()); hash.update(this.getExportNames() .map(exportName => { - const variable = this.exportsByName[exportName]; + const variable = this.exportsByName.get(exportName); return `${relativeId(variable.module.id).replace(/\\/g, '/')}:${variable.name}:${exportName}`; }) .join(',')); @@ -10853,61 +14738,56 @@ class Chunk$1 { return this.exportNamesByVariable.get(variable)[0]; } link() { + this.dependencies = getStaticDependencies(this, this.orderedModules, this.chunkByModule); for (const module of this.orderedModules) { - this.addDependenciesToChunk(module.getDependenciesToBeIncluded(), this.dependencies); this.addDependenciesToChunk(module.dynamicDependencies, this.dynamicDependencies); this.addDependenciesToChunk(module.implicitlyLoadedBefore, this.implicitlyLoadedBefore); this.setUpChunkImportsAndExportsForModule(module); } } // prerender allows chunk hashes and names to be generated before finalizing - preRender(options, inputBase, outputPluginDriver) { - const magicString = new Bundle({ separator: options.compact ? '' : '\n\n' }); + preRender(options, inputBase, snippets) { + const { _, getPropertyAccess, n } = snippets; + const magicString = new Bundle$1({ separator: `${n}${n}` }); this.usedModules = []; this.indentString = getIndentString(this.orderedModules, options); - const n = options.compact ? '' : '\n'; - const _ = options.compact ? '' : ' '; const renderOptions = { - compact: options.compact, dynamicImportFunction: options.dynamicImportFunction, exportNamesByVariable: this.exportNamesByVariable, format: options.format, freeze: options.freeze, indent: this.indentString, namespaceToStringTag: options.namespaceToStringTag, - outputPluginDriver, - varOrConst: options.preferConst ? 'const' : 'var' + outputPluginDriver: this.pluginDriver, + snippets }; // for static and dynamic entry points, inline the execution list to avoid loading latency if (options.hoistTransitiveImports && !this.outputOptions.preserveModules && this.facadeModule !== null) { for (const dep of this.dependencies) { - if (dep instanceof Chunk$1) + if (dep instanceof Chunk) this.inlineChunkDependencies(dep); } } - const sortedDependencies = [...this.dependencies]; - sortByExecutionOrder(sortedDependencies); - this.dependencies = new Set(sortedDependencies); - this.prepareDynamicImports(); + this.prepareModulesForRendering(snippets); this.setIdentifierRenderResolutions(options); let hoistedSource = ''; - const renderedModules = (this.renderedModules = Object.create(null)); + const renderedModules = this.renderedModules; for (const module of this.orderedModules) { let renderedLength = 0; - if (module.isIncluded()) { + if (module.isIncluded() || this.includedNamespaces.has(module)) { const source = module.render(renderOptions).trim(); renderedLength = source.length(); if (renderedLength) { - if (options.compact && source.lastLine().indexOf('//') !== -1) + if (options.compact && source.lastLine().includes('//')) source.append('\n'); this.renderedModuleSources.set(module, source); magicString.addSource(source); this.usedModules.push(module); } const namespace = module.namespace; - if (namespace.included && !this.outputOptions.preserveModules) { + if (this.includedNamespaces.has(module) && !this.outputOptions.preserveModules) { const rendered = namespace.renderBlock(renderOptions); if (namespace.renderFirst()) hoistedSource += n + rendered; @@ -10916,7 +14796,12 @@ class Chunk$1 { } } const { renderedExports, removedExports } = module.getRenderedExports(); + const { renderedModuleSources } = this; renderedModules[module.id] = { + get code() { + var _a, _b; + return (_b = (_a = renderedModuleSources.get(module)) === null || _a === void 0 ? void 0 : _a.toString()) !== null && _b !== void 0 ? _b : null; + }, originalLength: module.originalCode.length, removedExports, renderedExports, @@ -10926,7 +14811,7 @@ class Chunk$1 { if (hoistedSource) magicString.prepend(hoistedSource + n + n); if (this.needsExportsShim) { - magicString.prepend(`${n}${renderOptions.varOrConst} ${MISSING_EXPORT_SHIM_VARIABLE}${_}=${_}void 0;${n}${n}`); + magicString.prepend(`${n}${snippets.cnst} ${MISSING_EXPORT_SHIM_VARIABLE}${_}=${_}void 0;${n}${n}`); } if (options.compact) { this.renderedSource = magicString; @@ -10944,19 +14829,18 @@ class Chunk$1 { }); } this.setExternalRenderPaths(options, inputBase); - this.renderedDependencies = this.getChunkDependencyDeclarations(options); + this.renderedDependencies = this.getChunkDependencyDeclarations(options, getPropertyAccess); this.renderedExports = - this.exportMode === 'none' ? [] : this.getChunkExportDeclarations(options.format); + this.exportMode === 'none' + ? [] + : this.getChunkExportDeclarations(options.format, getPropertyAccess); } - async render(options, addons, outputChunk, outputPluginDriver) { + async render(options, addons, outputChunk, snippets) { timeStart('render format', 2); const format = options.format; const finalise = finalisers[format]; if (options.dynamicImportFunction && format !== 'es') { - this.inputOptions.onwarn({ - code: 'INVALID_OPTION', - message: '"output.dynamicImportFunction" is ignored for formats other than "es".' - }); + this.inputOptions.onwarn(errInvalidOption('output.dynamicImportFunction', 'outputdynamicImportFunction', 'this option is ignored for formats other than "es"')); } // populate ids in the rendered declarations only here // as chunk ids known only after prerender @@ -10964,50 +14848,58 @@ class Chunk$1 { const renderedDependency = this.renderedDependencies.get(dependency); if (dependency instanceof ExternalModule) { const originalId = dependency.renderPath; - renderedDependency.id = escapeId(dependency.renormalizeRenderPath ? this.getRelativePath(originalId, false) : originalId); + renderedDependency.id = escapeId(dependency.renormalizeRenderPath + ? getImportPath(this.id, originalId, false, false) + : originalId); } else { renderedDependency.namedExportsMode = dependency.exportMode !== 'default'; - renderedDependency.id = escapeId(this.getRelativePath(dependency.id, false)); + renderedDependency.id = escapeId(getImportPath(this.id, dependency.id, false, true)); } } - this.finaliseDynamicImports(options); - this.finaliseImportMetas(format, outputPluginDriver); + this.finaliseDynamicImports(options, snippets); + this.finaliseImportMetas(format, snippets); const hasExports = this.renderedExports.length !== 0 || [...this.renderedDependencies.values()].some(dep => (dep.reexports && dep.reexports.length !== 0)); - let usesTopLevelAwait = false; + let topLevelAwaitModule = null; const accessedGlobals = new Set(); for (const module of this.orderedModules) { if (module.usesTopLevelAwait) { - usesTopLevelAwait = true; + topLevelAwaitModule = module.id; } - const accessedGlobalVariablesByFormat = module.scope.accessedGlobalVariablesByFormat; - const accessedGlobalVariables = accessedGlobalVariablesByFormat && accessedGlobalVariablesByFormat.get(format); + const accessedGlobalVariables = this.accessedGlobalsByScope.get(module.scope); if (accessedGlobalVariables) { for (const name of accessedGlobalVariables) { accessedGlobals.add(name); } } } - if (usesTopLevelAwait && format !== 'es' && format !== 'system') { + if (topLevelAwaitModule !== null && format !== 'es' && format !== 'system') { return error({ code: 'INVALID_TLA_FORMAT', + id: topLevelAwaitModule, message: `Module format ${format} does not support top-level await. Use the "es" or "system" output formats rather.` }); } + /* istanbul ignore next */ + if (!this.id) { + throw new Error('Internal Error: expecting chunk id'); + } const magicString = finalise(this.renderedSource, { accessedGlobals, dependencies: [...this.renderedDependencies.values()], exports: this.renderedExports, hasExports, - indentString: this.indentString, + id: this.id, + indent: this.indentString, intro: addons.intro, - isEntryModuleFacade: this.outputOptions.preserveModules || - (this.facadeModule !== null && this.facadeModule.isEntryPoint), + isEntryFacade: this.outputOptions.preserveModules || + (this.facadeModule !== null && this.facadeModule.info.isEntry), + isModuleFacade: this.facadeModule !== null, namedExportsMode: this.exportMode !== 'default', outro: addons.outro, - usesTopLevelAwait, - varOrConst: options.preferConst ? 'const' : 'var', + snippets, + usesTopLevelAwait: topLevelAwaitModule !== null, warn: this.inputOptions.onwarn }, options); if (addons.banner) @@ -11021,7 +14913,7 @@ class Chunk$1 { let code = await renderChunk({ code: prevCode, options, - outputPluginDriver, + outputPluginDriver: this.pluginDriver, renderChunk: outputChunk, sourcemapChain: chunkSourcemapChain }); @@ -11051,7 +14943,7 @@ class Chunk$1 { .map(normalize); timeEnd('sourcemap', 2); } - if (options.compact !== true && code[code.length - 1] !== '\n') + if (!options.compact && code[code.length - 1] !== '\n') code += '\n'; return { code, map }; } @@ -11068,26 +14960,52 @@ class Chunk$1 { } } } + addNecessaryImportsForFacades() { + for (const [module, variables] of this.includedReexportsByModule) { + if (this.includedNamespaces.has(module)) { + for (const variable of variables) { + this.imports.add(variable); + } + } + } + } assignFacadeName({ fileName, name }, facadedModule) { if (fileName) { this.fileName = fileName; } else { - this.name = sanitizeFileName(name || facadedModule.chunkName || getAliasName(facadedModule.id)); + this.name = this.outputOptions.sanitizeFileName(name || getChunkNameFromModule(facadedModule)); } } - computeContentHashWithDependencies(addons, options, existingNames, outputPluginDriver) { + checkCircularDependencyImport(variable, importingModule) { + const variableModule = variable.module; + if (variableModule instanceof Module) { + const exportChunk = this.chunkByModule.get(variableModule); + let alternativeReexportModule; + do { + alternativeReexportModule = importingModule.alternativeReexportModules.get(variable); + if (alternativeReexportModule) { + const exportingChunk = this.chunkByModule.get(alternativeReexportModule); + if (exportingChunk && exportingChunk !== exportChunk) { + this.inputOptions.onwarn(errCyclicCrossChunkReexport(variableModule.getExportNamesByVariable().get(variable)[0], variableModule.id, alternativeReexportModule.id, importingModule.id)); + } + importingModule = alternativeReexportModule; + } + } while (alternativeReexportModule); + } + } + computeContentHashWithDependencies(addons, options, bundle) { const hash = createHash(); - hash.update([addons.intro, addons.outro, addons.banner, addons.footer].map(addon => addon || '').join(':')); + hash.update([addons.intro, addons.outro, addons.banner, addons.footer].join(':')); hash.update(options.format); const dependenciesForHashing = new Set([this]); for (const current of dependenciesForHashing) { if (current instanceof ExternalModule) { - hash.update(':' + current.renderPath); + hash.update(`:${current.renderPath}`); } else { - hash.update(current.getRenderedHash(outputPluginDriver)); - hash.update(current.generateId(addons, options, existingNames, false, outputPluginDriver)); + hash.update(current.getRenderedHash()); + hash.update(current.generateId(addons, options, bundle, false)); } if (current instanceof ExternalModule) continue; @@ -11098,6 +15016,7 @@ class Chunk$1 { return hash.digest('hex').substr(0, 8); } ensureReexportsAreAvailableForModule(module) { + const includedReexports = []; const map = module.getExportNamesByVariable(); for (const exportedVariable of map.keys()) { const isSynthetic = exportedVariable instanceof SyntheticNamedExportVariable; @@ -11105,11 +15024,13 @@ class Chunk$1 { ? exportedVariable.getBaseVariable() : exportedVariable; if (!(importedVariable instanceof NamespaceVariable && this.outputOptions.preserveModules)) { + this.checkCircularDependencyImport(importedVariable, module); const exportingModule = importedVariable.module; if (exportingModule instanceof Module) { const chunk = this.chunkByModule.get(exportingModule); if (chunk && chunk !== this) { chunk.exports.add(importedVariable); + includedReexports.push(importedVariable); if (isSynthetic) { this.imports.add(importedVariable); } @@ -11117,9 +15038,12 @@ class Chunk$1 { } } } + if (includedReexports.length) { + this.includedReexportsByModule.set(module, includedReexports); + } } - finaliseDynamicImports(options) { - const stripKnownJsExtensions = options.format === 'amd'; + finaliseDynamicImports(options, snippets) { + const stripKnownJsExtensions = options.format === 'amd' && !options.amd.forceJsExtensionForImports; for (const [module, code] of this.renderedModuleSources) { for (const { node, resolution } of module.dynamicImports) { const chunk = this.chunkByModule.get(resolution); @@ -11128,22 +15052,22 @@ class Chunk$1 { continue; } const renderedResolution = resolution instanceof Module - ? `'${this.getRelativePath((facadeChunk || chunk).id, stripKnownJsExtensions)}'` + ? `'${escapeId(getImportPath(this.id, (facadeChunk || chunk).id, stripKnownJsExtensions, true))}'` : resolution instanceof ExternalModule - ? `'${resolution.renormalizeRenderPath - ? this.getRelativePath(resolution.renderPath, stripKnownJsExtensions) - : resolution.renderPath}'` + ? `'${escapeId(resolution.renormalizeRenderPath + ? getImportPath(this.id, resolution.renderPath, stripKnownJsExtensions, false) + : resolution.renderPath)}'` : resolution; node.renderFinalResolution(code, renderedResolution, resolution instanceof Module && !(facadeChunk === null || facadeChunk === void 0 ? void 0 : facadeChunk.strictFacade) && - chunk.exportNamesByVariable.get(resolution.namespace)[0], options); + chunk.exportNamesByVariable.get(resolution.namespace)[0], snippets); } } } - finaliseImportMetas(format, outputPluginDriver) { + finaliseImportMetas(format, snippets) { for (const [module, code] of this.renderedModuleSources) { for (const importMeta of module.importMetas) { - importMeta.renderFinalMechanism(code, this.id, format, outputPluginDriver); + importMeta.renderFinalMechanism(code, this.id, format, snippets, this.pluginDriver); } } } @@ -11156,97 +15080,40 @@ class Chunk$1 { this.dynamicEntryModules[0] || this.orderedModules[this.orderedModules.length - 1]; if (moduleForNaming) { - return moduleForNaming.chunkName || getAliasName(moduleForNaming.id); + return getChunkNameFromModule(moduleForNaming); } return 'chunk'; } - getChunkDependencyDeclarations(options) { - const reexportDeclarations = new Map(); - for (let exportName of this.getExportNames()) { - let exportChunk; - let importName; - let needsLiveBinding = false; - if (exportName[0] === '*') { - needsLiveBinding = options.externalLiveBindings; - exportChunk = this.modulesById.get(exportName.substr(1)); - importName = exportName = '*'; - } - else { - const variable = this.exportsByName[exportName]; - if (variable instanceof SyntheticNamedExportVariable) - continue; - const module = variable.module; - if (module instanceof Module) { - exportChunk = this.chunkByModule.get(module); - if (exportChunk === this) - continue; - importName = exportChunk.getVariableExportName(variable); - needsLiveBinding = variable.isReassigned; - } - else { - exportChunk = module; - importName = variable.name; - needsLiveBinding = options.externalLiveBindings; - } - } - let reexportDeclaration = reexportDeclarations.get(exportChunk); - if (!reexportDeclaration) - reexportDeclarations.set(exportChunk, (reexportDeclaration = [])); - reexportDeclaration.push({ imported: importName, reexported: exportName, needsLiveBinding }); - } - const renderedImports = new Set(); - const dependencies = new Map(); + getChunkDependencyDeclarations(options, getPropertyAccess) { + const importSpecifiers = this.getImportSpecifiers(getPropertyAccess); + const reexportSpecifiers = this.getReexportSpecifiers(); + const dependencyDeclaration = new Map(); for (const dep of this.dependencies) { - const imports = []; - for (const variable of this.imports) { - if ((variable.module instanceof Module - ? this.chunkByModule.get(variable.module) === dep - : variable.module === dep) && - !renderedImports.has(variable)) { - renderedImports.add(variable); - imports.push({ - imported: variable.module instanceof ExternalModule - ? variable.name - : this.chunkByModule.get(variable.module).getVariableExportName(variable), - local: variable.getName() - }); - } - } - const reexports = reexportDeclarations.get(dep); - let exportsNames, exportsDefault; - let namedExportsMode = true; - if (dep instanceof ExternalModule) { - exportsNames = dep.exportsNames || dep.exportsNamespace; - exportsDefault = 'default' in dep.declarations; - } - else { - exportsNames = true; - // we don't want any interop patterns to trigger - exportsDefault = false; - namedExportsMode = dep.exportMode !== 'default'; - } - dependencies.set(dep, { - exportsDefault, - exportsNames, + const imports = importSpecifiers.get(dep) || null; + const reexports = reexportSpecifiers.get(dep) || null; + const namedExportsMode = dep instanceof ExternalModule || dep.exportMode !== 'default'; + dependencyDeclaration.set(dep, { + defaultVariableName: dep.defaultVariableName, globalName: (dep instanceof ExternalModule && (options.format === 'umd' || options.format === 'iife') && - getGlobalName(dep, options.globals, exportsNames || exportsDefault, this.inputOptions.onwarn)), + getGlobalName(dep, options.globals, (imports || reexports) !== null, this.inputOptions.onwarn)), id: undefined, - imports: imports.length > 0 ? imports : null, - isChunk: dep instanceof Chunk$1, + imports, + isChunk: dep instanceof Chunk, name: dep.variableName, namedExportsMode, + namespaceVariableName: dep.namespaceVariableName, reexports }); } - return dependencies; + return dependencyDeclaration; } - getChunkExportDeclarations(format) { + getChunkExportDeclarations(format, getPropertyAccess) { const exports = []; for (const exportName of this.getExportNames()) { if (exportName[0] === '*') continue; - const variable = this.exportsByName[exportName]; + const variable = this.exportsByName.get(exportName); if (!(variable instanceof SyntheticNamedExportVariable)) { const module = variable.module; if (module && this.chunkByModule.get(module) !== this) @@ -11254,12 +15121,8 @@ class Chunk$1 { } let expression = null; let hoisted = false; - let uninitialized = false; - let local = variable.getName(); + let local = variable.getName(getPropertyAccess); if (variable instanceof LocalVariable) { - if (variable.init === UNDEFINED_EXPRESSION) { - uninitialized = true; - } for (const declaration of variable.declarations) { if (declaration.parent instanceof FunctionDeclaration || (declaration instanceof ExportDefaultDeclaration && @@ -11271,7 +15134,7 @@ class Chunk$1 { } else if (variable instanceof SyntheticNamedExportVariable) { expression = local; - if (format === 'es' && exportName !== 'default') { + if (format === 'es') { local = variable.renderName; } } @@ -11279,59 +15142,202 @@ class Chunk$1 { exported: exportName, expression, hoisted, - local, - uninitialized + local }); } return exports; } + getDependenciesToBeDeconflicted(addNonNamespacesAndInteropHelpers, addDependenciesWithoutBindings, interop) { + const dependencies = new Set(); + const deconflictedDefault = new Set(); + const deconflictedNamespace = new Set(); + for (const variable of [...this.exportNamesByVariable.keys(), ...this.imports]) { + if (addNonNamespacesAndInteropHelpers || variable.isNamespace) { + const module = variable.module; + if (module instanceof ExternalModule) { + dependencies.add(module); + if (addNonNamespacesAndInteropHelpers) { + if (variable.name === 'default') { + if (defaultInteropHelpersByInteropType[String(interop(module.id))]) { + deconflictedDefault.add(module); + } + } + else if (variable.name === '*') { + if (namespaceInteropHelpersByInteropType[String(interop(module.id))]) { + deconflictedNamespace.add(module); + } + } + } + } + else { + const chunk = this.chunkByModule.get(module); + if (chunk !== this) { + dependencies.add(chunk); + if (addNonNamespacesAndInteropHelpers && + chunk.exportMode === 'default' && + variable.isNamespace) { + deconflictedNamespace.add(chunk); + } + } + } + } + } + if (addDependenciesWithoutBindings) { + for (const dependency of this.dependencies) { + dependencies.add(dependency); + } + } + return { deconflictedDefault, deconflictedNamespace, dependencies }; + } getFallbackChunkName() { if (this.manualChunkAlias) { return this.manualChunkAlias; } + if (this.dynamicName) { + return this.dynamicName; + } if (this.fileName) { return getAliasName(this.fileName); } return getAliasName(this.orderedModules[this.orderedModules.length - 1].id); } - getRelativePath(targetPath, stripJsExtension) { - let relativePath = normalize(relative(dirname(this.id), targetPath)); - if (stripJsExtension && relativePath.endsWith('.js')) { - relativePath = relativePath.slice(0, -3); + getImportSpecifiers(getPropertyAccess) { + const { interop } = this.outputOptions; + const importsByDependency = new Map(); + for (const variable of this.imports) { + const module = variable.module; + let dependency; + let imported; + if (module instanceof ExternalModule) { + dependency = module; + imported = variable.name; + if (imported !== 'default' && imported !== '*' && interop(module.id) === 'defaultOnly') { + return error(errUnexpectedNamedImport(module.id, imported, false)); + } + } + else { + dependency = this.chunkByModule.get(module); + imported = dependency.getVariableExportName(variable); + } + getOrCreate(importsByDependency, dependency, () => []).push({ + imported, + local: variable.getName(getPropertyAccess) + }); } - if (relativePath === '..') - return '../../' + basename(targetPath); - if (relativePath === '') - return '../' + basename(targetPath); - return relativePath.startsWith('../') ? relativePath : './' + relativePath; + return importsByDependency; + } + getImportedBindingsPerDependency() { + const importSpecifiers = {}; + for (const [dependency, declaration] of this.renderedDependencies) { + const specifiers = new Set(); + if (declaration.imports) { + for (const { imported } of declaration.imports) { + specifiers.add(imported); + } + } + if (declaration.reexports) { + for (const { imported } of declaration.reexports) { + specifiers.add(imported); + } + } + importSpecifiers[dependency.id] = [...specifiers]; + } + return importSpecifiers; + } + getReexportSpecifiers() { + const { externalLiveBindings, interop } = this.outputOptions; + const reexportSpecifiers = new Map(); + for (let exportName of this.getExportNames()) { + let dependency; + let imported; + let needsLiveBinding = false; + if (exportName[0] === '*') { + const id = exportName.substring(1); + if (interop(id) === 'defaultOnly') { + this.inputOptions.onwarn(errUnexpectedNamespaceReexport(id)); + } + needsLiveBinding = externalLiveBindings; + dependency = this.modulesById.get(id); + imported = exportName = '*'; + } + else { + const variable = this.exportsByName.get(exportName); + if (variable instanceof SyntheticNamedExportVariable) + continue; + const module = variable.module; + if (module instanceof Module) { + dependency = this.chunkByModule.get(module); + if (dependency === this) + continue; + imported = dependency.getVariableExportName(variable); + needsLiveBinding = variable.isReassigned; + } + else { + dependency = module; + imported = variable.name; + if (imported !== 'default' && imported !== '*' && interop(module.id) === 'defaultOnly') { + return error(errUnexpectedNamedImport(module.id, imported, true)); + } + needsLiveBinding = + externalLiveBindings && + (imported !== 'default' || isDefaultAProperty(String(interop(module.id)), true)); + } + } + getOrCreate(reexportSpecifiers, dependency, () => []).push({ + imported, + needsLiveBinding, + reexported: exportName + }); + } + return reexportSpecifiers; + } + getReferencedFiles() { + const referencedFiles = []; + for (const module of this.orderedModules) { + for (const meta of module.importMetas) { + const fileName = meta.getReferencedFileName(this.pluginDriver); + if (fileName) { + referencedFiles.push(fileName); + } + } + } + return referencedFiles; } inlineChunkDependencies(chunk) { for (const dep of chunk.dependencies) { if (this.dependencies.has(dep)) continue; this.dependencies.add(dep); - if (dep instanceof Chunk$1) { + if (dep instanceof Chunk) { this.inlineChunkDependencies(dep); } } } - prepareDynamicImports() { + prepareModulesForRendering(snippets) { + var _a; + const accessedGlobalsByScope = this.accessedGlobalsByScope; for (const module of this.orderedModules) { for (const { node, resolution } of module.dynamicImports) { - if (!node.included) - continue; - if (resolution instanceof Module) { - const chunk = this.chunkByModule.get(resolution); - if (chunk === this) { - node.setInternalResolution(resolution.namespace); + if (node.included) { + if (resolution instanceof Module) { + const chunk = this.chunkByModule.get(resolution); + if (chunk === this) { + node.setInternalResolution(resolution.namespace); + } + else { + node.setExternalResolution(((_a = this.facadeChunkByModule.get(resolution)) === null || _a === void 0 ? void 0 : _a.exportMode) || chunk.exportMode, resolution, this.outputOptions, snippets, this.pluginDriver, accessedGlobalsByScope); + } } else { - node.setExternalResolution(chunk.exportMode, resolution); + node.setExternalResolution('external', resolution, this.outputOptions, snippets, this.pluginDriver, accessedGlobalsByScope); } } - else { - node.setExternalResolution('auto', resolution); - } + } + for (const importMeta of module.importMetas) { + importMeta.addAccessedGlobals(this.outputOptions.format, accessedGlobalsByScope); + } + if (this.includedNamespaces.has(module) && !this.outputOptions.preserveModules) { + module.namespace.prepare(accessedGlobalsByScope); } } } @@ -11342,15 +15348,12 @@ class Chunk$1 { } } } - setIdentifierRenderResolutions(options) { + setIdentifierRenderResolutions({ format, interop, namespaceToStringTag }) { const syntheticExports = new Set(); for (const exportName of this.getExportNames()) { - const exportVariable = this.exportsByName[exportName]; - if (exportVariable instanceof ExportShimVariable) { - this.needsExportsShim = true; - } - if (options.format !== 'es' && - options.format !== 'system' && + const exportVariable = this.exportsByName.get(exportName); + if (format !== 'es' && + format !== 'system' && exportVariable.isReassigned && !exportVariable.isId) { exportVariable.setRenderNames('exports', exportName); @@ -11362,34 +15365,45 @@ class Chunk$1 { exportVariable.setRenderNames(null, null); } } - const usedNames = new Set(); + for (const module of this.orderedModules) { + if (module.needsExportShim) { + this.needsExportsShim = true; + break; + } + } + const usedNames = new Set(['Object', 'Promise']); if (this.needsExportsShim) { usedNames.add(MISSING_EXPORT_SHIM_VARIABLE); } - switch (options.format) { + if (namespaceToStringTag) { + usedNames.add('Symbol'); + } + switch (format) { + case 'system': + usedNames.add('module').add('exports'); + break; case 'es': break; case 'cjs': - usedNames.add(INTEROP_DEFAULT_VARIABLE).add('require').add('__filename').add('__dirname'); - // fallthrough - case 'system': - usedNames.add('module'); + usedNames.add('module').add('require').add('__filename').add('__dirname'); // fallthrough default: usedNames.add('exports'); + for (const helper of HELPER_NAMES) { + usedNames.add(helper); + } } - deconflictChunk(this.orderedModules, this.dependencies, this.imports, usedNames, options.format, options.interop, this.outputOptions.preserveModules, this.chunkByModule, syntheticExports, this.exportNamesByVariable); + deconflictChunk(this.orderedModules, this.getDependenciesToBeDeconflicted(format !== 'es' && format !== 'system', format === 'amd' || format === 'umd' || format === 'iife', interop), this.imports, usedNames, format, interop, this.outputOptions.preserveModules, this.outputOptions.externalLiveBindings, this.chunkByModule, syntheticExports, this.exportNamesByVariable, this.accessedGlobalsByScope, this.includedNamespaces); } setUpChunkImportsAndExportsForModule(module) { - const moduleImports = new Set(module.imports); + const moduleImports = new Set(module.includedImports); // when we are not preserving modules, we need to make all namespace variables available for // rendering the namespace object if (!this.outputOptions.preserveModules) { - const namespace = module.namespace; - if (namespace.included) { - const memberVariables = namespace.getMemberVariables(); - for (const name of Object.keys(memberVariables)) { - moduleImports.add(memberVariables[name]); + if (this.includedNamespaces.has(module)) { + const memberVariables = module.namespace.getMemberVariables(); + for (const variable of Object.values(memberVariables)) { + moduleImports.add(variable); } } } @@ -11406,11 +15420,12 @@ class Chunk$1 { if (!(variable instanceof NamespaceVariable && this.outputOptions.preserveModules) && variable.module instanceof Module) { chunk.exports.add(variable); + this.checkCircularDependencyImport(variable, module); } } } - if (module.namespace.included || - (module.isEntryPoint && module.preserveSignature !== false) || + if (this.includedNamespaces.has(module) || + (module.info.isEntry && module.preserveSignature !== false) || module.includedDynamicImporters.some(importer => this.chunkByModule.get(importer) !== this)) { this.ensureReexportsAreAvailableForModule(module); } @@ -11418,13 +15433,18 @@ class Chunk$1 { if (node.included && resolution instanceof Module && this.chunkByModule.get(resolution) === this && - !resolution.namespace.included) { - resolution.namespace.include(); + !this.includedNamespaces.has(resolution)) { + this.includedNamespaces.add(resolution); this.ensureReexportsAreAvailableForModule(resolution); } } } } +function getChunkNameFromModule(module) { + var _a, _b, _c, _d; + return ((_d = (_b = (_a = module.chunkNames.find(({ isUserDefined }) => isUserDefined)) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : (_c = module.chunkNames[0]) === null || _c === void 0 ? void 0 : _c.name) !== null && _d !== void 0 ? _d : getAliasName(module.id)); +} +const QUERY_HASH_REGEX = /[?#]/; const concatSep = (out, next) => (next ? `${out}\n${next}` : out); const concatDblSep = (out, next) => (next ? `${out}\n\n${next}` : out); @@ -11444,7 +15464,7 @@ async function createAddons(options, outputPluginDriver) { banner += '\n'; if (footer.length) footer = '\n' + footer; - return { intro, outro, banner, footer }; + return { banner, footer, intro, outro }; } catch (err) { return error({ @@ -11474,7 +15494,7 @@ function getChunkAssignments(entryModules, manualChunkAliasByEntry) { function assignEntryToStaticDependencies(entry, dynamicDependentEntryPoints) { const modulesToHandle = new Set([entry]); for (const module of modulesToHandle) { - const assignedEntryPoints = getDependentModules(assignedEntryPointsByModule, module); + const assignedEntryPoints = getOrCreate(assignedEntryPointsByModule, module, () => new Set()); if (dynamicDependentEntryPoints && areEntryPointsContainedOrDynamicallyDependent(dynamicDependentEntryPoints, dependentEntryPointsByModule.get(module))) { continue; @@ -11535,7 +15555,7 @@ function analyzeModuleGraph(entryModules) { for (const currentEntry of entriesToHandle) { const modulesToHandle = new Set([currentEntry]); for (const module of modulesToHandle) { - getDependentModules(dependentEntryPointsByModule, module).add(currentEntry); + getOrCreate(dependentEntryPointsByModule, module, () => new Set()).add(currentEntry); for (const dependency of module.getDependenciesToBeIncluded()) { if (!(dependency instanceof ExternalModule)) { modulesToHandle.add(dependency); @@ -11555,15 +15575,10 @@ function analyzeModuleGraph(entryModules) { } return { dependentEntryPointsByModule, dynamicEntryModules }; } -function getDependentModules(moduleMap, module) { - const dependentModules = moduleMap.get(module) || new Set(); - moduleMap.set(module, dependentModules); - return dependentModules; -} function getDynamicDependentEntryPoints(dependentEntryPointsByModule, dynamicEntryModules) { const dynamicallyDependentEntryPointsByDynamicEntry = new Map(); for (const dynamicEntry of dynamicEntryModules) { - const dynamicDependentEntryPoints = getDependentModules(dynamicallyDependentEntryPointsByDynamicEntry, dynamicEntry); + const dynamicDependentEntryPoints = getOrCreate(dynamicallyDependentEntryPointsByDynamicEntry, dynamicEntry, () => new Set()); for (const importer of [ ...dynamicEntry.includedDynamicImporters, ...dynamicEntry.implicitlyLoadedAfter @@ -11590,9 +15605,9 @@ function createChunks(allEntryPoints, assignedEntryPointsByModule) { chunkModules[chunkSignature] = [module]; } } - return Object.keys(chunkModules).map(chunkSignature => ({ + return Object.values(chunkModules).map(modules => ({ alias: null, - modules: chunkModules[chunkSignature] + modules })); } @@ -11614,249 +15629,134 @@ function commondir(files) { return commonSegments.length > 1 ? commonSegments.join('/') : '/'; } -var BuildPhase; -(function (BuildPhase) { - BuildPhase[BuildPhase["LOAD_AND_PARSE"] = 0] = "LOAD_AND_PARSE"; - BuildPhase[BuildPhase["ANALYSE"] = 1] = "ANALYSE"; - BuildPhase[BuildPhase["GENERATE"] = 2] = "GENERATE"; -})(BuildPhase || (BuildPhase = {})); - -function generateAssetFileName(name, source, output) { - const emittedName = name || 'asset'; - return makeUnique(renderNamePattern(output.assetFileNames, 'output.assetFileNames', { - hash() { - const hash = createHash(); - hash.update(emittedName); - hash.update(':'); - hash.update(source); - return hash.digest('hex').substr(0, 8); - }, - ext: () => extname(emittedName).substr(1), - extname: () => extname(emittedName), - name: () => emittedName.substr(0, emittedName.length - extname(emittedName).length) - }), output.bundle); -} -function reserveFileNameInBundle(fileName, bundle, warn) { - if (fileName in bundle) { - warn(errFileNameConflict(fileName)); - } - bundle[fileName] = FILE_PLACEHOLDER; -} -const FILE_PLACEHOLDER = { - type: 'placeholder' -}; -function hasValidType(emittedFile) { - return (emittedFile && - (emittedFile.type === 'asset' || - emittedFile.type === 'chunk')); -} -function hasValidName(emittedFile) { - const validatedName = emittedFile.fileName || emittedFile.name; - return (!validatedName || (typeof validatedName === 'string' && isPlainPathFragment(validatedName))); -} -function getValidSource(source, emittedFile, fileReferenceId) { - if (!(typeof source === 'string' || source instanceof Uint8Array)) { - const assetName = emittedFile.fileName || emittedFile.name || fileReferenceId; - return error(errFailedValidation(`Could not set source for ${typeof assetName === 'string' ? `asset "${assetName}"` : 'unnamed asset'}, asset source needs to be a string, Uint8Array or Buffer.`)); - } - return source; -} -function getAssetFileName(file, referenceId) { - if (typeof file.fileName !== 'string') { - return error(errAssetNotFinalisedForFileName(file.name || referenceId)); - } - return file.fileName; -} -function getChunkFileName(file, facadeChunkByModule) { - var _a; - const fileName = file.fileName || (file.module && ((_a = facadeChunkByModule === null || facadeChunkByModule === void 0 ? void 0 : facadeChunkByModule.get(file.module)) === null || _a === void 0 ? void 0 : _a.id)); - if (!fileName) - return error(errChunkNotGeneratedForFileName(file.fileName || file.name)); - return fileName; +const compareExecIndex = (unitA, unitB) => unitA.execIndex > unitB.execIndex ? 1 : -1; +function sortByExecutionOrder(units) { + units.sort(compareExecIndex); } -class FileEmitter { - constructor(graph, options, baseFileEmitter) { - this.graph = graph; - this.options = options; - this.facadeChunkByModule = null; - this.output = null; - this.assertAssetsFinalized = () => { - for (const [referenceId, emittedFile] of this.filesByReferenceId.entries()) { - if (emittedFile.type === 'asset' && typeof emittedFile.fileName !== 'string') - return error(errNoAssetSourceSet(emittedFile.name || referenceId)); - } - }; - this.emitFile = (emittedFile) => { - if (!hasValidType(emittedFile)) { - return error(errFailedValidation(`Emitted files must be of type "asset" or "chunk", received "${emittedFile && emittedFile.type}".`)); - } - if (!hasValidName(emittedFile)) { - return error(errFailedValidation(`The "fileName" or "name" properties of emitted files must be strings that are neither absolute nor relative paths and do not contain invalid characters, received "${emittedFile.fileName || emittedFile.name}".`)); - } - if (emittedFile.type === 'chunk') { - return this.emitChunk(emittedFile); - } - else { - return this.emitAsset(emittedFile); - } - }; - this.getFileName = (fileReferenceId) => { - const emittedFile = this.filesByReferenceId.get(fileReferenceId); - if (!emittedFile) - return error(errFileReferenceIdNotFoundForFilename(fileReferenceId)); - if (emittedFile.type === 'chunk') { - return getChunkFileName(emittedFile, this.facadeChunkByModule); - } - else { - return getAssetFileName(emittedFile, fileReferenceId); - } - }; - this.setAssetSource = (referenceId, requestedSource) => { - const consumedFile = this.filesByReferenceId.get(referenceId); - if (!consumedFile) - return error(errAssetReferenceIdNotFoundForSetSource(referenceId)); - if (consumedFile.type !== 'asset') { - return error(errFailedValidation(`Asset sources can only be set for emitted assets but "${referenceId}" is an emitted chunk.`)); - } - if (consumedFile.source !== undefined) { - return error(errAssetSourceAlreadySet(consumedFile.name || referenceId)); - } - const source = getValidSource(requestedSource, consumedFile, referenceId); - if (this.output) { - this.finalizeAsset(consumedFile, source, referenceId, this.output); - } - else { - consumedFile.source = source; - } - }; - this.setOutputBundle = (outputBundle, assetFileNames, facadeChunkByModule) => { - this.output = { - assetFileNames, - bundle: outputBundle - }; - this.facadeChunkByModule = facadeChunkByModule; - for (const emittedFile of this.filesByReferenceId.values()) { - if (emittedFile.fileName) { - reserveFileNameInBundle(emittedFile.fileName, this.output.bundle, this.options.onwarn); - } - } - for (const [referenceId, consumedFile] of this.filesByReferenceId.entries()) { - if (consumedFile.type === 'asset' && consumedFile.source !== undefined) { - this.finalizeAsset(consumedFile, consumedFile.source, referenceId, this.output); +function analyseModuleExecution(entryModules) { + let nextExecIndex = 0; + const cyclePaths = []; + const analysedModules = new Set(); + const dynamicImports = new Set(); + const parents = new Map(); + const orderedModules = []; + const analyseModule = (module) => { + if (module instanceof Module) { + for (const dependency of module.dependencies) { + if (parents.has(dependency)) { + if (!analysedModules.has(dependency)) { + cyclePaths.push(getCyclePath(dependency, module, parents)); + } + continue; } + parents.set(dependency, module); + analyseModule(dependency); } - }; - this.filesByReferenceId = baseFileEmitter - ? new Map(baseFileEmitter.filesByReferenceId) - : new Map(); - } - assignReferenceId(file, idBase) { - let referenceId; - do { - const hash = createHash(); - if (referenceId) { - hash.update(referenceId); - } - else { - hash.update(idBase); - } - referenceId = hash.digest('hex').substr(0, 8); - } while (this.filesByReferenceId.has(referenceId)); - this.filesByReferenceId.set(referenceId, file); - return referenceId; - } - emitAsset(emittedAsset) { - const source = typeof emittedAsset.source !== 'undefined' - ? getValidSource(emittedAsset.source, emittedAsset, null) - : undefined; - const consumedAsset = { - fileName: emittedAsset.fileName, - name: emittedAsset.name, - source, - type: 'asset' - }; - const referenceId = this.assignReferenceId(consumedAsset, emittedAsset.fileName || emittedAsset.name || emittedAsset.type); - if (this.output) { - if (emittedAsset.fileName) { - reserveFileNameInBundle(emittedAsset.fileName, this.output.bundle, this.options.onwarn); + for (const dependency of module.implicitlyLoadedBefore) { + dynamicImports.add(dependency); } - if (source !== undefined) { - this.finalizeAsset(consumedAsset, source, referenceId, this.output); + for (const { resolution } of module.dynamicImports) { + if (resolution instanceof Module) { + dynamicImports.add(resolution); + } } + orderedModules.push(module); } - return referenceId; - } - emitChunk(emittedChunk) { - if (this.graph.phase > BuildPhase.LOAD_AND_PARSE) { - return error(errInvalidRollupPhaseForChunkEmission()); - } - if (typeof emittedChunk.id !== 'string') { - return error(errFailedValidation(`Emitted chunks need to have a valid string id, received "${emittedChunk.id}"`)); + module.execIndex = nextExecIndex++; + analysedModules.add(module); + }; + for (const curEntry of entryModules) { + if (!parents.has(curEntry)) { + parents.set(curEntry, null); + analyseModule(curEntry); } - const consumedChunk = { - fileName: emittedChunk.fileName, - module: null, - name: emittedChunk.name || emittedChunk.id, - type: 'chunk' - }; - this.graph.moduleLoader - .emitChunk(emittedChunk) - .then(module => (consumedChunk.module = module)) - .catch(() => { - // Avoid unhandled Promise rejection as the error will be thrown later - // once module loading has finished - }); - return this.assignReferenceId(consumedChunk, emittedChunk.id); } - finalizeAsset(consumedFile, source, referenceId, output) { - const fileName = consumedFile.fileName || - findExistingAssetFileNameWithSource(output.bundle, source) || - generateAssetFileName(consumedFile.name, source, output); - // We must not modify the original assets to avoid interaction between outputs - const assetWithFileName = { ...consumedFile, source, fileName }; - this.filesByReferenceId.set(referenceId, assetWithFileName); - const options = this.options; - output.bundle[fileName] = { - fileName, - get isAsset() { - warnDeprecation('Accessing "isAsset" on files in the bundle is deprecated, please use "type === \'asset\'" instead', true, options); - return true; - }, - source, - type: 'asset' - }; + for (const curEntry of dynamicImports) { + if (!parents.has(curEntry)) { + parents.set(curEntry, null); + analyseModule(curEntry); + } } + return { cyclePaths, orderedModules }; } -function findExistingAssetFileNameWithSource(bundle, source) { - for (const fileName of Object.keys(bundle)) { - const outputFile = bundle[fileName]; - if (outputFile.type === 'asset' && areSourcesEqual(source, outputFile.source)) - return fileName; +function getCyclePath(module, parent, parents) { + const cycleSymbol = Symbol(module.id); + const path = [relativeId(module.id)]; + let nextModule = parent; + module.cycles.add(cycleSymbol); + while (nextModule !== module) { + nextModule.cycles.add(cycleSymbol); + path.push(relativeId(nextModule.id)); + nextModule = parents.get(nextModule); } - return null; + path.push(path[0]); + path.reverse(); + return path; } -function areSourcesEqual(sourceA, sourceB) { - if (typeof sourceA === 'string') { - return sourceA === sourceB; - } - if (typeof sourceB === 'string') { - return false; - } - if ('equals' in sourceA) { - return sourceA.equals(sourceB); - } - if (sourceA.length !== sourceB.length) { - return false; - } - for (let index = 0; index < sourceA.length; index++) { - if (sourceA[index] !== sourceB[index]) { - return false; - } - } - return true; + +function getGenerateCodeSnippets({ compact, generatedCode: { arrowFunctions, constBindings, objectShorthand, reservedNamesAsProps } }) { + const { _, n, s } = compact ? { _: '', n: '', s: '' } : { _: ' ', n: '\n', s: ';' }; + const cnst = constBindings ? 'const' : 'var'; + const getNonArrowFunctionIntro = (params, { isAsync, name }) => `${isAsync ? `async ` : ''}function${name ? ` ${name}` : ''}${_}(${params.join(`,${_}`)})${_}`; + const getFunctionIntro = arrowFunctions + ? (params, { isAsync, name }) => { + const singleParam = params.length === 1; + const asyncString = isAsync ? `async${singleParam ? ' ' : _}` : ''; + return `${name ? `${cnst} ${name}${_}=${_}` : ''}${asyncString}${singleParam ? params[0] : `(${params.join(`,${_}`)})`}${_}=>${_}`; + } + : getNonArrowFunctionIntro; + const getDirectReturnFunction = (params, { functionReturn, lineBreakIndent, name }) => [ + `${getFunctionIntro(params, { + isAsync: false, + name + })}${arrowFunctions + ? lineBreakIndent + ? `${n}${lineBreakIndent.base}${lineBreakIndent.t}` + : '' + : `{${lineBreakIndent ? `${n}${lineBreakIndent.base}${lineBreakIndent.t}` : _}${functionReturn ? 'return ' : ''}`}`, + arrowFunctions + ? `${name ? ';' : ''}${lineBreakIndent ? `${n}${lineBreakIndent.base}` : ''}` + : `${s}${lineBreakIndent ? `${n}${lineBreakIndent.base}` : _}}` + ]; + const isValidPropName = reservedNamesAsProps + ? (name) => validPropName.test(name) + : (name) => !RESERVED_NAMES$1.has(name) && validPropName.test(name); + return { + _, + cnst, + getDirectReturnFunction, + getDirectReturnIifeLeft: (params, returned, { needsArrowReturnParens, needsWrappedFunction }) => { + const [left, right] = getDirectReturnFunction(params, { + functionReturn: true, + lineBreakIndent: null, + name: null + }); + return `${wrapIfNeeded(`${left}${wrapIfNeeded(returned, arrowFunctions && needsArrowReturnParens)}${right}`, arrowFunctions || needsWrappedFunction)}(`; + }, + getFunctionIntro, + getNonArrowFunctionIntro, + getObject(fields, { lineBreakIndent }) { + const prefix = lineBreakIndent ? `${n}${lineBreakIndent.base}${lineBreakIndent.t}` : _; + return `{${fields + .map(([key, value]) => { + if (key === null) + return `${prefix}${value}`; + const needsQuotes = !isValidPropName(key); + return key === value && objectShorthand && !needsQuotes + ? prefix + key + : `${prefix}${needsQuotes ? `'${key}'` : key}:${_}${value}`; + }) + .join(`,`)}${fields.length === 0 ? '' : lineBreakIndent ? `${n}${lineBreakIndent.base}` : _}}`; + }, + getPropertyAccess: (name) => isValidPropName(name) ? `.${name}` : `[${JSON.stringify(name)}]`, + n, + s + }; } +const wrapIfNeeded = (code, needsParens) => needsParens ? `(${code})` : code; +const validPropName = /^(?!\d)[\w$]+$/; -class Bundle$1 { +class Bundle { constructor(outputOptions, unsetOptions, inputOptions, pluginDriver, graph) { this.outputOptions = outputOptions; this.unsetOptions = unsetOptions; @@ -11864,17 +15764,19 @@ class Bundle$1 { this.pluginDriver = pluginDriver; this.graph = graph; this.facadeChunkByModule = new Map(); + this.includedNamespaces = new Set(); } async generate(isWrite) { timeStart('GENERATE', 1); - const outputBundle = Object.create(null); - this.pluginDriver.setOutputBundle(outputBundle, this.outputOptions.assetFileNames, this.facadeChunkByModule); + const outputBundleBase = Object.create(null); + const outputBundle = getOutputBundle(outputBundleBase); + this.pluginDriver.setOutputBundle(outputBundle, this.outputOptions, this.facadeChunkByModule); try { await this.pluginDriver.hookParallel('renderStart', [this.outputOptions, this.inputOptions]); timeStart('generate chunks', 2); const chunks = await this.generateChunks(); if (chunks.length > 1) { - validateOptionsForMultiChunkOutput(this.outputOptions); + validateOptionsForMultiChunkOutput(this.outputOptions, this.inputOptions.onwarn); } const inputBase = commondir(getAbsoluteEntryModulePaths(chunks)); timeEnd('generate chunks', 2); @@ -11882,13 +15784,14 @@ class Bundle$1 { // We need to create addons before prerender because at the moment, there // can be no async code between prerender and render due to internal state const addons = await createAddons(this.outputOptions, this.pluginDriver); - this.prerenderChunks(chunks, inputBase); + const snippets = getGenerateCodeSnippets(this.outputOptions); + this.prerenderChunks(chunks, inputBase, snippets); timeEnd('render modules', 2); - await this.addFinalizedChunksToBundle(chunks, inputBase, addons, outputBundle); + await this.addFinalizedChunksToBundle(chunks, inputBase, addons, outputBundle, snippets); } - catch (error) { - await this.pluginDriver.hookParallel('renderError', [error]); - throw error; + catch (err) { + await this.pluginDriver.hookParallel('renderError', [err]); + throw err; } await this.pluginDriver.hookSeq('generateBundle', [ this.outputOptions, @@ -11897,29 +15800,23 @@ class Bundle$1 { ]); this.finaliseAssets(outputBundle); timeEnd('GENERATE', 1); - return outputBundle; + return outputBundleBase; } - async addFinalizedChunksToBundle(chunks, inputBase, addons, outputBundle) { - this.assignChunkIds(chunks, inputBase, addons, outputBundle); + async addFinalizedChunksToBundle(chunks, inputBase, addons, bundle, snippets) { + this.assignChunkIds(chunks, inputBase, addons, bundle); for (const chunk of chunks) { - const chunkDescription = (outputBundle[chunk.id] = chunk.getPrerenderedChunk()); - chunkDescription.fileName = chunk.id; - } - await Promise.all(chunks.map(chunk => { - const outputChunk = outputBundle[chunk.id]; - return chunk - .render(this.outputOptions, addons, outputChunk, this.pluginDriver) - .then(rendered => { - outputChunk.code = rendered.code; - outputChunk.map = rendered.map; - }); + bundle[chunk.id] = chunk.getChunkInfoWithFileNames(); + } + await Promise.all(chunks.map(async (chunk) => { + const outputChunk = bundle[chunk.id]; + Object.assign(outputChunk, await chunk.render(this.outputOptions, addons, outputChunk, snippets)); })); } async addManualChunks(manualChunks) { const manualChunkAliasByEntry = new Map(); - const chunkEntries = await Promise.all(Object.keys(manualChunks).map(async (alias) => ({ + const chunkEntries = await Promise.all(Object.entries(manualChunks).map(async ([alias, files]) => ({ alias, - entries: await this.graph.moduleLoader.addAdditionalModules(manualChunks[alias]) + entries: await this.graph.moduleLoader.addAdditionalModules(files) }))); for (const { alias, entries } of chunkEntries) { for (const entry of entries) { @@ -11946,13 +15843,13 @@ class Bundle$1 { chunk.id = chunk.generateIdPreserveModules(inputBase, this.outputOptions, bundle, this.unsetOptions); } else { - chunk.id = chunk.generateId(addons, this.outputOptions, bundle, true, this.pluginDriver); + chunk.id = chunk.generateId(addons, this.outputOptions, bundle, true); } bundle[chunk.id] = FILE_PLACEHOLDER; } } assignManualChunks(getManualChunk) { - const manualChunkAliasByEntry = new Map(); + const manualChunkAliasesWithEntry = []; const manualChunksApi = { getModuleIds: () => this.graph.modulesById.keys(), getModuleInfo: this.graph.getModuleInfo @@ -11961,19 +15858,34 @@ class Bundle$1 { if (module instanceof Module) { const manualChunkAlias = getManualChunk(module.id, manualChunksApi); if (typeof manualChunkAlias === 'string') { - addModuleToManualChunk(manualChunkAlias, module, manualChunkAliasByEntry); + manualChunkAliasesWithEntry.push([manualChunkAlias, module]); } } } + manualChunkAliasesWithEntry.sort(([aliasA], [aliasB]) => aliasA > aliasB ? 1 : aliasA < aliasB ? -1 : 0); + const manualChunkAliasByEntry = new Map(); + for (const [alias, module] of manualChunkAliasesWithEntry) { + addModuleToManualChunk(alias, module, manualChunkAliasByEntry); + } return manualChunkAliasByEntry; } finaliseAssets(outputBundle) { - for (const key of Object.keys(outputBundle)) { - const file = outputBundle[key]; + for (const file of Object.values(outputBundle)) { if (!file.type) { warnDeprecation('A plugin is directly adding properties to the bundle object in the "generateBundle" hook. This is deprecated and will be removed in a future Rollup version, please use "this.emitFile" instead.', true, this.inputOptions); file.type = 'asset'; } + if (this.outputOptions.validate && 'code' in file) { + try { + this.graph.contextParse(file.code, { + allowHashBang: true, + ecmaVersion: 'latest' + }); + } + catch (err) { + this.inputOptions.onwarn(errChunkInvalid(file, err)); + } + } } this.pluginDriver.finaliseAssets(); } @@ -11993,7 +15905,7 @@ class Bundle$1 { })) : getChunkAssignments(this.graph.entryModules, manualChunkAliasByEntry)) { sortByExecutionOrder(modules); - const chunk = new Chunk$1(modules, this.inputOptions, this.outputOptions, this.unsetOptions, this.graph.modulesById, chunkByModule, this.facadeChunkByModule, alias); + const chunk = new Chunk(modules, this.inputOptions, this.outputOptions, this.unsetOptions, this.pluginDriver, this.graph.modulesById, chunkByModule, this.facadeChunkByModule, this.includedNamespaces, alias); chunks.push(chunk); for (const module of modules) { chunkByModule.set(module, chunk); @@ -12008,12 +15920,12 @@ class Bundle$1 { } return [...chunks, ...facades]; } - prerenderChunks(chunks, inputBase) { + prerenderChunks(chunks, inputBase, snippets) { for (const chunk of chunks) { chunk.generateExports(); } for (const chunk of chunks) { - chunk.preRender(this.outputOptions, inputBase, this.pluginDriver); + chunk.preRender(this.outputOptions, inputBase, snippets); } } } @@ -12028,27 +15940,19 @@ function getAbsoluteEntryModulePaths(chunks) { } return absoluteEntryModulePaths; } -function validateOptionsForMultiChunkOutput(outputOptions) { +function validateOptionsForMultiChunkOutput(outputOptions, onWarn) { if (outputOptions.format === 'umd' || outputOptions.format === 'iife') - return error({ - code: 'INVALID_OPTION', - message: 'UMD and IIFE output formats are not supported for code-splitting builds.' - }); + return error(errInvalidOption('output.format', 'outputformat', 'UMD and IIFE output formats are not supported for code-splitting builds', outputOptions.format)); if (typeof outputOptions.file === 'string') - return error({ - code: 'INVALID_OPTION', - message: 'When building multiple chunks, the "output.dir" option must be used, not "output.file". ' + - 'To inline dynamic imports, set the "inlineDynamicImports" option.' - }); + return error(errInvalidOption('output.file', 'outputdir', 'when building multiple chunks, the "output.dir" option must be used, not "output.file". To inline dynamic imports, set the "inlineDynamicImports" option')); if (outputOptions.sourcemapFile) - return error({ - code: 'INVALID_OPTION', - message: '"output.sourcemapFile" is only supported for single-file builds.' - }); + return error(errInvalidOption('output.sourcemapFile', 'outputsourcemapfile', '"output.sourcemapFile" is only supported for single-file builds')); + if (!outputOptions.amd.autoId && outputOptions.amd.id) + onWarn(errInvalidOption('output.amd.id', 'outputamd', 'this option is only properly supported for single-file builds. Use "output.amd.autoId" and "output.amd.basePath" instead')); } function getIncludedModules(modulesById) { - return [...modulesById.values()].filter(module => module instanceof Module && - (module.isIncluded() || module.isEntryPoint || module.includedDynamicImporters.length > 0)); + return [...modulesById.values()].filter((module) => module instanceof Module && + (module.isIncluded() || module.info.isEntry || module.includedDynamicImporters.length > 0)); } function addModuleToManualChunk(alias, module, manualChunkAliasByEntry) { const existingAlias = manualChunkAliasByEntry.get(module); @@ -12058,9 +15962,23 @@ function addModuleToManualChunk(alias, module, manualChunkAliasByEntry) { manualChunkAliasByEntry.set(module, alias); } +// This file was generated. Do not modify manually! +var astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 370, 1, 154, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 161, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 193, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 406, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 19306, 9, 87, 9, 39, 4, 60, 6, 26, 9, 1014, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4706, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 262, 6, 10, 9, 357, 0, 62, 13, 1495, 6, 110, 6, 6, 9, 4759, 9, 787719, 239]; + +// This file was generated. Do not modify manually! +var astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 68, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 349, 41, 7, 1, 79, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 85, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 159, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 264, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 190, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1070, 4050, 582, 8634, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 689, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 43, 8, 8936, 3, 2, 6, 2, 1, 2, 290, 46, 2, 18, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 30, 482, 44, 11, 6, 17, 0, 322, 29, 19, 43, 1269, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4152, 8, 221, 3, 5761, 15, 7472, 3104, 541, 1507, 4938]; + +// This file was generated. Do not modify manually! +var nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u0898-\u089f\u08ca-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b55-\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3c\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d81-\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u180f-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1abf-\u1ace\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf4\u1cf7-\u1cf9\u1dc0-\u1dff\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua82c\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f"; + +// This file was generated. Do not modify manually! +var nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u0870-\u0887\u0889-\u088e\u08a0-\u08c9\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c5d\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cdd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d04-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u1711\u171f-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4c\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c88\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31bf\u31f0-\u31ff\u3400-\u4dbf\u4e00-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7ca\ua7d0\ua7d1\ua7d3\ua7d5-\ua7d9\ua7f2-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab69\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc"; + +// These are a run-length and offset encoded representation of the + // Reserved word lists for various dialects of the language -var reservedWords$1 = { +var reservedWords = { 3: "abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile", 5: "class enum extends super const export import", 6: "enum", @@ -12072,7 +15990,7 @@ var reservedWords$1 = { var ecma5AndLessKeywords = "break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this"; -var keywords = { +var keywords$1 = { 5: ecma5AndLessKeywords, "5module": ecma5AndLessKeywords + " export import", 6: ecma5AndLessKeywords + " const class extends export import super" @@ -12082,31 +16000,9 @@ var keywordRelationalOperator = /^in(stanceof)?$/; // ## Character categories -// Big ugly regular expressions that match characters in the -// whitespace, identifier, and identifier-start categories. These -// are only applied when a character is found to actually have a -// code point above 128. -// Generated by `bin/generate-identifier-regex.js`. -var nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u08a0-\u08b4\u08b6-\u08c7\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d04-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c88\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31bf\u31f0-\u31ff\u3400-\u4dbf\u4e00-\u9ffc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7bf\ua7c2-\ua7ca\ua7f5-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab69\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc"; -var nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08d3-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b55-\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d81-\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1abf\u1ac0\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf4\u1cf7-\u1cf9\u1dc0-\u1df9\u1dfb-\u1dff\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua82c\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f"; - var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]"); var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]"); -nonASCIIidentifierStartChars = nonASCIIidentifierChars = null; - -// These are a run-length and offset encoded representation of the -// >0xffff code points that are a valid part of identifiers. The -// offset starts at 0x10000, and each pair of numbers represents an -// offset to the next range, and then a size of the range. They were -// generated by bin/generate-identifier-regex.js - -// eslint-disable-next-line comma-spacing -var astralIdentifierStartCodes = [0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,157,310,10,21,11,7,153,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,107,20,28,22,13,52,76,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,85,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,230,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,35,56,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,190,0,80,921,103,110,18,195,2749,1070,4050,582,8634,568,8,30,114,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8952,286,50,2,18,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,2357,44,11,6,17,0,370,43,1301,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42717,35,4148,12,221,3,5761,15,7472,3104,541,1507,4938]; - -// eslint-disable-next-line comma-spacing -var astralIdentifierCodes = [509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,154,10,176,2,54,14,32,9,16,3,46,10,54,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,161,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,19306,9,135,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,5319,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,262,6,10,9,419,13,1495,6,110,6,6,9,4759,9,787719,239]; - // This has a complexity linear to the value of the code. The // assumption is that looking up astral identifier characters is // rare. @@ -12191,21 +16087,22 @@ var beforeExpr = {beforeExpr: true}, startsExpr = {startsExpr: true}; // Map keyword names to token types. -var keywords$1 = {}; +var keywords = {}; // Succinct definitions of keyword token types function kw(name, options) { if ( options === void 0 ) options = {}; options.keyword = name; - return keywords$1[name] = new TokenType(name, options) + return keywords[name] = new TokenType(name, options) } -var types = { +var types$1 = { num: new TokenType("num", startsExpr), regexp: new TokenType("regexp", startsExpr), string: new TokenType("string", startsExpr), name: new TokenType("name", startsExpr), + privateId: new TokenType("privateId", startsExpr), eof: new TokenType("eof"), // Punctuation token types. @@ -12305,8 +16202,19 @@ var types = { var lineBreak = /\r\n?|\n|\u2028|\u2029/; var lineBreakG = new RegExp(lineBreak.source, "g"); -function isNewLine(code, ecma2019String) { - return code === 10 || code === 13 || (!ecma2019String && (code === 0x2028 || code === 0x2029)) +function isNewLine(code) { + return code === 10 || code === 13 || code === 0x2028 || code === 0x2029 +} + +function nextLineBreak(code, from, end) { + if ( end === void 0 ) end = code.length; + + for (var i = from; i < end; i++) { + var next = code.charCodeAt(i); + if (isNewLine(next)) + { return i < end - 1 && next === 13 && code.charCodeAt(i + 1) === 10 ? i + 2 : i + 1 } + } + return -1 } var nonASCIIwhitespace = /[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/; @@ -12315,22 +16223,29 @@ var skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g; var ref = Object.prototype; var hasOwnProperty = ref.hasOwnProperty; -var toString$1 = ref.toString; +var toString = ref.toString; -// Checks if an object has a property. - -function has(obj, propName) { - return hasOwnProperty.call(obj, propName) -} +var hasOwn = Object.hasOwn || (function (obj, propName) { return ( + hasOwnProperty.call(obj, propName) +); }); var isArray = Array.isArray || (function (obj) { return ( - toString$1.call(obj) === "[object Array]" + toString.call(obj) === "[object Array]" ); }); function wordsRegexp(words) { return new RegExp("^(?:" + words.replace(/ /g, "|") + ")$") } +function codePointToString(code) { + // UTF-16 Decoding + if (code <= 0xFFFF) { return String.fromCharCode(code) } + code -= 0x10000; + return String.fromCharCode((code >> 10) + 0xD800, (code & 1023) + 0xDC00) +} + +var loneSurrogate = /(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/; + // These are used when `options.locations` is on, for the // `startLoc` and `endLoc` properties. @@ -12357,27 +16272,24 @@ var SourceLocation = function SourceLocation(p, start, end) { function getLineInfo(input, offset) { for (var line = 1, cur = 0;;) { - lineBreakG.lastIndex = cur; - var match = lineBreakG.exec(input); - if (match && match.index < offset) { - ++line; - cur = match.index + match[0].length; - } else { - return new Position(line, offset - cur) - } + var nextBreak = nextLineBreak(input, cur, offset); + if (nextBreak < 0) { return new Position(line, offset - cur) } + ++line; + cur = nextBreak; } } -// A second optional argument can be given to further configure -// the parser process. These options are recognized: +// A second argument must be given to configure the parser process. +// These options are recognized (only `ecmaVersion` is required): var defaultOptions = { // `ecmaVersion` indicates the ECMAScript version to parse. Must be - // either 3, 5, 6 (2015), 7 (2016), 8 (2017), 9 (2018), or 10 - // (2019). This influences support for strict mode, the set of - // reserved words, and support for new syntax features. The default - // is 10. - ecmaVersion: 10, + // either 3, 5, 6 (or 2015), 7 (2016), 8 (2017), 9 (2018), 10 + // (2019), 11 (2020), 12 (2021), 13 (2022), or `"latest"` (the + // latest version the library supports). This influences support + // for strict mode, the set of reserved words, and support for + // new syntax features. + ecmaVersion: null, // `sourceType` indicates the mode the code should be parsed in. // Can be either `"script"` or `"module"`. This influences global // strict mode and parsing of `import` and `export` declarations. @@ -12400,11 +16312,16 @@ var defaultOptions = { // error. allowReturnOutsideFunction: false, // When enabled, import/export statements are not constrained to - // appearing at the top of the program. + // appearing at the top of the program, and an import.meta expression + // in a script isn't considered an error. allowImportExportEverywhere: false, + // By default, await identifiers are allowed to appear at the top-level scope only if ecmaVersion >= 2022. // When enabled, await identifiers are allowed to appear at the top-level scope, // but they are still not allowed in non-async functions. - allowAwaitOutsideFunction: false, + allowAwaitOutsideFunction: null, + // When enabled, super identifiers are not constrained to + // appearing in methods and do not raise an error when they appear elsewhere. + allowSuperOutsideMethod: null, // When enabled, hashbang directive in the beginning of file // is allowed and treated as a line comment. allowHashBang: false, @@ -12458,14 +16375,25 @@ var defaultOptions = { // Interpret and default an options object +var warnedAboutEcmaVersion = false; + function getOptions(opts) { var options = {}; for (var opt in defaultOptions) - { options[opt] = opts && has(opts, opt) ? opts[opt] : defaultOptions[opt]; } - - if (options.ecmaVersion >= 2015) - { options.ecmaVersion -= 2009; } + { options[opt] = opts && hasOwn(opts, opt) ? opts[opt] : defaultOptions[opt]; } + + if (options.ecmaVersion === "latest") { + options.ecmaVersion = 1e8; + } else if (options.ecmaVersion == null) { + if (!warnedAboutEcmaVersion && typeof console === "object" && console.warn) { + warnedAboutEcmaVersion = true; + console.warn("Since Acorn 8.0.0, options.ecmaVersion is required.\nDefaulting to 2020, but this will stop working in the future."); + } + options.ecmaVersion = 11; + } else if (options.ecmaVersion >= 2015) { + options.ecmaVersion -= 2009; + } if (options.allowReserved == null) { options.allowReserved = options.ecmaVersion < 5; } @@ -12500,19 +16428,20 @@ function pushComment(options, array) { var SCOPE_TOP = 1, SCOPE_FUNCTION = 2, - SCOPE_VAR = SCOPE_TOP | SCOPE_FUNCTION, SCOPE_ASYNC = 4, SCOPE_GENERATOR = 8, SCOPE_ARROW = 16, SCOPE_SIMPLE_CATCH = 32, SCOPE_SUPER = 64, - SCOPE_DIRECT_SUPER = 128; + SCOPE_DIRECT_SUPER = 128, + SCOPE_CLASS_STATIC_BLOCK = 256, + SCOPE_VAR = SCOPE_TOP | SCOPE_FUNCTION | SCOPE_CLASS_STATIC_BLOCK; function functionFlags(async, generator) { return SCOPE_FUNCTION | (async ? SCOPE_ASYNC : 0) | (generator ? SCOPE_GENERATOR : 0) } -// Used in checkLVal and declareName to determine the type of a binding +// Used in checkLVal* and declareName to determine the type of a binding var BIND_NONE = 0, // Not a binding BIND_VAR = 1, // Var-style binding @@ -12524,17 +16453,16 @@ var var Parser = function Parser(options, input, startPos) { this.options = options = getOptions(options); this.sourceFile = options.sourceFile; - this.keywords = wordsRegexp(keywords[options.ecmaVersion >= 6 ? 6 : options.sourceType === "module" ? "5module" : 5]); + this.keywords = wordsRegexp(keywords$1[options.ecmaVersion >= 6 ? 6 : options.sourceType === "module" ? "5module" : 5]); var reserved = ""; if (options.allowReserved !== true) { - for (var v = options.ecmaVersion;; v--) - { if (reserved = reservedWords$1[v]) { break } } + reserved = reservedWords[options.ecmaVersion >= 6 ? 6 : options.ecmaVersion === 5 ? 5 : 3]; if (options.sourceType === "module") { reserved += " await"; } } this.reservedWords = wordsRegexp(reserved); - var reservedStrict = (reserved ? reserved + " " : "") + reservedWords$1.strict; + var reservedStrict = (reserved ? reserved + " " : "") + reservedWords.strict; this.reservedWordsStrict = wordsRegexp(reservedStrict); - this.reservedWordsStrictBind = wordsRegexp(reservedStrict + " " + reservedWords$1.strictBind); + this.reservedWordsStrictBind = wordsRegexp(reservedStrict + " " + reservedWords.strictBind); this.input = String(input); // Used to signal to callers of `readWord1` whether the word @@ -12556,7 +16484,7 @@ var Parser = function Parser(options, input, startPos) { // Properties of the current token: // Its type - this.type = types.eof; + this.type = types$1.eof; // For tokens that include more information than their type, the value this.value = null; // Its start and end offset @@ -12581,13 +16509,14 @@ var Parser = function Parser(options, input, startPos) { // Used to signify the start of a potential arrow function this.potentialArrowAt = -1; + this.potentialArrowInForAwait = false; // Positions to delayed-check that yield/await does not exist in default parameters. this.yieldPos = this.awaitPos = this.awaitIdentPos = 0; // Labels in scope. this.labels = []; // Thus-far undefined exports. - this.undefinedExports = {}; + this.undefinedExports = Object.create(null); // If enabled, skip leading hashbang line. if (this.pos === 0 && options.allowHashBang && this.input.slice(0, 2) === "#!") @@ -12599,9 +16528,14 @@ var Parser = function Parser(options, input, startPos) { // For RegExp validation this.regexpState = null; + + // The stack of private names. + // Each element has two properties: 'declared' and 'used'. + // When it exited from the outermost class definition, all used private names must be declared. + this.privateNameStack = []; }; -var prototypeAccessors = { inFunction: { configurable: true },inGenerator: { configurable: true },inAsync: { configurable: true },allowSuper: { configurable: true },allowDirectSuper: { configurable: true },treatFunctionsAsVar: { configurable: true } }; +var prototypeAccessors = { inFunction: { configurable: true },inGenerator: { configurable: true },inAsync: { configurable: true },canAwait: { configurable: true },allowSuper: { configurable: true },allowDirectSuper: { configurable: true },treatFunctionsAsVar: { configurable: true },allowNewDotTarget: { configurable: true },inClassStaticBlock: { configurable: true } }; Parser.prototype.parse = function parse () { var node = this.options.program || this.startNode(); @@ -12610,14 +16544,41 @@ Parser.prototype.parse = function parse () { }; prototypeAccessors.inFunction.get = function () { return (this.currentVarScope().flags & SCOPE_FUNCTION) > 0 }; -prototypeAccessors.inGenerator.get = function () { return (this.currentVarScope().flags & SCOPE_GENERATOR) > 0 }; -prototypeAccessors.inAsync.get = function () { return (this.currentVarScope().flags & SCOPE_ASYNC) > 0 }; -prototypeAccessors.allowSuper.get = function () { return (this.currentThisScope().flags & SCOPE_SUPER) > 0 }; + +prototypeAccessors.inGenerator.get = function () { return (this.currentVarScope().flags & SCOPE_GENERATOR) > 0 && !this.currentVarScope().inClassFieldInit }; + +prototypeAccessors.inAsync.get = function () { return (this.currentVarScope().flags & SCOPE_ASYNC) > 0 && !this.currentVarScope().inClassFieldInit }; + +prototypeAccessors.canAwait.get = function () { + for (var i = this.scopeStack.length - 1; i >= 0; i--) { + var scope = this.scopeStack[i]; + if (scope.inClassFieldInit || scope.flags & SCOPE_CLASS_STATIC_BLOCK) { return false } + if (scope.flags & SCOPE_FUNCTION) { return (scope.flags & SCOPE_ASYNC) > 0 } + } + return (this.inModule && this.options.ecmaVersion >= 13) || this.options.allowAwaitOutsideFunction +}; + +prototypeAccessors.allowSuper.get = function () { + var ref = this.currentThisScope(); + var flags = ref.flags; + var inClassFieldInit = ref.inClassFieldInit; + return (flags & SCOPE_SUPER) > 0 || inClassFieldInit || this.options.allowSuperOutsideMethod +}; + prototypeAccessors.allowDirectSuper.get = function () { return (this.currentThisScope().flags & SCOPE_DIRECT_SUPER) > 0 }; + prototypeAccessors.treatFunctionsAsVar.get = function () { return this.treatFunctionsAsVarInScope(this.currentScope()) }; -// Switch to a getter for 7.0.0. -Parser.prototype.inNonArrowFunction = function inNonArrowFunction () { return (this.currentThisScope().flags & SCOPE_FUNCTION) > 0 }; +prototypeAccessors.allowNewDotTarget.get = function () { + var ref = this.currentThisScope(); + var flags = ref.flags; + var inClassFieldInit = ref.inClassFieldInit; + return (flags & (SCOPE_FUNCTION | SCOPE_CLASS_STATIC_BLOCK)) > 0 || inClassFieldInit +}; + +prototypeAccessors.inClassStaticBlock.get = function () { + return (this.currentVarScope().flags & SCOPE_CLASS_STATIC_BLOCK) > 0 +}; Parser.extend = function extend () { var plugins = [], len = arguments.length; @@ -12644,12 +16605,13 @@ Parser.tokenizer = function tokenizer (input, options) { Object.defineProperties( Parser.prototype, prototypeAccessors ); -var pp = Parser.prototype; +var pp$9 = Parser.prototype; // ## Parser utilities -var literal = /^(?:'((?:\\.|[^'])*?)'|"((?:\\.|[^"])*?)")/; -pp.strictDirective = function(start) { +var literal = /^(?:'((?:\\.|[^'\\])*?)'|"((?:\\.|[^"\\])*?)")/; +pp$9.strictDirective = function(start) { + if (this.options.ecmaVersion < 5) { return false } for (;;) { // Try to find string literal. skipWhiteSpace.lastIndex = start; @@ -12677,7 +16639,7 @@ pp.strictDirective = function(start) { // Predicate that tests whether the next token is of the given // type, and if yes, consumes it as a side effect. -pp.eat = function(type) { +pp$9.eat = function(type) { if (this.type === type) { this.next(); return true @@ -12688,13 +16650,13 @@ pp.eat = function(type) { // Tests whether parsed token is a contextual keyword. -pp.isContextual = function(name) { - return this.type === types.name && this.value === name && !this.containsEsc +pp$9.isContextual = function(name) { + return this.type === types$1.name && this.value === name && !this.containsEsc }; // Consumes contextual keyword if possible. -pp.eatContextual = function(name) { +pp$9.eatContextual = function(name) { if (!this.isContextual(name)) { return false } this.next(); return true @@ -12702,19 +16664,19 @@ pp.eatContextual = function(name) { // Asserts that following token is given contextual keyword. -pp.expectContextual = function(name) { +pp$9.expectContextual = function(name) { if (!this.eatContextual(name)) { this.unexpected(); } }; // Test whether a semicolon can be inserted at the current position. -pp.canInsertSemicolon = function() { - return this.type === types.eof || - this.type === types.braceR || +pp$9.canInsertSemicolon = function() { + return this.type === types$1.eof || + this.type === types$1.braceR || lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) }; -pp.insertSemicolon = function() { +pp$9.insertSemicolon = function() { if (this.canInsertSemicolon()) { if (this.options.onInsertedSemicolon) { this.options.onInsertedSemicolon(this.lastTokEnd, this.lastTokEndLoc); } @@ -12725,11 +16687,11 @@ pp.insertSemicolon = function() { // Consume a semicolon, or, failing that, see if we are allowed to // pretend that there is a semicolon at this position. -pp.semicolon = function() { - if (!this.eat(types.semi) && !this.insertSemicolon()) { this.unexpected(); } +pp$9.semicolon = function() { + if (!this.eat(types$1.semi) && !this.insertSemicolon()) { this.unexpected(); } }; -pp.afterTrailingComma = function(tokType, notNext) { +pp$9.afterTrailingComma = function(tokType, notNext) { if (this.type === tokType) { if (this.options.onTrailingComma) { this.options.onTrailingComma(this.lastTokStart, this.lastTokStartLoc); } @@ -12742,26 +16704,26 @@ pp.afterTrailingComma = function(tokType, notNext) { // Expect a token of a given type. If found, consume it, otherwise, // raise an unexpected token error. -pp.expect = function(type) { +pp$9.expect = function(type) { this.eat(type) || this.unexpected(); }; // Raise an unexpected token error. -pp.unexpected = function(pos) { +pp$9.unexpected = function(pos) { this.raise(pos != null ? pos : this.start, "Unexpected token"); }; -function DestructuringErrors() { +var DestructuringErrors = function DestructuringErrors() { this.shorthandAssign = this.trailingComma = this.parenthesizedAssign = this.parenthesizedBind = this.doubleProto = -1; -} +}; -pp.checkPatternErrors = function(refDestructuringErrors, isAssign) { +pp$9.checkPatternErrors = function(refDestructuringErrors, isAssign) { if (!refDestructuringErrors) { return } if (refDestructuringErrors.trailingComma > -1) { this.raiseRecoverable(refDestructuringErrors.trailingComma, "Comma is not permitted after the rest element"); } @@ -12769,7 +16731,7 @@ pp.checkPatternErrors = function(refDestructuringErrors, isAssign) { if (parens > -1) { this.raiseRecoverable(parens, "Parenthesized pattern"); } }; -pp.checkExpressionErrors = function(refDestructuringErrors, andThrow) { +pp$9.checkExpressionErrors = function(refDestructuringErrors, andThrow) { if (!refDestructuringErrors) { return false } var shorthandAssign = refDestructuringErrors.shorthandAssign; var doubleProto = refDestructuringErrors.doubleProto; @@ -12780,20 +16742,20 @@ pp.checkExpressionErrors = function(refDestructuringErrors, andThrow) { { this.raiseRecoverable(doubleProto, "Redefinition of __proto__ property"); } }; -pp.checkYieldAwaitInDefaultParams = function() { +pp$9.checkYieldAwaitInDefaultParams = function() { if (this.yieldPos && (!this.awaitPos || this.yieldPos < this.awaitPos)) { this.raise(this.yieldPos, "Yield expression cannot be a default value"); } if (this.awaitPos) { this.raise(this.awaitPos, "Await expression cannot be a default value"); } }; -pp.isSimpleAssignTarget = function(expr) { +pp$9.isSimpleAssignTarget = function(expr) { if (expr.type === "ParenthesizedExpression") { return this.isSimpleAssignTarget(expr.expression) } return expr.type === "Identifier" || expr.type === "MemberExpression" }; -var pp$1 = Parser.prototype; +var pp$8 = Parser.prototype; // ### Statement parsing @@ -12802,10 +16764,10 @@ var pp$1 = Parser.prototype; // `program` argument. If present, the statements will be appended // to its body instead of creating a new node. -pp$1.parseTopLevel = function(node) { - var exports = {}; +pp$8.parseTopLevel = function(node) { + var exports = Object.create(null); if (!node.body) { node.body = []; } - while (this.type !== types.eof) { + while (this.type !== types$1.eof) { var stmt = this.parseStatement(null, true, exports); node.body.push(stmt); } @@ -12824,7 +16786,7 @@ pp$1.parseTopLevel = function(node) { var loopLabel = {kind: "loop"}, switchLabel = {kind: "switch"}; -pp$1.isLet = function(context) { +pp$8.isLet = function(context) { if (this.options.ecmaVersion < 6 || !this.isContextual("let")) { return false } skipWhiteSpace.lastIndex = this.pos; var skip = skipWhiteSpace.exec(this.input); @@ -12833,13 +16795,14 @@ pp$1.isLet = function(context) { // Statement) is allowed here. If context is not empty then only a Statement // is allowed. However, `let [` is an explicit negative lookahead for // ExpressionStatement, so special-case it first. - if (nextCh === 91) { return true } // '[' + if (nextCh === 91 || nextCh === 92 || nextCh > 0xd7ff && nextCh < 0xdc00) { return true } // '[', '/', astral if (context) { return false } if (nextCh === 123) { return true } // '{' if (isIdentifierStart(nextCh, true)) { var pos = next + 1; - while (isIdentifierChar(this.input.charCodeAt(pos), true)) { ++pos; } + while (isIdentifierChar(nextCh = this.input.charCodeAt(pos), true)) { ++pos; } + if (nextCh === 92 || nextCh > 0xd7ff && nextCh < 0xdc00) { return true } var ident = this.input.slice(next, pos); if (!keywordRelationalOperator.test(ident)) { return true } } @@ -12849,16 +16812,17 @@ pp$1.isLet = function(context) { // check 'async [no LineTerminator here] function' // - 'async /*foo*/ function' is OK. // - 'async /*\n*/ function' is invalid. -pp$1.isAsyncFunction = function() { +pp$8.isAsyncFunction = function() { if (this.options.ecmaVersion < 8 || !this.isContextual("async")) { return false } skipWhiteSpace.lastIndex = this.pos; var skip = skipWhiteSpace.exec(this.input); - var next = this.pos + skip[0].length; + var next = this.pos + skip[0].length, after; return !lineBreak.test(this.input.slice(this.pos, next)) && this.input.slice(next, next + 8) === "function" && - (next + 8 === this.input.length || !isIdentifierChar(this.input.charAt(next + 8))) + (next + 8 === this.input.length || + !(isIdentifierChar(after = this.input.charCodeAt(next + 8)) || after > 0xd7ff && after < 0xdc00)) }; // Parse a single statement. @@ -12868,11 +16832,11 @@ pp$1.isAsyncFunction = function() { // `if (foo) /blah/.exec(foo)`, where looking at the previous token // does not help. -pp$1.parseStatement = function(context, topLevel, exports) { +pp$8.parseStatement = function(context, topLevel, exports) { var starttype = this.type, node = this.startNode(), kind; if (this.isLet(context)) { - starttype = types._var; + starttype = types$1._var; kind = "let"; } @@ -12881,35 +16845,35 @@ pp$1.parseStatement = function(context, topLevel, exports) { // complexity. switch (starttype) { - case types._break: case types._continue: return this.parseBreakContinueStatement(node, starttype.keyword) - case types._debugger: return this.parseDebuggerStatement(node) - case types._do: return this.parseDoStatement(node) - case types._for: return this.parseForStatement(node) - case types._function: + case types$1._break: case types$1._continue: return this.parseBreakContinueStatement(node, starttype.keyword) + case types$1._debugger: return this.parseDebuggerStatement(node) + case types$1._do: return this.parseDoStatement(node) + case types$1._for: return this.parseForStatement(node) + case types$1._function: // Function as sole body of either an if statement or a labeled statement // works, but not when it is part of a labeled statement that is the sole // body of an if statement. if ((context && (this.strict || context !== "if" && context !== "label")) && this.options.ecmaVersion >= 6) { this.unexpected(); } return this.parseFunctionStatement(node, false, !context) - case types._class: + case types$1._class: if (context) { this.unexpected(); } return this.parseClass(node, true) - case types._if: return this.parseIfStatement(node) - case types._return: return this.parseReturnStatement(node) - case types._switch: return this.parseSwitchStatement(node) - case types._throw: return this.parseThrowStatement(node) - case types._try: return this.parseTryStatement(node) - case types._const: case types._var: + case types$1._if: return this.parseIfStatement(node) + case types$1._return: return this.parseReturnStatement(node) + case types$1._switch: return this.parseSwitchStatement(node) + case types$1._throw: return this.parseThrowStatement(node) + case types$1._try: return this.parseTryStatement(node) + case types$1._const: case types$1._var: kind = kind || this.value; if (context && kind !== "var") { this.unexpected(); } return this.parseVarStatement(node, kind) - case types._while: return this.parseWhileStatement(node) - case types._with: return this.parseWithStatement(node) - case types.braceL: return this.parseBlock(true, node) - case types.semi: return this.parseEmptyStatement(node) - case types._export: - case types._import: - if (this.options.ecmaVersion > 10 && starttype === types._import) { + case types$1._while: return this.parseWhileStatement(node) + case types$1._with: return this.parseWithStatement(node) + case types$1.braceL: return this.parseBlock(true, node) + case types$1.semi: return this.parseEmptyStatement(node) + case types$1._export: + case types$1._import: + if (this.options.ecmaVersion > 10 && starttype === types$1._import) { skipWhiteSpace.lastIndex = this.pos; var skip = skipWhiteSpace.exec(this.input); var next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next); @@ -12923,7 +16887,7 @@ pp$1.parseStatement = function(context, topLevel, exports) { if (!this.inModule) { this.raise(this.start, "'import' and 'export' may appear only with 'sourceType: module'"); } } - return starttype === types._import ? this.parseImport(node) : this.parseExport(node, exports) + return starttype === types$1._import ? this.parseImport(node) : this.parseExport(node, exports) // If the statement does not start with a statement keyword or a // brace, it's an ExpressionStatement or LabeledStatement. We @@ -12938,17 +16902,17 @@ pp$1.parseStatement = function(context, topLevel, exports) { } var maybeName = this.value, expr = this.parseExpression(); - if (starttype === types.name && expr.type === "Identifier" && this.eat(types.colon)) + if (starttype === types$1.name && expr.type === "Identifier" && this.eat(types$1.colon)) { return this.parseLabeledStatement(node, maybeName, expr, context) } else { return this.parseExpressionStatement(node, expr) } } }; -pp$1.parseBreakContinueStatement = function(node, keyword) { +pp$8.parseBreakContinueStatement = function(node, keyword) { var isBreak = keyword === "break"; this.next(); - if (this.eat(types.semi) || this.insertSemicolon()) { node.label = null; } - else if (this.type !== types.name) { this.unexpected(); } + if (this.eat(types$1.semi) || this.insertSemicolon()) { node.label = null; } + else if (this.type !== types$1.name) { this.unexpected(); } else { node.label = this.parseIdent(); this.semicolon(); @@ -12968,21 +16932,21 @@ pp$1.parseBreakContinueStatement = function(node, keyword) { return this.finishNode(node, isBreak ? "BreakStatement" : "ContinueStatement") }; -pp$1.parseDebuggerStatement = function(node) { +pp$8.parseDebuggerStatement = function(node) { this.next(); this.semicolon(); return this.finishNode(node, "DebuggerStatement") }; -pp$1.parseDoStatement = function(node) { +pp$8.parseDoStatement = function(node) { this.next(); this.labels.push(loopLabel); node.body = this.parseStatement("do"); this.labels.pop(); - this.expect(types._while); + this.expect(types$1._while); node.test = this.parseParenExpression(); if (this.options.ecmaVersion >= 6) - { this.eat(types.semi); } + { this.eat(types$1.semi); } else { this.semicolon(); } return this.finishNode(node, "DoWhileStatement") @@ -12996,25 +16960,25 @@ pp$1.parseDoStatement = function(node) { // part (semicolon immediately after the opening parenthesis), it // is a regular `for` loop. -pp$1.parseForStatement = function(node) { +pp$8.parseForStatement = function(node) { this.next(); - var awaitAt = (this.options.ecmaVersion >= 9 && (this.inAsync || (!this.inFunction && this.options.allowAwaitOutsideFunction)) && this.eatContextual("await")) ? this.lastTokStart : -1; + var awaitAt = (this.options.ecmaVersion >= 9 && this.canAwait && this.eatContextual("await")) ? this.lastTokStart : -1; this.labels.push(loopLabel); this.enterScope(0); - this.expect(types.parenL); - if (this.type === types.semi) { + this.expect(types$1.parenL); + if (this.type === types$1.semi) { if (awaitAt > -1) { this.unexpected(awaitAt); } return this.parseFor(node, null) } var isLet = this.isLet(); - if (this.type === types._var || this.type === types._const || isLet) { + if (this.type === types$1._var || this.type === types$1._const || isLet) { var init$1 = this.startNode(), kind = isLet ? "let" : this.value; this.next(); this.parseVar(init$1, true, kind); this.finishNode(init$1, "VariableDeclaration"); - if ((this.type === types._in || (this.options.ecmaVersion >= 6 && this.isContextual("of"))) && init$1.declarations.length === 1) { + if ((this.type === types$1._in || (this.options.ecmaVersion >= 6 && this.isContextual("of"))) && init$1.declarations.length === 1) { if (this.options.ecmaVersion >= 9) { - if (this.type === types._in) { + if (this.type === types$1._in) { if (awaitAt > -1) { this.unexpected(awaitAt); } } else { node.await = awaitAt > -1; } } @@ -13023,16 +16987,18 @@ pp$1.parseForStatement = function(node) { if (awaitAt > -1) { this.unexpected(awaitAt); } return this.parseFor(node, init$1) } + var startsWithLet = this.isContextual("let"), isForOf = false; var refDestructuringErrors = new DestructuringErrors; - var init = this.parseExpression(true, refDestructuringErrors); - if (this.type === types._in || (this.options.ecmaVersion >= 6 && this.isContextual("of"))) { + var init = this.parseExpression(awaitAt > -1 ? "await" : true, refDestructuringErrors); + if (this.type === types$1._in || (isForOf = this.options.ecmaVersion >= 6 && this.isContextual("of"))) { if (this.options.ecmaVersion >= 9) { - if (this.type === types._in) { + if (this.type === types$1._in) { if (awaitAt > -1) { this.unexpected(awaitAt); } } else { node.await = awaitAt > -1; } } + if (startsWithLet && isForOf) { this.raise(init.start, "The left-hand side of a for-of loop may not start with 'let'."); } this.toAssignable(init, false, refDestructuringErrors); - this.checkLVal(init); + this.checkLValPattern(init); return this.parseForIn(node, init) } else { this.checkExpressionErrors(refDestructuringErrors, true); @@ -13041,21 +17007,21 @@ pp$1.parseForStatement = function(node) { return this.parseFor(node, init) }; -pp$1.parseFunctionStatement = function(node, isAsync, declarationPosition) { +pp$8.parseFunctionStatement = function(node, isAsync, declarationPosition) { this.next(); return this.parseFunction(node, FUNC_STATEMENT | (declarationPosition ? 0 : FUNC_HANGING_STATEMENT), false, isAsync) }; -pp$1.parseIfStatement = function(node) { +pp$8.parseIfStatement = function(node) { this.next(); node.test = this.parseParenExpression(); // allow function declarations in branches, but only in non-strict mode node.consequent = this.parseStatement("if"); - node.alternate = this.eat(types._else) ? this.parseStatement("if") : null; + node.alternate = this.eat(types$1._else) ? this.parseStatement("if") : null; return this.finishNode(node, "IfStatement") }; -pp$1.parseReturnStatement = function(node) { +pp$8.parseReturnStatement = function(node) { if (!this.inFunction && !this.options.allowReturnOutsideFunction) { this.raise(this.start, "'return' outside of function"); } this.next(); @@ -13064,16 +17030,16 @@ pp$1.parseReturnStatement = function(node) { // optional arguments, we eagerly look for a semicolon or the // possibility to insert one. - if (this.eat(types.semi) || this.insertSemicolon()) { node.argument = null; } + if (this.eat(types$1.semi) || this.insertSemicolon()) { node.argument = null; } else { node.argument = this.parseExpression(); this.semicolon(); } return this.finishNode(node, "ReturnStatement") }; -pp$1.parseSwitchStatement = function(node) { +pp$8.parseSwitchStatement = function(node) { this.next(); node.discriminant = this.parseParenExpression(); node.cases = []; - this.expect(types.braceL); + this.expect(types$1.braceL); this.labels.push(switchLabel); this.enterScope(0); @@ -13082,9 +17048,9 @@ pp$1.parseSwitchStatement = function(node) { // adding statements to. var cur; - for (var sawDefault = false; this.type !== types.braceR;) { - if (this.type === types._case || this.type === types._default) { - var isCase = this.type === types._case; + for (var sawDefault = false; this.type !== types$1.braceR;) { + if (this.type === types$1._case || this.type === types$1._default) { + var isCase = this.type === types$1._case; if (cur) { this.finishNode(cur, "SwitchCase"); } node.cases.push(cur = this.startNode()); cur.consequent = []; @@ -13096,7 +17062,7 @@ pp$1.parseSwitchStatement = function(node) { sawDefault = true; cur.test = null; } - this.expect(types.colon); + this.expect(types$1.colon); } else { if (!cur) { this.unexpected(); } cur.consequent.push(this.parseStatement(null)); @@ -13109,7 +17075,7 @@ pp$1.parseSwitchStatement = function(node) { return this.finishNode(node, "SwitchStatement") }; -pp$1.parseThrowStatement = function(node) { +pp$8.parseThrowStatement = function(node) { this.next(); if (lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) { this.raise(this.lastTokEnd, "Illegal newline after throw"); } @@ -13120,21 +17086,21 @@ pp$1.parseThrowStatement = function(node) { // Reused empty array added for node fields that are always empty. -var empty = []; +var empty$1 = []; -pp$1.parseTryStatement = function(node) { +pp$8.parseTryStatement = function(node) { this.next(); node.block = this.parseBlock(); node.handler = null; - if (this.type === types._catch) { + if (this.type === types$1._catch) { var clause = this.startNode(); this.next(); - if (this.eat(types.parenL)) { + if (this.eat(types$1.parenL)) { clause.param = this.parseBindingAtom(); var simple = clause.param.type === "Identifier"; this.enterScope(simple ? SCOPE_SIMPLE_CATCH : 0); - this.checkLVal(clause.param, simple ? BIND_SIMPLE_CATCH : BIND_LEXICAL); - this.expect(types.parenR); + this.checkLValPattern(clause.param, simple ? BIND_SIMPLE_CATCH : BIND_LEXICAL); + this.expect(types$1.parenR); } else { if (this.options.ecmaVersion < 10) { this.unexpected(); } clause.param = null; @@ -13144,20 +17110,20 @@ pp$1.parseTryStatement = function(node) { this.exitScope(); node.handler = this.finishNode(clause, "CatchClause"); } - node.finalizer = this.eat(types._finally) ? this.parseBlock() : null; + node.finalizer = this.eat(types$1._finally) ? this.parseBlock() : null; if (!node.handler && !node.finalizer) { this.raise(node.start, "Missing catch or finally clause"); } return this.finishNode(node, "TryStatement") }; -pp$1.parseVarStatement = function(node, kind) { +pp$8.parseVarStatement = function(node, kind) { this.next(); this.parseVar(node, false, kind); this.semicolon(); return this.finishNode(node, "VariableDeclaration") }; -pp$1.parseWhileStatement = function(node) { +pp$8.parseWhileStatement = function(node) { this.next(); node.test = this.parseParenExpression(); this.labels.push(loopLabel); @@ -13166,7 +17132,7 @@ pp$1.parseWhileStatement = function(node) { return this.finishNode(node, "WhileStatement") }; -pp$1.parseWithStatement = function(node) { +pp$8.parseWithStatement = function(node) { if (this.strict) { this.raise(this.start, "'with' in strict mode"); } this.next(); node.object = this.parseParenExpression(); @@ -13174,12 +17140,12 @@ pp$1.parseWithStatement = function(node) { return this.finishNode(node, "WithStatement") }; -pp$1.parseEmptyStatement = function(node) { +pp$8.parseEmptyStatement = function(node) { this.next(); return this.finishNode(node, "EmptyStatement") }; -pp$1.parseLabeledStatement = function(node, maybeName, expr, context) { +pp$8.parseLabeledStatement = function(node, maybeName, expr, context) { for (var i$1 = 0, list = this.labels; i$1 < list.length; i$1 += 1) { var label = list[i$1]; @@ -13187,7 +17153,7 @@ pp$1.parseLabeledStatement = function(node, maybeName, expr, context) { if (label.name === maybeName) { this.raise(expr.start, "Label '" + maybeName + "' is already declared"); } } - var kind = this.type.isLoop ? "loop" : this.type === types._switch ? "switch" : null; + var kind = this.type.isLoop ? "loop" : this.type === types$1._switch ? "switch" : null; for (var i = this.labels.length - 1; i >= 0; i--) { var label$1 = this.labels[i]; if (label$1.statementStart === node.start) { @@ -13203,7 +17169,7 @@ pp$1.parseLabeledStatement = function(node, maybeName, expr, context) { return this.finishNode(node, "LabeledStatement") }; -pp$1.parseExpressionStatement = function(node, expr) { +pp$8.parseExpressionStatement = function(node, expr) { node.expression = expr; this.semicolon(); return this.finishNode(node, "ExpressionStatement") @@ -13213,14 +17179,14 @@ pp$1.parseExpressionStatement = function(node, expr) { // strict"` declarations when `allowStrict` is true (used for // function bodies). -pp$1.parseBlock = function(createNewLexicalScope, node, exitStrict) { +pp$8.parseBlock = function(createNewLexicalScope, node, exitStrict) { if ( createNewLexicalScope === void 0 ) createNewLexicalScope = true; if ( node === void 0 ) node = this.startNode(); node.body = []; - this.expect(types.braceL); + this.expect(types$1.braceL); if (createNewLexicalScope) { this.enterScope(0); } - while (this.type !== types.braceR) { + while (this.type !== types$1.braceR) { var stmt = this.parseStatement(null); node.body.push(stmt); } @@ -13234,13 +17200,13 @@ pp$1.parseBlock = function(createNewLexicalScope, node, exitStrict) { // `parseStatement` will already have parsed the init statement or // expression. -pp$1.parseFor = function(node, init) { +pp$8.parseFor = function(node, init) { node.init = init; - this.expect(types.semi); - node.test = this.type === types.semi ? null : this.parseExpression(); - this.expect(types.semi); - node.update = this.type === types.parenR ? null : this.parseExpression(); - this.expect(types.parenR); + this.expect(types$1.semi); + node.test = this.type === types$1.semi ? null : this.parseExpression(); + this.expect(types$1.semi); + node.update = this.type === types$1.parenR ? null : this.parseExpression(); + this.expect(types$1.parenR); node.body = this.parseStatement("for"); this.exitScope(); this.labels.pop(); @@ -13250,8 +17216,8 @@ pp$1.parseFor = function(node, init) { // Parse a `for`/`in` and `for`/`of` loop, which are almost // same from parser's perspective. -pp$1.parseForIn = function(node, init) { - var isForIn = this.type === types._in; +pp$8.parseForIn = function(node, init) { + var isForIn = this.type === types$1._in; this.next(); if ( @@ -13269,12 +17235,10 @@ pp$1.parseForIn = function(node, init) { init.start, ((isForIn ? "for-in" : "for-of") + " loop variable declaration may not have an initializer") ); - } else if (init.type === "AssignmentPattern") { - this.raise(init.start, "Invalid left-hand side in for-loop"); } node.left = init; node.right = isForIn ? this.parseExpression() : this.parseMaybeAssign(); - this.expect(types.parenR); + this.expect(types$1.parenR); node.body = this.parseStatement("for"); this.exitScope(); this.labels.pop(); @@ -13283,30 +17247,30 @@ pp$1.parseForIn = function(node, init) { // Parse a list of variable declarations. -pp$1.parseVar = function(node, isFor, kind) { +pp$8.parseVar = function(node, isFor, kind) { node.declarations = []; node.kind = kind; for (;;) { var decl = this.startNode(); this.parseVarId(decl, kind); - if (this.eat(types.eq)) { + if (this.eat(types$1.eq)) { decl.init = this.parseMaybeAssign(isFor); - } else if (kind === "const" && !(this.type === types._in || (this.options.ecmaVersion >= 6 && this.isContextual("of")))) { + } else if (kind === "const" && !(this.type === types$1._in || (this.options.ecmaVersion >= 6 && this.isContextual("of")))) { this.unexpected(); - } else if (decl.id.type !== "Identifier" && !(isFor && (this.type === types._in || this.isContextual("of")))) { + } else if (decl.id.type !== "Identifier" && !(isFor && (this.type === types$1._in || this.isContextual("of")))) { this.raise(this.lastTokEnd, "Complex binding patterns require an initialization value"); } else { decl.init = null; } node.declarations.push(this.finishNode(decl, "VariableDeclarator")); - if (!this.eat(types.comma)) { break } + if (!this.eat(types$1.comma)) { break } } return node }; -pp$1.parseVarId = function(decl, kind) { +pp$8.parseVarId = function(decl, kind) { decl.id = this.parseBindingAtom(); - this.checkLVal(decl.id, kind === "var" ? BIND_VAR : BIND_LEXICAL, false); + this.checkLValPattern(decl.id, kind === "var" ? BIND_VAR : BIND_LEXICAL, false); }; var FUNC_STATEMENT = 1, FUNC_HANGING_STATEMENT = 2, FUNC_NULLABLE_ID = 4; @@ -13315,24 +17279,24 @@ var FUNC_STATEMENT = 1, FUNC_HANGING_STATEMENT = 2, FUNC_NULLABLE_ID = 4; // `statement & FUNC_STATEMENT`). // Remove `allowExpressionBody` for 7.0.0, as it is only called with false -pp$1.parseFunction = function(node, statement, allowExpressionBody, isAsync) { +pp$8.parseFunction = function(node, statement, allowExpressionBody, isAsync, forInit) { this.initFunction(node); if (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !isAsync) { - if (this.type === types.star && (statement & FUNC_HANGING_STATEMENT)) + if (this.type === types$1.star && (statement & FUNC_HANGING_STATEMENT)) { this.unexpected(); } - node.generator = this.eat(types.star); + node.generator = this.eat(types$1.star); } if (this.options.ecmaVersion >= 8) { node.async = !!isAsync; } if (statement & FUNC_STATEMENT) { - node.id = (statement & FUNC_NULLABLE_ID) && this.type !== types.name ? null : this.parseIdent(); + node.id = (statement & FUNC_NULLABLE_ID) && this.type !== types$1.name ? null : this.parseIdent(); if (node.id && !(statement & FUNC_HANGING_STATEMENT)) // If it is a regular function declaration in sloppy mode, then it is // subject to Annex B semantics (BIND_FUNCTION). Otherwise, the binding // mode depends on properties of the current scope (see // treatFunctionsAsVar). - { this.checkLVal(node.id, (this.strict || node.generator || node.async) ? this.treatFunctionsAsVar ? BIND_VAR : BIND_LEXICAL : BIND_FUNCTION); } + { this.checkLValSimple(node.id, (this.strict || node.generator || node.async) ? this.treatFunctionsAsVar ? BIND_VAR : BIND_LEXICAL : BIND_FUNCTION); } } var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; @@ -13342,10 +17306,10 @@ pp$1.parseFunction = function(node, statement, allowExpressionBody, isAsync) { this.enterScope(functionFlags(node.async, node.generator)); if (!(statement & FUNC_STATEMENT)) - { node.id = this.type === types.name ? this.parseIdent() : null; } + { node.id = this.type === types$1.name ? this.parseIdent() : null; } this.parseFunctionParams(node); - this.parseFunctionBody(node, allowExpressionBody, false); + this.parseFunctionBody(node, allowExpressionBody, false, forInit); this.yieldPos = oldYieldPos; this.awaitPos = oldAwaitPos; @@ -13353,16 +17317,16 @@ pp$1.parseFunction = function(node, statement, allowExpressionBody, isAsync) { return this.finishNode(node, (statement & FUNC_STATEMENT) ? "FunctionDeclaration" : "FunctionExpression") }; -pp$1.parseFunctionParams = function(node) { - this.expect(types.parenL); - node.params = this.parseBindingList(types.parenR, false, this.options.ecmaVersion >= 8); +pp$8.parseFunctionParams = function(node) { + this.expect(types$1.parenL); + node.params = this.parseBindingList(types$1.parenR, false, this.options.ecmaVersion >= 8); this.checkYieldAwaitInDefaultParams(); }; // Parse a class declaration or literal (depending on the // `isStatement` parameter). -pp$1.parseClass = function(node, isStatement) { +pp$8.parseClass = function(node, isStatement) { this.next(); // ecma-262 14.6 Class Definitions @@ -13372,93 +17336,193 @@ pp$1.parseClass = function(node, isStatement) { this.parseClassId(node, isStatement); this.parseClassSuper(node); + var privateNameMap = this.enterClassBody(); var classBody = this.startNode(); var hadConstructor = false; classBody.body = []; - this.expect(types.braceL); - while (this.type !== types.braceR) { + this.expect(types$1.braceL); + while (this.type !== types$1.braceR) { var element = this.parseClassElement(node.superClass !== null); if (element) { classBody.body.push(element); if (element.type === "MethodDefinition" && element.kind === "constructor") { if (hadConstructor) { this.raise(element.start, "Duplicate constructor in the same class"); } hadConstructor = true; + } else if (element.key && element.key.type === "PrivateIdentifier" && isPrivateNameConflicted(privateNameMap, element)) { + this.raiseRecoverable(element.key.start, ("Identifier '#" + (element.key.name) + "' has already been declared")); } } } this.strict = oldStrict; this.next(); node.body = this.finishNode(classBody, "ClassBody"); + this.exitClassBody(); return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression") }; -pp$1.parseClassElement = function(constructorAllowsSuper) { - var this$1 = this; +pp$8.parseClassElement = function(constructorAllowsSuper) { + if (this.eat(types$1.semi)) { return null } + + var ecmaVersion = this.options.ecmaVersion; + var node = this.startNode(); + var keyName = ""; + var isGenerator = false; + var isAsync = false; + var kind = "method"; + var isStatic = false; + + if (this.eatContextual("static")) { + // Parse static init block + if (ecmaVersion >= 13 && this.eat(types$1.braceL)) { + this.parseClassStaticBlock(node); + return node + } + if (this.isClassElementNameStart() || this.type === types$1.star) { + isStatic = true; + } else { + keyName = "static"; + } + } + node.static = isStatic; + if (!keyName && ecmaVersion >= 8 && this.eatContextual("async")) { + if ((this.isClassElementNameStart() || this.type === types$1.star) && !this.canInsertSemicolon()) { + isAsync = true; + } else { + keyName = "async"; + } + } + if (!keyName && (ecmaVersion >= 9 || !isAsync) && this.eat(types$1.star)) { + isGenerator = true; + } + if (!keyName && !isAsync && !isGenerator) { + var lastValue = this.value; + if (this.eatContextual("get") || this.eatContextual("set")) { + if (this.isClassElementNameStart()) { + kind = lastValue; + } else { + keyName = lastValue; + } + } + } + + // Parse element name + if (keyName) { + // 'async', 'get', 'set', or 'static' were not a keyword contextually. + // The last token is any of those. Make it the element name. + node.computed = false; + node.key = this.startNodeAt(this.lastTokStart, this.lastTokStartLoc); + node.key.name = keyName; + this.finishNode(node.key, "Identifier"); + } else { + this.parseClassElementName(node); + } - if (this.eat(types.semi)) { return null } + // Parse element value + if (ecmaVersion < 13 || this.type === types$1.parenL || kind !== "method" || isGenerator || isAsync) { + var isConstructor = !node.static && checkKeyName(node, "constructor"); + var allowsDirectSuper = isConstructor && constructorAllowsSuper; + // Couldn't move this check into the 'parseClassMethod' method for backward compatibility. + if (isConstructor && kind !== "method") { this.raise(node.key.start, "Constructor can't have get/set modifier"); } + node.kind = isConstructor ? "constructor" : kind; + this.parseClassMethod(node, isGenerator, isAsync, allowsDirectSuper); + } else { + this.parseClassField(node); + } - var method = this.startNode(); - var tryContextual = function (k, noLineBreak) { - if ( noLineBreak === void 0 ) noLineBreak = false; + return node +}; - var start = this$1.start, startLoc = this$1.startLoc; - if (!this$1.eatContextual(k)) { return false } - if (this$1.type !== types.parenL && (!noLineBreak || !this$1.canInsertSemicolon())) { return true } - if (method.key) { this$1.unexpected(); } - method.computed = false; - method.key = this$1.startNodeAt(start, startLoc); - method.key.name = k; - this$1.finishNode(method.key, "Identifier"); - return false - }; +pp$8.isClassElementNameStart = function() { + return ( + this.type === types$1.name || + this.type === types$1.privateId || + this.type === types$1.num || + this.type === types$1.string || + this.type === types$1.bracketL || + this.type.keyword + ) +}; - method.kind = "method"; - method.static = tryContextual("static"); - var isGenerator = this.eat(types.star); - var isAsync = false; - if (!isGenerator) { - if (this.options.ecmaVersion >= 8 && tryContextual("async", true)) { - isAsync = true; - isGenerator = this.options.ecmaVersion >= 9 && this.eat(types.star); - } else if (tryContextual("get")) { - method.kind = "get"; - } else if (tryContextual("set")) { - method.kind = "set"; +pp$8.parseClassElementName = function(element) { + if (this.type === types$1.privateId) { + if (this.value === "constructor") { + this.raise(this.start, "Classes can't have an element named '#constructor'"); } + element.computed = false; + element.key = this.parsePrivateIdent(); + } else { + this.parsePropertyName(element); } - if (!method.key) { this.parsePropertyName(method); } +}; + +pp$8.parseClassMethod = function(method, isGenerator, isAsync, allowsDirectSuper) { + // Check key and flags var key = method.key; - var allowsDirectSuper = false; - if (!method.computed && !method.static && (key.type === "Identifier" && key.name === "constructor" || - key.type === "Literal" && key.value === "constructor")) { - if (method.kind !== "method") { this.raise(key.start, "Constructor can't have get/set modifier"); } + if (method.kind === "constructor") { if (isGenerator) { this.raise(key.start, "Constructor can't be a generator"); } if (isAsync) { this.raise(key.start, "Constructor can't be an async method"); } - method.kind = "constructor"; - allowsDirectSuper = constructorAllowsSuper; - } else if (method.static && key.type === "Identifier" && key.name === "prototype") { + } else if (method.static && checkKeyName(method, "prototype")) { this.raise(key.start, "Classes may not have a static property named prototype"); } - this.parseClassMethod(method, isGenerator, isAsync, allowsDirectSuper); - if (method.kind === "get" && method.value.params.length !== 0) - { this.raiseRecoverable(method.value.start, "getter should have no params"); } - if (method.kind === "set" && method.value.params.length !== 1) - { this.raiseRecoverable(method.value.start, "setter should have exactly one param"); } - if (method.kind === "set" && method.value.params[0].type === "RestElement") - { this.raiseRecoverable(method.value.params[0].start, "Setter cannot use rest params"); } - return method -}; -pp$1.parseClassMethod = function(method, isGenerator, isAsync, allowsDirectSuper) { - method.value = this.parseMethod(isGenerator, isAsync, allowsDirectSuper); + // Parse value + var value = method.value = this.parseMethod(isGenerator, isAsync, allowsDirectSuper); + + // Check value + if (method.kind === "get" && value.params.length !== 0) + { this.raiseRecoverable(value.start, "getter should have no params"); } + if (method.kind === "set" && value.params.length !== 1) + { this.raiseRecoverable(value.start, "setter should have exactly one param"); } + if (method.kind === "set" && value.params[0].type === "RestElement") + { this.raiseRecoverable(value.params[0].start, "Setter cannot use rest params"); } + return this.finishNode(method, "MethodDefinition") }; -pp$1.parseClassId = function(node, isStatement) { - if (this.type === types.name) { +pp$8.parseClassField = function(field) { + if (checkKeyName(field, "constructor")) { + this.raise(field.key.start, "Classes can't have a field named 'constructor'"); + } else if (field.static && checkKeyName(field, "prototype")) { + this.raise(field.key.start, "Classes can't have a static field named 'prototype'"); + } + + if (this.eat(types$1.eq)) { + // To raise SyntaxError if 'arguments' exists in the initializer. + var scope = this.currentThisScope(); + var inClassFieldInit = scope.inClassFieldInit; + scope.inClassFieldInit = true; + field.value = this.parseMaybeAssign(); + scope.inClassFieldInit = inClassFieldInit; + } else { + field.value = null; + } + this.semicolon(); + + return this.finishNode(field, "PropertyDefinition") +}; + +pp$8.parseClassStaticBlock = function(node) { + node.body = []; + + var oldLabels = this.labels; + this.labels = []; + this.enterScope(SCOPE_CLASS_STATIC_BLOCK | SCOPE_SUPER); + while (this.type !== types$1.braceR) { + var stmt = this.parseStatement(null); + node.body.push(stmt); + } + this.next(); + this.exitScope(); + this.labels = oldLabels; + + return this.finishNode(node, "StaticBlock") +}; + +pp$8.parseClassId = function(node, isStatement) { + if (this.type === types$1.name) { node.id = this.parseIdent(); if (isStatement) - { this.checkLVal(node.id, BIND_LEXICAL, false); } + { this.checkLValSimple(node.id, BIND_LEXICAL, false); } } else { if (isStatement === true) { this.unexpected(); } @@ -13466,39 +17530,98 @@ pp$1.parseClassId = function(node, isStatement) { } }; -pp$1.parseClassSuper = function(node) { - node.superClass = this.eat(types._extends) ? this.parseExprSubscripts() : null; +pp$8.parseClassSuper = function(node) { + node.superClass = this.eat(types$1._extends) ? this.parseExprSubscripts(false) : null; +}; + +pp$8.enterClassBody = function() { + var element = {declared: Object.create(null), used: []}; + this.privateNameStack.push(element); + return element.declared }; +pp$8.exitClassBody = function() { + var ref = this.privateNameStack.pop(); + var declared = ref.declared; + var used = ref.used; + var len = this.privateNameStack.length; + var parent = len === 0 ? null : this.privateNameStack[len - 1]; + for (var i = 0; i < used.length; ++i) { + var id = used[i]; + if (!hasOwn(declared, id.name)) { + if (parent) { + parent.used.push(id); + } else { + this.raiseRecoverable(id.start, ("Private field '#" + (id.name) + "' must be declared in an enclosing class")); + } + } + } +}; + +function isPrivateNameConflicted(privateNameMap, element) { + var name = element.key.name; + var curr = privateNameMap[name]; + + var next = "true"; + if (element.type === "MethodDefinition" && (element.kind === "get" || element.kind === "set")) { + next = (element.static ? "s" : "i") + element.kind; + } + + // `class { get #a(){}; static set #a(_){} }` is also conflict. + if ( + curr === "iget" && next === "iset" || + curr === "iset" && next === "iget" || + curr === "sget" && next === "sset" || + curr === "sset" && next === "sget" + ) { + privateNameMap[name] = "true"; + return false + } else if (!curr) { + privateNameMap[name] = next; + return false + } else { + return true + } +} + +function checkKeyName(node, name) { + var computed = node.computed; + var key = node.key; + return !computed && ( + key.type === "Identifier" && key.name === name || + key.type === "Literal" && key.value === name + ) +} + // Parses module export declaration. -pp$1.parseExport = function(node, exports) { +pp$8.parseExport = function(node, exports) { this.next(); // export * from '...' - if (this.eat(types.star)) { + if (this.eat(types$1.star)) { if (this.options.ecmaVersion >= 11) { if (this.eatContextual("as")) { - node.exported = this.parseIdent(true); - this.checkExport(exports, node.exported.name, this.lastTokStart); + node.exported = this.parseModuleExportName(); + this.checkExport(exports, node.exported, this.lastTokStart); } else { node.exported = null; } } this.expectContextual("from"); - if (this.type !== types.string) { this.unexpected(); } + if (this.type !== types$1.string) { this.unexpected(); } node.source = this.parseExprAtom(); this.semicolon(); return this.finishNode(node, "ExportAllDeclaration") } - if (this.eat(types._default)) { // export default ... + if (this.eat(types$1._default)) { // export default ... this.checkExport(exports, "default", this.lastTokStart); var isAsync; - if (this.type === types._function || (isAsync = this.isAsyncFunction())) { + if (this.type === types$1._function || (isAsync = this.isAsyncFunction())) { var fNode = this.startNode(); this.next(); if (isAsync) { this.next(); } node.declaration = this.parseFunction(fNode, FUNC_STATEMENT | FUNC_NULLABLE_ID, false, isAsync); - } else if (this.type === types._class) { + } else if (this.type === types$1._class) { var cNode = this.startNode(); node.declaration = this.parseClass(cNode, "nullableID"); } else { @@ -13513,14 +17636,14 @@ pp$1.parseExport = function(node, exports) { if (node.declaration.type === "VariableDeclaration") { this.checkVariableExport(exports, node.declaration.declarations); } else - { this.checkExport(exports, node.declaration.id.name, node.declaration.id.start); } + { this.checkExport(exports, node.declaration.id, node.declaration.id.start); } node.specifiers = []; node.source = null; } else { // export { x, y as z } [from '...'] node.declaration = null; node.specifiers = this.parseExportSpecifiers(exports); if (this.eatContextual("from")) { - if (this.type !== types.string) { this.unexpected(); } + if (this.type !== types$1.string) { this.unexpected(); } node.source = this.parseExprAtom(); } else { for (var i = 0, list = node.specifiers; i < list.length; i += 1) { @@ -13530,6 +17653,10 @@ pp$1.parseExport = function(node, exports) { this.checkUnreserved(spec.local); // check if export is defined this.checkLocalExport(spec.local); + + if (spec.local.type === "Literal") { + this.raise(spec.local.start, "A string literal cannot be used as an exported binding without `from`."); + } } node.source = null; @@ -13539,17 +17666,19 @@ pp$1.parseExport = function(node, exports) { return this.finishNode(node, "ExportNamedDeclaration") }; -pp$1.checkExport = function(exports, name, pos) { +pp$8.checkExport = function(exports, name, pos) { if (!exports) { return } - if (has(exports, name)) + if (typeof name !== "string") + { name = name.type === "Identifier" ? name.name : name.value; } + if (hasOwn(exports, name)) { this.raiseRecoverable(pos, "Duplicate export '" + name + "'"); } exports[name] = true; }; -pp$1.checkPatternExport = function(exports, pat) { +pp$8.checkPatternExport = function(exports, pat) { var type = pat.type; if (type === "Identifier") - { this.checkExport(exports, pat.name, pat.start); } + { this.checkExport(exports, pat, pat.start); } else if (type === "ObjectPattern") { for (var i = 0, list = pat.properties; i < list.length; i += 1) { @@ -13573,7 +17702,7 @@ pp$1.checkPatternExport = function(exports, pat) { { this.checkPatternExport(exports, pat.expression); } }; -pp$1.checkVariableExport = function(exports, decls) { +pp$8.checkVariableExport = function(exports, decls) { if (!exports) { return } for (var i = 0, list = decls; i < list.length; i += 1) { @@ -13583,7 +17712,7 @@ pp$1.checkVariableExport = function(exports, decls) { } }; -pp$1.shouldParseExportStatement = function() { +pp$8.shouldParseExportStatement = function() { return this.type.keyword === "var" || this.type.keyword === "const" || this.type.keyword === "class" || @@ -13594,20 +17723,24 @@ pp$1.shouldParseExportStatement = function() { // Parses a comma-separated list of module exports. -pp$1.parseExportSpecifiers = function(exports) { +pp$8.parseExportSpecifiers = function(exports) { var nodes = [], first = true; // export { x, y as z } [from '...'] - this.expect(types.braceL); - while (!this.eat(types.braceR)) { + this.expect(types$1.braceL); + while (!this.eat(types$1.braceR)) { if (!first) { - this.expect(types.comma); - if (this.afterTrailingComma(types.braceR)) { break } + this.expect(types$1.comma); + if (this.afterTrailingComma(types$1.braceR)) { break } } else { first = false; } var node = this.startNode(); - node.local = this.parseIdent(true); - node.exported = this.eatContextual("as") ? this.parseIdent(true) : node.local; - this.checkExport(exports, node.exported.name, node.exported.start); + node.local = this.parseModuleExportName(); + node.exported = this.eatContextual("as") ? this.parseModuleExportName() : node.local; + this.checkExport( + exports, + node.exported, + node.exported.start + ); nodes.push(this.finishNode(node, "ExportSpecifier")); } return nodes @@ -13615,16 +17748,16 @@ pp$1.parseExportSpecifiers = function(exports) { // Parses import declaration. -pp$1.parseImport = function(node) { +pp$8.parseImport = function(node) { this.next(); // import '...' - if (this.type === types.string) { - node.specifiers = empty; + if (this.type === types$1.string) { + node.specifiers = empty$1; node.source = this.parseExprAtom(); } else { node.specifiers = this.parseImportSpecifiers(); this.expectContextual("from"); - node.source = this.type === types.string ? this.parseExprAtom() : this.unexpected(); + node.source = this.type === types$1.string ? this.parseExprAtom() : this.unexpected(); } this.semicolon(); return this.finishNode(node, "ImportDeclaration") @@ -13632,53 +17765,64 @@ pp$1.parseImport = function(node) { // Parses a comma-separated list of module imports. -pp$1.parseImportSpecifiers = function() { +pp$8.parseImportSpecifiers = function() { var nodes = [], first = true; - if (this.type === types.name) { + if (this.type === types$1.name) { // import defaultObj, { x, y as z } from '...' var node = this.startNode(); node.local = this.parseIdent(); - this.checkLVal(node.local, BIND_LEXICAL); + this.checkLValSimple(node.local, BIND_LEXICAL); nodes.push(this.finishNode(node, "ImportDefaultSpecifier")); - if (!this.eat(types.comma)) { return nodes } + if (!this.eat(types$1.comma)) { return nodes } } - if (this.type === types.star) { + if (this.type === types$1.star) { var node$1 = this.startNode(); this.next(); this.expectContextual("as"); node$1.local = this.parseIdent(); - this.checkLVal(node$1.local, BIND_LEXICAL); + this.checkLValSimple(node$1.local, BIND_LEXICAL); nodes.push(this.finishNode(node$1, "ImportNamespaceSpecifier")); return nodes } - this.expect(types.braceL); - while (!this.eat(types.braceR)) { + this.expect(types$1.braceL); + while (!this.eat(types$1.braceR)) { if (!first) { - this.expect(types.comma); - if (this.afterTrailingComma(types.braceR)) { break } + this.expect(types$1.comma); + if (this.afterTrailingComma(types$1.braceR)) { break } } else { first = false; } var node$2 = this.startNode(); - node$2.imported = this.parseIdent(true); + node$2.imported = this.parseModuleExportName(); if (this.eatContextual("as")) { node$2.local = this.parseIdent(); } else { this.checkUnreserved(node$2.imported); node$2.local = node$2.imported; } - this.checkLVal(node$2.local, BIND_LEXICAL); + this.checkLValSimple(node$2.local, BIND_LEXICAL); nodes.push(this.finishNode(node$2, "ImportSpecifier")); } return nodes }; +pp$8.parseModuleExportName = function() { + if (this.options.ecmaVersion >= 13 && this.type === types$1.string) { + var stringLiteral = this.parseLiteral(this.value); + if (loneSurrogate.test(stringLiteral.value)) { + this.raise(stringLiteral.start, "An export name cannot include a lone surrogate."); + } + return stringLiteral + } + return this.parseIdent(true) +}; + // Set `ExpressionStatement#directive` property for directive prologues. -pp$1.adaptDirectivePrologue = function(statements) { +pp$8.adaptDirectivePrologue = function(statements) { for (var i = 0; i < statements.length && this.isDirectiveCandidate(statements[i]); ++i) { statements[i].directive = statements[i].expression.raw.slice(1, -1); } }; -pp$1.isDirectiveCandidate = function(statement) { +pp$8.isDirectiveCandidate = function(statement) { return ( statement.type === "ExpressionStatement" && statement.expression.type === "Literal" && @@ -13688,12 +17832,12 @@ pp$1.isDirectiveCandidate = function(statement) { ) }; -var pp$2 = Parser.prototype; +var pp$7 = Parser.prototype; // Convert existing expression atom to assignable pattern // if possible. -pp$2.toAssignable = function(node, isBinding, refDestructuringErrors) { +pp$7.toAssignable = function(node, isBinding, refDestructuringErrors) { if (this.options.ecmaVersion >= 6 && node) { switch (node.type) { case "Identifier": @@ -13703,6 +17847,7 @@ pp$2.toAssignable = function(node, isBinding, refDestructuringErrors) { case "ObjectPattern": case "ArrayPattern": + case "AssignmentPattern": case "RestElement": break @@ -13751,9 +17896,6 @@ pp$2.toAssignable = function(node, isBinding, refDestructuringErrors) { node.type = "AssignmentPattern"; delete node.operator; this.toAssignable(node.left, isBinding); - // falls through to AssignmentPattern - - case "AssignmentPattern": break case "ParenthesizedExpression": @@ -13776,7 +17918,7 @@ pp$2.toAssignable = function(node, isBinding, refDestructuringErrors) { // Convert list of expression atoms to binding list. -pp$2.toAssignableList = function(exprList, isBinding) { +pp$7.toAssignableList = function(exprList, isBinding) { var end = exprList.length; for (var i = 0; i < end; i++) { var elt = exprList[i]; @@ -13792,19 +17934,19 @@ pp$2.toAssignableList = function(exprList, isBinding) { // Parses spread element. -pp$2.parseSpread = function(refDestructuringErrors) { +pp$7.parseSpread = function(refDestructuringErrors) { var node = this.startNode(); this.next(); node.argument = this.parseMaybeAssign(false, refDestructuringErrors); return this.finishNode(node, "SpreadElement") }; -pp$2.parseRestBinding = function() { +pp$7.parseRestBinding = function() { var node = this.startNode(); this.next(); // RestElement inside of a function parameter must be an identifier - if (this.options.ecmaVersion === 6 && this.type !== types.name) + if (this.options.ecmaVersion === 6 && this.type !== types$1.name) { this.unexpected(); } node.argument = this.parseBindingAtom(); @@ -13814,36 +17956,36 @@ pp$2.parseRestBinding = function() { // Parses lvalue (assignable) atom. -pp$2.parseBindingAtom = function() { +pp$7.parseBindingAtom = function() { if (this.options.ecmaVersion >= 6) { switch (this.type) { - case types.bracketL: + case types$1.bracketL: var node = this.startNode(); this.next(); - node.elements = this.parseBindingList(types.bracketR, true, true); + node.elements = this.parseBindingList(types$1.bracketR, true, true); return this.finishNode(node, "ArrayPattern") - case types.braceL: + case types$1.braceL: return this.parseObj(true) } } return this.parseIdent() }; -pp$2.parseBindingList = function(close, allowEmpty, allowTrailingComma) { +pp$7.parseBindingList = function(close, allowEmpty, allowTrailingComma) { var elts = [], first = true; while (!this.eat(close)) { if (first) { first = false; } - else { this.expect(types.comma); } - if (allowEmpty && this.type === types.comma) { + else { this.expect(types$1.comma); } + if (allowEmpty && this.type === types$1.comma) { elts.push(null); } else if (allowTrailingComma && this.afterTrailingComma(close)) { break - } else if (this.type === types.ellipsis) { + } else if (this.type === types$1.ellipsis) { var rest = this.parseRestBinding(); this.parseBindingListItem(rest); elts.push(rest); - if (this.type === types.comma) { this.raise(this.start, "Comma is not permitted after the rest element"); } + if (this.type === types$1.comma) { this.raise(this.start, "Comma is not permitted after the rest element"); } this.expect(close); break } else { @@ -13855,102 +17997,334 @@ pp$2.parseBindingList = function(close, allowEmpty, allowTrailingComma) { return elts }; -pp$2.parseBindingListItem = function(param) { +pp$7.parseBindingListItem = function(param) { return param }; // Parses assignment pattern around given atom if possible. -pp$2.parseMaybeDefault = function(startPos, startLoc, left) { +pp$7.parseMaybeDefault = function(startPos, startLoc, left) { left = left || this.parseBindingAtom(); - if (this.options.ecmaVersion < 6 || !this.eat(types.eq)) { return left } + if (this.options.ecmaVersion < 6 || !this.eat(types$1.eq)) { return left } var node = this.startNodeAt(startPos, startLoc); node.left = left; node.right = this.parseMaybeAssign(); return this.finishNode(node, "AssignmentPattern") }; -// Verify that a node is an lval — something that can be assigned -// to. -// bindingType can be either: -// 'var' indicating that the lval creates a 'var' binding -// 'let' indicating that the lval creates a lexical ('let' or 'const') binding -// 'none' indicating that the binding should be checked for illegal identifiers, but not for duplicate references +// The following three functions all verify that a node is an lvalue — +// something that can be bound, or assigned to. In order to do so, they perform +// a variety of checks: +// +// - Check that none of the bound/assigned-to identifiers are reserved words. +// - Record name declarations for bindings in the appropriate scope. +// - Check duplicate argument names, if checkClashes is set. +// +// If a complex binding pattern is encountered (e.g., object and array +// destructuring), the entire pattern is recursively checked. +// +// There are three versions of checkLVal*() appropriate for different +// circumstances: +// +// - checkLValSimple() shall be used if the syntactic construct supports +// nothing other than identifiers and member expressions. Parenthesized +// expressions are also correctly handled. This is generally appropriate for +// constructs for which the spec says +// +// > It is a Syntax Error if AssignmentTargetType of [the production] is not +// > simple. +// +// It is also appropriate for checking if an identifier is valid and not +// defined elsewhere, like import declarations or function/class identifiers. +// +// Examples where this is used include: +// a += …; +// import a from '…'; +// where a is the node to be checked. +// +// - checkLValPattern() shall be used if the syntactic construct supports +// anything checkLValSimple() supports, as well as object and array +// destructuring patterns. This is generally appropriate for constructs for +// which the spec says +// +// > It is a Syntax Error if [the production] is neither an ObjectLiteral nor +// > an ArrayLiteral and AssignmentTargetType of [the production] is not +// > simple. +// +// Examples where this is used include: +// (a = …); +// const a = …; +// try { … } catch (a) { … } +// where a is the node to be checked. +// +// - checkLValInnerPattern() shall be used if the syntactic construct supports +// anything checkLValPattern() supports, as well as default assignment +// patterns, rest elements, and other constructs that may appear within an +// object or array destructuring pattern. +// +// As a special case, function parameters also use checkLValInnerPattern(), +// as they also support defaults and rest constructs. +// +// These functions deliberately support both assignment and binding constructs, +// as the logic for both is exceedingly similar. If the node is the target of +// an assignment, then bindingType should be set to BIND_NONE. Otherwise, it +// should be set to the appropriate BIND_* constant, like BIND_VAR or +// BIND_LEXICAL. +// +// If the function is called with a non-BIND_NONE bindingType, then +// additionally a checkClashes object may be specified to allow checking for +// duplicate argument names. checkClashes is ignored if the provided construct +// is an assignment (i.e., bindingType is BIND_NONE). + +pp$7.checkLValSimple = function(expr, bindingType, checkClashes) { + if ( bindingType === void 0 ) bindingType = BIND_NONE; + + var isBind = bindingType !== BIND_NONE; + + switch (expr.type) { + case "Identifier": + if (this.strict && this.reservedWordsStrictBind.test(expr.name)) + { this.raiseRecoverable(expr.start, (isBind ? "Binding " : "Assigning to ") + expr.name + " in strict mode"); } + if (isBind) { + if (bindingType === BIND_LEXICAL && expr.name === "let") + { this.raiseRecoverable(expr.start, "let is disallowed as a lexically bound name"); } + if (checkClashes) { + if (hasOwn(checkClashes, expr.name)) + { this.raiseRecoverable(expr.start, "Argument name clash"); } + checkClashes[expr.name] = true; + } + if (bindingType !== BIND_OUTSIDE) { this.declareName(expr.name, bindingType, expr.start); } + } + break + + case "ChainExpression": + this.raiseRecoverable(expr.start, "Optional chaining cannot appear in left-hand side"); + break + + case "MemberExpression": + if (isBind) { this.raiseRecoverable(expr.start, "Binding member expression"); } + break + + case "ParenthesizedExpression": + if (isBind) { this.raiseRecoverable(expr.start, "Binding parenthesized expression"); } + return this.checkLValSimple(expr.expression, bindingType, checkClashes) + + default: + this.raise(expr.start, (isBind ? "Binding" : "Assigning to") + " rvalue"); + } +}; + +pp$7.checkLValPattern = function(expr, bindingType, checkClashes) { + if ( bindingType === void 0 ) bindingType = BIND_NONE; + + switch (expr.type) { + case "ObjectPattern": + for (var i = 0, list = expr.properties; i < list.length; i += 1) { + var prop = list[i]; + + this.checkLValInnerPattern(prop, bindingType, checkClashes); + } + break + + case "ArrayPattern": + for (var i$1 = 0, list$1 = expr.elements; i$1 < list$1.length; i$1 += 1) { + var elem = list$1[i$1]; + + if (elem) { this.checkLValInnerPattern(elem, bindingType, checkClashes); } + } + break + + default: + this.checkLValSimple(expr, bindingType, checkClashes); + } +}; + +pp$7.checkLValInnerPattern = function(expr, bindingType, checkClashes) { + if ( bindingType === void 0 ) bindingType = BIND_NONE; + + switch (expr.type) { + case "Property": + // AssignmentProperty has type === "Property" + this.checkLValInnerPattern(expr.value, bindingType, checkClashes); + break + + case "AssignmentPattern": + this.checkLValPattern(expr.left, bindingType, checkClashes); + break + + case "RestElement": + this.checkLValPattern(expr.argument, bindingType, checkClashes); + break + + default: + this.checkLValPattern(expr, bindingType, checkClashes); + } +}; + +// The algorithm used to determine whether a regexp can appear at a + +var TokContext = function TokContext(token, isExpr, preserveSpace, override, generator) { + this.token = token; + this.isExpr = !!isExpr; + this.preserveSpace = !!preserveSpace; + this.override = override; + this.generator = !!generator; +}; + +var types = { + b_stat: new TokContext("{", false), + b_expr: new TokContext("{", true), + b_tmpl: new TokContext("${", false), + p_stat: new TokContext("(", false), + p_expr: new TokContext("(", true), + q_tmpl: new TokContext("`", true, true, function (p) { return p.tryReadTemplateToken(); }), + f_stat: new TokContext("function", false), + f_expr: new TokContext("function", true), + f_expr_gen: new TokContext("function", true, false, null, true), + f_gen: new TokContext("function", false, false, null, true) +}; + +var pp$6 = Parser.prototype; + +pp$6.initialContext = function() { + return [types.b_stat] +}; + +pp$6.curContext = function() { + return this.context[this.context.length - 1] +}; + +pp$6.braceIsBlock = function(prevType) { + var parent = this.curContext(); + if (parent === types.f_expr || parent === types.f_stat) + { return true } + if (prevType === types$1.colon && (parent === types.b_stat || parent === types.b_expr)) + { return !parent.isExpr } -pp$2.checkLVal = function(expr, bindingType, checkClashes) { - if ( bindingType === void 0 ) bindingType = BIND_NONE; + // The check for `tt.name && exprAllowed` detects whether we are + // after a `yield` or `of` construct. See the `updateContext` for + // `tt.name`. + if (prevType === types$1._return || prevType === types$1.name && this.exprAllowed) + { return lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) } + if (prevType === types$1._else || prevType === types$1.semi || prevType === types$1.eof || prevType === types$1.parenR || prevType === types$1.arrow) + { return true } + if (prevType === types$1.braceL) + { return parent === types.b_stat } + if (prevType === types$1._var || prevType === types$1._const || prevType === types$1.name) + { return false } + return !this.exprAllowed +}; - switch (expr.type) { - case "Identifier": - if (bindingType === BIND_LEXICAL && expr.name === "let") - { this.raiseRecoverable(expr.start, "let is disallowed as a lexically bound name"); } - if (this.strict && this.reservedWordsStrictBind.test(expr.name)) - { this.raiseRecoverable(expr.start, (bindingType ? "Binding " : "Assigning to ") + expr.name + " in strict mode"); } - if (checkClashes) { - if (has(checkClashes, expr.name)) - { this.raiseRecoverable(expr.start, "Argument name clash"); } - checkClashes[expr.name] = true; - } - if (bindingType !== BIND_NONE && bindingType !== BIND_OUTSIDE) { this.declareName(expr.name, bindingType, expr.start); } - break +pp$6.inGeneratorContext = function() { + for (var i = this.context.length - 1; i >= 1; i--) { + var context = this.context[i]; + if (context.token === "function") + { return context.generator } + } + return false +}; - case "ChainExpression": - this.raiseRecoverable(expr.start, "Optional chaining cannot appear in left-hand side"); - break +pp$6.updateContext = function(prevType) { + var update, type = this.type; + if (type.keyword && prevType === types$1.dot) + { this.exprAllowed = false; } + else if (update = type.updateContext) + { update.call(this, prevType); } + else + { this.exprAllowed = type.beforeExpr; } +}; - case "MemberExpression": - if (bindingType) { this.raiseRecoverable(expr.start, "Binding member expression"); } - break +// Used to handle egde case when token context could not be inferred correctly in tokenize phase +pp$6.overrideContext = function(tokenCtx) { + if (this.curContext() !== tokenCtx) { + this.context[this.context.length - 1] = tokenCtx; + } +}; - case "ObjectPattern": - for (var i = 0, list = expr.properties; i < list.length; i += 1) - { - var prop = list[i]; +// Token-specific context update code - this.checkLVal(prop, bindingType, checkClashes); +types$1.parenR.updateContext = types$1.braceR.updateContext = function() { + if (this.context.length === 1) { + this.exprAllowed = true; + return } - break + var out = this.context.pop(); + if (out === types.b_stat && this.curContext().token === "function") { + out = this.context.pop(); + } + this.exprAllowed = !out.isExpr; +}; - case "Property": - // AssignmentProperty has type === "Property" - this.checkLVal(expr.value, bindingType, checkClashes); - break +types$1.braceL.updateContext = function(prevType) { + this.context.push(this.braceIsBlock(prevType) ? types.b_stat : types.b_expr); + this.exprAllowed = true; +}; - case "ArrayPattern": - for (var i$1 = 0, list$1 = expr.elements; i$1 < list$1.length; i$1 += 1) { - var elem = list$1[i$1]; +types$1.dollarBraceL.updateContext = function() { + this.context.push(types.b_tmpl); + this.exprAllowed = true; +}; - if (elem) { this.checkLVal(elem, bindingType, checkClashes); } - } - break +types$1.parenL.updateContext = function(prevType) { + var statementParens = prevType === types$1._if || prevType === types$1._for || prevType === types$1._with || prevType === types$1._while; + this.context.push(statementParens ? types.p_stat : types.p_expr); + this.exprAllowed = true; +}; - case "AssignmentPattern": - this.checkLVal(expr.left, bindingType, checkClashes); - break +types$1.incDec.updateContext = function() { + // tokExprAllowed stays unchanged +}; - case "RestElement": - this.checkLVal(expr.argument, bindingType, checkClashes); - break +types$1._function.updateContext = types$1._class.updateContext = function(prevType) { + if (prevType.beforeExpr && prevType !== types$1._else && + !(prevType === types$1.semi && this.curContext() !== types.p_stat) && + !(prevType === types$1._return && lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) && + !((prevType === types$1.colon || prevType === types$1.braceL) && this.curContext() === types.b_stat)) + { this.context.push(types.f_expr); } + else + { this.context.push(types.f_stat); } + this.exprAllowed = false; +}; - case "ParenthesizedExpression": - this.checkLVal(expr.expression, bindingType, checkClashes); - break +types$1.backQuote.updateContext = function() { + if (this.curContext() === types.q_tmpl) + { this.context.pop(); } + else + { this.context.push(types.q_tmpl); } + this.exprAllowed = false; +}; - default: - this.raise(expr.start, (bindingType ? "Binding" : "Assigning to") + " rvalue"); +types$1.star.updateContext = function(prevType) { + if (prevType === types$1._function) { + var index = this.context.length - 1; + if (this.context[index] === types.f_expr) + { this.context[index] = types.f_expr_gen; } + else + { this.context[index] = types.f_gen; } + } + this.exprAllowed = true; +}; + +types$1.name.updateContext = function(prevType) { + var allowed = false; + if (this.options.ecmaVersion >= 6 && prevType !== types$1.dot) { + if (this.value === "of" && !this.exprAllowed || + this.value === "yield" && this.inGeneratorContext()) + { allowed = true; } } + this.exprAllowed = allowed; }; // A recursive descent parser operates by defining functions for all -var pp$3 = Parser.prototype; +var pp$5 = Parser.prototype; // Check if property name clashes with already added. // Object/class getters and setters are not allowed to clash — // either with each other or with an init property — and in // strict mode, init properties are also not allowed to be repeated. -pp$3.checkPropClash = function(prop, propHash, refDestructuringErrors) { +pp$5.checkPropClash = function(prop, propHash, refDestructuringErrors) { if (this.options.ecmaVersion >= 9 && prop.type === "SpreadElement") { return } if (this.options.ecmaVersion >= 6 && (prop.computed || prop.method || prop.shorthand)) @@ -13967,10 +18341,12 @@ pp$3.checkPropClash = function(prop, propHash, refDestructuringErrors) { if (name === "__proto__" && kind === "init") { if (propHash.proto) { if (refDestructuringErrors) { - if (refDestructuringErrors.doubleProto < 0) - { refDestructuringErrors.doubleProto = key.start; } - // Backwards-compat kludge. Can be removed in version 6.0 - } else { this.raiseRecoverable(key.start, "Redefinition of __proto__ property"); } + if (refDestructuringErrors.doubleProto < 0) { + refDestructuringErrors.doubleProto = key.start; + } + } else { + this.raiseRecoverable(key.start, "Redefinition of __proto__ property"); + } } propHash.proto = true; } @@ -14012,13 +18388,13 @@ pp$3.checkPropClash = function(prop, propHash, refDestructuringErrors) { // and object pattern might appear (so it's possible to raise // delayed syntax error at correct position). -pp$3.parseExpression = function(noIn, refDestructuringErrors) { +pp$5.parseExpression = function(forInit, refDestructuringErrors) { var startPos = this.start, startLoc = this.startLoc; - var expr = this.parseMaybeAssign(noIn, refDestructuringErrors); - if (this.type === types.comma) { + var expr = this.parseMaybeAssign(forInit, refDestructuringErrors); + if (this.type === types$1.comma) { var node = this.startNodeAt(startPos, startLoc); node.expressions = [expr]; - while (this.eat(types.comma)) { node.expressions.push(this.parseMaybeAssign(noIn, refDestructuringErrors)); } + while (this.eat(types$1.comma)) { node.expressions.push(this.parseMaybeAssign(forInit, refDestructuringErrors)); } return this.finishNode(node, "SequenceExpression") } return expr @@ -14027,18 +18403,19 @@ pp$3.parseExpression = function(noIn, refDestructuringErrors) { // Parse an assignment expression. This includes applications of // operators like `+=`. -pp$3.parseMaybeAssign = function(noIn, refDestructuringErrors, afterLeftParse) { +pp$5.parseMaybeAssign = function(forInit, refDestructuringErrors, afterLeftParse) { if (this.isContextual("yield")) { - if (this.inGenerator) { return this.parseYield(noIn) } + if (this.inGenerator) { return this.parseYield(forInit) } // The tokenizer will assume an expression is allowed after // `yield`, but this isn't that kind of yield else { this.exprAllowed = false; } } - var ownDestructuringErrors = false, oldParenAssign = -1, oldTrailingComma = -1; + var ownDestructuringErrors = false, oldParenAssign = -1, oldTrailingComma = -1, oldDoubleProto = -1; if (refDestructuringErrors) { oldParenAssign = refDestructuringErrors.parenthesizedAssign; oldTrailingComma = refDestructuringErrors.trailingComma; + oldDoubleProto = refDestructuringErrors.doubleProto; refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = -1; } else { refDestructuringErrors = new DestructuringErrors; @@ -14046,22 +18423,30 @@ pp$3.parseMaybeAssign = function(noIn, refDestructuringErrors, afterLeftParse) { } var startPos = this.start, startLoc = this.startLoc; - if (this.type === types.parenL || this.type === types.name) - { this.potentialArrowAt = this.start; } - var left = this.parseMaybeConditional(noIn, refDestructuringErrors); + if (this.type === types$1.parenL || this.type === types$1.name) { + this.potentialArrowAt = this.start; + this.potentialArrowInForAwait = forInit === "await"; + } + var left = this.parseMaybeConditional(forInit, refDestructuringErrors); if (afterLeftParse) { left = afterLeftParse.call(this, left, startPos, startLoc); } if (this.type.isAssign) { var node = this.startNodeAt(startPos, startLoc); node.operator = this.value; - node.left = this.type === types.eq ? this.toAssignable(left, false, refDestructuringErrors) : left; + if (this.type === types$1.eq) + { left = this.toAssignable(left, false, refDestructuringErrors); } if (!ownDestructuringErrors) { refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = refDestructuringErrors.doubleProto = -1; } - if (refDestructuringErrors.shorthandAssign >= node.left.start) + if (refDestructuringErrors.shorthandAssign >= left.start) { refDestructuringErrors.shorthandAssign = -1; } // reset because shorthand default was used correctly - this.checkLVal(left); + if (this.type === types$1.eq) + { this.checkLValPattern(left); } + else + { this.checkLValSimple(left); } + node.left = left; this.next(); - node.right = this.parseMaybeAssign(noIn); + node.right = this.parseMaybeAssign(forInit); + if (oldDoubleProto > -1) { refDestructuringErrors.doubleProto = oldDoubleProto; } return this.finishNode(node, "AssignmentExpression") } else { if (ownDestructuringErrors) { this.checkExpressionErrors(refDestructuringErrors, true); } @@ -14073,16 +18458,16 @@ pp$3.parseMaybeAssign = function(noIn, refDestructuringErrors, afterLeftParse) { // Parse a ternary conditional (`?:`) operator. -pp$3.parseMaybeConditional = function(noIn, refDestructuringErrors) { +pp$5.parseMaybeConditional = function(forInit, refDestructuringErrors) { var startPos = this.start, startLoc = this.startLoc; - var expr = this.parseExprOps(noIn, refDestructuringErrors); + var expr = this.parseExprOps(forInit, refDestructuringErrors); if (this.checkExpressionErrors(refDestructuringErrors)) { return expr } - if (this.eat(types.question)) { + if (this.eat(types$1.question)) { var node = this.startNodeAt(startPos, startLoc); node.test = expr; node.consequent = this.parseMaybeAssign(); - this.expect(types.colon); - node.alternate = this.parseMaybeAssign(noIn); + this.expect(types$1.colon); + node.alternate = this.parseMaybeAssign(forInit); return this.finishNode(node, "ConditionalExpression") } return expr @@ -14090,11 +18475,11 @@ pp$3.parseMaybeConditional = function(noIn, refDestructuringErrors) { // Start the precedence parser. -pp$3.parseExprOps = function(noIn, refDestructuringErrors) { +pp$5.parseExprOps = function(forInit, refDestructuringErrors) { var startPos = this.start, startLoc = this.startLoc; - var expr = this.parseMaybeUnary(refDestructuringErrors, false); + var expr = this.parseMaybeUnary(refDestructuringErrors, false, false, forInit); if (this.checkExpressionErrors(refDestructuringErrors)) { return expr } - return expr.start === startPos && expr.type === "ArrowFunctionExpression" ? expr : this.parseExprOp(expr, startPos, startLoc, -1, noIn) + return expr.start === startPos && expr.type === "ArrowFunctionExpression" ? expr : this.parseExprOp(expr, startPos, startLoc, -1, forInit) }; // Parse binary operators with the operator precedence parsing @@ -14103,32 +18488,33 @@ pp$3.parseExprOps = function(noIn, refDestructuringErrors) { // defer further parser to one of its callers when it encounters an // operator that has a lower precedence than the set it is parsing. -pp$3.parseExprOp = function(left, leftStartPos, leftStartLoc, minPrec, noIn) { +pp$5.parseExprOp = function(left, leftStartPos, leftStartLoc, minPrec, forInit) { var prec = this.type.binop; - if (prec != null && (!noIn || this.type !== types._in)) { + if (prec != null && (!forInit || this.type !== types$1._in)) { if (prec > minPrec) { - var logical = this.type === types.logicalOR || this.type === types.logicalAND; - var coalesce = this.type === types.coalesce; + var logical = this.type === types$1.logicalOR || this.type === types$1.logicalAND; + var coalesce = this.type === types$1.coalesce; if (coalesce) { // Handle the precedence of `tt.coalesce` as equal to the range of logical expressions. // In other words, `node.right` shouldn't contain logical expressions in order to check the mixed error. - prec = types.logicalAND.binop; + prec = types$1.logicalAND.binop; } var op = this.value; this.next(); var startPos = this.start, startLoc = this.startLoc; - var right = this.parseExprOp(this.parseMaybeUnary(null, false), startPos, startLoc, prec, noIn); + var right = this.parseExprOp(this.parseMaybeUnary(null, false, false, forInit), startPos, startLoc, prec, forInit); var node = this.buildBinary(leftStartPos, leftStartLoc, left, right, op, logical || coalesce); - if ((logical && this.type === types.coalesce) || (coalesce && (this.type === types.logicalOR || this.type === types.logicalAND))) { + if ((logical && this.type === types$1.coalesce) || (coalesce && (this.type === types$1.logicalOR || this.type === types$1.logicalAND))) { this.raiseRecoverable(this.start, "Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"); } - return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec, noIn) + return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec, forInit) } } return left }; -pp$3.buildBinary = function(startPos, startLoc, left, right, op, logical) { +pp$5.buildBinary = function(startPos, startLoc, left, right, op, logical) { + if (right.type === "PrivateIdentifier") { this.raise(right.start, "Private identifier can only be left side of binary expression"); } var node = this.startNodeAt(startPos, startLoc); node.left = left; node.operator = op; @@ -14138,67 +18524,86 @@ pp$3.buildBinary = function(startPos, startLoc, left, right, op, logical) { // Parse unary operators, both prefix and postfix. -pp$3.parseMaybeUnary = function(refDestructuringErrors, sawUnary) { +pp$5.parseMaybeUnary = function(refDestructuringErrors, sawUnary, incDec, forInit) { var startPos = this.start, startLoc = this.startLoc, expr; - if (this.isContextual("await") && (this.inAsync || (!this.inFunction && this.options.allowAwaitOutsideFunction))) { - expr = this.parseAwait(); + if (this.isContextual("await") && this.canAwait) { + expr = this.parseAwait(forInit); sawUnary = true; } else if (this.type.prefix) { - var node = this.startNode(), update = this.type === types.incDec; + var node = this.startNode(), update = this.type === types$1.incDec; node.operator = this.value; node.prefix = true; this.next(); - node.argument = this.parseMaybeUnary(null, true); + node.argument = this.parseMaybeUnary(null, true, update, forInit); this.checkExpressionErrors(refDestructuringErrors, true); - if (update) { this.checkLVal(node.argument); } + if (update) { this.checkLValSimple(node.argument); } else if (this.strict && node.operator === "delete" && node.argument.type === "Identifier") { this.raiseRecoverable(node.start, "Deleting local variable in strict mode"); } + else if (node.operator === "delete" && isPrivateFieldAccess(node.argument)) + { this.raiseRecoverable(node.start, "Private fields can not be deleted"); } else { sawUnary = true; } expr = this.finishNode(node, update ? "UpdateExpression" : "UnaryExpression"); + } else if (!sawUnary && this.type === types$1.privateId) { + if (forInit || this.privateNameStack.length === 0) { this.unexpected(); } + expr = this.parsePrivateIdent(); + // only could be private fields in 'in', such as #x in obj + if (this.type !== types$1._in) { this.unexpected(); } } else { - expr = this.parseExprSubscripts(refDestructuringErrors); + expr = this.parseExprSubscripts(refDestructuringErrors, forInit); if (this.checkExpressionErrors(refDestructuringErrors)) { return expr } while (this.type.postfix && !this.canInsertSemicolon()) { var node$1 = this.startNodeAt(startPos, startLoc); node$1.operator = this.value; node$1.prefix = false; node$1.argument = expr; - this.checkLVal(expr); + this.checkLValSimple(expr); this.next(); expr = this.finishNode(node$1, "UpdateExpression"); } } - if (!sawUnary && this.eat(types.starstar)) - { return this.buildBinary(startPos, startLoc, expr, this.parseMaybeUnary(null, false), "**", false) } - else - { return expr } + if (!incDec && this.eat(types$1.starstar)) { + if (sawUnary) + { this.unexpected(this.lastTokStart); } + else + { return this.buildBinary(startPos, startLoc, expr, this.parseMaybeUnary(null, false, false, forInit), "**", false) } + } else { + return expr + } }; +function isPrivateFieldAccess(node) { + return ( + node.type === "MemberExpression" && node.property.type === "PrivateIdentifier" || + node.type === "ChainExpression" && isPrivateFieldAccess(node.expression) + ) +} + // Parse call, dot, and `[]`-subscript expressions. -pp$3.parseExprSubscripts = function(refDestructuringErrors) { +pp$5.parseExprSubscripts = function(refDestructuringErrors, forInit) { var startPos = this.start, startLoc = this.startLoc; - var expr = this.parseExprAtom(refDestructuringErrors); + var expr = this.parseExprAtom(refDestructuringErrors, forInit); if (expr.type === "ArrowFunctionExpression" && this.input.slice(this.lastTokStart, this.lastTokEnd) !== ")") { return expr } - var result = this.parseSubscripts(expr, startPos, startLoc); + var result = this.parseSubscripts(expr, startPos, startLoc, false, forInit); if (refDestructuringErrors && result.type === "MemberExpression") { if (refDestructuringErrors.parenthesizedAssign >= result.start) { refDestructuringErrors.parenthesizedAssign = -1; } if (refDestructuringErrors.parenthesizedBind >= result.start) { refDestructuringErrors.parenthesizedBind = -1; } + if (refDestructuringErrors.trailingComma >= result.start) { refDestructuringErrors.trailingComma = -1; } } return result }; -pp$3.parseSubscripts = function(base, startPos, startLoc, noCalls) { +pp$5.parseSubscripts = function(base, startPos, startLoc, noCalls, forInit) { var maybeAsyncArrow = this.options.ecmaVersion >= 8 && base.type === "Identifier" && base.name === "async" && this.lastTokEnd === base.end && !this.canInsertSemicolon() && base.end - base.start === 5 && this.potentialArrowAt === base.start; var optionalChained = false; while (true) { - var element = this.parseSubscript(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained); + var element = this.parseSubscript(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained, forInit); if (element.optional) { optionalChained = true; } if (element === base || element.type === "ArrowFunctionExpression") { @@ -14214,29 +18619,35 @@ pp$3.parseSubscripts = function(base, startPos, startLoc, noCalls) { } }; -pp$3.parseSubscript = function(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained) { +pp$5.parseSubscript = function(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained, forInit) { var optionalSupported = this.options.ecmaVersion >= 11; - var optional = optionalSupported && this.eat(types.questionDot); + var optional = optionalSupported && this.eat(types$1.questionDot); if (noCalls && optional) { this.raise(this.lastTokStart, "Optional chaining cannot appear in the callee of new expressions"); } - var computed = this.eat(types.bracketL); - if (computed || (optional && this.type !== types.parenL && this.type !== types.backQuote) || this.eat(types.dot)) { + var computed = this.eat(types$1.bracketL); + if (computed || (optional && this.type !== types$1.parenL && this.type !== types$1.backQuote) || this.eat(types$1.dot)) { var node = this.startNodeAt(startPos, startLoc); node.object = base; - node.property = computed ? this.parseExpression() : this.parseIdent(this.options.allowReserved !== "never"); + if (computed) { + node.property = this.parseExpression(); + this.expect(types$1.bracketR); + } else if (this.type === types$1.privateId && base.type !== "Super") { + node.property = this.parsePrivateIdent(); + } else { + node.property = this.parseIdent(this.options.allowReserved !== "never"); + } node.computed = !!computed; - if (computed) { this.expect(types.bracketR); } if (optionalSupported) { node.optional = optional; } base = this.finishNode(node, "MemberExpression"); - } else if (!noCalls && this.eat(types.parenL)) { + } else if (!noCalls && this.eat(types$1.parenL)) { var refDestructuringErrors = new DestructuringErrors, oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; this.yieldPos = 0; this.awaitPos = 0; this.awaitIdentPos = 0; - var exprList = this.parseExprList(types.parenR, this.options.ecmaVersion >= 8, false, refDestructuringErrors); - if (maybeAsyncArrow && !optional && !this.canInsertSemicolon() && this.eat(types.arrow)) { + var exprList = this.parseExprList(types$1.parenR, this.options.ecmaVersion >= 8, false, refDestructuringErrors); + if (maybeAsyncArrow && !optional && !this.canInsertSemicolon() && this.eat(types$1.arrow)) { this.checkPatternErrors(refDestructuringErrors, false); this.checkYieldAwaitInDefaultParams(); if (this.awaitIdentPos > 0) @@ -14244,7 +18655,7 @@ pp$3.parseSubscript = function(base, startPos, startLoc, noCalls, maybeAsyncArro this.yieldPos = oldYieldPos; this.awaitPos = oldAwaitPos; this.awaitIdentPos = oldAwaitIdentPos; - return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, true) + return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, true, forInit) } this.checkExpressionErrors(refDestructuringErrors, true); this.yieldPos = oldYieldPos || this.yieldPos; @@ -14257,7 +18668,7 @@ pp$3.parseSubscript = function(base, startPos, startLoc, noCalls, maybeAsyncArro node$1.optional = optional; } base = this.finishNode(node$1, "CallExpression"); - } else if (this.type === types.backQuote) { + } else if (this.type === types$1.backQuote) { if (optional || optionalChained) { this.raise(this.start, "Optional chaining cannot appear in the tag of tagged template expressions"); } @@ -14274,19 +18685,19 @@ pp$3.parseSubscript = function(base, startPos, startLoc, noCalls, maybeAsyncArro // `new`, or an expression wrapped in punctuation like `()`, `[]`, // or `{}`. -pp$3.parseExprAtom = function(refDestructuringErrors) { +pp$5.parseExprAtom = function(refDestructuringErrors, forInit) { // If a division operator appears in an expression position, the // tokenizer got confused, and we force it to read a regexp instead. - if (this.type === types.slash) { this.readRegexp(); } + if (this.type === types$1.slash) { this.readRegexp(); } var node, canBeArrow = this.potentialArrowAt === this.start; switch (this.type) { - case types._super: + case types$1._super: if (!this.allowSuper) { this.raise(this.start, "'super' keyword outside a method"); } node = this.startNode(); this.next(); - if (this.type === types.parenL && !this.allowDirectSuper) + if (this.type === types$1.parenL && !this.allowDirectSuper) { this.raise(node.start, "super() call outside constructor of a subclass"); } // The `super` keyword can appear at below: // SuperProperty: @@ -14294,50 +18705,53 @@ pp$3.parseExprAtom = function(refDestructuringErrors) { // super . IdentifierName // SuperCall: // super ( Arguments ) - if (this.type !== types.dot && this.type !== types.bracketL && this.type !== types.parenL) + if (this.type !== types$1.dot && this.type !== types$1.bracketL && this.type !== types$1.parenL) { this.unexpected(); } return this.finishNode(node, "Super") - case types._this: + case types$1._this: node = this.startNode(); this.next(); return this.finishNode(node, "ThisExpression") - case types.name: + case types$1.name: var startPos = this.start, startLoc = this.startLoc, containsEsc = this.containsEsc; var id = this.parseIdent(false); - if (this.options.ecmaVersion >= 8 && !containsEsc && id.name === "async" && !this.canInsertSemicolon() && this.eat(types._function)) - { return this.parseFunction(this.startNodeAt(startPos, startLoc), 0, false, true) } + if (this.options.ecmaVersion >= 8 && !containsEsc && id.name === "async" && !this.canInsertSemicolon() && this.eat(types$1._function)) { + this.overrideContext(types.f_expr); + return this.parseFunction(this.startNodeAt(startPos, startLoc), 0, false, true, forInit) + } if (canBeArrow && !this.canInsertSemicolon()) { - if (this.eat(types.arrow)) - { return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], false) } - if (this.options.ecmaVersion >= 8 && id.name === "async" && this.type === types.name && !containsEsc) { + if (this.eat(types$1.arrow)) + { return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], false, forInit) } + if (this.options.ecmaVersion >= 8 && id.name === "async" && this.type === types$1.name && !containsEsc && + (!this.potentialArrowInForAwait || this.value !== "of" || this.containsEsc)) { id = this.parseIdent(false); - if (this.canInsertSemicolon() || !this.eat(types.arrow)) + if (this.canInsertSemicolon() || !this.eat(types$1.arrow)) { this.unexpected(); } - return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], true) + return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], true, forInit) } } return id - case types.regexp: + case types$1.regexp: var value = this.value; node = this.parseLiteral(value.value); node.regex = {pattern: value.pattern, flags: value.flags}; return node - case types.num: case types.string: + case types$1.num: case types$1.string: return this.parseLiteral(this.value) - case types._null: case types._true: case types._false: + case types$1._null: case types$1._true: case types$1._false: node = this.startNode(); - node.value = this.type === types._null ? null : this.type === types._true; + node.value = this.type === types$1._null ? null : this.type === types$1._true; node.raw = this.type.keyword; this.next(); return this.finishNode(node, "Literal") - case types.parenL: - var start = this.start, expr = this.parseParenAndDistinguishExpression(canBeArrow); + case types$1.parenL: + var start = this.start, expr = this.parseParenAndDistinguishExpression(canBeArrow, forInit); if (refDestructuringErrors) { if (refDestructuringErrors.parenthesizedAssign < 0 && !this.isSimpleAssignTarget(expr)) { refDestructuringErrors.parenthesizedAssign = start; } @@ -14346,30 +18760,31 @@ pp$3.parseExprAtom = function(refDestructuringErrors) { } return expr - case types.bracketL: + case types$1.bracketL: node = this.startNode(); this.next(); - node.elements = this.parseExprList(types.bracketR, true, true, refDestructuringErrors); + node.elements = this.parseExprList(types$1.bracketR, true, true, refDestructuringErrors); return this.finishNode(node, "ArrayExpression") - case types.braceL: + case types$1.braceL: + this.overrideContext(types.b_expr); return this.parseObj(false, refDestructuringErrors) - case types._function: + case types$1._function: node = this.startNode(); this.next(); return this.parseFunction(node, 0) - case types._class: + case types$1._class: return this.parseClass(this.startNode(), false) - case types._new: + case types$1._new: return this.parseNew() - case types.backQuote: + case types$1.backQuote: return this.parseTemplate() - case types._import: + case types$1._import: if (this.options.ecmaVersion >= 11) { return this.parseExprImport() } else { @@ -14381,7 +18796,7 @@ pp$3.parseExprAtom = function(refDestructuringErrors) { } }; -pp$3.parseExprImport = function() { +pp$5.parseExprImport = function() { var node = this.startNode(); // Consume `import` as an identifier for `import.meta`. @@ -14390,9 +18805,9 @@ pp$3.parseExprImport = function() { var meta = this.parseIdent(true); switch (this.type) { - case types.parenL: + case types$1.parenL: return this.parseDynamicImport(node) - case types.dot: + case types$1.dot: node.meta = meta; return this.parseImportMeta(node) default: @@ -14400,16 +18815,16 @@ pp$3.parseExprImport = function() { } }; -pp$3.parseDynamicImport = function(node) { +pp$5.parseDynamicImport = function(node) { this.next(); // skip `(` // Parse node.source. node.source = this.parseMaybeAssign(); // Verify ending. - if (!this.eat(types.parenR)) { + if (!this.eat(types$1.parenR)) { var errorPos = this.start; - if (this.eat(types.comma) && this.eat(types.parenR)) { + if (this.eat(types$1.comma) && this.eat(types$1.parenR)) { this.raiseRecoverable(errorPos, "Trailing comma is not allowed in import()"); } else { this.unexpected(errorPos); @@ -14419,7 +18834,7 @@ pp$3.parseDynamicImport = function(node) { return this.finishNode(node, "ImportExpression") }; -pp$3.parseImportMeta = function(node) { +pp$5.parseImportMeta = function(node) { this.next(); // skip `.` var containsEsc = this.containsEsc; @@ -14429,29 +18844,29 @@ pp$3.parseImportMeta = function(node) { { this.raiseRecoverable(node.property.start, "The only valid meta property for import is 'import.meta'"); } if (containsEsc) { this.raiseRecoverable(node.start, "'import.meta' must not contain escaped characters"); } - if (this.options.sourceType !== "module") + if (this.options.sourceType !== "module" && !this.options.allowImportExportEverywhere) { this.raiseRecoverable(node.start, "Cannot use 'import.meta' outside a module"); } return this.finishNode(node, "MetaProperty") }; -pp$3.parseLiteral = function(value) { +pp$5.parseLiteral = function(value) { var node = this.startNode(); node.value = value; node.raw = this.input.slice(this.start, this.end); - if (node.raw.charCodeAt(node.raw.length - 1) === 110) { node.bigint = node.raw.slice(0, -1); } + if (node.raw.charCodeAt(node.raw.length - 1) === 110) { node.bigint = node.raw.slice(0, -1).replace(/_/g, ""); } this.next(); return this.finishNode(node, "Literal") }; -pp$3.parseParenExpression = function() { - this.expect(types.parenL); +pp$5.parseParenExpression = function() { + this.expect(types$1.parenL); var val = this.parseExpression(); - this.expect(types.parenR); + this.expect(types$1.parenR); return val }; -pp$3.parseParenAndDistinguishExpression = function(canBeArrow) { +pp$5.parseParenAndDistinguishExpression = function(canBeArrow, forInit) { var startPos = this.start, startLoc = this.startLoc, val, allowTrailingComma = this.options.ecmaVersion >= 8; if (this.options.ecmaVersion >= 6) { this.next(); @@ -14462,29 +18877,29 @@ pp$3.parseParenAndDistinguishExpression = function(canBeArrow) { this.yieldPos = 0; this.awaitPos = 0; // Do not save awaitIdentPos to allow checking awaits nested in parameters - while (this.type !== types.parenR) { - first ? first = false : this.expect(types.comma); - if (allowTrailingComma && this.afterTrailingComma(types.parenR, true)) { + while (this.type !== types$1.parenR) { + first ? first = false : this.expect(types$1.comma); + if (allowTrailingComma && this.afterTrailingComma(types$1.parenR, true)) { lastIsComma = true; break - } else if (this.type === types.ellipsis) { + } else if (this.type === types$1.ellipsis) { spreadStart = this.start; exprList.push(this.parseParenItem(this.parseRestBinding())); - if (this.type === types.comma) { this.raise(this.start, "Comma is not permitted after the rest element"); } + if (this.type === types$1.comma) { this.raise(this.start, "Comma is not permitted after the rest element"); } break } else { exprList.push(this.parseMaybeAssign(false, refDestructuringErrors, this.parseParenItem)); } } - var innerEndPos = this.start, innerEndLoc = this.startLoc; - this.expect(types.parenR); + var innerEndPos = this.lastTokEnd, innerEndLoc = this.lastTokEndLoc; + this.expect(types$1.parenR); - if (canBeArrow && !this.canInsertSemicolon() && this.eat(types.arrow)) { + if (canBeArrow && !this.canInsertSemicolon() && this.eat(types$1.arrow)) { this.checkPatternErrors(refDestructuringErrors, false); this.checkYieldAwaitInDefaultParams(); this.yieldPos = oldYieldPos; this.awaitPos = oldAwaitPos; - return this.parseParenArrowList(startPos, startLoc, exprList) + return this.parseParenArrowList(startPos, startLoc, exprList, forInit) } if (!exprList.length || lastIsComma) { this.unexpected(this.lastTokStart); } @@ -14513,12 +18928,12 @@ pp$3.parseParenAndDistinguishExpression = function(canBeArrow) { } }; -pp$3.parseParenItem = function(item) { +pp$5.parseParenItem = function(item) { return item }; -pp$3.parseParenArrowList = function(startPos, startLoc, exprList) { - return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList) +pp$5.parseParenArrowList = function(startPos, startLoc, exprList, forInit) { + return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, false, forInit) }; // New's precedence is slightly tricky. It must allow its argument to @@ -14527,13 +18942,13 @@ pp$3.parseParenArrowList = function(startPos, startLoc, exprList) { // argument to parseSubscripts to prevent it from consuming the // argument list. -var empty$1 = []; +var empty = []; -pp$3.parseNew = function() { +pp$5.parseNew = function() { if (this.containsEsc) { this.raiseRecoverable(this.start, "Escape sequence in keyword new"); } var node = this.startNode(); var meta = this.parseIdent(true); - if (this.options.ecmaVersion >= 6 && this.eat(types.dot)) { + if (this.options.ecmaVersion >= 6 && this.eat(types$1.dot)) { node.meta = meta; var containsEsc = this.containsEsc; node.property = this.parseIdent(true); @@ -14541,27 +18956,27 @@ pp$3.parseNew = function() { { this.raiseRecoverable(node.property.start, "The only valid meta property for new is 'new.target'"); } if (containsEsc) { this.raiseRecoverable(node.start, "'new.target' must not contain escaped characters"); } - if (!this.inNonArrowFunction()) - { this.raiseRecoverable(node.start, "'new.target' can only be used in functions"); } + if (!this.allowNewDotTarget) + { this.raiseRecoverable(node.start, "'new.target' can only be used in functions and class static block"); } return this.finishNode(node, "MetaProperty") } - var startPos = this.start, startLoc = this.startLoc, isImport = this.type === types._import; - node.callee = this.parseSubscripts(this.parseExprAtom(), startPos, startLoc, true); + var startPos = this.start, startLoc = this.startLoc, isImport = this.type === types$1._import; + node.callee = this.parseSubscripts(this.parseExprAtom(), startPos, startLoc, true, false); if (isImport && node.callee.type === "ImportExpression") { this.raise(startPos, "Cannot use new with import()"); } - if (this.eat(types.parenL)) { node.arguments = this.parseExprList(types.parenR, this.options.ecmaVersion >= 8, false); } - else { node.arguments = empty$1; } + if (this.eat(types$1.parenL)) { node.arguments = this.parseExprList(types$1.parenR, this.options.ecmaVersion >= 8, false); } + else { node.arguments = empty; } return this.finishNode(node, "NewExpression") }; // Parse template expression. -pp$3.parseTemplateElement = function(ref) { +pp$5.parseTemplateElement = function(ref) { var isTagged = ref.isTagged; var elem = this.startNode(); - if (this.type === types.invalidTemplate) { + if (this.type === types$1.invalidTemplate) { if (!isTagged) { this.raiseRecoverable(this.start, "Bad escape sequence in untagged template literal"); } @@ -14576,11 +18991,11 @@ pp$3.parseTemplateElement = function(ref) { }; } this.next(); - elem.tail = this.type === types.backQuote; + elem.tail = this.type === types$1.backQuote; return this.finishNode(elem, "TemplateElement") }; -pp$3.parseTemplate = function(ref) { +pp$5.parseTemplate = function(ref) { if ( ref === void 0 ) ref = {}; var isTagged = ref.isTagged; if ( isTagged === void 0 ) isTagged = false; @@ -14590,32 +19005,32 @@ pp$3.parseTemplate = function(ref) { var curElt = this.parseTemplateElement({isTagged: isTagged}); node.quasis = [curElt]; while (!curElt.tail) { - if (this.type === types.eof) { this.raise(this.pos, "Unterminated template literal"); } - this.expect(types.dollarBraceL); + if (this.type === types$1.eof) { this.raise(this.pos, "Unterminated template literal"); } + this.expect(types$1.dollarBraceL); node.expressions.push(this.parseExpression()); - this.expect(types.braceR); + this.expect(types$1.braceR); node.quasis.push(curElt = this.parseTemplateElement({isTagged: isTagged})); } this.next(); return this.finishNode(node, "TemplateLiteral") }; -pp$3.isAsyncProp = function(prop) { +pp$5.isAsyncProp = function(prop) { return !prop.computed && prop.key.type === "Identifier" && prop.key.name === "async" && - (this.type === types.name || this.type === types.num || this.type === types.string || this.type === types.bracketL || this.type.keyword || (this.options.ecmaVersion >= 9 && this.type === types.star)) && + (this.type === types$1.name || this.type === types$1.num || this.type === types$1.string || this.type === types$1.bracketL || this.type.keyword || (this.options.ecmaVersion >= 9 && this.type === types$1.star)) && !lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) }; // Parse an object literal or binding pattern. -pp$3.parseObj = function(isPattern, refDestructuringErrors) { +pp$5.parseObj = function(isPattern, refDestructuringErrors) { var node = this.startNode(), first = true, propHash = {}; node.properties = []; this.next(); - while (!this.eat(types.braceR)) { + while (!this.eat(types$1.braceR)) { if (!first) { - this.expect(types.comma); - if (this.options.ecmaVersion >= 5 && this.afterTrailingComma(types.braceR)) { break } + this.expect(types$1.comma); + if (this.options.ecmaVersion >= 5 && this.afterTrailingComma(types$1.braceR)) { break } } else { first = false; } var prop = this.parseProperty(isPattern, refDestructuringErrors); @@ -14625,18 +19040,18 @@ pp$3.parseObj = function(isPattern, refDestructuringErrors) { return this.finishNode(node, isPattern ? "ObjectPattern" : "ObjectExpression") }; -pp$3.parseProperty = function(isPattern, refDestructuringErrors) { +pp$5.parseProperty = function(isPattern, refDestructuringErrors) { var prop = this.startNode(), isGenerator, isAsync, startPos, startLoc; - if (this.options.ecmaVersion >= 9 && this.eat(types.ellipsis)) { + if (this.options.ecmaVersion >= 9 && this.eat(types$1.ellipsis)) { if (isPattern) { prop.argument = this.parseIdent(false); - if (this.type === types.comma) { + if (this.type === types$1.comma) { this.raise(this.start, "Comma is not permitted after the rest element"); } return this.finishNode(prop, "RestElement") } // To disallow parenthesized identifier via `this.toAssignable()`. - if (this.type === types.parenL && refDestructuringErrors) { + if (this.type === types$1.parenL && refDestructuringErrors) { if (refDestructuringErrors.parenthesizedAssign < 0) { refDestructuringErrors.parenthesizedAssign = this.start; } @@ -14647,7 +19062,7 @@ pp$3.parseProperty = function(isPattern, refDestructuringErrors) { // Parse argument. prop.argument = this.parseMaybeAssign(false, refDestructuringErrors); // To disallow trailing comma via `this.toAssignable()`. - if (this.type === types.comma && refDestructuringErrors && refDestructuringErrors.trailingComma < 0) { + if (this.type === types$1.comma && refDestructuringErrors && refDestructuringErrors.trailingComma < 0) { refDestructuringErrors.trailingComma = this.start; } // Finish @@ -14661,13 +19076,13 @@ pp$3.parseProperty = function(isPattern, refDestructuringErrors) { startLoc = this.startLoc; } if (!isPattern) - { isGenerator = this.eat(types.star); } + { isGenerator = this.eat(types$1.star); } } var containsEsc = this.containsEsc; this.parsePropertyName(prop); if (!isPattern && !containsEsc && this.options.ecmaVersion >= 8 && !isGenerator && this.isAsyncProp(prop)) { isAsync = true; - isGenerator = this.options.ecmaVersion >= 9 && this.eat(types.star); + isGenerator = this.options.ecmaVersion >= 9 && this.eat(types$1.star); this.parsePropertyName(prop, refDestructuringErrors); } else { isAsync = false; @@ -14676,14 +19091,14 @@ pp$3.parseProperty = function(isPattern, refDestructuringErrors) { return this.finishNode(prop, "Property") }; -pp$3.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc) { - if ((isGenerator || isAsync) && this.type === types.colon) +pp$5.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc) { + if ((isGenerator || isAsync) && this.type === types$1.colon) { this.unexpected(); } - if (this.eat(types.colon)) { + if (this.eat(types$1.colon)) { prop.value = isPattern ? this.parseMaybeDefault(this.start, this.startLoc) : this.parseMaybeAssign(false, refDestructuringErrors); prop.kind = "init"; - } else if (this.options.ecmaVersion >= 6 && this.type === types.parenL) { + } else if (this.options.ecmaVersion >= 6 && this.type === types$1.parenL) { if (isPattern) { this.unexpected(); } prop.kind = "init"; prop.method = true; @@ -14691,7 +19106,7 @@ pp$3.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startP } else if (!isPattern && !containsEsc && this.options.ecmaVersion >= 5 && !prop.computed && prop.key.type === "Identifier" && (prop.key.name === "get" || prop.key.name === "set") && - (this.type !== types.comma && this.type !== types.braceR && this.type !== types.eq)) { + (this.type !== types$1.comma && this.type !== types$1.braceR && this.type !== types$1.eq)) { if (isGenerator || isAsync) { this.unexpected(); } prop.kind = prop.key.name; this.parsePropertyName(prop); @@ -14714,35 +19129,35 @@ pp$3.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startP { this.awaitIdentPos = startPos; } prop.kind = "init"; if (isPattern) { - prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key); - } else if (this.type === types.eq && refDestructuringErrors) { + prop.value = this.parseMaybeDefault(startPos, startLoc, this.copyNode(prop.key)); + } else if (this.type === types$1.eq && refDestructuringErrors) { if (refDestructuringErrors.shorthandAssign < 0) { refDestructuringErrors.shorthandAssign = this.start; } - prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key); + prop.value = this.parseMaybeDefault(startPos, startLoc, this.copyNode(prop.key)); } else { - prop.value = prop.key; + prop.value = this.copyNode(prop.key); } prop.shorthand = true; } else { this.unexpected(); } }; -pp$3.parsePropertyName = function(prop) { +pp$5.parsePropertyName = function(prop) { if (this.options.ecmaVersion >= 6) { - if (this.eat(types.bracketL)) { + if (this.eat(types$1.bracketL)) { prop.computed = true; prop.key = this.parseMaybeAssign(); - this.expect(types.bracketR); + this.expect(types$1.bracketR); return prop.key } else { prop.computed = false; } } - return prop.key = this.type === types.num || this.type === types.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== "never") + return prop.key = this.type === types$1.num || this.type === types$1.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== "never") }; // Initialize empty function node. -pp$3.initFunction = function(node) { +pp$5.initFunction = function(node) { node.id = null; if (this.options.ecmaVersion >= 6) { node.generator = node.expression = false; } if (this.options.ecmaVersion >= 8) { node.async = false; } @@ -14750,7 +19165,7 @@ pp$3.initFunction = function(node) { // Parse object or class method. -pp$3.parseMethod = function(isGenerator, isAsync, allowDirectSuper) { +pp$5.parseMethod = function(isGenerator, isAsync, allowDirectSuper) { var node = this.startNode(), oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; this.initFunction(node); @@ -14764,10 +19179,10 @@ pp$3.parseMethod = function(isGenerator, isAsync, allowDirectSuper) { this.awaitIdentPos = 0; this.enterScope(functionFlags(isAsync, node.generator) | SCOPE_SUPER | (allowDirectSuper ? SCOPE_DIRECT_SUPER : 0)); - this.expect(types.parenL); - node.params = this.parseBindingList(types.parenR, false, this.options.ecmaVersion >= 8); + this.expect(types$1.parenL); + node.params = this.parseBindingList(types$1.parenR, false, this.options.ecmaVersion >= 8); this.checkYieldAwaitInDefaultParams(); - this.parseFunctionBody(node, false, true); + this.parseFunctionBody(node, false, true, false); this.yieldPos = oldYieldPos; this.awaitPos = oldAwaitPos; @@ -14777,7 +19192,7 @@ pp$3.parseMethod = function(isGenerator, isAsync, allowDirectSuper) { // Parse arrow function expression with given parameters. -pp$3.parseArrowExpression = function(node, params, isAsync) { +pp$5.parseArrowExpression = function(node, params, isAsync, forInit) { var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; this.enterScope(functionFlags(isAsync, false) | SCOPE_ARROW); @@ -14789,7 +19204,7 @@ pp$3.parseArrowExpression = function(node, params, isAsync) { this.awaitIdentPos = 0; node.params = this.toAssignableList(params, true); - this.parseFunctionBody(node, true, false); + this.parseFunctionBody(node, true, false, forInit); this.yieldPos = oldYieldPos; this.awaitPos = oldAwaitPos; @@ -14799,12 +19214,12 @@ pp$3.parseArrowExpression = function(node, params, isAsync) { // Parse function body and check parameters. -pp$3.parseFunctionBody = function(node, isArrowFunction, isMethod) { - var isExpression = isArrowFunction && this.type !== types.braceL; +pp$5.parseFunctionBody = function(node, isArrowFunction, isMethod, forInit) { + var isExpression = isArrowFunction && this.type !== types$1.braceL; var oldStrict = this.strict, useStrict = false; if (isExpression) { - node.body = this.parseMaybeAssign(); + node.body = this.parseMaybeAssign(forInit); node.expression = true; this.checkParams(node, false); } else { @@ -14827,7 +19242,7 @@ pp$3.parseFunctionBody = function(node, isArrowFunction, isMethod) { // if a let/const declaration in the function clashes with one of the params. this.checkParams(node, !oldStrict && !useStrict && !isArrowFunction && !isMethod && this.isSimpleParamList(node.params)); // Ensure the function name isn't a forbidden identifier in strict mode, e.g. 'eval' - if (this.strict && node.id) { this.checkLVal(node.id, BIND_OUTSIDE); } + if (this.strict && node.id) { this.checkLValSimple(node.id, BIND_OUTSIDE); } node.body = this.parseBlock(false, undefined, useStrict && !oldStrict); node.expression = false; this.adaptDirectivePrologue(node.body.body); @@ -14836,7 +19251,7 @@ pp$3.parseFunctionBody = function(node, isArrowFunction, isMethod) { this.exitScope(); }; -pp$3.isSimpleParamList = function(params) { +pp$5.isSimpleParamList = function(params) { for (var i = 0, list = params; i < list.length; i += 1) { var param = list[i]; @@ -14849,13 +19264,13 @@ pp$3.isSimpleParamList = function(params) { // Checks function params for various disallowed patterns such as using "eval" // or "arguments" and duplicate parameters. -pp$3.checkParams = function(node, allowDuplicates) { - var nameHash = {}; +pp$5.checkParams = function(node, allowDuplicates) { + var nameHash = Object.create(null); for (var i = 0, list = node.params; i < list.length; i += 1) { var param = list[i]; - this.checkLVal(param, BIND_VAR, allowDuplicates ? null : nameHash); + this.checkLValInnerPattern(param, BIND_VAR, allowDuplicates ? null : nameHash); } }; @@ -14865,20 +19280,20 @@ pp$3.checkParams = function(node, allowDuplicates) { // nothing in between them to be parsed as `null` (which is needed // for array literals). -pp$3.parseExprList = function(close, allowTrailingComma, allowEmpty, refDestructuringErrors) { +pp$5.parseExprList = function(close, allowTrailingComma, allowEmpty, refDestructuringErrors) { var elts = [], first = true; while (!this.eat(close)) { if (!first) { - this.expect(types.comma); + this.expect(types$1.comma); if (allowTrailingComma && this.afterTrailingComma(close)) { break } } else { first = false; } var elt = (void 0); - if (allowEmpty && this.type === types.comma) + if (allowEmpty && this.type === types$1.comma) { elt = null; } - else if (this.type === types.ellipsis) { + else if (this.type === types$1.ellipsis) { elt = this.parseSpread(refDestructuringErrors); - if (refDestructuringErrors && this.type === types.comma && refDestructuringErrors.trailingComma < 0) + if (refDestructuringErrors && this.type === types$1.comma && refDestructuringErrors.trailingComma < 0) { refDestructuringErrors.trailingComma = this.start; } } else { elt = this.parseMaybeAssign(false, refDestructuringErrors); @@ -14888,7 +19303,7 @@ pp$3.parseExprList = function(close, allowTrailingComma, allowEmpty, refDestruct return elts }; -pp$3.checkUnreserved = function(ref) { +pp$5.checkUnreserved = function(ref) { var start = ref.start; var end = ref.end; var name = ref.name; @@ -14897,6 +19312,10 @@ pp$3.checkUnreserved = function(ref) { { this.raiseRecoverable(start, "Cannot use 'yield' as identifier inside a generator"); } if (this.inAsync && name === "await") { this.raiseRecoverable(start, "Cannot use 'await' as identifier inside an async function"); } + if (this.currentThisScope().inClassFieldInit && name === "arguments") + { this.raiseRecoverable(start, "Cannot use 'arguments' in class field initializer"); } + if (this.inClassStaticBlock && (name === "arguments" || name === "await")) + { this.raise(start, ("Cannot use " + name + " in class static initialization block")); } if (this.keywords.test(name)) { this.raise(start, ("Unexpected keyword '" + name + "'")); } if (this.options.ecmaVersion < 6 && @@ -14913,9 +19332,9 @@ pp$3.checkUnreserved = function(ref) { // when parsing properties), it will also convert keywords into // identifiers. -pp$3.parseIdent = function(liberal, isBinding) { +pp$5.parseIdent = function(liberal, isBinding) { var node = this.startNode(); - if (this.type === types.name) { + if (this.type === types$1.name) { node.name = this.value; } else if (this.type.keyword) { node.name = this.type.keyword; @@ -14941,29 +19360,49 @@ pp$3.parseIdent = function(liberal, isBinding) { return node }; +pp$5.parsePrivateIdent = function() { + var node = this.startNode(); + if (this.type === types$1.privateId) { + node.name = this.value; + } else { + this.unexpected(); + } + this.next(); + this.finishNode(node, "PrivateIdentifier"); + + // For validating existence + if (this.privateNameStack.length === 0) { + this.raise(node.start, ("Private field '#" + (node.name) + "' must be declared in an enclosing class")); + } else { + this.privateNameStack[this.privateNameStack.length - 1].used.push(node); + } + + return node +}; + // Parses yield expression inside generator. -pp$3.parseYield = function(noIn) { +pp$5.parseYield = function(forInit) { if (!this.yieldPos) { this.yieldPos = this.start; } var node = this.startNode(); this.next(); - if (this.type === types.semi || this.canInsertSemicolon() || (this.type !== types.star && !this.type.startsExpr)) { + if (this.type === types$1.semi || this.canInsertSemicolon() || (this.type !== types$1.star && !this.type.startsExpr)) { node.delegate = false; node.argument = null; } else { - node.delegate = this.eat(types.star); - node.argument = this.parseMaybeAssign(noIn); + node.delegate = this.eat(types$1.star); + node.argument = this.parseMaybeAssign(forInit); } return this.finishNode(node, "YieldExpression") }; -pp$3.parseAwait = function() { +pp$5.parseAwait = function(forInit) { if (!this.awaitPos) { this.awaitPos = this.start; } var node = this.startNode(); this.next(); - node.argument = this.parseMaybeUnary(null, false); + node.argument = this.parseMaybeUnary(null, true, false, forInit); return this.finishNode(node, "AwaitExpression") }; @@ -14991,9 +19430,9 @@ pp$4.curPosition = function() { } }; -var pp$5 = Parser.prototype; +var pp$3 = Parser.prototype; -var Scope$1 = function Scope(flags) { +var Scope = function Scope(flags) { this.flags = flags; // A list of var-declared names in the current lexical scope this.var = []; @@ -15001,26 +19440,28 @@ var Scope$1 = function Scope(flags) { this.lexical = []; // A list of lexically-declared FunctionDeclaration names in the current lexical scope this.functions = []; + // A switch to disallow the identifier reference 'arguments' + this.inClassFieldInit = false; }; // The functions in this module keep track of declared variables in the current scope in order to detect duplicate variable names. -pp$5.enterScope = function(flags) { - this.scopeStack.push(new Scope$1(flags)); +pp$3.enterScope = function(flags) { + this.scopeStack.push(new Scope(flags)); }; -pp$5.exitScope = function() { +pp$3.exitScope = function() { this.scopeStack.pop(); }; // The spec says: // > At the top level of a function, or script, function declarations are // > treated like var declarations rather than like lexical declarations. -pp$5.treatFunctionsAsVarInScope = function(scope) { +pp$3.treatFunctionsAsVarInScope = function(scope) { return (scope.flags & SCOPE_FUNCTION) || !this.inModule && (scope.flags & SCOPE_TOP) }; -pp$5.declareName = function(name, bindingType, pos) { +pp$3.declareName = function(name, bindingType, pos) { var redeclared = false; if (bindingType === BIND_LEXICAL) { var scope = this.currentScope(); @@ -15055,219 +19496,83 @@ pp$5.declareName = function(name, bindingType, pos) { if (redeclared) { this.raiseRecoverable(pos, ("Identifier '" + name + "' has already been declared")); } }; -pp$5.checkLocalExport = function(id) { +pp$3.checkLocalExport = function(id) { // scope.functions must be empty as Module code is always strict. if (this.scopeStack[0].lexical.indexOf(id.name) === -1 && this.scopeStack[0].var.indexOf(id.name) === -1) { - this.undefinedExports[id.name] = id; - } -}; - -pp$5.currentScope = function() { - return this.scopeStack[this.scopeStack.length - 1] -}; - -pp$5.currentVarScope = function() { - for (var i = this.scopeStack.length - 1;; i--) { - var scope = this.scopeStack[i]; - if (scope.flags & SCOPE_VAR) { return scope } - } -}; - -// Could be useful for `this`, `new.target`, `super()`, `super.property`, and `super[property]`. -pp$5.currentThisScope = function() { - for (var i = this.scopeStack.length - 1;; i--) { - var scope = this.scopeStack[i]; - if (scope.flags & SCOPE_VAR && !(scope.flags & SCOPE_ARROW)) { return scope } - } -}; - -var Node = function Node(parser, pos, loc) { - this.type = ""; - this.start = pos; - this.end = 0; - if (parser.options.locations) - { this.loc = new SourceLocation(parser, loc); } - if (parser.options.directSourceFile) - { this.sourceFile = parser.options.directSourceFile; } - if (parser.options.ranges) - { this.range = [pos, 0]; } -}; - -// Start an AST node, attaching a start offset. - -var pp$6 = Parser.prototype; - -pp$6.startNode = function() { - return new Node(this, this.start, this.startLoc) -}; - -pp$6.startNodeAt = function(pos, loc) { - return new Node(this, pos, loc) -}; - -// Finish an AST node, adding `type` and `end` properties. - -function finishNodeAt(node, type, pos, loc) { - node.type = type; - node.end = pos; - if (this.options.locations) - { node.loc.end = loc; } - if (this.options.ranges) - { node.range[1] = pos; } - return node -} - -pp$6.finishNode = function(node, type) { - return finishNodeAt.call(this, node, type, this.lastTokEnd, this.lastTokEndLoc) -}; - -// Finish node at given position - -pp$6.finishNodeAt = function(node, type, pos, loc) { - return finishNodeAt.call(this, node, type, pos, loc) -}; - -// The algorithm used to determine whether a regexp can appear at a - -var TokContext = function TokContext(token, isExpr, preserveSpace, override, generator) { - this.token = token; - this.isExpr = !!isExpr; - this.preserveSpace = !!preserveSpace; - this.override = override; - this.generator = !!generator; -}; - -var types$1 = { - b_stat: new TokContext("{", false), - b_expr: new TokContext("{", true), - b_tmpl: new TokContext("${", false), - p_stat: new TokContext("(", false), - p_expr: new TokContext("(", true), - q_tmpl: new TokContext("`", true, true, function (p) { return p.tryReadTemplateToken(); }), - f_stat: new TokContext("function", false), - f_expr: new TokContext("function", true), - f_expr_gen: new TokContext("function", true, false, null, true), - f_gen: new TokContext("function", false, false, null, true) -}; - -var pp$7 = Parser.prototype; - -pp$7.initialContext = function() { - return [types$1.b_stat] -}; - -pp$7.braceIsBlock = function(prevType) { - var parent = this.curContext(); - if (parent === types$1.f_expr || parent === types$1.f_stat) - { return true } - if (prevType === types.colon && (parent === types$1.b_stat || parent === types$1.b_expr)) - { return !parent.isExpr } - - // The check for `tt.name && exprAllowed` detects whether we are - // after a `yield` or `of` construct. See the `updateContext` for - // `tt.name`. - if (prevType === types._return || prevType === types.name && this.exprAllowed) - { return lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) } - if (prevType === types._else || prevType === types.semi || prevType === types.eof || prevType === types.parenR || prevType === types.arrow) - { return true } - if (prevType === types.braceL) - { return parent === types$1.b_stat } - if (prevType === types._var || prevType === types._const || prevType === types.name) - { return false } - return !this.exprAllowed -}; - -pp$7.inGeneratorContext = function() { - for (var i = this.context.length - 1; i >= 1; i--) { - var context = this.context[i]; - if (context.token === "function") - { return context.generator } - } - return false -}; - -pp$7.updateContext = function(prevType) { - var update, type = this.type; - if (type.keyword && prevType === types.dot) - { this.exprAllowed = false; } - else if (update = type.updateContext) - { update.call(this, prevType); } - else - { this.exprAllowed = type.beforeExpr; } -}; - -// Token-specific context update code - -types.parenR.updateContext = types.braceR.updateContext = function() { - if (this.context.length === 1) { - this.exprAllowed = true; - return - } - var out = this.context.pop(); - if (out === types$1.b_stat && this.curContext().token === "function") { - out = this.context.pop(); + this.undefinedExports[id.name] = id; } - this.exprAllowed = !out.isExpr; }; -types.braceL.updateContext = function(prevType) { - this.context.push(this.braceIsBlock(prevType) ? types$1.b_stat : types$1.b_expr); - this.exprAllowed = true; +pp$3.currentScope = function() { + return this.scopeStack[this.scopeStack.length - 1] }; -types.dollarBraceL.updateContext = function() { - this.context.push(types$1.b_tmpl); - this.exprAllowed = true; +pp$3.currentVarScope = function() { + for (var i = this.scopeStack.length - 1;; i--) { + var scope = this.scopeStack[i]; + if (scope.flags & SCOPE_VAR) { return scope } + } }; -types.parenL.updateContext = function(prevType) { - var statementParens = prevType === types._if || prevType === types._for || prevType === types._with || prevType === types._while; - this.context.push(statementParens ? types$1.p_stat : types$1.p_expr); - this.exprAllowed = true; +// Could be useful for `this`, `new.target`, `super()`, `super.property`, and `super[property]`. +pp$3.currentThisScope = function() { + for (var i = this.scopeStack.length - 1;; i--) { + var scope = this.scopeStack[i]; + if (scope.flags & SCOPE_VAR && !(scope.flags & SCOPE_ARROW)) { return scope } + } }; -types.incDec.updateContext = function() { - // tokExprAllowed stays unchanged +var Node = function Node(parser, pos, loc) { + this.type = ""; + this.start = pos; + this.end = 0; + if (parser.options.locations) + { this.loc = new SourceLocation(parser, loc); } + if (parser.options.directSourceFile) + { this.sourceFile = parser.options.directSourceFile; } + if (parser.options.ranges) + { this.range = [pos, 0]; } }; -types._function.updateContext = types._class.updateContext = function(prevType) { - if (prevType.beforeExpr && prevType !== types.semi && prevType !== types._else && - !(prevType === types._return && lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) && - !((prevType === types.colon || prevType === types.braceL) && this.curContext() === types$1.b_stat)) - { this.context.push(types$1.f_expr); } - else - { this.context.push(types$1.f_stat); } - this.exprAllowed = false; +// Start an AST node, attaching a start offset. + +var pp$2 = Parser.prototype; + +pp$2.startNode = function() { + return new Node(this, this.start, this.startLoc) }; -types.backQuote.updateContext = function() { - if (this.curContext() === types$1.q_tmpl) - { this.context.pop(); } - else - { this.context.push(types$1.q_tmpl); } - this.exprAllowed = false; +pp$2.startNodeAt = function(pos, loc) { + return new Node(this, pos, loc) }; -types.star.updateContext = function(prevType) { - if (prevType === types._function) { - var index = this.context.length - 1; - if (this.context[index] === types$1.f_expr) - { this.context[index] = types$1.f_expr_gen; } - else - { this.context[index] = types$1.f_gen; } - } - this.exprAllowed = true; +// Finish an AST node, adding `type` and `end` properties. + +function finishNodeAt(node, type, pos, loc) { + node.type = type; + node.end = pos; + if (this.options.locations) + { node.loc.end = loc; } + if (this.options.ranges) + { node.range[1] = pos; } + return node +} + +pp$2.finishNode = function(node, type) { + return finishNodeAt.call(this, node, type, this.lastTokEnd, this.lastTokEndLoc) }; -types.name.updateContext = function(prevType) { - var allowed = false; - if (this.options.ecmaVersion >= 6 && prevType !== types.dot) { - if (this.value === "of" && !this.exprAllowed || - this.value === "yield" && this.inGeneratorContext()) - { allowed = true; } - } - this.exprAllowed = allowed; +// Finish node at given position + +pp$2.finishNodeAt = function(node, type, pos, loc) { + return finishNodeAt.call(this, node, type, pos, loc) +}; + +pp$2.copyNode = function(node) { + var newNode = new Node(this, node.start, this.startLoc); + for (var prop in node) { newNode[prop] = node[prop]; } + return newNode }; // This file contains Unicode properties extracted from the ECMAScript @@ -15278,23 +19583,31 @@ types.name.updateContext = function(prevType) { var ecma9BinaryProperties = "ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS"; var ecma10BinaryProperties = ecma9BinaryProperties + " Extended_Pictographic"; var ecma11BinaryProperties = ecma10BinaryProperties; +var ecma12BinaryProperties = ecma11BinaryProperties + " EBase EComp EMod EPres ExtPict"; +var ecma13BinaryProperties = ecma12BinaryProperties; var unicodeBinaryProperties = { 9: ecma9BinaryProperties, 10: ecma10BinaryProperties, - 11: ecma11BinaryProperties + 11: ecma11BinaryProperties, + 12: ecma12BinaryProperties, + 13: ecma13BinaryProperties }; // #table-unicode-general-category-values var unicodeGeneralCategoryValues = "Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu"; // #table-unicode-script-values -var ecma9ScriptValues = "Adlam Adlm Ahom Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb"; +var ecma9ScriptValues = "Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb"; var ecma10ScriptValues = ecma9ScriptValues + " Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd"; var ecma11ScriptValues = ecma10ScriptValues + " Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho"; +var ecma12ScriptValues = ecma11ScriptValues + " Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi"; +var ecma13ScriptValues = ecma12ScriptValues + " Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith"; var unicodeScriptValues = { 9: ecma9ScriptValues, 10: ecma10ScriptValues, - 11: ecma11ScriptValues + 11: ecma11ScriptValues, + 12: ecma12ScriptValues, + 13: ecma13ScriptValues }; var data = {}; @@ -15312,16 +19625,19 @@ function buildUnicodeData(ecmaVersion) { d.nonBinary.sc = d.nonBinary.Script; d.nonBinary.scx = d.nonBinary.Script_Extensions; } -buildUnicodeData(9); -buildUnicodeData(10); -buildUnicodeData(11); -var pp$8 = Parser.prototype; +for (var i = 0, list = [9, 10, 11, 12, 13]; i < list.length; i += 1) { + var ecmaVersion = list[i]; + + buildUnicodeData(ecmaVersion); +} + +var pp$1 = Parser.prototype; var RegExpValidationState = function RegExpValidationState(parser) { this.parser = parser; - this.validFlags = "gim" + (parser.options.ecmaVersion >= 6 ? "uy" : "") + (parser.options.ecmaVersion >= 9 ? "s" : ""); - this.unicodeProperties = data[parser.options.ecmaVersion >= 11 ? 11 : parser.options.ecmaVersion]; + this.validFlags = "gim" + (parser.options.ecmaVersion >= 6 ? "uy" : "") + (parser.options.ecmaVersion >= 9 ? "s" : "") + (parser.options.ecmaVersion >= 13 ? "d" : ""); + this.unicodeProperties = data[parser.options.ecmaVersion >= 13 ? 13 : parser.options.ecmaVersion]; this.source = ""; this.flags = ""; this.start = 0; @@ -15412,19 +19728,13 @@ RegExpValidationState.prototype.eat = function eat (ch, forceU) { return false }; -function codePointToString(ch) { - if (ch <= 0xFFFF) { return String.fromCharCode(ch) } - ch -= 0x10000; - return String.fromCharCode((ch >> 10) + 0xD800, (ch & 0x03FF) + 0xDC00) -} - /** * Validate the flags part of a given RegExpLiteral. * * @param {RegExpValidationState} state The state to validate RegExp. * @returns {void} */ -pp$8.validateRegExpFlags = function(state) { +pp$1.validateRegExpFlags = function(state) { var validFlags = state.validFlags; var flags = state.flags; @@ -15445,7 +19755,7 @@ pp$8.validateRegExpFlags = function(state) { * @param {RegExpValidationState} state The state to validate RegExp. * @returns {void} */ -pp$8.validateRegExpPattern = function(state) { +pp$1.validateRegExpPattern = function(state) { this.regexp_pattern(state); // The goal symbol for the parse is |Pattern[~U, ~N]|. If the result of @@ -15460,7 +19770,7 @@ pp$8.validateRegExpPattern = function(state) { }; // https://www.ecma-international.org/ecma-262/8.0/#prod-Pattern -pp$8.regexp_pattern = function(state) { +pp$1.regexp_pattern = function(state) { state.pos = 0; state.lastIntValue = 0; state.lastStringValue = ""; @@ -15494,7 +19804,7 @@ pp$8.regexp_pattern = function(state) { }; // https://www.ecma-international.org/ecma-262/8.0/#prod-Disjunction -pp$8.regexp_disjunction = function(state) { +pp$1.regexp_disjunction = function(state) { this.regexp_alternative(state); while (state.eat(0x7C /* | */)) { this.regexp_alternative(state); @@ -15510,13 +19820,13 @@ pp$8.regexp_disjunction = function(state) { }; // https://www.ecma-international.org/ecma-262/8.0/#prod-Alternative -pp$8.regexp_alternative = function(state) { +pp$1.regexp_alternative = function(state) { while (state.pos < state.source.length && this.regexp_eatTerm(state)) { } }; // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Term -pp$8.regexp_eatTerm = function(state) { +pp$1.regexp_eatTerm = function(state) { if (this.regexp_eatAssertion(state)) { // Handle `QuantifiableAssertion Quantifier` alternative. // `state.lastAssertionIsQuantifiable` is true if the last eaten Assertion @@ -15539,7 +19849,7 @@ pp$8.regexp_eatTerm = function(state) { }; // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Assertion -pp$8.regexp_eatAssertion = function(state) { +pp$1.regexp_eatAssertion = function(state) { var start = state.pos; state.lastAssertionIsQuantifiable = false; @@ -15577,7 +19887,7 @@ pp$8.regexp_eatAssertion = function(state) { }; // https://www.ecma-international.org/ecma-262/8.0/#prod-Quantifier -pp$8.regexp_eatQuantifier = function(state, noError) { +pp$1.regexp_eatQuantifier = function(state, noError) { if ( noError === void 0 ) noError = false; if (this.regexp_eatQuantifierPrefix(state, noError)) { @@ -15588,7 +19898,7 @@ pp$8.regexp_eatQuantifier = function(state, noError) { }; // https://www.ecma-international.org/ecma-262/8.0/#prod-QuantifierPrefix -pp$8.regexp_eatQuantifierPrefix = function(state, noError) { +pp$1.regexp_eatQuantifierPrefix = function(state, noError) { return ( state.eat(0x2A /* * */) || state.eat(0x2B /* + */) || @@ -15596,7 +19906,7 @@ pp$8.regexp_eatQuantifierPrefix = function(state, noError) { this.regexp_eatBracedQuantifier(state, noError) ) }; -pp$8.regexp_eatBracedQuantifier = function(state, noError) { +pp$1.regexp_eatBracedQuantifier = function(state, noError) { var start = state.pos; if (state.eat(0x7B /* { */)) { var min = 0, max = -1; @@ -15622,7 +19932,7 @@ pp$8.regexp_eatBracedQuantifier = function(state, noError) { }; // https://www.ecma-international.org/ecma-262/8.0/#prod-Atom -pp$8.regexp_eatAtom = function(state) { +pp$1.regexp_eatAtom = function(state) { return ( this.regexp_eatPatternCharacters(state) || state.eat(0x2E /* . */) || @@ -15632,7 +19942,7 @@ pp$8.regexp_eatAtom = function(state) { this.regexp_eatCapturingGroup(state) ) }; -pp$8.regexp_eatReverseSolidusAtomEscape = function(state) { +pp$1.regexp_eatReverseSolidusAtomEscape = function(state) { var start = state.pos; if (state.eat(0x5C /* \ */)) { if (this.regexp_eatAtomEscape(state)) { @@ -15642,7 +19952,7 @@ pp$8.regexp_eatReverseSolidusAtomEscape = function(state) { } return false }; -pp$8.regexp_eatUncapturingGroup = function(state) { +pp$1.regexp_eatUncapturingGroup = function(state) { var start = state.pos; if (state.eat(0x28 /* ( */)) { if (state.eat(0x3F /* ? */) && state.eat(0x3A /* : */)) { @@ -15656,7 +19966,7 @@ pp$8.regexp_eatUncapturingGroup = function(state) { } return false }; -pp$8.regexp_eatCapturingGroup = function(state) { +pp$1.regexp_eatCapturingGroup = function(state) { if (state.eat(0x28 /* ( */)) { if (this.options.ecmaVersion >= 9) { this.regexp_groupSpecifier(state); @@ -15674,7 +19984,7 @@ pp$8.regexp_eatCapturingGroup = function(state) { }; // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedAtom -pp$8.regexp_eatExtendedAtom = function(state) { +pp$1.regexp_eatExtendedAtom = function(state) { return ( state.eat(0x2E /* . */) || this.regexp_eatReverseSolidusAtomEscape(state) || @@ -15687,7 +19997,7 @@ pp$8.regexp_eatExtendedAtom = function(state) { }; // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-InvalidBracedQuantifier -pp$8.regexp_eatInvalidBracedQuantifier = function(state) { +pp$1.regexp_eatInvalidBracedQuantifier = function(state) { if (this.regexp_eatBracedQuantifier(state, true)) { state.raise("Nothing to repeat"); } @@ -15695,7 +20005,7 @@ pp$8.regexp_eatInvalidBracedQuantifier = function(state) { }; // https://www.ecma-international.org/ecma-262/8.0/#prod-SyntaxCharacter -pp$8.regexp_eatSyntaxCharacter = function(state) { +pp$1.regexp_eatSyntaxCharacter = function(state) { var ch = state.current(); if (isSyntaxCharacter(ch)) { state.lastIntValue = ch; @@ -15717,7 +20027,7 @@ function isSyntaxCharacter(ch) { // https://www.ecma-international.org/ecma-262/8.0/#prod-PatternCharacter // But eat eager. -pp$8.regexp_eatPatternCharacters = function(state) { +pp$1.regexp_eatPatternCharacters = function(state) { var start = state.pos; var ch = 0; while ((ch = state.current()) !== -1 && !isSyntaxCharacter(ch)) { @@ -15727,7 +20037,7 @@ pp$8.regexp_eatPatternCharacters = function(state) { }; // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedPatternCharacter -pp$8.regexp_eatExtendedPatternCharacter = function(state) { +pp$1.regexp_eatExtendedPatternCharacter = function(state) { var ch = state.current(); if ( ch !== -1 && @@ -15748,7 +20058,7 @@ pp$8.regexp_eatExtendedPatternCharacter = function(state) { // GroupSpecifier :: // [empty] // `?` GroupName -pp$8.regexp_groupSpecifier = function(state) { +pp$1.regexp_groupSpecifier = function(state) { if (state.eat(0x3F /* ? */)) { if (this.regexp_eatGroupName(state)) { if (state.groupNames.indexOf(state.lastStringValue) !== -1) { @@ -15764,7 +20074,7 @@ pp$8.regexp_groupSpecifier = function(state) { // GroupName :: // `<` RegExpIdentifierName `>` // Note: this updates `state.lastStringValue` property with the eaten name. -pp$8.regexp_eatGroupName = function(state) { +pp$1.regexp_eatGroupName = function(state) { state.lastStringValue = ""; if (state.eat(0x3C /* < */)) { if (this.regexp_eatRegExpIdentifierName(state) && state.eat(0x3E /* > */)) { @@ -15779,7 +20089,7 @@ pp$8.regexp_eatGroupName = function(state) { // RegExpIdentifierStart // RegExpIdentifierName RegExpIdentifierPart // Note: this updates `state.lastStringValue` property with the eaten name. -pp$8.regexp_eatRegExpIdentifierName = function(state) { +pp$1.regexp_eatRegExpIdentifierName = function(state) { state.lastStringValue = ""; if (this.regexp_eatRegExpIdentifierStart(state)) { state.lastStringValue += codePointToString(state.lastIntValue); @@ -15796,7 +20106,7 @@ pp$8.regexp_eatRegExpIdentifierName = function(state) { // `$` // `_` // `\` RegExpUnicodeEscapeSequence[+U] -pp$8.regexp_eatRegExpIdentifierStart = function(state) { +pp$1.regexp_eatRegExpIdentifierStart = function(state) { var start = state.pos; var forceU = this.options.ecmaVersion >= 11; var ch = state.current(forceU); @@ -15824,7 +20134,7 @@ function isRegExpIdentifierStart(ch) { // `\` RegExpUnicodeEscapeSequence[+U] // // -pp$8.regexp_eatRegExpIdentifierPart = function(state) { +pp$1.regexp_eatRegExpIdentifierPart = function(state) { var start = state.pos; var forceU = this.options.ecmaVersion >= 11; var ch = state.current(forceU); @@ -15846,7 +20156,7 @@ function isRegExpIdentifierPart(ch) { } // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-AtomEscape -pp$8.regexp_eatAtomEscape = function(state) { +pp$1.regexp_eatAtomEscape = function(state) { if ( this.regexp_eatBackReference(state) || this.regexp_eatCharacterClassEscape(state) || @@ -15864,7 +20174,7 @@ pp$8.regexp_eatAtomEscape = function(state) { } return false }; -pp$8.regexp_eatBackReference = function(state) { +pp$1.regexp_eatBackReference = function(state) { var start = state.pos; if (this.regexp_eatDecimalEscape(state)) { var n = state.lastIntValue; @@ -15882,7 +20192,7 @@ pp$8.regexp_eatBackReference = function(state) { } return false }; -pp$8.regexp_eatKGroupName = function(state) { +pp$1.regexp_eatKGroupName = function(state) { if (state.eat(0x6B /* k */)) { if (this.regexp_eatGroupName(state)) { state.backReferenceNames.push(state.lastStringValue); @@ -15894,7 +20204,7 @@ pp$8.regexp_eatKGroupName = function(state) { }; // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-CharacterEscape -pp$8.regexp_eatCharacterEscape = function(state) { +pp$1.regexp_eatCharacterEscape = function(state) { return ( this.regexp_eatControlEscape(state) || this.regexp_eatCControlLetter(state) || @@ -15905,7 +20215,7 @@ pp$8.regexp_eatCharacterEscape = function(state) { this.regexp_eatIdentityEscape(state) ) }; -pp$8.regexp_eatCControlLetter = function(state) { +pp$1.regexp_eatCControlLetter = function(state) { var start = state.pos; if (state.eat(0x63 /* c */)) { if (this.regexp_eatControlLetter(state)) { @@ -15915,7 +20225,7 @@ pp$8.regexp_eatCControlLetter = function(state) { } return false }; -pp$8.regexp_eatZero = function(state) { +pp$1.regexp_eatZero = function(state) { if (state.current() === 0x30 /* 0 */ && !isDecimalDigit(state.lookahead())) { state.lastIntValue = 0; state.advance(); @@ -15925,7 +20235,7 @@ pp$8.regexp_eatZero = function(state) { }; // https://www.ecma-international.org/ecma-262/8.0/#prod-ControlEscape -pp$8.regexp_eatControlEscape = function(state) { +pp$1.regexp_eatControlEscape = function(state) { var ch = state.current(); if (ch === 0x74 /* t */) { state.lastIntValue = 0x09; /* \t */ @@ -15956,7 +20266,7 @@ pp$8.regexp_eatControlEscape = function(state) { }; // https://www.ecma-international.org/ecma-262/8.0/#prod-ControlLetter -pp$8.regexp_eatControlLetter = function(state) { +pp$1.regexp_eatControlLetter = function(state) { var ch = state.current(); if (isControlLetter(ch)) { state.lastIntValue = ch % 0x20; @@ -15973,7 +20283,7 @@ function isControlLetter(ch) { } // https://www.ecma-international.org/ecma-262/8.0/#prod-RegExpUnicodeEscapeSequence -pp$8.regexp_eatRegExpUnicodeEscapeSequence = function(state, forceU) { +pp$1.regexp_eatRegExpUnicodeEscapeSequence = function(state, forceU) { if ( forceU === void 0 ) forceU = false; var start = state.pos; @@ -16018,7 +20328,7 @@ function isValidUnicode(ch) { } // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-IdentityEscape -pp$8.regexp_eatIdentityEscape = function(state) { +pp$1.regexp_eatIdentityEscape = function(state) { if (state.switchU) { if (this.regexp_eatSyntaxCharacter(state)) { return true @@ -16041,7 +20351,7 @@ pp$8.regexp_eatIdentityEscape = function(state) { }; // https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalEscape -pp$8.regexp_eatDecimalEscape = function(state) { +pp$1.regexp_eatDecimalEscape = function(state) { state.lastIntValue = 0; var ch = state.current(); if (ch >= 0x31 /* 1 */ && ch <= 0x39 /* 9 */) { @@ -16055,7 +20365,7 @@ pp$8.regexp_eatDecimalEscape = function(state) { }; // https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClassEscape -pp$8.regexp_eatCharacterClassEscape = function(state) { +pp$1.regexp_eatCharacterClassEscape = function(state) { var ch = state.current(); if (isCharacterClassEscape(ch)) { @@ -16097,7 +20407,7 @@ function isCharacterClassEscape(ch) { // UnicodePropertyValueExpression :: // UnicodePropertyName `=` UnicodePropertyValue // LoneUnicodePropertyNameOrValue -pp$8.regexp_eatUnicodePropertyValueExpression = function(state) { +pp$1.regexp_eatUnicodePropertyValueExpression = function(state) { var start = state.pos; // UnicodePropertyName `=` UnicodePropertyValue @@ -16119,20 +20429,20 @@ pp$8.regexp_eatUnicodePropertyValueExpression = function(state) { } return false }; -pp$8.regexp_validateUnicodePropertyNameAndValue = function(state, name, value) { - if (!has(state.unicodeProperties.nonBinary, name)) +pp$1.regexp_validateUnicodePropertyNameAndValue = function(state, name, value) { + if (!hasOwn(state.unicodeProperties.nonBinary, name)) { state.raise("Invalid property name"); } if (!state.unicodeProperties.nonBinary[name].test(value)) { state.raise("Invalid property value"); } }; -pp$8.regexp_validateUnicodePropertyNameOrValue = function(state, nameOrValue) { +pp$1.regexp_validateUnicodePropertyNameOrValue = function(state, nameOrValue) { if (!state.unicodeProperties.binary.test(nameOrValue)) { state.raise("Invalid property name"); } }; // UnicodePropertyName :: // UnicodePropertyNameCharacters -pp$8.regexp_eatUnicodePropertyName = function(state) { +pp$1.regexp_eatUnicodePropertyName = function(state) { var ch = 0; state.lastStringValue = ""; while (isUnicodePropertyNameCharacter(ch = state.current())) { @@ -16147,7 +20457,7 @@ function isUnicodePropertyNameCharacter(ch) { // UnicodePropertyValue :: // UnicodePropertyValueCharacters -pp$8.regexp_eatUnicodePropertyValue = function(state) { +pp$1.regexp_eatUnicodePropertyValue = function(state) { var ch = 0; state.lastStringValue = ""; while (isUnicodePropertyValueCharacter(ch = state.current())) { @@ -16162,12 +20472,12 @@ function isUnicodePropertyValueCharacter(ch) { // LoneUnicodePropertyNameOrValue :: // UnicodePropertyValueCharacters -pp$8.regexp_eatLoneUnicodePropertyNameOrValue = function(state) { +pp$1.regexp_eatLoneUnicodePropertyNameOrValue = function(state) { return this.regexp_eatUnicodePropertyValue(state) }; // https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClass -pp$8.regexp_eatCharacterClass = function(state) { +pp$1.regexp_eatCharacterClass = function(state) { if (state.eat(0x5B /* [ */)) { state.eat(0x5E /* ^ */); this.regexp_classRanges(state); @@ -16183,7 +20493,7 @@ pp$8.regexp_eatCharacterClass = function(state) { // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassRanges // https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRanges // https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRangesNoDash -pp$8.regexp_classRanges = function(state) { +pp$1.regexp_classRanges = function(state) { while (this.regexp_eatClassAtom(state)) { var left = state.lastIntValue; if (state.eat(0x2D /* - */) && this.regexp_eatClassAtom(state)) { @@ -16200,7 +20510,7 @@ pp$8.regexp_classRanges = function(state) { // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassAtom // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassAtomNoDash -pp$8.regexp_eatClassAtom = function(state) { +pp$1.regexp_eatClassAtom = function(state) { var start = state.pos; if (state.eat(0x5C /* \ */)) { @@ -16229,7 +20539,7 @@ pp$8.regexp_eatClassAtom = function(state) { }; // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassEscape -pp$8.regexp_eatClassEscape = function(state) { +pp$1.regexp_eatClassEscape = function(state) { var start = state.pos; if (state.eat(0x62 /* b */)) { @@ -16256,7 +20566,7 @@ pp$8.regexp_eatClassEscape = function(state) { }; // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassControlLetter -pp$8.regexp_eatClassControlLetter = function(state) { +pp$1.regexp_eatClassControlLetter = function(state) { var ch = state.current(); if (isDecimalDigit(ch) || ch === 0x5F /* _ */) { state.lastIntValue = ch % 0x20; @@ -16267,7 +20577,7 @@ pp$8.regexp_eatClassControlLetter = function(state) { }; // https://www.ecma-international.org/ecma-262/8.0/#prod-HexEscapeSequence -pp$8.regexp_eatHexEscapeSequence = function(state) { +pp$1.regexp_eatHexEscapeSequence = function(state) { var start = state.pos; if (state.eat(0x78 /* x */)) { if (this.regexp_eatFixedHexDigits(state, 2)) { @@ -16282,7 +20592,7 @@ pp$8.regexp_eatHexEscapeSequence = function(state) { }; // https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalDigits -pp$8.regexp_eatDecimalDigits = function(state) { +pp$1.regexp_eatDecimalDigits = function(state) { var start = state.pos; var ch = 0; state.lastIntValue = 0; @@ -16297,7 +20607,7 @@ function isDecimalDigit(ch) { } // https://www.ecma-international.org/ecma-262/8.0/#prod-HexDigits -pp$8.regexp_eatHexDigits = function(state) { +pp$1.regexp_eatHexDigits = function(state) { var start = state.pos; var ch = 0; state.lastIntValue = 0; @@ -16326,7 +20636,7 @@ function hexToInt(ch) { // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-LegacyOctalEscapeSequence // Allows only 0-377(octal) i.e. 0-255(decimal). -pp$8.regexp_eatLegacyOctalEscapeSequence = function(state) { +pp$1.regexp_eatLegacyOctalEscapeSequence = function(state) { if (this.regexp_eatOctalDigit(state)) { var n1 = state.lastIntValue; if (this.regexp_eatOctalDigit(state)) { @@ -16345,7 +20655,7 @@ pp$8.regexp_eatLegacyOctalEscapeSequence = function(state) { }; // https://www.ecma-international.org/ecma-262/8.0/#prod-OctalDigit -pp$8.regexp_eatOctalDigit = function(state) { +pp$1.regexp_eatOctalDigit = function(state) { var ch = state.current(); if (isOctalDigit(ch)) { state.lastIntValue = ch - 0x30; /* 0 */ @@ -16362,7 +20672,7 @@ function isOctalDigit(ch) { // https://www.ecma-international.org/ecma-262/8.0/#prod-Hex4Digits // https://www.ecma-international.org/ecma-262/8.0/#prod-HexDigit // And HexDigit HexDigit in https://www.ecma-international.org/ecma-262/8.0/#prod-HexEscapeSequence -pp$8.regexp_eatFixedHexDigits = function(state, length) { +pp$1.regexp_eatFixedHexDigits = function(state, length) { var start = state.pos; state.lastIntValue = 0; for (var i = 0; i < length; ++i) { @@ -16394,11 +20704,11 @@ var Token = function Token(p) { // ## Tokenizer -var pp$9 = Parser.prototype; +var pp = Parser.prototype; // Move to the next token -pp$9.next = function(ignoreEscapeSequenceInKeyword) { +pp.next = function(ignoreEscapeSequenceInKeyword) { if (!ignoreEscapeSequenceInKeyword && this.type.keyword && this.containsEsc) { this.raiseRecoverable(this.start, "Escape sequence in keyword " + this.type.keyword); } if (this.options.onToken) @@ -16411,21 +20721,21 @@ pp$9.next = function(ignoreEscapeSequenceInKeyword) { this.nextToken(); }; -pp$9.getToken = function() { +pp.getToken = function() { this.next(); return new Token(this) }; // If we're in an ES6 environment, make parsers iterable if (typeof Symbol !== "undefined") - { pp$9[Symbol.iterator] = function() { - var this$1 = this; + { pp[Symbol.iterator] = function() { + var this$1$1 = this; return { next: function () { - var token = this$1.getToken(); + var token = this$1$1.getToken(); return { - done: token.type === types.eof, + done: token.type === types$1.eof, value: token } } @@ -16435,26 +20745,22 @@ if (typeof Symbol !== "undefined") // Toggle strict mode. Re-reads the next number or string to please // pedantic tests (`"use strict"; 010;` should fail). -pp$9.curContext = function() { - return this.context[this.context.length - 1] -}; - // Read a single token, updating the parser object's token-related // properties. -pp$9.nextToken = function() { +pp.nextToken = function() { var curContext = this.curContext(); if (!curContext || !curContext.preserveSpace) { this.skipSpace(); } this.start = this.pos; if (this.options.locations) { this.startLoc = this.curPosition(); } - if (this.pos >= this.input.length) { return this.finishToken(types.eof) } + if (this.pos >= this.input.length) { return this.finishToken(types$1.eof) } if (curContext.override) { return curContext.override(this) } else { this.readToken(this.fullCharCodeAtPos()); } }; -pp$9.readToken = function(code) { +pp.readToken = function(code) { // Identifier or keyword. '\uXXXX' sequences are allowed in // identifiers, so '\' also dispatches to that. if (isIdentifierStart(code, this.options.ecmaVersion >= 6) || code === 92 /* '\' */) @@ -16463,24 +20769,22 @@ pp$9.readToken = function(code) { return this.getTokenFromCode(code) }; -pp$9.fullCharCodeAtPos = function() { +pp.fullCharCodeAtPos = function() { var code = this.input.charCodeAt(this.pos); - if (code <= 0xd7ff || code >= 0xe000) { return code } + if (code <= 0xd7ff || code >= 0xdc00) { return code } var next = this.input.charCodeAt(this.pos + 1); - return (code << 10) + next - 0x35fdc00 + return next <= 0xdbff || next >= 0xe000 ? code : (code << 10) + next - 0x35fdc00 }; -pp$9.skipBlockComment = function() { +pp.skipBlockComment = function() { var startLoc = this.options.onComment && this.curPosition(); var start = this.pos, end = this.input.indexOf("*/", this.pos += 2); if (end === -1) { this.raise(this.pos - 2, "Unterminated comment"); } this.pos = end + 2; if (this.options.locations) { - lineBreakG.lastIndex = start; - var match; - while ((match = lineBreakG.exec(this.input)) && match.index < this.pos) { + for (var nextBreak = (void 0), pos = start; (nextBreak = nextLineBreak(this.input, pos, this.pos)) > -1;) { ++this.curLine; - this.lineStart = match.index + match[0].length; + pos = this.lineStart = nextBreak; } } if (this.options.onComment) @@ -16488,7 +20792,7 @@ pp$9.skipBlockComment = function() { startLoc, this.curPosition()); } }; -pp$9.skipLineComment = function(startSkip) { +pp.skipLineComment = function(startSkip) { var start = this.pos; var startLoc = this.options.onComment && this.curPosition(); var ch = this.input.charCodeAt(this.pos += startSkip); @@ -16503,7 +20807,7 @@ pp$9.skipLineComment = function(startSkip) { // Called at the start of the parse and after every token. Skips // whitespace and comments, and. -pp$9.skipSpace = function() { +pp.skipSpace = function() { loop: while (this.pos < this.input.length) { var ch = this.input.charCodeAt(this.pos); switch (ch) { @@ -16548,7 +20852,7 @@ pp$9.skipSpace = function() { // the token, so that the next one's `start` will point at the // right position. -pp$9.finishToken = function(type, val) { +pp.finishToken = function(type, val) { this.end = this.pos; if (this.options.locations) { this.endLoc = this.curPosition(); } var prevType = this.type; @@ -16567,56 +20871,62 @@ pp$9.finishToken = function(type, val) { // // All in the name of speed. // -pp$9.readToken_dot = function() { +pp.readToken_dot = function() { var next = this.input.charCodeAt(this.pos + 1); if (next >= 48 && next <= 57) { return this.readNumber(true) } var next2 = this.input.charCodeAt(this.pos + 2); if (this.options.ecmaVersion >= 6 && next === 46 && next2 === 46) { // 46 = dot '.' this.pos += 3; - return this.finishToken(types.ellipsis) + return this.finishToken(types$1.ellipsis) } else { ++this.pos; - return this.finishToken(types.dot) + return this.finishToken(types$1.dot) } }; -pp$9.readToken_slash = function() { // '/' +pp.readToken_slash = function() { // '/' var next = this.input.charCodeAt(this.pos + 1); if (this.exprAllowed) { ++this.pos; return this.readRegexp() } - if (next === 61) { return this.finishOp(types.assign, 2) } - return this.finishOp(types.slash, 1) + if (next === 61) { return this.finishOp(types$1.assign, 2) } + return this.finishOp(types$1.slash, 1) }; -pp$9.readToken_mult_modulo_exp = function(code) { // '%*' +pp.readToken_mult_modulo_exp = function(code) { // '%*' var next = this.input.charCodeAt(this.pos + 1); var size = 1; - var tokentype = code === 42 ? types.star : types.modulo; + var tokentype = code === 42 ? types$1.star : types$1.modulo; // exponentiation operator ** and **= if (this.options.ecmaVersion >= 7 && code === 42 && next === 42) { ++size; - tokentype = types.starstar; + tokentype = types$1.starstar; next = this.input.charCodeAt(this.pos + 2); } - if (next === 61) { return this.finishOp(types.assign, size + 1) } + if (next === 61) { return this.finishOp(types$1.assign, size + 1) } return this.finishOp(tokentype, size) }; -pp$9.readToken_pipe_amp = function(code) { // '|&' +pp.readToken_pipe_amp = function(code) { // '|&' var next = this.input.charCodeAt(this.pos + 1); - if (next === code) { return this.finishOp(code === 124 ? types.logicalOR : types.logicalAND, 2) } - if (next === 61) { return this.finishOp(types.assign, 2) } - return this.finishOp(code === 124 ? types.bitwiseOR : types.bitwiseAND, 1) + if (next === code) { + if (this.options.ecmaVersion >= 12) { + var next2 = this.input.charCodeAt(this.pos + 2); + if (next2 === 61) { return this.finishOp(types$1.assign, 3) } + } + return this.finishOp(code === 124 ? types$1.logicalOR : types$1.logicalAND, 2) + } + if (next === 61) { return this.finishOp(types$1.assign, 2) } + return this.finishOp(code === 124 ? types$1.bitwiseOR : types$1.bitwiseAND, 1) }; -pp$9.readToken_caret = function() { // '^' +pp.readToken_caret = function() { // '^' var next = this.input.charCodeAt(this.pos + 1); - if (next === 61) { return this.finishOp(types.assign, 2) } - return this.finishOp(types.bitwiseXOR, 1) + if (next === 61) { return this.finishOp(types$1.assign, 2) } + return this.finishOp(types$1.bitwiseXOR, 1) }; -pp$9.readToken_plus_min = function(code) { // '+-' +pp.readToken_plus_min = function(code) { // '+-' var next = this.input.charCodeAt(this.pos + 1); if (next === code) { if (next === 45 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 62 && @@ -16626,19 +20936,19 @@ pp$9.readToken_plus_min = function(code) { // '+-' this.skipSpace(); return this.nextToken() } - return this.finishOp(types.incDec, 2) + return this.finishOp(types$1.incDec, 2) } - if (next === 61) { return this.finishOp(types.assign, 2) } - return this.finishOp(types.plusMin, 1) + if (next === 61) { return this.finishOp(types$1.assign, 2) } + return this.finishOp(types$1.plusMin, 1) }; -pp$9.readToken_lt_gt = function(code) { // '<>' +pp.readToken_lt_gt = function(code) { // '<>' var next = this.input.charCodeAt(this.pos + 1); var size = 1; if (next === code) { size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2; - if (this.input.charCodeAt(this.pos + size) === 61) { return this.finishOp(types.assign, size + 1) } - return this.finishOp(types.bitShift, size) + if (this.input.charCodeAt(this.pos + size) === 61) { return this.finishOp(types$1.assign, size + 1) } + return this.finishOp(types$1.bitShift, size) } if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 && this.input.charCodeAt(this.pos + 3) === 45) { @@ -16648,32 +20958,53 @@ pp$9.readToken_lt_gt = function(code) { // '<>' return this.nextToken() } if (next === 61) { size = 2; } - return this.finishOp(types.relational, size) + return this.finishOp(types$1.relational, size) }; -pp$9.readToken_eq_excl = function(code) { // '=!' +pp.readToken_eq_excl = function(code) { // '=!' var next = this.input.charCodeAt(this.pos + 1); - if (next === 61) { return this.finishOp(types.equality, this.input.charCodeAt(this.pos + 2) === 61 ? 3 : 2) } + if (next === 61) { return this.finishOp(types$1.equality, this.input.charCodeAt(this.pos + 2) === 61 ? 3 : 2) } if (code === 61 && next === 62 && this.options.ecmaVersion >= 6) { // '=>' this.pos += 2; - return this.finishToken(types.arrow) + return this.finishToken(types$1.arrow) } - return this.finishOp(code === 61 ? types.eq : types.prefix, 1) + return this.finishOp(code === 61 ? types$1.eq : types$1.prefix, 1) }; -pp$9.readToken_question = function() { // '?' - if (this.options.ecmaVersion >= 11) { +pp.readToken_question = function() { // '?' + var ecmaVersion = this.options.ecmaVersion; + if (ecmaVersion >= 11) { var next = this.input.charCodeAt(this.pos + 1); if (next === 46) { var next2 = this.input.charCodeAt(this.pos + 2); - if (next2 < 48 || next2 > 57) { return this.finishOp(types.questionDot, 2) } + if (next2 < 48 || next2 > 57) { return this.finishOp(types$1.questionDot, 2) } + } + if (next === 63) { + if (ecmaVersion >= 12) { + var next2$1 = this.input.charCodeAt(this.pos + 2); + if (next2$1 === 61) { return this.finishOp(types$1.assign, 3) } + } + return this.finishOp(types$1.coalesce, 2) + } + } + return this.finishOp(types$1.question, 1) +}; + +pp.readToken_numberSign = function() { // '#' + var ecmaVersion = this.options.ecmaVersion; + var code = 35; // '#' + if (ecmaVersion >= 13) { + ++this.pos; + code = this.fullCharCodeAtPos(); + if (isIdentifierStart(code, true) || code === 92 /* '\' */) { + return this.finishToken(types$1.privateId, this.readWord1()) } - if (next === 63) { return this.finishOp(types.coalesce, 2) } } - return this.finishOp(types.question, 1) + + this.raise(this.pos, "Unexpected character '" + codePointToString(code) + "'"); }; -pp$9.getTokenFromCode = function(code) { +pp.getTokenFromCode = function(code) { switch (code) { // The interpretation of a dot depends on whether it is followed // by a digit or another two dots. @@ -16681,20 +21012,20 @@ pp$9.getTokenFromCode = function(code) { return this.readToken_dot() // Punctuation tokens. - case 40: ++this.pos; return this.finishToken(types.parenL) - case 41: ++this.pos; return this.finishToken(types.parenR) - case 59: ++this.pos; return this.finishToken(types.semi) - case 44: ++this.pos; return this.finishToken(types.comma) - case 91: ++this.pos; return this.finishToken(types.bracketL) - case 93: ++this.pos; return this.finishToken(types.bracketR) - case 123: ++this.pos; return this.finishToken(types.braceL) - case 125: ++this.pos; return this.finishToken(types.braceR) - case 58: ++this.pos; return this.finishToken(types.colon) + case 40: ++this.pos; return this.finishToken(types$1.parenL) + case 41: ++this.pos; return this.finishToken(types$1.parenR) + case 59: ++this.pos; return this.finishToken(types$1.semi) + case 44: ++this.pos; return this.finishToken(types$1.comma) + case 91: ++this.pos; return this.finishToken(types$1.bracketL) + case 93: ++this.pos; return this.finishToken(types$1.bracketR) + case 123: ++this.pos; return this.finishToken(types$1.braceL) + case 125: ++this.pos; return this.finishToken(types$1.braceR) + case 58: ++this.pos; return this.finishToken(types$1.colon) case 96: // '`' if (this.options.ecmaVersion < 6) { break } ++this.pos; - return this.finishToken(types.backQuote) + return this.finishToken(types$1.backQuote) case 48: // '0' var next = this.input.charCodeAt(this.pos + 1); @@ -16717,7 +21048,6 @@ pp$9.getTokenFromCode = function(code) { // often referred to. `finishOp` simply skips the amount of // characters it is given as second argument, and returns a token // of the type given by its first argument. - case 47: // '/' return this.readToken_slash() @@ -16743,19 +21073,22 @@ pp$9.getTokenFromCode = function(code) { return this.readToken_question() case 126: // '~' - return this.finishOp(types.prefix, 1) + return this.finishOp(types$1.prefix, 1) + + case 35: // '#' + return this.readToken_numberSign() } - this.raise(this.pos, "Unexpected character '" + codePointToString$1(code) + "'"); + this.raise(this.pos, "Unexpected character '" + codePointToString(code) + "'"); }; -pp$9.finishOp = function(type, size) { +pp.finishOp = function(type, size) { var str = this.input.slice(this.pos, this.pos + size); this.pos += size; return this.finishToken(type, str) }; -pp$9.readRegexp = function() { +pp.readRegexp = function() { var escaped, inClass, start = this.pos; for (;;) { if (this.pos >= this.input.length) { this.raise(start, "Unterminated regular expression"); } @@ -16790,56 +21123,92 @@ pp$9.readRegexp = function() { // https://github.com/estree/estree/blob/a27003adf4fd7bfad44de9cef372a2eacd527b1c/es5.md#regexpliteral } - return this.finishToken(types.regexp, {pattern: pattern, flags: flags, value: value}) + return this.finishToken(types$1.regexp, {pattern: pattern, flags: flags, value: value}) }; // Read an integer in the given radix. Return null if zero digits // were read, the integer value otherwise. When `len` is given, this // will return `null` unless the integer has exactly `len` digits. -pp$9.readInt = function(radix, len) { - var start = this.pos, total = 0; - for (var i = 0, e = len == null ? Infinity : len; i < e; ++i) { +pp.readInt = function(radix, len, maybeLegacyOctalNumericLiteral) { + // `len` is used for character escape sequences. In that case, disallow separators. + var allowSeparators = this.options.ecmaVersion >= 12 && len === undefined; + + // `maybeLegacyOctalNumericLiteral` is true if it doesn't have prefix (0x,0o,0b) + // and isn't fraction part nor exponent part. In that case, if the first digit + // is zero then disallow separators. + var isLegacyOctalNumericLiteral = maybeLegacyOctalNumericLiteral && this.input.charCodeAt(this.pos) === 48; + + var start = this.pos, total = 0, lastCode = 0; + for (var i = 0, e = len == null ? Infinity : len; i < e; ++i, ++this.pos) { var code = this.input.charCodeAt(this.pos), val = (void 0); + + if (allowSeparators && code === 95) { + if (isLegacyOctalNumericLiteral) { this.raiseRecoverable(this.pos, "Numeric separator is not allowed in legacy octal numeric literals"); } + if (lastCode === 95) { this.raiseRecoverable(this.pos, "Numeric separator must be exactly one underscore"); } + if (i === 0) { this.raiseRecoverable(this.pos, "Numeric separator is not allowed at the first of digits"); } + lastCode = code; + continue + } + if (code >= 97) { val = code - 97 + 10; } // a else if (code >= 65) { val = code - 65 + 10; } // A else if (code >= 48 && code <= 57) { val = code - 48; } // 0-9 else { val = Infinity; } if (val >= radix) { break } - ++this.pos; + lastCode = code; total = total * radix + val; } + + if (allowSeparators && lastCode === 95) { this.raiseRecoverable(this.pos - 1, "Numeric separator is not allowed at the last of digits"); } if (this.pos === start || len != null && this.pos - start !== len) { return null } return total }; -pp$9.readRadixNumber = function(radix) { +function stringToNumber(str, isLegacyOctalNumericLiteral) { + if (isLegacyOctalNumericLiteral) { + return parseInt(str, 8) + } + + // `parseFloat(value)` stops parsing at the first numeric separator then returns a wrong value. + return parseFloat(str.replace(/_/g, "")) +} + +function stringToBigInt(str) { + if (typeof BigInt !== "function") { + return null + } + + // `BigInt(value)` throws syntax error if the string contains numeric separators. + return BigInt(str.replace(/_/g, "")) +} + +pp.readRadixNumber = function(radix) { var start = this.pos; this.pos += 2; // 0x var val = this.readInt(radix); if (val == null) { this.raise(this.start + 2, "Expected number in radix " + radix); } if (this.options.ecmaVersion >= 11 && this.input.charCodeAt(this.pos) === 110) { - val = typeof BigInt !== "undefined" ? BigInt(this.input.slice(start, this.pos)) : null; + val = stringToBigInt(this.input.slice(start, this.pos)); ++this.pos; } else if (isIdentifierStart(this.fullCharCodeAtPos())) { this.raise(this.pos, "Identifier directly after number"); } - return this.finishToken(types.num, val) + return this.finishToken(types$1.num, val) }; // Read an integer, octal integer, or floating-point number. -pp$9.readNumber = function(startsWithDot) { +pp.readNumber = function(startsWithDot) { var start = this.pos; - if (!startsWithDot && this.readInt(10) === null) { this.raise(start, "Invalid number"); } + if (!startsWithDot && this.readInt(10, undefined, true) === null) { this.raise(start, "Invalid number"); } var octal = this.pos - start >= 2 && this.input.charCodeAt(start) === 48; if (octal && this.strict) { this.raise(start, "Invalid number"); } var next = this.input.charCodeAt(this.pos); if (!octal && !startsWithDot && this.options.ecmaVersion >= 11 && next === 110) { - var str$1 = this.input.slice(start, this.pos); - var val$1 = typeof BigInt !== "undefined" ? BigInt(str$1) : null; + var val$1 = stringToBigInt(this.input.slice(start, this.pos)); ++this.pos; if (isIdentifierStart(this.fullCharCodeAtPos())) { this.raise(this.pos, "Identifier directly after number"); } - return this.finishToken(types.num, val$1) + return this.finishToken(types$1.num, val$1) } if (octal && /[89]/.test(this.input.slice(start, this.pos))) { octal = false; } if (next === 46 && !octal) { // '.' @@ -16854,14 +21223,13 @@ pp$9.readNumber = function(startsWithDot) { } if (isIdentifierStart(this.fullCharCodeAtPos())) { this.raise(this.pos, "Identifier directly after number"); } - var str = this.input.slice(start, this.pos); - var val = octal ? parseInt(str, 8) : parseFloat(str); - return this.finishToken(types.num, val) + var val = stringToNumber(this.input.slice(start, this.pos), octal); + return this.finishToken(types$1.num, val) }; // Read a string value, interpreting backslash-escapes. -pp$9.readCodePoint = function() { +pp.readCodePoint = function() { var ch = this.input.charCodeAt(this.pos), code; if (ch === 123) { // '{' @@ -16876,14 +21244,7 @@ pp$9.readCodePoint = function() { return code }; -function codePointToString$1(code) { - // UTF-16 Decoding - if (code <= 0xFFFF) { return String.fromCharCode(code) } - code -= 0x10000; - return String.fromCharCode((code >> 10) + 0xD800, (code & 1023) + 0xDC00) -} - -pp$9.readString = function(quote) { +pp.readString = function(quote) { var out = "", chunkStart = ++this.pos; for (;;) { if (this.pos >= this.input.length) { this.raise(this.start, "Unterminated string constant"); } @@ -16893,20 +21254,27 @@ pp$9.readString = function(quote) { out += this.input.slice(chunkStart, this.pos); out += this.readEscapedChar(false); chunkStart = this.pos; + } else if (ch === 0x2028 || ch === 0x2029) { + if (this.options.ecmaVersion < 10) { this.raise(this.start, "Unterminated string constant"); } + ++this.pos; + if (this.options.locations) { + this.curLine++; + this.lineStart = this.pos; + } } else { - if (isNewLine(ch, this.options.ecmaVersion >= 10)) { this.raise(this.start, "Unterminated string constant"); } + if (isNewLine(ch)) { this.raise(this.start, "Unterminated string constant"); } ++this.pos; } } out += this.input.slice(chunkStart, this.pos++); - return this.finishToken(types.string, out) + return this.finishToken(types$1.string, out) }; // Reads template string tokens. var INVALID_TEMPLATE_ESCAPE_ERROR = {}; -pp$9.tryReadTemplateToken = function() { +pp.tryReadTemplateToken = function() { this.inTemplateElement = true; try { this.readTmplToken(); @@ -16921,7 +21289,7 @@ pp$9.tryReadTemplateToken = function() { this.inTemplateElement = false; }; -pp$9.invalidStringToken = function(position, message) { +pp.invalidStringToken = function(position, message) { if (this.inTemplateElement && this.options.ecmaVersion >= 9) { throw INVALID_TEMPLATE_ESCAPE_ERROR } else { @@ -16929,23 +21297,23 @@ pp$9.invalidStringToken = function(position, message) { } }; -pp$9.readTmplToken = function() { +pp.readTmplToken = function() { var out = "", chunkStart = this.pos; for (;;) { if (this.pos >= this.input.length) { this.raise(this.start, "Unterminated template"); } var ch = this.input.charCodeAt(this.pos); if (ch === 96 || ch === 36 && this.input.charCodeAt(this.pos + 1) === 123) { // '`', '${' - if (this.pos === this.start && (this.type === types.template || this.type === types.invalidTemplate)) { + if (this.pos === this.start && (this.type === types$1.template || this.type === types$1.invalidTemplate)) { if (ch === 36) { this.pos += 2; - return this.finishToken(types.dollarBraceL) + return this.finishToken(types$1.dollarBraceL) } else { ++this.pos; - return this.finishToken(types.backQuote) + return this.finishToken(types$1.backQuote) } } out += this.input.slice(chunkStart, this.pos); - return this.finishToken(types.template, out) + return this.finishToken(types$1.template, out) } if (ch === 92) { // '\' out += this.input.slice(chunkStart, this.pos); @@ -16976,7 +21344,7 @@ pp$9.readTmplToken = function() { }; // Reads a template token to search for the end, without validating any escape sequences -pp$9.readInvalidTemplateToken = function() { +pp.readInvalidTemplateToken = function() { for (; this.pos < this.input.length; this.pos++) { switch (this.input[this.pos]) { case "\\": @@ -16987,10 +21355,10 @@ pp$9.readInvalidTemplateToken = function() { if (this.input[this.pos + 1] !== "{") { break } - // falls through + // falls through case "`": - return this.finishToken(types.invalidTemplate, this.input.slice(this.start, this.pos)) + return this.finishToken(types$1.invalidTemplate, this.input.slice(this.start, this.pos)) // no default } @@ -17000,14 +21368,14 @@ pp$9.readInvalidTemplateToken = function() { // Used to read escaped characters -pp$9.readEscapedChar = function(inTemplate) { +pp.readEscapedChar = function(inTemplate) { var ch = this.input.charCodeAt(++this.pos); ++this.pos; switch (ch) { case 110: return "\n" // 'n' -> '\n' case 114: return "\r" // 'r' -> '\r' case 120: return String.fromCharCode(this.readHexChar(2)) // 'x' - case 117: return codePointToString$1(this.readCodePoint()) // 'u' + case 117: return codePointToString(this.readCodePoint()) // 'u' case 116: return "\t" // 't' -> '\t' case 98: return "\b" // 'b' -> '\b' case 118: return "\u000b" // 'v' -> '\u000b' @@ -17018,6 +21386,12 @@ pp$9.readEscapedChar = function(inTemplate) { return "" case 56: case 57: + if (this.strict) { + this.invalidStringToken( + this.pos - 1, + "Invalid escape sequence" + ); + } if (inTemplate) { var codePos = this.pos - 1; @@ -17059,7 +21433,7 @@ pp$9.readEscapedChar = function(inTemplate) { // Used to read character escape sequences ('\x', '\u', '\U'). -pp$9.readHexChar = function(len) { +pp.readHexChar = function(len) { var codePos = this.pos; var n = this.readInt(16, len); if (n === null) { this.invalidStringToken(codePos, "Bad character escape sequence"); } @@ -17072,7 +21446,7 @@ pp$9.readHexChar = function(len) { // Incrementally adds only escaped chars, adding other chunks as-is // as a micro-optimization. -pp$9.readWord1 = function() { +pp.readWord1 = function() { this.containsEsc = false; var word = "", first = true, chunkStart = this.pos; var astral = this.options.ecmaVersion >= 6; @@ -17090,7 +21464,7 @@ pp$9.readWord1 = function() { var esc = this.readCodePoint(); if (!(first ? isIdentifierStart : isIdentifierChar)(esc, astral)) { this.invalidStringToken(escStart, "Invalid Unicode escape"); } - word += codePointToString$1(esc); + word += codePointToString(esc); chunkStart = this.pos; } else { break @@ -17103,32 +21477,32 @@ pp$9.readWord1 = function() { // Read an identifier or keyword token. Will check for reserved // words when necessary. -pp$9.readWord = function() { +pp.readWord = function() { var word = this.readWord1(); - var type = types.name; + var type = types$1.name; if (this.keywords.test(word)) { - type = keywords$1[word]; + type = keywords[word]; } return this.finishToken(type, word) }; // Acorn is a tiny, fast JavaScript parser written in JavaScript. -var version$1 = "7.3.1"; +var version = "8.7.1"; Parser.acorn = { Parser: Parser, - version: version$1, + version: version, defaultOptions: defaultOptions, Position: Position, SourceLocation: SourceLocation, getLineInfo: getLineInfo, Node: Node, TokenType: TokenType, - tokTypes: types, - keywordTypes: keywords$1, + tokTypes: types$1, + keywordTypes: keywords, TokContext: TokContext, - tokContexts: types$1, + tokContexts: types, isIdentifierChar: isIdentifierChar, isIdentifierStart: isIdentifierStart, Token: Token, @@ -17138,107 +21512,28 @@ Parser.acorn = { nonASCIIwhitespace: nonASCIIwhitespace }; -// The main exported interface (under `self.acorn` when in the -// browser) is a `parse` function that takes a code string and -// returns an abstract syntax tree as specified by [Mozilla parser -// API][api]. -// -// [api]: https://developer.mozilla.org/en-US/docs/SpiderMonkey/Parser_API - -function parse(input, options) { - return Parser.parse(input, options) -} - -// This function tries to parse a single expression at a given -// offset in a string. Useful for parsing mixed-language formats -// that embed JavaScript expressions. - -function parseExpressionAt(input, pos, options) { - return Parser.parseExpressionAt(input, pos, options) -} - -// Acorn is organized as a tokenizer and a recursive-descent parser. -// The `tokenizer` export provides an interface to the tokenizer. - -function tokenizer(input, options) { - return Parser.tokenizer(input, options) -} - -var acorn = { - __proto__: null, - Node: Node, - Parser: Parser, - Position: Position, - SourceLocation: SourceLocation, - TokContext: TokContext, - Token: Token, - TokenType: TokenType, - defaultOptions: defaultOptions, - getLineInfo: getLineInfo, - isIdentifierChar: isIdentifierChar, - isIdentifierStart: isIdentifierStart, - isNewLine: isNewLine, - keywordTypes: keywords$1, - lineBreak: lineBreak, - lineBreakG: lineBreakG, - nonASCIIwhitespace: nonASCIIwhitespace, - parse: parse, - parseExpressionAt: parseExpressionAt, - tokContexts: types$1, - tokTypes: types, - tokenizer: tokenizer, - version: version$1 -}; - -class GlobalScope extends Scope { - constructor() { - super(); - this.variables.set('undefined', new UndefinedVariable()); - } - findVariable(name) { - let variable = this.variables.get(name); - if (!variable) { - variable = new GlobalVariable(name); - this.variables.set(name, variable); - } - return variable; - } -} - -const readFile = (file) => new Promise((fulfil, reject) => readFile$1(file, 'utf-8', (err, contents) => (err ? reject(err) : fulfil(contents)))); -function mkdirpath(path) { - const dir = dirname(path); - try { - readdirSync(dir); - } - catch (err) { - mkdirpath(dir); - try { - mkdirSync(dir); - } - catch (err2) { - if (err2.code !== 'EEXIST') { - throw err2; +function resolveIdViaPlugins(source, importer, pluginDriver, moduleLoaderResolveId, skip, customOptions, isEntry) { + let skipped = null; + let replaceContext = null; + if (skip) { + skipped = new Set(); + for (const skippedCall of skip) { + if (source === skippedCall.source && importer === skippedCall.importer) { + skipped.add(skippedCall.plugin); } } - } -} -function writeFile(dest, data) { - return new Promise((fulfil, reject) => { - mkdirpath(dest); - writeFile$1(dest, data, err => { - if (err) { - reject(err); - } - else { - fulfil(); + replaceContext = (pluginContext, plugin) => ({ + ...pluginContext, + resolve: (source, importer, { custom, isEntry, skipSelf } = BLANK) => { + return moduleLoaderResolveId(source, importer, custom, isEntry, skipSelf ? [...skip, { importer, plugin, source }] : skip); } }); - }); + } + return pluginDriver.hookFirst('resolveId', [source, importer, { custom: customOptions, isEntry }], replaceContext, skipped); } -async function resolveId(source, importer, preserveSymlinks, pluginDriver, skip) { - const pluginResult = await pluginDriver.hookFirst('resolveId', [source, importer], null, skip); +async function resolveId(source, importer, preserveSymlinks, pluginDriver, moduleLoaderResolveId, skip, customOptions, isEntry) { + const pluginResult = await resolveIdViaPlugins(source, importer, pluginDriver, moduleLoaderResolveId, skip, customOptions, isEntry); if (pluginResult != null) return pluginResult; // external modules (non-entry modules that start with neither '.' or '/') @@ -17249,28 +21544,22 @@ async function resolveId(source, importer, preserveSymlinks, pluginDriver, skip) // absolute path is created. Absolute importees therefore shortcircuit the // resolve call and require no special handing on our part. // See https://nodejs.org/api/path.html#path_path_resolve_paths - return addJsExtensionIfNecessary(resolve(importer ? dirname(importer) : resolve(), source), preserveSymlinks); -} -function addJsExtensionIfNecessary(file, preserveSymlinks) { - let found = findFile(file, preserveSymlinks); - if (found) - return found; - found = findFile(file + '.mjs', preserveSymlinks); - if (found) - return found; - found = findFile(file + '.js', preserveSymlinks); - return found; -} -function findFile(file, preserveSymlinks) { + return addJsExtensionIfNecessary(importer ? resolve(dirname(importer), source) : resolve(source), preserveSymlinks); +} +async function addJsExtensionIfNecessary(file, preserveSymlinks) { + var _a, _b; + return ((_b = (_a = (await findFile(file, preserveSymlinks))) !== null && _a !== void 0 ? _a : (await findFile(file + '.mjs', preserveSymlinks))) !== null && _b !== void 0 ? _b : (await findFile(file + '.js', preserveSymlinks))); +} +async function findFile(file, preserveSymlinks) { try { - const stats = lstatSync(file); + const stats = await promises.lstat(file); if (!preserveSymlinks && stats.isSymbolicLink()) - return findFile(realpathSync(file), preserveSymlinks); + return await findFile(await promises.realpath(file), preserveSymlinks); if ((preserveSymlinks && stats.isSymbolicLink()) || stats.isFile()) { // check case const name = basename(file); - const files = readdirSync(dirname(file)); - if (files.indexOf(name) !== -1) + const files = await promises.readdir(dirname(file)); + if (files.includes(name)) return file; } } @@ -17315,12 +21604,8 @@ function warnDeprecatedHooks(plugins, options) { function createPluginCache(cache) { return { - has(id) { - const item = cache[id]; - if (!item) - return false; - item[0] = 0; - return true; + delete(id) { + return delete cache[id]; }, get(id) { const item = cache[id]; @@ -17329,45 +21614,49 @@ function createPluginCache(cache) { item[0] = 0; return item[1]; }, + has(id) { + const item = cache[id]; + if (!item) + return false; + item[0] = 0; + return true; + }, set(id, value) { cache[id] = [0, value]; - }, - delete(id) { - return delete cache[id]; } }; } function getTrackedPluginCache(pluginCache, onUse) { return { - has(id) { + delete(id) { onUse(); - return pluginCache.has(id); + return pluginCache.delete(id); }, get(id) { onUse(); return pluginCache.get(id); }, - set(id, value) { + has(id) { onUse(); - return pluginCache.set(id, value); + return pluginCache.has(id); }, - delete(id) { + set(id, value) { onUse(); - return pluginCache.delete(id); + return pluginCache.set(id, value); } }; } const NO_CACHE = { - has() { + delete() { return false; }, get() { return undefined; }, - set() { }, - delete() { + has() { return false; - } + }, + set() { } }; function uncacheablePluginError(pluginName) { if (pluginName.startsWith(ANONYMOUS_PLUGIN_PREFIX) || @@ -17384,22 +21673,22 @@ function uncacheablePluginError(pluginName) { } function getCacheForUncacheablePlugin(pluginName) { return { - has() { + delete() { return uncacheablePluginError(pluginName); }, get() { return uncacheablePluginError(pluginName); }, - set() { + has() { return uncacheablePluginError(pluginName); }, - delete() { + set() { return uncacheablePluginError(pluginName); } }; } -function transform(source, module, pluginDriver, warn) { +async function transform(source, module, pluginDriver, warn) { const id = module.id; const sourcemapChain = []; let originalSourcemap = source.map === null ? null : decodedSourcemap(source.map); @@ -17409,130 +21698,125 @@ function transform(source, module, pluginDriver, warn) { const emittedFiles = []; let customTransformCache = false; const useCustomTransformCache = () => (customTransformCache = true); - let moduleSideEffects = null; - let syntheticNamedExports = null; - let curPlugin; + let pluginName = ''; const curSource = source.code; - function transformReducer(code, result, plugin) { + function transformReducer(previousCode, result, plugin) { + let code; + let map; if (typeof result === 'string') { - result = { - ast: undefined, - code: result, - map: undefined - }; + code = result; } else if (result && typeof result === 'object') { - if (typeof result.map === 'string') { - result.map = JSON.parse(result.map); - } - if (typeof result.moduleSideEffects === 'boolean') { - moduleSideEffects = result.moduleSideEffects; - } - if (typeof result.syntheticNamedExports === 'boolean') { - syntheticNamedExports = result.syntheticNamedExports; + module.updateOptions(result); + if (result.code == null) { + if (result.map || result.ast) { + warn(errNoTransformMapOrAstWithoutCode(plugin.name)); + } + return previousCode; } + ({ code, map, ast } = result); } else { - return code; + return previousCode; } // strict null check allows 'null' maps to not be pushed to the chain, // while 'undefined' gets the missing map warning - if (result.map !== null) { - const map = decodedSourcemap(result.map); - sourcemapChain.push(map || { missing: true, plugin: plugin.name }); + if (map !== null) { + sourcemapChain.push(decodedSourcemap(typeof map === 'string' ? JSON.parse(map) : map) || { + missing: true, + plugin: plugin.name + }); } - ast = result.ast; - return result.code; + return code; } - return pluginDriver - .hookReduceArg0('transform', [curSource, id], transformReducer, (pluginContext, plugin) => { - curPlugin = plugin; - return { - ...pluginContext, - cache: customTransformCache - ? pluginContext.cache - : getTrackedPluginCache(pluginContext.cache, useCustomTransformCache), - warn(warning, pos) { - if (typeof warning === 'string') - warning = { message: warning }; - if (pos) - augmentCodeLocation(warning, pos, curSource, id); - warning.id = id; - warning.hook = 'transform'; - pluginContext.warn(warning); - }, - error(err, pos) { - if (typeof err === 'string') - err = { message: err }; - if (pos) - augmentCodeLocation(err, pos, curSource, id); - err.id = id; - err.hook = 'transform'; - return pluginContext.error(err); - }, - emitAsset(name, source) { - const emittedFile = { type: 'asset', name, source }; - emittedFiles.push({ ...emittedFile }); - return pluginDriver.emitFile(emittedFile); - }, - emitChunk(id, options) { - const emittedFile = { type: 'chunk', id, name: options && options.name }; - emittedFiles.push({ ...emittedFile }); - return pluginDriver.emitFile(emittedFile); - }, - emitFile(emittedFile) { - emittedFiles.push(emittedFile); - return pluginDriver.emitFile(emittedFile); - }, - addWatchFile(id) { - transformDependencies.push(id); - pluginContext.addWatchFile(id); - }, - setAssetSource() { - return this.error({ - code: 'INVALID_SETASSETSOURCE', - message: `setAssetSource cannot be called in transform for caching reasons. Use emitFile with a source, or call setAssetSource in another hook.` - }); - }, - getCombinedSourcemap() { - const combinedMap = collapseSourcemap(id, originalCode, originalSourcemap, sourcemapChain, warn); - if (!combinedMap) { - const magicString = new MagicString(originalCode); - return magicString.generateMap({ includeContent: true, hires: true, source: id }); - } - if (originalSourcemap !== combinedMap) { - originalSourcemap = combinedMap; - sourcemapChain.length = 0; + let code; + try { + code = await pluginDriver.hookReduceArg0('transform', [curSource, id], transformReducer, (pluginContext, plugin) => { + pluginName = plugin.name; + return { + ...pluginContext, + addWatchFile(id) { + transformDependencies.push(id); + pluginContext.addWatchFile(id); + }, + cache: customTransformCache + ? pluginContext.cache + : getTrackedPluginCache(pluginContext.cache, useCustomTransformCache), + emitAsset(name, source) { + emittedFiles.push({ name, source, type: 'asset' }); + return pluginContext.emitAsset(name, source); + }, + emitChunk(id, options) { + emittedFiles.push({ id, name: options && options.name, type: 'chunk' }); + return pluginContext.emitChunk(id, options); + }, + emitFile(emittedFile) { + emittedFiles.push(emittedFile); + return pluginDriver.emitFile(emittedFile); + }, + error(err, pos) { + if (typeof err === 'string') + err = { message: err }; + if (pos) + augmentCodeLocation(err, pos, curSource, id); + err.id = id; + err.hook = 'transform'; + return pluginContext.error(err); + }, + getCombinedSourcemap() { + const combinedMap = collapseSourcemap(id, originalCode, originalSourcemap, sourcemapChain, warn); + if (!combinedMap) { + const magicString = new MagicString(originalCode); + return magicString.generateMap({ hires: true, includeContent: true, source: id }); + } + if (originalSourcemap !== combinedMap) { + originalSourcemap = combinedMap; + sourcemapChain.length = 0; + } + return new SourceMap({ + ...combinedMap, + file: null, + sourcesContent: combinedMap.sourcesContent + }); + }, + setAssetSource() { + return this.error({ + code: 'INVALID_SETASSETSOURCE', + message: `setAssetSource cannot be called in transform for caching reasons. Use emitFile with a source, or call setAssetSource in another hook.` + }); + }, + warn(warning, pos) { + if (typeof warning === 'string') + warning = { message: warning }; + if (pos) + augmentCodeLocation(warning, pos, curSource, id); + warning.id = id; + warning.hook = 'transform'; + pluginContext.warn(warning); } - return new SourceMap({ - ...combinedMap, - file: null, - sourcesContent: combinedMap.sourcesContent - }); - } - }; - }) - .catch(err => throwPluginError(err, curPlugin.name, { hook: 'transform', id })) - .then(code => { - if (!customTransformCache) { - // files emitted by a transform hook need to be emitted again if the hook is skipped - if (emittedFiles.length) - module.transformFiles = emittedFiles; - } - return { - ast, - code, - customTransformCache, - moduleSideEffects, - originalCode, - originalSourcemap, - sourcemapChain, - syntheticNamedExports, - transformDependencies - }; - }); + }; + }); + } + catch (err) { + throwPluginError(err, pluginName, { hook: 'transform', id }); + } + if (!customTransformCache) { + // files emitted by a transform hook need to be emitted again if the hook is skipped + if (emittedFiles.length) + module.transformFiles = emittedFiles; + } + return { + ast, + code, + customTransformCache, + originalCode, + originalSourcemap, + sourcemapChain, + transformDependencies + }; } +const RESOLVE_DEPENDENCIES = 'resolveDependencies'; class ModuleLoader { constructor(graph, modulesById, options, pluginDriver) { this.graph = graph; @@ -17542,7 +21826,15 @@ class ModuleLoader { this.implicitEntryModules = new Set(); this.indexedEntryModules = []; this.latestLoadModulesPromise = Promise.resolve(); + this.moduleLoadPromises = new Map(); + this.modulesWithLoadedDependencies = new Set(); + this.nextChunkNamePriority = 0; this.nextEntryModuleIndex = 0; + this.resolveId = async (source, importer, customOptions, isEntry, skip = null) => { + return this.getResolvedIdWithDefaults(this.getNormalizedResolvedIdWithoutDefaults(this.options.external(source, importer, false) + ? false + : await resolveId(source, importer, this.options.preserveSymlinks, this.pluginDriver, this.resolveId, skip, customOptions, typeof isEntry === 'boolean' ? isEntry : !importer), importer, source)); + }; this.hasModuleSideEffects = options.treeshake ? options.treeshake.moduleSideEffects : () => true; @@ -17555,21 +21847,24 @@ class ModuleLoader { async addEntryModules(unresolvedEntryModules, isUserDefined) { const firstEntryModuleIndex = this.nextEntryModuleIndex; this.nextEntryModuleIndex += unresolvedEntryModules.length; + const firstChunkNamePriority = this.nextChunkNamePriority; + this.nextChunkNamePriority += unresolvedEntryModules.length; const newEntryModules = await this.extendLoadModulesPromise(Promise.all(unresolvedEntryModules.map(({ id, importer }) => this.loadEntryModule(id, true, importer, null))).then(entryModules => { - let moduleIndex = firstEntryModuleIndex; for (let index = 0; index < entryModules.length; index++) { const entryModule = entryModules[index]; entryModule.isUserDefinedEntryPoint = entryModule.isUserDefinedEntryPoint || isUserDefined; - addChunkNamesToModule(entryModule, unresolvedEntryModules[index], isUserDefined); + addChunkNamesToModule(entryModule, unresolvedEntryModules[index], isUserDefined, firstChunkNamePriority + index); const existingIndexedModule = this.indexedEntryModules.find(indexedModule => indexedModule.module === entryModule); if (!existingIndexedModule) { - this.indexedEntryModules.push({ module: entryModule, index: moduleIndex }); + this.indexedEntryModules.push({ + index: firstEntryModuleIndex + index, + module: entryModule + }); } else { - existingIndexedModule.index = Math.min(existingIndexedModule.index, moduleIndex); + existingIndexedModule.index = Math.min(existingIndexedModule.index, firstEntryModuleIndex + index); } - moduleIndex++; } this.indexedEntryModules.sort(({ index: indexA }, { index: indexB }) => indexA > indexB ? 1 : -1); return entryModules; @@ -17596,15 +21891,15 @@ class ModuleLoader { } return module; } - async resolveId(source, importer, skip = null) { - return this.normalizeResolveIdResult(this.options.external(source, importer, false) - ? false - : await resolveId(source, importer, this.options.preserveSymlinks, this.pluginDriver, skip), importer, source); + async preloadModule(resolvedId) { + const module = await this.fetchModule(this.getResolvedIdWithDefaults(resolvedId), undefined, false, resolvedId.resolveDependencies ? RESOLVE_DEPENDENCIES : true); + return module.info; } addEntryWithImplicitDependants(unresolvedModule, implicitlyLoadedAfter) { + const chunkNamePriority = this.nextChunkNamePriority++; return this.extendLoadModulesPromise(this.loadEntryModule(unresolvedModule.id, false, unresolvedModule.importer, null).then(async (entryModule) => { - addChunkNamesToModule(entryModule, unresolvedModule, false); - if (!entryModule.isEntryPoint) { + addChunkNamesToModule(entryModule, unresolvedModule, false, chunkNamePriority); + if (!entryModule.info.isEntry) { this.implicitEntryModules.add(entryModule); const implicitlyLoadedAfterModules = await Promise.all(implicitlyLoadedAfter.map(id => this.loadEntryModule(id, false, unresolvedModule.importer, entryModule.id))); for (const module of implicitlyLoadedAfterModules) { @@ -17618,11 +21913,10 @@ class ModuleLoader { })); } async addModuleSource(id, importer, module) { - var _a; timeStart('load modules', 3); let source; try { - source = (_a = (await this.pluginDriver.hookFirst('load', [id]))) !== null && _a !== void 0 ? _a : (await readFile(id)); + source = await this.graph.fileOperationQueue.run(async () => { var _a; return (_a = (await this.pluginDriver.hookFirst('load', [id]))) !== null && _a !== void 0 ? _a : (await promises.readFile(id, 'utf8')); }); } catch (err) { timeEnd('load modules', 3); @@ -17636,13 +21930,24 @@ class ModuleLoader { timeEnd('load modules', 3); const sourceDescription = typeof source === 'string' ? { code: source } - : typeof source === 'object' && typeof source.code === 'string' + : source != null && typeof source === 'object' && typeof source.code === 'string' ? source : error(errBadLoader(id)); const cachedModule = this.graph.cachedModules.get(id); if (cachedModule && !cachedModule.customTransformCache && - cachedModule.originalCode === sourceDescription.code) { + cachedModule.originalCode === sourceDescription.code && + !(await this.pluginDriver.hookFirst('shouldTransformCachedModule', [ + { + ast: cachedModule.ast, + code: cachedModule.code, + id: cachedModule.id, + meta: cachedModule.meta, + moduleSideEffects: cachedModule.moduleSideEffects, + resolvedSources: cachedModule.resolvedIds, + syntheticNamedExports: cachedModule.syntheticNamedExports + } + ]))) { if (cachedModule.transformFiles) { for (const emittedFile of cachedModule.transformFiles) this.pluginDriver.emitFile(emittedFile); @@ -17650,12 +21955,7 @@ class ModuleLoader { module.setSource(cachedModule); } else { - if (typeof sourceDescription.moduleSideEffects === 'boolean') { - module.moduleSideEffects = sourceDescription.moduleSideEffects; - } - if (typeof sourceDescription.syntheticNamedExports === 'boolean') { - module.syntheticNamedExports = sourceDescription.syntheticNamedExports; - } + module.updateOptions(sourceDescription); module.setSource(await transform(sourceDescription, module, this.pluginDriver, this.options.onwarn)); } } @@ -17676,9 +21976,8 @@ class ModuleLoader { }); return loadNewModulesPromise; } - async fetchDynamicDependencies(module) { - const dependencies = await Promise.all(module.dynamicImports.map(async (dynamicImport) => { - const resolvedId = await this.resolveDynamicImport(module, dynamicImport.argument, module.id); + async fetchDynamicDependencies(module, resolveDynamicImportPromises) { + const dependencies = await Promise.all(resolveDynamicImportPromises.map(resolveDynamicImportPromise => resolveDynamicImportPromise.then(async ([dynamicImport, resolvedId]) => { if (resolvedId === null) return null; if (typeof resolvedId === 'string') { @@ -17686,7 +21985,7 @@ class ModuleLoader { return null; } return (dynamicImport.resolution = await this.fetchResolvedDependency(relativeId(resolvedId.id), module.id, resolvedId)); - })); + }))); for (const dependency of dependencies) { if (dependency) { module.dynamicDependencies.add(dependency); @@ -17694,52 +21993,162 @@ class ModuleLoader { } } } - async fetchModule(id, importer, moduleSideEffects, syntheticNamedExports, isEntry) { + // If this is a preload, then this method always waits for the dependencies of the module to be resolved. + // Otherwise if the module does not exist, it waits for the module and all its dependencies to be loaded. + // Otherwise it returns immediately. + async fetchModule({ id, meta, moduleSideEffects, syntheticNamedExports }, importer, isEntry, isPreload) { const existingModule = this.modulesById.get(id); if (existingModule instanceof Module) { - if (isEntry) { - existingModule.isEntryPoint = true; - this.implicitEntryModules.delete(existingModule); - for (const dependant of existingModule.implicitlyLoadedAfter) { - dependant.implicitlyLoadedBefore.delete(existingModule); - } - existingModule.implicitlyLoadedAfter.clear(); - } + await this.handleExistingModule(existingModule, isEntry, isPreload); return existingModule; } - const module = new Module(this.graph, id, this.options, moduleSideEffects, syntheticNamedExports, isEntry); + const module = new Module(this.graph, id, this.options, isEntry, moduleSideEffects, syntheticNamedExports, meta); this.modulesById.set(id, module); this.graph.watchFiles[id] = true; - await this.addModuleSource(id, importer, module); + const loadPromise = this.addModuleSource(id, importer, module).then(() => [ + this.getResolveStaticDependencyPromises(module), + this.getResolveDynamicImportPromises(module), + loadAndResolveDependenciesPromise + ]); + const loadAndResolveDependenciesPromise = waitForDependencyResolution(loadPromise).then(() => this.pluginDriver.hookParallel('moduleParsed', [module.info])); + loadAndResolveDependenciesPromise.catch(() => { + /* avoid unhandled promise rejections */ + }); + this.moduleLoadPromises.set(module, loadPromise); + const resolveDependencyPromises = await loadPromise; + if (!isPreload) { + await this.fetchModuleDependencies(module, ...resolveDependencyPromises); + } + else if (isPreload === RESOLVE_DEPENDENCIES) { + await loadAndResolveDependenciesPromise; + } + return module; + } + async fetchModuleDependencies(module, resolveStaticDependencyPromises, resolveDynamicDependencyPromises, loadAndResolveDependenciesPromise) { + if (this.modulesWithLoadedDependencies.has(module)) { + return; + } + this.modulesWithLoadedDependencies.add(module); await Promise.all([ - this.fetchStaticDependencies(module), - this.fetchDynamicDependencies(module) + this.fetchStaticDependencies(module, resolveStaticDependencyPromises), + this.fetchDynamicDependencies(module, resolveDynamicDependencyPromises) ]); module.linkImports(); - return module; + // To handle errors when resolving dependencies or in moduleParsed + await loadAndResolveDependenciesPromise; } fetchResolvedDependency(source, importer, resolvedId) { if (resolvedId.external) { - if (!this.modulesById.has(resolvedId.id)) { - this.modulesById.set(resolvedId.id, new ExternalModule(this.options, resolvedId.id, resolvedId.moduleSideEffects)); + const { external, id, moduleSideEffects, meta } = resolvedId; + if (!this.modulesById.has(id)) { + this.modulesById.set(id, new ExternalModule(this.options, id, moduleSideEffects, meta, external !== 'absolute' && isAbsolute(id))); } - const externalModule = this.modulesById.get(resolvedId.id); + const externalModule = this.modulesById.get(id); if (!(externalModule instanceof ExternalModule)) { return error(errInternalIdCannotBeExternal(source, importer)); } return Promise.resolve(externalModule); } - else { - return this.fetchModule(resolvedId.id, importer, resolvedId.moduleSideEffects, resolvedId.syntheticNamedExports, false); - } + return this.fetchModule(resolvedId, importer, false, false); } - async fetchStaticDependencies(module) { - for (const dependency of await Promise.all(Array.from(module.sources, async (source) => this.fetchResolvedDependency(source, module.id, (module.resolvedIds[source] = - module.resolvedIds[source] || - this.handleResolveId(await this.resolveId(source, module.id), source, module.id)))))) { + async fetchStaticDependencies(module, resolveStaticDependencyPromises) { + for (const dependency of await Promise.all(resolveStaticDependencyPromises.map(resolveStaticDependencyPromise => resolveStaticDependencyPromise.then(([source, resolvedId]) => this.fetchResolvedDependency(source, module.id, resolvedId))))) { module.dependencies.add(dependency); dependency.importers.push(module.id); } + if (!this.options.treeshake || module.info.moduleSideEffects === 'no-treeshake') { + for (const dependency of module.dependencies) { + if (dependency instanceof Module) { + dependency.importedFromNotTreeshaken = true; + } + } + } + } + getNormalizedResolvedIdWithoutDefaults(resolveIdResult, importer, source) { + const { makeAbsoluteExternalsRelative } = this.options; + if (resolveIdResult) { + if (typeof resolveIdResult === 'object') { + const external = resolveIdResult.external || this.options.external(resolveIdResult.id, importer, true); + return { + ...resolveIdResult, + external: external && + (external === 'relative' || + !isAbsolute(resolveIdResult.id) || + (external === true && + isNotAbsoluteExternal(resolveIdResult.id, source, makeAbsoluteExternalsRelative)) || + 'absolute') + }; + } + const external = this.options.external(resolveIdResult, importer, true); + return { + external: external && + (isNotAbsoluteExternal(resolveIdResult, source, makeAbsoluteExternalsRelative) || + 'absolute'), + id: external && makeAbsoluteExternalsRelative + ? normalizeRelativeExternalId(resolveIdResult, importer) + : resolveIdResult + }; + } + const id = makeAbsoluteExternalsRelative + ? normalizeRelativeExternalId(source, importer) + : source; + if (resolveIdResult !== false && !this.options.external(id, importer, true)) { + return null; + } + return { + external: isNotAbsoluteExternal(id, source, makeAbsoluteExternalsRelative) || 'absolute', + id + }; + } + getResolveDynamicImportPromises(module) { + return module.dynamicImports.map(async (dynamicImport) => { + const resolvedId = await this.resolveDynamicImport(module, typeof dynamicImport.argument === 'string' + ? dynamicImport.argument + : dynamicImport.argument.esTreeNode, module.id); + if (resolvedId && typeof resolvedId === 'object') { + dynamicImport.id = resolvedId.id; + } + return [dynamicImport, resolvedId]; + }); + } + getResolveStaticDependencyPromises(module) { + return Array.from(module.sources, async (source) => [ + source, + (module.resolvedIds[source] = + module.resolvedIds[source] || + this.handleResolveId(await this.resolveId(source, module.id, EMPTY_OBJECT, false), source, module.id)) + ]); + } + getResolvedIdWithDefaults(resolvedId) { + var _a, _b; + if (!resolvedId) { + return null; + } + const external = resolvedId.external || false; + return { + external, + id: resolvedId.id, + meta: resolvedId.meta || {}, + moduleSideEffects: (_a = resolvedId.moduleSideEffects) !== null && _a !== void 0 ? _a : this.hasModuleSideEffects(resolvedId.id, !!external), + syntheticNamedExports: (_b = resolvedId.syntheticNamedExports) !== null && _b !== void 0 ? _b : false + }; + } + async handleExistingModule(module, isEntry, isPreload) { + const loadPromise = this.moduleLoadPromises.get(module); + if (isPreload) { + return isPreload === RESOLVE_DEPENDENCIES + ? waitForDependencyResolution(loadPromise) + : loadPromise; + } + if (isEntry) { + module.info.isEntry = true; + this.implicitEntryModules.delete(module); + for (const dependant of module.implicitlyLoadedAfter) { + dependant.implicitlyLoadedBefore.delete(module); + } + module.implicitlyLoadedAfter.clear(); + } + return this.fetchModuleDependencies(module, ...(await loadPromise)); } handleResolveId(resolvedId, source, importer) { if (resolvedId === null) { @@ -17750,76 +22159,36 @@ class ModuleLoader { return { external: true, id: source, + meta: {}, moduleSideEffects: this.hasModuleSideEffects(source, true), syntheticNamedExports: false }; } - else { - if (resolvedId.external && resolvedId.syntheticNamedExports) { - this.options.onwarn(errExternalSyntheticExports(source, importer)); - } + else if (resolvedId.external && resolvedId.syntheticNamedExports) { + this.options.onwarn(errExternalSyntheticExports(source, importer)); } return resolvedId; } async loadEntryModule(unresolvedId, isEntry, importer, implicitlyLoadedBefore) { - const resolveIdResult = await resolveId(unresolvedId, importer, this.options.preserveSymlinks, this.pluginDriver, null); + const resolveIdResult = await resolveId(unresolvedId, importer, this.options.preserveSymlinks, this.pluginDriver, this.resolveId, null, EMPTY_OBJECT, true); + if (resolveIdResult == null) { + return error(implicitlyLoadedBefore === null + ? errUnresolvedEntry(unresolvedId) + : errUnresolvedImplicitDependant(unresolvedId, implicitlyLoadedBefore)); + } if (resolveIdResult === false || - (resolveIdResult && typeof resolveIdResult === 'object' && resolveIdResult.external)) { + (typeof resolveIdResult === 'object' && resolveIdResult.external)) { return error(implicitlyLoadedBefore === null ? errEntryCannotBeExternal(unresolvedId) : errImplicitDependantCannotBeExternal(unresolvedId, implicitlyLoadedBefore)); } - const id = resolveIdResult && typeof resolveIdResult === 'object' ? resolveIdResult.id : resolveIdResult; - if (typeof id === 'string') { - return this.fetchModule(id, undefined, true, false, isEntry); - } - return error(implicitlyLoadedBefore === null - ? errUnresolvedEntry(unresolvedId) - : errUnresolvedImplicitDependant(unresolvedId, implicitlyLoadedBefore)); - } - normalizeResolveIdResult(resolveIdResult, importer, source) { - let id = ''; - let external = false; - let moduleSideEffects = null; - let syntheticNamedExports = false; - if (resolveIdResult) { - if (typeof resolveIdResult === 'object') { - id = resolveIdResult.id; - if (resolveIdResult.external) { - external = true; - } - if (typeof resolveIdResult.moduleSideEffects === 'boolean') { - moduleSideEffects = resolveIdResult.moduleSideEffects; - } - if (typeof resolveIdResult.syntheticNamedExports === 'boolean') { - syntheticNamedExports = resolveIdResult.syntheticNamedExports; - } - } - else { - if (this.options.external(resolveIdResult, importer, true)) { - external = true; - } - id = external ? normalizeRelativeExternalId(resolveIdResult, importer) : resolveIdResult; - } - } - else { - id = normalizeRelativeExternalId(source, importer); - if (resolveIdResult !== false && !this.options.external(id, importer, true)) { - return null; - } - external = true; - } - return { - external, - id, - moduleSideEffects: typeof moduleSideEffects === 'boolean' - ? moduleSideEffects - : this.hasModuleSideEffects(id, external), - syntheticNamedExports - }; + return this.fetchModule(this.getResolvedIdWithDefaults(typeof resolveIdResult === 'object' + ? resolveIdResult + : { id: resolveIdResult }), undefined, isEntry, false); } async resolveDynamicImport(module, specifier, importer) { - // TODO we only should expose the acorn AST here + var _a; + var _b; const resolution = await this.pluginDriver.hookFirst('resolveDynamicImport', [ specifier, importer @@ -17837,33 +22206,288 @@ class ModuleLoader { ...resolution }; } - if (resolution == null) { - return (module.resolvedIds[specifier] = - module.resolvedIds[specifier] || - this.handleResolveId(await this.resolveId(specifier, module.id), specifier, module.id)); + if (resolution == null) { + return ((_a = (_b = module.resolvedIds)[specifier]) !== null && _a !== void 0 ? _a : (_b[specifier] = this.handleResolveId(await this.resolveId(specifier, module.id, EMPTY_OBJECT, false), specifier, module.id))); + } + return this.handleResolveId(this.getResolvedIdWithDefaults(this.getNormalizedResolvedIdWithoutDefaults(resolution, importer, specifier)), specifier, importer); + } +} +function normalizeRelativeExternalId(source, importer) { + return isRelative(source) + ? importer + ? resolve(importer, '..', source) + : resolve(source) + : source; +} +function addChunkNamesToModule(module, { fileName, name }, isUserDefined, priority) { + var _a; + if (fileName !== null) { + module.chunkFileNames.add(fileName); + } + else if (name !== null) { + // Always keep chunkNames sorted by priority + let namePosition = 0; + while (((_a = module.chunkNames[namePosition]) === null || _a === void 0 ? void 0 : _a.priority) < priority) + namePosition++; + module.chunkNames.splice(namePosition, 0, { isUserDefined, name, priority }); + } +} +function isNotAbsoluteExternal(id, source, makeAbsoluteExternalsRelative) { + return (makeAbsoluteExternalsRelative === true || + (makeAbsoluteExternalsRelative === 'ifRelativeSource' && isRelative(source)) || + !isAbsolute(id)); +} +async function waitForDependencyResolution(loadPromise) { + const [resolveStaticDependencyPromises, resolveDynamicImportPromises] = await loadPromise; + return Promise.all([...resolveStaticDependencyPromises, ...resolveDynamicImportPromises]); +} + +class GlobalScope extends Scope$1 { + constructor() { + super(); + this.parent = null; + this.variables.set('undefined', new UndefinedVariable()); + } + findVariable(name) { + let variable = this.variables.get(name); + if (!variable) { + variable = new GlobalVariable(name); + this.variables.set(name, variable); + } + return variable; + } +} + +function generateAssetFileName(name, source, outputOptions, bundle) { + const emittedName = outputOptions.sanitizeFileName(name || 'asset'); + return makeUnique(renderNamePattern(typeof outputOptions.assetFileNames === 'function' + ? outputOptions.assetFileNames({ name, source, type: 'asset' }) + : outputOptions.assetFileNames, 'output.assetFileNames', { + ext: () => extname(emittedName).substring(1), + extname: () => extname(emittedName), + hash() { + return createHash() + .update(emittedName) + .update(':') + .update(source) + .digest('hex') + .substring(0, 8); + }, + name: () => emittedName.substring(0, emittedName.length - extname(emittedName).length) + }), bundle); +} +function reserveFileNameInBundle(fileName, bundle, warn) { + const lowercaseFileName = fileName.toLowerCase(); + if (bundle[lowercaseBundleKeys].has(lowercaseFileName)) { + warn(errFileNameConflict(fileName)); + } + else { + bundle[fileName] = FILE_PLACEHOLDER; + } +} +function hasValidType(emittedFile) { + return Boolean(emittedFile && + (emittedFile.type === 'asset' || + emittedFile.type === 'chunk')); +} +function hasValidName(emittedFile) { + const validatedName = emittedFile.fileName || emittedFile.name; + return !validatedName || (typeof validatedName === 'string' && !isPathFragment(validatedName)); +} +function getValidSource(source, emittedFile, fileReferenceId) { + if (!(typeof source === 'string' || source instanceof Uint8Array)) { + const assetName = emittedFile.fileName || emittedFile.name || fileReferenceId; + return error(errFailedValidation(`Could not set source for ${typeof assetName === 'string' ? `asset "${assetName}"` : 'unnamed asset'}, asset source needs to be a string, Uint8Array or Buffer.`)); + } + return source; +} +function getAssetFileName(file, referenceId) { + if (typeof file.fileName !== 'string') { + return error(errAssetNotFinalisedForFileName(file.name || referenceId)); + } + return file.fileName; +} +function getChunkFileName(file, facadeChunkByModule) { + var _a; + const fileName = file.fileName || (file.module && ((_a = facadeChunkByModule === null || facadeChunkByModule === void 0 ? void 0 : facadeChunkByModule.get(file.module)) === null || _a === void 0 ? void 0 : _a.id)); + if (!fileName) + return error(errChunkNotGeneratedForFileName(file.fileName || file.name)); + return fileName; +} +class FileEmitter { + constructor(graph, options, baseFileEmitter) { + this.graph = graph; + this.options = options; + this.bundle = null; + this.facadeChunkByModule = null; + this.outputOptions = null; + this.assertAssetsFinalized = () => { + for (const [referenceId, emittedFile] of this.filesByReferenceId) { + if (emittedFile.type === 'asset' && typeof emittedFile.fileName !== 'string') + return error(errNoAssetSourceSet(emittedFile.name || referenceId)); + } + }; + this.emitFile = (emittedFile) => { + if (!hasValidType(emittedFile)) { + return error(errFailedValidation(`Emitted files must be of type "asset" or "chunk", received "${emittedFile && emittedFile.type}".`)); + } + if (!hasValidName(emittedFile)) { + return error(errFailedValidation(`The "fileName" or "name" properties of emitted files must be strings that are neither absolute nor relative paths, received "${emittedFile.fileName || emittedFile.name}".`)); + } + if (emittedFile.type === 'chunk') { + return this.emitChunk(emittedFile); + } + return this.emitAsset(emittedFile); + }; + this.getFileName = (fileReferenceId) => { + const emittedFile = this.filesByReferenceId.get(fileReferenceId); + if (!emittedFile) + return error(errFileReferenceIdNotFoundForFilename(fileReferenceId)); + if (emittedFile.type === 'chunk') { + return getChunkFileName(emittedFile, this.facadeChunkByModule); + } + return getAssetFileName(emittedFile, fileReferenceId); + }; + this.setAssetSource = (referenceId, requestedSource) => { + const consumedFile = this.filesByReferenceId.get(referenceId); + if (!consumedFile) + return error(errAssetReferenceIdNotFoundForSetSource(referenceId)); + if (consumedFile.type !== 'asset') { + return error(errFailedValidation(`Asset sources can only be set for emitted assets but "${referenceId}" is an emitted chunk.`)); + } + if (consumedFile.source !== undefined) { + return error(errAssetSourceAlreadySet(consumedFile.name || referenceId)); + } + const source = getValidSource(requestedSource, consumedFile, referenceId); + if (this.bundle) { + this.finalizeAsset(consumedFile, source, referenceId, this.bundle); + } + else { + consumedFile.source = source; + } + }; + this.setOutputBundle = (bundle, outputOptions, facadeChunkByModule) => { + this.outputOptions = outputOptions; + this.bundle = bundle; + this.facadeChunkByModule = facadeChunkByModule; + for (const { fileName } of this.filesByReferenceId.values()) { + if (fileName) { + reserveFileNameInBundle(fileName, bundle, this.options.onwarn); + } + } + for (const [referenceId, consumedFile] of this.filesByReferenceId) { + if (consumedFile.type === 'asset' && consumedFile.source !== undefined) { + this.finalizeAsset(consumedFile, consumedFile.source, referenceId, bundle); + } + } + }; + this.filesByReferenceId = baseFileEmitter + ? new Map(baseFileEmitter.filesByReferenceId) + : new Map(); + } + assignReferenceId(file, idBase) { + let referenceId; + do { + referenceId = createHash() + .update(referenceId || idBase) + .digest('hex') + .substring(0, 8); + } while (this.filesByReferenceId.has(referenceId)); + this.filesByReferenceId.set(referenceId, file); + return referenceId; + } + emitAsset(emittedAsset) { + const source = typeof emittedAsset.source !== 'undefined' + ? getValidSource(emittedAsset.source, emittedAsset, null) + : undefined; + const consumedAsset = { + fileName: emittedAsset.fileName, + name: emittedAsset.name, + source, + type: 'asset' + }; + const referenceId = this.assignReferenceId(consumedAsset, emittedAsset.fileName || emittedAsset.name || emittedAsset.type); + if (this.bundle) { + if (emittedAsset.fileName) { + reserveFileNameInBundle(emittedAsset.fileName, this.bundle, this.options.onwarn); + } + if (source !== undefined) { + this.finalizeAsset(consumedAsset, source, referenceId, this.bundle); + } + } + return referenceId; + } + emitChunk(emittedChunk) { + if (this.graph.phase > BuildPhase.LOAD_AND_PARSE) { + return error(errInvalidRollupPhaseForChunkEmission()); + } + if (typeof emittedChunk.id !== 'string') { + return error(errFailedValidation(`Emitted chunks need to have a valid string id, received "${emittedChunk.id}"`)); } - return this.handleResolveId(this.normalizeResolveIdResult(resolution, importer, specifier), specifier, importer); + const consumedChunk = { + fileName: emittedChunk.fileName, + module: null, + name: emittedChunk.name || emittedChunk.id, + type: 'chunk' + }; + this.graph.moduleLoader + .emitChunk(emittedChunk) + .then(module => (consumedChunk.module = module)) + .catch(() => { + // Avoid unhandled Promise rejection as the error will be thrown later + // once module loading has finished + }); + return this.assignReferenceId(consumedChunk, emittedChunk.id); + } + finalizeAsset(consumedFile, source, referenceId, bundle) { + const fileName = consumedFile.fileName || + findExistingAssetFileNameWithSource(bundle, source) || + generateAssetFileName(consumedFile.name, source, this.outputOptions, bundle); + // We must not modify the original assets to avoid interaction between outputs + const assetWithFileName = { ...consumedFile, fileName, source }; + this.filesByReferenceId.set(referenceId, assetWithFileName); + const { options } = this; + bundle[fileName] = { + fileName, + get isAsset() { + warnDeprecation('Accessing "isAsset" on files in the bundle is deprecated, please use "type === \'asset\'" instead', true, options); + return true; + }, + name: consumedFile.name, + source, + type: 'asset' + }; } } -function normalizeRelativeExternalId(source, importer) { - return isRelative(source) - ? importer - ? resolve(importer, '..', source) - : resolve(source) - : source; +// TODO This can lead to a performance problem when many assets are emitted. +// Instead, we should only deduplicate string assets and use their sources as +// object keys for better performance. +function findExistingAssetFileNameWithSource(bundle, source) { + for (const [fileName, outputFile] of Object.entries(bundle)) { + if (outputFile.type === 'asset' && areSourcesEqual(source, outputFile.source)) + return fileName; + } + return null; } -function addChunkNamesToModule(module, { fileName, name }, isUserDefined) { - if (fileName !== null) { - module.chunkFileNames.add(fileName); +function areSourcesEqual(sourceA, sourceB) { + if (typeof sourceA === 'string') { + return sourceA === sourceB; } - else if (name !== null) { - if (module.chunkName === null) { - module.chunkName = name; - } - if (isUserDefined) { - module.userChunkNames.add(name); + if (typeof sourceB === 'string') { + return false; + } + if ('equals' in sourceA) { + return sourceA.equals(sourceB); + } + if (sourceA.length !== sourceB.length) { + return false; + } + for (let index = 0; index < sourceA.length; index++) { + if (sourceA[index] !== sourceB[index]) { + return false; } } + return true; } function getDeprecatedContextHandler(handler, handlerName, newHandlerName, pluginName, activeDeprecation, options) { @@ -17879,118 +22503,124 @@ function getDeprecatedContextHandler(handler, handlerName, newHandlerName, plugi return handler(...args); }); } -function getPluginContexts(pluginCache, graph, options, fileEmitter) { - const existingPluginNames = new Set(); - return (plugin, pidx) => { - let cacheable = true; - if (typeof plugin.cacheKey !== 'string') { - if (plugin.name.startsWith(ANONYMOUS_PLUGIN_PREFIX) || - plugin.name.startsWith(ANONYMOUS_OUTPUT_PLUGIN_PREFIX) || - existingPluginNames.has(plugin.name)) { - cacheable = false; - } - else { - existingPluginNames.add(plugin.name); - } - } - let cacheInstance; - if (!pluginCache) { - cacheInstance = NO_CACHE; - } - else if (cacheable) { - const cacheKey = plugin.cacheKey || plugin.name; - cacheInstance = createPluginCache(pluginCache[cacheKey] || (pluginCache[cacheKey] = Object.create(null))); +function getPluginContext(plugin, pluginCache, graph, options, fileEmitter, existingPluginNames) { + let cacheable = true; + if (typeof plugin.cacheKey !== 'string') { + if (plugin.name.startsWith(ANONYMOUS_PLUGIN_PREFIX) || + plugin.name.startsWith(ANONYMOUS_OUTPUT_PLUGIN_PREFIX) || + existingPluginNames.has(plugin.name)) { + cacheable = false; } else { - cacheInstance = getCacheForUncacheablePlugin(plugin.name); + existingPluginNames.add(plugin.name); } - const context = { - addWatchFile(id) { - if (graph.phase >= BuildPhase.GENERATE) { - return this.error(errInvalidRollupPhaseForAddWatchFile()); - } - graph.watchFiles[id] = true; - }, - cache: cacheInstance, - emitAsset: getDeprecatedContextHandler((name, source) => fileEmitter.emitFile({ type: 'asset', name, source }), 'emitAsset', 'emitFile', plugin.name, true, options), - emitChunk: getDeprecatedContextHandler((id, options) => fileEmitter.emitFile({ type: 'chunk', id, name: options && options.name }), 'emitChunk', 'emitFile', plugin.name, true, options), - emitFile: fileEmitter.emitFile, - error(err) { - return throwPluginError(err, plugin.name); - }, - getAssetFileName: getDeprecatedContextHandler(fileEmitter.getFileName, 'getAssetFileName', 'getFileName', plugin.name, true, options), - getChunkFileName: getDeprecatedContextHandler(fileEmitter.getFileName, 'getChunkFileName', 'getFileName', plugin.name, true, options), - getFileName: fileEmitter.getFileName, - getModuleIds: () => graph.modulesById.keys(), - getModuleInfo: graph.getModuleInfo, - isExternal: getDeprecatedContextHandler((id, parentId, isResolved = false) => options.external(id, parentId, isResolved), 'isExternal', 'resolve', plugin.name, true, options), - meta: { - rollupVersion: version, - watchMode: graph.watchMode - }, - get moduleIds() { - function* wrappedModuleIds() { - warnDeprecation({ - message: `Accessing "this.moduleIds" on the plugin context by plugin ${plugin.name} is deprecated. The "this.getModuleIds" plugin context function should be used instead.`, - plugin: plugin.name - }, false, options); - yield* moduleIds; - } - const moduleIds = graph.modulesById.keys(); - return wrappedModuleIds(); - }, - parse: graph.contextParse, - resolve(source, importer, options) { - return graph.moduleLoader.resolveId(source, importer, options && options.skipSelf ? pidx : null); - }, - resolveId: getDeprecatedContextHandler((source, importer) => graph.moduleLoader - .resolveId(source, importer) - .then(resolveId => resolveId && resolveId.id), 'resolveId', 'resolve', plugin.name, true, options), - setAssetSource: fileEmitter.setAssetSource, - warn(warning) { - if (typeof warning === 'string') - warning = { message: warning }; - if (warning.code) - warning.pluginCode = warning.code; - warning.code = 'PLUGIN_WARNING'; - warning.plugin = plugin.name; - options.onwarn(warning); + } + let cacheInstance; + if (!pluginCache) { + cacheInstance = NO_CACHE; + } + else if (cacheable) { + const cacheKey = plugin.cacheKey || plugin.name; + cacheInstance = createPluginCache(pluginCache[cacheKey] || (pluginCache[cacheKey] = Object.create(null))); + } + else { + cacheInstance = getCacheForUncacheablePlugin(plugin.name); + } + return { + addWatchFile(id) { + if (graph.phase >= BuildPhase.GENERATE) { + return this.error(errInvalidRollupPhaseForAddWatchFile()); } - }; - return context; + graph.watchFiles[id] = true; + }, + cache: cacheInstance, + emitAsset: getDeprecatedContextHandler((name, source) => fileEmitter.emitFile({ name, source, type: 'asset' }), 'emitAsset', 'emitFile', plugin.name, true, options), + emitChunk: getDeprecatedContextHandler((id, options) => fileEmitter.emitFile({ id, name: options && options.name, type: 'chunk' }), 'emitChunk', 'emitFile', plugin.name, true, options), + emitFile: fileEmitter.emitFile.bind(fileEmitter), + error(err) { + return throwPluginError(err, plugin.name); + }, + getAssetFileName: getDeprecatedContextHandler(fileEmitter.getFileName, 'getAssetFileName', 'getFileName', plugin.name, true, options), + getChunkFileName: getDeprecatedContextHandler(fileEmitter.getFileName, 'getChunkFileName', 'getFileName', plugin.name, true, options), + getFileName: fileEmitter.getFileName, + getModuleIds: () => graph.modulesById.keys(), + getModuleInfo: graph.getModuleInfo, + getWatchFiles: () => Object.keys(graph.watchFiles), + isExternal: getDeprecatedContextHandler((id, parentId, isResolved = false) => options.external(id, parentId, isResolved), 'isExternal', 'resolve', plugin.name, true, options), + load(resolvedId) { + return graph.moduleLoader.preloadModule(resolvedId); + }, + meta: { + rollupVersion: version$1, + watchMode: graph.watchMode + }, + get moduleIds() { + function* wrappedModuleIds() { + // We are wrapping this in a generator to only show the message once we are actually iterating + warnDeprecation({ + message: `Accessing "this.moduleIds" on the plugin context by plugin ${plugin.name} is deprecated. The "this.getModuleIds" plugin context function should be used instead.`, + plugin: plugin.name + }, false, options); + yield* moduleIds; + } + const moduleIds = graph.modulesById.keys(); + return wrappedModuleIds(); + }, + parse: graph.contextParse.bind(graph), + resolve(source, importer, { custom, isEntry, skipSelf } = BLANK) { + return graph.moduleLoader.resolveId(source, importer, custom, isEntry, skipSelf ? [{ importer, plugin, source }] : null); + }, + resolveId: getDeprecatedContextHandler((source, importer) => graph.moduleLoader + .resolveId(source, importer, BLANK, undefined) + .then(resolveId => resolveId && resolveId.id), 'resolveId', 'resolve', plugin.name, true, options), + setAssetSource: fileEmitter.setAssetSource, + warn(warning) { + if (typeof warning === 'string') + warning = { message: warning }; + if (warning.code) + warning.pluginCode = warning.code; + warning.code = 'PLUGIN_WARNING'; + warning.plugin = plugin.name; + options.onwarn(warning); + } }; } +// This will make sure no input hook is omitted const inputHookNames = { buildEnd: 1, buildStart: 1, + closeBundle: 1, + closeWatcher: 1, load: 1, + moduleParsed: 1, options: 1, resolveDynamicImport: 1, resolveId: 1, + shouldTransformCachedModule: 1, transform: 1, watchChange: 1 }; const inputHooks = Object.keys(inputHookNames); -function throwInvalidHookError(hookName, pluginName) { - return error({ - code: 'INVALID_PLUGIN_HOOK', - message: `Error running plugin hook ${hookName} for ${pluginName}, expected a function hook.` - }); -} class PluginDriver { constructor(graph, options, userPlugins, pluginCache, basePluginDriver) { this.graph = graph; this.options = options; - warnDeprecatedHooks(userPlugins, options); this.pluginCache = pluginCache; + this.sortedPlugins = new Map(); + this.unfulfilledActions = new Set(); + warnDeprecatedHooks(userPlugins, options); this.fileEmitter = new FileEmitter(graph, options, basePluginDriver && basePluginDriver.fileEmitter); - this.emitFile = this.fileEmitter.emitFile; - this.getFileName = this.fileEmitter.getFileName; - this.finaliseAssets = this.fileEmitter.assertAssetsFinalized; - this.setOutputBundle = this.fileEmitter.setOutputBundle; + this.emitFile = this.fileEmitter.emitFile.bind(this.fileEmitter); + this.getFileName = this.fileEmitter.getFileName.bind(this.fileEmitter); + this.finaliseAssets = this.fileEmitter.assertAssetsFinalized.bind(this.fileEmitter); + this.setOutputBundle = this.fileEmitter.setOutputBundle.bind(this.fileEmitter); this.plugins = userPlugins.concat(basePluginDriver ? basePluginDriver.plugins : []); - this.pluginContexts = this.plugins.map(getPluginContexts(pluginCache, graph, options, this.fileEmitter)); + const existingPluginNames = new Set(); + this.pluginContexts = new Map(this.plugins.map(plugin => [ + plugin, + getPluginContext(plugin, pluginCache, graph, options, this.fileEmitter, existingPluginNames) + ])); if (basePluginDriver) { for (const plugin of userPlugins) { for (const hook of inputHooks) { @@ -18004,148 +22634,237 @@ class PluginDriver { createOutputPluginDriver(plugins) { return new PluginDriver(this.graph, this.options, plugins, this.pluginCache, this); } + getUnfulfilledHookActions() { + return this.unfulfilledActions; + } // chains, first non-null result stops and returns - hookFirst(hookName, args, replaceContext, skip) { - let promise = Promise.resolve(undefined); - for (let i = 0; i < this.plugins.length; i++) { - if (skip === i) + hookFirst(hookName, args, replaceContext, skipped) { + let promise = Promise.resolve(null); + for (const plugin of this.getSortedPlugins(hookName)) { + if (skipped && skipped.has(plugin)) continue; promise = promise.then(result => { if (result != null) return result; - return this.runHook(hookName, args, i, false, replaceContext); + return this.runHook(hookName, args, plugin, replaceContext); }); } return promise; } // chains synchronously, first non-null result stops and returns hookFirstSync(hookName, args, replaceContext) { - for (let i = 0; i < this.plugins.length; i++) { - const result = this.runHookSync(hookName, args, i, replaceContext); + for (const plugin of this.getSortedPlugins(hookName)) { + const result = this.runHookSync(hookName, args, plugin, replaceContext); if (result != null) return result; } return null; } // parallel, ignores returns - hookParallel(hookName, args, replaceContext) { - const promises = []; - for (let i = 0; i < this.plugins.length; i++) { - const hookPromise = this.runHook(hookName, args, i, false, replaceContext); - if (!hookPromise) - continue; - promises.push(hookPromise); + async hookParallel(hookName, args, replaceContext) { + const parallelPromises = []; + for (const plugin of this.getSortedPlugins(hookName)) { + if (plugin[hookName].sequential) { + await Promise.all(parallelPromises); + parallelPromises.length = 0; + await this.runHook(hookName, args, plugin, replaceContext); + } + else { + parallelPromises.push(this.runHook(hookName, args, plugin, replaceContext)); + } } - return Promise.all(promises).then(() => { }); + await Promise.all(parallelPromises); } // chains, reduces returned value, handling the reduced value as the first hook argument hookReduceArg0(hookName, [arg0, ...rest], reduce, replaceContext) { let promise = Promise.resolve(arg0); - for (let i = 0; i < this.plugins.length; i++) { - promise = promise.then(arg0 => { - const args = [arg0, ...rest]; - const hookPromise = this.runHook(hookName, args, i, false, replaceContext); - if (!hookPromise) - return arg0; - return hookPromise.then(result => reduce.call(this.pluginContexts[i], arg0, result, this.plugins[i])); - }); + for (const plugin of this.getSortedPlugins(hookName)) { + promise = promise.then(arg0 => this.runHook(hookName, [arg0, ...rest], plugin, replaceContext).then(result => reduce.call(this.pluginContexts.get(plugin), arg0, result, plugin))); } return promise; } // chains synchronously, reduces returned value, handling the reduced value as the first hook argument hookReduceArg0Sync(hookName, [arg0, ...rest], reduce, replaceContext) { - for (let i = 0; i < this.plugins.length; i++) { + for (const plugin of this.getSortedPlugins(hookName)) { const args = [arg0, ...rest]; - const result = this.runHookSync(hookName, args, i, replaceContext); - arg0 = reduce.call(this.pluginContexts[i], arg0, result, this.plugins[i]); + const result = this.runHookSync(hookName, args, plugin, replaceContext); + arg0 = reduce.call(this.pluginContexts.get(plugin), arg0, result, plugin); } return arg0; } - // chains, reduces returned value to type T, handling the reduced value separately. permits hooks as values. - hookReduceValue(hookName, initialValue, args, reduce, replaceContext) { - let promise = Promise.resolve(initialValue); - for (let i = 0; i < this.plugins.length; i++) { - promise = promise.then(value => { - const hookPromise = this.runHook(hookName, args, i, true, replaceContext); - if (!hookPromise) - return value; - return hookPromise.then(result => reduce.call(this.pluginContexts[i], value, result, this.plugins[i])); - }); + // chains, reduces returned value to type string, handling the reduced value separately. permits hooks as values. + async hookReduceValue(hookName, initialValue, args, reducer) { + const results = []; + const parallelResults = []; + for (const plugin of this.getSortedPlugins(hookName, validateAddonPluginHandler)) { + if (plugin[hookName].sequential) { + results.push(...(await Promise.all(parallelResults))); + parallelResults.length = 0; + results.push(await this.runHook(hookName, args, plugin)); + } + else { + parallelResults.push(this.runHook(hookName, args, plugin)); + } } - return promise; + results.push(...(await Promise.all(parallelResults))); + return results.reduce(reducer, await initialValue); } // chains synchronously, reduces returned value to type T, handling the reduced value separately. permits hooks as values. hookReduceValueSync(hookName, initialValue, args, reduce, replaceContext) { let acc = initialValue; - for (let i = 0; i < this.plugins.length; i++) { - const result = this.runHookSync(hookName, args, i, replaceContext); - acc = reduce.call(this.pluginContexts[i], acc, result, this.plugins[i]); + for (const plugin of this.getSortedPlugins(hookName)) { + const result = this.runHookSync(hookName, args, plugin, replaceContext); + acc = reduce.call(this.pluginContexts.get(plugin), acc, result, plugin); } return acc; } // chains, ignores returns hookSeq(hookName, args, replaceContext) { let promise = Promise.resolve(); - for (let i = 0; i < this.plugins.length; i++) { - promise = promise.then(() => this.runHook(hookName, args, i, false, replaceContext)); + for (const plugin of this.getSortedPlugins(hookName)) { + promise = promise.then(() => this.runHook(hookName, args, plugin, replaceContext)); } - return promise; + return promise.then(noReturn); } - // chains synchronously, ignores returns - hookSeqSync(hookName, args, replaceContext) { - for (let i = 0; i < this.plugins.length; i++) { - this.runHookSync(hookName, args, i, replaceContext); - } + getSortedPlugins(hookName, validateHandler) { + return getOrCreate(this.sortedPlugins, hookName, () => getSortedValidatedPlugins(hookName, this.plugins, validateHandler)); } - runHook(hookName, args, pluginIndex, permitValues, hookContext) { - const plugin = this.plugins[pluginIndex]; + // Implementation signature + runHook(hookName, args, plugin, replaceContext) { + // We always filter for plugins that support the hook before running it const hook = plugin[hookName]; - if (!hook) - return undefined; - let context = this.pluginContexts[pluginIndex]; - if (hookContext) { - context = hookContext(context, plugin); + const handler = typeof hook === 'object' ? hook.handler : hook; + let context = this.pluginContexts.get(plugin); + if (replaceContext) { + context = replaceContext(context, plugin); } + let action = null; return Promise.resolve() .then(() => { - // permit values allows values to be returned instead of a functional hook - if (typeof hook !== 'function') { - if (permitValues) - return hook; - return throwInvalidHookError(hookName, plugin.name); - } - return hook.apply(context, args); + if (typeof handler !== 'function') { + return handler; + } + // eslint-disable-next-line @typescript-eslint/ban-types + const hookResult = handler.apply(context, args); + if (!(hookResult === null || hookResult === void 0 ? void 0 : hookResult.then)) { + // short circuit for non-thenables and non-Promises + return hookResult; + } + // Track pending hook actions to properly error out when + // unfulfilled promises cause rollup to abruptly and confusingly + // exit with a successful 0 return code but without producing any + // output, errors or warnings. + action = [plugin.name, hookName, args]; + this.unfulfilledActions.add(action); + // Although it would be more elegant to just return hookResult here + // and put the .then() handler just above the .catch() handler below, + // doing so would subtly change the defacto async event dispatch order + // which at least one test and some plugins in the wild may depend on. + return Promise.resolve(hookResult).then(result => { + // action was fulfilled + this.unfulfilledActions.delete(action); + return result; + }); }) - .catch(err => throwPluginError(err, plugin.name, { hook: hookName })); + .catch(err => { + if (action !== null) { + // action considered to be fulfilled since error being handled + this.unfulfilledActions.delete(action); + } + return throwPluginError(err, plugin.name, { hook: hookName }); + }); } /** * Run a sync plugin hook and return the result. * @param hookName Name of the plugin hook. Must be in `PluginHooks`. * @param args Arguments passed to the plugin hook. - * @param pluginIndex Index of the plugin inside `this.plugins[]`. - * @param hookContext When passed, the plugin context can be overridden. + * @param plugin The acutal plugin + * @param replaceContext When passed, the plugin context can be overridden. */ - runHookSync(hookName, args, pluginIndex, hookContext) { - const plugin = this.plugins[pluginIndex]; + runHookSync(hookName, args, plugin, replaceContext) { const hook = plugin[hookName]; - if (!hook) - return undefined; - let context = this.pluginContexts[pluginIndex]; - if (hookContext) { - context = hookContext(context, plugin); + const handler = typeof hook === 'object' ? hook.handler : hook; + let context = this.pluginContexts.get(plugin); + if (replaceContext) { + context = replaceContext(context, plugin); } try { - // permit values allows values to be returned instead of a functional hook - if (typeof hook !== 'function') { - return throwInvalidHookError(hookName, plugin.name); - } - return hook.apply(context, args); + // eslint-disable-next-line @typescript-eslint/ban-types + return handler.apply(context, args); } catch (err) { return throwPluginError(err, plugin.name, { hook: hookName }); } } } +function getSortedValidatedPlugins(hookName, plugins, validateHandler = validateFunctionPluginHandler) { + const pre = []; + const normal = []; + const post = []; + for (const plugin of plugins) { + const hook = plugin[hookName]; + if (hook) { + if (typeof hook === 'object') { + validateHandler(hook.handler, hookName, plugin); + if (hook.order === 'pre') { + pre.push(plugin); + continue; + } + if (hook.order === 'post') { + post.push(plugin); + continue; + } + } + else { + validateHandler(hook, hookName, plugin); + } + normal.push(plugin); + } + } + return [...pre, ...normal, ...post]; +} +function validateFunctionPluginHandler(handler, hookName, plugin) { + if (typeof handler !== 'function') { + error(errInvalidFunctionPluginHook(hookName, plugin.name)); + } +} +function validateAddonPluginHandler(handler, hookName, plugin) { + if (typeof handler !== 'string' && typeof handler !== 'function') { + return error(errInvalidAddonPluginHook(hookName, plugin.name)); + } +} +function noReturn() { } + +class Queue { + constructor(maxParallel) { + this.maxParallel = maxParallel; + this.queue = []; + this.workerCount = 0; + } + run(task) { + return new Promise((resolve, reject) => { + this.queue.push({ reject, resolve, task }); + this.work(); + }); + } + async work() { + if (this.workerCount >= this.maxParallel) + return; + this.workerCount++; + let entry; + while ((entry = this.queue.shift())) { + const { reject, resolve, task } = entry; + try { + const result = await task(); + resolve(result); + } + catch (err) { + reject(err); + } + } + this.workerCount--; + } +} function normalizeEntryModules(entryModules) { if (Array.isArray(entryModules)) { @@ -18157,9 +22876,9 @@ function normalizeEntryModules(entryModules) { name: null })); } - return Object.keys(entryModules).map(name => ({ + return Object.entries(entryModules).map(([name, id]) => ({ fileName: null, - id: entryModules[name], + id, implicitlyLoadedAfter: [], importer: undefined, name @@ -18169,10 +22888,13 @@ class Graph { constructor(options, watcher) { var _a, _b; this.options = options; + this.cachedModules = new Map(); + this.deoptimizationTracker = new PathTracker(); this.entryModules = []; this.modulesById = new Map(); this.needsTreeshakingPass = false; this.phase = BuildPhase.LOAD_AND_PARSE; + this.scope = new GlobalScope(); this.watchFiles = Object.create(null); this.watchMode = false; this.externalModules = []; @@ -18180,36 +22902,10 @@ class Graph { this.modules = []; this.getModuleInfo = (moduleId) => { const foundModule = this.modulesById.get(moduleId); - if (foundModule == null) { - throw new Error(`Unable to find module ${moduleId}`); - } - const importedIds = []; - const dynamicallyImportedIds = []; - if (foundModule instanceof Module) { - for (const source of foundModule.sources) { - importedIds.push(foundModule.resolvedIds[source].id); - } - for (const { resolution } of foundModule.dynamicImports) { - if (resolution instanceof Module || resolution instanceof ExternalModule) { - dynamicallyImportedIds.push(resolution.id); - } - } - } - return { - dynamicallyImportedIds, - dynamicImporters: foundModule.dynamicImporters.sort(), - hasModuleSideEffects: foundModule.moduleSideEffects, - id: foundModule.id, - implicitlyLoadedAfterOneOf: foundModule instanceof Module ? Array.from(foundModule.implicitlyLoadedAfter, getId) : [], - implicitlyLoadedBefore: foundModule instanceof Module ? Array.from(foundModule.implicitlyLoadedBefore, getId) : [], - importedIds, - importers: foundModule.importers.sort(), - isEntry: foundModule instanceof Module && foundModule.isEntryPoint, - isExternal: foundModule instanceof ExternalModule - }; + if (!foundModule) + return null; + return foundModule.info; }; - this.deoptimizationTracker = new PathTracker(); - this.cachedModules = new Map(); if (options.cache !== false) { if ((_a = options.cache) === null || _a === void 0 ? void 0 : _a.modules) { for (const module of options.cache.modules) @@ -18219,26 +22915,21 @@ class Graph { // increment access counter for (const name in this.pluginCache) { const cache = this.pluginCache[name]; - for (const key of Object.keys(cache)) - cache[key][0]++; + for (const value of Object.values(cache)) + value[0]++; } } - this.contextParse = (code, options = {}) => this.acornParser.parse(code, { - ...this.options.acorn, - ...options - }); if (watcher) { this.watchMode = true; - const handleChange = (id) => this.pluginDriver.hookSeqSync('watchChange', [id]); - watcher.on('change', handleChange); - watcher.once('restart', () => { - watcher.removeListener('change', handleChange); - }); + const handleChange = (...args) => this.pluginDriver.hookParallel('watchChange', args); + const handleClose = () => this.pluginDriver.hookParallel('closeWatcher', []); + watcher.onCurrentAwaited('change', handleChange); + watcher.onCurrentAwaited('close', handleClose); } this.pluginDriver = new PluginDriver(this, options, options.plugins, this.pluginCache); - this.scope = new GlobalScope(); this.acornParser = Parser.extend(...options.acornInjectPlugins); this.moduleLoader = new ModuleLoader(this, this.modulesById, this.options, this.pluginDriver); + this.fileOperationQueue = new Queue(options.maxParallelFileOps); } async build() { timeStart('generate module graph', 2); @@ -18253,13 +22944,36 @@ class Graph { timeEnd('mark included statements', 2); this.phase = BuildPhase.GENERATE; } + contextParse(code, options = {}) { + const onCommentOrig = options.onComment; + const comments = []; + if (onCommentOrig && typeof onCommentOrig == 'function') { + options.onComment = (block, text, start, end, ...args) => { + comments.push({ end, start, type: block ? 'Block' : 'Line', value: text }); + return onCommentOrig.call(options, block, text, start, end, ...args); + }; + } + else { + options.onComment = comments; + } + const ast = this.acornParser.parse(code, { + ...this.options.acorn, + ...options + }); + if (typeof onCommentOrig == 'object') { + onCommentOrig.push(...comments); + } + options.onComment = onCommentOrig; + addAnnotations(comments, ast, code); + return ast; + } getCache() { // handle plugin cache eviction for (const name in this.pluginCache) { const cache = this.pluginCache[name]; let allDeleted = true; - for (const key of Object.keys(cache)) { - if (cache[key][0] >= this.options.experimentalCacheExpiry) + for (const [key, value] of Object.entries(cache)) { + if (value[0] >= this.options.experimentalCacheExpiry) delete cache[key]; else allDeleted = false; @@ -18273,10 +22987,8 @@ class Graph { }; } async generateModuleGraph() { - ({ - entryModules: this.entryModules, - implicitEntryModules: this.implicitEntryModules - } = await this.moduleLoader.addEntryModules(normalizeEntryModules(this.options.input), true)); + ({ entryModules: this.entryModules, implicitEntryModules: this.implicitEntryModules } = + await this.moduleLoader.addEntryModules(normalizeEntryModules(this.options.input), true)); if (this.entryModules.length === 0) { throw new Error('You must supply options.input to rollup'); } @@ -18291,12 +23003,7 @@ class Graph { } includeStatements() { for (const module of [...this.entryModules, ...this.implicitEntryModules]) { - if (module.preserveSignature !== false) { - module.includeAllExports(); - } - else { - markModuleAndImpureDependenciesAsExecuted(module); - } + markModuleAndImpureDependenciesAsExecuted(module); } if (this.options.treeshake) { let treeshakingPass = 1; @@ -18304,8 +23011,24 @@ class Graph { timeStart(`treeshaking pass ${treeshakingPass}`, 3); this.needsTreeshakingPass = false; for (const module of this.modules) { - if (module.isExecuted) - module.include(); + if (module.isExecuted) { + if (module.info.moduleSideEffects === 'no-treeshake') { + module.includeAllInBundle(); + } + else { + module.include(); + } + } + } + if (treeshakingPass === 1) { + // We only include exports after the first pass to avoid issues with + // the TDZ detection logic + for (const module of [...this.entryModules, ...this.implicitEntryModules]) { + if (module.preserveSignature !== false) { + module.includeAllExports(false); + this.needsTreeshakingPass = true; + } + } } timeEnd(`treeshaking pass ${treeshakingPass++}`, 3); } while (this.needsTreeshakingPass); @@ -18318,527 +23041,92 @@ class Graph { externalModule.warnUnusedImports(); for (const module of this.implicitEntryModules) { for (const dependant of module.implicitlyLoadedAfter) { - if (!(dependant.isEntryPoint || dependant.isIncluded())) { + if (!(dependant.info.isEntry || dependant.isIncluded())) { error(errImplicitDependantIsNotIncluded(dependant)); } - } - } - } - sortModules() { - const { orderedModules, cyclePaths } = analyseModuleExecution(this.entryModules); - for (const cyclePath of cyclePaths) { - this.options.onwarn({ - code: 'CIRCULAR_DEPENDENCY', - cycle: cyclePath, - importer: cyclePath[0], - message: `Circular dependency: ${cyclePath.join(' -> ')}` - }); - } - this.modules = orderedModules; - for (const module of this.modules) { - module.bindReferences(); - } - this.warnForMissingExports(); - } - warnForMissingExports() { - for (const module of this.modules) { - for (const importName of Object.keys(module.importDescriptions)) { - const importDescription = module.importDescriptions[importName]; - if (importDescription.name !== '*' && - !importDescription.module.getVariableForExportName(importDescription.name)) { - module.warn({ - code: 'NON_EXISTENT_EXPORT', - message: `Non-existent export '${importDescription.name}' is imported from ${relativeId(importDescription.module.id)}`, - name: importDescription.name, - source: importDescription.module.id - }, importDescription.start); - } - } - } - } -} - -function ensureArray(items) { - if (Array.isArray(items)) { - return items.filter(Boolean); - } - if (items) { - return [items]; - } - return []; -} - -function createCommonjsModule(fn, basedir, module) { - return module = { - path: basedir, - exports: {}, - require: function (path, base) { - return commonjsRequire(); - } - }, fn(module, module.exports), module.exports; -} - -function getCjsExportFromNamespace (n) { - return n && n['default'] || n; -} - -function commonjsRequire () { - throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs'); -} - -var require$$0 = getCjsExportFromNamespace(acorn); - -const getPrototype = Object.getPrototypeOf || (o => o.__proto__); - -const getAcorn = Parser => { - if (Parser.acorn) return Parser.acorn - - const acorn = require$$0; - - if (acorn.version.indexOf("6.") != 0 && acorn.version.indexOf("6.0.") == 0 && acorn.version.indexOf("7.") != 0) { - throw new Error(`acorn-private-class-elements requires acorn@^6.1.0 or acorn@7.0.0, not ${acorn.version}`) - } - - // Make sure `Parser` comes from the same acorn as we `require`d, - // otherwise the comparisons fail. - for (let cur = Parser; cur && cur !== acorn.Parser; cur = getPrototype(cur)) { - if (cur !== acorn.Parser) { - throw new Error("acorn-private-class-elements does not support mixing different acorn copies") - } - } - return acorn -}; - -var acornPrivateClassElements = function(Parser) { - // Only load this plugin once. - if (Parser.prototype.parsePrivateName) { - return Parser - } - - const acorn = getAcorn(Parser); - - Parser = class extends Parser { - _branch() { - this.__branch = this.__branch || new Parser({ecmaVersion: this.options.ecmaVersion}, this.input); - this.__branch.end = this.end; - this.__branch.pos = this.pos; - this.__branch.type = this.type; - this.__branch.value = this.value; - this.__branch.containsEsc = this.containsEsc; - return this.__branch - } - - parsePrivateClassElementName(element) { - element.computed = false; - element.key = this.parsePrivateName(); - if (element.key.name == "constructor") this.raise(element.key.start, "Classes may not have a private element named constructor"); - const accept = {get: "set", set: "get"}[element.kind]; - const privateBoundNames = this._privateBoundNames; - if (Object.prototype.hasOwnProperty.call(privateBoundNames, element.key.name) && privateBoundNames[element.key.name] !== accept) { - this.raise(element.start, "Duplicate private element"); - } - privateBoundNames[element.key.name] = element.kind || true; - delete this._unresolvedPrivateNames[element.key.name]; - return element.key - } - - parsePrivateName() { - const node = this.startNode(); - node.name = this.value; - this.next(); - this.finishNode(node, "PrivateName"); - if (this.options.allowReserved == "never") this.checkUnreserved(node); - return node - } - - // Parse # token - getTokenFromCode(code) { - if (code === 35) { - ++this.pos; - const word = this.readWord1(); - return this.finishToken(this.privateNameToken, word) - } - return super.getTokenFromCode(code) - } - - // Manage stacks and check for undeclared private names - parseClass(node, isStatement) { - const oldOuterPrivateBoundNames = this._outerPrivateBoundNames; - this._outerPrivateBoundNames = this._privateBoundNames; - this._privateBoundNames = Object.create(this._privateBoundNames || null); - const oldOuterUnresolvedPrivateNames = this._outerUnresolvedPrivateNames; - this._outerUnresolvedPrivateNames = this._unresolvedPrivateNames; - this._unresolvedPrivateNames = Object.create(null); - - const _return = super.parseClass(node, isStatement); - - const unresolvedPrivateNames = this._unresolvedPrivateNames; - this._privateBoundNames = this._outerPrivateBoundNames; - this._outerPrivateBoundNames = oldOuterPrivateBoundNames; - this._unresolvedPrivateNames = this._outerUnresolvedPrivateNames; - this._outerUnresolvedPrivateNames = oldOuterUnresolvedPrivateNames; - if (!this._unresolvedPrivateNames) { - const names = Object.keys(unresolvedPrivateNames); - if (names.length) { - names.sort((n1, n2) => unresolvedPrivateNames[n1] - unresolvedPrivateNames[n2]); - this.raise(unresolvedPrivateNames[names[0]], "Usage of undeclared private name"); - } - } else Object.assign(this._unresolvedPrivateNames, unresolvedPrivateNames); - return _return - } - - // Class heritage is evaluated with outer private environment - parseClassSuper(node) { - const privateBoundNames = this._privateBoundNames; - this._privateBoundNames = this._outerPrivateBoundNames; - const unresolvedPrivateNames = this._unresolvedPrivateNames; - this._unresolvedPrivateNames = this._outerUnresolvedPrivateNames; - const _return = super.parseClassSuper(node); - this._privateBoundNames = privateBoundNames; - this._unresolvedPrivateNames = unresolvedPrivateNames; - return _return - } - - // Parse private element access - parseSubscript(base, startPos, startLoc, _noCalls, _maybeAsyncArrow, _optionalChained) { - const optionalSupported = this.options.ecmaVersion >= 11 && acorn.tokTypes.questionDot; - const branch = this._branch(); - if (!( - (branch.eat(acorn.tokTypes.dot) || (optionalSupported && branch.eat(acorn.tokTypes.questionDot))) && - branch.type == this.privateNameToken - )) { - return super.parseSubscript.apply(this, arguments) - } - let optional = false; - if (!this.eat(acorn.tokTypes.dot)) { - this.expect(acorn.tokTypes.questionDot); - optional = true; - } - let node = this.startNodeAt(startPos, startLoc); - node.object = base; - node.computed = false; - if (optionalSupported) { - node.optional = optional; - } - if (this.type == this.privateNameToken) { - if (base.type == "Super") { - this.raise(this.start, "Cannot access private element on super"); - } - node.property = this.parsePrivateName(); - if (!this._privateBoundNames || !this._privateBoundNames[node.property.name]) { - if (!this._unresolvedPrivateNames) { - this.raise(node.property.start, "Usage of undeclared private name"); - } - this._unresolvedPrivateNames[node.property.name] = node.property.start; + } } - } else { - node.property = this.parseIdent(true); - } - return this.finishNode(node, "MemberExpression") } - - // Prohibit delete of private class elements - parseMaybeUnary(refDestructuringErrors, sawUnary) { - const _return = super.parseMaybeUnary(refDestructuringErrors, sawUnary); - if (_return.operator == "delete") { - if (_return.argument.type == "MemberExpression" && _return.argument.property.type == "PrivateName") { - this.raise(_return.start, "Private elements may not be deleted"); + sortModules() { + const { orderedModules, cyclePaths } = analyseModuleExecution(this.entryModules); + for (const cyclePath of cyclePaths) { + this.options.onwarn({ + code: 'CIRCULAR_DEPENDENCY', + cycle: cyclePath, + importer: cyclePath[0], + message: `Circular dependency: ${cyclePath.join(' -> ')}` + }); } - } - return _return - } - }; - Parser.prototype.privateNameToken = new acorn.TokenType("privateName"); - return Parser -}; - -var acornClassFields = function(Parser) { - const acorn = Parser.acorn || require$$0; - const tt = acorn.tokTypes; - - Parser = acornPrivateClassElements(Parser); - return class extends Parser { - _maybeParseFieldValue(field) { - if (this.eat(tt.eq)) { - const oldInFieldValue = this._inFieldValue; - this._inFieldValue = true; - field.value = this.parseExpression(); - this._inFieldValue = oldInFieldValue; - } else field.value = null; - } - - // Parse fields - parseClassElement(_constructorAllowsSuper) { - if (this.options.ecmaVersion >= 8 && (this.type == tt.name || this.type.keyword || this.type == this.privateNameToken || this.type == tt.bracketL || this.type == tt.string || this.type == tt.num)) { - const branch = this._branch(); - if (branch.type == tt.bracketL) { - let count = 0; - do { - if (branch.eat(tt.bracketL)) ++count; - else if (branch.eat(tt.bracketR)) --count; - else branch.next(); - } while (count > 0) - } else branch.next(true); - if (branch.type == tt.eq || branch.canInsertSemicolon() || branch.type == tt.semi) { - const node = this.startNode(); - if (this.type == this.privateNameToken) { - this.parsePrivateClassElementName(node); - } else { - this.parsePropertyName(node); - } - if ((node.key.type === "Identifier" && node.key.name === "constructor") || - (node.key.type === "Literal" && node.key.value === "constructor")) { - this.raise(node.key.start, "Classes may not have a field called constructor"); - } - this.enterScope(64 | 2 | 1); // See acorn's scopeflags.js - this._maybeParseFieldValue(node); - this.exitScope(); - this.finishNode(node, "FieldDefinition"); - this.semicolon(); - return node + this.modules = orderedModules; + for (const module of this.modules) { + module.bindReferences(); } - } - - return super.parseClassElement.apply(this, arguments) - } - - // Prohibit arguments in class field initializers - parseIdent(liberal, isBinding) { - const ident = super.parseIdent(liberal, isBinding); - if (this._inFieldValue && ident.name == "arguments") this.raise(ident.start, "A class field initializer may not contain arguments"); - return ident - } - } -}; - -function withoutAcornBigInt(acorn, Parser) { - return class extends Parser { - readInt(radix, len) { - // Hack: len is only != null for unicode escape sequences, - // where numeric separators are not allowed - if (len != null) return super.readInt(radix, len) - - let start = this.pos, total = 0, acceptUnderscore = false; - for (;;) { - let code = this.input.charCodeAt(this.pos), val; - if (code >= 97) val = code - 97 + 10; // a - else if (code == 95) { - if (!acceptUnderscore) this.raise(this.pos, "Invalid numeric separator"); - ++this.pos; - acceptUnderscore = false; - continue - } else if (code >= 65) val = code - 65 + 10; // A - else if (code >= 48 && code <= 57) val = code - 48; // 0-9 - else val = Infinity; - if (val >= radix) break - ++this.pos; - total = total * radix + val; - acceptUnderscore = true; - } - if (this.pos === start) return null - if (!acceptUnderscore) this.raise(this.pos - 1, "Invalid numeric separator"); - - return total - } - - readNumber(startsWithDot) { - const token = super.readNumber(startsWithDot); - let octal = this.end - this.start >= 2 && this.input.charCodeAt(this.start) === 48; - const stripped = this.getNumberInput(this.start, this.end); - if (stripped.length < this.end - this.start) { - if (octal) this.raise(this.start, "Invalid number"); - this.value = parseFloat(stripped); - } - return token + this.warnForMissingExports(); } - - // This is used by acorn-bigint - getNumberInput(start, end) { - return this.input.slice(start, end).replace(/_/g, "") + warnForMissingExports() { + for (const module of this.modules) { + for (const importDescription of module.importDescriptions.values()) { + if (importDescription.name !== '*' && + !importDescription.module.getVariableForExportName(importDescription.name)[0]) { + module.warn({ + code: 'NON_EXISTENT_EXPORT', + message: `Non-existent export '${importDescription.name}' is imported from ${relativeId(importDescription.module.id)}`, + name: importDescription.name, + source: importDescription.module.id + }, importDescription.start); + } + } + } } - } } -function withAcornBigInt(acorn, Parser) { - return class extends Parser { - readInt(radix, len) { - // Hack: len is only != null for unicode escape sequences, - // where numeric separators are not allowed - if (len != null) return super.readInt(radix, len) - - let start = this.pos, total = 0, acceptUnderscore = false; - for (;;) { - let code = this.input.charCodeAt(this.pos), val; - if (code >= 97) val = code - 97 + 10; // a - else if (code == 95) { - if (!acceptUnderscore) this.raise(this.pos, "Invalid numeric separator"); - ++this.pos; - acceptUnderscore = false; - continue - } else if (code >= 65) val = code - 65 + 10; // A - else if (code >= 48 && code <= 57) val = code - 48; // 0-9 - else val = Infinity; - if (val >= radix) break - ++this.pos; - total = total * radix + val; - acceptUnderscore = true; - } - if (this.pos === start) return null - if (!acceptUnderscore) this.raise(this.pos - 1, "Invalid numeric separator"); - - return total - } - - readNumber(startsWithDot) { - let start = this.pos; - if (!startsWithDot && this.readInt(10) === null) this.raise(start, "Invalid number"); - let octal = this.pos - start >= 2 && this.input.charCodeAt(start) === 48; - let octalLike = false; - if (octal && this.strict) this.raise(start, "Invalid number"); - let next = this.input.charCodeAt(this.pos); - if (!octal && !startsWithDot && this.options.ecmaVersion >= 11 && next === 110) { - let str = this.getNumberInput(start, this.pos); - let val = typeof BigInt !== "undefined" ? BigInt(str) : null; - ++this.pos; - if (acorn.isIdentifierStart(this.fullCharCodeAtPos())) this.raise(this.pos, "Identifier directly after number"); - return this.finishToken(acorn.tokTypes.num, val) - } - if (octal && /[89]/.test(this.input.slice(start, this.pos))) { - octal = false; - octalLike = true; - } - if (next === 46 && !octal) { // '.' - ++this.pos; - this.readInt(10); - next = this.input.charCodeAt(this.pos); - } - if ((next === 69 || next === 101) && !octal) { // 'eE' - next = this.input.charCodeAt(++this.pos); - if (next === 43 || next === 45) ++this.pos; // '+-' - if (this.readInt(10) === null) this.raise(start, "Invalid number"); - } - if (acorn.isIdentifierStart(this.fullCharCodeAtPos())) this.raise(this.pos, "Identifier directly after number"); - let str = this.getNumberInput(start, this.pos); - if ((octal || octalLike) && str.length < this.pos - start) { - this.raise(start, "Invalid number"); - } - - let val = octal ? parseInt(str, 8) : parseFloat(str); - return this.finishToken(acorn.tokTypes.num, val) - } - - parseLiteral(value) { - const ret = super.parseLiteral(value); - if (ret.bigint) ret.bigint = ret.bigint.replace(/_/g, ""); - return ret - } - - readRadixNumber(radix) { - let start = this.pos; - this.pos += 2; // 0x - let val = this.readInt(radix); - if (val == null) { this.raise(this.start + 2, "Expected number in radix " + radix); } - if (this.options.ecmaVersion >= 11 && this.input.charCodeAt(this.pos) === 110) { - let str = this.getNumberInput(start, this.pos); - val = typeof BigInt !== "undefined" ? BigInt(str) : null; - ++this.pos; - } else if (acorn.isIdentifierStart(this.fullCharCodeAtPos())) { this.raise(this.pos, "Identifier directly after number"); } - return this.finishToken(acorn.tokTypes.num, val) +function ensureArray(items) { + if (Array.isArray(items)) { + return items.filter(Boolean); } - - // This is used by acorn-bigint, which theoretically could be used with acorn@6.2 || acorn@7 - getNumberInput(start, end) { - return this.input.slice(start, end).replace(/_/g, "") + if (items) { + return [items]; } - } + return []; } -var acornNumericSeparator = function(Parser) { - const acorn = Parser.acorn || require$$0; - const withAcornBigIntSupport = (acorn.version.startsWith("6.") && !(acorn.version.startsWith("6.0.") || acorn.version.startsWith("6.1."))) || acorn.version.startsWith("7."); - - return withAcornBigIntSupport ? withAcornBigInt(acorn, Parser) : withoutAcornBigInt(acorn, Parser) -}; - -var acornStaticClassFeatures = function(Parser) { - const ExtendedParser = acornPrivateClassElements(Parser); - - const acorn = Parser.acorn || require$$0; - const tt = acorn.tokTypes; - - return class extends ExtendedParser { - _maybeParseFieldValue(field) { - if (this.eat(tt.eq)) { - const oldInFieldValue = this._inStaticFieldScope; - this._inStaticFieldScope = this.currentThisScope(); - field.value = this.parseExpression(); - this._inStaticFieldScope = oldInFieldValue; - } else field.value = null; - } - - // Parse fields - parseClassElement(_constructorAllowsSuper) { - if (this.options.ecmaVersion < 8 || !this.isContextual("static")) { - return super.parseClassElement.apply(this, arguments) - } - - const branch = this._branch(); - branch.next(); - if ([tt.name, tt.bracketL, tt.string, tt.num, this.privateNameToken].indexOf(branch.type) == -1) { - return super.parseClassElement.apply(this, arguments) - } - if (branch.type == tt.bracketL) { - let count = 0; - do { - if (branch.eat(tt.bracketL)) ++count; - else if (branch.eat(tt.bracketR)) --count; - else branch.next(); - } while (count > 0) - } else branch.next(); - if (branch.type != tt.eq && !branch.canInsertSemicolon() && branch.type != tt.semi) { - return super.parseClassElement.apply(this, arguments) - } - - const node = this.startNode(); - node.static = this.eatContextual("static"); - if (this.type == this.privateNameToken) { - this.parsePrivateClassElementName(node); - } else { - this.parsePropertyName(node); - } - if ((node.key.type === "Identifier" && node.key.name === "constructor") || - (node.key.type === "Literal" && !node.computed && node.key.value === "constructor")) { - this.raise(node.key.start, "Classes may not have a field called constructor"); - } - if ((node.key.name || node.key.value) === "prototype" && !node.computed) { - this.raise(node.key.start, "Classes may not have a static property named prototype"); - } - - this._maybeParseFieldValue(node); - this.finishNode(node, "FieldDefinition"); - this.semicolon(); - return node - } - - // Parse private static methods - parsePropertyName(prop) { - if (prop.static && this.type == this.privateNameToken) { - this.parsePrivateClassElementName(prop); - } else { - super.parsePropertyName(prop); - } - } - - // Prohibit arguments in class field initializers - parseIdent(liberal, isBinding) { - const ident = super.parseIdent(liberal, isBinding); - if (this._inStaticFieldScope && this.currentThisScope() === this._inStaticFieldScope && ident.name == "arguments") { - this.raise(ident.start, "A static class field initializer may not contain arguments"); - } - return ident - } - } -}; +function formatAction([pluginName, hookName, args]) { + const action = `(${pluginName}) ${hookName}`; + const s = JSON.stringify; + switch (hookName) { + case 'resolveId': + return `${action} ${s(args[0])} ${s(args[1])}`; + case 'load': + return `${action} ${s(args[0])}`; + case 'transform': + return `${action} ${s(args[1])}`; + case 'shouldTransformCachedModule': + return `${action} ${s(args[0].id)}`; + case 'moduleParsed': + return `${action} ${s(args[0].id)}`; + } + return action; +} +// We do not directly listen on process to avoid max listeners warnings for +// complicated build processes +const beforeExitEvent = 'beforeExit'; +const beforeExitEmitter = new EventEmitter(); +beforeExitEmitter.setMaxListeners(0); +process$1.on(beforeExitEvent, () => beforeExitEmitter.emit(beforeExitEvent)); +async function catchUnfinishedHookActions(pluginDriver, callback) { + let handleEmptyEventLoop; + const emptyEventLoopPromise = new Promise((_, reject) => { + handleEmptyEventLoop = () => { + const unfulfilledActions = pluginDriver.getUnfulfilledHookActions(); + reject(new Error(`Unexpected early exit. This happens when Promises returned by plugins cannot resolve. Unfinished hook action(s) on exit:\n` + + [...unfulfilledActions].map(formatAction).join('\n'))); + }; + beforeExitEmitter.once(beforeExitEvent, handleEmptyEventLoop); + }); + const result = await Promise.race([callback(), emptyEventLoopPromise]); + beforeExitEmitter.off(beforeExitEvent, handleEmptyEventLoop); + return result; +} const defaultOnWarn = warning => console.warn(warning.message || warning); function warnUnknownOptions(passedOptions, validOptions, optionType, warn, ignoredKeys = /$./) { @@ -18855,31 +23143,102 @@ function warnUnknownOptions(passedOptions, validOptions, optionType, warn, ignor }); } } +const treeshakePresets = { + recommended: { + annotations: true, + correctVarValueBeforeDeclaration: false, + moduleSideEffects: () => true, + propertyReadSideEffects: true, + tryCatchDeoptimization: true, + unknownGlobalSideEffects: false + }, + safest: { + annotations: true, + correctVarValueBeforeDeclaration: true, + moduleSideEffects: () => true, + propertyReadSideEffects: true, + tryCatchDeoptimization: true, + unknownGlobalSideEffects: true + }, + smallest: { + annotations: true, + correctVarValueBeforeDeclaration: false, + moduleSideEffects: () => false, + propertyReadSideEffects: false, + tryCatchDeoptimization: false, + unknownGlobalSideEffects: false + } +}; +const generatedCodePresets = { + es2015: { + arrowFunctions: true, + constBindings: true, + objectShorthand: true, + reservedNamesAsProps: true, + symbols: true + }, + es5: { + arrowFunctions: false, + constBindings: false, + objectShorthand: false, + reservedNamesAsProps: true, + symbols: false + } +}; +const objectifyOption = (value) => value && typeof value === 'object' ? value : {}; +const objectifyOptionWithPresets = (presets, optionName, additionalValues) => (value) => { + if (typeof value === 'string') { + const preset = presets[value]; + if (preset) { + return preset; + } + error(errInvalidOption(optionName, getHashFromObjectOption(optionName), `valid values are ${additionalValues}${printQuotedStringList(Object.keys(presets))}. You can also supply an object for more fine-grained control`, value)); + } + return objectifyOption(value); +}; +const getOptionWithPreset = (value, presets, optionName, additionalValues) => { + const presetName = value === null || value === void 0 ? void 0 : value.preset; + if (presetName) { + const preset = presets[presetName]; + if (preset) { + return { ...preset, ...value }; + } + else { + error(errInvalidOption(`${optionName}.preset`, getHashFromObjectOption(optionName), `valid values are ${printQuotedStringList(Object.keys(presets))}`, presetName)); + } + } + return objectifyOptionWithPresets(presets, optionName, additionalValues)(value); +}; +const getHashFromObjectOption = (optionName) => optionName.split('.').join('').toLowerCase(); function normalizeInputOptions(config) { - var _a, _b; + var _a, _b, _c; // These are options that may trigger special warnings or behaviour later // if the user did not select an explicit value const unsetOptions = new Set(); const context = (_a = config.context) !== null && _a !== void 0 ? _a : 'undefined'; const onwarn = getOnwarn(config); const strictDeprecations = config.strictDeprecations || false; + const maxParallelFileOps = getmaxParallelFileOps(config, onwarn, strictDeprecations); const options = { - acorn: getAcorn$1(config), + acorn: getAcorn(config), acornInjectPlugins: getAcornInjectPlugins(config), cache: getCache(config), context, experimentalCacheExpiry: (_b = config.experimentalCacheExpiry) !== null && _b !== void 0 ? _b : 10, external: getIdMatcher(config.external), - inlineDynamicImports: getInlineDynamicImports(config, onwarn, strictDeprecations), + inlineDynamicImports: getInlineDynamicImports$1(config, onwarn, strictDeprecations), input: getInput(config), - manualChunks: getManualChunks(config, onwarn, strictDeprecations), + makeAbsoluteExternalsRelative: (_c = config.makeAbsoluteExternalsRelative) !== null && _c !== void 0 ? _c : true, + manualChunks: getManualChunks$1(config, onwarn, strictDeprecations), + maxParallelFileOps, + maxParallelFileReads: maxParallelFileOps, moduleContext: getModuleContext(config, context), onwarn, perf: config.perf || false, plugins: ensureArray(config.plugins), preserveEntrySignatures: getPreserveEntrySignatures(config, unsetOptions), - preserveModules: getPreserveModules(config, onwarn, strictDeprecations), + preserveModules: getPreserveModules$1(config, onwarn, strictDeprecations), preserveSymlinks: config.preserveSymlinks || false, shimMissingExports: config.shimMissingExports || false, strictDeprecations, @@ -18889,7 +23248,8 @@ function normalizeInputOptions(config) { return { options, unsetOptions }; } const getOnwarn = (config) => { - return config.onwarn + const { onwarn } = config; + return onwarn ? warning => { warning.toString = () => { let str = ''; @@ -18900,27 +23260,19 @@ const getOnwarn = (config) => { str += warning.message; return str; }; - config.onwarn(warning, defaultOnWarn); + onwarn(warning, defaultOnWarn); } : defaultOnWarn; }; -const getAcorn$1 = (config) => ({ +const getAcorn = (config) => ({ allowAwaitOutsideFunction: true, - ecmaVersion: 2020, + ecmaVersion: 'latest', preserveParens: false, sourceType: 'module', ...config.acorn }); -const getAcornInjectPlugins = (config) => [ - acornClassFields, - acornStaticClassFeatures, - acornNumericSeparator, - ...ensureArray(config.acornInjectPlugins) -]; -const getCache = (config) => { - var _a; - return ((_a = config.cache) === null || _a === void 0 ? void 0 : _a.cache) || config.cache; -}; +const getAcornInjectPlugins = (config) => ensureArray(config.acornInjectPlugins); +const getCache = (config) => { var _a; return ((_a = config.cache) === null || _a === void 0 ? void 0 : _a.cache) || config.cache; }; const getIdMatcher = (option) => { if (option === true) { return () => true; @@ -18939,11 +23291,11 @@ const getIdMatcher = (option) => { ids.add(value); } } - return (id => ids.has(id) || matchers.some(matcher => matcher.test(id))); + return (id, ..._args) => ids.has(id) || matchers.some(matcher => matcher.test(id)); } return () => false; }; -const getInlineDynamicImports = (config, warn, strictDeprecations) => { +const getInlineDynamicImports$1 = (config, warn, strictDeprecations) => { const configInlineDynamicImports = config.inlineDynamicImports; if (configInlineDynamicImports) { warnDeprecationWithOptions('The "inlineDynamicImports" option is deprecated. Use the "output.inlineDynamicImports" option instead.', false, warn, strictDeprecations); @@ -18954,13 +23306,27 @@ const getInput = (config) => { const configInput = config.input; return configInput == null ? [] : typeof configInput === 'string' ? [configInput] : configInput; }; -const getManualChunks = (config, warn, strictDeprecations) => { +const getManualChunks$1 = (config, warn, strictDeprecations) => { const configManualChunks = config.manualChunks; if (configManualChunks) { warnDeprecationWithOptions('The "manualChunks" option is deprecated. Use the "output.manualChunks" option instead.', false, warn, strictDeprecations); } return configManualChunks; }; +const getmaxParallelFileOps = (config, warn, strictDeprecations) => { + var _a; + const maxParallelFileReads = config.maxParallelFileReads; + if (typeof maxParallelFileReads === 'number') { + warnDeprecationWithOptions('The "maxParallelFileReads" option is deprecated. Use the "maxParallelFileOps" option instead.', false, warn, strictDeprecations); + } + const maxParallelFileOps = (_a = config.maxParallelFileOps) !== null && _a !== void 0 ? _a : maxParallelFileReads; + if (typeof maxParallelFileOps === 'number') { + if (maxParallelFileOps <= 0) + return Infinity; + return maxParallelFileOps; + } + return 20; +}; const getModuleContext = (config, context) => { const configModuleContext = config.moduleContext; if (typeof configModuleContext === 'function') { @@ -18968,8 +23334,8 @@ const getModuleContext = (config, context) => { } if (configModuleContext) { const contextByModuleId = Object.create(null); - for (const key of Object.keys(configModuleContext)) { - contextByModuleId[resolve(key)] = configModuleContext[key]; + for (const [key, moduleContext] of Object.entries(configModuleContext)) { + contextByModuleId[resolve(key)] = moduleContext; } return id => contextByModuleId[id] || context; } @@ -18982,7 +23348,7 @@ const getPreserveEntrySignatures = (config, unsetOptions) => { } return configPreserveEntrySignatures !== null && configPreserveEntrySignatures !== void 0 ? configPreserveEntrySignatures : 'strict'; }; -const getPreserveModules = (config, warn, strictDeprecations) => { +const getPreserveModules$1 = (config, warn, strictDeprecations) => { const configPreserveModules = config.preserveModules; if (configPreserveModules) { warnDeprecationWithOptions('The "preserveModules" option is deprecated. Use the "output.preserveModules" option instead.', false, warn, strictDeprecations); @@ -18994,27 +23360,24 @@ const getTreeshake = (config, warn, strictDeprecations) => { if (configTreeshake === false) { return false; } - if (configTreeshake && configTreeshake !== true) { - if (typeof configTreeshake.pureExternalModules !== 'undefined') { - warnDeprecationWithOptions(`The "treeshake.pureExternalModules" option is deprecated. The "treeshake.moduleSideEffects" option should be used instead. "treeshake.pureExternalModules: true" is equivalent to "treeshake.moduleSideEffects: 'no-external'"`, true, warn, strictDeprecations); - } - return { - annotations: configTreeshake.annotations !== false, - moduleSideEffects: getHasModuleSideEffects(configTreeshake.moduleSideEffects, configTreeshake.pureExternalModules, warn), - propertyReadSideEffects: configTreeshake.propertyReadSideEffects !== false, - tryCatchDeoptimization: configTreeshake.tryCatchDeoptimization !== false, - unknownGlobalSideEffects: configTreeshake.unknownGlobalSideEffects !== false - }; + const configWithPreset = getOptionWithPreset(config.treeshake, treeshakePresets, 'treeshake', 'false, true, '); + if (typeof configWithPreset.pureExternalModules !== 'undefined') { + warnDeprecationWithOptions(`The "treeshake.pureExternalModules" option is deprecated. The "treeshake.moduleSideEffects" option should be used instead. "treeshake.pureExternalModules: true" is equivalent to "treeshake.moduleSideEffects: 'no-external'"`, true, warn, strictDeprecations); } return { - annotations: true, - moduleSideEffects: () => true, - propertyReadSideEffects: true, - tryCatchDeoptimization: true, - unknownGlobalSideEffects: true + annotations: configWithPreset.annotations !== false, + correctVarValueBeforeDeclaration: configWithPreset.correctVarValueBeforeDeclaration === true, + moduleSideEffects: typeof configTreeshake === 'object' && configTreeshake.pureExternalModules + ? getHasModuleSideEffects(configTreeshake.moduleSideEffects, configTreeshake.pureExternalModules) + : getHasModuleSideEffects(configWithPreset.moduleSideEffects, undefined), + propertyReadSideEffects: configWithPreset.propertyReadSideEffects === 'always' + ? 'always' + : configWithPreset.propertyReadSideEffects !== false, + tryCatchDeoptimization: configWithPreset.tryCatchDeoptimization !== false, + unknownGlobalSideEffects: configWithPreset.unknownGlobalSideEffects !== false }; }; -const getHasModuleSideEffects = (moduleSideEffectsOption, pureExternalModules, warn) => { +const getHasModuleSideEffects = (moduleSideEffectsOption, pureExternalModules) => { if (typeof moduleSideEffectsOption === 'boolean') { return () => moduleSideEffectsOption; } @@ -19029,22 +23392,46 @@ const getHasModuleSideEffects = (moduleSideEffectsOption, pureExternalModules, w return id => ids.has(id); } if (moduleSideEffectsOption) { - warn(errInvalidOption('treeshake.moduleSideEffects', 'please use one of false, "no-external", a function or an array')); + error(errInvalidOption('treeshake.moduleSideEffects', 'treeshake', 'please use one of false, "no-external", a function or an array')); } const isPureExternalModule = getIdMatcher(pureExternalModules); return (id, external) => !(external && isPureExternalModule(id)); }; +// https://datatracker.ietf.org/doc/html/rfc2396 +// eslint-disable-next-line no-control-regex +const INVALID_CHAR_REGEX = /[\x00-\x1F\x7F<>*#"{}|^[\]`;?:&=+$,]/g; +const DRIVE_LETTER_REGEX = /^[a-z]:/i; +function sanitizeFileName(name) { + const match = DRIVE_LETTER_REGEX.exec(name); + const driveLetter = match ? match[0] : ''; + // A `:` is only allowed as part of a windows drive letter (ex: C:\foo) + // Otherwise, avoid them because they can refer to NTFS alternate data streams. + return driveLetter + name.substr(driveLetter.length).replace(INVALID_CHAR_REGEX, '_'); +} + +function isValidUrl(url) { + try { + new URL(url); + } + catch (_) { + return false; + } + return true; +} + function normalizeOutputOptions(config, inputOptions, unsetInputOptions) { - var _a, _b, _c, _d, _e, _f, _g, _h; + var _a, _b, _c, _d, _e, _f, _g; // These are options that may trigger special warnings or behaviour later // if the user did not select an explicit value const unsetOptions = new Set(unsetInputOptions); const compact = config.compact || false; const format = getFormat(config); - const inlineDynamicImports = getInlineDynamicImports$1(config, inputOptions); - const preserveModules = getPreserveModules$1(config, inlineDynamicImports, inputOptions); + const inlineDynamicImports = getInlineDynamicImports(config, inputOptions); + const preserveModules = getPreserveModules(config, inlineDynamicImports, inputOptions); const file = getFile(config, preserveModules, inputOptions); + const preferConst = getPreferConst(config, inputOptions); + const generatedCode = getGeneratedCode(config, preferConst); const outputOptions = { amd: getAmd(config), assetFileNames: (_a = config.assetFileNames) !== null && _a !== void 0 ? _a : 'assets/[name]-[hash][extname]', @@ -19055,53 +23442,56 @@ function normalizeOutputOptions(config, inputOptions, unsetInputOptions) { dynamicImportFunction: getDynamicImportFunction(config, inputOptions), entryFileNames: getEntryFileNames(config, unsetOptions), esModule: (_c = config.esModule) !== null && _c !== void 0 ? _c : true, - exports: getExports(config), + exports: getExports(config, unsetOptions), extend: config.extend || false, externalLiveBindings: (_d = config.externalLiveBindings) !== null && _d !== void 0 ? _d : true, file, footer: getAddon(config, 'footer'), format, freeze: (_e = config.freeze) !== null && _e !== void 0 ? _e : true, + generatedCode, globals: config.globals || {}, hoistTransitiveImports: (_f = config.hoistTransitiveImports) !== null && _f !== void 0 ? _f : true, indent: getIndent(config, compact), inlineDynamicImports, - interop: (_g = config.interop) !== null && _g !== void 0 ? _g : true, + interop: getInterop(config, inputOptions), intro: getAddon(config, 'intro'), - manualChunks: getManualChunks$1(config, inlineDynamicImports, preserveModules, inputOptions), + manualChunks: getManualChunks(config, inlineDynamicImports, preserveModules, inputOptions), minifyInternalExports: getMinifyInternalExports(config, format, compact), name: config.name, - namespaceToStringTag: config.namespaceToStringTag || false, + namespaceToStringTag: getNamespaceToStringTag(config, generatedCode, inputOptions), noConflict: config.noConflict || false, outro: getAddon(config, 'outro'), paths: config.paths || {}, plugins: ensureArray(config.plugins), - preferConst: config.preferConst || false, + preferConst, preserveModules, + preserveModulesRoot: getPreserveModulesRoot(config), + sanitizeFileName: typeof config.sanitizeFileName === 'function' + ? config.sanitizeFileName + : config.sanitizeFileName === false + ? id => id + : sanitizeFileName, sourcemap: config.sourcemap || false, + sourcemapBaseUrl: getSourcemapBaseUrl(config), sourcemapExcludeSources: config.sourcemapExcludeSources || false, sourcemapFile: config.sourcemapFile, sourcemapPathTransform: config.sourcemapPathTransform, - strict: (_h = config.strict) !== null && _h !== void 0 ? _h : true, - systemNullSetters: config.systemNullSetters || false + strict: (_g = config.strict) !== null && _g !== void 0 ? _g : true, + systemNullSetters: config.systemNullSetters || false, + validate: config.validate || false }; warnUnknownOptions(config, Object.keys(outputOptions), 'output options', inputOptions.onwarn); return { options: outputOptions, unsetOptions }; } const getFile = (config, preserveModules, inputOptions) => { - const file = config.file; + const { file } = config; if (typeof file === 'string') { if (preserveModules) { - return error({ - code: 'INVALID_OPTION', - message: 'You must set "output.dir" instead of "output.file" when using the "output.preserveModules" option.' - }); + return error(errInvalidOption('output.file', 'outputdir', 'you must set "output.dir" instead of "output.file" when using the "output.preserveModules" option')); } if (!Array.isArray(inputOptions.input)) - return error({ - code: 'INVALID_OPTION', - message: 'You must set "output.dir" instead of "output.file" when providing named inputs.' - }); + return error(errInvalidOption('output.file', 'outputdir', 'you must set "output.dir" instead of "output.file" when providing named inputs')); } return file; }; @@ -19126,46 +23516,79 @@ const getFormat = (config) => { default: return error({ message: `You must specify "output.format", which can be one of "amd", "cjs", "system", "es", "iife" or "umd".`, - url: `https://rollupjs.org/guide/en/#output-format` + url: `https://rollupjs.org/guide/en/#outputformat` }); } }; -const getInlineDynamicImports$1 = (config, inputOptions) => { +const getInlineDynamicImports = (config, inputOptions) => { var _a; - const inlineDynamicImports = ((_a = config.inlineDynamicImports) !== null && _a !== void 0 ? _a : inputOptions.inlineDynamicImports) || - false; + const inlineDynamicImports = ((_a = config.inlineDynamicImports) !== null && _a !== void 0 ? _a : inputOptions.inlineDynamicImports) || false; const { input } = inputOptions; if (inlineDynamicImports && (Array.isArray(input) ? input : Object.keys(input)).length > 1) { - return error({ - code: 'INVALID_OPTION', - message: 'Multiple inputs are not supported for "output.inlineDynamicImports".' - }); + return error(errInvalidOption('output.inlineDynamicImports', 'outputinlinedynamicimports', 'multiple inputs are not supported when "output.inlineDynamicImports" is true')); } return inlineDynamicImports; }; -const getPreserveModules$1 = (config, inlineDynamicImports, inputOptions) => { +const getPreserveModules = (config, inlineDynamicImports, inputOptions) => { var _a; const preserveModules = ((_a = config.preserveModules) !== null && _a !== void 0 ? _a : inputOptions.preserveModules) || false; if (preserveModules) { if (inlineDynamicImports) { - return error({ - code: 'INVALID_OPTION', - message: `The "output.inlineDynamicImports" option is not supported for "output.preserveModules".` - }); + return error(errInvalidOption('output.inlineDynamicImports', 'outputinlinedynamicimports', `this option is not supported for "output.preserveModules"`)); } if (inputOptions.preserveEntrySignatures === false) { - return error({ - code: 'INVALID_OPTION', - message: 'Setting "preserveEntrySignatures" to "false" is not supported for "output.preserveModules".' - }); + return error(errInvalidOption('preserveEntrySignatures', 'preserveentrysignatures', 'setting this option to false is not supported for "output.preserveModules"')); } } return preserveModules; }; -const getAmd = (config) => ({ - define: 'define', - ...config.amd -}); +const getPreferConst = (config, inputOptions) => { + const configPreferConst = config.preferConst; + if (configPreferConst != null) { + warnDeprecation(`The "output.preferConst" option is deprecated. Use the "output.generatedCode.constBindings" option instead.`, false, inputOptions); + } + return !!configPreferConst; +}; +const getPreserveModulesRoot = (config) => { + const { preserveModulesRoot } = config; + if (preserveModulesRoot === null || preserveModulesRoot === undefined) { + return undefined; + } + return resolve(preserveModulesRoot); +}; +const getAmd = (config) => { + const mergedOption = { + autoId: false, + basePath: '', + define: 'define', + forceJsExtensionForImports: false, + ...config.amd + }; + if ((mergedOption.autoId || mergedOption.basePath) && mergedOption.id) { + return error(errInvalidOption('output.amd.id', 'outputamd', 'this option cannot be used together with "output.amd.autoId"/"output.amd.basePath"')); + } + if (mergedOption.basePath && !mergedOption.autoId) { + return error(errInvalidOption('output.amd.basePath', 'outputamd', 'this option only works with "output.amd.autoId"')); + } + let normalized; + if (mergedOption.autoId) { + normalized = { + autoId: true, + basePath: mergedOption.basePath, + define: mergedOption.define, + forceJsExtensionForImports: mergedOption.forceJsExtensionForImports + }; + } + else { + normalized = { + autoId: false, + define: mergedOption.define, + forceJsExtensionForImports: mergedOption.forceJsExtensionForImports, + id: mergedOption.id + }; + } + return normalized; +}; const getAddon = (config, name) => { const configAddon = config[name]; if (typeof configAddon === 'function') { @@ -19174,12 +23597,9 @@ const getAddon = (config, name) => { return () => configAddon || ''; }; const getDir = (config, file) => { - const dir = config.dir; + const { dir } = config; if (typeof dir === 'string' && typeof file === 'string') { - return error({ - code: 'INVALID_OPTION', - message: 'You must set either "output.file" for a single-file build or "output.dir" when generating multiple chunks.' - }); + return error(errInvalidOption('output.dir', 'outputdir', 'you must set either "output.file" for a single-file build or "output.dir" when generating multiple chunks')); } return dir; }; @@ -19197,13 +23617,26 @@ const getEntryFileNames = (config, unsetOptions) => { } return configEntryFileNames !== null && configEntryFileNames !== void 0 ? configEntryFileNames : '[name].js'; }; -function getExports(config) { +function getExports(config, unsetOptions) { const configExports = config.exports; - if (configExports && !['default', 'named', 'none', 'auto'].includes(configExports)) { + if (configExports == null) { + unsetOptions.add('exports'); + } + else if (!['default', 'named', 'none', 'auto'].includes(configExports)) { return error(errInvalidExportOptionValue(configExports)); } return configExports || 'auto'; } +const getGeneratedCode = (config, preferConst) => { + const configWithPreset = getOptionWithPreset(config.generatedCode, generatedCodePresets, 'output.generatedCode', ''); + return { + arrowFunctions: configWithPreset.arrowFunctions === true, + constBindings: configWithPreset.constBindings === true || preferConst, + objectShorthand: configWithPreset.objectShorthand === true, + reservedNamesAsProps: configWithPreset.reservedNamesAsProps === true, + symbols: configWithPreset.symbols === true + }; +}; const getIndent = (config, compact) => { if (compact) { return ''; @@ -19211,31 +23644,79 @@ const getIndent = (config, compact) => { const configIndent = config.indent; return configIndent === false ? '' : configIndent !== null && configIndent !== void 0 ? configIndent : true; }; -const getManualChunks$1 = (config, inlineDynamicImports, preserveModules, inputOptions) => { +const ALLOWED_INTEROP_TYPES = new Set([ + 'auto', + 'esModule', + 'default', + 'defaultOnly', + true, + false +]); +const getInterop = (config, inputOptions) => { + const configInterop = config.interop; + const validatedInteropTypes = new Set(); + const validateInterop = (interop) => { + if (!validatedInteropTypes.has(interop)) { + validatedInteropTypes.add(interop); + if (!ALLOWED_INTEROP_TYPES.has(interop)) { + return error(errInvalidOption('output.interop', 'outputinterop', `use one of ${Array.from(ALLOWED_INTEROP_TYPES, value => JSON.stringify(value)).join(', ')}`, interop)); + } + if (typeof interop === 'boolean') { + warnDeprecation({ + message: `The boolean value "${interop}" for the "output.interop" option is deprecated. Use ${interop ? '"auto"' : '"esModule", "default" or "defaultOnly"'} instead.`, + url: 'https://rollupjs.org/guide/en/#outputinterop' + }, false, inputOptions); + } + } + return interop; + }; + if (typeof configInterop === 'function') { + const interopPerId = Object.create(null); + let defaultInterop = null; + return id => id === null + ? defaultInterop || validateInterop((defaultInterop = configInterop(id))) + : id in interopPerId + ? interopPerId[id] + : validateInterop((interopPerId[id] = configInterop(id))); + } + return configInterop === undefined ? () => true : () => validateInterop(configInterop); +}; +const getManualChunks = (config, inlineDynamicImports, preserveModules, inputOptions) => { const configManualChunks = config.manualChunks || inputOptions.manualChunks; if (configManualChunks) { if (inlineDynamicImports) { - return error({ - code: 'INVALID_OPTION', - message: 'The "output.manualChunks" option is not supported for "output.inlineDynamicImports".' - }); + return error(errInvalidOption('output.manualChunks', 'outputmanualchunks', 'this option is not supported for "output.inlineDynamicImports"')); } if (preserveModules) { - return error({ - code: 'INVALID_OPTION', - message: 'The "output.manualChunks" option is not supported for "output.preserveModules".' - }); + return error(errInvalidOption('output.manualChunks', 'outputmanualchunks', 'this option is not supported for "output.preserveModules"')); } } return configManualChunks || {}; }; const getMinifyInternalExports = (config, format, compact) => { var _a; return (_a = config.minifyInternalExports) !== null && _a !== void 0 ? _a : (compact || format === 'es' || format === 'system'); }; +const getNamespaceToStringTag = (config, generatedCode, inputOptions) => { + const configNamespaceToStringTag = config.namespaceToStringTag; + if (configNamespaceToStringTag != null) { + warnDeprecation(`The "output.namespaceToStringTag" option is deprecated. Use the "output.generatedCode.symbols" option instead.`, false, inputOptions); + return configNamespaceToStringTag; + } + return generatedCode.symbols || false; +}; +const getSourcemapBaseUrl = (config) => { + const { sourcemapBaseUrl } = config; + if (sourcemapBaseUrl) { + if (isValidUrl(sourcemapBaseUrl)) { + return sourcemapBaseUrl; + } + return error(errInvalidOption('output.sourcemapBaseUrl', 'outputsourcemapbaseurl', `must be a valid URL, received ${JSON.stringify(sourcemapBaseUrl)}`)); + } +}; function rollup(rawInputOptions) { return rollupInternal(rawInputOptions, null); } async function rollupInternal(rawInputOptions, watcher) { - const { options: inputOptions, unsetOptions: unsetInputOptions } = getInputOptions(rawInputOptions, watcher !== null); + const { options: inputOptions, unsetOptions: unsetInputOptions } = await getInputOptions(rawInputOptions, watcher !== null); initialiseTimers(inputOptions); const graph = new Graph(inputOptions, watcher); // remove the cache option from the memory after graph creation (cache is not used anymore) @@ -19243,27 +23724,41 @@ async function rollupInternal(rawInputOptions, watcher) { delete inputOptions.cache; delete rawInputOptions.cache; timeStart('BUILD', 1); - try { - await graph.pluginDriver.hookParallel('buildStart', [inputOptions]); - await graph.build(); - } - catch (err) { - const watchFiles = Object.keys(graph.watchFiles); - if (watchFiles.length > 0) { - err.watchFiles = watchFiles; + await catchUnfinishedHookActions(graph.pluginDriver, async () => { + try { + await graph.pluginDriver.hookParallel('buildStart', [inputOptions]); + await graph.build(); } - await graph.pluginDriver.hookParallel('buildEnd', [err]); - throw err; - } - await graph.pluginDriver.hookParallel('buildEnd', []); + catch (err) { + const watchFiles = Object.keys(graph.watchFiles); + if (watchFiles.length > 0) { + err.watchFiles = watchFiles; + } + await graph.pluginDriver.hookParallel('buildEnd', [err]); + await graph.pluginDriver.hookParallel('closeBundle', []); + throw err; + } + await graph.pluginDriver.hookParallel('buildEnd', []); + }); timeEnd('BUILD', 1); const result = { cache: useCache ? graph.getCache() : undefined, + async close() { + if (result.closed) + return; + result.closed = true; + await graph.pluginDriver.hookParallel('closeBundle', []); + }, + closed: false, async generate(rawOutputOptions) { + if (result.closed) + return error(errAlreadyClosed()); return handleGenerateWrite(false, inputOptions, unsetInputOptions, rawOutputOptions, graph); }, watchFiles: Object.keys(graph.watchFiles), async write(rawOutputOptions) { + if (result.closed) + return error(errAlreadyClosed()); return handleGenerateWrite(true, inputOptions, unsetInputOptions, rawOutputOptions, graph); } }; @@ -19271,45 +23766,45 @@ async function rollupInternal(rawInputOptions, watcher) { result.getTimings = getTimings; return result; } -function getInputOptions(rawInputOptions, watchMode) { +async function getInputOptions(rawInputOptions, watchMode) { if (!rawInputOptions) { throw new Error('You must supply an options object to rollup'); } - const rawPlugins = ensureArray(rawInputOptions.plugins); - const { options, unsetOptions } = normalizeInputOptions(rawPlugins.reduce(applyOptionHook(watchMode), rawInputOptions)); + const rawPlugins = getSortedValidatedPlugins('options', ensureArray(rawInputOptions.plugins)); + const { options, unsetOptions } = normalizeInputOptions(await rawPlugins.reduce(applyOptionHook(watchMode), Promise.resolve(rawInputOptions))); normalizePlugins(options.plugins, ANONYMOUS_PLUGIN_PREFIX); return { options, unsetOptions }; } function applyOptionHook(watchMode) { - return (inputOptions, plugin) => { - if (plugin.options) - return (plugin.options.call({ meta: { rollupVersion: version, watchMode } }, inputOptions) || inputOptions); - return inputOptions; + return async (inputOptions, plugin) => { + const handler = 'handler' in plugin.options ? plugin.options.handler : plugin.options; + return ((await handler.call({ meta: { rollupVersion: version$1, watchMode } }, await inputOptions)) || inputOptions); }; } function normalizePlugins(plugins, anonymousPrefix) { - for (let pluginIndex = 0; pluginIndex < plugins.length; pluginIndex++) { - const plugin = plugins[pluginIndex]; + plugins.forEach((plugin, index) => { if (!plugin.name) { - plugin.name = `${anonymousPrefix}${pluginIndex + 1}`; + plugin.name = `${anonymousPrefix}${index + 1}`; } - } + }); } -async function handleGenerateWrite(isWrite, inputOptions, unsetInputOptions, rawOutputOptions, graph) { +function handleGenerateWrite(isWrite, inputOptions, unsetInputOptions, rawOutputOptions, graph) { const { options: outputOptions, outputPluginDriver, unsetOptions } = getOutputOptionsAndPluginDriver(rawOutputOptions, graph.pluginDriver, inputOptions, unsetInputOptions); - const bundle = new Bundle$1(outputOptions, unsetOptions, inputOptions, outputPluginDriver, graph); - const generated = await bundle.generate(isWrite); - if (isWrite) { - if (!outputOptions.dir && !outputOptions.file) { - return error({ - code: 'MISSING_OPTION', - message: 'You must specify "output.file" or "output.dir" for the build.' - }); + return catchUnfinishedHookActions(outputPluginDriver, async () => { + const bundle = new Bundle(outputOptions, unsetOptions, inputOptions, outputPluginDriver, graph); + const generated = await bundle.generate(isWrite); + if (isWrite) { + if (!outputOptions.dir && !outputOptions.file) { + return error({ + code: 'MISSING_OPTION', + message: 'You must specify "output.file" or "output.dir" for the build.' + }); + } + await Promise.all(Object.values(generated).map(chunk => graph.fileOperationQueue.run(() => writeOutputFile(chunk, outputOptions)))); + await outputPluginDriver.hookParallel('writeBundle', [outputOptions, generated]); } - await Promise.all(Object.keys(generated).map(chunkId => writeOutputFile(generated[chunkId], outputOptions))); - await outputPluginDriver.hookParallel('writeBundle', [outputOptions, generated]); - } - return createOutput(generated); + return createOutput(generated); + }); } function getOutputOptionsAndPluginDriver(rawOutputOptions, inputPluginDriver, inputOptions, unsetInputOptions) { if (!rawOutputOptions) { @@ -19335,15 +23830,7 @@ function getOutputOptions(inputOptions, unsetInputOptions, rawOutputOptions, out } function createOutput(outputBundle) { return { - output: Object.keys(outputBundle) - .map(fileName => outputBundle[fileName]) - .filter(outputFile => Object.keys(outputFile).length > 0).sort((outputFileA, outputFileB) => { - const fileTypeA = getSortingFileType(outputFileA); - const fileTypeB = getSortingFileType(outputFileB); - if (fileTypeA === fileTypeB) - return 0; - return fileTypeA < fileTypeB ? -1 : 1; - }) + output: Object.values(outputBundle).filter(outputFile => Object.keys(outputFile).length > 0).sort((outputFileA, outputFileB) => getSortingFileType(outputFileA) - getSortingFileType(outputFileB)) }; } var SortingFileType; @@ -19361,8 +23848,10 @@ function getSortingFileType(file) { } return SortingFileType.SECONDARY_CHUNK; } -function writeOutputFile(outputFile, outputOptions) { +async function writeOutputFile(outputFile, outputOptions) { const fileName = resolve(outputOptions.dir || dirname(outputOptions.file), outputFile.fileName); + // 'recursive: true' does not throw if the folder structure, or parts of it, already exist + await promises.mkdir(dirname(fileName), { recursive: true }); let writeSourceMapPromise; let source; if (outputFile.type === 'asset') { @@ -19376,27 +23865,65 @@ function writeOutputFile(outputFile, outputOptions) { url = outputFile.map.toUrl(); } else { - url = `${basename(outputFile.fileName)}.map`; - writeSourceMapPromise = writeFile(`${fileName}.map`, outputFile.map.toString()); + const { sourcemapBaseUrl } = outputOptions; + const sourcemapFileName = `${basename(outputFile.fileName)}.map`; + url = sourcemapBaseUrl + ? new URL(sourcemapFileName, sourcemapBaseUrl).toString() + : sourcemapFileName; + writeSourceMapPromise = promises.writeFile(`${fileName}.map`, outputFile.map.toString()); } if (outputOptions.sourcemap !== 'hidden') { source += `//# ${SOURCEMAPPING_URL}=${url}\n`; } } } - return Promise.all([writeFile(fileName, source), writeSourceMapPromise]); + return Promise.all([promises.writeFile(fileName, source), writeSourceMapPromise]); +} +/** + * Auxiliary function for defining rollup configuration + * Mainly to facilitate IDE code prompts, after all, export default does not prompt, even if you add @type annotations, it is not accurate + * @param options + */ +function defineConfig(options) { + return options; +} + +class WatchEmitter extends EventEmitter { + constructor() { + super(); + this.awaitedHandlers = Object.create(null); + // Allows more than 10 bundles to be watched without + // showing the `MaxListenersExceededWarning` to the user. + this.setMaxListeners(Infinity); + } + // Will be overwritten by Rollup + async close() { } + emitAndAwait(event, ...args) { + this.emit(event, ...args); + return Promise.all(this.getHandlers(event).map(handler => handler(...args))); + } + onCurrentAwaited(event, listener) { + this.getHandlers(event).push(listener); + return this; + } + removeAwaited() { + this.awaitedHandlers = {}; + return this; + } + getHandlers(event) { + return this.awaitedHandlers[event] || (this.awaitedHandlers[event] = []); + } } let fsEvents; let fsEventsImportError; -function loadFsEvents() { - return import('fsevents') - .then(namespace => { - fsEvents = namespace.default; - }) - .catch(err => { +async function loadFsEvents() { + try { + ({ default: fsEvents } = await import('fsevents')); + } + catch (err) { fsEventsImportError = err; - }); + } } // A call to this function will be injected into the chokidar code function getFsEvents() { @@ -19405,27 +23932,18 @@ function getFsEvents() { return fsEvents; } -var fseventsImporter = { +const fseventsImporter = /*#__PURE__*/Object.defineProperty({ __proto__: null, - loadFsEvents: loadFsEvents, - getFsEvents: getFsEvents -}; + loadFsEvents, + getFsEvents +}, Symbol.toStringTag, { value: 'Module' }); -class WatchEmitter extends EventEmitter { - constructor() { - super(); - // Allows more than 10 bundles to be watched without - // showing the `MaxListenersExceededWarning` to the user. - this.setMaxListeners(Infinity); - } - close() { } -} function watch(configs) { const emitter = new WatchEmitter(); const configArray = ensureArray(configs); const watchConfigs = configArray.filter(config => config.watch !== false); if (watchConfigs.length === 0) { - throw error(errInvalidOption('watch', 'there must be at least one config where "watch" is not set to "false"')); + return error(errInvalidOption('watch', 'watch', 'there must be at least one config where "watch" is not set to "false"')); } loadFsEvents() .then(() => import('./watch.js')) @@ -19433,4 +23951,4 @@ function watch(configs) { return emitter; } -export { createCommonjsModule, defaultOnWarn, ensureArray, fseventsImporter, getCjsExportFromNamespace, rollup, rollupInternal, version, warnUnknownOptions, watch }; +export { createFilter, defaultOnWarn, defineConfig, ensureArray, fseventsImporter, generatedCodePresets, getAugmentedNamespace, objectifyOption, objectifyOptionWithPresets, picomatch$1 as picomatch, rollup, rollupInternal, treeshakePresets, version$1 as version, warnUnknownOptions, watch }; diff --git a/node_modules/rollup/dist/es/shared/watch.js b/node_modules/rollup/dist/es/shared/watch.js index 5d58a39f3b68..b0dfa3a353b8 100644 --- a/node_modules/rollup/dist/es/shared/watch.js +++ b/node_modules/rollup/dist/es/shared/watch.js @@ -1,4615 +1,2245 @@ /* @license - Rollup.js v2.18.0 - Mon, 22 Jun 2020 04:16:05 GMT - commit ee6ef99935fbd24a3e30ef05b0b98e4019f983c6 - + Rollup.js v2.79.1 + Thu, 22 Sep 2022 04:55:29 GMT - commit 69ff4181e701a0fe0026d0ba147f31bc86beffa8 https://github.com/rollup/rollup Released under the MIT License. */ -import { createCommonjsModule, defaultOnWarn, ensureArray as ensureArray$1, warnUnknownOptions, getCjsExportFromNamespace, fseventsImporter, rollupInternal } from './rollup.js'; -import path, { sep, resolve } from 'path'; +import require$$0$2, { resolve } from 'path'; +import process$1 from 'process'; +import { ensureArray, warnUnknownOptions, defaultOnWarn, objectifyOptionWithPresets, treeshakePresets, objectifyOption, generatedCodePresets, picomatch as picomatch$2, getAugmentedNamespace, fseventsImporter, createFilter, rollupInternal } from './rollup.js'; +import require$$2$1, { platform } from 'os'; +import require$$0$1 from 'fs'; +import require$$2 from 'util'; +import require$$1 from 'stream'; +import require$$0$3 from 'events'; +import 'perf_hooks'; import 'crypto'; -import fs from 'fs'; -import events from 'events'; -import util from 'util'; -import stream from 'stream'; -import os, { platform } from 'os'; - -var utils = createCommonjsModule(function (module, exports) { -exports.isInteger = num => { - if (typeof num === 'number') { - return Number.isInteger(num); - } - if (typeof num === 'string' && num.trim() !== '') { - return Number.isInteger(Number(num)); - } - return false; +const commandAliases = { + c: 'config', + d: 'dir', + e: 'external', + f: 'format', + g: 'globals', + h: 'help', + i: 'input', + m: 'sourcemap', + n: 'name', + o: 'file', + p: 'plugin', + v: 'version', + w: 'watch' }; - -/** - * Find a node of the given type - */ - -exports.find = (node, type) => node.nodes.find(node => node.type === type); - -/** - * Find a node of the given type - */ - -exports.exceedsLimit = (min, max, step = 1, limit) => { - if (limit === false) return false; - if (!exports.isInteger(min) || !exports.isInteger(max)) return false; - return ((Number(max) - Number(min)) / Number(step)) >= limit; +function mergeOptions(config, rawCommandOptions = { external: [], globals: undefined }, defaultOnWarnHandler = defaultOnWarn) { + const command = getCommandOptions(rawCommandOptions); + const inputOptions = mergeInputOptions(config, command, defaultOnWarnHandler); + const warn = inputOptions.onwarn; + if (command.output) { + Object.assign(command, command.output); + } + const outputOptionsArray = ensureArray(config.output); + if (outputOptionsArray.length === 0) + outputOptionsArray.push({}); + const outputOptions = outputOptionsArray.map(singleOutputOptions => mergeOutputOptions(singleOutputOptions, command, warn)); + warnUnknownOptions(command, Object.keys(inputOptions).concat(Object.keys(outputOptions[0]).filter(option => option !== 'sourcemapPathTransform'), Object.keys(commandAliases), 'config', 'environment', 'plugin', 'silent', 'failAfterWarnings', 'stdin', 'waitForBundleInput', 'configPlugin'), 'CLI flags', warn, /^_$|output$|config/); + inputOptions.output = outputOptions; + return inputOptions; +} +function getCommandOptions(rawCommandOptions) { + const external = rawCommandOptions.external && typeof rawCommandOptions.external === 'string' + ? rawCommandOptions.external.split(',') + : []; + return { + ...rawCommandOptions, + external, + globals: typeof rawCommandOptions.globals === 'string' + ? rawCommandOptions.globals.split(',').reduce((globals, globalDefinition) => { + const [id, variableName] = globalDefinition.split(':'); + globals[id] = variableName; + if (!external.includes(id)) { + external.push(id); + } + return globals; + }, Object.create(null)) + : undefined + }; +} +function mergeInputOptions(config, overrides, defaultOnWarnHandler) { + const getOption = (name) => { var _a; return (_a = overrides[name]) !== null && _a !== void 0 ? _a : config[name]; }; + const inputOptions = { + acorn: getOption('acorn'), + acornInjectPlugins: config.acornInjectPlugins, + cache: config.cache, + context: getOption('context'), + experimentalCacheExpiry: getOption('experimentalCacheExpiry'), + external: getExternal(config, overrides), + inlineDynamicImports: getOption('inlineDynamicImports'), + input: getOption('input') || [], + makeAbsoluteExternalsRelative: getOption('makeAbsoluteExternalsRelative'), + manualChunks: getOption('manualChunks'), + maxParallelFileOps: getOption('maxParallelFileOps'), + maxParallelFileReads: getOption('maxParallelFileReads'), + moduleContext: getOption('moduleContext'), + onwarn: getOnWarn(config, defaultOnWarnHandler), + perf: getOption('perf'), + plugins: ensureArray(config.plugins), + preserveEntrySignatures: getOption('preserveEntrySignatures'), + preserveModules: getOption('preserveModules'), + preserveSymlinks: getOption('preserveSymlinks'), + shimMissingExports: getOption('shimMissingExports'), + strictDeprecations: getOption('strictDeprecations'), + treeshake: getObjectOption(config, overrides, 'treeshake', objectifyOptionWithPresets(treeshakePresets, 'treeshake', 'false, true, ')), + watch: getWatch(config, overrides) + }; + warnUnknownOptions(config, Object.keys(inputOptions), 'input options', inputOptions.onwarn, /^output$/); + return inputOptions; +} +const getExternal = (config, overrides) => { + const configExternal = config.external; + return typeof configExternal === 'function' + ? (source, importer, isResolved) => configExternal(source, importer, isResolved) || overrides.external.includes(source) + : ensureArray(configExternal).concat(overrides.external); }; - -/** - * Escape the given node with '\\' before node.value - */ - -exports.escapeNode = (block, n = 0, type) => { - let node = block.nodes[n]; - if (!node) return; - - if ((type && node.type === type) || node.type === 'open' || node.type === 'close') { - if (node.escaped !== true) { - node.value = '\\' + node.value; - node.escaped = true; +const getOnWarn = (config, defaultOnWarnHandler) => config.onwarn + ? warning => config.onwarn(warning, defaultOnWarnHandler) + : defaultOnWarnHandler; +const getObjectOption = (config, overrides, name, objectifyValue = objectifyOption) => { + const commandOption = normalizeObjectOptionValue(overrides[name], objectifyValue); + const configOption = normalizeObjectOptionValue(config[name], objectifyValue); + if (commandOption !== undefined) { + return commandOption && { ...configOption, ...commandOption }; } - } + return configOption; }; - -/** - * Returns true if the given brace node should be enclosed in literal braces - */ - -exports.encloseBrace = node => { - if (node.type !== 'brace') return false; - if ((node.commas >> 0 + node.ranges >> 0) === 0) { - node.invalid = true; - return true; - } - return false; +const getWatch = (config, overrides) => config.watch !== false && getObjectOption(config, overrides, 'watch'); +const normalizeObjectOptionValue = (optionValue, objectifyValue) => { + if (!optionValue) { + return optionValue; + } + if (Array.isArray(optionValue)) { + return optionValue.reduce((result, value) => value && result && { ...result, ...objectifyValue(value) }, {}); + } + return objectifyValue(optionValue); }; +function mergeOutputOptions(config, overrides, warn) { + const getOption = (name) => { var _a; return (_a = overrides[name]) !== null && _a !== void 0 ? _a : config[name]; }; + const outputOptions = { + amd: getObjectOption(config, overrides, 'amd'), + assetFileNames: getOption('assetFileNames'), + banner: getOption('banner'), + chunkFileNames: getOption('chunkFileNames'), + compact: getOption('compact'), + dir: getOption('dir'), + dynamicImportFunction: getOption('dynamicImportFunction'), + entryFileNames: getOption('entryFileNames'), + esModule: getOption('esModule'), + exports: getOption('exports'), + extend: getOption('extend'), + externalLiveBindings: getOption('externalLiveBindings'), + file: getOption('file'), + footer: getOption('footer'), + format: getOption('format'), + freeze: getOption('freeze'), + generatedCode: getObjectOption(config, overrides, 'generatedCode', objectifyOptionWithPresets(generatedCodePresets, 'output.generatedCode', '')), + globals: getOption('globals'), + hoistTransitiveImports: getOption('hoistTransitiveImports'), + indent: getOption('indent'), + inlineDynamicImports: getOption('inlineDynamicImports'), + interop: getOption('interop'), + intro: getOption('intro'), + manualChunks: getOption('manualChunks'), + minifyInternalExports: getOption('minifyInternalExports'), + name: getOption('name'), + namespaceToStringTag: getOption('namespaceToStringTag'), + noConflict: getOption('noConflict'), + outro: getOption('outro'), + paths: getOption('paths'), + plugins: ensureArray(config.plugins), + preferConst: getOption('preferConst'), + preserveModules: getOption('preserveModules'), + preserveModulesRoot: getOption('preserveModulesRoot'), + sanitizeFileName: getOption('sanitizeFileName'), + sourcemap: getOption('sourcemap'), + sourcemapBaseUrl: getOption('sourcemapBaseUrl'), + sourcemapExcludeSources: getOption('sourcemapExcludeSources'), + sourcemapFile: getOption('sourcemapFile'), + sourcemapPathTransform: getOption('sourcemapPathTransform'), + strict: getOption('strict'), + systemNullSetters: getOption('systemNullSetters'), + validate: getOption('validate') + }; + warnUnknownOptions(config, Object.keys(outputOptions), 'output options', warn); + return outputOptions; +} -/** - * Returns true if a brace node is invalid. - */ - -exports.isInvalidBrace = block => { - if (block.type !== 'brace') return false; - if (block.invalid === true || block.dollar) return true; - if ((block.commas >> 0 + block.ranges >> 0) === 0) { - block.invalid = true; - return true; - } - if (block.open !== true || block.close !== true) { - block.invalid = true; - return true; - } - return false; -}; +var chokidar = {}; -/** - * Returns true if a node is an open or close node - */ +const fs$3 = require$$0$1; +const { Readable } = require$$1; +const sysPath$3 = require$$0$2; +const { promisify: promisify$3 } = require$$2; +const picomatch$1 = picomatch$2.exports; -exports.isOpenOrClose = node => { - if (node.type === 'open' || node.type === 'close') { - return true; - } - return node.open === true || node.close === true; -}; +const readdir$1 = promisify$3(fs$3.readdir); +const stat$3 = promisify$3(fs$3.stat); +const lstat$2 = promisify$3(fs$3.lstat); +const realpath$1 = promisify$3(fs$3.realpath); /** - * Reduce an array of text nodes. + * @typedef {Object} EntryInfo + * @property {String} path + * @property {String} fullPath + * @property {fs.Stats=} stats + * @property {fs.Dirent=} dirent + * @property {String} basename */ -exports.reduce = nodes => nodes.reduce((acc, node) => { - if (node.type === 'text') acc.push(node.value); - if (node.type === 'range') node.type = 'text'; - return acc; -}, []); +const BANG$2 = '!'; +const RECURSIVE_ERROR_CODE = 'READDIRP_RECURSIVE_ERROR'; +const NORMAL_FLOW_ERRORS = new Set(['ENOENT', 'EPERM', 'EACCES', 'ELOOP', RECURSIVE_ERROR_CODE]); +const FILE_TYPE = 'files'; +const DIR_TYPE = 'directories'; +const FILE_DIR_TYPE = 'files_directories'; +const EVERYTHING_TYPE = 'all'; +const ALL_TYPES = [FILE_TYPE, DIR_TYPE, FILE_DIR_TYPE, EVERYTHING_TYPE]; -/** - * Flatten an array - */ +const isNormalFlowError = error => NORMAL_FLOW_ERRORS.has(error.code); +const [maj, min] = process.versions.node.split('.').slice(0, 2).map(n => Number.parseInt(n, 10)); +const wantBigintFsStats = process.platform === 'win32' && (maj > 10 || (maj === 10 && min >= 5)); -exports.flatten = (...args) => { - const result = []; - const flat = arr => { - for (let i = 0; i < arr.length; i++) { - let ele = arr[i]; - Array.isArray(ele) ? flat(ele) : ele !== void 0 && result.push(ele); - } - return result; - }; - flat(args); - return result; -}; -}); +const normalizeFilter = filter => { + if (filter === undefined) return; + if (typeof filter === 'function') return filter; -var stringify = (ast, options = {}) => { - let stringify = (node, parent = {}) => { - let invalidBlock = options.escapeInvalid && utils.isInvalidBrace(parent); - let invalidNode = node.invalid === true && options.escapeInvalid === true; - let output = ''; + if (typeof filter === 'string') { + const glob = picomatch$1(filter.trim()); + return entry => glob(entry.basename); + } - if (node.value) { - if ((invalidBlock || invalidNode) && utils.isOpenOrClose(node)) { - return '\\' + node.value; + if (Array.isArray(filter)) { + const positive = []; + const negative = []; + for (const item of filter) { + const trimmed = item.trim(); + if (trimmed.charAt(0) === BANG$2) { + negative.push(picomatch$1(trimmed.slice(1))); + } else { + positive.push(picomatch$1(trimmed)); } - return node.value; - } - - if (node.value) { - return node.value; } - if (node.nodes) { - for (let child of node.nodes) { - output += stringify(child); + if (negative.length > 0) { + if (positive.length > 0) { + return entry => + positive.some(f => f(entry.basename)) && !negative.some(f => f(entry.basename)); } + return entry => !negative.some(f => f(entry.basename)); } - return output; - }; - - return stringify(ast); -}; - -/*! - * is-number - * - * Copyright (c) 2014-present, Jon Schlinkert. - * Released under the MIT License. - */ - -var isNumber = function(num) { - if (typeof num === 'number') { - return num - num === 0; - } - if (typeof num === 'string' && num.trim() !== '') { - return Number.isFinite ? Number.isFinite(+num) : isFinite(+num); + return entry => positive.some(f => f(entry.basename)); } - return false; }; -const toRegexRange = (min, max, options) => { - if (isNumber(min) === false) { - throw new TypeError('toRegexRange: expected the first argument to be a number'); +class ReaddirpStream extends Readable { + static get defaultOptions() { + return { + root: '.', + /* eslint-disable no-unused-vars */ + fileFilter: (path) => true, + directoryFilter: (path) => true, + /* eslint-enable no-unused-vars */ + type: FILE_TYPE, + lstat: false, + depth: 2147483648, + alwaysStat: false + }; } - if (max === void 0 || min === max) { - return String(min); - } + constructor(options = {}) { + super({ + objectMode: true, + autoDestroy: true, + highWaterMark: options.highWaterMark || 4096 + }); + const opts = { ...ReaddirpStream.defaultOptions, ...options }; + const { root, type } = opts; - if (isNumber(max) === false) { - throw new TypeError('toRegexRange: expected the second argument to be a number.'); - } + this._fileFilter = normalizeFilter(opts.fileFilter); + this._directoryFilter = normalizeFilter(opts.directoryFilter); - let opts = { relaxZeros: true, ...options }; - if (typeof opts.strictZeros === 'boolean') { - opts.relaxZeros = opts.strictZeros === false; - } + const statMethod = opts.lstat ? lstat$2 : stat$3; + // Use bigint stats if it's windows and stat() supports options (node 10+). + if (wantBigintFsStats) { + this._stat = path => statMethod(path, { bigint: true }); + } else { + this._stat = statMethod; + } - let relax = String(opts.relaxZeros); - let shorthand = String(opts.shorthand); - let capture = String(opts.capture); - let wrap = String(opts.wrap); - let cacheKey = min + ':' + max + '=' + relax + shorthand + capture + wrap; + this._maxDepth = opts.depth; + this._wantsDir = [DIR_TYPE, FILE_DIR_TYPE, EVERYTHING_TYPE].includes(type); + this._wantsFile = [FILE_TYPE, FILE_DIR_TYPE, EVERYTHING_TYPE].includes(type); + this._wantsEverything = type === EVERYTHING_TYPE; + this._root = sysPath$3.resolve(root); + this._isDirent = ('Dirent' in fs$3) && !opts.alwaysStat; + this._statsProp = this._isDirent ? 'dirent' : 'stats'; + this._rdOptions = { encoding: 'utf8', withFileTypes: this._isDirent }; - if (toRegexRange.cache.hasOwnProperty(cacheKey)) { - return toRegexRange.cache[cacheKey].result; + // Launch stream with one parent, the root dir. + this.parents = [this._exploreDir(root, 1)]; + this.reading = false; + this.parent = undefined; } - let a = Math.min(min, max); - let b = Math.max(min, max); + async _read(batch) { + if (this.reading) return; + this.reading = true; - if (Math.abs(a - b) === 1) { - let result = min + '|' + max; - if (opts.capture) { - return `(${result})`; - } - if (opts.wrap === false) { - return result; - } - return `(?:${result})`; - } + try { + while (!this.destroyed && batch > 0) { + const { path, depth, files = [] } = this.parent || {}; - let isPadded = hasPadding(min) || hasPadding(max); - let state = { min, max, a, b }; - let positives = []; - let negatives = []; + if (files.length > 0) { + const slice = files.splice(0, batch).map(dirent => this._formatEntry(dirent, path)); + for (const entry of await Promise.all(slice)) { + if (this.destroyed) return; - if (isPadded) { - state.isPadded = isPadded; - state.maxLen = String(state.max).length; - } + const entryType = await this._getEntryType(entry); + if (entryType === 'directory' && this._directoryFilter(entry)) { + if (depth <= this._maxDepth) { + this.parents.push(this._exploreDir(entry.fullPath, depth + 1)); + } - if (a < 0) { - let newMin = b < 0 ? Math.abs(b) : 1; - negatives = splitToPatterns(newMin, Math.abs(a), state, opts); - a = state.a = 0; + if (this._wantsDir) { + this.push(entry); + batch--; + } + } else if ((entryType === 'file' || this._includeAsFile(entry)) && this._fileFilter(entry)) { + if (this._wantsFile) { + this.push(entry); + batch--; + } + } + } + } else { + const parent = this.parents.pop(); + if (!parent) { + this.push(null); + break; + } + this.parent = await parent; + if (this.destroyed) return; + } + } + } catch (error) { + this.destroy(error); + } finally { + this.reading = false; + } } - if (b >= 0) { - positives = splitToPatterns(a, b, state, opts); + async _exploreDir(path, depth) { + let files; + try { + files = await readdir$1(path, this._rdOptions); + } catch (error) { + this._onError(error); + } + return { files, depth, path }; } - state.negatives = negatives; - state.positives = positives; - state.result = collatePatterns(negatives, positives); - - if (opts.capture === true) { - state.result = `(${state.result})`; - } else if (opts.wrap !== false && (positives.length + negatives.length) > 1) { - state.result = `(?:${state.result})`; + async _formatEntry(dirent, path) { + let entry; + try { + const basename = this._isDirent ? dirent.name : dirent; + const fullPath = sysPath$3.resolve(sysPath$3.join(path, basename)); + entry = { path: sysPath$3.relative(this._root, fullPath), fullPath, basename }; + entry[this._statsProp] = this._isDirent ? dirent : await this._stat(fullPath); + } catch (err) { + this._onError(err); + } + return entry; } - toRegexRange.cache[cacheKey] = state; - return state.result; -}; - -function collatePatterns(neg, pos, options) { - let onlyNegative = filterPatterns(neg, pos, '-', false) || []; - let onlyPositive = filterPatterns(pos, neg, '', false) || []; - let intersected = filterPatterns(neg, pos, '-?', true) || []; - let subpatterns = onlyNegative.concat(intersected).concat(onlyPositive); - return subpatterns.join('|'); -} - -function splitToRanges(min, max) { - let nines = 1; - let zeros = 1; - - let stop = countNines(min, nines); - let stops = new Set([max]); + _onError(err) { + if (isNormalFlowError(err) && !this.destroyed) { + this.emit('warn', err); + } else { + this.destroy(err); + } + } - while (min <= stop && stop <= max) { - stops.add(stop); - nines += 1; - stop = countNines(min, nines); + async _getEntryType(entry) { + // entry may be undefined, because a warning or an error were emitted + // and the statsProp is undefined + const stats = entry && entry[this._statsProp]; + if (!stats) { + return; + } + if (stats.isFile()) { + return 'file'; + } + if (stats.isDirectory()) { + return 'directory'; + } + if (stats && stats.isSymbolicLink()) { + const full = entry.fullPath; + try { + const entryRealPath = await realpath$1(full); + const entryRealPathStats = await lstat$2(entryRealPath); + if (entryRealPathStats.isFile()) { + return 'file'; + } + if (entryRealPathStats.isDirectory()) { + const len = entryRealPath.length; + if (full.startsWith(entryRealPath) && full.substr(len, 1) === sysPath$3.sep) { + const recursiveError = new Error( + `Circular symlink detected: "${full}" points to "${entryRealPath}"` + ); + recursiveError.code = RECURSIVE_ERROR_CODE; + return this._onError(recursiveError); + } + return 'directory'; + } + } catch (error) { + this._onError(error); + } + } } - stop = countZeros(max + 1, zeros) - 1; + _includeAsFile(entry) { + const stats = entry && entry[this._statsProp]; - while (min < stop && stop <= max) { - stops.add(stop); - zeros += 1; - stop = countZeros(max + 1, zeros) - 1; + return stats && this._wantsEverything && !stats.isDirectory(); } - - stops = [...stops]; - stops.sort(compare); - return stops; } /** - * Convert a range to a regex pattern - * @param {Number} `start` - * @param {Number} `stop` - * @return {String} + * @typedef {Object} ReaddirpArguments + * @property {Function=} fileFilter + * @property {Function=} directoryFilter + * @property {String=} type + * @property {Number=} depth + * @property {String=} root + * @property {Boolean=} lstat + * @property {Boolean=} bigint */ -function rangeToPattern(start, stop, options) { - if (start === stop) { - return { pattern: start, count: [], digits: 0 }; +/** + * Main function which ends up calling readdirRec and reads all files and directories in given root recursively. + * @param {String} root Root directory + * @param {ReaddirpArguments=} options Options to specify root (start directory), filters and recursion depth + */ +const readdirp$1 = (root, options = {}) => { + let type = options.entryType || options.type; + if (type === 'both') type = FILE_DIR_TYPE; // backwards-compatibility + if (type) options.type = type; + if (!root) { + throw new Error('readdirp: root argument is required. Usage: readdirp(root, options)'); + } else if (typeof root !== 'string') { + throw new TypeError('readdirp: root argument must be a string. Usage: readdirp(root, options)'); + } else if (type && !ALL_TYPES.includes(type)) { + throw new Error(`readdirp: Invalid type passed. Use one of ${ALL_TYPES.join(', ')}`); } - let zipped = zip(start, stop); - let digits = zipped.length; - let pattern = ''; - let count = 0; + options.root = root; + return new ReaddirpStream(options); +}; - for (let i = 0; i < digits; i++) { - let [startDigit, stopDigit] = zipped[i]; +const readdirpPromise = (root, options = {}) => { + return new Promise((resolve, reject) => { + const files = []; + readdirp$1(root, options) + .on('data', entry => files.push(entry)) + .on('end', () => resolve(files)) + .on('error', error => reject(error)); + }); +}; - if (startDigit === stopDigit) { - pattern += startDigit; +readdirp$1.promise = readdirpPromise; +readdirp$1.ReaddirpStream = ReaddirpStream; +readdirp$1.default = readdirp$1; - } else if (startDigit !== '0' || stopDigit !== '9') { - pattern += toCharacterClass(startDigit, stopDigit); +var readdirp_1 = readdirp$1; - } else { - count++; - } - } +var anymatch$2 = {exports: {}}; - if (count) { - pattern += options.shorthand === true ? '\\d' : '[0-9]'; +/*! + * normalize-path + * + * Copyright (c) 2014-2018, Jon Schlinkert. + * Released under the MIT License. + */ + +var normalizePath$2 = function(path, stripTrailing) { + if (typeof path !== 'string') { + throw new TypeError('expected path to be a string'); } - return { pattern, count: [count], digits }; -} - -function splitToPatterns(min, max, tok, options) { - let ranges = splitToRanges(min, max); - let tokens = []; - let start = min; - let prev; - - for (let i = 0; i < ranges.length; i++) { - let max = ranges[i]; - let obj = rangeToPattern(String(start), String(max), options); - let zeros = ''; - - if (!tok.isPadded && prev && prev.pattern === obj.pattern) { - if (prev.count.length > 1) { - prev.count.pop(); - } + if (path === '\\' || path === '/') return '/'; - prev.count.push(obj.count[0]); - prev.string = prev.pattern + toQuantifier(prev.count); - start = max + 1; - continue; - } + var len = path.length; + if (len <= 1) return path; - if (tok.isPadded) { - zeros = padZeros(max, tok, options); + // ensure that win32 namespaces has two leading slashes, so that the path is + // handled properly by the win32 version of path.parse() after being normalized + // https://msdn.microsoft.com/library/windows/desktop/aa365247(v=vs.85).aspx#namespaces + var prefix = ''; + if (len > 4 && path[3] === '\\') { + var ch = path[2]; + if ((ch === '?' || ch === '.') && path.slice(0, 2) === '\\\\') { + path = path.slice(2); + prefix = '//'; } + } - obj.string = zeros + obj.pattern + toQuantifier(obj.count); - tokens.push(obj); - start = max + 1; - prev = obj; + var segs = path.split(/[/\\]+/); + if (stripTrailing !== false && segs[segs.length - 1] === '') { + segs.pop(); } + return prefix + segs.join('/'); +}; - return tokens; -} +Object.defineProperty(anymatch$2.exports, "__esModule", { value: true }); -function filterPatterns(arr, comparison, prefix, intersection, options) { - let result = []; +const picomatch = picomatch$2.exports; +const normalizePath$1 = normalizePath$2; - for (let ele of arr) { - let { string } = ele; +/** + * @typedef {(testString: string) => boolean} AnymatchFn + * @typedef {string|RegExp|AnymatchFn} AnymatchPattern + * @typedef {AnymatchPattern|AnymatchPattern[]} AnymatchMatcher + */ +const BANG$1 = '!'; +const DEFAULT_OPTIONS = {returnIndex: false}; +const arrify$1 = (item) => Array.isArray(item) ? item : [item]; - // only push if _both_ are negative... - if (!intersection && !contains(comparison, 'string', string)) { - result.push(prefix + string); +/** + * @param {AnymatchPattern} matcher + * @param {object} options + * @returns {AnymatchFn} + */ +const createPattern = (matcher, options) => { + if (typeof matcher === 'function') { + return matcher; + } + if (typeof matcher === 'string') { + const glob = picomatch(matcher, options); + return (string) => matcher === string || glob(string); + } + if (matcher instanceof RegExp) { + return (string) => matcher.test(string); + } + return (string) => false; +}; + +/** + * @param {Array} patterns + * @param {Array} negPatterns + * @param {String|Array} args + * @param {Boolean} returnIndex + * @returns {boolean|number} + */ +const matchPatterns = (patterns, negPatterns, args, returnIndex) => { + const isList = Array.isArray(args); + const _path = isList ? args[0] : args; + if (!isList && typeof _path !== 'string') { + throw new TypeError('anymatch: second argument must be a string: got ' + + Object.prototype.toString.call(_path)) + } + const path = normalizePath$1(_path); + + for (let index = 0; index < negPatterns.length; index++) { + const nglob = negPatterns[index]; + if (nglob(path)) { + return returnIndex ? -1 : false; } + } - // or _both_ are positive - if (intersection && contains(comparison, 'string', string)) { - result.push(prefix + string); + const applied = isList && [path].concat(args.slice(1)); + for (let index = 0; index < patterns.length; index++) { + const pattern = patterns[index]; + if (isList ? pattern(...applied) : pattern(path)) { + return returnIndex ? index : true; } } - return result; -} + + return returnIndex ? -1 : false; +}; /** - * Zip strings + * @param {AnymatchMatcher} matchers + * @param {Array|string} testString + * @param {object} options + * @returns {boolean|number|Function} */ +const anymatch$1 = (matchers, testString, options = DEFAULT_OPTIONS) => { + if (matchers == null) { + throw new TypeError('anymatch: specify first argument'); + } + const opts = typeof options === 'boolean' ? {returnIndex: options} : options; + const returnIndex = opts.returnIndex || false; -function zip(a, b) { - let arr = []; - for (let i = 0; i < a.length; i++) arr.push([a[i], b[i]]); - return arr; -} + // Early cache for matchers. + const mtchers = arrify$1(matchers); + const negatedGlobs = mtchers + .filter(item => typeof item === 'string' && item.charAt(0) === BANG$1) + .map(item => item.slice(1)) + .map(item => picomatch(item, opts)); + const patterns = mtchers + .filter(item => typeof item !== 'string' || (typeof item === 'string' && item.charAt(0) !== BANG$1)) + .map(matcher => createPattern(matcher, opts)); -function compare(a, b) { - return a > b ? 1 : b > a ? -1 : 0; -} + if (testString == null) { + return (testString, ri = false) => { + const returnIndex = typeof ri === 'boolean' ? ri : false; + return matchPatterns(patterns, negatedGlobs, testString, returnIndex); + } + } -function contains(arr, key, val) { - return arr.some(ele => ele[key] === val); -} + return matchPatterns(patterns, negatedGlobs, testString, returnIndex); +}; -function countNines(min, len) { - return Number(String(min).slice(0, -len) + '9'.repeat(len)); -} +anymatch$1.default = anymatch$1; +anymatch$2.exports = anymatch$1; -function countZeros(integer, zeros) { - return integer - (integer % Math.pow(10, zeros)); -} +/*! + * is-extglob + * + * Copyright (c) 2014-2016, Jon Schlinkert. + * Licensed under the MIT License. + */ -function toQuantifier(digits) { - let [start = 0, stop = ''] = digits; - if (stop || start > 1) { - return `{${start + (stop ? ',' + stop : '')}}`; +var isExtglob$1 = function isExtglob(str) { + if (typeof str !== 'string' || str === '') { + return false; } - return ''; -} -function toCharacterClass(a, b, options) { - return `[${a}${(b - a === 1) ? '' : '-'}${b}]`; -} + var match; + while ((match = /(\\).|([@?!+*]\(.*\))/g.exec(str))) { + if (match[2]) return true; + str = str.slice(match.index + match[0].length); + } -function hasPadding(str) { - return /^-?(0+)\d/.test(str); -} + return false; +}; -function padZeros(value, tok, options) { - if (!tok.isPadded) { - return value; +/*! + * is-glob + * + * Copyright (c) 2014-2017, Jon Schlinkert. + * Released under the MIT License. + */ + +var isExtglob = isExtglob$1; +var chars = { '{': '}', '(': ')', '[': ']'}; +var strictCheck = function(str) { + if (str[0] === '!') { + return true; } + var index = 0; + var pipeIndex = -2; + var closeSquareIndex = -2; + var closeCurlyIndex = -2; + var closeParenIndex = -2; + var backSlashIndex = -2; + while (index < str.length) { + if (str[index] === '*') { + return true; + } - let diff = Math.abs(tok.maxLen - String(value).length); - let relax = options.relaxZeros !== false; + if (str[index + 1] === '?' && /[\].+)]/.test(str[index])) { + return true; + } - switch (diff) { - case 0: - return ''; - case 1: - return relax ? '0?' : '0'; - case 2: - return relax ? '0{0,2}' : '00'; - default: { - return relax ? `0{0,${diff}}` : `0{${diff}}`; + if (closeSquareIndex !== -1 && str[index] === '[' && str[index + 1] !== ']') { + if (closeSquareIndex < index) { + closeSquareIndex = str.indexOf(']', index); + } + if (closeSquareIndex > index) { + if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) { + return true; + } + backSlashIndex = str.indexOf('\\', index); + if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) { + return true; + } + } } - } -} -/** - * Cache - */ + if (closeCurlyIndex !== -1 && str[index] === '{' && str[index + 1] !== '}') { + closeCurlyIndex = str.indexOf('}', index); + if (closeCurlyIndex > index) { + backSlashIndex = str.indexOf('\\', index); + if (backSlashIndex === -1 || backSlashIndex > closeCurlyIndex) { + return true; + } + } + } -toRegexRange.cache = {}; -toRegexRange.clearCache = () => (toRegexRange.cache = {}); + if (closeParenIndex !== -1 && str[index] === '(' && str[index + 1] === '?' && /[:!=]/.test(str[index + 2]) && str[index + 3] !== ')') { + closeParenIndex = str.indexOf(')', index); + if (closeParenIndex > index) { + backSlashIndex = str.indexOf('\\', index); + if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) { + return true; + } + } + } -/** - * Expose `toRegexRange` - */ + if (pipeIndex !== -1 && str[index] === '(' && str[index + 1] !== '|') { + if (pipeIndex < index) { + pipeIndex = str.indexOf('|', index); + } + if (pipeIndex !== -1 && str[pipeIndex + 1] !== ')') { + closeParenIndex = str.indexOf(')', pipeIndex); + if (closeParenIndex > pipeIndex) { + backSlashIndex = str.indexOf('\\', pipeIndex); + if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) { + return true; + } + } + } + } -var toRegexRange_1 = toRegexRange; + if (str[index] === '\\') { + var open = str[index + 1]; + index += 2; + var close = chars[open]; -const isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val); + if (close) { + var n = str.indexOf(close, index); + if (n !== -1) { + index = n + 1; + } + } -const transform = toNumber => { - return value => toNumber === true ? Number(value) : String(value); + if (str[index] === '!') { + return true; + } + } else { + index++; + } + } + return false; }; -const isValidValue = value => { - return typeof value === 'number' || (typeof value === 'string' && value !== ''); -}; +var relaxedCheck = function(str) { + if (str[0] === '!') { + return true; + } + var index = 0; + while (index < str.length) { + if (/[*?{}()[\]]/.test(str[index])) { + return true; + } -const isNumber$1 = num => Number.isInteger(+num); + if (str[index] === '\\') { + var open = str[index + 1]; + index += 2; + var close = chars[open]; -const zeros = input => { - let value = `${input}`; - let index = -1; - if (value[0] === '-') value = value.slice(1); - if (value === '0') return false; - while (value[++index] === '0'); - return index > 0; -}; + if (close) { + var n = str.indexOf(close, index); + if (n !== -1) { + index = n + 1; + } + } -const stringify$1 = (start, end, options) => { - if (typeof start === 'string' || typeof end === 'string') { - return true; + if (str[index] === '!') { + return true; + } + } else { + index++; + } } - return options.stringify === true; + return false; }; -const pad = (input, maxLength, toNumber) => { - if (maxLength > 0) { - let dash = input[0] === '-' ? '-' : ''; - if (dash) input = input.slice(1); - input = (dash + input.padStart(dash ? maxLength - 1 : maxLength, '0')); +var isGlob$2 = function isGlob(str, options) { + if (typeof str !== 'string' || str === '') { + return false; } - if (toNumber === false) { - return String(input); + + if (isExtglob(str)) { + return true; } - return input; -}; -const toMaxLen = (input, maxLength) => { - let negative = input[0] === '-' ? '-' : ''; - if (negative) { - input = input.slice(1); - maxLength--; + var check = strictCheck; + + // optionally relax check + if (options && options.strict === false) { + check = relaxedCheck; } - while (input.length < maxLength) input = '0' + input; - return negative ? ('-' + input) : input; + + return check(str); }; -const toSequence = (parts, options) => { - parts.negatives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0); - parts.positives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0); +var isGlob$1 = isGlob$2; +var pathPosixDirname = require$$0$2.posix.dirname; +var isWin32 = require$$2$1.platform() === 'win32'; - let prefix = options.capture ? '' : '?:'; - let positives = ''; - let negatives = ''; - let result; +var slash = '/'; +var backslash = /\\/g; +var enclosure = /[\{\[].*[\}\]]$/; +var globby = /(^|[^\\])([\{\[]|\([^\)]+$)/; +var escaped = /\\([\!\*\?\|\[\]\(\)\{\}])/g; - if (parts.positives.length) { - positives = parts.positives.join('|'); - } +/** + * @param {string} str + * @param {Object} opts + * @param {boolean} [opts.flipBackslashes=true] + * @returns {string} + */ +var globParent$1 = function globParent(str, opts) { + var options = Object.assign({ flipBackslashes: true }, opts); - if (parts.negatives.length) { - negatives = `-(${prefix}${parts.negatives.join('|')})`; + // flip windows path separators + if (options.flipBackslashes && isWin32 && str.indexOf(slash) < 0) { + str = str.replace(backslash, slash); } - if (positives && negatives) { - result = `${positives}|${negatives}`; - } else { - result = positives || negatives; + // special case for strings ending in enclosure containing path separator + if (enclosure.test(str)) { + str += slash; } - if (options.wrap) { - return `(${prefix}${result})`; - } + // preserves full path in case of trailing path separator + str += 'a'; - return result; + // remove path parts that are globby + do { + str = pathPosixDirname(str); + } while (isGlob$1(str) || globby.test(str)); + + // remove escape chars and return result + return str.replace(escaped, '$1'); }; -const toRange = (a, b, isNumbers, options) => { - if (isNumbers) { - return toRegexRange_1(a, b, { wrap: false, ...options }); - } +var utils$3 = {}; + +(function (exports) { + + exports.isInteger = num => { + if (typeof num === 'number') { + return Number.isInteger(num); + } + if (typeof num === 'string' && num.trim() !== '') { + return Number.isInteger(Number(num)); + } + return false; + }; + + /** + * Find a node of the given type + */ + + exports.find = (node, type) => node.nodes.find(node => node.type === type); + + /** + * Find a node of the given type + */ + + exports.exceedsLimit = (min, max, step = 1, limit) => { + if (limit === false) return false; + if (!exports.isInteger(min) || !exports.isInteger(max)) return false; + return ((Number(max) - Number(min)) / Number(step)) >= limit; + }; + + /** + * Escape the given node with '\\' before node.value + */ + + exports.escapeNode = (block, n = 0, type) => { + let node = block.nodes[n]; + if (!node) return; + + if ((type && node.type === type) || node.type === 'open' || node.type === 'close') { + if (node.escaped !== true) { + node.value = '\\' + node.value; + node.escaped = true; + } + } + }; + + /** + * Returns true if the given brace node should be enclosed in literal braces + */ + + exports.encloseBrace = node => { + if (node.type !== 'brace') return false; + if ((node.commas >> 0 + node.ranges >> 0) === 0) { + node.invalid = true; + return true; + } + return false; + }; + + /** + * Returns true if a brace node is invalid. + */ + + exports.isInvalidBrace = block => { + if (block.type !== 'brace') return false; + if (block.invalid === true || block.dollar) return true; + if ((block.commas >> 0 + block.ranges >> 0) === 0) { + block.invalid = true; + return true; + } + if (block.open !== true || block.close !== true) { + block.invalid = true; + return true; + } + return false; + }; + + /** + * Returns true if a node is an open or close node + */ + + exports.isOpenOrClose = node => { + if (node.type === 'open' || node.type === 'close') { + return true; + } + return node.open === true || node.close === true; + }; + + /** + * Reduce an array of text nodes. + */ + + exports.reduce = nodes => nodes.reduce((acc, node) => { + if (node.type === 'text') acc.push(node.value); + if (node.type === 'range') node.type = 'text'; + return acc; + }, []); + + /** + * Flatten an array + */ + + exports.flatten = (...args) => { + const result = []; + const flat = arr => { + for (let i = 0; i < arr.length; i++) { + let ele = arr[i]; + Array.isArray(ele) ? flat(ele) : ele !== void 0 && result.push(ele); + } + return result; + }; + flat(args); + return result; + }; +} (utils$3)); + +const utils$2 = utils$3; + +var stringify$4 = (ast, options = {}) => { + let stringify = (node, parent = {}) => { + let invalidBlock = options.escapeInvalid && utils$2.isInvalidBrace(parent); + let invalidNode = node.invalid === true && options.escapeInvalid === true; + let output = ''; - let start = String.fromCharCode(a); - if (a === b) return start; + if (node.value) { + if ((invalidBlock || invalidNode) && utils$2.isOpenOrClose(node)) { + return '\\' + node.value; + } + return node.value; + } - let stop = String.fromCharCode(b); - return `[${start}-${stop}]`; -}; + if (node.value) { + return node.value; + } -const toRegex = (start, end, options) => { - if (Array.isArray(start)) { - let wrap = options.wrap === true; - let prefix = options.capture ? '' : '?:'; - return wrap ? `(${prefix}${start.join('|')})` : start.join('|'); - } - return toRegexRange_1(start, end, options); -}; + if (node.nodes) { + for (let child of node.nodes) { + output += stringify(child); + } + } + return output; + }; -const rangeError = (...args) => { - return new RangeError('Invalid range arguments: ' + util.inspect(...args)); + return stringify(ast); }; -const invalidRange = (start, end, options) => { - if (options.strictRanges === true) throw rangeError([start, end]); - return []; -}; +/*! + * is-number + * + * Copyright (c) 2014-present, Jon Schlinkert. + * Released under the MIT License. + */ -const invalidStep = (step, options) => { - if (options.strictRanges === true) { - throw new TypeError(`Expected step "${step}" to be a number`); +var isNumber$2 = function(num) { + if (typeof num === 'number') { + return num - num === 0; } - return []; -}; - -const fillNumbers = (start, end, step = 1, options = {}) => { - let a = Number(start); - let b = Number(end); - - if (!Number.isInteger(a) || !Number.isInteger(b)) { - if (options.strictRanges === true) throw rangeError([start, end]); - return []; + if (typeof num === 'string' && num.trim() !== '') { + return Number.isFinite ? Number.isFinite(+num) : isFinite(+num); } + return false; +}; - // fix negative zero - if (a === 0) a = 0; - if (b === 0) b = 0; - - let descending = a > b; - let startString = String(start); - let endString = String(end); - let stepString = String(step); - step = Math.max(Math.abs(step), 1); +/*! + * to-regex-range + * + * Copyright (c) 2015-present, Jon Schlinkert. + * Released under the MIT License. + */ - let padded = zeros(startString) || zeros(endString) || zeros(stepString); - let maxLen = padded ? Math.max(startString.length, endString.length, stepString.length) : 0; - let toNumber = padded === false && stringify$1(start, end, options) === false; - let format = options.transform || transform(toNumber); +const isNumber$1 = isNumber$2; - if (options.toRegex && step === 1) { - return toRange(toMaxLen(start, maxLen), toMaxLen(end, maxLen), true, options); +const toRegexRange$1 = (min, max, options) => { + if (isNumber$1(min) === false) { + throw new TypeError('toRegexRange: expected the first argument to be a number'); } - let parts = { negatives: [], positives: [] }; - let push = num => parts[num < 0 ? 'negatives' : 'positives'].push(Math.abs(num)); - let range = []; - let index = 0; - - while (descending ? a >= b : a <= b) { - if (options.toRegex === true && step > 1) { - push(a); - } else { - range.push(pad(format(a, index), maxLen, toNumber)); - } - a = descending ? a - step : a + step; - index++; + if (max === void 0 || min === max) { + return String(min); } - if (options.toRegex === true) { - return step > 1 - ? toSequence(parts, options) - : toRegex(range, null, { wrap: false, ...options }); + if (isNumber$1(max) === false) { + throw new TypeError('toRegexRange: expected the second argument to be a number.'); } - return range; -}; - -const fillLetters = (start, end, step = 1, options = {}) => { - if ((!isNumber$1(start) && start.length > 1) || (!isNumber$1(end) && end.length > 1)) { - return invalidRange(start, end, options); + let opts = { relaxZeros: true, ...options }; + if (typeof opts.strictZeros === 'boolean') { + opts.relaxZeros = opts.strictZeros === false; } + let relax = String(opts.relaxZeros); + let shorthand = String(opts.shorthand); + let capture = String(opts.capture); + let wrap = String(opts.wrap); + let cacheKey = min + ':' + max + '=' + relax + shorthand + capture + wrap; - let format = options.transform || (val => String.fromCharCode(val)); - let a = `${start}`.charCodeAt(0); - let b = `${end}`.charCodeAt(0); + if (toRegexRange$1.cache.hasOwnProperty(cacheKey)) { + return toRegexRange$1.cache[cacheKey].result; + } - let descending = a > b; - let min = Math.min(a, b); - let max = Math.max(a, b); + let a = Math.min(min, max); + let b = Math.max(min, max); - if (options.toRegex && step === 1) { - return toRange(min, max, false, options); + if (Math.abs(a - b) === 1) { + let result = min + '|' + max; + if (opts.capture) { + return `(${result})`; + } + if (opts.wrap === false) { + return result; + } + return `(?:${result})`; } - let range = []; - let index = 0; + let isPadded = hasPadding(min) || hasPadding(max); + let state = { min, max, a, b }; + let positives = []; + let negatives = []; - while (descending ? a >= b : a <= b) { - range.push(format(a, index)); - a = descending ? a - step : a + step; - index++; + if (isPadded) { + state.isPadded = isPadded; + state.maxLen = String(state.max).length; } - if (options.toRegex === true) { - return toRegex(range, null, { wrap: false, options }); + if (a < 0) { + let newMin = b < 0 ? Math.abs(b) : 1; + negatives = splitToPatterns(newMin, Math.abs(a), state, opts); + a = state.a = 0; } - return range; -}; - -const fill = (start, end, step, options = {}) => { - if (end == null && isValidValue(start)) { - return [start]; + if (b >= 0) { + positives = splitToPatterns(a, b, state, opts); } - if (!isValidValue(start) || !isValidValue(end)) { - return invalidRange(start, end, options); - } + state.negatives = negatives; + state.positives = positives; + state.result = collatePatterns(negatives, positives); - if (typeof step === 'function') { - return fill(start, end, 1, { transform: step }); + if (opts.capture === true) { + state.result = `(${state.result})`; + } else if (opts.wrap !== false && (positives.length + negatives.length) > 1) { + state.result = `(?:${state.result})`; } - if (isObject(step)) { - return fill(start, end, 0, step); - } + toRegexRange$1.cache[cacheKey] = state; + return state.result; +}; - let opts = { ...options }; - if (opts.capture === true) opts.wrap = true; - step = step || opts.step || 1; +function collatePatterns(neg, pos, options) { + let onlyNegative = filterPatterns(neg, pos, '-', false) || []; + let onlyPositive = filterPatterns(pos, neg, '', false) || []; + let intersected = filterPatterns(neg, pos, '-?', true) || []; + let subpatterns = onlyNegative.concat(intersected).concat(onlyPositive); + return subpatterns.join('|'); +} - if (!isNumber$1(step)) { - if (step != null && !isObject(step)) return invalidStep(step, opts); - return fill(start, end, 1, step); +function splitToRanges(min, max) { + let nines = 1; + let zeros = 1; + + let stop = countNines(min, nines); + let stops = new Set([max]); + + while (min <= stop && stop <= max) { + stops.add(stop); + nines += 1; + stop = countNines(min, nines); } - if (isNumber$1(start) && isNumber$1(end)) { - return fillNumbers(start, end, step, opts); + stop = countZeros(max + 1, zeros) - 1; + + while (min < stop && stop <= max) { + stops.add(stop); + zeros += 1; + stop = countZeros(max + 1, zeros) - 1; } - return fillLetters(start, end, Math.max(Math.abs(step), 1), opts); -}; + stops = [...stops]; + stops.sort(compare); + return stops; +} -var fillRange = fill; +/** + * Convert a range to a regex pattern + * @param {Number} `start` + * @param {Number} `stop` + * @return {String} + */ -const compile = (ast, options = {}) => { - let walk = (node, parent = {}) => { - let invalidBlock = utils.isInvalidBrace(parent); - let invalidNode = node.invalid === true && options.escapeInvalid === true; - let invalid = invalidBlock === true || invalidNode === true; - let prefix = options.escapeInvalid === true ? '\\' : ''; - let output = ''; +function rangeToPattern(start, stop, options) { + if (start === stop) { + return { pattern: start, count: [], digits: 0 }; + } - if (node.isOpen === true) { - return prefix + node.value; - } - if (node.isClose === true) { - return prefix + node.value; - } + let zipped = zip(start, stop); + let digits = zipped.length; + let pattern = ''; + let count = 0; - if (node.type === 'open') { - return invalid ? (prefix + node.value) : '('; - } + for (let i = 0; i < digits; i++) { + let [startDigit, stopDigit] = zipped[i]; - if (node.type === 'close') { - return invalid ? (prefix + node.value) : ')'; - } + if (startDigit === stopDigit) { + pattern += startDigit; - if (node.type === 'comma') { - return node.prev.type === 'comma' ? '' : (invalid ? node.value : '|'); - } + } else if (startDigit !== '0' || stopDigit !== '9') { + pattern += toCharacterClass(startDigit, stopDigit); - if (node.value) { - return node.value; + } else { + count++; } + } - if (node.nodes && node.ranges > 0) { - let args = utils.reduce(node.nodes); - let range = fillRange(...args, { ...options, wrap: false, toRegex: true }); + if (count) { + pattern += options.shorthand === true ? '\\d' : '[0-9]'; + } - if (range.length !== 0) { - return args.length > 1 && range.length > 1 ? `(${range})` : range; + return { pattern, count: [count], digits }; +} + +function splitToPatterns(min, max, tok, options) { + let ranges = splitToRanges(min, max); + let tokens = []; + let start = min; + let prev; + + for (let i = 0; i < ranges.length; i++) { + let max = ranges[i]; + let obj = rangeToPattern(String(start), String(max), options); + let zeros = ''; + + if (!tok.isPadded && prev && prev.pattern === obj.pattern) { + if (prev.count.length > 1) { + prev.count.pop(); } + + prev.count.push(obj.count[0]); + prev.string = prev.pattern + toQuantifier(prev.count); + start = max + 1; + continue; } - if (node.nodes) { - for (let child of node.nodes) { - output += walk(child, node); - } + if (tok.isPadded) { + zeros = padZeros(max, tok, options); } - return output; - }; - return walk(ast); -}; + obj.string = zeros + obj.pattern + toQuantifier(obj.count); + tokens.push(obj); + start = max + 1; + prev = obj; + } -var compile_1 = compile; + return tokens; +} -const append = (queue = '', stash = '', enclose = false) => { +function filterPatterns(arr, comparison, prefix, intersection, options) { let result = []; - queue = [].concat(queue); - stash = [].concat(stash); + for (let ele of arr) { + let { string } = ele; - if (!stash.length) return queue; - if (!queue.length) { - return enclose ? utils.flatten(stash).map(ele => `{${ele}}`) : stash; - } + // only push if _both_ are negative... + if (!intersection && !contains(comparison, 'string', string)) { + result.push(prefix + string); + } - for (let item of queue) { - if (Array.isArray(item)) { - for (let value of item) { - result.push(append(value, stash, enclose)); - } - } else { - for (let ele of stash) { - if (enclose === true && typeof ele === 'string') ele = `{${ele}}`; - result.push(Array.isArray(ele) ? append(item, ele, enclose) : (item + ele)); - } + // or _both_ are positive + if (intersection && contains(comparison, 'string', string)) { + result.push(prefix + string); } } - return utils.flatten(result); -}; + return result; +} -const expand = (ast, options = {}) => { - let rangeLimit = options.rangeLimit === void 0 ? 1000 : options.rangeLimit; +/** + * Zip strings + */ - let walk = (node, parent = {}) => { - node.queue = []; +function zip(a, b) { + let arr = []; + for (let i = 0; i < a.length; i++) arr.push([a[i], b[i]]); + return arr; +} - let p = parent; - let q = parent.queue; +function compare(a, b) { + return a > b ? 1 : b > a ? -1 : 0; +} - while (p.type !== 'brace' && p.type !== 'root' && p.parent) { - p = p.parent; - q = p.queue; - } +function contains(arr, key, val) { + return arr.some(ele => ele[key] === val); +} - if (node.invalid || node.dollar) { - q.push(append(q.pop(), stringify(node, options))); - return; - } +function countNines(min, len) { + return Number(String(min).slice(0, -len) + '9'.repeat(len)); +} - if (node.type === 'brace' && node.invalid !== true && node.nodes.length === 2) { - q.push(append(q.pop(), ['{}'])); - return; - } +function countZeros(integer, zeros) { + return integer - (integer % Math.pow(10, zeros)); +} - if (node.nodes && node.ranges > 0) { - let args = utils.reduce(node.nodes); +function toQuantifier(digits) { + let [start = 0, stop = ''] = digits; + if (stop || start > 1) { + return `{${start + (stop ? ',' + stop : '')}}`; + } + return ''; +} - if (utils.exceedsLimit(...args, options.step, rangeLimit)) { - throw new RangeError('expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.'); - } +function toCharacterClass(a, b, options) { + return `[${a}${(b - a === 1) ? '' : '-'}${b}]`; +} - let range = fillRange(...args, options); - if (range.length === 0) { - range = stringify(node, options); - } +function hasPadding(str) { + return /^-?(0+)\d/.test(str); +} - q.push(append(q.pop(), range)); - node.nodes = []; - return; - } +function padZeros(value, tok, options) { + if (!tok.isPadded) { + return value; + } - let enclose = utils.encloseBrace(node); - let queue = node.queue; - let block = node; + let diff = Math.abs(tok.maxLen - String(value).length); + let relax = options.relaxZeros !== false; - while (block.type !== 'brace' && block.type !== 'root' && block.parent) { - block = block.parent; - queue = block.queue; + switch (diff) { + case 0: + return ''; + case 1: + return relax ? '0?' : '0'; + case 2: + return relax ? '0{0,2}' : '00'; + default: { + return relax ? `0{0,${diff}}` : `0{${diff}}`; } + } +} - for (let i = 0; i < node.nodes.length; i++) { - let child = node.nodes[i]; +/** + * Cache + */ - if (child.type === 'comma' && node.type === 'brace') { - if (i === 1) queue.push(''); - queue.push(''); - continue; - } +toRegexRange$1.cache = {}; +toRegexRange$1.clearCache = () => (toRegexRange$1.cache = {}); - if (child.type === 'close') { - q.push(append(q.pop(), queue, enclose)); - continue; - } +/** + * Expose `toRegexRange` + */ - if (child.value && child.type !== 'open') { - queue.push(append(queue.pop(), child.value)); - continue; - } +var toRegexRange_1 = toRegexRange$1; - if (child.nodes) { - walk(child, node); - } - } +/*! + * fill-range + * + * Copyright (c) 2014-present, Jon Schlinkert. + * Licensed under the MIT License. + */ - return queue; - }; +const util = require$$2; +const toRegexRange = toRegexRange_1; - return utils.flatten(walk(ast)); -}; +const isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val); -var expand_1 = expand; +const transform = toNumber => { + return value => toNumber === true ? Number(value) : String(value); +}; -var constants = { - MAX_LENGTH: 1024 * 64, +const isValidValue = value => { + return typeof value === 'number' || (typeof value === 'string' && value !== ''); +}; - // Digits - CHAR_0: '0', /* 0 */ - CHAR_9: '9', /* 9 */ +const isNumber = num => Number.isInteger(+num); - // Alphabet chars. - CHAR_UPPERCASE_A: 'A', /* A */ - CHAR_LOWERCASE_A: 'a', /* a */ - CHAR_UPPERCASE_Z: 'Z', /* Z */ - CHAR_LOWERCASE_Z: 'z', /* z */ +const zeros = input => { + let value = `${input}`; + let index = -1; + if (value[0] === '-') value = value.slice(1); + if (value === '0') return false; + while (value[++index] === '0'); + return index > 0; +}; - CHAR_LEFT_PARENTHESES: '(', /* ( */ - CHAR_RIGHT_PARENTHESES: ')', /* ) */ +const stringify$3 = (start, end, options) => { + if (typeof start === 'string' || typeof end === 'string') { + return true; + } + return options.stringify === true; +}; - CHAR_ASTERISK: '*', /* * */ +const pad = (input, maxLength, toNumber) => { + if (maxLength > 0) { + let dash = input[0] === '-' ? '-' : ''; + if (dash) input = input.slice(1); + input = (dash + input.padStart(dash ? maxLength - 1 : maxLength, '0')); + } + if (toNumber === false) { + return String(input); + } + return input; +}; - // Non-alphabetic chars. - CHAR_AMPERSAND: '&', /* & */ - CHAR_AT: '@', /* @ */ - CHAR_BACKSLASH: '\\', /* \ */ - CHAR_BACKTICK: '`', /* ` */ - CHAR_CARRIAGE_RETURN: '\r', /* \r */ - CHAR_CIRCUMFLEX_ACCENT: '^', /* ^ */ - CHAR_COLON: ':', /* : */ - CHAR_COMMA: ',', /* , */ - CHAR_DOLLAR: '$', /* . */ - CHAR_DOT: '.', /* . */ - CHAR_DOUBLE_QUOTE: '"', /* " */ - CHAR_EQUAL: '=', /* = */ - CHAR_EXCLAMATION_MARK: '!', /* ! */ - CHAR_FORM_FEED: '\f', /* \f */ - CHAR_FORWARD_SLASH: '/', /* / */ - CHAR_HASH: '#', /* # */ - CHAR_HYPHEN_MINUS: '-', /* - */ - CHAR_LEFT_ANGLE_BRACKET: '<', /* < */ - CHAR_LEFT_CURLY_BRACE: '{', /* { */ - CHAR_LEFT_SQUARE_BRACKET: '[', /* [ */ - CHAR_LINE_FEED: '\n', /* \n */ - CHAR_NO_BREAK_SPACE: '\u00A0', /* \u00A0 */ - CHAR_PERCENT: '%', /* % */ - CHAR_PLUS: '+', /* + */ - CHAR_QUESTION_MARK: '?', /* ? */ - CHAR_RIGHT_ANGLE_BRACKET: '>', /* > */ - CHAR_RIGHT_CURLY_BRACE: '}', /* } */ - CHAR_RIGHT_SQUARE_BRACKET: ']', /* ] */ - CHAR_SEMICOLON: ';', /* ; */ - CHAR_SINGLE_QUOTE: '\'', /* ' */ - CHAR_SPACE: ' ', /* */ - CHAR_TAB: '\t', /* \t */ - CHAR_UNDERSCORE: '_', /* _ */ - CHAR_VERTICAL_LINE: '|', /* | */ - CHAR_ZERO_WIDTH_NOBREAK_SPACE: '\uFEFF' /* \uFEFF */ +const toMaxLen = (input, maxLength) => { + let negative = input[0] === '-' ? '-' : ''; + if (negative) { + input = input.slice(1); + maxLength--; + } + while (input.length < maxLength) input = '0' + input; + return negative ? ('-' + input) : input; }; -/** - * Constants - */ +const toSequence = (parts, options) => { + parts.negatives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0); + parts.positives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0); -const { - MAX_LENGTH, - CHAR_BACKSLASH, /* \ */ - CHAR_BACKTICK, /* ` */ - CHAR_COMMA, /* , */ - CHAR_DOT, /* . */ - CHAR_LEFT_PARENTHESES, /* ( */ - CHAR_RIGHT_PARENTHESES, /* ) */ - CHAR_LEFT_CURLY_BRACE, /* { */ - CHAR_RIGHT_CURLY_BRACE, /* } */ - CHAR_LEFT_SQUARE_BRACKET, /* [ */ - CHAR_RIGHT_SQUARE_BRACKET, /* ] */ - CHAR_DOUBLE_QUOTE, /* " */ - CHAR_SINGLE_QUOTE, /* ' */ - CHAR_NO_BREAK_SPACE, - CHAR_ZERO_WIDTH_NOBREAK_SPACE -} = constants; + let prefix = options.capture ? '' : '?:'; + let positives = ''; + let negatives = ''; + let result; -/** - * parse - */ + if (parts.positives.length) { + positives = parts.positives.join('|'); + } -const parse = (input, options = {}) => { - if (typeof input !== 'string') { - throw new TypeError('Expected a string'); + if (parts.negatives.length) { + negatives = `-(${prefix}${parts.negatives.join('|')})`; } - let opts = options || {}; - let max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; - if (input.length > max) { - throw new SyntaxError(`Input length (${input.length}), exceeds max characters (${max})`); + if (positives && negatives) { + result = `${positives}|${negatives}`; + } else { + result = positives || negatives; } - let ast = { type: 'root', input, nodes: [] }; - let stack = [ast]; - let block = ast; - let prev = ast; - let brackets = 0; - let length = input.length; - let index = 0; - let depth = 0; - let value; + if (options.wrap) { + return `(${prefix}${result})`; + } - /** - * Helpers - */ + return result; +}; - const advance = () => input[index++]; - const push = node => { - if (node.type === 'text' && prev.type === 'dot') { - prev.type = 'text'; - } +const toRange = (a, b, isNumbers, options) => { + if (isNumbers) { + return toRegexRange(a, b, { wrap: false, ...options }); + } - if (prev && prev.type === 'text' && node.type === 'text') { - prev.value += node.value; - return; - } + let start = String.fromCharCode(a); + if (a === b) return start; - block.nodes.push(node); - node.parent = block; - node.prev = prev; - prev = node; - return node; - }; + let stop = String.fromCharCode(b); + return `[${start}-${stop}]`; +}; - push({ type: 'bos' }); +const toRegex = (start, end, options) => { + if (Array.isArray(start)) { + let wrap = options.wrap === true; + let prefix = options.capture ? '' : '?:'; + return wrap ? `(${prefix}${start.join('|')})` : start.join('|'); + } + return toRegexRange(start, end, options); +}; - while (index < length) { - block = stack[stack.length - 1]; - value = advance(); +const rangeError = (...args) => { + return new RangeError('Invalid range arguments: ' + util.inspect(...args)); +}; - /** - * Invalid chars - */ +const invalidRange = (start, end, options) => { + if (options.strictRanges === true) throw rangeError([start, end]); + return []; +}; - if (value === CHAR_ZERO_WIDTH_NOBREAK_SPACE || value === CHAR_NO_BREAK_SPACE) { - continue; - } +const invalidStep = (step, options) => { + if (options.strictRanges === true) { + throw new TypeError(`Expected step "${step}" to be a number`); + } + return []; +}; - /** - * Escaped chars - */ +const fillNumbers = (start, end, step = 1, options = {}) => { + let a = Number(start); + let b = Number(end); - if (value === CHAR_BACKSLASH) { - push({ type: 'text', value: (options.keepEscaping ? value : '') + advance() }); - continue; - } + if (!Number.isInteger(a) || !Number.isInteger(b)) { + if (options.strictRanges === true) throw rangeError([start, end]); + return []; + } - /** - * Right square bracket (literal): ']' - */ + // fix negative zero + if (a === 0) a = 0; + if (b === 0) b = 0; - if (value === CHAR_RIGHT_SQUARE_BRACKET) { - push({ type: 'text', value: '\\' + value }); - continue; - } + let descending = a > b; + let startString = String(start); + let endString = String(end); + let stepString = String(step); + step = Math.max(Math.abs(step), 1); - /** - * Left square bracket: '[' - */ + let padded = zeros(startString) || zeros(endString) || zeros(stepString); + let maxLen = padded ? Math.max(startString.length, endString.length, stepString.length) : 0; + let toNumber = padded === false && stringify$3(start, end, options) === false; + let format = options.transform || transform(toNumber); - if (value === CHAR_LEFT_SQUARE_BRACKET) { - brackets++; - let next; + if (options.toRegex && step === 1) { + return toRange(toMaxLen(start, maxLen), toMaxLen(end, maxLen), true, options); + } - while (index < length && (next = advance())) { - value += next; + let parts = { negatives: [], positives: [] }; + let push = num => parts[num < 0 ? 'negatives' : 'positives'].push(Math.abs(num)); + let range = []; + let index = 0; - if (next === CHAR_LEFT_SQUARE_BRACKET) { - brackets++; - continue; - } + while (descending ? a >= b : a <= b) { + if (options.toRegex === true && step > 1) { + push(a); + } else { + range.push(pad(format(a, index), maxLen, toNumber)); + } + a = descending ? a - step : a + step; + index++; + } - if (next === CHAR_BACKSLASH) { - value += advance(); - continue; - } + if (options.toRegex === true) { + return step > 1 + ? toSequence(parts, options) + : toRegex(range, null, { wrap: false, ...options }); + } - if (next === CHAR_RIGHT_SQUARE_BRACKET) { - brackets--; + return range; +}; - if (brackets === 0) { - break; - } - } - } +const fillLetters = (start, end, step = 1, options = {}) => { + if ((!isNumber(start) && start.length > 1) || (!isNumber(end) && end.length > 1)) { + return invalidRange(start, end, options); + } - push({ type: 'text', value }); - continue; - } - /** - * Parentheses - */ + let format = options.transform || (val => String.fromCharCode(val)); + let a = `${start}`.charCodeAt(0); + let b = `${end}`.charCodeAt(0); - if (value === CHAR_LEFT_PARENTHESES) { - block = push({ type: 'paren', nodes: [] }); - stack.push(block); - push({ type: 'text', value }); - continue; - } + let descending = a > b; + let min = Math.min(a, b); + let max = Math.max(a, b); - if (value === CHAR_RIGHT_PARENTHESES) { - if (block.type !== 'paren') { - push({ type: 'text', value }); - continue; - } - block = stack.pop(); - push({ type: 'text', value }); - block = stack[stack.length - 1]; - continue; - } + if (options.toRegex && step === 1) { + return toRange(min, max, false, options); + } - /** - * Quotes: '|"|` - */ + let range = []; + let index = 0; - if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) { - let open = value; - let next; + while (descending ? a >= b : a <= b) { + range.push(format(a, index)); + a = descending ? a - step : a + step; + index++; + } - if (options.keepQuotes !== true) { - value = ''; - } + if (options.toRegex === true) { + return toRegex(range, null, { wrap: false, options }); + } - while (index < length && (next = advance())) { - if (next === CHAR_BACKSLASH) { - value += next + advance(); - continue; - } + return range; +}; - if (next === open) { - if (options.keepQuotes === true) value += next; - break; - } +const fill$2 = (start, end, step, options = {}) => { + if (end == null && isValidValue(start)) { + return [start]; + } - value += next; - } + if (!isValidValue(start) || !isValidValue(end)) { + return invalidRange(start, end, options); + } - push({ type: 'text', value }); - continue; - } + if (typeof step === 'function') { + return fill$2(start, end, 1, { transform: step }); + } - /** - * Left curly brace: '{' - */ + if (isObject(step)) { + return fill$2(start, end, 0, step); + } - if (value === CHAR_LEFT_CURLY_BRACE) { - depth++; + let opts = { ...options }; + if (opts.capture === true) opts.wrap = true; + step = step || opts.step || 1; - let dollar = prev.value && prev.value.slice(-1) === '$' || block.dollar === true; - let brace = { - type: 'brace', - open: true, - close: false, - dollar, - depth, - commas: 0, - ranges: 0, - nodes: [] - }; + if (!isNumber(step)) { + if (step != null && !isObject(step)) return invalidStep(step, opts); + return fill$2(start, end, 1, step); + } - block = push(brace); - stack.push(block); - push({ type: 'open', value }); - continue; - } + if (isNumber(start) && isNumber(end)) { + return fillNumbers(start, end, step, opts); + } - /** - * Right curly brace: '}' - */ + return fillLetters(start, end, Math.max(Math.abs(step), 1), opts); +}; - if (value === CHAR_RIGHT_CURLY_BRACE) { - if (block.type !== 'brace') { - push({ type: 'text', value }); - continue; - } +var fillRange = fill$2; - let type = 'close'; - block = stack.pop(); - block.close = true; +const fill$1 = fillRange; +const utils$1 = utils$3; - push({ type, value }); - depth--; +const compile$1 = (ast, options = {}) => { + let walk = (node, parent = {}) => { + let invalidBlock = utils$1.isInvalidBrace(parent); + let invalidNode = node.invalid === true && options.escapeInvalid === true; + let invalid = invalidBlock === true || invalidNode === true; + let prefix = options.escapeInvalid === true ? '\\' : ''; + let output = ''; - block = stack[stack.length - 1]; - continue; + if (node.isOpen === true) { + return prefix + node.value; + } + if (node.isClose === true) { + return prefix + node.value; } - /** - * Comma: ',' - */ + if (node.type === 'open') { + return invalid ? (prefix + node.value) : '('; + } - if (value === CHAR_COMMA && depth > 0) { - if (block.ranges > 0) { - block.ranges = 0; - let open = block.nodes.shift(); - block.nodes = [open, { type: 'text', value: stringify(block) }]; - } + if (node.type === 'close') { + return invalid ? (prefix + node.value) : ')'; + } - push({ type: 'comma', value }); - block.commas++; - continue; + if (node.type === 'comma') { + return node.prev.type === 'comma' ? '' : (invalid ? node.value : '|'); } - /** - * Dot: '.' - */ + if (node.value) { + return node.value; + } - if (value === CHAR_DOT && depth > 0 && block.commas === 0) { - let siblings = block.nodes; + if (node.nodes && node.ranges > 0) { + let args = utils$1.reduce(node.nodes); + let range = fill$1(...args, { ...options, wrap: false, toRegex: true }); - if (depth === 0 || siblings.length === 0) { - push({ type: 'text', value }); - continue; + if (range.length !== 0) { + return args.length > 1 && range.length > 1 ? `(${range})` : range; } + } - if (prev.type === 'dot') { - block.range = []; - prev.value += value; - prev.type = 'range'; - - if (block.nodes.length !== 3 && block.nodes.length !== 5) { - block.invalid = true; - block.ranges = 0; - prev.type = 'text'; - continue; - } - - block.ranges++; - block.args = []; - continue; + if (node.nodes) { + for (let child of node.nodes) { + output += walk(child, node); } + } + return output; + }; - if (prev.type === 'range') { - siblings.pop(); + return walk(ast); +}; - let before = siblings[siblings.length - 1]; - before.value += prev.value + value; - prev = before; - block.ranges--; - continue; - } +var compile_1 = compile$1; - push({ type: 'dot', value }); - continue; - } +const fill = fillRange; +const stringify$2 = stringify$4; +const utils = utils$3; - /** - * Text - */ +const append = (queue = '', stash = '', enclose = false) => { + let result = []; - push({ type: 'text', value }); + queue = [].concat(queue); + stash = [].concat(stash); + + if (!stash.length) return queue; + if (!queue.length) { + return enclose ? utils.flatten(stash).map(ele => `{${ele}}`) : stash; } - // Mark imbalanced braces and brackets as invalid - do { - block = stack.pop(); - - if (block.type !== 'root') { - block.nodes.forEach(node => { - if (!node.nodes) { - if (node.type === 'open') node.isOpen = true; - if (node.type === 'close') node.isClose = true; - if (!node.nodes) node.type = 'text'; - node.invalid = true; - } - }); - - // get the location of the block on parent.nodes (block's siblings) - let parent = stack[stack.length - 1]; - let index = parent.nodes.indexOf(block); - // replace the (invalid) block with it's nodes - parent.nodes.splice(index, 1, ...block.nodes); - } - } while (stack.length > 0); - - push({ type: 'eos' }); - return ast; -}; - -var parse_1 = parse; - -/** - * Expand the given pattern or create a regex-compatible string. - * - * ```js - * const braces = require('braces'); - * console.log(braces('{a,b,c}', { compile: true })); //=> ['(a|b|c)'] - * console.log(braces('{a,b,c}')); //=> ['a', 'b', 'c'] - * ``` - * @param {String} `str` - * @param {Object} `options` - * @return {String} - * @api public - */ - -const braces = (input, options = {}) => { - let output = []; - - if (Array.isArray(input)) { - for (let pattern of input) { - let result = braces.create(pattern, options); - if (Array.isArray(result)) { - output.push(...result); - } else { - output.push(result); + for (let item of queue) { + if (Array.isArray(item)) { + for (let value of item) { + result.push(append(value, stash, enclose)); + } + } else { + for (let ele of stash) { + if (enclose === true && typeof ele === 'string') ele = `{${ele}}`; + result.push(Array.isArray(ele) ? append(item, ele, enclose) : (item + ele)); } } - } else { - output = [].concat(braces.create(input, options)); - } - - if (options && options.expand === true && options.nodupes === true) { - output = [...new Set(output)]; } - return output; + return utils.flatten(result); }; -/** - * Parse the given `str` with the given `options`. - * - * ```js - * // braces.parse(pattern, [, options]); - * const ast = braces.parse('a/{b,c}/d'); - * console.log(ast); - * ``` - * @param {String} pattern Brace pattern to parse - * @param {Object} options - * @return {Object} Returns an AST - * @api public - */ - -braces.parse = (input, options = {}) => parse_1(input, options); - -/** - * Creates a braces string from an AST, or an AST node. - * - * ```js - * const braces = require('braces'); - * let ast = braces.parse('foo/{a,b}/bar'); - * console.log(stringify(ast.nodes[2])); //=> '{a,b}' - * ``` - * @param {String} `input` Brace pattern or AST. - * @param {Object} `options` - * @return {Array} Returns an array of expanded values. - * @api public - */ - -braces.stringify = (input, options = {}) => { - if (typeof input === 'string') { - return stringify(braces.parse(input, options), options); - } - return stringify(input, options); -}; +const expand$1 = (ast, options = {}) => { + let rangeLimit = options.rangeLimit === void 0 ? 1000 : options.rangeLimit; -/** - * Compiles a brace pattern into a regex-compatible, optimized string. - * This method is called by the main [braces](#braces) function by default. - * - * ```js - * const braces = require('braces'); - * console.log(braces.compile('a/{b,c}/d')); - * //=> ['a/(b|c)/d'] - * ``` - * @param {String} `input` Brace pattern or AST. - * @param {Object} `options` - * @return {Array} Returns an array of expanded values. - * @api public - */ + let walk = (node, parent = {}) => { + node.queue = []; -braces.compile = (input, options = {}) => { - if (typeof input === 'string') { - input = braces.parse(input, options); - } - return compile_1(input, options); -}; + let p = parent; + let q = parent.queue; -/** - * Expands a brace pattern into an array. This method is called by the - * main [braces](#braces) function when `options.expand` is true. Before - * using this method it's recommended that you read the [performance notes](#performance)) - * and advantages of using [.compile](#compile) instead. - * - * ```js - * const braces = require('braces'); - * console.log(braces.expand('a/{b,c}/d')); - * //=> ['a/b/d', 'a/c/d']; - * ``` - * @param {String} `pattern` Brace pattern - * @param {Object} `options` - * @return {Array} Returns an array of expanded values. - * @api public - */ + while (p.type !== 'brace' && p.type !== 'root' && p.parent) { + p = p.parent; + q = p.queue; + } -braces.expand = (input, options = {}) => { - if (typeof input === 'string') { - input = braces.parse(input, options); - } + if (node.invalid || node.dollar) { + q.push(append(q.pop(), stringify$2(node, options))); + return; + } - let result = expand_1(input, options); + if (node.type === 'brace' && node.invalid !== true && node.nodes.length === 2) { + q.push(append(q.pop(), ['{}'])); + return; + } - // filter out empty strings if specified - if (options.noempty === true) { - result = result.filter(Boolean); - } + if (node.nodes && node.ranges > 0) { + let args = utils.reduce(node.nodes); - // filter out duplicates if specified - if (options.nodupes === true) { - result = [...new Set(result)]; - } + if (utils.exceedsLimit(...args, options.step, rangeLimit)) { + throw new RangeError('expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.'); + } - return result; -}; + let range = fill(...args, options); + if (range.length === 0) { + range = stringify$2(node, options); + } -/** - * Processes a brace pattern and returns either an expanded array - * (if `options.expand` is true), a highly optimized regex-compatible string. - * This method is called by the main [braces](#braces) function. - * - * ```js - * const braces = require('braces'); - * console.log(braces.create('user-{200..300}/project-{a,b,c}-{1..10}')) - * //=> 'user-(20[0-9]|2[1-9][0-9]|300)/project-(a|b|c)-([1-9]|10)' - * ``` - * @param {String} `pattern` Brace pattern - * @param {Object} `options` - * @return {Array} Returns an array of expanded values. - * @api public - */ + q.push(append(q.pop(), range)); + node.nodes = []; + return; + } -braces.create = (input, options = {}) => { - if (input === '' || input.length < 3) { - return [input]; - } + let enclose = utils.encloseBrace(node); + let queue = node.queue; + let block = node; - return options.expand !== true - ? braces.compile(input, options) - : braces.expand(input, options); -}; + while (block.type !== 'brace' && block.type !== 'root' && block.parent) { + block = block.parent; + queue = block.queue; + } -/** - * Expose "braces" - */ + for (let i = 0; i < node.nodes.length; i++) { + let child = node.nodes[i]; -var braces_1 = braces; + if (child.type === 'comma' && node.type === 'brace') { + if (i === 1) queue.push(''); + queue.push(''); + continue; + } -const WIN_SLASH = '\\\\/'; -const WIN_NO_SLASH = `[^${WIN_SLASH}]`; + if (child.type === 'close') { + q.push(append(q.pop(), queue, enclose)); + continue; + } -/** - * Posix glob regex - */ + if (child.value && child.type !== 'open') { + queue.push(append(queue.pop(), child.value)); + continue; + } -const DOT_LITERAL = '\\.'; -const PLUS_LITERAL = '\\+'; -const QMARK_LITERAL = '\\?'; -const SLASH_LITERAL = '\\/'; -const ONE_CHAR = '(?=.)'; -const QMARK = '[^/]'; -const END_ANCHOR = `(?:${SLASH_LITERAL}|$)`; -const START_ANCHOR = `(?:^|${SLASH_LITERAL})`; -const DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`; -const NO_DOT = `(?!${DOT_LITERAL})`; -const NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`; -const NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`; -const NO_DOTS_SLASH = `(?!${DOTS_SLASH})`; -const QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`; -const STAR = `${QMARK}*?`; - -const POSIX_CHARS = { - DOT_LITERAL, - PLUS_LITERAL, - QMARK_LITERAL, - SLASH_LITERAL, - ONE_CHAR, - QMARK, - END_ANCHOR, - DOTS_SLASH, - NO_DOT, - NO_DOTS, - NO_DOT_SLASH, - NO_DOTS_SLASH, - QMARK_NO_DOT, - STAR, - START_ANCHOR -}; + if (child.nodes) { + walk(child, node); + } + } -/** - * Windows glob regex - */ + return queue; + }; -const WINDOWS_CHARS = { - ...POSIX_CHARS, - - SLASH_LITERAL: `[${WIN_SLASH}]`, - QMARK: WIN_NO_SLASH, - STAR: `${WIN_NO_SLASH}*?`, - DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`, - NO_DOT: `(?!${DOT_LITERAL})`, - NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`, - NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`, - NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`, - QMARK_NO_DOT: `[^.${WIN_SLASH}]`, - START_ANCHOR: `(?:^|[${WIN_SLASH}])`, - END_ANCHOR: `(?:[${WIN_SLASH}]|$)` + return utils.flatten(walk(ast)); }; -/** - * POSIX Bracket Regex - */ - -const POSIX_REGEX_SOURCE = { - alnum: 'a-zA-Z0-9', - alpha: 'a-zA-Z', - ascii: '\\x00-\\x7F', - blank: ' \\t', - cntrl: '\\x00-\\x1F\\x7F', - digit: '0-9', - graph: '\\x21-\\x7E', - lower: 'a-z', - print: '\\x20-\\x7E ', - punct: '\\-!"#$%&\'()\\*+,./:;<=>?@[\\]^_`{|}~', - space: ' \\t\\r\\n\\v\\f', - upper: 'A-Z', - word: 'A-Za-z0-9_', - xdigit: 'A-Fa-f0-9' -}; +var expand_1 = expand$1; var constants$1 = { MAX_LENGTH: 1024 * 64, - POSIX_REGEX_SOURCE, - - // regular expressions - REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g, - REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/, - REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/, - REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g, - REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g, - REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g, - - // Replace globs with equivalent patterns to reduce parsing time. - REPLACEMENTS: { - '***': '*', - '**/**': '**', - '**/**/**': '**' - }, // Digits - CHAR_0: 48, /* 0 */ - CHAR_9: 57, /* 9 */ + CHAR_0: '0', /* 0 */ + CHAR_9: '9', /* 9 */ // Alphabet chars. - CHAR_UPPERCASE_A: 65, /* A */ - CHAR_LOWERCASE_A: 97, /* a */ - CHAR_UPPERCASE_Z: 90, /* Z */ - CHAR_LOWERCASE_Z: 122, /* z */ + CHAR_UPPERCASE_A: 'A', /* A */ + CHAR_LOWERCASE_A: 'a', /* a */ + CHAR_UPPERCASE_Z: 'Z', /* Z */ + CHAR_LOWERCASE_Z: 'z', /* z */ - CHAR_LEFT_PARENTHESES: 40, /* ( */ - CHAR_RIGHT_PARENTHESES: 41, /* ) */ + CHAR_LEFT_PARENTHESES: '(', /* ( */ + CHAR_RIGHT_PARENTHESES: ')', /* ) */ - CHAR_ASTERISK: 42, /* * */ + CHAR_ASTERISK: '*', /* * */ // Non-alphabetic chars. - CHAR_AMPERSAND: 38, /* & */ - CHAR_AT: 64, /* @ */ - CHAR_BACKWARD_SLASH: 92, /* \ */ - CHAR_CARRIAGE_RETURN: 13, /* \r */ - CHAR_CIRCUMFLEX_ACCENT: 94, /* ^ */ - CHAR_COLON: 58, /* : */ - CHAR_COMMA: 44, /* , */ - CHAR_DOT: 46, /* . */ - CHAR_DOUBLE_QUOTE: 34, /* " */ - CHAR_EQUAL: 61, /* = */ - CHAR_EXCLAMATION_MARK: 33, /* ! */ - CHAR_FORM_FEED: 12, /* \f */ - CHAR_FORWARD_SLASH: 47, /* / */ - CHAR_GRAVE_ACCENT: 96, /* ` */ - CHAR_HASH: 35, /* # */ - CHAR_HYPHEN_MINUS: 45, /* - */ - CHAR_LEFT_ANGLE_BRACKET: 60, /* < */ - CHAR_LEFT_CURLY_BRACE: 123, /* { */ - CHAR_LEFT_SQUARE_BRACKET: 91, /* [ */ - CHAR_LINE_FEED: 10, /* \n */ - CHAR_NO_BREAK_SPACE: 160, /* \u00A0 */ - CHAR_PERCENT: 37, /* % */ - CHAR_PLUS: 43, /* + */ - CHAR_QUESTION_MARK: 63, /* ? */ - CHAR_RIGHT_ANGLE_BRACKET: 62, /* > */ - CHAR_RIGHT_CURLY_BRACE: 125, /* } */ - CHAR_RIGHT_SQUARE_BRACKET: 93, /* ] */ - CHAR_SEMICOLON: 59, /* ; */ - CHAR_SINGLE_QUOTE: 39, /* ' */ - CHAR_SPACE: 32, /* */ - CHAR_TAB: 9, /* \t */ - CHAR_UNDERSCORE: 95, /* _ */ - CHAR_VERTICAL_LINE: 124, /* | */ - CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279, /* \uFEFF */ - - SEP: path.sep, - - /** - * Create EXTGLOB_CHARS - */ - - extglobChars(chars) { - return { - '!': { type: 'negate', open: '(?:(?!(?:', close: `))${chars.STAR})` }, - '?': { type: 'qmark', open: '(?:', close: ')?' }, - '+': { type: 'plus', open: '(?:', close: ')+' }, - '*': { type: 'star', open: '(?:', close: ')*' }, - '@': { type: 'at', open: '(?:', close: ')' } - }; - }, - - /** - * Create GLOB_CHARS - */ - - globChars(win32) { - return win32 === true ? WINDOWS_CHARS : POSIX_CHARS; - } -}; - -var utils$1 = createCommonjsModule(function (module, exports) { - - -const win32 = process.platform === 'win32'; -const { - REGEX_BACKSLASH, - REGEX_REMOVE_BACKSLASH, - REGEX_SPECIAL_CHARS, - REGEX_SPECIAL_CHARS_GLOBAL -} = constants$1; - -exports.isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val); -exports.hasRegexChars = str => REGEX_SPECIAL_CHARS.test(str); -exports.isRegexChar = str => str.length === 1 && exports.hasRegexChars(str); -exports.escapeRegex = str => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, '\\$1'); -exports.toPosixSlashes = str => str.replace(REGEX_BACKSLASH, '/'); - -exports.removeBackslashes = str => { - return str.replace(REGEX_REMOVE_BACKSLASH, match => { - return match === '\\' ? '' : match; - }); -}; - -exports.supportsLookbehinds = () => { - const segs = process.version.slice(1).split('.').map(Number); - if (segs.length === 3 && segs[0] >= 9 || (segs[0] === 8 && segs[1] >= 10)) { - return true; - } - return false; -}; - -exports.isWindows = options => { - if (options && typeof options.windows === 'boolean') { - return options.windows; - } - return win32 === true || path.sep === '\\'; -}; - -exports.escapeLast = (input, char, lastIdx) => { - const idx = input.lastIndexOf(char, lastIdx); - if (idx === -1) return input; - if (input[idx - 1] === '\\') return exports.escapeLast(input, char, idx - 1); - return `${input.slice(0, idx)}\\${input.slice(idx)}`; -}; - -exports.removePrefix = (input, state = {}) => { - let output = input; - if (output.startsWith('./')) { - output = output.slice(2); - state.prefix = './'; - } - return output; + CHAR_AMPERSAND: '&', /* & */ + CHAR_AT: '@', /* @ */ + CHAR_BACKSLASH: '\\', /* \ */ + CHAR_BACKTICK: '`', /* ` */ + CHAR_CARRIAGE_RETURN: '\r', /* \r */ + CHAR_CIRCUMFLEX_ACCENT: '^', /* ^ */ + CHAR_COLON: ':', /* : */ + CHAR_COMMA: ',', /* , */ + CHAR_DOLLAR: '$', /* . */ + CHAR_DOT: '.', /* . */ + CHAR_DOUBLE_QUOTE: '"', /* " */ + CHAR_EQUAL: '=', /* = */ + CHAR_EXCLAMATION_MARK: '!', /* ! */ + CHAR_FORM_FEED: '\f', /* \f */ + CHAR_FORWARD_SLASH: '/', /* / */ + CHAR_HASH: '#', /* # */ + CHAR_HYPHEN_MINUS: '-', /* - */ + CHAR_LEFT_ANGLE_BRACKET: '<', /* < */ + CHAR_LEFT_CURLY_BRACE: '{', /* { */ + CHAR_LEFT_SQUARE_BRACKET: '[', /* [ */ + CHAR_LINE_FEED: '\n', /* \n */ + CHAR_NO_BREAK_SPACE: '\u00A0', /* \u00A0 */ + CHAR_PERCENT: '%', /* % */ + CHAR_PLUS: '+', /* + */ + CHAR_QUESTION_MARK: '?', /* ? */ + CHAR_RIGHT_ANGLE_BRACKET: '>', /* > */ + CHAR_RIGHT_CURLY_BRACE: '}', /* } */ + CHAR_RIGHT_SQUARE_BRACKET: ']', /* ] */ + CHAR_SEMICOLON: ';', /* ; */ + CHAR_SINGLE_QUOTE: '\'', /* ' */ + CHAR_SPACE: ' ', /* */ + CHAR_TAB: '\t', /* \t */ + CHAR_UNDERSCORE: '_', /* _ */ + CHAR_VERTICAL_LINE: '|', /* | */ + CHAR_ZERO_WIDTH_NOBREAK_SPACE: '\uFEFF' /* \uFEFF */ }; -exports.wrapOutput = (input, state = {}, options = {}) => { - const prepend = options.contains ? '' : '^'; - const append = options.contains ? '' : '$'; +const stringify$1 = stringify$4; - let output = `${prepend}(?:${input})${append}`; - if (state.negated === true) { - output = `(?:^(?!${output}).*$)`; - } - return output; -}; -}); +/** + * Constants + */ const { - CHAR_ASTERISK, /* * */ - CHAR_AT, /* @ */ - CHAR_BACKWARD_SLASH, /* \ */ - CHAR_COMMA: CHAR_COMMA$1, /* , */ - CHAR_DOT: CHAR_DOT$1, /* . */ - CHAR_EXCLAMATION_MARK, /* ! */ - CHAR_FORWARD_SLASH, /* / */ - CHAR_LEFT_CURLY_BRACE: CHAR_LEFT_CURLY_BRACE$1, /* { */ - CHAR_LEFT_PARENTHESES: CHAR_LEFT_PARENTHESES$1, /* ( */ - CHAR_LEFT_SQUARE_BRACKET: CHAR_LEFT_SQUARE_BRACKET$1, /* [ */ - CHAR_PLUS, /* + */ - CHAR_QUESTION_MARK, /* ? */ - CHAR_RIGHT_CURLY_BRACE: CHAR_RIGHT_CURLY_BRACE$1, /* } */ - CHAR_RIGHT_PARENTHESES: CHAR_RIGHT_PARENTHESES$1, /* ) */ - CHAR_RIGHT_SQUARE_BRACKET: CHAR_RIGHT_SQUARE_BRACKET$1 /* ] */ + MAX_LENGTH, + CHAR_BACKSLASH, /* \ */ + CHAR_BACKTICK, /* ` */ + CHAR_COMMA, /* , */ + CHAR_DOT, /* . */ + CHAR_LEFT_PARENTHESES, /* ( */ + CHAR_RIGHT_PARENTHESES, /* ) */ + CHAR_LEFT_CURLY_BRACE, /* { */ + CHAR_RIGHT_CURLY_BRACE, /* } */ + CHAR_LEFT_SQUARE_BRACKET, /* [ */ + CHAR_RIGHT_SQUARE_BRACKET, /* ] */ + CHAR_DOUBLE_QUOTE, /* " */ + CHAR_SINGLE_QUOTE, /* ' */ + CHAR_NO_BREAK_SPACE, + CHAR_ZERO_WIDTH_NOBREAK_SPACE } = constants$1; -const isPathSeparator = code => { - return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH; -}; +/** + * parse + */ -const depth = token => { - if (token.isPrefix !== true) { - token.depth = token.isGlobstar ? Infinity : 1; +const parse$1 = (input, options = {}) => { + if (typeof input !== 'string') { + throw new TypeError('Expected a string'); } -}; -/** - * Quickly scans a glob pattern and returns an object with a handful of - * useful properties, like `isGlob`, `path` (the leading non-glob, if it exists), - * `glob` (the actual pattern), and `negated` (true if the path starts with `!`). - * - * ```js - * const pm = require('picomatch'); - * console.log(pm.scan('foo/bar/*.js')); - * { isGlob: true, input: 'foo/bar/*.js', base: 'foo/bar', glob: '*.js' } - * ``` - * @param {String} `str` - * @param {Object} `options` - * @return {Object} Returns an object with tokens and regex source string. - * @api public - */ + let opts = options || {}; + let max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; + if (input.length > max) { + throw new SyntaxError(`Input length (${input.length}), exceeds max characters (${max})`); + } + + let ast = { type: 'root', input, nodes: [] }; + let stack = [ast]; + let block = ast; + let prev = ast; + let brackets = 0; + let length = input.length; + let index = 0; + let depth = 0; + let value; -const scan = (input, options) => { - const opts = options || {}; + /** + * Helpers + */ - const length = input.length - 1; - const scanToEnd = opts.parts === true || opts.scanToEnd === true; - const slashes = []; - const tokens = []; - const parts = []; + const advance = () => input[index++]; + const push = node => { + if (node.type === 'text' && prev.type === 'dot') { + prev.type = 'text'; + } - let str = input; - let index = -1; - let start = 0; - let lastIndex = 0; - let isBrace = false; - let isBracket = false; - let isGlob = false; - let isExtglob = false; - let isGlobstar = false; - let braceEscaped = false; - let backslashes = false; - let negated = false; - let finished = false; - let braces = 0; - let prev; - let code; - let token = { value: '', depth: 0, isGlob: false }; - - const eos = () => index >= length; - const peek = () => str.charCodeAt(index + 1); - const advance = () => { - prev = code; - return str.charCodeAt(++index); + if (prev && prev.type === 'text' && node.type === 'text') { + prev.value += node.value; + return; + } + + block.nodes.push(node); + node.parent = block; + node.prev = prev; + prev = node; + return node; }; + push({ type: 'bos' }); + while (index < length) { - code = advance(); - let next; + block = stack[stack.length - 1]; + value = advance(); - if (code === CHAR_BACKWARD_SLASH) { - backslashes = token.backslashes = true; - code = advance(); + /** + * Invalid chars + */ - if (code === CHAR_LEFT_CURLY_BRACE$1) { - braceEscaped = true; - } + if (value === CHAR_ZERO_WIDTH_NOBREAK_SPACE || value === CHAR_NO_BREAK_SPACE) { continue; } - if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE$1) { - braces++; + /** + * Escaped chars + */ - while (eos() !== true && (code = advance())) { - if (code === CHAR_BACKWARD_SLASH) { - backslashes = token.backslashes = true; - advance(); - continue; - } + if (value === CHAR_BACKSLASH) { + push({ type: 'text', value: (options.keepEscaping ? value : '') + advance() }); + continue; + } - if (code === CHAR_LEFT_CURLY_BRACE$1) { - braces++; - continue; - } + /** + * Right square bracket (literal): ']' + */ - if (braceEscaped !== true && code === CHAR_DOT$1 && (code = advance()) === CHAR_DOT$1) { - isBrace = token.isBrace = true; - isGlob = token.isGlob = true; - finished = true; + if (value === CHAR_RIGHT_SQUARE_BRACKET) { + push({ type: 'text', value: '\\' + value }); + continue; + } - if (scanToEnd === true) { - continue; - } + /** + * Left square bracket: '[' + */ - break; - } + if (value === CHAR_LEFT_SQUARE_BRACKET) { + brackets++; + let next; - if (braceEscaped !== true && code === CHAR_COMMA$1) { - isBrace = token.isBrace = true; - isGlob = token.isGlob = true; - finished = true; + while (index < length && (next = advance())) { + value += next; - if (scanToEnd === true) { - continue; - } + if (next === CHAR_LEFT_SQUARE_BRACKET) { + brackets++; + continue; + } - break; + if (next === CHAR_BACKSLASH) { + value += advance(); + continue; } - if (code === CHAR_RIGHT_CURLY_BRACE$1) { - braces--; + if (next === CHAR_RIGHT_SQUARE_BRACKET) { + brackets--; - if (braces === 0) { - braceEscaped = false; - isBrace = token.isBrace = true; - finished = true; + if (brackets === 0) { break; } } } - if (scanToEnd === true) { - continue; - } - - break; - } - - if (code === CHAR_FORWARD_SLASH) { - slashes.push(index); - tokens.push(token); - token = { value: '', depth: 0, isGlob: false }; - - if (finished === true) continue; - if (prev === CHAR_DOT$1 && index === (start + 1)) { - start += 2; - continue; - } - - lastIndex = index + 1; + push({ type: 'text', value }); continue; } - if (opts.noext !== true) { - const isExtglobChar = code === CHAR_PLUS - || code === CHAR_AT - || code === CHAR_ASTERISK - || code === CHAR_QUESTION_MARK - || code === CHAR_EXCLAMATION_MARK; - - if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES$1) { - isGlob = token.isGlob = true; - isExtglob = token.isExtglob = true; - finished = true; - - if (scanToEnd === true) { - while (eos() !== true && (code = advance())) { - if (code === CHAR_BACKWARD_SLASH) { - backslashes = token.backslashes = true; - code = advance(); - continue; - } + /** + * Parentheses + */ - if (code === CHAR_RIGHT_PARENTHESES$1) { - isGlob = token.isGlob = true; - finished = true; - break; - } - } - continue; - } - break; - } + if (value === CHAR_LEFT_PARENTHESES) { + block = push({ type: 'paren', nodes: [] }); + stack.push(block); + push({ type: 'text', value }); + continue; } - if (code === CHAR_ASTERISK) { - if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true; - isGlob = token.isGlob = true; - finished = true; - - if (scanToEnd === true) { + if (value === CHAR_RIGHT_PARENTHESES) { + if (block.type !== 'paren') { + push({ type: 'text', value }); continue; } - break; + block = stack.pop(); + push({ type: 'text', value }); + block = stack[stack.length - 1]; + continue; } - if (code === CHAR_QUESTION_MARK) { - isGlob = token.isGlob = true; - finished = true; + /** + * Quotes: '|"|` + */ + + if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) { + let open = value; + let next; - if (scanToEnd === true) { - continue; + if (options.keepQuotes !== true) { + value = ''; } - break; - } - if (code === CHAR_LEFT_SQUARE_BRACKET$1) { - while (eos() !== true && (next = advance())) { - if (next === CHAR_BACKWARD_SLASH) { - backslashes = token.backslashes = true; - advance(); + while (index < length && (next = advance())) { + if (next === CHAR_BACKSLASH) { + value += next + advance(); continue; } - if (next === CHAR_RIGHT_SQUARE_BRACKET$1) { - isBracket = token.isBracket = true; - isGlob = token.isGlob = true; - finished = true; - - if (scanToEnd === true) { - continue; - } + if (next === open) { + if (options.keepQuotes === true) value += next; break; } + + value += next; } - } - if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) { - negated = token.negated = true; - start++; + push({ type: 'text', value }); continue; } - if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES$1) { - isGlob = token.isGlob = true; - - if (scanToEnd === true) { - while (eos() !== true && (code = advance())) { - if (code === CHAR_LEFT_PARENTHESES$1) { - backslashes = token.backslashes = true; - code = advance(); - continue; - } + /** + * Left curly brace: '{' + */ - if (code === CHAR_RIGHT_PARENTHESES$1) { - finished = true; - break; - } - } - continue; - } - break; - } + if (value === CHAR_LEFT_CURLY_BRACE) { + depth++; - if (isGlob === true) { - finished = true; + let dollar = prev.value && prev.value.slice(-1) === '$' || block.dollar === true; + let brace = { + type: 'brace', + open: true, + close: false, + dollar, + depth, + commas: 0, + ranges: 0, + nodes: [] + }; - if (scanToEnd === true) { - continue; - } - - break; - } - } - - if (opts.noext === true) { - isExtglob = false; - isGlob = false; - } - - let base = str; - let prefix = ''; - let glob = ''; - - if (start > 0) { - prefix = str.slice(0, start); - str = str.slice(start); - lastIndex -= start; - } - - if (base && isGlob === true && lastIndex > 0) { - base = str.slice(0, lastIndex); - glob = str.slice(lastIndex); - } else if (isGlob === true) { - base = ''; - glob = str; - } else { - base = str; - } - - if (base && base !== '' && base !== '/' && base !== str) { - if (isPathSeparator(base.charCodeAt(base.length - 1))) { - base = base.slice(0, -1); - } - } - - if (opts.unescape === true) { - if (glob) glob = utils$1.removeBackslashes(glob); - - if (base && backslashes === true) { - base = utils$1.removeBackslashes(base); - } - } - - const state = { - prefix, - input, - start, - base, - glob, - isBrace, - isBracket, - isGlob, - isExtglob, - isGlobstar, - negated - }; - - if (opts.tokens === true) { - state.maxDepth = 0; - if (!isPathSeparator(code)) { - tokens.push(token); - } - state.tokens = tokens; - } - - if (opts.parts === true || opts.tokens === true) { - let prevIndex; - - for (let idx = 0; idx < slashes.length; idx++) { - const n = prevIndex ? prevIndex + 1 : start; - const i = slashes[idx]; - const value = input.slice(n, i); - if (opts.tokens) { - if (idx === 0 && start !== 0) { - tokens[idx].isPrefix = true; - tokens[idx].value = prefix; - } else { - tokens[idx].value = value; - } - depth(tokens[idx]); - state.maxDepth += tokens[idx].depth; - } - if (idx !== 0 || value !== '') { - parts.push(value); - } - prevIndex = i; - } - - if (prevIndex && prevIndex + 1 < input.length) { - const value = input.slice(prevIndex + 1); - parts.push(value); - - if (opts.tokens) { - tokens[tokens.length - 1].value = value; - depth(tokens[tokens.length - 1]); - state.maxDepth += tokens[tokens.length - 1].depth; - } - } - - state.slashes = slashes; - state.parts = parts; - } - - return state; -}; - -var scan_1 = scan; - -/** - * Constants - */ - -const { - MAX_LENGTH: MAX_LENGTH$1, - POSIX_REGEX_SOURCE: POSIX_REGEX_SOURCE$1, - REGEX_NON_SPECIAL_CHARS, - REGEX_SPECIAL_CHARS_BACKREF, - REPLACEMENTS -} = constants$1; - -/** - * Helpers - */ - -const expandRange = (args, options) => { - if (typeof options.expandRange === 'function') { - return options.expandRange(...args, options); - } - - args.sort(); - const value = `[${args.join('-')}]`; - - return value; -}; - -/** - * Create the message for a syntax error - */ - -const syntaxError = (type, char) => { - return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`; -}; - -/** - * Parse the given input string. - * @param {String} input - * @param {Object} options - * @return {Object} - */ - -const parse$1 = (input, options) => { - if (typeof input !== 'string') { - throw new TypeError('Expected a string'); - } - - input = REPLACEMENTS[input] || input; - - const opts = { ...options }; - const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH$1, opts.maxLength) : MAX_LENGTH$1; - - let len = input.length; - if (len > max) { - throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`); - } - - const bos = { type: 'bos', value: '', output: opts.prepend || '' }; - const tokens = [bos]; - - const capture = opts.capture ? '' : '?:'; - const win32 = utils$1.isWindows(options); - - // create constants based on platform, for windows or posix - const PLATFORM_CHARS = constants$1.globChars(win32); - const EXTGLOB_CHARS = constants$1.extglobChars(PLATFORM_CHARS); - - const { - DOT_LITERAL, - PLUS_LITERAL, - SLASH_LITERAL, - ONE_CHAR, - DOTS_SLASH, - NO_DOT, - NO_DOT_SLASH, - NO_DOTS_SLASH, - QMARK, - QMARK_NO_DOT, - STAR, - START_ANCHOR - } = PLATFORM_CHARS; - - const globstar = (opts) => { - return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`; - }; - - const nodot = opts.dot ? '' : NO_DOT; - const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT; - let star = opts.bash === true ? globstar(opts) : STAR; - - if (opts.capture) { - star = `(${star})`; - } - - // minimatch options support - if (typeof opts.noext === 'boolean') { - opts.noextglob = opts.noext; - } - - const state = { - input, - index: -1, - start: 0, - dot: opts.dot === true, - consumed: '', - output: '', - prefix: '', - backtrack: false, - negated: false, - brackets: 0, - braces: 0, - parens: 0, - quotes: 0, - globstar: false, - tokens - }; - - input = utils$1.removePrefix(input, state); - len = input.length; - - const extglobs = []; - const braces = []; - const stack = []; - let prev = bos; - let value; - - /** - * Tokenizing helpers - */ - - const eos = () => state.index === len - 1; - const peek = state.peek = (n = 1) => input[state.index + n]; - const advance = state.advance = () => input[++state.index]; - const remaining = () => input.slice(state.index + 1); - const consume = (value = '', num = 0) => { - state.consumed += value; - state.index += num; - }; - const append = token => { - state.output += token.output != null ? token.output : token.value; - consume(token.value); - }; - - const negate = () => { - let count = 1; - - while (peek() === '!' && (peek(2) !== '(' || peek(3) === '?')) { - advance(); - state.start++; - count++; - } - - if (count % 2 === 0) { - return false; - } - - state.negated = true; - state.start++; - return true; - }; - - const increment = type => { - state[type]++; - stack.push(type); - }; - - const decrement = type => { - state[type]--; - stack.pop(); - }; - - /** - * Push tokens onto the tokens array. This helper speeds up - * tokenizing by 1) helping us avoid backtracking as much as possible, - * and 2) helping us avoid creating extra tokens when consecutive - * characters are plain text. This improves performance and simplifies - * lookbehinds. - */ - - const push = tok => { - if (prev.type === 'globstar') { - const isBrace = state.braces > 0 && (tok.type === 'comma' || tok.type === 'brace'); - const isExtglob = tok.extglob === true || (extglobs.length && (tok.type === 'pipe' || tok.type === 'paren')); - - if (tok.type !== 'slash' && tok.type !== 'paren' && !isBrace && !isExtglob) { - state.output = state.output.slice(0, -prev.output.length); - prev.type = 'star'; - prev.value = '*'; - prev.output = star; - state.output += prev.output; - } - } - - if (extglobs.length && tok.type !== 'paren' && !EXTGLOB_CHARS[tok.value]) { - extglobs[extglobs.length - 1].inner += tok.value; - } - - if (tok.value || tok.output) append(tok); - if (prev && prev.type === 'text' && tok.type === 'text') { - prev.value += tok.value; - prev.output = (prev.output || '') + tok.value; - return; - } - - tok.prev = prev; - tokens.push(tok); - prev = tok; - }; - - const extglobOpen = (type, value) => { - const token = { ...EXTGLOB_CHARS[value], conditions: 1, inner: '' }; - - token.prev = prev; - token.parens = state.parens; - token.output = state.output; - const output = (opts.capture ? '(' : '') + token.open; - - increment('parens'); - push({ type, value, output: state.output ? '' : ONE_CHAR }); - push({ type: 'paren', extglob: true, value: advance(), output }); - extglobs.push(token); - }; - - const extglobClose = token => { - let output = token.close + (opts.capture ? ')' : ''); - - if (token.type === 'negate') { - let extglobStar = star; - - if (token.inner && token.inner.length > 1 && token.inner.includes('/')) { - extglobStar = globstar(opts); - } - - if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) { - output = token.close = `)$))${extglobStar}`; - } - - if (token.prev.type === 'bos' && eos()) { - state.negatedExtglob = true; - } - } - - push({ type: 'paren', extglob: true, value, output }); - decrement('parens'); - }; - - /** - * Fast paths - */ - - if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) { - let backslashes = false; - - let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => { - if (first === '\\') { - backslashes = true; - return m; - } - - if (first === '?') { - if (esc) { - return esc + first + (rest ? QMARK.repeat(rest.length) : ''); - } - if (index === 0) { - return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : ''); - } - return QMARK.repeat(chars.length); - } - - if (first === '.') { - return DOT_LITERAL.repeat(chars.length); - } - - if (first === '*') { - if (esc) { - return esc + first + (rest ? star : ''); - } - return star; - } - return esc ? m : `\\${m}`; - }); - - if (backslashes === true) { - if (opts.unescape === true) { - output = output.replace(/\\/g, ''); - } else { - output = output.replace(/\\+/g, m => { - return m.length % 2 === 0 ? '\\\\' : (m ? '\\' : ''); - }); - } - } - - if (output === input && opts.contains === true) { - state.output = input; - return state; - } - - state.output = utils$1.wrapOutput(output, state, options); - return state; - } - - /** - * Tokenize input until we reach end-of-string - */ - - while (!eos()) { - value = advance(); - - if (value === '\u0000') { - continue; - } - - /** - * Escaped characters - */ - - if (value === '\\') { - const next = peek(); - - if (next === '/' && opts.bash !== true) { - continue; - } - - if (next === '.' || next === ';') { - continue; - } - - if (!next) { - value += '\\'; - push({ type: 'text', value }); - continue; - } - - // collapse slashes to reduce potential for exploits - const match = /^\\+/.exec(remaining()); - let slashes = 0; - - if (match && match[0].length > 2) { - slashes = match[0].length; - state.index += slashes; - if (slashes % 2 !== 0) { - value += '\\'; - } - } - - if (opts.unescape === true) { - value = advance() || ''; - } else { - value += advance() || ''; - } - - if (state.brackets === 0) { - push({ type: 'text', value }); - continue; - } - } - - /** - * If we're inside a regex character class, continue - * until we reach the closing bracket. - */ - - if (state.brackets > 0 && (value !== ']' || prev.value === '[' || prev.value === '[^')) { - if (opts.posix !== false && value === ':') { - const inner = prev.value.slice(1); - if (inner.includes('[')) { - prev.posix = true; - - if (inner.includes(':')) { - const idx = prev.value.lastIndexOf('['); - const pre = prev.value.slice(0, idx); - const rest = prev.value.slice(idx + 2); - const posix = POSIX_REGEX_SOURCE$1[rest]; - if (posix) { - prev.value = pre + posix; - state.backtrack = true; - advance(); - - if (!bos.output && tokens.indexOf(prev) === 1) { - bos.output = ONE_CHAR; - } - continue; - } - } - } - } - - if ((value === '[' && peek() !== ':') || (value === '-' && peek() === ']')) { - value = `\\${value}`; - } - - if (value === ']' && (prev.value === '[' || prev.value === '[^')) { - value = `\\${value}`; - } - - if (opts.posix === true && value === '!' && prev.value === '[') { - value = '^'; - } - - prev.value += value; - append({ value }); - continue; - } - - /** - * If we're inside a quoted string, continue - * until we reach the closing double quote. - */ - - if (state.quotes === 1 && value !== '"') { - value = utils$1.escapeRegex(value); - prev.value += value; - append({ value }); + block = push(brace); + stack.push(block); + push({ type: 'open', value }); continue; } /** - * Double quotes + * Right curly brace: '}' */ - if (value === '"') { - state.quotes = state.quotes === 1 ? 0 : 1; - if (opts.keepQuotes === true) { + if (value === CHAR_RIGHT_CURLY_BRACE) { + if (block.type !== 'brace') { push({ type: 'text', value }); - } - continue; - } - - /** - * Parentheses - */ - - if (value === '(') { - increment('parens'); - push({ type: 'paren', value }); - continue; - } - - if (value === ')') { - if (state.parens === 0 && opts.strictBrackets === true) { - throw new SyntaxError(syntaxError('opening', '(')); - } - - const extglob = extglobs[extglobs.length - 1]; - if (extglob && state.parens === extglob.parens + 1) { - extglobClose(extglobs.pop()); - continue; - } - - push({ type: 'paren', value, output: state.parens ? ')' : '\\)' }); - decrement('parens'); - continue; - } - - /** - * Square brackets - */ - - if (value === '[') { - if (opts.nobracket === true || !remaining().includes(']')) { - if (opts.nobracket !== true && opts.strictBrackets === true) { - throw new SyntaxError(syntaxError('closing', ']')); - } - - value = `\\${value}`; - } else { - increment('brackets'); - } - - push({ type: 'bracket', value }); - continue; - } - - if (value === ']') { - if (opts.nobracket === true || (prev && prev.type === 'bracket' && prev.value.length === 1)) { - push({ type: 'text', value, output: `\\${value}` }); continue; } - if (state.brackets === 0) { - if (opts.strictBrackets === true) { - throw new SyntaxError(syntaxError('opening', '[')); - } - - push({ type: 'text', value, output: `\\${value}` }); - continue; - } - - decrement('brackets'); - - const prevValue = prev.value.slice(1); - if (prev.posix !== true && prevValue[0] === '^' && !prevValue.includes('/')) { - value = `/${value}`; - } - - prev.value += value; - append({ value }); - - // when literal brackets are explicitly disabled - // assume we should match with a regex character class - if (opts.literalBrackets === false || utils$1.hasRegexChars(prevValue)) { - continue; - } - - const escaped = utils$1.escapeRegex(prev.value); - state.output = state.output.slice(0, -prev.value.length); - - // when literal brackets are explicitly enabled - // assume we should escape the brackets to match literal characters - if (opts.literalBrackets === true) { - state.output += escaped; - prev.value = escaped; - continue; - } - - // when the user specifies nothing, try to match both - prev.value = `(${capture}${escaped}|${prev.value})`; - state.output += prev.value; - continue; - } - - /** - * Braces - */ - - if (value === '{' && opts.nobrace !== true) { - increment('braces'); - - const open = { - type: 'brace', - value, - output: '(', - outputIndex: state.output.length, - tokensIndex: state.tokens.length - }; - - braces.push(open); - push(open); - continue; - } - - if (value === '}') { - const brace = braces[braces.length - 1]; - - if (opts.nobrace === true || !brace) { - push({ type: 'text', value, output: value }); - continue; - } - - let output = ')'; - - if (brace.dots === true) { - const arr = tokens.slice(); - const range = []; - - for (let i = arr.length - 1; i >= 0; i--) { - tokens.pop(); - if (arr[i].type === 'brace') { - break; - } - if (arr[i].type !== 'dots') { - range.unshift(arr[i].value); - } - } - - output = expandRange(range, opts); - state.backtrack = true; - } - - if (brace.comma !== true && brace.dots !== true) { - const out = state.output.slice(0, brace.outputIndex); - const toks = state.tokens.slice(brace.tokensIndex); - brace.value = brace.output = '\\{'; - value = output = '\\}'; - state.output = out; - for (const t of toks) { - state.output += (t.output || t.value); - } - } - - push({ type: 'brace', value, output }); - decrement('braces'); - braces.pop(); - continue; - } - - /** - * Pipes - */ - - if (value === '|') { - if (extglobs.length > 0) { - extglobs[extglobs.length - 1].conditions++; - } - push({ type: 'text', value }); - continue; - } - - /** - * Commas - */ - - if (value === ',') { - let output = value; - - const brace = braces[braces.length - 1]; - if (brace && stack[stack.length - 1] === 'braces') { - brace.comma = true; - output = '|'; - } - - push({ type: 'comma', value, output }); - continue; - } - - /** - * Slashes - */ - - if (value === '/') { - // if the beginning of the glob is "./", advance the start - // to the current index, and don't add the "./" characters - // to the state. This greatly simplifies lookbehinds when - // checking for BOS characters like "!" and "." (not "./") - if (prev.type === 'dot' && state.index === state.start + 1) { - state.start = state.index + 1; - state.consumed = ''; - state.output = ''; - tokens.pop(); - prev = bos; // reset "prev" to the first token - continue; - } - - push({ type: 'slash', value, output: SLASH_LITERAL }); - continue; - } - - /** - * Dots - */ - - if (value === '.') { - if (state.braces > 0 && prev.type === 'dot') { - if (prev.value === '.') prev.output = DOT_LITERAL; - const brace = braces[braces.length - 1]; - prev.type = 'dots'; - prev.output += value; - prev.value += value; - brace.dots = true; - continue; - } - - if ((state.braces + state.parens) === 0 && prev.type !== 'bos' && prev.type !== 'slash') { - push({ type: 'text', value, output: DOT_LITERAL }); - continue; - } - - push({ type: 'dot', value, output: DOT_LITERAL }); - continue; - } - - /** - * Question marks - */ - - if (value === '?') { - const isGroup = prev && prev.value === '('; - if (!isGroup && opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { - extglobOpen('qmark', value); - continue; - } - - if (prev && prev.type === 'paren') { - const next = peek(); - let output = value; - - if (next === '<' && !utils$1.supportsLookbehinds()) { - throw new Error('Node.js v10 or higher is required for regex lookbehinds'); - } - - if ((prev.value === '(' && !/[!=<:]/.test(next)) || (next === '<' && !/<([!=]|\w+>)/.test(remaining()))) { - output = `\\${value}`; - } - - push({ type: 'text', value, output }); - continue; - } - - if (opts.dot !== true && (prev.type === 'slash' || prev.type === 'bos')) { - push({ type: 'qmark', value, output: QMARK_NO_DOT }); - continue; - } - - push({ type: 'qmark', value, output: QMARK }); - continue; - } - - /** - * Exclamation - */ - - if (value === '!') { - if (opts.noextglob !== true && peek() === '(') { - if (peek(2) !== '?' || !/[!=<:]/.test(peek(3))) { - extglobOpen('negate', value); - continue; - } - } - - if (opts.nonegate !== true && state.index === 0) { - negate(); - continue; - } - } - - /** - * Plus - */ - - if (value === '+') { - if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { - extglobOpen('plus', value); - continue; - } - - if ((prev && prev.value === '(') || opts.regex === false) { - push({ type: 'plus', value, output: PLUS_LITERAL }); - continue; - } - - if ((prev && (prev.type === 'bracket' || prev.type === 'paren' || prev.type === 'brace')) || state.parens > 0) { - push({ type: 'plus', value }); - continue; - } - - push({ type: 'plus', value: PLUS_LITERAL }); - continue; - } - - /** - * Plain text - */ - - if (value === '@') { - if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { - push({ type: 'at', extglob: true, value, output: '' }); - continue; - } - - push({ type: 'text', value }); - continue; - } - - /** - * Plain text - */ - - if (value !== '*') { - if (value === '$' || value === '^') { - value = `\\${value}`; - } - - const match = REGEX_NON_SPECIAL_CHARS.exec(remaining()); - if (match) { - value += match[0]; - state.index += match[0].length; - } - - push({ type: 'text', value }); - continue; - } - - /** - * Stars - */ - - if (prev && (prev.type === 'globstar' || prev.star === true)) { - prev.type = 'star'; - prev.star = true; - prev.value += value; - prev.output = star; - state.backtrack = true; - state.globstar = true; - consume(value); - continue; - } - - let rest = remaining(); - if (opts.noextglob !== true && /^\([^?]/.test(rest)) { - extglobOpen('star', value); - continue; - } - - if (prev.type === 'star') { - if (opts.noglobstar === true) { - consume(value); - continue; - } - - const prior = prev.prev; - const before = prior.prev; - const isStart = prior.type === 'slash' || prior.type === 'bos'; - const afterStar = before && (before.type === 'star' || before.type === 'globstar'); - - if (opts.bash === true && (!isStart || (rest[0] && rest[0] !== '/'))) { - push({ type: 'star', value, output: '' }); - continue; - } - - const isBrace = state.braces > 0 && (prior.type === 'comma' || prior.type === 'brace'); - const isExtglob = extglobs.length && (prior.type === 'pipe' || prior.type === 'paren'); - if (!isStart && prior.type !== 'paren' && !isBrace && !isExtglob) { - push({ type: 'star', value, output: '' }); - continue; - } - - // strip consecutive `/**/` - while (rest.slice(0, 3) === '/**') { - const after = input[state.index + 4]; - if (after && after !== '/') { - break; - } - rest = rest.slice(3); - consume('/**', 3); - } - - if (prior.type === 'bos' && eos()) { - prev.type = 'globstar'; - prev.value += value; - prev.output = globstar(opts); - state.output = prev.output; - state.globstar = true; - consume(value); - continue; - } - - if (prior.type === 'slash' && prior.prev.type !== 'bos' && !afterStar && eos()) { - state.output = state.output.slice(0, -(prior.output + prev.output).length); - prior.output = `(?:${prior.output}`; - - prev.type = 'globstar'; - prev.output = globstar(opts) + (opts.strictSlashes ? ')' : '|$)'); - prev.value += value; - state.globstar = true; - state.output += prior.output + prev.output; - consume(value); - continue; - } - - if (prior.type === 'slash' && prior.prev.type !== 'bos' && rest[0] === '/') { - const end = rest[1] !== void 0 ? '|$' : ''; - - state.output = state.output.slice(0, -(prior.output + prev.output).length); - prior.output = `(?:${prior.output}`; - - prev.type = 'globstar'; - prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`; - prev.value += value; - - state.output += prior.output + prev.output; - state.globstar = true; - - consume(value + advance()); - - push({ type: 'slash', value: '/', output: '' }); - continue; - } - - if (prior.type === 'bos' && rest[0] === '/') { - prev.type = 'globstar'; - prev.value += value; - prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`; - state.output = prev.output; - state.globstar = true; - consume(value + advance()); - push({ type: 'slash', value: '/', output: '' }); - continue; - } - - // remove single star from output - state.output = state.output.slice(0, -prev.output.length); - - // reset previous token to globstar - prev.type = 'globstar'; - prev.output = globstar(opts); - prev.value += value; - - // reset output with globstar - state.output += prev.output; - state.globstar = true; - consume(value); - continue; - } - - const token = { type: 'star', value, output: star }; - - if (opts.bash === true) { - token.output = '.*?'; - if (prev.type === 'bos' || prev.type === 'slash') { - token.output = nodot + token.output; - } - push(token); - continue; - } - - if (prev && (prev.type === 'bracket' || prev.type === 'paren') && opts.regex === true) { - token.output = value; - push(token); - continue; - } - - if (state.index === state.start || prev.type === 'slash' || prev.type === 'dot') { - if (prev.type === 'dot') { - state.output += NO_DOT_SLASH; - prev.output += NO_DOT_SLASH; - - } else if (opts.dot === true) { - state.output += NO_DOTS_SLASH; - prev.output += NO_DOTS_SLASH; - - } else { - state.output += nodot; - prev.output += nodot; - } - - if (peek() !== '*') { - state.output += ONE_CHAR; - prev.output += ONE_CHAR; - } - } - - push(token); - } - - while (state.brackets > 0) { - if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ']')); - state.output = utils$1.escapeLast(state.output, '['); - decrement('brackets'); - } - - while (state.parens > 0) { - if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ')')); - state.output = utils$1.escapeLast(state.output, '('); - decrement('parens'); - } - - while (state.braces > 0) { - if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', '}')); - state.output = utils$1.escapeLast(state.output, '{'); - decrement('braces'); - } - - if (opts.strictSlashes !== true && (prev.type === 'star' || prev.type === 'bracket')) { - push({ type: 'maybe_slash', value: '', output: `${SLASH_LITERAL}?` }); - } - - // rebuild the output if we had to backtrack at any point - if (state.backtrack === true) { - state.output = ''; - - for (const token of state.tokens) { - state.output += token.output != null ? token.output : token.value; - - if (token.suffix) { - state.output += token.suffix; - } - } - } - - return state; -}; - -/** - * Fast paths for creating regular expressions for common glob patterns. - * This can significantly speed up processing and has very little downside - * impact when none of the fast paths match. - */ - -parse$1.fastpaths = (input, options) => { - const opts = { ...options }; - const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH$1, opts.maxLength) : MAX_LENGTH$1; - const len = input.length; - if (len > max) { - throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`); - } - - input = REPLACEMENTS[input] || input; - const win32 = utils$1.isWindows(options); - - // create constants based on platform, for windows or posix - const { - DOT_LITERAL, - SLASH_LITERAL, - ONE_CHAR, - DOTS_SLASH, - NO_DOT, - NO_DOTS, - NO_DOTS_SLASH, - STAR, - START_ANCHOR - } = constants$1.globChars(win32); - - const nodot = opts.dot ? NO_DOTS : NO_DOT; - const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT; - const capture = opts.capture ? '' : '?:'; - const state = { negated: false, prefix: '' }; - let star = opts.bash === true ? '.*?' : STAR; - - if (opts.capture) { - star = `(${star})`; - } - - const globstar = (opts) => { - if (opts.noglobstar === true) return star; - return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`; - }; - - const create = str => { - switch (str) { - case '*': - return `${nodot}${ONE_CHAR}${star}`; - - case '.*': - return `${DOT_LITERAL}${ONE_CHAR}${star}`; - - case '*.*': - return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`; - - case '*/*': - return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`; - - case '**': - return nodot + globstar(opts); - - case '**/*': - return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`; - - case '**/*.*': - return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`; - - case '**/.*': - return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`; - - default: { - const match = /^(.*?)\.(\w+)$/.exec(str); - if (!match) return; - - const source = create(match[1]); - if (!source) return; - - return source + DOT_LITERAL + match[2]; - } - } - }; - - const output = utils$1.removePrefix(input, state); - let source = create(output); - - if (source && opts.strictSlashes !== true) { - source += `${SLASH_LITERAL}?`; - } - - return source; -}; - -var parse_1$1 = parse$1; - -const isObject$1 = val => val && typeof val === 'object' && !Array.isArray(val); - -/** - * Creates a matcher function from one or more glob patterns. The - * returned function takes a string to match as its first argument, - * and returns true if the string is a match. The returned matcher - * function also takes a boolean as the second argument that, when true, - * returns an object with additional information. - * - * ```js - * const picomatch = require('picomatch'); - * // picomatch(glob[, options]); - * - * const isMatch = picomatch('*.!(*a)'); - * console.log(isMatch('a.a')); //=> false - * console.log(isMatch('a.b')); //=> true - * ``` - * @name picomatch - * @param {String|Array} `globs` One or more glob patterns. - * @param {Object=} `options` - * @return {Function=} Returns a matcher function. - * @api public - */ - -const picomatch = (glob, options, returnState = false) => { - if (Array.isArray(glob)) { - const fns = glob.map(input => picomatch(input, options, returnState)); - const arrayMatcher = str => { - for (const isMatch of fns) { - const state = isMatch(str); - if (state) return state; - } - return false; - }; - return arrayMatcher; - } - - const isState = isObject$1(glob) && glob.tokens && glob.input; - - if (glob === '' || (typeof glob !== 'string' && !isState)) { - throw new TypeError('Expected pattern to be a non-empty string'); - } - - const opts = options || {}; - const posix = utils$1.isWindows(options); - const regex = isState - ? picomatch.compileRe(glob, options) - : picomatch.makeRe(glob, options, false, true); - - const state = regex.state; - delete regex.state; - - let isIgnored = () => false; - if (opts.ignore) { - const ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null }; - isIgnored = picomatch(opts.ignore, ignoreOpts, returnState); - } - - const matcher = (input, returnObject = false) => { - const { isMatch, match, output } = picomatch.test(input, regex, options, { glob, posix }); - const result = { glob, state, regex, posix, input, output, match, isMatch }; - - if (typeof opts.onResult === 'function') { - opts.onResult(result); - } - - if (isMatch === false) { - result.isMatch = false; - return returnObject ? result : false; - } - - if (isIgnored(input)) { - if (typeof opts.onIgnore === 'function') { - opts.onIgnore(result); - } - result.isMatch = false; - return returnObject ? result : false; - } - - if (typeof opts.onMatch === 'function') { - opts.onMatch(result); - } - return returnObject ? result : true; - }; - - if (returnState) { - matcher.state = state; - } - - return matcher; -}; - -/** - * Test `input` with the given `regex`. This is used by the main - * `picomatch()` function to test the input string. - * - * ```js - * const picomatch = require('picomatch'); - * // picomatch.test(input, regex[, options]); - * - * console.log(picomatch.test('foo/bar', /^(?:([^/]*?)\/([^/]*?))$/)); - * // { isMatch: true, match: [ 'foo/', 'foo', 'bar' ], output: 'foo/bar' } - * ``` - * @param {String} `input` String to test. - * @param {RegExp} `regex` - * @return {Object} Returns an object with matching info. - * @api public - */ - -picomatch.test = (input, regex, options, { glob, posix } = {}) => { - if (typeof input !== 'string') { - throw new TypeError('Expected input to be a string'); - } - - if (input === '') { - return { isMatch: false, output: '' }; - } - - const opts = options || {}; - const format = opts.format || (posix ? utils$1.toPosixSlashes : null); - let match = input === glob; - let output = (match && format) ? format(input) : input; - - if (match === false) { - output = format ? format(input) : input; - match = output === glob; - } - - if (match === false || opts.capture === true) { - if (opts.matchBase === true || opts.basename === true) { - match = picomatch.matchBase(input, regex, options, posix); - } else { - match = regex.exec(output); - } - } - - return { isMatch: Boolean(match), match, output }; -}; - -/** - * Match the basename of a filepath. - * - * ```js - * const picomatch = require('picomatch'); - * // picomatch.matchBase(input, glob[, options]); - * console.log(picomatch.matchBase('foo/bar.js', '*.js'); // true - * ``` - * @param {String} `input` String to test. - * @param {RegExp|String} `glob` Glob pattern or regex created by [.makeRe](#makeRe). - * @return {Boolean} - * @api public - */ - -picomatch.matchBase = (input, glob, options, posix = utils$1.isWindows(options)) => { - const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options); - return regex.test(path.basename(input)); -}; - -/** - * Returns true if **any** of the given glob `patterns` match the specified `string`. - * - * ```js - * const picomatch = require('picomatch'); - * // picomatch.isMatch(string, patterns[, options]); - * - * console.log(picomatch.isMatch('a.a', ['b.*', '*.a'])); //=> true - * console.log(picomatch.isMatch('a.a', 'b.*')); //=> false - * ``` - * @param {String|Array} str The string to test. - * @param {String|Array} patterns One or more glob patterns to use for matching. - * @param {Object} [options] See available [options](#options). - * @return {Boolean} Returns true if any patterns match `str` - * @api public - */ - -picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str); - -/** - * Parse a glob pattern to create the source string for a regular - * expression. - * - * ```js - * const picomatch = require('picomatch'); - * const result = picomatch.parse(pattern[, options]); - * ``` - * @param {String} `pattern` - * @param {Object} `options` - * @return {Object} Returns an object with useful properties and output to be used as a regex source string. - * @api public - */ - -picomatch.parse = (pattern, options) => { - if (Array.isArray(pattern)) return pattern.map(p => picomatch.parse(p, options)); - return parse_1$1(pattern, { ...options, fastpaths: false }); -}; - -/** - * Scan a glob pattern to separate the pattern into segments. - * - * ```js - * const picomatch = require('picomatch'); - * // picomatch.scan(input[, options]); - * - * const result = picomatch.scan('!./foo/*.js'); - * console.log(result); - * { prefix: '!./', - * input: '!./foo/*.js', - * start: 3, - * base: 'foo', - * glob: '*.js', - * isBrace: false, - * isBracket: false, - * isGlob: true, - * isExtglob: false, - * isGlobstar: false, - * negated: true } - * ``` - * @param {String} `input` Glob pattern to scan. - * @param {Object} `options` - * @return {Object} Returns an object with - * @api public - */ - -picomatch.scan = (input, options) => scan_1(input, options); - -/** - * Create a regular expression from a parsed glob pattern. - * - * ```js - * const picomatch = require('picomatch'); - * const state = picomatch.parse('*.js'); - * // picomatch.compileRe(state[, options]); - * - * console.log(picomatch.compileRe(state)); - * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ - * ``` - * @param {String} `state` The object returned from the `.parse` method. - * @param {Object} `options` - * @return {RegExp} Returns a regex created from the given pattern. - * @api public - */ - -picomatch.compileRe = (parsed, options, returnOutput = false, returnState = false) => { - if (returnOutput === true) { - return parsed.output; - } - - const opts = options || {}; - const prepend = opts.contains ? '' : '^'; - const append = opts.contains ? '' : '$'; - - let source = `${prepend}(?:${parsed.output})${append}`; - if (parsed && parsed.negated === true) { - source = `^(?!${source}).*$`; - } - - const regex = picomatch.toRegex(source, options); - if (returnState === true) { - regex.state = parsed; - } - - return regex; -}; - -picomatch.makeRe = (input, options, returnOutput = false, returnState = false) => { - if (!input || typeof input !== 'string') { - throw new TypeError('Expected a non-empty string'); - } - - const opts = options || {}; - let parsed = { negated: false, fastpaths: true }; - let prefix = ''; - let output; - - if (input.startsWith('./')) { - input = input.slice(2); - prefix = parsed.prefix = './'; - } - - if (opts.fastpaths !== false && (input[0] === '.' || input[0] === '*')) { - output = parse_1$1.fastpaths(input, options); - } - - if (output === undefined) { - parsed = parse_1$1(input, options); - parsed.prefix = prefix + (parsed.prefix || ''); - } else { - parsed.output = output; - } - - return picomatch.compileRe(parsed, options, returnOutput, returnState); -}; - -/** - * Create a regular expression from the given regex source string. - * - * ```js - * const picomatch = require('picomatch'); - * // picomatch.toRegex(source[, options]); - * - * const { output } = picomatch.parse('*.js'); - * console.log(picomatch.toRegex(output)); - * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ - * ``` - * @param {String} `source` Regular expression source string. - * @param {Object} `options` - * @return {RegExp} - * @api public - */ - -picomatch.toRegex = (source, options) => { - try { - const opts = options || {}; - return new RegExp(source, opts.flags || (opts.nocase ? 'i' : '')); - } catch (err) { - if (options && options.debug === true) throw err; - return /$^/; - } -}; - -/** - * Picomatch constants. - * @return {Object} - */ - -picomatch.constants = constants$1; - -/** - * Expose "picomatch" - */ - -var picomatch_1 = picomatch; - -var picomatch$1 = picomatch_1; - -const isEmptyString = val => typeof val === 'string' && (val === '' || val === './'); - -/** - * Returns an array of strings that match one or more glob patterns. - * - * ```js - * const mm = require('micromatch'); - * // mm(list, patterns[, options]); - * - * console.log(mm(['a.js', 'a.txt'], ['*.js'])); - * //=> [ 'a.js' ] - * ``` - * @param {String|Array} list List of strings to match. - * @param {String|Array} patterns One or more glob patterns to use for matching. - * @param {Object} options See available [options](#options) - * @return {Array} Returns an array of matches - * @summary false - * @api public - */ - -const micromatch = (list, patterns, options) => { - patterns = [].concat(patterns); - list = [].concat(list); - - let omit = new Set(); - let keep = new Set(); - let items = new Set(); - let negatives = 0; - - let onResult = state => { - items.add(state.output); - if (options && options.onResult) { - options.onResult(state); - } - }; - - for (let i = 0; i < patterns.length; i++) { - let isMatch = picomatch$1(String(patterns[i]), { ...options, onResult }, true); - let negated = isMatch.state.negated || isMatch.state.negatedExtglob; - if (negated) negatives++; - - for (let item of list) { - let matched = isMatch(item, true); - - let match = negated ? !matched.isMatch : matched.isMatch; - if (!match) continue; - - if (negated) { - omit.add(matched.output); - } else { - omit.delete(matched.output); - keep.add(matched.output); - } - } - } - - let result = negatives === patterns.length ? [...items] : [...keep]; - let matches = result.filter(item => !omit.has(item)); - - if (options && matches.length === 0) { - if (options.failglob === true) { - throw new Error(`No matches found for "${patterns.join(', ')}"`); - } - - if (options.nonull === true || options.nullglob === true) { - return options.unescape ? patterns.map(p => p.replace(/\\/g, '')) : patterns; - } - } - - return matches; -}; - -/** - * Backwards compatibility - */ - -micromatch.match = micromatch; - -/** - * Returns a matcher function from the given glob `pattern` and `options`. - * The returned function takes a string to match as its only argument and returns - * true if the string is a match. - * - * ```js - * const mm = require('micromatch'); - * // mm.matcher(pattern[, options]); - * - * const isMatch = mm.matcher('*.!(*a)'); - * console.log(isMatch('a.a')); //=> false - * console.log(isMatch('a.b')); //=> true - * ``` - * @param {String} `pattern` Glob pattern - * @param {Object} `options` - * @return {Function} Returns a matcher function. - * @api public - */ - -micromatch.matcher = (pattern, options) => picomatch$1(pattern, options); - -/** - * Returns true if **any** of the given glob `patterns` match the specified `string`. - * - * ```js - * const mm = require('micromatch'); - * // mm.isMatch(string, patterns[, options]); - * - * console.log(mm.isMatch('a.a', ['b.*', '*.a'])); //=> true - * console.log(mm.isMatch('a.a', 'b.*')); //=> false - * ``` - * @param {String} str The string to test. - * @param {String|Array} patterns One or more glob patterns to use for matching. - * @param {Object} [options] See available [options](#options). - * @return {Boolean} Returns true if any patterns match `str` - * @api public - */ - -micromatch.isMatch = (str, patterns, options) => picomatch$1(patterns, options)(str); - -/** - * Backwards compatibility - */ - -micromatch.any = micromatch.isMatch; - -/** - * Returns a list of strings that _**do not match any**_ of the given `patterns`. - * - * ```js - * const mm = require('micromatch'); - * // mm.not(list, patterns[, options]); - * - * console.log(mm.not(['a.a', 'b.b', 'c.c'], '*.a')); - * //=> ['b.b', 'c.c'] - * ``` - * @param {Array} `list` Array of strings to match. - * @param {String|Array} `patterns` One or more glob pattern to use for matching. - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Array} Returns an array of strings that **do not match** the given patterns. - * @api public - */ - -micromatch.not = (list, patterns, options = {}) => { - patterns = [].concat(patterns).map(String); - let result = new Set(); - let items = []; - - let onResult = state => { - if (options.onResult) options.onResult(state); - items.push(state.output); - }; - - let matches = micromatch(list, patterns, { ...options, onResult }); - - for (let item of items) { - if (!matches.includes(item)) { - result.add(item); - } - } - return [...result]; -}; - -/** - * Returns true if the given `string` contains the given pattern. Similar - * to [.isMatch](#isMatch) but the pattern can match any part of the string. - * - * ```js - * var mm = require('micromatch'); - * // mm.contains(string, pattern[, options]); - * - * console.log(mm.contains('aa/bb/cc', '*b')); - * //=> true - * console.log(mm.contains('aa/bb/cc', '*d')); - * //=> false - * ``` - * @param {String} `str` The string to match. - * @param {String|Array} `patterns` Glob pattern to use for matching. - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Boolean} Returns true if the patter matches any part of `str`. - * @api public - */ - -micromatch.contains = (str, pattern, options) => { - if (typeof str !== 'string') { - throw new TypeError(`Expected a string: "${util.inspect(str)}"`); - } - - if (Array.isArray(pattern)) { - return pattern.some(p => micromatch.contains(str, p, options)); - } - - if (typeof pattern === 'string') { - if (isEmptyString(str) || isEmptyString(pattern)) { - return false; - } - - if (str.includes(pattern) || (str.startsWith('./') && str.slice(2).includes(pattern))) { - return true; - } - } - - return micromatch.isMatch(str, pattern, { ...options, contains: true }); -}; - -/** - * Filter the keys of the given object with the given `glob` pattern - * and `options`. Does not attempt to match nested keys. If you need this feature, - * use [glob-object][] instead. - * - * ```js - * const mm = require('micromatch'); - * // mm.matchKeys(object, patterns[, options]); - * - * const obj = { aa: 'a', ab: 'b', ac: 'c' }; - * console.log(mm.matchKeys(obj, '*b')); - * //=> { ab: 'b' } - * ``` - * @param {Object} `object` The object with keys to filter. - * @param {String|Array} `patterns` One or more glob patterns to use for matching. - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Object} Returns an object with only keys that match the given patterns. - * @api public - */ - -micromatch.matchKeys = (obj, patterns, options) => { - if (!utils$1.isObject(obj)) { - throw new TypeError('Expected the first argument to be an object'); - } - let keys = micromatch(Object.keys(obj), patterns, options); - let res = {}; - for (let key of keys) res[key] = obj[key]; - return res; -}; - -/** - * Returns true if some of the strings in the given `list` match any of the given glob `patterns`. - * - * ```js - * const mm = require('micromatch'); - * // mm.some(list, patterns[, options]); - * - * console.log(mm.some(['foo.js', 'bar.js'], ['*.js', '!foo.js'])); - * // true - * console.log(mm.some(['foo.js'], ['*.js', '!foo.js'])); - * // false - * ``` - * @param {String|Array} `list` The string or array of strings to test. Returns as soon as the first match is found. - * @param {String|Array} `patterns` One or more glob patterns to use for matching. - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Boolean} Returns true if any patterns match `str` - * @api public - */ - -micromatch.some = (list, patterns, options) => { - let items = [].concat(list); - - for (let pattern of [].concat(patterns)) { - let isMatch = picomatch$1(String(pattern), options); - if (items.some(item => isMatch(item))) { - return true; - } - } - return false; -}; - -/** - * Returns true if every string in the given `list` matches - * any of the given glob `patterns`. - * - * ```js - * const mm = require('micromatch'); - * // mm.every(list, patterns[, options]); - * - * console.log(mm.every('foo.js', ['foo.js'])); - * // true - * console.log(mm.every(['foo.js', 'bar.js'], ['*.js'])); - * // true - * console.log(mm.every(['foo.js', 'bar.js'], ['*.js', '!foo.js'])); - * // false - * console.log(mm.every(['foo.js'], ['*.js', '!foo.js'])); - * // false - * ``` - * @param {String|Array} `list` The string or array of strings to test. - * @param {String|Array} `patterns` One or more glob patterns to use for matching. - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Boolean} Returns true if any patterns match `str` - * @api public - */ - -micromatch.every = (list, patterns, options) => { - let items = [].concat(list); - - for (let pattern of [].concat(patterns)) { - let isMatch = picomatch$1(String(pattern), options); - if (!items.every(item => isMatch(item))) { - return false; - } - } - return true; -}; - -/** - * Returns true if **all** of the given `patterns` match - * the specified string. - * - * ```js - * const mm = require('micromatch'); - * // mm.all(string, patterns[, options]); - * - * console.log(mm.all('foo.js', ['foo.js'])); - * // true - * - * console.log(mm.all('foo.js', ['*.js', '!foo.js'])); - * // false - * - * console.log(mm.all('foo.js', ['*.js', 'foo.js'])); - * // true - * - * console.log(mm.all('foo.js', ['*.js', 'f*', '*o*', '*o.js'])); - * // true - * ``` - * @param {String|Array} `str` The string to test. - * @param {String|Array} `patterns` One or more glob patterns to use for matching. - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Boolean} Returns true if any patterns match `str` - * @api public - */ - -micromatch.all = (str, patterns, options) => { - if (typeof str !== 'string') { - throw new TypeError(`Expected a string: "${util.inspect(str)}"`); - } - - return [].concat(patterns).every(p => picomatch$1(p, options)(str)); -}; - -/** - * Returns an array of matches captured by `pattern` in `string, or `null` if the pattern did not match. - * - * ```js - * const mm = require('micromatch'); - * // mm.capture(pattern, string[, options]); - * - * console.log(mm.capture('test/*.js', 'test/foo.js')); - * //=> ['foo'] - * console.log(mm.capture('test/*.js', 'foo/bar.css')); - * //=> null - * ``` - * @param {String} `glob` Glob pattern to use for matching. - * @param {String} `input` String to match - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Boolean} Returns an array of captures if the input matches the glob pattern, otherwise `null`. - * @api public - */ - -micromatch.capture = (glob, input, options) => { - let posix = utils$1.isWindows(options); - let regex = picomatch$1.makeRe(String(glob), { ...options, capture: true }); - let match = regex.exec(posix ? utils$1.toPosixSlashes(input) : input); - - if (match) { - return match.slice(1).map(v => v === void 0 ? '' : v); - } -}; - -/** - * Create a regular expression from the given glob `pattern`. - * - * ```js - * const mm = require('micromatch'); - * // mm.makeRe(pattern[, options]); - * - * console.log(mm.makeRe('*.js')); - * //=> /^(?:(\.[\\\/])?(?!\.)(?=.)[^\/]*?\.js)$/ - * ``` - * @param {String} `pattern` A glob pattern to convert to regex. - * @param {Object} `options` - * @return {RegExp} Returns a regex created from the given pattern. - * @api public - */ - -micromatch.makeRe = (...args) => picomatch$1.makeRe(...args); - -/** - * Scan a glob pattern to separate the pattern into segments. Used - * by the [split](#split) method. - * - * ```js - * const mm = require('micromatch'); - * const state = mm.scan(pattern[, options]); - * ``` - * @param {String} `pattern` - * @param {Object} `options` - * @return {Object} Returns an object with - * @api public - */ - -micromatch.scan = (...args) => picomatch$1.scan(...args); - -/** - * Parse a glob pattern to create the source string for a regular - * expression. - * - * ```js - * const mm = require('micromatch'); - * const state = mm(pattern[, options]); - * ``` - * @param {String} `glob` - * @param {Object} `options` - * @return {Object} Returns an object with useful properties and output to be used as regex source string. - * @api public - */ - -micromatch.parse = (patterns, options) => { - let res = []; - for (let pattern of [].concat(patterns || [])) { - for (let str of braces_1(String(pattern), options)) { - res.push(picomatch$1.parse(str, options)); - } - } - return res; -}; - -/** - * Process the given brace `pattern`. - * - * ```js - * const { braces } = require('micromatch'); - * console.log(braces('foo/{a,b,c}/bar')); - * //=> [ 'foo/(a|b|c)/bar' ] - * - * console.log(braces('foo/{a,b,c}/bar', { expand: true })); - * //=> [ 'foo/a/bar', 'foo/b/bar', 'foo/c/bar' ] - * ``` - * @param {String} `pattern` String with brace pattern to process. - * @param {Object} `options` Any [options](#options) to change how expansion is performed. See the [braces][] library for all available options. - * @return {Array} - * @api public - */ - -micromatch.braces = (pattern, options) => { - if (typeof pattern !== 'string') throw new TypeError('Expected a string'); - if ((options && options.nobrace === true) || !/\{.*\}/.test(pattern)) { - return [pattern]; - } - return braces_1(pattern, options); -}; - -/** - * Expand braces - */ - -micromatch.braceExpand = (pattern, options) => { - if (typeof pattern !== 'string') throw new TypeError('Expected a string'); - return micromatch.braces(pattern, { ...options, expand: true }); -}; - -/** - * Expose micromatch - */ - -var micromatch_1 = micromatch; - -function ensureArray(thing) { - if (Array.isArray(thing)) - return thing; - if (thing == undefined) - return []; - return [thing]; -} - -function getMatcherString(id, resolutionBase) { - if (resolutionBase === false) { - return id; - } - return resolve(...(typeof resolutionBase === 'string' ? [resolutionBase, id] : [id])); -} -const createFilter = function createFilter(include, exclude, options) { - const resolutionBase = options && options.resolve; - const getMatcher = (id) => { - return id instanceof RegExp - ? id - : { - test: micromatch_1.matcher(getMatcherString(id, resolutionBase) - .split(sep) - .join('/'), { dot: true }) - }; - }; - const includeMatchers = ensureArray(include).map(getMatcher); - const excludeMatchers = ensureArray(exclude).map(getMatcher); - return function (id) { - if (typeof id !== 'string') - return false; - if (/\0/.test(id)) - return false; - id = id.split(sep).join('/'); - for (let i = 0; i < excludeMatchers.length; ++i) { - const matcher = excludeMatchers[i]; - if (matcher.test(id)) - return false; - } - for (let i = 0; i < includeMatchers.length; ++i) { - const matcher = includeMatchers[i]; - if (matcher.test(id)) - return true; - } - return !includeMatchers.length; - }; -}; - -const commandAliases = { - c: 'config', - d: 'dir', - e: 'external', - f: 'format', - g: 'globals', - h: 'help', - i: 'input', - m: 'sourcemap', - n: 'name', - o: 'file', - p: 'plugin', - v: 'version', - w: 'watch' -}; -function mergeOptions(config, rawCommandOptions = { external: [], globals: undefined }, defaultOnWarnHandler = defaultOnWarn) { - const command = getCommandOptions(rawCommandOptions); - const inputOptions = mergeInputOptions(config, command, defaultOnWarnHandler); - const warn = inputOptions.onwarn; - if (command.output) { - Object.assign(command, command.output); - } - const outputOptionsArray = ensureArray$1(config.output); - if (outputOptionsArray.length === 0) - outputOptionsArray.push({}); - const outputOptions = outputOptionsArray.map(singleOutputOptions => mergeOutputOptions(singleOutputOptions, command, warn)); - warnUnknownOptions(command, Object.keys(inputOptions).concat(Object.keys(outputOptions[0]).filter(option => option !== 'sourcemapPathTransform'), Object.keys(commandAliases), 'config', 'environment', 'plugin', 'silent', 'stdin', 'waitForBundleInput'), 'CLI flags', warn, /^_$|output$|config/); - inputOptions.output = outputOptions; - return inputOptions; -} -function getCommandOptions(rawCommandOptions) { - const external = rawCommandOptions.external && typeof rawCommandOptions.external === 'string' - ? rawCommandOptions.external.split(',') - : []; - return { - ...rawCommandOptions, - external, - globals: typeof rawCommandOptions.globals === 'string' - ? rawCommandOptions.globals.split(',').reduce((globals, globalDefinition) => { - const [id, variableName] = globalDefinition.split(':'); - globals[id] = variableName; - if (external.indexOf(id) === -1) { - external.push(id); - } - return globals; - }, Object.create(null)) - : undefined - }; -} -function mergeInputOptions(config, overrides, defaultOnWarnHandler) { - const getOption = (name) => { var _a; return (_a = overrides[name]) !== null && _a !== void 0 ? _a : config[name]; }; - const inputOptions = { - acorn: getOption('acorn'), - acornInjectPlugins: config.acornInjectPlugins, - cache: config.cache, - context: getOption('context'), - experimentalCacheExpiry: getOption('experimentalCacheExpiry'), - external: getExternal(config, overrides), - inlineDynamicImports: getOption('inlineDynamicImports'), - input: getOption('input') || [], - manualChunks: getOption('manualChunks'), - moduleContext: getOption('moduleContext'), - onwarn: getOnWarn(config, defaultOnWarnHandler), - perf: getOption('perf'), - plugins: ensureArray$1(config.plugins), - preserveEntrySignatures: getOption('preserveEntrySignatures'), - preserveModules: getOption('preserveModules'), - preserveSymlinks: getOption('preserveSymlinks'), - shimMissingExports: getOption('shimMissingExports'), - strictDeprecations: getOption('strictDeprecations'), - treeshake: getObjectOption(config, overrides, 'treeshake'), - watch: getWatch(config, overrides, 'watch') - }; - warnUnknownOptions(config, Object.keys(inputOptions), 'input options', inputOptions.onwarn, /^output$/); - return inputOptions; -} -const getExternal = (config, overrides) => { - const configExternal = config.external; - return typeof configExternal === 'function' - ? (source, importer, isResolved) => configExternal(source, importer, isResolved) || overrides.external.indexOf(source) !== -1 - : ensureArray$1(configExternal).concat(overrides.external); -}; -const getOnWarn = (config, defaultOnWarnHandler) => config.onwarn - ? warning => config.onwarn(warning, defaultOnWarnHandler) - : defaultOnWarnHandler; -const getObjectOption = (config, overrides, name) => { - const commandOption = normalizeObjectOptionValue(overrides[name]); - const configOption = normalizeObjectOptionValue(config[name]); - if (commandOption !== undefined) { - return commandOption && { ...configOption, ...commandOption }; - } - return configOption; -}; -const getWatch = (config, overrides, name) => config.watch !== false && getObjectOption(config, overrides, name); -const normalizeObjectOptionValue = (optionValue) => { - if (!optionValue) { - return optionValue; - } - if (Array.isArray(optionValue)) { - return optionValue.reduce((result, value) => value && result && { ...result, ...value }, {}); - } - if (typeof optionValue !== 'object') { - return {}; - } - return optionValue; -}; -function mergeOutputOptions(config, overrides, warn) { - const getOption = (name) => { var _a; return (_a = overrides[name]) !== null && _a !== void 0 ? _a : config[name]; }; - const outputOptions = { - amd: getObjectOption(config, overrides, 'amd'), - assetFileNames: getOption('assetFileNames'), - banner: getOption('banner'), - chunkFileNames: getOption('chunkFileNames'), - compact: getOption('compact'), - dir: getOption('dir'), - dynamicImportFunction: getOption('dynamicImportFunction'), - entryFileNames: getOption('entryFileNames'), - esModule: getOption('esModule'), - exports: getOption('exports'), - extend: getOption('extend'), - externalLiveBindings: getOption('externalLiveBindings'), - file: getOption('file'), - footer: getOption('footer'), - format: getOption('format'), - freeze: getOption('freeze'), - globals: getOption('globals'), - hoistTransitiveImports: getOption('hoistTransitiveImports'), - indent: getOption('indent'), - inlineDynamicImports: getOption('inlineDynamicImports'), - interop: getOption('interop'), - intro: getOption('intro'), - manualChunks: getOption('manualChunks'), - minifyInternalExports: getOption('minifyInternalExports'), - name: getOption('name'), - namespaceToStringTag: getOption('namespaceToStringTag'), - noConflict: getOption('noConflict'), - outro: getOption('outro'), - paths: getOption('paths'), - plugins: ensureArray$1(config.plugins), - preferConst: getOption('preferConst'), - preserveModules: getOption('preserveModules'), - sourcemap: getOption('sourcemap'), - sourcemapExcludeSources: getOption('sourcemapExcludeSources'), - sourcemapFile: getOption('sourcemapFile'), - sourcemapPathTransform: getOption('sourcemapPathTransform'), - strict: getOption('strict'), - systemNullSetters: getOption('systemNullSetters') - }; - warnUnknownOptions(config, Object.keys(outputOptions), 'output options', warn); - return outputOptions; -} - -const { Readable } = stream; - -const { promisify } = util; - - -const readdir = promisify(fs.readdir); -const stat = promisify(fs.stat); -const lstat = promisify(fs.lstat); -const realpath = promisify(fs.realpath); - -/** - * @typedef {Object} EntryInfo - * @property {String} path - * @property {String} fullPath - * @property {fs.Stats=} stats - * @property {fs.Dirent=} dirent - * @property {String} basename - */ - -const BANG = '!'; -const NORMAL_FLOW_ERRORS = new Set(['ENOENT', 'EPERM', 'EACCES', 'ELOOP']); -const FILE_TYPE = 'files'; -const DIR_TYPE = 'directories'; -const FILE_DIR_TYPE = 'files_directories'; -const EVERYTHING_TYPE = 'all'; -const ALL_TYPES = [FILE_TYPE, DIR_TYPE, FILE_DIR_TYPE, EVERYTHING_TYPE]; - -const isNormalFlowError = error => NORMAL_FLOW_ERRORS.has(error.code); - -const normalizeFilter = filter => { - if (filter === undefined) return; - if (typeof filter === 'function') return filter; - - if (typeof filter === 'string') { - const glob = picomatch$1(filter.trim()); - return entry => glob(entry.basename); - } - - if (Array.isArray(filter)) { - const positive = []; - const negative = []; - for (const item of filter) { - const trimmed = item.trim(); - if (trimmed.charAt(0) === BANG) { - negative.push(picomatch$1(trimmed.slice(1))); - } else { - positive.push(picomatch$1(trimmed)); - } - } - - if (negative.length > 0) { - if (positive.length > 0) { - return entry => - positive.some(f => f(entry.basename)) && !negative.some(f => f(entry.basename)); - } - return entry => !negative.some(f => f(entry.basename)); - } - return entry => positive.some(f => f(entry.basename)); - } -}; - -class ReaddirpStream extends Readable { - static get defaultOptions() { - return { - root: '.', - /* eslint-disable no-unused-vars */ - fileFilter: (path) => true, - directoryFilter: (path) => true, - /* eslint-enable no-unused-vars */ - type: FILE_TYPE, - lstat: false, - depth: 2147483648, - alwaysStat: false - }; - } - - constructor(options = {}) { - super({ - objectMode: true, - autoDestroy: true, - highWaterMark: options.highWaterMark || 4096 - }); - const opts = { ...ReaddirpStream.defaultOptions, ...options }; - const { root, type } = opts; - - this._fileFilter = normalizeFilter(opts.fileFilter); - this._directoryFilter = normalizeFilter(opts.directoryFilter); - - const statMethod = opts.lstat ? lstat : stat; - // Use bigint stats if it's windows and stat() supports options (node 10+). - if (process.platform === 'win32' && stat.length === 3) { - this._stat = path => statMethod(path, { bigint: true }); - } else { - this._stat = statMethod; - } - - this._maxDepth = opts.depth; - this._wantsDir = [DIR_TYPE, FILE_DIR_TYPE, EVERYTHING_TYPE].includes(type); - this._wantsFile = [FILE_TYPE, FILE_DIR_TYPE, EVERYTHING_TYPE].includes(type); - this._wantsEverything = type === EVERYTHING_TYPE; - this._root = path.resolve(root); - this._isDirent = ('Dirent' in fs) && !opts.alwaysStat; - this._statsProp = this._isDirent ? 'dirent' : 'stats'; - this._rdOptions = { encoding: 'utf8', withFileTypes: this._isDirent }; - - // Launch stream with one parent, the root dir. - this.parents = [this._exploreDir(root, 1)]; - this.reading = false; - this.parent = undefined; - } - - async _read(batch) { - if (this.reading) return; - this.reading = true; - - try { - while (!this.destroyed && batch > 0) { - const { path, depth, files = [] } = this.parent || {}; - - if (files.length > 0) { - const slice = files.splice(0, batch).map(dirent => this._formatEntry(dirent, path)); - for (const entry of await Promise.all(slice)) { - if (this.destroyed) return; - - const entryType = await this._getEntryType(entry); - if (entryType === 'directory' && this._directoryFilter(entry)) { - if (depth <= this._maxDepth) { - this.parents.push(this._exploreDir(entry.fullPath, depth + 1)); - } - - if (this._wantsDir) { - this.push(entry); - batch--; - } - } else if ((entryType === 'file' || this._includeAsFile(entry)) && this._fileFilter(entry)) { - if (this._wantsFile) { - this.push(entry); - batch--; - } - } - } - } else { - const parent = this.parents.pop(); - if (!parent) { - this.push(null); - break; - } - this.parent = await parent; - if (this.destroyed) return; - } - } - } catch (error) { - this.destroy(error); - } finally { - this.reading = false; - } - } - - async _exploreDir(path, depth) { - let files; - try { - files = await readdir(path, this._rdOptions); - } catch (error) { - this._onError(error); - } - return {files, depth, path}; - } - - async _formatEntry(dirent, path$1) { - let entry; - try { - const basename = this._isDirent ? dirent.name : dirent; - const fullPath = path.resolve(path.join(path$1, basename)); - entry = {path: path.relative(this._root, fullPath), fullPath, basename}; - entry[this._statsProp] = this._isDirent ? dirent : await this._stat(fullPath); - } catch (err) { - this._onError(err); - } - return entry; - } - - _onError(err) { - if (isNormalFlowError(err) && !this.destroyed) { - this.emit('warn', err); - } else { - this.destroy(err); - } - } - - async _getEntryType(entry) { - // entry may be undefined, because a warning or an error were emitted - // and the statsProp is undefined - const stats = entry && entry[this._statsProp]; - if (!stats) { - return; - } - if (stats.isFile()) { - return 'file'; - } - if (stats.isDirectory()) { - return 'directory'; - } - if (stats && stats.isSymbolicLink()) { - try { - const entryRealPath = await realpath(entry.fullPath); - const entryRealPathStats = await lstat(entryRealPath); - if (entryRealPathStats.isFile()) { - return 'file'; - } - if (entryRealPathStats.isDirectory()) { - return 'directory'; - } - } catch (error) { - this._onError(error); - } - } - } + let type = 'close'; + block = stack.pop(); + block.close = true; - _includeAsFile(entry) { - const stats = entry && entry[this._statsProp]; + push({ type, value }); + depth--; - return stats && this._wantsEverything && !stats.isDirectory(); - } -} + block = stack[stack.length - 1]; + continue; + } -/** - * @typedef {Object} ReaddirpArguments - * @property {Function=} fileFilter - * @property {Function=} directoryFilter - * @property {String=} type - * @property {Number=} depth - * @property {String=} root - * @property {Boolean=} lstat - * @property {Boolean=} bigint - */ + /** + * Comma: ',' + */ -/** - * Main function which ends up calling readdirRec and reads all files and directories in given root recursively. - * @param {String} root Root directory - * @param {ReaddirpArguments=} options Options to specify root (start directory), filters and recursion depth - */ -const readdirp = (root, options = {}) => { - let type = options.entryType || options.type; - if (type === 'both') type = FILE_DIR_TYPE; // backwards-compatibility - if (type) options.type = type; - if (!root) { - throw new Error('readdirp: root argument is required. Usage: readdirp(root, options)'); - } else if (typeof root !== 'string') { - throw new TypeError('readdirp: root argument must be a string. Usage: readdirp(root, options)'); - } else if (type && !ALL_TYPES.includes(type)) { - throw new Error(`readdirp: Invalid type passed. Use one of ${ALL_TYPES.join(', ')}`); - } + if (value === CHAR_COMMA && depth > 0) { + if (block.ranges > 0) { + block.ranges = 0; + let open = block.nodes.shift(); + block.nodes = [open, { type: 'text', value: stringify$1(block) }]; + } - options.root = root; - return new ReaddirpStream(options); -}; + push({ type: 'comma', value }); + block.commas++; + continue; + } -const readdirpPromise = (root, options = {}) => { - return new Promise((resolve, reject) => { - const files = []; - readdirp(root, options) - .on('data', entry => files.push(entry)) - .on('end', () => resolve(files)) - .on('error', error => reject(error)); - }); -}; + /** + * Dot: '.' + */ + + if (value === CHAR_DOT && depth > 0 && block.commas === 0) { + let siblings = block.nodes; -readdirp.promise = readdirpPromise; -readdirp.ReaddirpStream = ReaddirpStream; -readdirp.default = readdirp; + if (depth === 0 || siblings.length === 0) { + push({ type: 'text', value }); + continue; + } -var readdirp_1 = readdirp; + if (prev.type === 'dot') { + block.range = []; + prev.value += value; + prev.type = 'range'; -/*! - * normalize-path - * - * Copyright (c) 2014-2018, Jon Schlinkert. - * Released under the MIT License. - */ + if (block.nodes.length !== 3 && block.nodes.length !== 5) { + block.invalid = true; + block.ranges = 0; + prev.type = 'text'; + continue; + } -var normalizePath = function(path, stripTrailing) { - if (typeof path !== 'string') { - throw new TypeError('expected path to be a string'); - } + block.ranges++; + block.args = []; + continue; + } - if (path === '\\' || path === '/') return '/'; + if (prev.type === 'range') { + siblings.pop(); - var len = path.length; - if (len <= 1) return path; + let before = siblings[siblings.length - 1]; + before.value += prev.value + value; + prev = before; + block.ranges--; + continue; + } - // ensure that win32 namespaces has two leading slashes, so that the path is - // handled properly by the win32 version of path.parse() after being normalized - // https://msdn.microsoft.com/library/windows/desktop/aa365247(v=vs.85).aspx#namespaces - var prefix = ''; - if (len > 4 && path[3] === '\\') { - var ch = path[2]; - if ((ch === '?' || ch === '.') && path.slice(0, 2) === '\\\\') { - path = path.slice(2); - prefix = '//'; + push({ type: 'dot', value }); + continue; } - } - var segs = path.split(/[/\\]+/); - if (stripTrailing !== false && segs[segs.length - 1] === '') { - segs.pop(); + /** + * Text + */ + + push({ type: 'text', value }); } - return prefix + segs.join('/'); -}; -var anymatch_1 = createCommonjsModule(function (module, exports) { + // Mark imbalanced braces and brackets as invalid + do { + block = stack.pop(); -Object.defineProperty(exports, "__esModule", { value: true }); + if (block.type !== 'root') { + block.nodes.forEach(node => { + if (!node.nodes) { + if (node.type === 'open') node.isOpen = true; + if (node.type === 'close') node.isClose = true; + if (!node.nodes) node.type = 'text'; + node.invalid = true; + } + }); + // get the location of the block on parent.nodes (block's siblings) + let parent = stack[stack.length - 1]; + let index = parent.nodes.indexOf(block); + // replace the (invalid) block with it's nodes + parent.nodes.splice(index, 1, ...block.nodes); + } + } while (stack.length > 0); + push({ type: 'eos' }); + return ast; +}; +var parse_1 = parse$1; -/** - * @typedef {(testString: string) => boolean} AnymatchFn - * @typedef {string|RegExp|AnymatchFn} AnymatchPattern - * @typedef {AnymatchPattern|AnymatchPattern[]} AnymatchMatcher - */ -const BANG = '!'; -const DEFAULT_OPTIONS = {returnIndex: false}; -const arrify = (item) => Array.isArray(item) ? item : [item]; +const stringify = stringify$4; +const compile = compile_1; +const expand = expand_1; +const parse = parse_1; /** - * @param {AnymatchPattern} matcher - * @param {object} options - * @returns {AnymatchFn} + * Expand the given pattern or create a regex-compatible string. + * + * ```js + * const braces = require('braces'); + * console.log(braces('{a,b,c}', { compile: true })); //=> ['(a|b|c)'] + * console.log(braces('{a,b,c}')); //=> ['a', 'b', 'c'] + * ``` + * @param {String} `str` + * @param {Object} `options` + * @return {String} + * @api public */ -const createPattern = (matcher, options) => { - if (typeof matcher === 'function') { - return matcher; - } - if (typeof matcher === 'string') { - const glob = picomatch$1(matcher, options); - return (string) => matcher === string || glob(string); - } - if (matcher instanceof RegExp) { - return (string) => matcher.test(string); - } - return (string) => false; -}; -/** - * @param {Array} patterns - * @param {Array} negPatterns - * @param {String|Array} args - * @param {Boolean} returnIndex - * @returns {boolean|number} - */ -const matchPatterns = (patterns, negPatterns, args, returnIndex) => { - const isList = Array.isArray(args); - const _path = isList ? args[0] : args; - if (!isList && typeof _path !== 'string') { - throw new TypeError('anymatch: second argument must be a string: got ' + - Object.prototype.toString.call(_path)) - } - const path = normalizePath(_path); +const braces$1 = (input, options = {}) => { + let output = []; - for (let index = 0; index < negPatterns.length; index++) { - const nglob = negPatterns[index]; - if (nglob(path)) { - return returnIndex ? -1 : false; + if (Array.isArray(input)) { + for (let pattern of input) { + let result = braces$1.create(pattern, options); + if (Array.isArray(result)) { + output.push(...result); + } else { + output.push(result); + } } + } else { + output = [].concat(braces$1.create(input, options)); } - const applied = isList && [path].concat(args.slice(1)); - for (let index = 0; index < patterns.length; index++) { - const pattern = patterns[index]; - if (isList ? pattern(...applied) : pattern(path)) { - return returnIndex ? index : true; - } + if (options && options.expand === true && options.nodupes === true) { + output = [...new Set(output)]; } - - return returnIndex ? -1 : false; + return output; }; /** - * @param {AnymatchMatcher} matchers - * @param {Array|string} testString - * @param {object} options - * @returns {boolean|number|Function} + * Parse the given `str` with the given `options`. + * + * ```js + * // braces.parse(pattern, [, options]); + * const ast = braces.parse('a/{b,c}/d'); + * console.log(ast); + * ``` + * @param {String} pattern Brace pattern to parse + * @param {Object} options + * @return {Object} Returns an AST + * @api public */ -const anymatch = (matchers, testString, options = DEFAULT_OPTIONS) => { - if (matchers == null) { - throw new TypeError('anymatch: specify first argument'); - } - const opts = typeof options === 'boolean' ? {returnIndex: options} : options; - const returnIndex = opts.returnIndex || false; - // Early cache for matchers. - const mtchers = arrify(matchers); - const negatedGlobs = mtchers - .filter(item => typeof item === 'string' && item.charAt(0) === BANG) - .map(item => item.slice(1)) - .map(item => picomatch$1(item, opts)); - const patterns = mtchers.map(matcher => createPattern(matcher, opts)); +braces$1.parse = (input, options = {}) => parse(input, options); - if (testString == null) { - return (testString, ri = false) => { - const returnIndex = typeof ri === 'boolean' ? ri : false; - return matchPatterns(patterns, negatedGlobs, testString, returnIndex); - } - } +/** + * Creates a braces string from an AST, or an AST node. + * + * ```js + * const braces = require('braces'); + * let ast = braces.parse('foo/{a,b}/bar'); + * console.log(stringify(ast.nodes[2])); //=> '{a,b}' + * ``` + * @param {String} `input` Brace pattern or AST. + * @param {Object} `options` + * @return {Array} Returns an array of expanded values. + * @api public + */ - return matchPatterns(patterns, negatedGlobs, testString, returnIndex); +braces$1.stringify = (input, options = {}) => { + if (typeof input === 'string') { + return stringify(braces$1.parse(input, options), options); + } + return stringify(input, options); }; -anymatch.default = anymatch; -module.exports = anymatch; -}); - -/*! - * is-extglob +/** + * Compiles a brace pattern into a regex-compatible, optimized string. + * This method is called by the main [braces](#braces) function by default. * - * Copyright (c) 2014-2016, Jon Schlinkert. - * Licensed under the MIT License. + * ```js + * const braces = require('braces'); + * console.log(braces.compile('a/{b,c}/d')); + * //=> ['a/(b|c)/d'] + * ``` + * @param {String} `input` Brace pattern or AST. + * @param {Object} `options` + * @return {Array} Returns an array of expanded values. + * @api public */ -var isExtglob = function isExtglob(str) { - if (typeof str !== 'string' || str === '') { - return false; - } - - var match; - while ((match = /(\\).|([@?!+*]\(.*\))/g.exec(str))) { - if (match[2]) return true; - str = str.slice(match.index + match[0].length); +braces$1.compile = (input, options = {}) => { + if (typeof input === 'string') { + input = braces$1.parse(input, options); } - - return false; + return compile(input, options); }; -/*! - * is-glob +/** + * Expands a brace pattern into an array. This method is called by the + * main [braces](#braces) function when `options.expand` is true. Before + * using this method it's recommended that you read the [performance notes](#performance)) + * and advantages of using [.compile](#compile) instead. * - * Copyright (c) 2014-2017, Jon Schlinkert. - * Released under the MIT License. + * ```js + * const braces = require('braces'); + * console.log(braces.expand('a/{b,c}/d')); + * //=> ['a/b/d', 'a/c/d']; + * ``` + * @param {String} `pattern` Brace pattern + * @param {Object} `options` + * @return {Array} Returns an array of expanded values. + * @api public */ - -var chars = { '{': '}', '(': ')', '[': ']'}; -var strictRegex = /\\(.)|(^!|\*|[\].+)]\?|\[[^\\\]]+\]|\{[^\\}]+\}|\(\?[:!=][^\\)]+\)|\([^|]+\|[^\\)]+\))/; -var relaxedRegex = /\\(.)|(^!|[*?{}()[\]]|\(\?)/; - -var isGlob = function isGlob(str, options) { - if (typeof str !== 'string' || str === '') { - return false; - } - - if (isExtglob(str)) { - return true; +braces$1.expand = (input, options = {}) => { + if (typeof input === 'string') { + input = braces$1.parse(input, options); } - var regex = strictRegex; - var match; + let result = expand(input, options); - // optionally relax regex - if (options && options.strict === false) { - regex = relaxedRegex; + // filter out empty strings if specified + if (options.noempty === true) { + result = result.filter(Boolean); } - while ((match = regex.exec(str))) { - if (match[2]) return true; - var idx = match.index + match[0].length; - - // if an open bracket/brace/paren is escaped, - // set the index to the next closing character - var open = match[1]; - var close = open ? chars[open] : null; - if (open && close) { - var n = str.indexOf(close, idx); - if (n !== -1) { - idx = n + 1; - } - } - - str = str.slice(idx); + // filter out duplicates if specified + if (options.nodupes === true) { + result = [...new Set(result)]; } - return false; -}; - -var pathPosixDirname = path.posix.dirname; -var isWin32 = os.platform() === 'win32'; -var slash = '/'; -var backslash = /\\/g; -var enclosure = /[\{\[].*[\/]*.*[\}\]]$/; -var globby = /(^|[^\\])([\{\[]|\([^\)]+$)/; -var escaped = /\\([\!\*\?\|\[\]\(\)\{\}])/g; + return result; +}; /** - * @param {string} str - * @param {Object} opts - * @param {boolean} [opts.flipBackslashes=true] + * Processes a brace pattern and returns either an expanded array + * (if `options.expand` is true), a highly optimized regex-compatible string. + * This method is called by the main [braces](#braces) function. + * + * ```js + * const braces = require('braces'); + * console.log(braces.create('user-{200..300}/project-{a,b,c}-{1..10}')) + * //=> 'user-(20[0-9]|2[1-9][0-9]|300)/project-(a|b|c)-([1-9]|10)' + * ``` + * @param {String} `pattern` Brace pattern + * @param {Object} `options` + * @return {Array} Returns an array of expanded values. + * @api public */ -var globParent = function globParent(str, opts) { - var options = Object.assign({ flipBackslashes: true }, opts); - // flip windows path separators - if (options.flipBackslashes && isWin32 && str.indexOf(slash) < 0) { - str = str.replace(backslash, slash); +braces$1.create = (input, options = {}) => { + if (input === '' || input.length < 3) { + return [input]; } - // special case for strings ending in enclosure containing path separator - if (enclosure.test(str)) { - str += slash; - } + return options.expand !== true + ? braces$1.compile(input, options) + : braces$1.expand(input, options); +}; - // preserves full path in case of trailing path separator - str += 'a'; +/** + * Expose "braces" + */ - // remove path parts that are globby - do { - str = pathPosixDirname(str); - } while (isGlob(str) || globby.test(str)); +var braces_1 = braces$1; - // remove escape chars and return result - return str.replace(escaped, '$1'); -}; +var binaryExtensions$1 = {exports: {}}; -var binaryExtensions = [ +const require$$0 = [ "3dm", "3ds", "3g2", @@ -4624,6 +2254,7 @@ var binaryExtensions = [ "alz", "ape", "apk", + "appimage", "ar", "arj", "asf", @@ -4680,6 +2311,7 @@ var binaryExtensions = [ "fh", "fla", "flac", + "flatpak", "fli", "flv", "fpx", @@ -4743,10 +2375,14 @@ var binaryExtensions = [ "numbers", "nupkg", "o", + "odp", + "ods", + "odt", "oga", "ogg", "ogv", "otf", + "ott", "pages", "pbm", "pcx", @@ -4784,6 +2420,7 @@ var binaryExtensions = [ "rlc", "rmf", "rmvb", + "rpm", "rtf", "rz", "s3m", @@ -4791,6 +2428,7 @@ var binaryExtensions = [ "scpt", "sgi", "shar", + "snap", "sil", "sketch", "slk", @@ -4862,111 +2500,118 @@ var binaryExtensions = [ "zipx" ]; -var binaryExtensions$1 = { - __proto__: null, - 'default': binaryExtensions -}; - -var require$$0 = getCjsExportFromNamespace(binaryExtensions$1); - -var binaryExtensions$2 = require$$0; - -const extensions = new Set(binaryExtensions$2); - -var isBinaryPath = filePath => extensions.has(path.extname(filePath).slice(1).toLowerCase()); - -var constants$2 = createCommonjsModule(function (module, exports) { - -const {sep} = path; -const {platform} = process; - -exports.EV_ALL = 'all'; -exports.EV_READY = 'ready'; -exports.EV_ADD = 'add'; -exports.EV_CHANGE = 'change'; -exports.EV_ADD_DIR = 'addDir'; -exports.EV_UNLINK = 'unlink'; -exports.EV_UNLINK_DIR = 'unlinkDir'; -exports.EV_RAW = 'raw'; -exports.EV_ERROR = 'error'; - -exports.STR_DATA = 'data'; -exports.STR_END = 'end'; -exports.STR_CLOSE = 'close'; - -exports.FSEVENT_CREATED = 'created'; -exports.FSEVENT_MODIFIED = 'modified'; -exports.FSEVENT_DELETED = 'deleted'; -exports.FSEVENT_MOVED = 'moved'; -exports.FSEVENT_CLONED = 'cloned'; -exports.FSEVENT_UNKNOWN = 'unknown'; -exports.FSEVENT_TYPE_FILE = 'file'; -exports.FSEVENT_TYPE_DIRECTORY = 'directory'; -exports.FSEVENT_TYPE_SYMLINK = 'symlink'; - -exports.KEY_LISTENERS = 'listeners'; -exports.KEY_ERR = 'errHandlers'; -exports.KEY_RAW = 'rawEmitters'; -exports.HANDLER_KEYS = [exports.KEY_LISTENERS, exports.KEY_ERR, exports.KEY_RAW]; - -exports.DOT_SLASH = `.${sep}`; - -exports.BACK_SLASH_RE = /\\/g; -exports.DOUBLE_SLASH_RE = /\/\//; -exports.SLASH_OR_BACK_SLASH_RE = /[/\\]/; -exports.DOT_RE = /\..*\.(sw[px])$|~$|\.subl.*\.tmp/; -exports.REPLACER_RE = /^\.[/\\]/; - -exports.SLASH = '/'; -exports.BRACE_START = '{'; -exports.BANG = '!'; -exports.ONE_DOT = '.'; -exports.TWO_DOTS = '..'; -exports.STAR = '*'; -exports.GLOBSTAR = '**'; -exports.ROOT_GLOBSTAR = '/**/*'; -exports.SLASH_GLOBSTAR = '/**'; -exports.DIR_SUFFIX = 'Dir'; -exports.ANYMATCH_OPTS = {dot: true}; -exports.STRING_TYPE = 'string'; -exports.FUNCTION_TYPE = 'function'; -exports.EMPTY_STR = ''; -exports.EMPTY_FN = () => {}; -exports.IDENTITY_FN = val => val; - -exports.isWindows = platform === 'win32'; -exports.isMacos = platform === 'darwin'; -}); - -const { promisify: promisify$1 } = util; - +(function (module) { + module.exports = require$$0; +} (binaryExtensions$1)); + +const path = require$$0$2; +const binaryExtensions = binaryExtensions$1.exports; + +const extensions = new Set(binaryExtensions); + +var isBinaryPath$1 = filePath => extensions.has(path.extname(filePath).slice(1).toLowerCase()); + +var constants = {}; + +(function (exports) { + + const {sep} = require$$0$2; + const {platform} = process; + const os = require$$2$1; + + exports.EV_ALL = 'all'; + exports.EV_READY = 'ready'; + exports.EV_ADD = 'add'; + exports.EV_CHANGE = 'change'; + exports.EV_ADD_DIR = 'addDir'; + exports.EV_UNLINK = 'unlink'; + exports.EV_UNLINK_DIR = 'unlinkDir'; + exports.EV_RAW = 'raw'; + exports.EV_ERROR = 'error'; + + exports.STR_DATA = 'data'; + exports.STR_END = 'end'; + exports.STR_CLOSE = 'close'; + + exports.FSEVENT_CREATED = 'created'; + exports.FSEVENT_MODIFIED = 'modified'; + exports.FSEVENT_DELETED = 'deleted'; + exports.FSEVENT_MOVED = 'moved'; + exports.FSEVENT_CLONED = 'cloned'; + exports.FSEVENT_UNKNOWN = 'unknown'; + exports.FSEVENT_TYPE_FILE = 'file'; + exports.FSEVENT_TYPE_DIRECTORY = 'directory'; + exports.FSEVENT_TYPE_SYMLINK = 'symlink'; + + exports.KEY_LISTENERS = 'listeners'; + exports.KEY_ERR = 'errHandlers'; + exports.KEY_RAW = 'rawEmitters'; + exports.HANDLER_KEYS = [exports.KEY_LISTENERS, exports.KEY_ERR, exports.KEY_RAW]; + + exports.DOT_SLASH = `.${sep}`; + + exports.BACK_SLASH_RE = /\\/g; + exports.DOUBLE_SLASH_RE = /\/\//; + exports.SLASH_OR_BACK_SLASH_RE = /[/\\]/; + exports.DOT_RE = /\..*\.(sw[px])$|~$|\.subl.*\.tmp/; + exports.REPLACER_RE = /^\.[/\\]/; + + exports.SLASH = '/'; + exports.SLASH_SLASH = '//'; + exports.BRACE_START = '{'; + exports.BANG = '!'; + exports.ONE_DOT = '.'; + exports.TWO_DOTS = '..'; + exports.STAR = '*'; + exports.GLOBSTAR = '**'; + exports.ROOT_GLOBSTAR = '/**/*'; + exports.SLASH_GLOBSTAR = '/**'; + exports.DIR_SUFFIX = 'Dir'; + exports.ANYMATCH_OPTS = {dot: true}; + exports.STRING_TYPE = 'string'; + exports.FUNCTION_TYPE = 'function'; + exports.EMPTY_STR = ''; + exports.EMPTY_FN = () => {}; + exports.IDENTITY_FN = val => val; + + exports.isWindows = platform === 'win32'; + exports.isMacos = platform === 'darwin'; + exports.isLinux = platform === 'linux'; + exports.isIBMi = os.type() === 'OS400'; +} (constants)); + +const fs$2 = require$$0$1; +const sysPath$2 = require$$0$2; +const { promisify: promisify$2 } = require$$2; +const isBinaryPath = isBinaryPath$1; const { - isWindows, - EMPTY_FN, - EMPTY_STR, + isWindows: isWindows$1, + isLinux, + EMPTY_FN: EMPTY_FN$2, + EMPTY_STR: EMPTY_STR$1, KEY_LISTENERS, KEY_ERR, KEY_RAW, HANDLER_KEYS, - EV_CHANGE, - EV_ADD, - EV_ADD_DIR, - EV_ERROR, - STR_DATA, - STR_END, - BRACE_START, - STAR: STAR$1 -} = constants$2; + EV_CHANGE: EV_CHANGE$2, + EV_ADD: EV_ADD$2, + EV_ADD_DIR: EV_ADD_DIR$2, + EV_ERROR: EV_ERROR$2, + STR_DATA: STR_DATA$1, + STR_END: STR_END$2, + BRACE_START: BRACE_START$1, + STAR +} = constants; const THROTTLE_MODE_WATCH = 'watch'; -const open = promisify$1(fs.open); -const stat$1 = promisify$1(fs.stat); -const lstat$1 = promisify$1(fs.lstat); -const close = promisify$1(fs.close); -const fsrealpath = promisify$1(fs.realpath); +const open = promisify$2(fs$2.open); +const stat$2 = promisify$2(fs$2.stat); +const lstat$1 = promisify$2(fs$2.lstat); +const close = promisify$2(fs$2.close); +const fsrealpath = promisify$2(fs$2.realpath); -const statMethods = { lstat: lstat$1, stat: stat$1 }; +const statMethods$1 = { lstat: lstat$1, stat: stat$2 }; // TODO: emit errors properly. Example: EMFILE on Macos. const foreach = (val, fn) => { @@ -5037,21 +2682,21 @@ const FsWatchInstances = new Map(); * @param {Function} emitRaw emits raw event data * @returns {fs.FSWatcher} new fsevents instance */ -function createFsWatchInstance(path$1, options, listener, errHandler, emitRaw) { +function createFsWatchInstance(path, options, listener, errHandler, emitRaw) { const handleEvent = (rawEvent, evPath) => { - listener(path$1); - emitRaw(rawEvent, evPath, {watchedPath: path$1}); + listener(path); + emitRaw(rawEvent, evPath, {watchedPath: path}); // emit based on events occurring for files from a directory's watcher in // case the file's watcher misses it (and rely on throttling to de-dupe) - if (evPath && path$1 !== evPath) { + if (evPath && path !== evPath) { fsWatchBroadcast( - path.resolve(path$1, evPath), KEY_LISTENERS, path.join(path$1, evPath) + sysPath$2.resolve(path, evPath), KEY_LISTENERS, sysPath$2.join(path, evPath) ); } }; try { - return fs.watch(path$1, options, handleEvent); + return fs$2.watch(path, options, handleEvent); } catch (error) { errHandler(error); } @@ -5106,11 +2751,11 @@ const setFsWatchListener = (path, fullPath, options, handlers) => { fsWatchBroadcast.bind(null, fullPath, KEY_RAW) ); if (!watcher) return; - watcher.on(EV_ERROR, async (error) => { + watcher.on(EV_ERROR$2, async (error) => { const broadcastErr = fsWatchBroadcast.bind(null, fullPath, KEY_ERR); cont.watcherUnusable = true; // documented since Node 10.4.1 // Workaround for https://github.com/joyent/node/issues/4337 - if (isWindows && error.code === 'EPERM') { + if (isWindows$1 && error.code === 'EPERM') { try { const fd = await open(path, 'r'); await close(fd); @@ -5170,7 +2815,7 @@ const setFsWatchFileListener = (path, fullPath, options, handlers) => { const copts = cont && cont.options; if (copts && (copts.persistent < options.persistent || copts.interval > options.interval)) { - fs.unwatchFile(fullPath); + fs$2.unwatchFile(fullPath); cont = undefined; } @@ -5187,9 +2832,9 @@ const setFsWatchFileListener = (path, fullPath, options, handlers) => { listeners: listener, rawEmitters: rawEmitter, options, - watcher: fs.watchFile(fullPath, options, (curr, prev) => { + watcher: fs$2.watchFile(fullPath, options, (curr, prev) => { foreach(cont.rawEmitters, (rawEmitter) => { - rawEmitter(EV_CHANGE, fullPath, {curr, prev}); + rawEmitter(EV_CHANGE$2, fullPath, {curr, prev}); }); const currmtime = curr.mtimeMs; if (curr.size !== prev.size || currmtime > prev.mtimeMs || currmtime === 0) { @@ -5208,7 +2853,7 @@ const setFsWatchFileListener = (path, fullPath, options, handlers) => { delFromSet(cont, KEY_RAW, rawEmitter); if (isEmptySet(cont.listeners)) { FsWatchFileInstances.delete(fullPath); - fs.unwatchFile(fullPath); + fs$2.unwatchFile(fullPath); cont.options = cont.watcher = undefined; Object.freeze(cont); } @@ -5218,7 +2863,7 @@ const setFsWatchFileListener = (path, fullPath, options, handlers) => { /** * @mixin */ -class NodeFsHandler { +class NodeFsHandler$1 { /** * @param {import("../index").FSWatcher} fsW @@ -5234,26 +2879,26 @@ constructor(fsW) { * @param {Function} listener on fs change * @returns {Function} closer for the watcher instance */ -_watchWithNodeFs(path$1, listener) { +_watchWithNodeFs(path, listener) { const opts = this.fsw.options; - const directory = path.dirname(path$1); - const basename = path.basename(path$1); + const directory = sysPath$2.dirname(path); + const basename = sysPath$2.basename(path); const parent = this.fsw._getWatchedDir(directory); parent.add(basename); - const absolutePath = path.resolve(path$1); + const absolutePath = sysPath$2.resolve(path); const options = {persistent: opts.persistent}; - if (!listener) listener = EMPTY_FN; + if (!listener) listener = EMPTY_FN$2; let closer; if (opts.usePolling) { options.interval = opts.enableBinaryInterval && isBinaryPath(basename) ? opts.binaryInterval : opts.interval; - closer = setFsWatchFileListener(path$1, absolutePath, options, { + closer = setFsWatchFileListener(path, absolutePath, options, { listener, rawEmitter: this.fsw._emitRaw }); } else { - closer = setFsWatchListener(path$1, absolutePath, options, { + closer = setFsWatchListener(path, absolutePath, options, { listener, errHandler: this._boundHandleError, rawEmitter: this.fsw._emitRaw @@ -5273,8 +2918,8 @@ _handleFile(file, stats, initialAdd) { if (this.fsw.closed) { return; } - const dirname = path.dirname(file); - const basename = path.basename(file); + const dirname = sysPath$2.dirname(file); + const basename = sysPath$2.basename(file); const parent = this.fsw._getWatchedDir(dirname); // stats is always present let prevStats = stats; @@ -5282,40 +2927,47 @@ _handleFile(file, stats, initialAdd) { // if the file is already being watched, do nothing if (parent.has(basename)) return; - // kick off the watcher - const closer = this._watchWithNodeFs(file, async (path, newStats) => { + const listener = async (path, newStats) => { if (!this.fsw._throttle(THROTTLE_MODE_WATCH, file, 5)) return; if (!newStats || newStats.mtimeMs === 0) { try { - const newStats = await stat$1(file); + const newStats = await stat$2(file); if (this.fsw.closed) return; // Check that change event was not fired because of changed only accessTime. const at = newStats.atimeMs; const mt = newStats.mtimeMs; if (!at || at <= mt || mt !== prevStats.mtimeMs) { - this.fsw._emit(EV_CHANGE, file, newStats); + this.fsw._emit(EV_CHANGE$2, file, newStats); + } + if (isLinux && prevStats.ino !== newStats.ino) { + this.fsw._closeFile(path); + prevStats = newStats; + this.fsw._addPathCloser(path, this._watchWithNodeFs(file, listener)); + } else { + prevStats = newStats; } - prevStats = newStats; } catch (error) { // Fix issues where mtime is null but file is still present this.fsw._remove(dirname, basename); } - // add is about to be emitted if file not already tracked in parent + // add is about to be emitted if file not already tracked in parent } else if (parent.has(basename)) { // Check that change event was not fired because of changed only accessTime. const at = newStats.atimeMs; const mt = newStats.mtimeMs; if (!at || at <= mt || mt !== prevStats.mtimeMs) { - this.fsw._emit(EV_CHANGE, file, newStats); + this.fsw._emit(EV_CHANGE$2, file, newStats); } prevStats = newStats; } - }); + }; + // kick off the watcher + const closer = this._watchWithNodeFs(file, listener); // emit an add event if we're supposed to if (!(initialAdd && this.fsw.options.ignoreInitial) && this.fsw._isntIgnored(file)) { - if (!this.fsw._throttle(EV_ADD, file, 0)) return; - this.fsw._emit(EV_ADD, file, stats); + if (!this.fsw._throttle(EV_ADD$2, file, 0)) return; + this.fsw._emit(EV_ADD$2, file, stats); } return closer; @@ -5339,17 +2991,25 @@ async _handleSymlink(entry, directory, path, item) { if (!this.fsw.options.followSymlinks) { // watch symlink directly (don't follow) and detect changes this.fsw._incrReadyCount(); - const linkPath = await fsrealpath(path); + + let linkPath; + try { + linkPath = await fsrealpath(path); + } catch (e) { + this.fsw._emitReady(); + return true; + } + if (this.fsw.closed) return; if (dir.has(item)) { if (this.fsw._symlinkPaths.get(full) !== linkPath) { this.fsw._symlinkPaths.set(full, linkPath); - this.fsw._emit(EV_CHANGE, path, entry.stats); + this.fsw._emit(EV_CHANGE$2, path, entry.stats); } } else { dir.add(item); this.fsw._symlinkPaths.set(full, linkPath); - this.fsw._emit(EV_ADD, path, entry.stats); + this.fsw._emit(EV_ADD$2, path, entry.stats); } this.fsw._emitReady(); return true; @@ -5365,7 +3025,7 @@ async _handleSymlink(entry, directory, path, item) { _handleRead(directory, initialAdd, wh, target, dir, depth, throttler) { // Normalize the directory name on Windows - directory = path.join(directory, EMPTY_STR); + directory = sysPath$2.join(directory, EMPTY_STR$1); if (!wh.hasGlob) { throttler = this.fsw._throttle('readdir', directory, 1000); @@ -5379,16 +3039,16 @@ _handleRead(directory, initialAdd, wh, target, dir, depth, throttler) { fileFilter: entry => wh.filterPath(entry), directoryFilter: entry => wh.filterDir(entry), depth: 0 - }).on(STR_DATA, async (entry) => { + }).on(STR_DATA$1, async (entry) => { if (this.fsw.closed) { stream = undefined; return; } const item = entry.path; - let path$1 = path.join(directory, item); + let path = sysPath$2.join(directory, item); current.add(item); - if (entry.stats.isSymbolicLink() && await this._handleSymlink(entry, directory, path$1, item)) { + if (entry.stats.isSymbolicLink() && await this._handleSymlink(entry, directory, path, item)) { return; } @@ -5403,14 +3063,14 @@ _handleRead(directory, initialAdd, wh, target, dir, depth, throttler) { this.fsw._incrReadyCount(); // ensure relativeness of path is preserved in case of watcher reuse - path$1 = path.join(dir, path.relative(dir, path$1)); + path = sysPath$2.join(dir, sysPath$2.relative(dir, path)); - this._addToNodeFs(path$1, initialAdd, wh, depth + 1); + this._addToNodeFs(path, initialAdd, wh, depth + 1); } - }).on(EV_ERROR, this._boundHandleError); + }).on(EV_ERROR$2, this._boundHandleError); return new Promise(resolve => - stream.once(STR_END, () => { + stream.once(STR_END$2, () => { if (this.fsw.closed) { stream = undefined; return; @@ -5429,7 +3089,7 @@ _handleRead(directory, initialAdd, wh, target, dir, depth, throttler) { // a path may have been filtered out of this readdir, but // shouldn't be removed because it matches a different glob (!wh.hasGlob || wh.filterPath({ - fullPath: path.resolve(directory, item) + fullPath: sysPath$2.resolve(directory, item) })); }).forEach((item) => { this.fsw._remove(directory, item); @@ -5455,14 +3115,14 @@ _handleRead(directory, initialAdd, wh, target, dir, depth, throttler) { * @returns {Promise} closer for the watcher instance. */ async _handleDir(dir, stats, initialAdd, depth, target, wh, realpath) { - const parentDir = this.fsw._getWatchedDir(path.dirname(dir)); - const tracked = parentDir.has(path.basename(dir)); + const parentDir = this.fsw._getWatchedDir(sysPath$2.dirname(dir)); + const tracked = parentDir.has(sysPath$2.basename(dir)); if (!(initialAdd && this.fsw.options.ignoreInitial) && !target && !tracked) { - if (!wh.hasGlob || wh.globFilter(dir)) this.fsw._emit(EV_ADD_DIR, dir, stats); + if (!wh.hasGlob || wh.globFilter(dir)) this.fsw._emit(EV_ADD_DIR$2, dir, stats); } // ensure dir is tracked (harmless if redundant) - parentDir.add(path.basename(dir)); + parentDir.add(sysPath$2.basename(dir)); this.fsw._getWatchedDir(dir); let throttler; let closer; @@ -5494,14 +3154,14 @@ async _handleDir(dir, stats, initialAdd, depth, target, wh, realpath) { * @param {String=} target Child path actually targeted for watch * @returns {Promise} */ -async _addToNodeFs(path$1, initialAdd, priorWh, depth, target) { +async _addToNodeFs(path, initialAdd, priorWh, depth, target) { const ready = this.fsw._emitReady; - if (this.fsw._isIgnored(path$1) || this.fsw.closed) { + if (this.fsw._isIgnored(path) || this.fsw.closed) { ready(); return false; } - const wh = this.fsw._getWatchHelpers(path$1, depth); + const wh = this.fsw._getWatchHelpers(path, depth); if (!wh.hasGlob && priorWh) { wh.hasGlob = priorWh.hasGlob; wh.globFilter = priorWh.globFilter; @@ -5511,64 +3171,69 @@ async _addToNodeFs(path$1, initialAdd, priorWh, depth, target) { // evaluate what is at the path we're being asked to watch try { - const stats = await statMethods[wh.statMethod](wh.watchPath); + const stats = await statMethods$1[wh.statMethod](wh.watchPath); if (this.fsw.closed) return; if (this.fsw._isIgnored(wh.watchPath, stats)) { ready(); return false; } - const follow = this.fsw.options.followSymlinks && !path$1.includes(STAR$1) && !path$1.includes(BRACE_START); + const follow = this.fsw.options.followSymlinks && !path.includes(STAR) && !path.includes(BRACE_START$1); let closer; if (stats.isDirectory()) { - const targetPath = follow ? await fsrealpath(path$1) : path$1; + const absPath = sysPath$2.resolve(path); + const targetPath = follow ? await fsrealpath(path) : path; if (this.fsw.closed) return; closer = await this._handleDir(wh.watchPath, stats, initialAdd, depth, target, wh, targetPath); if (this.fsw.closed) return; // preserve this symlink's target path - if (path$1 !== targetPath && targetPath !== undefined) { - this.fsw._symlinkPaths.set(targetPath, true); + if (absPath !== targetPath && targetPath !== undefined) { + this.fsw._symlinkPaths.set(absPath, targetPath); } } else if (stats.isSymbolicLink()) { - const targetPath = follow ? await fsrealpath(path$1) : path$1; + const targetPath = follow ? await fsrealpath(path) : path; if (this.fsw.closed) return; - const parent = path.dirname(wh.watchPath); + const parent = sysPath$2.dirname(wh.watchPath); this.fsw._getWatchedDir(parent).add(wh.watchPath); - this.fsw._emit(EV_ADD, wh.watchPath, stats); - closer = await this._handleDir(parent, stats, initialAdd, depth, path$1, wh, targetPath); + this.fsw._emit(EV_ADD$2, wh.watchPath, stats); + closer = await this._handleDir(parent, stats, initialAdd, depth, path, wh, targetPath); if (this.fsw.closed) return; // preserve this symlink's target path if (targetPath !== undefined) { - this.fsw._symlinkPaths.set(path.resolve(path$1), targetPath); + this.fsw._symlinkPaths.set(sysPath$2.resolve(path), targetPath); } } else { closer = this._handleFile(wh.watchPath, stats, initialAdd); } ready(); - this.fsw._addPathCloser(path$1, closer); + this.fsw._addPathCloser(path, closer); return false; } catch (error) { if (this.fsw._handleError(error)) { ready(); - return path$1; + return path; } } } } -var nodefsHandler = NodeFsHandler; +var nodefsHandler = NodeFsHandler$1; + +var fseventsHandler = {exports: {}}; -var require$$1 = getCjsExportFromNamespace(fseventsImporter); +const require$$3 = /*@__PURE__*/getAugmentedNamespace(fseventsImporter); -const { promisify: promisify$2 } = util; +const fs$1 = require$$0$1; +const sysPath$1 = require$$0$2; +const { promisify: promisify$1 } = require$$2; let fsevents; try { - fsevents = require$$1.getFsEvents(); + fsevents = require$$3.getFsEvents(); } catch (error) { if (process.env.CHOKIDAR_PRINT_FSEVENTS_REQUIRE_ERROR) console.error(error); } @@ -5589,9 +3254,9 @@ const { EV_ADD: EV_ADD$1, EV_CHANGE: EV_CHANGE$1, EV_ADD_DIR: EV_ADD_DIR$1, - EV_UNLINK, + EV_UNLINK: EV_UNLINK$1, EV_ERROR: EV_ERROR$1, - STR_DATA: STR_DATA$1, + STR_DATA, STR_END: STR_END$1, FSEVENT_CREATED, FSEVENT_MODIFIED, @@ -5606,18 +3271,18 @@ const { ROOT_GLOBSTAR, DIR_SUFFIX, DOT_SLASH, - FUNCTION_TYPE, + FUNCTION_TYPE: FUNCTION_TYPE$1, EMPTY_FN: EMPTY_FN$1, IDENTITY_FN -} = constants$2; +} = constants; const Depth = (value) => isNaN(value) ? {} : {depth: value}; -const stat$2 = promisify$2(fs.stat); -const lstat$2 = promisify$2(fs.lstat); -const realpath$1 = promisify$2(fs.realpath); +const stat$1 = promisify$1(fs$1.stat); +const lstat = promisify$1(fs$1.lstat); +const realpath = promisify$1(fs$1.realpath); -const statMethods$1 = { stat: stat$2, lstat: lstat$2 }; +const statMethods = { stat: stat$1, lstat }; /** * @typedef {String} Path @@ -5665,9 +3330,10 @@ const createFSEventsInstance = (path, callback) => { * @param {Function} rawEmitter - passes data to listeners of the 'raw' event * @returns {Function} closer */ -function setFSEventsListener(path$1, realPath, listener, rawEmitter, fsw) { - let watchPath = path.extname(path$1) ? path.dirname(path$1) : path$1; - const parentPath = path.dirname(watchPath); +function setFSEventsListener(path, realPath, listener, rawEmitter) { + let watchPath = sysPath$1.extname(realPath) ? sysPath$1.dirname(realPath) : realPath; + + const parentPath = sysPath$1.dirname(watchPath); let cont = FSEventsWatchers.get(watchPath); // If we've accumulated a substantial number of paths that @@ -5678,14 +3344,14 @@ function setFSEventsListener(path$1, realPath, listener, rawEmitter, fsw) { watchPath = parentPath; } - const resolvedPath = path.resolve(path$1); + const resolvedPath = sysPath$1.resolve(path); const hasSymlink = resolvedPath !== realPath; const filteredListener = (fullPath, flags, info) => { if (hasSymlink) fullPath = fullPath.replace(realPath, resolvedPath); if ( fullPath === resolvedPath || - !fullPath.indexOf(resolvedPath + path.sep) + !fullPath.indexOf(resolvedPath + sysPath$1.sep) ) listener(fullPath, flags, info); }; @@ -5693,7 +3359,7 @@ function setFSEventsListener(path$1, realPath, listener, rawEmitter, fsw) { // modifies `watchPath` to the parent path when it finds a match let watchedParent = false; for (const watchedPath of FSEventsWatchers.keys()) { - if (realPath.indexOf(path.resolve(watchedPath) + path.sep) === 0) { + if (realPath.indexOf(sysPath$1.resolve(watchedPath) + sysPath$1.sep) === 0) { watchPath = watchedPath; cont = FSEventsWatchers.get(watchPath); watchedParent = true; @@ -5708,7 +3374,7 @@ function setFSEventsListener(path$1, realPath, listener, rawEmitter, fsw) { listeners: new Set([filteredListener]), rawEmitter, watcher: createFSEventsInstance(watchPath, (fullPath, flags) => { - if (fsw.closed) return; + if (!cont.listeners.size) return; const info = fsevents.getInfo(fullPath, flags); cont.listeners.forEach(list => { list(fullPath, flags, info); @@ -5756,9 +3422,9 @@ const couldConsolidate = (path) => { const canUse = () => fsevents && FSEventsWatchers.size < 128; // determines subdirectory traversal levels from root to path -const calcDepth = (path$1, root) => { +const calcDepth = (path, root) => { let i = 0; - while (!path$1.indexOf(root) && (path$1 = path.dirname(path$1)) !== root) i++; + while (!path.indexOf(root) && (path = sysPath$1.dirname(path)) !== root) i++; return i; }; @@ -5773,7 +3439,7 @@ const sameTypes = (info, stats) => ( /** * @mixin */ -class FsEventsHandler { +class FsEventsHandler$1 { /** * @param {import('../index').FSWatcher} fsw @@ -5802,19 +3468,18 @@ addOrChange(path, fullPath, realPath, parent, watchedDir, item, info, opts) { async checkExists(path, fullPath, realPath, parent, watchedDir, item, info, opts) { try { - const stats = await stat$2(path); - if (this.fsw.closed) return; + const stats = await stat$1(path); if (this.fsw.closed) return; if (sameTypes(info, stats)) { this.addOrChange(path, fullPath, realPath, parent, watchedDir, item, info, opts); } else { - this.handleEvent(EV_UNLINK, path, fullPath, realPath, parent, watchedDir, item, info, opts); + this.handleEvent(EV_UNLINK$1, path, fullPath, realPath, parent, watchedDir, item, info, opts); } } catch (error) { if (error.code === 'EACCES') { this.addOrChange(path, fullPath, realPath, parent, watchedDir, item, info, opts); } else { - this.handleEvent(EV_UNLINK, path, fullPath, realPath, parent, watchedDir, item, info, opts); + this.handleEvent(EV_UNLINK$1, path, fullPath, realPath, parent, watchedDir, item, info, opts); } } } @@ -5822,7 +3487,7 @@ async checkExists(path, fullPath, realPath, parent, watchedDir, item, info, opts handleEvent(event, path, fullPath, realPath, parent, watchedDir, item, info, opts) { if (this.fsw.closed || this.checkIgnored(path)) return; - if (event === EV_UNLINK) { + if (event === EV_UNLINK$1) { const isDirectory = info.type === FSEVENT_TYPE_DIRECTORY; // suppress unlink events on never before seen files if (isDirectory || watchedDir.has(item)) { @@ -5862,8 +3527,7 @@ handleEvent(event, path, fullPath, realPath, parent, watchedDir, item, info, opt * @returns {Function} closer for the watcher instance */ _watchWithFsEvents(watchPath, realPath, transform, globFilter) { - if (this.fsw.closed) return; - if (this.fsw._isIgnored(watchPath)) return; + if (this.fsw.closed || this.fsw._isIgnored(watchPath)) return; const opts = this.fsw.options; const watchCallback = async (fullPath, flags, info) => { if (this.fsw.closed) return; @@ -5871,42 +3535,42 @@ _watchWithFsEvents(watchPath, realPath, transform, globFilter) { opts.depth !== undefined && calcDepth(fullPath, realPath) > opts.depth ) return; - const path$1 = transform(path.join( - watchPath, path.relative(watchPath, fullPath) + const path = transform(sysPath$1.join( + watchPath, sysPath$1.relative(watchPath, fullPath) )); - if (globFilter && !globFilter(path$1)) return; + if (globFilter && !globFilter(path)) return; // ensure directories are tracked - const parent = path.dirname(path$1); - const item = path.basename(path$1); + const parent = sysPath$1.dirname(path); + const item = sysPath$1.basename(path); const watchedDir = this.fsw._getWatchedDir( - info.type === FSEVENT_TYPE_DIRECTORY ? path$1 : parent + info.type === FSEVENT_TYPE_DIRECTORY ? path : parent ); // correct for wrong events emitted if (wrongEventFlags.has(flags) || info.event === FSEVENT_UNKNOWN) { - if (typeof opts.ignored === FUNCTION_TYPE) { + if (typeof opts.ignored === FUNCTION_TYPE$1) { let stats; try { - stats = await stat$2(path$1); + stats = await stat$1(path); } catch (error) {} if (this.fsw.closed) return; - if (this.checkIgnored(path$1, stats)) return; + if (this.checkIgnored(path, stats)) return; if (sameTypes(info, stats)) { - this.addOrChange(path$1, fullPath, realPath, parent, watchedDir, item, info, opts); + this.addOrChange(path, fullPath, realPath, parent, watchedDir, item, info, opts); } else { - this.handleEvent(EV_UNLINK, path$1, fullPath, realPath, parent, watchedDir, item, info, opts); + this.handleEvent(EV_UNLINK$1, path, fullPath, realPath, parent, watchedDir, item, info, opts); } } else { - this.checkExists(path$1, fullPath, realPath, parent, watchedDir, item, info, opts); + this.checkExists(path, fullPath, realPath, parent, watchedDir, item, info, opts); } } else { switch (info.event) { case FSEVENT_CREATED: case FSEVENT_MODIFIED: - return this.addOrChange(path$1, fullPath, realPath, parent, watchedDir, item, info, opts); + return this.addOrChange(path, fullPath, realPath, parent, watchedDir, item, info, opts); case FSEVENT_DELETED: case FSEVENT_MOVED: - return this.checkExists(path$1, fullPath, realPath, parent, watchedDir, item, info, opts); + return this.checkExists(path, fullPath, realPath, parent, watchedDir, item, info, opts); } } }; @@ -5915,8 +3579,7 @@ _watchWithFsEvents(watchPath, realPath, transform, globFilter) { watchPath, realPath, watchCallback, - this.fsw._emitRaw, - this.fsw + this.fsw._emitRaw ); this.fsw._emitReady(); @@ -5939,7 +3602,7 @@ async _handleFsEventsSymlink(linkPath, fullPath, transform, curDepth) { this.fsw._incrReadyCount(); try { - const linkTarget = await realpath$1(linkPath); + const linkTarget = await realpath(linkPath); if (this.fsw.closed) return; if (this.fsw._isIgnored(linkTarget)) { return this.fsw._emitReady(); @@ -5949,12 +3612,12 @@ async _handleFsEventsSymlink(linkPath, fullPath, transform, curDepth) { // add the linkTarget for watching with a wrapper for transform // that causes emitted paths to incorporate the link's path - this._addToFsEvents(linkTarget || linkPath, (path$1) => { + this._addToFsEvents(linkTarget || linkPath, (path) => { let aliasedPath = linkPath; if (linkTarget && linkTarget !== DOT_SLASH) { - aliasedPath = path$1.replace(linkTarget, linkPath); - } else if (path$1 !== DOT_SLASH) { - aliasedPath = path.join(linkPath, path$1); + aliasedPath = path.replace(linkTarget, linkPath); + } else if (path !== DOT_SLASH) { + aliasedPath = sysPath$1.join(linkPath, path); } return transform(aliasedPath); }, false, curDepth); @@ -5973,8 +3636,8 @@ async _handleFsEventsSymlink(linkPath, fullPath, transform, curDepth) { emitAdd(newPath, stats, processPath, opts, forceAdd) { const pp = processPath(newPath); const isDir = stats.isDirectory(); - const dirObj = this.fsw._getWatchedDir(path.dirname(pp)); - const base = path.basename(pp); + const dirObj = this.fsw._getWatchedDir(sysPath$1.dirname(pp)); + const base = sysPath$1.basename(pp); // ensure empty dirs get tracked if (isDir) this.fsw._getWatchedDir(pp); @@ -5986,15 +3649,15 @@ emitAdd(newPath, stats, processPath, opts, forceAdd) { } } -initWatch(realPath, path$1, wh, processPath) { +initWatch(realPath, path, wh, processPath) { if (this.fsw.closed) return; const closer = this._watchWithFsEvents( wh.watchPath, - path.resolve(realPath || wh.watchPath), + sysPath$1.resolve(realPath || wh.watchPath), processPath, wh.globFilter ); - this.fsw._addPathCloser(path$1, closer); + this.fsw._addPathCloser(path, closer); } /** @@ -6005,25 +3668,25 @@ initWatch(realPath, path$1, wh, processPath) { * @param {Number=} priorDepth Level of subdirectories already traversed. * @returns {Promise} */ -async _addToFsEvents(path$1, transform, forceAdd, priorDepth) { +async _addToFsEvents(path, transform, forceAdd, priorDepth) { if (this.fsw.closed) { return; } const opts = this.fsw.options; - const processPath = typeof transform === FUNCTION_TYPE ? transform : IDENTITY_FN; + const processPath = typeof transform === FUNCTION_TYPE$1 ? transform : IDENTITY_FN; - const wh = this.fsw._getWatchHelpers(path$1); + const wh = this.fsw._getWatchHelpers(path); // evaluate what is at the path we're being asked to watch try { - const stats = await statMethods$1[wh.statMethod](wh.watchPath); + const stats = await statMethods[wh.statMethod](wh.watchPath); if (this.fsw.closed) return; if (this.fsw._isIgnored(wh.watchPath, stats)) { throw null; } if (stats.isDirectory()) { // emit addDir unless this is a glob parent - if (!wh.globFilter) this.emitAdd(processPath(path$1), stats, processPath, opts, forceAdd); + if (!wh.globFilter) this.emitAdd(processPath(path), stats, processPath, opts, forceAdd); // don't recurse further if it would exceed depth setting if (priorDepth && priorDepth > opts.depth) return; @@ -6033,21 +3696,21 @@ async _addToFsEvents(path$1, transform, forceAdd, priorDepth) { fileFilter: entry => wh.filterPath(entry), directoryFilter: entry => wh.filterDir(entry), ...Depth(opts.depth - (priorDepth || 0)) - }).on(STR_DATA$1, (entry) => { + }).on(STR_DATA, (entry) => { // need to check filterPath on dirs b/c filterDir is less restrictive if (this.fsw.closed) { return; } if (entry.stats.isDirectory() && !wh.filterPath(entry)) return; - const joinedPath = path.join(wh.watchPath, entry.path); + const joinedPath = sysPath$1.join(wh.watchPath, entry.path); const {fullPath} = entry; if (wh.followSymlinks && entry.stats.isSymbolicLink()) { // preserve the current depth here since it can't be derived from // real paths past the symlink const curDepth = opts.depth === undefined ? - undefined : calcDepth(joinedPath, path.resolve(wh.watchPath)) + 1; + undefined : calcDepth(joinedPath, sysPath$1.resolve(wh.watchPath)) + 1; this._handleFsEventsSymlink(joinedPath, fullPath, processPath, curDepth); } else { @@ -6069,51 +3732,50 @@ async _addToFsEvents(path$1, transform, forceAdd, priorDepth) { } if (opts.persistent && forceAdd !== true) { - if (typeof transform === FUNCTION_TYPE) { + if (typeof transform === FUNCTION_TYPE$1) { // realpath has already been resolved - this.initWatch(undefined, path$1, wh, processPath); + this.initWatch(undefined, path, wh, processPath); } else { let realPath; try { - realPath = await realpath$1(wh.watchPath); + realPath = await realpath(wh.watchPath); } catch (e) {} - this.initWatch(realPath, path$1, wh, processPath); + this.initWatch(realPath, path, wh, processPath); } } } } -var fseventsHandler = FsEventsHandler; -var canUse_1 = canUse; -fseventsHandler.canUse = canUse_1; - -const { EventEmitter } = events; - - -const { promisify: promisify$3 } = util; - -const anymatch = anymatch_1.default; - - - - - - - +fseventsHandler.exports = FsEventsHandler$1; +fseventsHandler.exports.canUse = canUse; + +const { EventEmitter } = require$$0$3; +const fs = require$$0$1; +const sysPath = require$$0$2; +const { promisify } = require$$2; +const readdirp = readdirp_1; +const anymatch = anymatch$2.exports.default; +const globParent = globParent$1; +const isGlob = isGlob$2; +const braces = braces_1; +const normalizePath = normalizePath$2; + +const NodeFsHandler = nodefsHandler; +const FsEventsHandler = fseventsHandler.exports; const { EV_ALL, EV_READY, - EV_ADD: EV_ADD$2, - EV_CHANGE: EV_CHANGE$2, - EV_UNLINK: EV_UNLINK$1, - EV_ADD_DIR: EV_ADD_DIR$2, + EV_ADD, + EV_CHANGE, + EV_UNLINK, + EV_ADD_DIR, EV_UNLINK_DIR, EV_RAW, - EV_ERROR: EV_ERROR$2, + EV_ERROR, STR_CLOSE, - STR_END: STR_END$2, + STR_END, BACK_SLASH_RE, DOUBLE_SLASH_RE, @@ -6122,24 +3784,26 @@ const { REPLACER_RE, SLASH, - BRACE_START: BRACE_START$1, - BANG: BANG$1, + SLASH_SLASH, + BRACE_START, + BANG, ONE_DOT, TWO_DOTS, GLOBSTAR, SLASH_GLOBSTAR, ANYMATCH_OPTS, STRING_TYPE, - FUNCTION_TYPE: FUNCTION_TYPE$1, - EMPTY_STR: EMPTY_STR$1, - EMPTY_FN: EMPTY_FN$2, + FUNCTION_TYPE, + EMPTY_STR, + EMPTY_FN, - isWindows: isWindows$1, - isMacos -} = constants$2; + isWindows, + isMacos, + isIBMi +} = constants; -const stat$3 = promisify$3(fs.stat); -const readdir$1 = promisify$3(fs.readdir); +const stat = promisify(fs.stat); +const readdir = promisify(fs.readdir); /** * @typedef {String} Path @@ -6184,31 +3848,40 @@ const unifyPaths = (paths_) => { return paths.map(normalizePathToUnix); }; +// If SLASH_SLASH occurs at the beginning of path, it is not replaced +// because "//StoragePC/DrivePool/Movies" is a valid network path const toUnix = (string) => { let str = string.replace(BACK_SLASH_RE, SLASH); + let prepend = false; + if (str.startsWith(SLASH_SLASH)) { + prepend = true; + } while (str.match(DOUBLE_SLASH_RE)) { str = str.replace(DOUBLE_SLASH_RE, SLASH); } + if (prepend) { + str = SLASH + str; + } return str; }; // Our version of upath.normalize // TODO: this is not equal to path-normalize module - investigate why -const normalizePathToUnix = (path$1) => toUnix(path.normalize(toUnix(path$1))); +const normalizePathToUnix = (path) => toUnix(sysPath.normalize(toUnix(path))); -const normalizeIgnored = (cwd = EMPTY_STR$1) => (path$1) => { - if (typeof path$1 !== STRING_TYPE) return path$1; - return normalizePathToUnix(path.isAbsolute(path$1) ? path$1 : path.join(cwd, path$1)); +const normalizeIgnored = (cwd = EMPTY_STR) => (path) => { + if (typeof path !== STRING_TYPE) return path; + return normalizePathToUnix(sysPath.isAbsolute(path) ? path : sysPath.join(cwd, path)); }; -const getAbsolutePath = (path$1, cwd) => { - if (path.isAbsolute(path$1)) { - return path$1; +const getAbsolutePath = (path, cwd) => { + if (sysPath.isAbsolute(path)) { + return path; } - if (path$1.startsWith(BANG$1)) { - return BANG$1 + path.join(cwd, path$1.slice(1)); + if (path.startsWith(BANG)) { + return BANG + sysPath.join(cwd, path.slice(1)); } - return path.join(cwd, path$1); + return sysPath.join(cwd, path); }; const undef = (opts, key) => opts[key] === undefined; @@ -6244,10 +3917,10 @@ class DirEntry { const dir = this.path; try { - await readdir$1(dir); + await readdir(dir); } catch (err) { if (this._removeWatcher) { - this._removeWatcher(path.dirname(dir), path.basename(dir)); + this._removeWatcher(sysPath.dirname(dir), sysPath.basename(dir)); } } } @@ -6279,17 +3952,17 @@ class DirEntry { const STAT_METHOD_F = 'stat'; const STAT_METHOD_L = 'lstat'; class WatchHelper { - constructor(path$1, watchPath, follow, fsw) { + constructor(path, watchPath, follow, fsw) { this.fsw = fsw; - this.path = path$1 = path$1.replace(REPLACER_RE, EMPTY_STR$1); + this.path = path = path.replace(REPLACER_RE, EMPTY_STR); this.watchPath = watchPath; - this.fullWatchPath = path.resolve(watchPath); - this.hasGlob = watchPath !== path$1; + this.fullWatchPath = sysPath.resolve(watchPath); + this.hasGlob = watchPath !== path; /** @type {object|boolean} */ - if (path$1 === EMPTY_STR$1) this.hasGlob = false; + if (path === EMPTY_STR) this.hasGlob = false; this.globSymlink = this.hasGlob && follow ? undefined : false; - this.globFilter = this.hasGlob ? anymatch(path$1, undefined, ANYMATCH_OPTS) : false; - this.dirParts = this.getDirParts(path$1); + this.globFilter = this.hasGlob ? anymatch(path, undefined, ANYMATCH_OPTS) : false; + this.dirParts = this.getDirParts(path); this.dirParts.forEach((parts) => { if (parts.length > 1) parts.pop(); }); @@ -6313,8 +3986,8 @@ class WatchHelper { } entryPath(entry) { - return path.join(this.watchPath, - path.relative(this.watchPath, this.checkGlobSymlink(entry)) + return sysPath.join(this.watchPath, + sysPath.relative(this.watchPath, this.checkGlobSymlink(entry)) ); } @@ -6322,19 +3995,19 @@ class WatchHelper { const {stats} = entry; if (stats && stats.isSymbolicLink()) return this.filterDir(entry); const resolvedPath = this.entryPath(entry); - const matchesGlob = this.hasGlob && typeof this.globFilter === FUNCTION_TYPE$1 ? + const matchesGlob = this.hasGlob && typeof this.globFilter === FUNCTION_TYPE ? this.globFilter(resolvedPath) : true; return matchesGlob && this.fsw._isntIgnored(resolvedPath, stats) && this.fsw._hasReadPermissions(stats); } - getDirParts(path$1) { + getDirParts(path) { if (!this.hasGlob) return []; const parts = []; - const expandedPath = path$1.includes(BRACE_START$1) ? braces_1.expand(path$1) : [path$1]; - expandedPath.forEach((path$1) => { - parts.push(path.relative(this.watchPath, path$1).split(SLASH_OR_BACK_SLASH_RE)); + const expandedPath = path.includes(BRACE_START) ? braces.expand(path) : [path]; + expandedPath.forEach((path) => { + parts.push(sysPath.relative(this.watchPath, path).split(SLASH_OR_BACK_SLASH_RE)); }); return parts; } @@ -6399,7 +4072,7 @@ constructor(_opts) { if (undef(opts, 'useFsEvents')) opts.useFsEvents = !opts.usePolling; // If we can't use fsevents, ensure the options reflect it's disabled. - const canUseFsEvents = fseventsHandler.canUse(); + const canUseFsEvents = FsEventsHandler.canUse(); if (!canUseFsEvents) opts.useFsEvents = false; // Use polling on Mac if not using fsevents. @@ -6408,6 +4081,11 @@ constructor(_opts) { opts.usePolling = isMacos; } + // Always default to polling on IBM i because fs.watch() is not available on IBM i. + if(isIBMi) { + opts.usePolling = true; + } + // Global override (useful for end-developers that need to force polling for all // instances of chokidar, regardless of usage/dependency depth) const envPoll = process.env.CHOKIDAR_USEPOLLING; @@ -6447,7 +4125,7 @@ constructor(_opts) { this._emitReady = () => { readyCalls++; if (readyCalls >= this._readyCount) { - this._emitReady = EMPTY_FN$2; + this._emitReady = EMPTY_FN; this._readyEmitted = true; // use process.nextTick to allow time for listener to be bound process.nextTick(() => this.emit(EV_READY)); @@ -6459,9 +4137,9 @@ constructor(_opts) { // Initialize with proper watcher. if (opts.useFsEvents) { - this._fsEventsHandler = new fseventsHandler(this); + this._fsEventsHandler = new FsEventsHandler(this); } else { - this._nodeFsHandler = new nodefsHandler(this); + this._nodeFsHandler = new NodeFsHandler(this); } // You’re frozen when your heart’s not open. @@ -6495,7 +4173,7 @@ add(paths_, _origAdd, _internal) { // set aside negated glob strings paths = paths.filter((path) => { - if (path.startsWith(BANG$1)) { + if (path.startsWith(BANG)) { this._ignoredPaths.add(path.slice(1)); return false; } @@ -6527,7 +4205,7 @@ add(paths_, _origAdd, _internal) { ).then(results => { if (this.closed) return; results.filter(item => item).forEach(item => { - this.add(path.dirname(item), path.basename(_origAdd || item)); + this.add(sysPath.dirname(item), sysPath.basename(_origAdd || item)); }); }); } @@ -6545,18 +4223,18 @@ unwatch(paths_) { const paths = unifyPaths(paths_); const {cwd} = this.options; - paths.forEach((path$1) => { + paths.forEach((path) => { // convert to absolute path unless relative path already matches - if (!path.isAbsolute(path$1) && !this._closers.has(path$1)) { - if (cwd) path$1 = path.join(cwd, path$1); - path$1 = path.resolve(path$1); + if (!sysPath.isAbsolute(path) && !this._closers.has(path)) { + if (cwd) path = sysPath.join(cwd, path); + path = sysPath.resolve(path); } - this._closePath(path$1); + this._closePath(path); - this._ignoredPaths.add(path$1); - if (this._watched.has(path$1)) { - this._ignoredPaths.add(path$1 + SLASH_GLOBSTAR); + this._ignoredPaths.add(path); + if (this._watched.has(path)) { + this._ignoredPaths.add(path + SLASH_GLOBSTAR); } // reset the cached userIgnored anymatch fn @@ -6602,7 +4280,7 @@ close() { getWatched() { const watchList = {}; this._watched.forEach((entry, dir) => { - const key = this.options.cwd ? path.relative(this.options.cwd, dir) : dir; + const key = this.options.cwd ? sysPath.relative(this.options.cwd, dir) : dir; watchList[key || ONE_DOT] = entry.getChildren().sort(); }); return watchList; @@ -6610,7 +4288,7 @@ getWatched() { emitWithAll(event, args) { this.emit(...args); - if (event !== EV_ERROR$2) this.emit(EV_ALL, ...args); + if (event !== EV_ERROR) this.emit(EV_ALL, ...args); } // Common helpers @@ -6626,28 +4304,28 @@ emitWithAll(event, args) { * @param {*=} val3 * @returns the error if defined, otherwise the value of the FSWatcher instance's `closed` flag */ -async _emit(event, path$1, val1, val2, val3) { +async _emit(event, path, val1, val2, val3) { if (this.closed) return; const opts = this.options; - if (isWindows$1) path$1 = path.normalize(path$1); - if (opts.cwd) path$1 = path.relative(opts.cwd, path$1); + if (isWindows) path = sysPath.normalize(path); + if (opts.cwd) path = sysPath.relative(opts.cwd, path); /** @type Array */ - const args = [event, path$1]; + const args = [event, path]; if (val3 !== undefined) args.push(val1, val2, val3); else if (val2 !== undefined) args.push(val1, val2); else if (val1 !== undefined) args.push(val1); const awf = opts.awaitWriteFinish; let pw; - if (awf && (pw = this._pendingWrites.get(path$1))) { + if (awf && (pw = this._pendingWrites.get(path))) { pw.lastChange = new Date(); return this; } if (opts.atomic) { - if (event === EV_UNLINK$1) { - this._pendingUnlinks.set(path$1, args); + if (event === EV_UNLINK) { + this._pendingUnlinks.set(path, args); setTimeout(() => { this._pendingUnlinks.forEach((entry, path) => { this.emit(...entry); @@ -6657,16 +4335,16 @@ async _emit(event, path$1, val1, val2, val3) { }, typeof opts.atomic === 'number' ? opts.atomic : 100); return this; } - if (event === EV_ADD$2 && this._pendingUnlinks.has(path$1)) { - event = args[0] = EV_CHANGE$2; - this._pendingUnlinks.delete(path$1); + if (event === EV_ADD && this._pendingUnlinks.has(path)) { + event = args[0] = EV_CHANGE; + this._pendingUnlinks.delete(path); } } - if (awf && (event === EV_ADD$2 || event === EV_CHANGE$2) && this._readyEmitted) { + if (awf && (event === EV_ADD || event === EV_CHANGE) && this._readyEmitted) { const awfEmit = (err, stats) => { if (err) { - event = args[0] = EV_ERROR$2; + event = args[0] = EV_ERROR; args[1] = err; this.emitWithAll(event, args); } else if (stats) { @@ -6680,22 +4358,22 @@ async _emit(event, path$1, val1, val2, val3) { } }; - this._awaitWriteFinish(path$1, awf.stabilityThreshold, event, awfEmit); + this._awaitWriteFinish(path, awf.stabilityThreshold, event, awfEmit); return this; } - if (event === EV_CHANGE$2) { - const isThrottled = !this._throttle(EV_CHANGE$2, path$1, 50); + if (event === EV_CHANGE) { + const isThrottled = !this._throttle(EV_CHANGE, path, 50); if (isThrottled) return this; } if (opts.alwaysStat && val1 === undefined && - (event === EV_ADD$2 || event === EV_ADD_DIR$2 || event === EV_CHANGE$2) + (event === EV_ADD || event === EV_ADD_DIR || event === EV_CHANGE) ) { - const fullPath = opts.cwd ? path.join(opts.cwd, path$1) : path$1; + const fullPath = opts.cwd ? sysPath.join(opts.cwd, path) : path; let stats; try { - stats = await stat$3(fullPath); + stats = await stat(fullPath); } catch (err) {} // Suppress event when fs_stat fails, to avoid sending undefined 'stat' if (!stats || this.closed) return; @@ -6716,7 +4394,7 @@ _handleError(error) { if (error && code !== 'ENOENT' && code !== 'ENOTDIR' && (!this.options.ignorePermissionErrors || (code !== 'EPERM' && code !== 'EACCES')) ) { - this.emit(EV_ERROR$2, error); + this.emit(EV_ERROR, error); } return error || this.closed; } @@ -6770,19 +4448,19 @@ _incrReadyCount() { * @param {EventName} event * @param {Function} awfEmit Callback to be called when ready for event to be emitted. */ -_awaitWriteFinish(path$1, threshold, event, awfEmit) { +_awaitWriteFinish(path, threshold, event, awfEmit) { let timeoutHandler; - let fullPath = path$1; - if (this.options.cwd && !path.isAbsolute(path$1)) { - fullPath = path.join(this.options.cwd, path$1); + let fullPath = path; + if (this.options.cwd && !sysPath.isAbsolute(path)) { + fullPath = sysPath.join(this.options.cwd, path); } const now = new Date(); const awaitWriteFinish = (prevStat) => { fs.stat(fullPath, (err, curStat) => { - if (err || !this._pendingWrites.has(path$1)) { + if (err || !this._pendingWrites.has(path)) { if (err && err.code !== 'ENOENT') awfEmit(err); return; } @@ -6790,13 +4468,13 @@ _awaitWriteFinish(path$1, threshold, event, awfEmit) { const now = Number(new Date()); if (prevStat && curStat.size !== prevStat.size) { - this._pendingWrites.get(path$1).lastChange = now; + this._pendingWrites.get(path).lastChange = now; } - const pw = this._pendingWrites.get(path$1); + const pw = this._pendingWrites.get(path); const df = now - pw.lastChange; if (df >= threshold) { - this._pendingWrites.delete(path$1); + this._pendingWrites.delete(path); awfEmit(undefined, curStat); } else { timeoutHandler = setTimeout( @@ -6808,11 +4486,11 @@ _awaitWriteFinish(path$1, threshold, event, awfEmit) { }); }; - if (!this._pendingWrites.has(path$1)) { - this._pendingWrites.set(path$1, { + if (!this._pendingWrites.has(path)) { + this._pendingWrites.set(path, { lastChange: now, cancelWait: () => { - this._pendingWrites.delete(path$1); + this._pendingWrites.delete(path); clearTimeout(timeoutHandler); return event; } @@ -6878,7 +4556,7 @@ _getWatchHelpers(path, depth) { */ _getWatchedDir(directory) { if (!this._boundRemove) this._boundRemove = this._remove.bind(this); - const dir = path.resolve(directory); + const dir = sysPath.resolve(directory); if (!this._watched.has(dir)) this._watched.set(dir, new DirEntry(dir, this._boundRemove)); return this._watched.get(dir); } @@ -6914,15 +4592,15 @@ _remove(directory, item, isDirectory) { // if what is being deleted is a directory, get that directory's paths // for recursive deleting and cleaning of watched object // if it is not a directory, nestedDirectoryChildren will be empty array - const path$1 = path.join(directory, item); - const fullPath = path.resolve(path$1); + const path = sysPath.join(directory, item); + const fullPath = sysPath.resolve(path); isDirectory = isDirectory != null ? isDirectory - : this._watched.has(path$1) || this._watched.has(fullPath); + : this._watched.has(path) || this._watched.has(fullPath); // prevent duplicate handling in case of arriving here nearly simultaneously // via multiple paths (such as _handleFile and _handleDir) - if (!this._throttle('remove', path$1, 100)) return; + if (!this._throttle('remove', path, 100)) return; // if the only watched file is removed, watch for its return if (!isDirectory && !this.options.useFsEvents && this._watched.size === 1) { @@ -6931,49 +4609,66 @@ _remove(directory, item, isDirectory) { // This will create a new entry in the watched object in either case // so we got to do the directory check beforehand - const wp = this._getWatchedDir(path$1); + const wp = this._getWatchedDir(path); const nestedDirectoryChildren = wp.getChildren(); // Recursively remove children directories / files. - nestedDirectoryChildren.forEach(nested => this._remove(path$1, nested)); + nestedDirectoryChildren.forEach(nested => this._remove(path, nested)); // Check if item was on the watched list and remove it const parent = this._getWatchedDir(directory); const wasTracked = parent.has(item); parent.remove(item); + // Fixes issue #1042 -> Relative paths were detected and added as symlinks + // (https://github.com/paulmillr/chokidar/blob/e1753ddbc9571bdc33b4a4af172d52cb6e611c10/lib/nodefs-handler.js#L612), + // but never removed from the map in case the path was deleted. + // This leads to an incorrect state if the path was recreated: + // https://github.com/paulmillr/chokidar/blob/e1753ddbc9571bdc33b4a4af172d52cb6e611c10/lib/nodefs-handler.js#L553 + if (this._symlinkPaths.has(fullPath)) { + this._symlinkPaths.delete(fullPath); + } + // If we wait for this file to be fully written, cancel the wait. - let relPath = path$1; - if (this.options.cwd) relPath = path.relative(this.options.cwd, path$1); + let relPath = path; + if (this.options.cwd) relPath = sysPath.relative(this.options.cwd, path); if (this.options.awaitWriteFinish && this._pendingWrites.has(relPath)) { const event = this._pendingWrites.get(relPath).cancelWait(); - if (event === EV_ADD$2) return; + if (event === EV_ADD) return; } // The Entry will either be a directory that just got removed // or a bogus entry to a file, in either case we have to remove it - this._watched.delete(path$1); + this._watched.delete(path); this._watched.delete(fullPath); - const eventName = isDirectory ? EV_UNLINK_DIR : EV_UNLINK$1; - if (wasTracked && !this._isIgnored(path$1)) this._emit(eventName, path$1); + const eventName = isDirectory ? EV_UNLINK_DIR : EV_UNLINK; + if (wasTracked && !this._isIgnored(path)) this._emit(eventName, path); // Avoid conflicts if we later create another file with the same name if (!this.options.useFsEvents) { - this._closePath(path$1); + this._closePath(path); } } /** - * + * Closes all watchers for a path + * @param {Path} path + */ +_closePath(path) { + this._closeFile(path); + const dir = sysPath.dirname(path); + this._getWatchedDir(dir).remove(sysPath.basename(path)); +} + +/** + * Closes only file-specific watchers * @param {Path} path */ -_closePath(path$1) { - const closers = this._closers.get(path$1); +_closeFile(path) { + const closers = this._closers.get(path); if (!closers) return; closers.forEach(closer => closer()); - this._closers.delete(path$1); - const dir = path.dirname(path$1); - this._getWatchedDir(dir).remove(path.basename(path$1)); + this._closers.delete(path); } /** @@ -6994,12 +4689,12 @@ _addPathCloser(path, closer) { _readdirp(root, opts) { if (this.closed) return; const options = {type: EV_ALL, alwaysStat: true, lstat: true, ...opts}; - let stream = readdirp_1(root, options); + let stream = readdirp(root, options); this._streams.add(stream); stream.once(STR_CLOSE, () => { stream = undefined; }); - stream.once(STR_END$2, () => { + stream.once(STR_END, () => { if (stream) { this._streams.delete(stream); stream = undefined; @@ -7011,7 +4706,7 @@ _readdirp(root, opts) { } // Export FSWatcher class -var FSWatcher_1 = FSWatcher; +chokidar.FSWatcher = FSWatcher; /** * Instantiates watcher with paths to be tracked. @@ -7025,12 +4720,7 @@ const watch = (paths, options) => { return watcher; }; -var watch_1 = watch; - -var chokidar = { - FSWatcher: FSWatcher_1, - watch: watch_1 -}; +chokidar.watch = watch; class FileWatcher { constructor(task, chokidarOptions) { @@ -7054,8 +4744,9 @@ class FileWatcher { } } watch(id, isTransformDependency) { + var _a; if (isTransformDependency) { - const watcher = this.transformWatchers.get(id) || this.createWatcher(id); + const watcher = (_a = this.transformWatchers.get(id)) !== null && _a !== void 0 ? _a : this.createWatcher(id); watcher.add(id); this.transformWatchers.set(id, watcher); } @@ -7067,7 +4758,7 @@ class FileWatcher { const task = this.task; const isLinux = platform() === 'linux'; const isTransformDependency = transformWatcherId !== null; - const handleChange = (id) => { + const handleChange = (id, event) => { const changedId = transformWatcherId || id; if (isLinux) { // unwatching and watching fixes an issue with chokidar where on certain systems, @@ -7076,45 +4767,72 @@ class FileWatcher { watcher.unwatch(changedId); watcher.add(changedId); } - task.invalidate(changedId, isTransformDependency); + task.invalidate(changedId, { event, isTransformDependency }); }; const watcher = chokidar .watch([], this.chokidarOptions) - .on('change', handleChange) - .on('unlink', handleChange); + .on('add', id => handleChange(id, 'create')) + .on('change', id => handleChange(id, 'update')) + .on('unlink', id => handleChange(id, 'delete')); return watcher; } } +const eventsRewrites = { + create: { + create: 'buggy', + delete: null, + update: 'create' + }, + delete: { + create: 'update', + delete: 'buggy', + update: 'buggy' + }, + update: { + create: 'buggy', + delete: 'delete', + update: 'update' + } +}; class Watcher { constructor(configs, emitter) { this.buildDelay = 0; this.buildTimeout = null; - this.invalidatedIds = new Set(); + this.invalidatedIds = new Map(); this.rerun = false; + this.running = true; this.emitter = emitter; emitter.close = this.close.bind(this); this.tasks = configs.map(config => new Task(this, config)); this.buildDelay = configs.reduce((buildDelay, { watch }) => watch && typeof watch.buildDelay === 'number' ? Math.max(buildDelay, watch.buildDelay) : buildDelay, this.buildDelay); - this.running = true; - process.nextTick(() => this.run()); + process$1.nextTick(() => this.run()); } - close() { + async close() { if (this.buildTimeout) clearTimeout(this.buildTimeout); for (const task of this.tasks) { task.close(); } + await this.emitter.emitAndAwait('close'); this.emitter.removeAllListeners(); } - emit(event, value) { - this.emitter.emit(event, value); - } - invalidate(id) { - if (id) { - this.invalidatedIds.add(id); + invalidate(file) { + if (file) { + const prevEvent = this.invalidatedIds.get(file.id); + const event = prevEvent ? eventsRewrites[prevEvent][file.event] : file.event; + if (event === 'buggy') { + //TODO: throws or warn? Currently just ignore, uses new event + this.invalidatedIds.set(file.id, file.event); + } + else if (event === null) { + this.invalidatedIds.delete(file.id); + } + else { + this.invalidatedIds.set(file.id, event); + } } if (this.running) { this.rerun = true; @@ -7122,37 +4840,40 @@ class Watcher { } if (this.buildTimeout) clearTimeout(this.buildTimeout); - this.buildTimeout = setTimeout(() => { + this.buildTimeout = setTimeout(async () => { this.buildTimeout = null; - for (const id of this.invalidatedIds) { - this.emit('change', id); + try { + await Promise.all([...this.invalidatedIds].map(([id, event]) => this.emitter.emitAndAwait('change', id, { event }))); + this.invalidatedIds.clear(); + this.emitter.emit('restart'); + this.emitter.removeAwaited(); + this.run(); + } + catch (error) { + this.invalidatedIds.clear(); + this.emitter.emit('event', { + code: 'ERROR', + error, + result: null + }); + this.emitter.emit('event', { + code: 'END' + }); } - this.invalidatedIds.clear(); - this.emit('restart'); - this.run(); }, this.buildDelay); } async run() { this.running = true; - this.emit('event', { + this.emitter.emit('event', { code: 'START' }); - try { - for (const task of this.tasks) { - await task.run(); - } - this.running = false; - this.emit('event', { - code: 'END' - }); - } - catch (error) { - this.running = false; - this.emit('event', { - code: 'ERROR', - error - }); + for (const task of this.tasks) { + await task.run(); } + this.running = false; + this.emitter.emit('event', { + code: 'END' + }); if (this.rerun) { this.rerun = false; this.invalidate(); @@ -7163,11 +4884,11 @@ class Task { constructor(watcher, config) { this.cache = { modules: [] }; this.watchFiles = []; - this.invalidated = true; - this.watcher = watcher; this.closed = false; + this.invalidated = true; this.watched = new Set(); - this.skipWrite = config.watch && !!config.watch.skipWrite; + this.watcher = watcher; + this.skipWrite = Boolean(config.watch && config.watch.skipWrite); this.options = mergeOptions(config); this.outputs = this.options.output; this.outputFiles = this.outputs.map(output => { @@ -7187,17 +4908,17 @@ class Task { this.closed = true; this.fileWatcher.close(); } - invalidate(id, isTransformDependency) { + invalidate(id, details) { this.invalidated = true; - if (isTransformDependency) { + if (details.isTransformDependency) { for (const module of this.cache.modules) { - if (module.transformDependencies.indexOf(id) === -1) + if (!module.transformDependencies.includes(id)) continue; // effective invalidation module.originalCode = null; } } - this.watcher.invalidate(id); + this.watcher.invalidate({ event: details.event, id }); } async run() { if (!this.invalidated) @@ -7208,19 +4929,20 @@ class Task { cache: this.cache }; const start = Date.now(); - this.watcher.emit('event', { + this.watcher.emitter.emit('event', { code: 'BUNDLE_START', input: this.options.input, output: this.outputFiles }); + let result = null; try { - const result = await rollupInternal(options, this.watcher.emitter); + result = await rollupInternal(options, this.watcher.emitter); if (this.closed) { return; } this.updateWatchedFiles(result); this.skipWrite || (await Promise.all(this.outputs.map(output => result.write(output)))); - this.watcher.emit('event', { + this.watcher.emitter.emit('event', { code: 'BUNDLE_END', duration: Date.now() - start, input: this.options.input, @@ -7229,18 +4951,21 @@ class Task { }); } catch (error) { - if (this.closed) { - return; - } - if (Array.isArray(error.watchFiles)) { - for (const id of error.watchFiles) { - this.watchFile(id); + if (!this.closed) { + if (Array.isArray(error.watchFiles)) { + for (const id of error.watchFiles) { + this.watchFile(id); + } + } + if (error.id) { + this.cache.modules = this.cache.modules.filter(module => module.id !== error.id); } } - if (error.id) { - this.cache.modules = this.cache.modules.filter(module => module.id !== error.id); - } - throw error; + this.watcher.emitter.emit('event', { + code: 'ERROR', + error, + result + }); } } updateWatchedFiles(result) { diff --git a/node_modules/rollup/dist/loadConfigFile.js b/node_modules/rollup/dist/loadConfigFile.js index ef8b454e047a..125d0004f829 100644 --- a/node_modules/rollup/dist/loadConfigFile.js +++ b/node_modules/rollup/dist/loadConfigFile.js @@ -1,8 +1,7 @@ /* @license - Rollup.js v2.18.0 - Mon, 22 Jun 2020 04:16:05 GMT - commit ee6ef99935fbd24a3e30ef05b0b98e4019f983c6 - + Rollup.js v2.79.1 + Thu, 22 Sep 2022 04:55:29 GMT - commit 69ff4181e701a0fe0026d0ba147f31bc86beffa8 https://github.com/rollup/rollup @@ -10,14 +9,17 @@ */ 'use strict'; -require('./shared/rollup.js'); require('path'); +require('process'); +require('url'); +const loadConfigFile_js = require('./shared/loadConfigFile.js'); +require('./shared/rollup.js'); require('./shared/mergeOptions.js'); -var loadConfigFile_js = require('./shared/loadConfigFile.js'); +require('tty'); +require('perf_hooks'); require('crypto'); require('fs'); require('events'); -require('url'); diff --git a/node_modules/rollup/dist/rollup.browser.js b/node_modules/rollup/dist/rollup.browser.js index faa50daf596c..16f66c2bc360 100644 --- a/node_modules/rollup/dist/rollup.browser.js +++ b/node_modules/rollup/dist/rollup.browser.js @@ -1,11 +1,11 @@ /* @license - Rollup.js v2.18.0 - Mon, 22 Jun 2020 04:16:05 GMT - commit ee6ef99935fbd24a3e30ef05b0b98e4019f983c6 - + Rollup.js v2.79.1 + Thu, 22 Sep 2022 04:55:29 GMT - commit 69ff4181e701a0fe0026d0ba147f31bc86beffa8 https://github.com/rollup/rollup Released under the MIT License. */ -var e,t;e=this,t=function(e){for(var t={},s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",i=0;i>>=5)>0&&(i|=32),t+=s[i]}while(e>0);return t}var a=function e(t){this.bits=t instanceof e?t.bits.slice():[]};a.prototype.add=function(e){this.bits[e>>5]|=1<<(31&e)},a.prototype.has=function(e){return!!(this.bits[e>>5]&1<<(31&e))};var o=function(e,t,s){this.start=e,this.end=t,this.original=s,this.intro="",this.outro="",this.content=s,this.storeName=!1,this.edited=!1,Object.defineProperties(this,{previous:{writable:!0,value:null},next:{writable:!0,value:null}})};o.prototype.appendLeft=function(e){this.outro+=e},o.prototype.appendRight=function(e){this.intro=this.intro+e},o.prototype.clone=function(){var e=new o(this.start,this.end,this.original);return e.intro=this.intro,e.outro=this.outro,e.content=this.content,e.storeName=this.storeName,e.edited=this.edited,e},o.prototype.contains=function(e){return this.start0&&(a+=";"),0!==h.length){for(var l=0,c=[],u=0,d=h;u1&&(f+=r(p[1]-t)+r(p[2]-s)+r(p[3]-i),t=p[1],s=p[2],i=p[3]),5===p.length&&(f+=r(p[4]-n),n=p[4]),c.push(f)}a+=c.join(",")}}return a}(e.mappings)};function c(e){var t=e.split("\n"),s=t.filter((function(e){return/^\t+/.test(e)})),i=t.filter((function(e){return/^ {2,}/.test(e)}));if(0===s.length&&0===i.length)return null;if(s.length>=i.length)return"\t";var n=i.reduce((function(e,t){var s=/^ +/.exec(t)[0].length;return Math.min(s,e)}),1/0);return new Array(n+1).join(" ")}function u(e,t){var s=e.split(/[/\\]/),i=t.split(/[/\\]/);for(s.pop();s[0]===i[0];)s.shift(),i.shift();if(s.length)for(var n=s.length;n--;)s[n]="..";return s.concat(i).join("/")}l.prototype.toString=function(){return JSON.stringify(this)},l.prototype.toUrl=function(){return"data:application/json;charset=utf-8;base64,"+h(this.toString())};var d=Object.prototype.toString;function p(e){return"[object Object]"===d.call(e)}function f(e){for(var t=e.split("\n"),s=[],i=0,n=0;i>1;e=0&&n.push(i),this.rawSegments.push(n)}else this.pending&&this.rawSegments.push(this.pending);this.advance(t),this.pending=null},m.prototype.addUneditedChunk=function(e,t,s,i,n){for(var r=t.start,a=!0;r1){for(var s=0;s=e&&s<=t)throw new Error("Cannot move a selection inside itself");this._split(e),this._split(t),this._split(s);var i=this.byStart[e],n=this.byEnd[t],r=i.previous,a=n.next,o=this.byStart[s];if(!o&&n===this.lastChunk)return this;var h=o?o.previous:this.lastChunk;return r&&(r.next=a),a&&(a.previous=r),h&&(h.next=i),o&&(o.previous=n),i.previous||(this.firstChunk=n.next),n.next||(this.lastChunk=i.previous,this.lastChunk.next=null),i.previous=h,n.next=o||null,h||(this.firstChunk=i),o||(this.lastChunk=n),this},x.prototype.overwrite=function(e,t,s,i){if("string"!=typeof s)throw new TypeError("replacement content must be a string");for(;e<0;)e+=this.original.length;for(;t<0;)t+=this.original.length;if(t>this.original.length)throw new Error("end is out of bounds");if(e===t)throw new Error("Cannot overwrite a zero-length range – use appendLeft or prependRight instead");this._split(e),this._split(t),!0===i&&(y.storeName||(console.warn("The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string"),y.storeName=!0),i={storeName:!0});var n=void 0!==i&&i.storeName,r=void 0!==i&&i.contentOnly;if(n){var a=this.original.slice(e,t);this.storedNames[a]=!0}var h=this.byStart[e],l=this.byEnd[t];if(h){if(t>h.end&&h.next!==this.byStart[h.end])throw new Error("Cannot overwrite across a split point");if(h.edit(s,n,r),h!==l){for(var c=h.next;c!==l;)c.edit("",!1),c=c.next;c.edit("",!1)}}else{var u=new o(e,t,"").edit(s,n);l.next=u,u.previous=l}return this},x.prototype.prepend=function(e){if("string"!=typeof e)throw new TypeError("outro content must be a string");return this.intro=e+this.intro,this},x.prototype.prependLeft=function(e,t){if("string"!=typeof t)throw new TypeError("inserted content must be a string");this._split(e);var s=this.byEnd[e];return s?s.prependLeft(t):this.intro=t+this.intro,this},x.prototype.prependRight=function(e,t){if("string"!=typeof t)throw new TypeError("inserted content must be a string");this._split(e);var s=this.byStart[e];return s?s.prependRight(t):this.outro=t+this.outro,this},x.prototype.remove=function(e,t){for(;e<0;)e+=this.original.length;for(;t<0;)t+=this.original.length;if(e===t)return this;if(e<0||t>this.original.length)throw new Error("Character is out of bounds");if(e>t)throw new Error("end must be greater than start");this._split(e),this._split(t);for(var s=this.byStart[e];s;)s.intro="",s.outro="",s.edit(""),s=t>s.end?this.byStart[s.end]:null;return this},x.prototype.lastChar=function(){if(this.outro.length)return this.outro[this.outro.length-1];var e=this.lastChunk;do{if(e.outro.length)return e.outro[e.outro.length-1];if(e.content.length)return e.content[e.content.length-1];if(e.intro.length)return e.intro[e.intro.length-1]}while(e=e.previous);return this.intro.length?this.intro[this.intro.length-1]:""},x.prototype.lastLine=function(){var e=this.outro.lastIndexOf(g);if(-1!==e)return this.outro.substr(e+1);var t=this.outro,s=this.lastChunk;do{if(s.outro.length>0){if(-1!==(e=s.outro.lastIndexOf(g)))return s.outro.substr(e+1)+t;t=s.outro+t}if(s.content.length>0){if(-1!==(e=s.content.lastIndexOf(g)))return s.content.substr(e+1)+t;t=s.content+t}if(s.intro.length>0){if(-1!==(e=s.intro.lastIndexOf(g)))return s.intro.substr(e+1)+t;t=s.intro+t}}while(s=s.previous);return-1!==(e=this.intro.lastIndexOf(g))?this.intro.substr(e+1)+t:this.intro+t},x.prototype.slice=function(e,t){for(void 0===e&&(e=0),void 0===t&&(t=this.original.length);e<0;)e+=this.original.length;for(;t<0;)t+=this.original.length;for(var s="",i=this.firstChunk;i&&(i.start>e||i.end<=e);){if(i.start=t)return s;i=i.next}if(i&&i.edited&&i.start!==e)throw new Error("Cannot use replaced character "+e+" as slice start anchor.");for(var n=i;i;){!i.intro||n===i&&i.start!==e||(s+=i.intro);var r=i.start=t;if(r&&i.edited&&i.end!==t)throw new Error("Cannot use replaced character "+t+" as slice end anchor.");var a=n===i?e-i.start:0,o=r?i.content.length+t-i.end:i.content.length;if(s+=i.content.slice(a,o),!i.outro||r&&i.end!==t||(s+=i.outro),r)break;i=i.next}return s},x.prototype.snip=function(e,t){var s=this.clone();return s.remove(0,e),s.remove(t,s.original.length),s},x.prototype._split=function(e){if(!this.byStart[e]&&!this.byEnd[e])for(var t=this.lastSearchedChunk,s=e>t.end;t;){if(t.contains(e))return this._splitChunk(t,e);t=s?this.byStart[t.end]:this.byEnd[t.start]}},x.prototype._splitChunk=function(e,t){if(e.edited&&e.content.length){var s=f(this.original)(t);throw new Error("Cannot split a chunk that has already been edited ("+s.line+":"+s.column+' – "'+e.original+'")')}var i=e.split(t);return this.byEnd[t]=e,this.byStart[t]=i,this.byEnd[i.end]=i,e===this.lastChunk&&(this.lastChunk=i),this.lastSearchedChunk=e,!0},x.prototype.toString=function(){for(var e=this.intro,t=this.firstChunk;t;)e+=t.toString(),t=t.next;return e+this.outro},x.prototype.isEmpty=function(){var e=this.firstChunk;do{if(e.intro.length&&e.intro.trim()||e.content.length&&e.content.trim()||e.outro.length&&e.outro.trim())return!1}while(e=e.next);return!0},x.prototype.length=function(){var e=this.firstChunk,t=0;do{t+=e.intro.length+e.content.length+e.outro.length}while(e=e.next);return t},x.prototype.trimLines=function(){return this.trim("[\\r\\n]")},x.prototype.trim=function(e){return this.trimStart(e).trimEnd(e)},x.prototype.trimEndAborted=function(e){var t=new RegExp((e||"\\s")+"+$");if(this.outro=this.outro.replace(t,""),this.outro.length)return!0;var s=this.lastChunk;do{var i=s.end,n=s.trimEnd(t);if(s.end!==i&&(this.lastChunk===s&&(this.lastChunk=s.next),this.byEnd[s.end]=s,this.byStart[s.next.start]=s.next,this.byEnd[s.next.end]=s.next),n)return!0;s=s.previous}while(s);return!1},x.prototype.trimEnd=function(e){return this.trimEndAborted(e),this},x.prototype.trimStartAborted=function(e){var t=new RegExp("^"+(e||"\\s")+"+");if(this.intro=this.intro.replace(t,""),this.intro.length)return!0;var s=this.firstChunk;do{var i=s.end,n=s.trimStart(t);if(s.end!==i&&(s===this.lastChunk&&(this.lastChunk=s.next),this.byEnd[s.end]=s,this.byStart[s.next.start]=s.next,this.byEnd[s.next.end]=s.next),n)return!0;s=s.next}while(s);return!1},x.prototype.trimStart=function(e){return this.trimStartAborted(e),this};var E=Object.prototype.hasOwnProperty,v=function(e){void 0===e&&(e={}),this.intro=e.intro||"",this.separator=void 0!==e.separator?e.separator:"\n",this.sources=[],this.uniqueSources=[],this.uniqueSourceIndexByFilename={}};function b(e,t){const s=e.split(/[/\\]/).filter(Boolean),i=t.split(/[/\\]/).filter(Boolean);for("."===s[0]&&s.shift(),"."===i[0]&&i.shift();s[0]&&i[0]&&s[0]===i[0];)s.shift(),i.shift();for(;".."===i[0]&&s.length>0;)i.shift(),s.pop();for(;s.pop();)i.unshift("..");return i.join("/")}function S(e,t,s,i){if(t.remove(s,i),e.annotations)for(const i of e.annotations){if(!(i.start0&&i.advance(t.separator);var r=e.filename?t.uniqueSourceIndexByFilename[e.filename]:-1,a=e.content,o=f(a.original);a.intro&&i.advance(a.intro),a.firstChunk.eachNext((function(t){var n=o(t.start);t.intro.length&&i.advance(t.intro),e.filename?t.edited?i.addEdit(r,t.content,n,t.storeName?s.indexOf(t.original):-1):i.addUneditedChunk(r,t,a.original,n,a.sourcemapLocations):i.advance(t.content),t.outro.length&&i.advance(t.outro)})),a.outro&&i.advance(a.outro)})),{file:e.file?e.file.split(/[/\\]/).pop():null,sources:this.uniqueSources.map((function(t){return e.file?u(e.file,t.filename):t.filename})),sourcesContent:this.uniqueSources.map((function(t){return e.includeContent?t.content:null})),names:s,mappings:i.raw}},v.prototype.generateMap=function(e){return new l(this.generateDecodedMap(e))},v.prototype.getIndentString=function(){var e={};return this.sources.forEach((function(t){var s=t.content.indentStr;null!==s&&(e[s]||(e[s]=0),e[s]+=1)})),Object.keys(e).sort((function(t,s){return e[t]-e[s]}))[0]||"\t"},v.prototype.indent=function(e){var t=this;if(arguments.length||(e=this.getIndentString()),""===e)return this;var s=!this.intro||"\n"===this.intro.slice(-1);return this.sources.forEach((function(i,n){var r=void 0!==i.separator?i.separator:t.separator,a=s||n>0&&/\r?\n$/.test(r);i.content.indent(e,{exclude:i.indentExclusionRanges,indentStart:a}),s="\n"===i.content.lastChar()})),this.intro&&(this.intro=e+this.intro.replace(/^[^\n]/gm,(function(t,s){return s>0?e+t:t}))),this},v.prototype.prepend=function(e){return this.intro=e+this.intro,this},v.prototype.toString=function(){var e=this,t=this.sources.map((function(t,s){var i=void 0!==t.separator?t.separator:e.separator;return(s>0?i:"")+t.content.toString()})).join("");return this.intro+t},v.prototype.isEmpty=function(){return!(this.intro.length&&this.intro.trim()||this.sources.some((function(e){return!e.content.isEmpty()})))},v.prototype.length=function(){return this.sources.reduce((function(e,t){return e+t.content.length()}),this.intro.length)},v.prototype.trimLines=function(){return this.trim("[\\r\\n]")},v.prototype.trim=function(e){return this.trimStart(e).trimEnd(e)},v.prototype.trimStart=function(e){var t=new RegExp("^"+(e||"\\s")+"+");if(this.intro=this.intro.replace(t,""),!this.intro){var s,i=0;do{if(!(s=this.sources[i++]))break}while(!s.content.trimStartAborted(e))}return this},v.prototype.trimEnd=function(e){var t,s=new RegExp((e||"\\s")+"+$"),i=this.sources.length-1;do{if(!(t=this.sources[i--])){this.intro=this.intro.replace(s,"");break}}while(!t.content.trimEndAborted(e));return this};const P={isNoStatement:!0};function C(e,t,s=0){let i,n;for(i=e.indexOf(t,s);;){if(-1===(s=e.indexOf("/",s))||s>=i)return i;n=e.charCodeAt(++s),++s,(s=47===n?e.indexOf("\n",s)+1:e.indexOf("*/",s)+2)>i&&(i=e.indexOf(t,s))}}const k=/\s/;function w(e,t){for(;tt)return t;if(s=e.charCodeAt(++i),47===s)return t;i=e.indexOf("*/",i+2)+2,i>t&&(t=e.indexOf("\n",i))}}function _(e,t,s,i,n){let r,a,o,h,l=e[0],c=!l.included||l.needsBoundaries;c&&(h=s+N(t.original.slice(s,l.start))+1);for(let s=1;s<=e.length;s++)r=l,a=h,o=c,l=e[s],c=void 0!==l&&(!l.included||l.needsBoundaries),o||c?(h=r.end+N(t.original.slice(r.end,void 0===l?i:l.start))+1,r.included?o?r.render(t,n,{end:h,start:a}):r.render(t,n):S(r,t,a,h)):r.render(t,n)}function I(e,t,s,i){const n=[];let r,a,o,h,l,c=s-1;for(let i=0;it.exportNamesByVariable.get(e).map(t=>`${t}:${s}${e.getName()}`).join(","+s)).join(","+s)}${s}})`}function T(e,t,s){const i=s.compact?"":" ",n=s.compact?"":";";return`function${i}(v)${i}{${i}return exports({${i}${e.map(e=>s.exportNamesByVariable.get(e).map(s=>`${s}:${i}${t?e.getName():"v"}`).join(","+i)).join(","+i)}${i}}),${i}v${n}${i}}(`}function L(e){let t="";do{const s=e%64;e=Math.floor(e/64),t="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_$"[s]+t}while(0!==e);return t}const R=Object.assign(Object.create(null),{await:!0,break:!0,case:!0,catch:!0,class:!0,const:!0,continue:!0,debugger:!0,default:!0,delete:!0,do:!0,else:!0,enum:!0,eval:!0,export:!0,extends:!0,false:!0,finally:!0,for:!0,function:!0,if:!0,implements:!0,import:!0,in:!0,instanceof:!0,interface:!0,let:!0,new:!0,null:!0,package:!0,private:!0,protected:!0,public:!0,return:!0,static:!0,super:!0,switch:!0,this:!0,throw:!0,true:!0,try:!0,typeof:!0,undefined:!0,var:!0,void:!0,while:!0,with:!0,yield:!0});function O(e,t){let s=e,i=1;for(;t.has(s)||R[s];)s=`${e}$${L(i++)}`;return t.add(s),s}const D=[],V=Symbol("Unknown Key"),B=[],F=[V],W=Symbol("Entities");class U{constructor(){this.entityPaths=Object.create(null,{[W]:{value:new Set}})}getEntities(e){let t=this.entityPaths;for(const s of e)t=t[s]=t[s]||Object.create(null,{[W]:{value:new Set}});return t[W]}}const z=new U;class j{constructor(){this.entityPaths=Object.create(null,{[W]:{value:new Map}})}getEntities(e,t){let s=this.entityPaths;for(const t of e)s=s[t]=s[t]||Object.create(null,{[W]:{value:new Map}});const i=s[W],n=i.get(t)||new Set;return i.set(t,n),n}}function G(e,t=null){return Object.create(t,e)}const H=Symbol("Unknown Value"),q={deoptimizePath:()=>{},getLiteralValueAtPath:()=>H,getReturnExpressionWhenCalledAtPath:()=>q,hasEffectsWhenAccessedAtPath:e=>e.length>0,hasEffectsWhenAssignedAtPath:e=>e.length>0,hasEffectsWhenCalledAtPath:()=>!0,include:()=>{},includeCallArguments(e,t){for(const s of t)s.include(e,!1)},included:!0,toString:()=>"[[UNKNOWN]]"},K={deoptimizePath:()=>{},getLiteralValueAtPath:()=>{},getReturnExpressionWhenCalledAtPath:()=>q,hasEffectsWhenAccessedAtPath:e=>e.length>0,hasEffectsWhenAssignedAtPath:e=>e.length>0,hasEffectsWhenCalledAtPath:()=>!0,include:()=>{},includeCallArguments(){},included:!0,toString:()=>"undefined"},X={value:{callsArgs:null,mutatesSelf:!1,returns:null,returnsPrimitive:q}},Y={value:{returns:null,returnsPrimitive:q,callsArgs:null,mutatesSelf:!0}},Q={value:{returns:null,returnsPrimitive:q,callsArgs:[0],mutatesSelf:!1}};class J{constructor(){this.included=!1}deoptimizePath(){}getLiteralValueAtPath(){return H}getReturnExpressionWhenCalledAtPath(e){return 1===e.length?Ee(fe,e[0]):q}hasEffectsWhenAccessedAtPath(e){return e.length>1}hasEffectsWhenAssignedAtPath(e){return e.length>1}hasEffectsWhenCalledAtPath(e,t,s){return 1!==e.length||xe(fe,e[0],this.included,t,s)}include(){this.included=!0}includeCallArguments(e,t){for(const s of t)s.include(e,!1)}toString(){return"[[UNKNOWN ARRAY]]"}}const Z={value:{callsArgs:null,mutatesSelf:!1,returns:J,returnsPrimitive:null}},ee={value:{callsArgs:null,mutatesSelf:!0,returns:J,returnsPrimitive:null}},te={value:{callsArgs:[0],mutatesSelf:!1,returns:J,returnsPrimitive:null}},se={value:{callsArgs:[0],mutatesSelf:!0,returns:J,returnsPrimitive:null}},ie={deoptimizePath:()=>{},getLiteralValueAtPath:()=>H,getReturnExpressionWhenCalledAtPath:e=>1===e.length?Ee(me,e[0]):q,hasEffectsWhenAccessedAtPath:e=>e.length>1,hasEffectsWhenAssignedAtPath:e=>e.length>0,hasEffectsWhenCalledAtPath:e=>{if(1===e.length){const t=e[0];return"string"!=typeof t||!me[t]}return!0},include:()=>{},includeCallArguments(e,t){for(const s of t)s.include(e,!1)},included:!0,toString:()=>"[[UNKNOWN BOOLEAN]]"},ne={value:{callsArgs:null,mutatesSelf:!1,returns:null,returnsPrimitive:ie}},re={value:{callsArgs:[0],mutatesSelf:!1,returns:null,returnsPrimitive:ie}},ae={deoptimizePath:()=>{},getLiteralValueAtPath:()=>H,getReturnExpressionWhenCalledAtPath:e=>1===e.length?Ee(ge,e[0]):q,hasEffectsWhenAccessedAtPath:e=>e.length>1,hasEffectsWhenAssignedAtPath:e=>e.length>0,hasEffectsWhenCalledAtPath:e=>{if(1===e.length){const t=e[0];return"string"!=typeof t||!ge[t]}return!0},include:()=>{},includeCallArguments(e,t){for(const s of t)s.include(e,!1)},included:!0,toString:()=>"[[UNKNOWN NUMBER]]"},oe={value:{callsArgs:null,mutatesSelf:!1,returns:null,returnsPrimitive:ae}},he={value:{callsArgs:null,mutatesSelf:!0,returns:null,returnsPrimitive:ae}},le={value:{callsArgs:[0],mutatesSelf:!1,returns:null,returnsPrimitive:ae}},ce={deoptimizePath:()=>{},getLiteralValueAtPath:()=>H,getReturnExpressionWhenCalledAtPath:e=>1===e.length?Ee(ye,e[0]):q,hasEffectsWhenAccessedAtPath:e=>e.length>1,hasEffectsWhenAssignedAtPath:e=>e.length>0,hasEffectsWhenCalledAtPath:(e,t,s)=>1!==e.length||xe(ye,e[0],!0,t,s),include:()=>{},includeCallArguments(e,t){for(const s of t)s.include(e,!1)},included:!0,toString:()=>"[[UNKNOWN STRING]]"},ue={value:{callsArgs:null,mutatesSelf:!1,returns:null,returnsPrimitive:ce}};class de{constructor(){this.included=!1}deoptimizePath(){}getLiteralValueAtPath(){return H}getReturnExpressionWhenCalledAtPath(e){return 1===e.length?Ee(pe,e[0]):q}hasEffectsWhenAccessedAtPath(e){return e.length>1}hasEffectsWhenAssignedAtPath(e){return e.length>1}hasEffectsWhenCalledAtPath(e,t,s){return 1!==e.length||xe(pe,e[0],this.included,t,s)}include(){this.included=!0}includeCallArguments(e,t){for(const s of t)s.include(e,!1)}toString(){return"[[UNKNOWN OBJECT]]"}}const pe=G({hasOwnProperty:ne,isPrototypeOf:ne,propertyIsEnumerable:ne,toLocaleString:ue,toString:ue,valueOf:X}),fe=G({concat:Z,copyWithin:ee,every:re,fill:ee,filter:te,find:Q,findIndex:le,forEach:Q,includes:ne,indexOf:oe,join:ue,lastIndexOf:oe,map:te,pop:Y,push:he,reduce:Q,reduceRight:Q,reverse:ee,shift:Y,slice:Z,some:re,sort:se,splice:ee,unshift:he},pe),me=G({valueOf:ne},pe),ge=G({toExponential:ue,toFixed:ue,toLocaleString:ue,toPrecision:ue,valueOf:oe},pe),ye=G({charAt:ue,charCodeAt:oe,codePointAt:oe,concat:ue,endsWith:ne,includes:ne,indexOf:oe,lastIndexOf:oe,localeCompare:oe,match:ne,normalize:ue,padEnd:ue,padStart:ue,repeat:ue,replace:{value:{callsArgs:[1],mutatesSelf:!1,returns:null,returnsPrimitive:ce}},search:oe,slice:ue,split:Z,startsWith:ne,substr:ue,substring:ue,toLocaleLowerCase:ue,toLocaleUpperCase:ue,toLowerCase:ue,toUpperCase:ue,trim:ue,valueOf:ue},pe);function xe(e,t,s,i,n){if("string"!=typeof t||!e[t]||e[t].mutatesSelf&&s)return!0;if(!e[t].callsArgs)return!1;for(const s of e[t].callsArgs)if(i.args[s]&&i.args[s].hasEffectsWhenCalledAtPath(B,{args:D,withNew:!1},n))return!0;return!1}function Ee(e,t){return"string"==typeof t&&e[t]?null!==e[t].returnsPrimitive?e[t].returnsPrimitive:new e[t].returns:q}class ve{constructor(e){this.alwaysRendered=!1,this.included=!1,this.isId=!1,this.isReassigned=!1,this.renderBaseName=null,this.renderName=null,this.name=e}addReference(e){}deoptimizePath(e){}getBaseVariableName(){return this.renderBaseName||this.renderName||this.name}getLiteralValueAtPath(e,t,s){return H}getName(){const e=this.renderName||this.name;return this.renderBaseName?`${this.renderBaseName}.${e}`:e}getReturnExpressionWhenCalledAtPath(e,t,s){return q}hasEffectsWhenAccessedAtPath(e,t){return e.length>0}hasEffectsWhenAssignedAtPath(e,t){return!0}hasEffectsWhenCalledAtPath(e,t,s){return!0}include(){this.included=!0}includeCallArguments(e,t){for(const s of t)s.include(e,!1)}markCalledFromTryStatement(){}setRenderNames(e,t){this.renderBaseName=e,this.renderName=t}setSafeName(e){this.renderName=e}}class be extends ve{constructor(e,t){super(t),this.module=e,this.isNamespace="*"===t,this.referenced=!1}addReference(e){this.referenced=!0,"default"!==this.name&&"*"!==this.name||this.module.suggestName(e.name)}include(){this.included||(this.included=!0,this.module.used=!0)}}const Se="break case class catch const continue debugger default delete do else export extends finally for function if import in instanceof let new return super switch this throw try typeof var void while with yield enum await implements package protected static interface private public".split(" "),Ae="Infinity NaN undefined null true false eval uneval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Symbol Error EvalError InternalError RangeError ReferenceError SyntaxError TypeError URIError Number Math Date String RegExp Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array Map Set WeakMap WeakSet SIMD ArrayBuffer DataView JSON Promise Generator GeneratorFunction Reflect Proxy Intl".split(" "),Pe=new Set(Se.concat(Ae)),Ce=/[^$_a-zA-Z0-9]/g,ke=e=>/\d/.test(e[0]);function we(e){return e=e.replace(/-(\w)/g,(e,t)=>t.toUpperCase()).replace(Ce,"_"),(ke(e)||Pe.has(e))&&(e="_"+e),e||"_"}const Ne=/^(?:\/|(?:[A-Za-z]:)?[\\|/])/,_e=/^\.?\.\//;function Ie(e){return Ne.test(e)}function $e(e){return _e.test(e)}function Me(e){return e.replace(/\\/g,"/")}function Te(e){return e.split(/(\/|\\)/).pop()}function Le(e){const t=/(\/|\\)[^/\\]*$/.exec(e);if(!t)return".";const s=e.slice(0,-t[0].length);return s||"/"}function Re(e){const t=/\.[^.]+$/.exec(Te(e));return t?t[0]:""}function Oe(e,t){const s=e.split(/[/\\]/).filter(Boolean),i=t.split(/[/\\]/).filter(Boolean);for("."===s[0]&&s.shift(),"."===i[0]&&i.shift();s[0]&&i[0]&&s[0]===i[0];)s.shift(),i.shift();for(;".."===i[0]&&s.length>0;)i.shift(),s.pop();for(;s.pop();)i.unshift("..");return i.join("/")}function De(...e){let t=e.shift().split(/[/\\]/);return e.forEach(e=>{if(Ie(e))t=e.split(/[/\\]/);else{const s=e.split(/[/\\]/);for(;"."===s[0]||".."===s[0];)".."===s.shift()&&t.pop();t.push.apply(t,s)}}),t.join("/")}class Ve{constructor(e,t,s){this.options=e,this.dynamicImporters=[],this.exportsNames=!1,this.exportsNamespace=!1,this.importers=[],this.mostCommonSuggestion=0,this.reexported=!1,this.renderPath=void 0,this.renormalizeRenderPath=!1,this.used=!1,this.id=t,this.execIndex=1/0,this.moduleSideEffects=s;const i=t.split(/[\\/]/);this.variableName=we(i.pop()),this.nameSuggestions=Object.create(null),this.declarations=Object.create(null),this.exportedVariables=new Map}getVariableForExportName(e){"*"===e?this.exportsNamespace=!0:"default"!==e&&(this.exportsNames=!0);let t=this.declarations[e];return t||(this.declarations[e]=t=new be(this,e),this.exportedVariables.set(t,e),t)}setRenderPath(e,t){return this.renderPath="function"==typeof e.paths?e.paths(this.id):e.paths[this.id],this.renderPath||(Ie(this.id)?(this.renderPath=Me(Oe(t,this.id)),this.renormalizeRenderPath=!0):this.renderPath=this.id),this.renderPath}suggestName(e){this.nameSuggestions[e]||(this.nameSuggestions[e]=0),this.nameSuggestions[e]+=1,this.nameSuggestions[e]>this.mostCommonSuggestion&&(this.mostCommonSuggestion=this.nameSuggestions[e],this.variableName=e)}warnUnusedImports(){const e=Object.keys(this.declarations).filter(e=>{if("*"===e)return!1;const t=this.declarations[e];return!t.included&&!this.reexported&&!t.referenced});if(0===e.length)return;const t=1===e.length?`'${e[0]}' is`:`${e.slice(0,-1).map(e=>`'${e}'`).join(", ")} and '${e.slice(-1)}' are`;this.options.onwarn({code:"UNUSED_EXTERNAL_IMPORT",message:`${t} imported from external module '${this.id}' but never used`,names:e,source:this.id})}}function Be(e){e.isExecuted=!0;const t=[e],s=new Set;for(const e of t)for(const i of[...e.dependencies,...e.implicitlyLoadedBefore])i instanceof Ve||i.isExecuted||!i.moduleSideEffects&&!e.implicitlyLoadedBefore.has(i)||s.has(i.id)||(i.isExecuted=!0,s.add(i.id),t.push(i))}function Fe(){return{brokenFlow:0,includedCallArguments:new Set,includedLabels:new Set}}function We(){return{accessed:new U,assigned:new U,brokenFlow:0,called:new j,ignore:{breaks:!1,continues:!1,labels:new Set,returnAwaitYield:!1},includedLabels:new Set,instantiated:new j,replacedVariableInits:new Map}}class Ue extends ve{constructor(e,t,s,i){super(e),this.additionalInitializers=null,this.calledFromTryStatement=!1,this.expressionsToBeDeoptimized=[],this.declarations=t?[t]:[],this.init=s,this.deoptimizationTracker=i.deoptimizationTracker,this.module=i.module}addDeclaration(e,t){this.declarations.push(e),null===this.additionalInitializers&&(this.additionalInitializers=null===this.init?[]:[this.init],this.init=q,this.isReassigned=!0),null!==t&&this.additionalInitializers.push(t)}consolidateInitializers(){if(null!==this.additionalInitializers){for(const e of this.additionalInitializers)e.deoptimizePath(F);this.additionalInitializers=null}}deoptimizePath(e){if(e.length>7||this.isReassigned)return;const t=this.deoptimizationTracker.getEntities(e);if(!t.has(this))if(t.add(this),0===e.length){if(!this.isReassigned){this.isReassigned=!0;const e=this.expressionsToBeDeoptimized;this.expressionsToBeDeoptimized=[];for(const t of e)t.deoptimizeCache();this.init&&this.init.deoptimizePath(F)}}else this.init&&this.init.deoptimizePath(e)}getLiteralValueAtPath(e,t,s){if(this.isReassigned||!this.init||e.length>7)return H;const i=t.getEntities(e);if(i.has(this.init))return H;this.expressionsToBeDeoptimized.push(s),i.add(this.init);const n=this.init.getLiteralValueAtPath(e,t,s);return i.delete(this.init),n}getReturnExpressionWhenCalledAtPath(e,t,s){if(this.isReassigned||!this.init||e.length>7)return q;const i=t.getEntities(e);if(i.has(this.init))return q;this.expressionsToBeDeoptimized.push(s),i.add(this.init);const n=this.init.getReturnExpressionWhenCalledAtPath(e,t,s);return i.delete(this.init),n}hasEffectsWhenAccessedAtPath(e,t){if(0===e.length)return!1;if(this.isReassigned||e.length>7)return!0;const s=t.accessed.getEntities(e);return!s.has(this)&&(s.add(this),this.init&&this.init.hasEffectsWhenAccessedAtPath(e,t))}hasEffectsWhenAssignedAtPath(e,t){if(this.included||e.length>7)return!0;if(0===e.length)return!1;if(this.isReassigned)return!0;const s=t.assigned.getEntities(e);return!s.has(this)&&(s.add(this),this.init&&this.init.hasEffectsWhenAssignedAtPath(e,t))}hasEffectsWhenCalledAtPath(e,t,s){if(e.length>7||this.isReassigned)return!0;const i=(t.withNew?s.instantiated:s.called).getEntities(e,t);return!i.has(this)&&(i.add(this),this.init&&this.init.hasEffectsWhenCalledAtPath(e,t,s))}include(){if(!this.included){this.included=!0,this.module.isExecuted||Be(this.module);for(const e of this.declarations){e.included||e.include(Fe(),!1);let t=e.parent;for(;!t.included&&(t.included=!0,"Program"!==t.type);)t=t.parent}}}includeCallArguments(e,t){if(this.isReassigned||this.init&&e.includedCallArguments.has(this.init))for(const s of t)s.include(e,!1);else this.init&&(e.includedCallArguments.add(this.init),this.init.includeCallArguments(e,t),e.includedCallArguments.delete(this.init))}markCalledFromTryStatement(){this.calledFromTryStatement=!0}}class ze{constructor(){this.children=[],this.variables=new Map}addDeclaration(e,t,s=null,i){const n=e.name;let r=this.variables.get(n);return r?r.addDeclaration(e,s):(r=new Ue(e.name,e,s||K,t),this.variables.set(n,r)),r}contains(e){return this.variables.has(e)}findVariable(e){throw new Error("Internal Error: findVariable needs to be implemented by a subclass")}}class je extends ze{constructor(e){super(),this.accessedOutsideVariables=new Map,this.parent=e,e.children.push(this)}addAccessedDynamicImport(e){(this.accessedDynamicImports||(this.accessedDynamicImports=new Set)).add(e),this.parent instanceof je&&this.parent.addAccessedDynamicImport(e)}addAccessedGlobalsByFormat(e){const t=this.accessedGlobalVariablesByFormat||(this.accessedGlobalVariablesByFormat=new Map);for(const s of Object.keys(e)){let i=t.get(s);i||(i=new Set,t.set(s,i));for(const t of e[s])i.add(t)}this.parent instanceof je&&this.parent.addAccessedGlobalsByFormat(e)}addNamespaceMemberAccess(e,t){this.accessedOutsideVariables.set(e,t),this.parent.addNamespaceMemberAccess(e,t)}addReturnExpression(e){this.parent instanceof je&&this.parent.addReturnExpression(e)}addUsedOutsideNames(e,t,s){for(const i of this.accessedOutsideVariables.values())i.included&&(e.add(i.getBaseVariableName()),"system"===t&&s.has(i)&&e.add("exports"));const i=this.accessedGlobalVariablesByFormat&&this.accessedGlobalVariablesByFormat.get(t);if(i)for(const t of i)e.add(t)}contains(e){return this.variables.has(e)||this.parent.contains(e)}deconflict(e,t){const s=new Set;if(this.addUsedOutsideNames(s,e,t),this.accessedDynamicImports)for(const e of this.accessedDynamicImports)e.inlineNamespace&&s.add(e.inlineNamespace.getBaseVariableName());for(const[e,t]of this.variables)(t.included||t.alwaysRendered)&&t.setSafeName(O(e,s));for(const s of this.children)s.deconflict(e,t)}findLexicalBoundary(){return this.parent.findLexicalBoundary()}findVariable(e){const t=this.variables.get(e)||this.accessedOutsideVariables.get(e);if(t)return t;const s=this.parent.findVariable(e);return this.accessedOutsideVariables.set(e,s),s}}function Ge(e,t,s){if("number"==typeof s)throw new Error("locate takes a { startIndex, offsetLine, offsetColumn } object as the third argument");return function(e,t){void 0===t&&(t={});var s=t.offsetLine||0,i=t.offsetColumn||0,n=e.split("\n"),r=0,a=n.map((function(e,t){var s=r+e.length+1,i={start:r,end:s,line:t};return r=s,i})),o=0;function h(e,t){return e.start<=t&&t=i.end?1:-1;i;){if(h(i,t))return l(i,t);i=a[o+=n]}}}(e,s)(t,s&&s.startIndex)}const He={Literal:[],Program:["body"]};class qe{constructor(e,t,s){this.included=!1,this.keys=He[e.type]||function(e){return He[e.type]=Object.keys(e).filter(t=>"object"==typeof e[t]),He[e.type]}(e),this.parent=t,this.context=t.context,this.createScope(s),this.parseNode(e),this.initialise(),this.context.magicString.addSourcemapLocation(this.start),this.context.magicString.addSourcemapLocation(this.end)}bind(){for(const e of this.keys){const t=this[e];if(null!==t&&"annotations"!==e)if(Array.isArray(t))for(const e of t)null!==e&&e.bind();else t.bind()}}createScope(e){this.scope=e}declare(e,t){return[]}deoptimizePath(e){}getLiteralValueAtPath(e,t,s){return H}getReturnExpressionWhenCalledAtPath(e,t,s){return q}hasEffects(e){for(const t of this.keys){const s=this[t];if(null!==s&&"annotations"!==t)if(Array.isArray(s)){for(const t of s)if(null!==t&&t.hasEffects(e))return!0}else if(s.hasEffects(e))return!0}return!1}hasEffectsWhenAccessedAtPath(e,t){return e.length>0}hasEffectsWhenAssignedAtPath(e,t){return!0}hasEffectsWhenCalledAtPath(e,t,s){return!0}include(e,t){this.included=!0;for(const s of this.keys){const i=this[s];if(null!==i&&"annotations"!==s)if(Array.isArray(i))for(const s of i)null!==s&&s.include(e,t);else i.include(e,t)}}includeCallArguments(e,t){for(const s of t)s.include(e,!1)}includeWithAllDeclaredVariables(e,t){this.include(t,e)}initialise(){}insertSemicolon(e){";"!==e.original[this.end-1]&&e.appendLeft(this.end,";")}parseNode(e){for(const t of Object.keys(e)){if(this.hasOwnProperty(t))continue;const s=e[t];if("object"!=typeof s||null===s||"annotations"===t)this[t]=s;else if(Array.isArray(s)){this[t]=[];for(const e of s)this[t].push(null===e?null:new(this.context.nodeConstructors[e.type]||this.context.nodeConstructors.UnknownNode)(e,this,this.scope))}else this[t]=new(this.context.nodeConstructors[s.type]||this.context.nodeConstructors.UnknownNode)(s,this,this.scope)}}render(e,t){for(const s of this.keys){const i=this[s];if(null!==i&&"annotations"!==s)if(Array.isArray(i))for(const s of i)null!==s&&s.render(e,t);else i.render(e,t)}}shouldBeIncluded(e){return this.included||!e.brokenFlow&&this.hasEffects(We())}toString(){return this.context.code.slice(this.start,this.end)}}class Ke extends qe{createScope(e){this.scope=new je(e)}hasEffectsWhenAccessedAtPath(e){return!(e.length<=1)&&(e.length>2||"prototype"!==e[0])}hasEffectsWhenAssignedAtPath(e){return!(e.length<=1)&&(e.length>2||"prototype"!==e[0])}hasEffectsWhenCalledAtPath(e,t,s){return!t.withNew||this.body.hasEffectsWhenCalledAtPath(e,t,s)||null!==this.superClass&&this.superClass.hasEffectsWhenCalledAtPath(e,t,s)}initialise(){null!==this.id&&this.id.declare("class",this)}}class Xe extends Ke{initialise(){super.initialise(),null!==this.id&&(this.id.variable.isId=!0)}parseNode(e){null!==e.id&&(this.id=new this.context.nodeConstructors.Identifier(e.id,this,this.scope.parent)),super.parseNode(e)}render(e,t){"system"===t.format&&this.id&&t.exportNamesByVariable.has(this.id.variable)&&e.appendLeft(this.end,`${t.compact?"":" "}${M([this.id.variable],t)};`),super.render(e,t)}}class Ye extends Ue{constructor(e){super("arguments",null,q,e)}hasEffectsWhenAccessedAtPath(e){return e.length>1}hasEffectsWhenAssignedAtPath(){return!0}hasEffectsWhenCalledAtPath(){return!0}}class Qe extends Ue{constructor(e){super("this",null,null,e)}getLiteralValueAtPath(){return H}hasEffectsWhenAccessedAtPath(e,t){return this.getInit(t).hasEffectsWhenAccessedAtPath(e,t)||super.hasEffectsWhenAccessedAtPath(e,t)}hasEffectsWhenAssignedAtPath(e,t){return this.getInit(t).hasEffectsWhenAssignedAtPath(e,t)||super.hasEffectsWhenAssignedAtPath(e,t)}hasEffectsWhenCalledAtPath(e,t,s){return this.getInit(s).hasEffectsWhenCalledAtPath(e,t,s)||super.hasEffectsWhenCalledAtPath(e,t,s)}getInit(e){return e.replacedVariableInits.get(this)||q}}class Je extends je{constructor(e,t){super(e),this.parameters=[],this.hasRest=!1,this.context=t,this.hoistedBodyVarScope=new je(this)}addParameterDeclaration(e){const t=e.name;let s=this.hoistedBodyVarScope.variables.get(t);return s?s.addDeclaration(e,null):s=new Ue(t,e,q,this.context),this.variables.set(t,s),s}addParameterVariables(e,t){this.parameters=e;for(const t of e)for(const e of t)e.alwaysRendered=!0;this.hasRest=t}includeCallArguments(e,t){let s=!1,i=!1;const n=this.hasRest&&this.parameters[this.parameters.length-1];for(let r=t.length-1;r>=0;r--){const a=this.parameters[r]||n,o=t[r];if(a){s=!1;for(const e of a)e.included&&(i=!0),e.calledFromTryStatement&&(s=!0)}!i&&o.shouldBeIncluded(e)&&(i=!0),i&&o.include(e,s)}}}class Ze extends Je{constructor(){super(...arguments),this.returnExpression=null,this.returnExpressions=[]}addReturnExpression(e){this.returnExpressions.push(e)}getReturnExpression(){return null===this.returnExpression&&this.updateReturnExpression(),this.returnExpression}updateReturnExpression(){if(1===this.returnExpressions.length)this.returnExpression=this.returnExpressions[0];else{this.returnExpression=q;for(const e of this.returnExpressions)e.deoptimizePath(F)}}}class et extends Ze{constructor(e,t){super(e,t),this.variables.set("arguments",this.argumentsVariable=new Ye(t)),this.variables.set("this",this.thisVariable=new Qe(t))}findLexicalBoundary(){return this}includeCallArguments(e,t){if(super.includeCallArguments(e,t),this.argumentsVariable.included)for(const s of t)s.included||s.include(e,!1)}}const tt=Object.create(null),st=Symbol("Value Properties"),it={pure:!0},nt={pure:!1},rt={__proto__:null,[st]:nt},at={__proto__:null,[st]:it},ot={__proto__:null,[st]:nt,prototype:rt},ht={__proto__:null,[st]:it,prototype:rt},lt={__proto__:null,[st]:it,from:at,of:at,prototype:rt},ct={__proto__:null,[st]:it,supportedLocalesOf:ht},ut={global:rt,globalThis:rt,self:rt,window:rt,__proto__:null,[st]:nt,Array:{__proto__:null,[st]:nt,from:rt,isArray:at,of:at,prototype:rt},ArrayBuffer:{__proto__:null,[st]:it,isView:at,prototype:rt},Atomics:rt,BigInt:ot,BigInt64Array:ot,BigUint64Array:ot,Boolean:ht,constructor:ot,DataView:ht,Date:{__proto__:null,[st]:it,now:at,parse:at,prototype:rt,UTC:at},decodeURI:at,decodeURIComponent:at,encodeURI:at,encodeURIComponent:at,Error:ht,escape:at,eval:rt,EvalError:ht,Float32Array:lt,Float64Array:lt,Function:ot,hasOwnProperty:rt,Infinity:rt,Int16Array:lt,Int32Array:lt,Int8Array:lt,isFinite:at,isNaN:at,isPrototypeOf:rt,JSON:rt,Map:ht,Math:{__proto__:null,[st]:nt,abs:at,acos:at,acosh:at,asin:at,asinh:at,atan:at,atan2:at,atanh:at,cbrt:at,ceil:at,clz32:at,cos:at,cosh:at,exp:at,expm1:at,floor:at,fround:at,hypot:at,imul:at,log:at,log10:at,log1p:at,log2:at,max:at,min:at,pow:at,random:at,round:at,sign:at,sin:at,sinh:at,sqrt:at,tan:at,tanh:at,trunc:at},NaN:rt,Number:{__proto__:null,[st]:it,isFinite:at,isInteger:at,isNaN:at,isSafeInteger:at,parseFloat:at,parseInt:at,prototype:rt},Object:{__proto__:null,[st]:it,create:at,getNotifier:at,getOwn:at,getOwnPropertyDescriptor:at,getOwnPropertyNames:at,getOwnPropertySymbols:at,getPrototypeOf:at,is:at,isExtensible:at,isFrozen:at,isSealed:at,keys:at,prototype:rt},parseFloat:at,parseInt:at,Promise:{__proto__:null,[st]:nt,all:at,prototype:rt,race:at,resolve:at},propertyIsEnumerable:rt,Proxy:rt,RangeError:ht,ReferenceError:ht,Reflect:rt,RegExp:ht,Set:ht,SharedArrayBuffer:ot,String:{__proto__:null,[st]:it,fromCharCode:at,fromCodePoint:at,prototype:rt,raw:at},Symbol:{__proto__:null,[st]:it,for:at,keyFor:at,prototype:rt},SyntaxError:ht,toLocaleString:rt,toString:rt,TypeError:ht,Uint16Array:lt,Uint32Array:lt,Uint8Array:lt,Uint8ClampedArray:lt,unescape:at,URIError:ht,valueOf:rt,WeakMap:ht,WeakSet:ht,clearInterval:ot,clearTimeout:ot,console:rt,Intl:{__proto__:null,[st]:nt,Collator:ct,DateTimeFormat:ct,ListFormat:ct,NumberFormat:ct,PluralRules:ct,RelativeTimeFormat:ct},setInterval:ot,setTimeout:ot,TextDecoder:ot,TextEncoder:ot,URL:ot,URLSearchParams:ot,AbortController:ot,AbortSignal:ot,addEventListener:rt,alert:rt,AnalyserNode:ot,Animation:ot,AnimationEvent:ot,applicationCache:rt,ApplicationCache:ot,ApplicationCacheErrorEvent:ot,atob:rt,Attr:ot,Audio:ot,AudioBuffer:ot,AudioBufferSourceNode:ot,AudioContext:ot,AudioDestinationNode:ot,AudioListener:ot,AudioNode:ot,AudioParam:ot,AudioProcessingEvent:ot,AudioScheduledSourceNode:ot,AudioWorkletNode:ot,BarProp:ot,BaseAudioContext:ot,BatteryManager:ot,BeforeUnloadEvent:ot,BiquadFilterNode:ot,Blob:ot,BlobEvent:ot,blur:rt,BroadcastChannel:ot,btoa:rt,ByteLengthQueuingStrategy:ot,Cache:ot,caches:rt,CacheStorage:ot,cancelAnimationFrame:rt,cancelIdleCallback:rt,CanvasCaptureMediaStreamTrack:ot,CanvasGradient:ot,CanvasPattern:ot,CanvasRenderingContext2D:ot,ChannelMergerNode:ot,ChannelSplitterNode:ot,CharacterData:ot,clientInformation:rt,ClipboardEvent:ot,close:rt,closed:rt,CloseEvent:ot,Comment:ot,CompositionEvent:ot,confirm:rt,ConstantSourceNode:ot,ConvolverNode:ot,CountQueuingStrategy:ot,createImageBitmap:rt,Credential:ot,CredentialsContainer:ot,crypto:rt,Crypto:ot,CryptoKey:ot,CSS:ot,CSSConditionRule:ot,CSSFontFaceRule:ot,CSSGroupingRule:ot,CSSImportRule:ot,CSSKeyframeRule:ot,CSSKeyframesRule:ot,CSSMediaRule:ot,CSSNamespaceRule:ot,CSSPageRule:ot,CSSRule:ot,CSSRuleList:ot,CSSStyleDeclaration:ot,CSSStyleRule:ot,CSSStyleSheet:ot,CSSSupportsRule:ot,CustomElementRegistry:ot,customElements:rt,CustomEvent:ot,DataTransfer:ot,DataTransferItem:ot,DataTransferItemList:ot,defaultstatus:rt,defaultStatus:rt,DelayNode:ot,DeviceMotionEvent:ot,DeviceOrientationEvent:ot,devicePixelRatio:rt,dispatchEvent:rt,document:rt,Document:ot,DocumentFragment:ot,DocumentType:ot,DOMError:ot,DOMException:ot,DOMImplementation:ot,DOMMatrix:ot,DOMMatrixReadOnly:ot,DOMParser:ot,DOMPoint:ot,DOMPointReadOnly:ot,DOMQuad:ot,DOMRect:ot,DOMRectReadOnly:ot,DOMStringList:ot,DOMStringMap:ot,DOMTokenList:ot,DragEvent:ot,DynamicsCompressorNode:ot,Element:ot,ErrorEvent:ot,Event:ot,EventSource:ot,EventTarget:ot,external:rt,fetch:rt,File:ot,FileList:ot,FileReader:ot,find:rt,focus:rt,FocusEvent:ot,FontFace:ot,FontFaceSetLoadEvent:ot,FormData:ot,frames:rt,GainNode:ot,Gamepad:ot,GamepadButton:ot,GamepadEvent:ot,getComputedStyle:rt,getSelection:rt,HashChangeEvent:ot,Headers:ot,history:rt,History:ot,HTMLAllCollection:ot,HTMLAnchorElement:ot,HTMLAreaElement:ot,HTMLAudioElement:ot,HTMLBaseElement:ot,HTMLBodyElement:ot,HTMLBRElement:ot,HTMLButtonElement:ot,HTMLCanvasElement:ot,HTMLCollection:ot,HTMLContentElement:ot,HTMLDataElement:ot,HTMLDataListElement:ot,HTMLDetailsElement:ot,HTMLDialogElement:ot,HTMLDirectoryElement:ot,HTMLDivElement:ot,HTMLDListElement:ot,HTMLDocument:ot,HTMLElement:ot,HTMLEmbedElement:ot,HTMLFieldSetElement:ot,HTMLFontElement:ot,HTMLFormControlsCollection:ot,HTMLFormElement:ot,HTMLFrameElement:ot,HTMLFrameSetElement:ot,HTMLHeadElement:ot,HTMLHeadingElement:ot,HTMLHRElement:ot,HTMLHtmlElement:ot,HTMLIFrameElement:ot,HTMLImageElement:ot,HTMLInputElement:ot,HTMLLabelElement:ot,HTMLLegendElement:ot,HTMLLIElement:ot,HTMLLinkElement:ot,HTMLMapElement:ot,HTMLMarqueeElement:ot,HTMLMediaElement:ot,HTMLMenuElement:ot,HTMLMetaElement:ot,HTMLMeterElement:ot,HTMLModElement:ot,HTMLObjectElement:ot,HTMLOListElement:ot,HTMLOptGroupElement:ot,HTMLOptionElement:ot,HTMLOptionsCollection:ot,HTMLOutputElement:ot,HTMLParagraphElement:ot,HTMLParamElement:ot,HTMLPictureElement:ot,HTMLPreElement:ot,HTMLProgressElement:ot,HTMLQuoteElement:ot,HTMLScriptElement:ot,HTMLSelectElement:ot,HTMLShadowElement:ot,HTMLSlotElement:ot,HTMLSourceElement:ot,HTMLSpanElement:ot,HTMLStyleElement:ot,HTMLTableCaptionElement:ot,HTMLTableCellElement:ot,HTMLTableColElement:ot,HTMLTableElement:ot,HTMLTableRowElement:ot,HTMLTableSectionElement:ot,HTMLTemplateElement:ot,HTMLTextAreaElement:ot,HTMLTimeElement:ot,HTMLTitleElement:ot,HTMLTrackElement:ot,HTMLUListElement:ot,HTMLUnknownElement:ot,HTMLVideoElement:ot,IDBCursor:ot,IDBCursorWithValue:ot,IDBDatabase:ot,IDBFactory:ot,IDBIndex:ot,IDBKeyRange:ot,IDBObjectStore:ot,IDBOpenDBRequest:ot,IDBRequest:ot,IDBTransaction:ot,IDBVersionChangeEvent:ot,IdleDeadline:ot,IIRFilterNode:ot,Image:ot,ImageBitmap:ot,ImageBitmapRenderingContext:ot,ImageCapture:ot,ImageData:ot,indexedDB:rt,innerHeight:rt,innerWidth:rt,InputEvent:ot,IntersectionObserver:ot,IntersectionObserverEntry:ot,isSecureContext:rt,KeyboardEvent:ot,KeyframeEffect:ot,length:rt,localStorage:rt,location:rt,Location:ot,locationbar:rt,matchMedia:rt,MediaDeviceInfo:ot,MediaDevices:ot,MediaElementAudioSourceNode:ot,MediaEncryptedEvent:ot,MediaError:ot,MediaKeyMessageEvent:ot,MediaKeySession:ot,MediaKeyStatusMap:ot,MediaKeySystemAccess:ot,MediaList:ot,MediaQueryList:ot,MediaQueryListEvent:ot,MediaRecorder:ot,MediaSettingsRange:ot,MediaSource:ot,MediaStream:ot,MediaStreamAudioDestinationNode:ot,MediaStreamAudioSourceNode:ot,MediaStreamEvent:ot,MediaStreamTrack:ot,MediaStreamTrackEvent:ot,menubar:rt,MessageChannel:ot,MessageEvent:ot,MessagePort:ot,MIDIAccess:ot,MIDIConnectionEvent:ot,MIDIInput:ot,MIDIInputMap:ot,MIDIMessageEvent:ot,MIDIOutput:ot,MIDIOutputMap:ot,MIDIPort:ot,MimeType:ot,MimeTypeArray:ot,MouseEvent:ot,moveBy:rt,moveTo:rt,MutationEvent:ot,MutationObserver:ot,MutationRecord:ot,name:rt,NamedNodeMap:ot,NavigationPreloadManager:ot,navigator:rt,Navigator:ot,NetworkInformation:ot,Node:ot,NodeFilter:rt,NodeIterator:ot,NodeList:ot,Notification:ot,OfflineAudioCompletionEvent:ot,OfflineAudioContext:ot,offscreenBuffering:rt,OffscreenCanvas:ot,open:rt,openDatabase:rt,Option:ot,origin:rt,OscillatorNode:ot,outerHeight:rt,outerWidth:rt,PageTransitionEvent:ot,pageXOffset:rt,pageYOffset:rt,PannerNode:ot,parent:rt,Path2D:ot,PaymentAddress:ot,PaymentRequest:ot,PaymentRequestUpdateEvent:ot,PaymentResponse:ot,performance:rt,Performance:ot,PerformanceEntry:ot,PerformanceLongTaskTiming:ot,PerformanceMark:ot,PerformanceMeasure:ot,PerformanceNavigation:ot,PerformanceNavigationTiming:ot,PerformanceObserver:ot,PerformanceObserverEntryList:ot,PerformancePaintTiming:ot,PerformanceResourceTiming:ot,PerformanceTiming:ot,PeriodicWave:ot,Permissions:ot,PermissionStatus:ot,personalbar:rt,PhotoCapabilities:ot,Plugin:ot,PluginArray:ot,PointerEvent:ot,PopStateEvent:ot,postMessage:rt,Presentation:ot,PresentationAvailability:ot,PresentationConnection:ot,PresentationConnectionAvailableEvent:ot,PresentationConnectionCloseEvent:ot,PresentationConnectionList:ot,PresentationReceiver:ot,PresentationRequest:ot,print:rt,ProcessingInstruction:ot,ProgressEvent:ot,PromiseRejectionEvent:ot,prompt:rt,PushManager:ot,PushSubscription:ot,PushSubscriptionOptions:ot,queueMicrotask:rt,RadioNodeList:ot,Range:ot,ReadableStream:ot,RemotePlayback:ot,removeEventListener:rt,Request:ot,requestAnimationFrame:rt,requestIdleCallback:rt,resizeBy:rt,ResizeObserver:ot,ResizeObserverEntry:ot,resizeTo:rt,Response:ot,RTCCertificate:ot,RTCDataChannel:ot,RTCDataChannelEvent:ot,RTCDtlsTransport:ot,RTCIceCandidate:ot,RTCIceTransport:ot,RTCPeerConnection:ot,RTCPeerConnectionIceEvent:ot,RTCRtpReceiver:ot,RTCRtpSender:ot,RTCSctpTransport:ot,RTCSessionDescription:ot,RTCStatsReport:ot,RTCTrackEvent:ot,screen:rt,Screen:ot,screenLeft:rt,ScreenOrientation:ot,screenTop:rt,screenX:rt,screenY:rt,ScriptProcessorNode:ot,scroll:rt,scrollbars:rt,scrollBy:rt,scrollTo:rt,scrollX:rt,scrollY:rt,SecurityPolicyViolationEvent:ot,Selection:ot,ServiceWorker:ot,ServiceWorkerContainer:ot,ServiceWorkerRegistration:ot,sessionStorage:rt,ShadowRoot:ot,SharedWorker:ot,SourceBuffer:ot,SourceBufferList:ot,speechSynthesis:rt,SpeechSynthesisEvent:ot,SpeechSynthesisUtterance:ot,StaticRange:ot,status:rt,statusbar:rt,StereoPannerNode:ot,stop:rt,Storage:ot,StorageEvent:ot,StorageManager:ot,styleMedia:rt,StyleSheet:ot,StyleSheetList:ot,SubtleCrypto:ot,SVGAElement:ot,SVGAngle:ot,SVGAnimatedAngle:ot,SVGAnimatedBoolean:ot,SVGAnimatedEnumeration:ot,SVGAnimatedInteger:ot,SVGAnimatedLength:ot,SVGAnimatedLengthList:ot,SVGAnimatedNumber:ot,SVGAnimatedNumberList:ot,SVGAnimatedPreserveAspectRatio:ot,SVGAnimatedRect:ot,SVGAnimatedString:ot,SVGAnimatedTransformList:ot,SVGAnimateElement:ot,SVGAnimateMotionElement:ot,SVGAnimateTransformElement:ot,SVGAnimationElement:ot,SVGCircleElement:ot,SVGClipPathElement:ot,SVGComponentTransferFunctionElement:ot,SVGDefsElement:ot,SVGDescElement:ot,SVGDiscardElement:ot,SVGElement:ot,SVGEllipseElement:ot,SVGFEBlendElement:ot,SVGFEColorMatrixElement:ot,SVGFEComponentTransferElement:ot,SVGFECompositeElement:ot,SVGFEConvolveMatrixElement:ot,SVGFEDiffuseLightingElement:ot,SVGFEDisplacementMapElement:ot,SVGFEDistantLightElement:ot,SVGFEDropShadowElement:ot,SVGFEFloodElement:ot,SVGFEFuncAElement:ot,SVGFEFuncBElement:ot,SVGFEFuncGElement:ot,SVGFEFuncRElement:ot,SVGFEGaussianBlurElement:ot,SVGFEImageElement:ot,SVGFEMergeElement:ot,SVGFEMergeNodeElement:ot,SVGFEMorphologyElement:ot,SVGFEOffsetElement:ot,SVGFEPointLightElement:ot,SVGFESpecularLightingElement:ot,SVGFESpotLightElement:ot,SVGFETileElement:ot,SVGFETurbulenceElement:ot,SVGFilterElement:ot,SVGForeignObjectElement:ot,SVGGElement:ot,SVGGeometryElement:ot,SVGGradientElement:ot,SVGGraphicsElement:ot,SVGImageElement:ot,SVGLength:ot,SVGLengthList:ot,SVGLinearGradientElement:ot,SVGLineElement:ot,SVGMarkerElement:ot,SVGMaskElement:ot,SVGMatrix:ot,SVGMetadataElement:ot,SVGMPathElement:ot,SVGNumber:ot,SVGNumberList:ot,SVGPathElement:ot,SVGPatternElement:ot,SVGPoint:ot,SVGPointList:ot,SVGPolygonElement:ot,SVGPolylineElement:ot,SVGPreserveAspectRatio:ot,SVGRadialGradientElement:ot,SVGRect:ot,SVGRectElement:ot,SVGScriptElement:ot,SVGSetElement:ot,SVGStopElement:ot,SVGStringList:ot,SVGStyleElement:ot,SVGSVGElement:ot,SVGSwitchElement:ot,SVGSymbolElement:ot,SVGTextContentElement:ot,SVGTextElement:ot,SVGTextPathElement:ot,SVGTextPositioningElement:ot,SVGTitleElement:ot,SVGTransform:ot,SVGTransformList:ot,SVGTSpanElement:ot,SVGUnitTypes:ot,SVGUseElement:ot,SVGViewElement:ot,TaskAttributionTiming:ot,Text:ot,TextEvent:ot,TextMetrics:ot,TextTrack:ot,TextTrackCue:ot,TextTrackCueList:ot,TextTrackList:ot,TimeRanges:ot,toolbar:rt,top:rt,Touch:ot,TouchEvent:ot,TouchList:ot,TrackEvent:ot,TransitionEvent:ot,TreeWalker:ot,UIEvent:ot,ValidityState:ot,visualViewport:rt,VisualViewport:ot,VTTCue:ot,WaveShaperNode:ot,WebAssembly:rt,WebGL2RenderingContext:ot,WebGLActiveInfo:ot,WebGLBuffer:ot,WebGLContextEvent:ot,WebGLFramebuffer:ot,WebGLProgram:ot,WebGLQuery:ot,WebGLRenderbuffer:ot,WebGLRenderingContext:ot,WebGLSampler:ot,WebGLShader:ot,WebGLShaderPrecisionFormat:ot,WebGLSync:ot,WebGLTexture:ot,WebGLTransformFeedback:ot,WebGLUniformLocation:ot,WebGLVertexArrayObject:ot,WebSocket:ot,WheelEvent:ot,Window:ot,Worker:ot,WritableStream:ot,XMLDocument:ot,XMLHttpRequest:ot,XMLHttpRequestEventTarget:ot,XMLHttpRequestUpload:ot,XMLSerializer:ot,XPathEvaluator:ot,XPathExpression:ot,XPathResult:ot,XSLTProcessor:ot};for(const e of["window","global","self","globalThis"])ut[e]=ut;function dt(e){let t=ut;for(const s of e){if("string"!=typeof s)return null;if(t=t[s],!t)return null}return t[st]}class pt extends ve{constructor(){super(...arguments),this.isReassigned=!0}hasEffectsWhenAccessedAtPath(e){return!function(e){return 1===e.length?"undefined"===e[0]||null!==dt(e):null!==dt(e.slice(0,-1))}([this.name,...e])}hasEffectsWhenCalledAtPath(e){return!function(e){const t=dt(e);return null!==t&&t.pure}([this.name,...e])}}class ft extends qe{constructor(){super(...arguments),this.variable=null,this.bound=!1}addExportedVariables(e,t){null!==this.variable&&t.has(this.variable)&&e.push(this.variable)}bind(){this.bound||(this.bound=!0,null===this.variable&&function e(t,s){if("MemberExpression"===t.type)return!t.computed&&e(t.object,t);if("Identifier"===t.type){if(!s)return!0;switch(s.type){case"MemberExpression":return s.computed||t===s.object;case"MethodDefinition":return s.computed;case"FieldDefinition":case"Property":return s.computed||t===s.value;case"ExportSpecifier":case"ImportSpecifier":return t===s.local;case"LabeledStatement":case"BreakStatement":case"ContinueStatement":return!1;default:return!0}}return!1}(this,this.parent)&&(this.variable=this.scope.findVariable(this.name),this.variable.addReference(this)),null!==this.variable&&this.variable instanceof Ue&&null!==this.variable.additionalInitializers&&this.variable.consolidateInitializers())}declare(e,t){let s;switch(e){case"var":s=this.scope.addDeclaration(this,this.context,t,!0);break;case"function":s=this.scope.addDeclaration(this,this.context,t,"function");break;case"let":case"const":case"class":s=this.scope.addDeclaration(this,this.context,t,!1);break;case"parameter":s=this.scope.addParameterDeclaration(this);break;default:throw new Error(`Internal Error: Unexpected identifier kind ${e}.`)}return[this.variable=s]}deoptimizePath(e){this.bound||this.bind(),0!==e.length||this.scope.contains(this.name)||this.disallowImportReassignment(),this.variable.deoptimizePath(e)}getLiteralValueAtPath(e,t,s){return this.bound||this.bind(),this.variable.getLiteralValueAtPath(e,t,s)}getReturnExpressionWhenCalledAtPath(e,t,s){return this.bound||this.bind(),this.variable.getReturnExpressionWhenCalledAtPath(e,t,s)}hasEffects(){return this.context.options.treeshake.unknownGlobalSideEffects&&this.variable instanceof pt&&this.variable.hasEffectsWhenAccessedAtPath(B)}hasEffectsWhenAccessedAtPath(e,t){return null!==this.variable&&this.variable.hasEffectsWhenAccessedAtPath(e,t)}hasEffectsWhenAssignedAtPath(e,t){return!this.variable||this.variable.hasEffectsWhenAssignedAtPath(e,t)}hasEffectsWhenCalledAtPath(e,t,s){return!this.variable||this.variable.hasEffectsWhenCalledAtPath(e,t,s)}include(){this.included||(this.included=!0,null!==this.variable&&this.context.includeVariable(this.variable))}includeCallArguments(e,t){this.variable.includeCallArguments(e,t)}render(e,t,{renderedParentType:s,isCalleeOfRenderedParent:i,isShorthandProperty:n}=tt){if(this.variable){const t=this.variable.getName();t!==this.name&&(e.overwrite(this.start,this.end,t,{contentOnly:!0,storeName:!0}),n&&e.prependRight(this.start,this.name+": ")),"eval"===t&&"CallExpression"===s&&i&&e.appendRight(this.start,"0, ")}}disallowImportReassignment(){return this.context.error({code:"ILLEGAL_REASSIGNMENT",message:`Illegal reassignment to import '${this.name}'`},this.start)}}class mt extends qe{constructor(){super(...arguments),this.declarationInit=null}addExportedVariables(e,t){this.argument.addExportedVariables(e,t)}bind(){super.bind(),null!==this.declarationInit&&this.declarationInit.deoptimizePath([V,V])}declare(e,t){return this.declarationInit=t,this.argument.declare(e,q)}deoptimizePath(e){0===e.length&&this.argument.deoptimizePath(B)}hasEffectsWhenAssignedAtPath(e,t){return e.length>0||this.argument.hasEffectsWhenAssignedAtPath(B,t)}}class gt extends qe{constructor(){super(...arguments),this.isPrototypeDeoptimized=!1}createScope(e){this.scope=new et(e,this.context)}deoptimizePath(e){1===e.length&&("prototype"===e[0]?this.isPrototypeDeoptimized=!0:e[0]===V&&(this.isPrototypeDeoptimized=!0,this.scope.getReturnExpression().deoptimizePath(F)))}getReturnExpressionWhenCalledAtPath(e){return 0===e.length?this.scope.getReturnExpression():q}hasEffects(){return null!==this.id&&this.id.hasEffects()}hasEffectsWhenAccessedAtPath(e){return!(e.length<=1)&&(e.length>2||"prototype"!==e[0]||this.isPrototypeDeoptimized)}hasEffectsWhenAssignedAtPath(e){return!(e.length<=1)&&(e.length>2||"prototype"!==e[0]||this.isPrototypeDeoptimized)}hasEffectsWhenCalledAtPath(e,t,s){if(e.length>0)return!0;for(const e of this.params)if(e.hasEffects(s))return!0;const i=s.replacedVariableInits.get(this.scope.thisVariable);s.replacedVariableInits.set(this.scope.thisVariable,t.withNew?new de:q);const{brokenFlow:n,ignore:r}=s;return s.ignore={breaks:!1,continues:!1,labels:new Set,returnAwaitYield:!0},!!this.body.hasEffects(s)||(s.brokenFlow=n,i?s.replacedVariableInits.set(this.scope.thisVariable,i):s.replacedVariableInits.delete(this.scope.thisVariable),s.ignore=r,!1)}include(e,t){this.included=!0,this.id&&this.id.include();const s=this.scope.argumentsVariable.included;for(const i of this.params)i instanceof ft&&!s||i.include(e,t);const{brokenFlow:i}=e;e.brokenFlow=0,this.body.include(e,t),e.brokenFlow=i}includeCallArguments(e,t){this.scope.includeCallArguments(e,t)}initialise(){null!==this.id&&this.id.declare("function",this),this.scope.addParameterVariables(this.params.map(e=>e.declare("parameter",q)),this.params[this.params.length-1]instanceof mt),this.body.addImplicitReturnExpressionToScope()}parseNode(e){this.body=new this.context.nodeConstructors.BlockStatement(e.body,this,this.scope.hoistedBodyVarScope),super.parseNode(e)}}gt.prototype.preventChildBlockScope=!0;class yt extends gt{initialise(){super.initialise(),null!==this.id&&(this.id.variable.isId=!0)}parseNode(e){null!==e.id&&(this.id=new this.context.nodeConstructors.Identifier(e.id,this,this.scope.parent)),super.parseNode(e)}}class xt extends qe{include(e,t){super.include(e,t),t&&this.context.includeVariable(this.variable)}initialise(){const e=this.declaration;this.declarationName=e.id&&e.id.name||this.declaration.name,this.variable=this.scope.addExportDefaultDeclaration(this.declarationName||this.context.getModuleName(),this,this.context),this.context.addExport(this)}render(e,t,s){const{start:i,end:n}=s,r=function(e,t){return w(e,C(e,"default",t)+7)}(e.original,this.start);if(this.declaration instanceof yt)this.renderNamedDeclaration(e,r,"function","(",null===this.declaration.id,t);else if(this.declaration instanceof Xe)this.renderNamedDeclaration(e,r,"class","{",null===this.declaration.id,t);else{if(this.variable.getOriginalVariable()!==this.variable)return void S(this,e,i,n);if(!this.variable.included)return e.remove(this.start,r),this.declaration.render(e,t,{isCalleeOfRenderedParent:!1,renderedParentType:"ExpressionStatement"}),void(";"!==e.original[this.end-1]&&e.appendLeft(this.end,";"));this.renderVariableDeclaration(e,r,t)}this.declaration.render(e,t)}renderNamedDeclaration(e,t,s,i,n,r){const a=this.variable.getName();e.remove(this.start,t),n&&e.appendLeft(function(e,t,s,i){const n=C(e,t,i)+t.length;e=e.slice(n,C(e,s,n));const r=C(e,"*");return-1===r?n:n+r+1}(e.original,s,i,t)," "+a),"system"===r.format&&this.declaration instanceof Xe&&r.exportNamesByVariable.has(this.variable)&&e.appendLeft(this.end,` ${M([this.variable],r)};`)}renderVariableDeclaration(e,t,s){const i=59===e.original.charCodeAt(this.end-1),n="system"===s.format&&s.exportNamesByVariable.get(this.variable);n?(e.overwrite(this.start,t,`${s.varOrConst} ${this.variable.getName()} = exports('${n[0]}', `),e.appendRight(i?this.end-1:this.end,")"+(i?"":";"))):(e.overwrite(this.start,t,`${s.varOrConst} ${this.variable.getName()} = `),i||e.appendLeft(this.end,";"))}}xt.prototype.needsBoundaries=!0;class Et extends ve{constructor(){super("undefined")}getLiteralValueAtPath(){}}class vt extends Ue{constructor(e,t,s){super(e,t,t.declaration,s),this.hasId=!1,this.originalId=null,this.originalVariableAndDeclarationModules=null;const i=t.declaration;(i instanceof yt||i instanceof Xe)&&i.id?(this.hasId=!0,this.originalId=i.id):i instanceof ft&&(this.originalId=i)}addReference(e){this.hasId||(this.name=e.name)}getAssignedVariableName(){return this.originalId&&this.originalId.name||null}getBaseVariableName(){const e=this.getOriginalVariable();return e===this?super.getBaseVariableName():e.getBaseVariableName()}getName(){const e=this.getOriginalVariable();return e===this?super.getName():e.getName()}getOriginalVariable(){return this.getOriginalVariableAndDeclarationModules().original}getOriginalVariableAndDeclarationModules(){if(null===this.originalVariableAndDeclarationModules)if(!this.originalId||!this.hasId&&(this.originalId.variable.isReassigned||this.originalId.variable instanceof Et))this.originalVariableAndDeclarationModules={modules:[],original:this};else{const e=this.originalId.variable;if(e instanceof vt){const{modules:t,original:s}=e.getOriginalVariableAndDeclarationModules();this.originalVariableAndDeclarationModules={modules:t.concat(this.module),original:s}}else this.originalVariableAndDeclarationModules={modules:[this.module],original:e}}return this.originalVariableAndDeclarationModules}}class bt extends ve{constructor(e){super("_missingExportShim"),this.module=e}}class St extends ve{constructor(e,t){super(e.getModuleName()),this.memberVariables=null,this.mergedNamespaces=[],this.referencedEarly=!1,this.references=[],this.context=e,this.module=e.module,this.syntheticNamedExports=t}addReference(e){this.references.push(e),this.name=e.name}deoptimizePath(){const e=this.getMemberVariables();for(const t of Object.keys(e))e[t].deoptimizePath(F)}getMemberVariables(){if(this.memberVariables)return this.memberVariables;const e=Object.create(null);for(const t of this.context.getExports().concat(this.context.getReexports()))"*"!==t[0]&&(e[t]=this.context.traceExport(t));return this.memberVariables=e,this.memberVariables=e}include(){if(!this.included){this.included=!0;for(const e of this.references)if(e.context.getModuleExecIndex()<=this.context.getModuleExecIndex()){this.referencedEarly=!0;break}this.mergedNamespaces=this.context.includeAndGetAdditionalMergedNamespaces();const e=this.getMemberVariables();for(const t of Object.keys(e))e[t].include()}}renderBlock(e){const t=e.compact?"":" ",s=e.compact?"":"\n",i=e.indent,n=this.getMemberVariables(),r=Object.keys(n).map(s=>{const r=n[s];if(this.referencedEarly||r.isReassigned)return`${i}get ${s}${t}()${t}{${t}return ${r.getName()}${e.compact?"":";"}${t}}`;const a=R[s]?`'${s}'`:s;return`${i}${a}: ${r.getName()}`});e.namespaceToStringTag&&r.unshift(`${i}[Symbol.toStringTag]:${t}'Module'`);const a=this.mergedNamespaces.length>0||this.syntheticNamedExports;a||r.unshift(`${i}__proto__:${t}null`);let o=`{${s}${r.join(","+s)}${s}}`;if(a){const e=["/*#__PURE__*/Object.create(null)"];this.mergedNamespaces.length>0&&e.push(...this.mergedNamespaces.map(e=>e.getName())),this.syntheticNamedExports&&e.push(this.module.getDefaultExport().getName()),r.length>0&&e.push(o),o=`/*#__PURE__*/Object.assign(${e.join(","+t)})`}e.freeze&&(o=`/*#__PURE__*/Object.freeze(${o})`);const h=this.getName();return o=`${e.varOrConst} ${h}${t}=${t}${o};`,"system"===e.format&&e.exportNamesByVariable.has(this)&&(o+=`${s}${M([this],e)};`),o}renderFirst(){return this.referencedEarly}}St.prototype.isNamespace=!0;class At extends ve{constructor(e,t,s){super(t),this.context=e,this.module=e.module,this.defaultVariable=s}getBaseVariable(){let e=this.defaultVariable;return e instanceof vt&&(e=e.getOriginalVariable()),e instanceof At&&(e=e.getBaseVariable()),e}getName(){const e=this.name;return`${this.defaultVariable.getName()}${Pt(e)}`}include(){this.included||(this.included=!0,this.context.includeVariable(this.defaultVariable))}}const Pt=e=>/^(?!\d)[\w$]+$/.test(e)?"."+e:`[${JSON.stringify(e)}]`,Ct="Object.defineProperty(exports, '__esModule', { value: true });",kt="Object.defineProperty(exports,'__esModule',{value:true});";function wt(e,t,s,i,n,r,a="return "){const o=n?"":" ",h=n?"":"\n";if(!s){let s;if(e.length>0)s=e[0].local;else for(const e of t)if(e.reexports){const t=e.reexports[0];s=e.namedExportsMode&&"*"!==t.imported&&"default"!==t.imported?`${e.name}.${t.imported}`:e.name;break}return`${a}${s};`}let l="";for(const{name:e,reexports:i}of t)if(i&&s)for(const t of i)"*"===t.reexported&&(l&&(l+=h),t.needsLiveBinding?l+=`Object.keys(${e}).forEach(function${o}(k)${o}{${h}${r}if${o}(k${o}!==${o}'default')${o}Object.defineProperty(exports,${o}k,${o}{${h}${r}${r}enumerable:${o}true,${h}${r}${r}get:${o}function${o}()${o}{${h}${r}${r}${r}return ${e}[k];${h}${r}${r}}${h}${r}});${h}});`:l+=`Object.keys(${e}).forEach(function${o}(k)${o}{${h}${r}if${o}(k${o}!==${o}'default')${o}exports[k]${o}=${o}${e}[k];${h}});`);for(const{name:e,imports:n,reexports:a,isChunk:c,namedExportsMode:u,exportsNames:d}of t)if(a&&s)for(const t of a)if("default"!==t.imported||c)if("*"!==t.imported){l&&(l+=h);const s="default"!==t.imported||u?`${e}.${t.imported}`:e;l+=t.needsLiveBinding?`Object.defineProperty(exports,${o}'${t.reexported}',${o}{${h}${r}enumerable:${o}true,${h}${r}get:${o}function${o}()${o}{${h}${r}${r}return ${s};${h}${r}}${h}});`:`exports.${t.reexported}${o}=${o}${s};`}else"*"!==t.reexported&&(l&&(l+=h),l+=`exports.${t.reexported}${o}=${o}${e};`);else l&&(l+=h),d&&(a.some(e=>"default"===e.imported?"default"===e.reexported:"*"!==e.imported)||n&&n.some(e=>"default"!==e.imported))?l+=`exports.${t.reexported}${o}=${o}${e}${!1!==i?"__default":".default"};`:l+=`exports.${t.reexported}${o}=${o}${e};`;for(const t of e){const e="exports."+t.exported,s=t.local;e!==s&&(l&&(l+=h),l+=`${e}${o}=${o}${s};`)}return l}function Nt(e,t,s){const i=t.compact?"":" ";return e.map(({name:e,exportsNames:n,exportsDefault:r,namedExportsMode:a})=>a&&r&&t.interop?n?`${s} ${e}__default${i}=${i}'default'${i}in ${e}${i}?${i}${e}['default']${i}:${i}${e};`:`${e}${i}=${i}${e}${i}&&${i}Object.prototype.hasOwnProperty.call(${e},${i}'default')${i}?${i}${e}['default']${i}:${i}${e};`:null).filter(Boolean).join(t.compact?"":"\n")}function _t(e,t,s,i){return`${i}var d${e}=${e}Object.getOwnPropertyDescriptor(e,${e}k);${t}${i}Object.defineProperty(n,${e}k,${e}d.get${e}?${e}d${e}:${e}{${t}${i}${s}enumerable:${e}true,${t}${i}${s}get:${e}function${e}()${e}{${t}${i}${s}${s}return e[k];${t}${i}${s}}${t}${i}});${t}`}function It(e,t,s,i){return`${i}n[k]${e}=e${e}[k];${t}`}function $t(e,t,s,i){return`function _interopNamespace(e)${e}{${t}${s}if${e}(e${e}&&${e}e.__esModule)${e}{${e}return e;${e}}${e}else${e}{${t}${s}${s}var n${e}=${e}{};${t}${s}${s}if${e}(e)${e}{${t}${s}${s}${s}Object.keys(e).forEach(function${e}(k)${e}{${t}`+(i?_t:It)(e,t,s,s+s+s+s)+`${s}${s}${s}});${t}`+`${s}${s}}${t}`+`${s}${s}n['default']${e}=${e}e;${t}`+`${s}${s}return n;${t}`+`${s}}${t}`+`}${t}${t}`}const Mt={assert:!0,buffer:!0,console:!0,constants:!0,domain:!0,events:!0,http:!0,https:!0,os:!0,path:!0,process:!0,punycode:!0,querystring:!0,stream:!0,string_decoder:!0,timers:!0,tty:!0,url:!0,util:!0,vm:!0,zlib:!0};function Tt(e,t){const s=t.map(({id:e})=>e).filter(e=>e in Mt);s.length&&e({code:"MISSING_NODE_BUILTINS",message:`Creating a browser bundle that depends on Node.js built-in ${1===s.length?`module ('${s[0]}')`:`modules (${s.slice(0,-1).map(e=>`'${e}'`).join(", ")} and '${s.slice(-1)}')`}. You might need to include https://github.com/ionic-team/rollup-plugin-node-polyfills`,modules:s})}function Lt(e){return e.replace(/^\t+/,e=>e.split("\t").join(" "))}function Rt(e){return e.replace(/[\0?*]/g,"_")}function Ot(e){const t=Te(e);return t.substr(0,t.length-Re(e).length)}function Dt(e){return"undefined"!=typeof process&&Ie(e)?Oe(process.cwd(),e):e}function Vt(e){return!("/"===e[0]||"."===e[0]&&("/"===e[1]||"."===e[1])||Rt(e)!==e||Ie(e))}function Bt(e){throw e instanceof Error||(e=Object.assign(new Error(e.message),e)),e}function Ft(e,t,s,i){if("object"==typeof t){const{line:s,column:n}=t;e.loc={file:i,line:s,column:n}}else{e.pos=t;const{line:n,column:r}=Ge(s,t,{offsetLine:1});e.loc={file:i,line:n,column:r}}if(void 0===e.frame){const{line:t,column:i}=e.loc;e.frame=function(e,t,s){let i=e.split("\n");const n=Math.max(0,t-3);let r=Math.min(t+2,i.length);for(i=i.slice(n,r);!/\S/.test(i[i.length-1]);)i.pop(),r-=1;const a=String(r).length;return i.map((e,i)=>{const r=n+i+1===t;let o=String(i+n+1);for(;o.lengthDt(e.id)).sort();return{code:Wt.MISSING_IMPLICIT_DEPENDANT,message:`Module "${Dt(e.id)}" that should be implicitly loaded before "${1===t.length?t[0]:`${t.slice(0,-1).join('", "')}" and "${t.slice(-1)[0]}`}" is not included in the module graph. Either it was not imported by an included module or only via a tree-shaken dynamic import, or no imported bindings were used and it had otherwise no side-effects.`}}function jt(e,t,s){return{code:Wt.NAMESPACE_CONFLICT,message:`Conflicting namespaces: ${Dt(t.id)} re-exports '${e}' from both ${Dt(t.exportsAll[e])} and ${Dt(s.exportsAll[e])} (will be ignored)`,name:e,reexporter:t.id,sources:[t.exportsAll[e],s.exportsAll[e]]}}function Gt(e){return{code:Wt.VALIDATION_ERROR,message:e}}function Ht(e,t,s){qt(e,t,s.onwarn,s.strictDeprecations)}function qt(e,t,s,i){if(t||i){const t=function(e){return{code:Wt.DEPRECATED_FEATURE,..."string"==typeof e?{message:e}:e}}(e);if(i)return Bt(t);s(t)}}!function(e){e.ASSET_NOT_FINALISED="ASSET_NOT_FINALISED",e.ASSET_NOT_FOUND="ASSET_NOT_FOUND",e.ASSET_SOURCE_ALREADY_SET="ASSET_SOURCE_ALREADY_SET",e.ASSET_SOURCE_MISSING="ASSET_SOURCE_MISSING",e.BAD_LOADER="BAD_LOADER",e.CANNOT_EMIT_FROM_OPTIONS_HOOK="CANNOT_EMIT_FROM_OPTIONS_HOOK",e.CHUNK_NOT_GENERATED="CHUNK_NOT_GENERATED",e.DEPRECATED_FEATURE="DEPRECATED_FEATURE",e.FILE_NOT_FOUND="FILE_NOT_FOUND",e.FILE_NAME_CONFLICT="FILE_NAME_CONFLICT",e.INPUT_HOOK_IN_OUTPUT_PLUGIN="INPUT_HOOK_IN_OUTPUT_PLUGIN",e.INVALID_CHUNK="INVALID_CHUNK",e.INVALID_EXPORT_OPTION="INVALID_EXPORT_OPTION",e.INVALID_EXTERNAL_ID="INVALID_EXTERNAL_ID",e.INVALID_OPTION="INVALID_OPTION",e.INVALID_PLUGIN_HOOK="INVALID_PLUGIN_HOOK",e.INVALID_ROLLUP_PHASE="INVALID_ROLLUP_PHASE",e.MISSING_IMPLICIT_DEPENDANT="MISSING_IMPLICIT_DEPENDANT",e.MIXED_EXPORTS="MIXED_EXPORTS",e.NAMESPACE_CONFLICT="NAMESPACE_CONFLICT",e.PLUGIN_ERROR="PLUGIN_ERROR",e.UNRESOLVED_ENTRY="UNRESOLVED_ENTRY",e.UNRESOLVED_IMPORT="UNRESOLVED_IMPORT",e.VALIDATION_ERROR="VALIDATION_ERROR",e.EXTERNAL_SYNTHETIC_EXPORTS="EXTERNAL_SYNTHETIC_EXPORTS",e.SYNTHETIC_NAMED_EXPORTS_NEED_DEFAULT="SYNTHETIC_NAMED_EXPORTS_NEED_DEFAULT"}(Wt||(Wt={}));const Kt=/^[a-zA-Z$_][a-zA-Z0-9$_]*$/;function Xt(e){return Kt.test(e)?"."+e:`['${e}']`}function Yt(e){return e.split(".").map(Xt).join("")}function Qt(e,t,s,i,n){const r=i?"":" ",a=e.split(".");a[0]=("function"==typeof s?s(a[0]):s[a[0]])||a[0];const o=a.pop();let h=t,l=a.map(e=>(h+=Xt(e),`${h}${r}=${r}${h}${r}||${r}{}`)).concat(`${h}${Xt(o)}`).join(","+r).concat(`${r}=${r}${n}`);return a.length>0&&(l=`(${l})`),l}function Jt(e){let t=e.length;for(;t--;){const s=e[t];if(s.exportsDefault||s.exportsNames)return e.slice(0,t+1)}return[]}const Zt=e=>"this"+Yt(e);function es({dependencies:e,exports:t}){const s=new Set(t.map(e=>e.exported));s.has("default")||s.add("default");for(const{reexports:t}of e)if(t)for(const e of t)"*"===e.imported||s.has(e.reexported)||s.add(e.reexported);return s}function ts(e,t,s,i){return 0===e.length?"":1===e.length?`${s}${s}${s}exports('${e[0].name}',${t}${e[0].value});${i}${i}`:`${s}${s}${s}exports({${i}`+e.map(({name:e,value:i})=>`${s}${s}${s}${s}${e}:${t}${i}`).join(","+i)+`${i}${s}${s}${s}});${i}${i}`}function ss(e,t){return e?`${t}${Yt(e)}`:"null"}var is={system:function(e,{accessedGlobals:t,dependencies:s,exports:i,hasExports:n,indentString:r,intro:a,outro:o,usesTopLevelAwait:h,varOrConst:l},c){const u=c.compact?"":"\n",d=c.compact?"":" ",p=s.map(e=>`'${e.id}'`),f=[];let m;const g=[];for(const{imports:e,reexports:t}of s){const n=[];if(e)for(const t of e)f.push(t.local),"*"===t.imported?n.push(`${t.local}${d}=${d}module;`):n.push(`${t.local}${d}=${d}module.${t.imported};`);if(t){let e=!1;if(t.length>1||1===t.length&&("*"===t[0].reexported||"*"===t[0].imported)){for(const a of t)"*"===a.reexported&&(m||(m=es({dependencies:s,exports:i})),e||(n.push(`${l} _setter${d}=${d}{};`),e=!0),n.push(`for${d}(var _$p${d}in${d}module)${d}{`),n.push(`${r}if${d}(!_starExcludes[_$p])${d}_setter[_$p]${d}=${d}module[_$p];`),n.push("}"));for(const e of t)"*"===e.imported&&"*"!==e.reexported&&n.push(`exports('${e.reexported}',${d}module);`);for(const s of t)"*"!==s.reexported&&"*"!==s.imported&&(e||(n.push(`${l} _setter${d}=${d}{};`),e=!0),n.push(`_setter.${s.reexported}${d}=${d}module.${s.imported};`));e&&n.push("exports(_setter);")}else for(const e of t)n.push(`exports('${e.reexported}',${d}module.${e.imported});`)}g.push(n.join(`${u}${r}${r}${r}`))}const y=c.name?`'${c.name}',${d}`:"",x=t.has("module")?`exports,${d}module`:n?"exports":"";let E=`System.register(${y}[`+p.join(","+d)+`],${d}function${d}(${x})${d}{${u}${r}${c.strict?"'use strict';":""}`+((e,t,s,i,n)=>e?`${n}${i}${t} _starExcludes${s}=${s}{${s}${[...e].map(e=>`${e}:${s}1`).join(","+s)}${s}};`:"")(m,l,d,r,u)+((e,t,s,i)=>e.length?`${i}${s}var ${e.join(","+t)};`:"")(f,d,r,u)+`${u}${r}return${d}{${g.length?`${u}${r}${r}setters:${d}[${g.map(e=>e?`function${d}(module)${d}{${u}${r}${r}${r}${e}${u}${r}${r}}`:c.systemNullSetters?"null":`function${d}()${d}{}`).join(","+d)}],`:""}${u}`;E+=`${r}${r}execute:${d}${h?"async"+d:""}function${d}()${d}{${u}${u}`+((e,t,s,i)=>ts(e.filter(e=>e.hoisted||e.uninitialized).map(e=>({name:e.exported,value:e.uninitialized?"void 0":e.local})),t,s,i))(i,d,r,u);const v=`${u}${u}`+((e,t,s,i)=>ts(e.filter(e=>e.expression).map(e=>({name:e.exported,value:e.local})),t,s,i))(i,d,r,u)+((e,t,s,i)=>ts(e.filter(e=>"_missingExportShim"===e.local).map(e=>({name:e.exported,value:"_missingExportShim"})),t,s,i))(i,d,r,u)+`${r}${r}}${u}${r}}${c.compact?"":";"}${u}});`;return a&&e.prepend(a),o&&e.append(o),e.indent(`${r}${r}${r}`).append(v).prepend(E)},amd:function(e,{accessedGlobals:t,dependencies:s,exports:i,hasExports:n,indentString:r,intro:a,isEntryModuleFacade:o,namedExportsMode:h,outro:l,varOrConst:c,warn:u},d){Tt(u,s);const p=s.map(e=>{return`'${t=e.id,"."===t[0]&&t.endsWith(".js")?t.slice(0,-3):t}'`;var t}),f=s.map(e=>e.name),m=d.compact?"":"\n",g=d.compact?"":" ";h&&n&&(f.unshift("exports"),p.unshift("'exports'")),t.has("require")&&(f.unshift("require"),p.unshift("'require'")),t.has("module")&&(f.unshift("module"),p.unshift("'module'"));const y=d.amd||{},x=(y.id?`'${y.id}',${g}`:"")+(p.length?`[${p.join(","+g)}],${g}`:""),E=d.strict?g+"'use strict';":"",v=`${y.define}(${x}function${g}(${f.join(","+g)})${g}{${E}${m}${m}`,b=Nt(s,d,c);b&&e.prepend(b+m+m),t.has("_interopNamespace")&&e.prepend($t(g,m,r,d.externalLiveBindings)),a&&e.prepend(a);const S=wt(i,s,h,d.interop,d.compact,r);return S&&e.append(m+m+S),h&&n&&o&&d.esModule&&e.append(`${m}${m}${d.compact?kt:Ct}`),l&&e.append(l),e.indent(r).append(m+m+"});").prepend(v)},cjs:function(e,{accessedGlobals:t,dependencies:s,exports:i,hasExports:n,indentString:r,intro:a,isEntryModuleFacade:o,namedExportsMode:h,outro:l,varOrConst:c},u){const d=u.compact?"":"\n",p=u.compact?"":" ";a=(!1===u.strict?a:`'use strict';${d}${d}${a}`)+(h&&n&&o&&u.esModule?`${u.compact?kt:Ct}${d}${d}`:"");let f,m=!1,g=!1;f="";for(const{id:e,namedExportsMode:t,isChunk:i,name:n,reexports:r,imports:a,exportsNames:o,exportsDefault:h}of s)r||a?(f+=u.compact&&g?",":`${f?";"+d:""}${c} `,g=!0,u.interop&&!i&&h&&t?(m=!0,f+=o?`${n}${p}=${p}require('${e}')${u.compact?",":`;\n${c} `}${n}__default${p}=${p}_interopDefault(${n})`:`${n}${p}=${p}_interopDefault(require('${e}'))`):f+=`${n}${p}=${p}require('${e}')`):(f&&(f+=!u.compact||g?";"+d:","),g=!1,f+=`require('${e}')`);if(f&&(f+=";"),m){const e=u.compact?"e":"ex";a+=`function _interopDefault${p}(${e})${p}{${p}return${p}(${e}${p}&&${p}(typeof ${e}${p}===${p}'object')${p}&&${p}'default'${p}in ${e})${p}?${p}${e}['default']${p}:${p}${e}${u.compact?"":"; "}}${d}${d}`}t.has("_interopNamespace")&&(a+=$t(p,d,r,u.externalLiveBindings)),f&&(a+=f+d+d);const y=wt(i,s,h,u.interop,u.compact,r,`module.exports${p}=${p}`);return e.prepend(a),y&&e.append(d+d+y),l&&e.append(l),e},es:function(e,{intro:t,outro:s,dependencies:i,exports:n,varOrConst:r},a){const o=a.compact?"":" ",h=a.compact?"":"\n",l=function(e,t){const s=[];for(const{id:i,reexports:n,imports:r,name:a}of e)if(n||r){if(r){let e=null,n=null;const a=[];for(const t of r)"default"===t.imported?e=t:"*"===t.imported?n=t:a.push(t);n&&s.push(`import${t}*${t}as ${n.local} from${t}'${i}';`),e&&0===a.length?s.push(`import ${e.local} from${t}'${i}';`):a.length>0&&s.push(`import ${e?`${e.local},${t}`:""}{${t}${a.map(e=>e.imported===e.local?e.imported:`${e.imported} as ${e.local}`).join(","+t)}${t}}${t}from${t}'${i}';`)}if(n){let e=null;const o=[],h=[];for(const t of n)"*"===t.reexported?e=t:"*"===t.imported?o.push(t):h.push(t);if(e&&s.push(`export${t}*${t}from${t}'${i}';`),o.length>0){r&&r.some(e=>"*"===e.imported&&e.local===a)||s.push(`import${t}*${t}as ${a} from${t}'${i}';`);for(const e of o)s.push(`export${t}{${t}${a===e.reexported?a:`${a} as ${e.reexported}`} };`)}h.length>0&&s.push(`export${t}{${t}${h.map(e=>e.imported===e.reexported?e.imported:`${e.imported} as ${e.reexported}`).join(","+t)}${t}}${t}from${t}'${i}';`)}}else s.push(`import${t}'${i}';`);return s}(i,o);l.length>0&&(t+=l.join(h)+h+h),t&&e.prepend(t);const c=function(e,t,s){const i=[],n=[];for(const r of e)"default"===r.exported?i.push(`export default ${r.local};`):(r.expression&&i.push(`${s} ${r.local}${t}=${t}${r.expression};`),n.push(r.exported===r.local?r.local:`${r.local} as ${r.exported}`));return n.length&&i.push(`export${t}{${t}${n.join(","+t)}${t}};`),i}(n,o,r);return c.length&&e.append(h+h+c.join(h).trim()),s&&e.append(s),e.trim()},iife:function(e,{dependencies:t,exports:s,hasExports:i,indentString:n,intro:r,namedExportsMode:a,outro:o,varOrConst:h,warn:l},c){const u=c.compact?"":" ",d=c.compact?"":"\n",{extend:p,name:f}=c,m=f&&-1!==f.indexOf("."),g=!p&&!m;if(f&&g&&(ke(y=f)||Pe.has(y)||Ce.test(y)))return Bt({code:"ILLEGAL_IDENTIFIER_AS_NAME",message:`Given name "${f}" is not a legal JS identifier. If you need this, you can try "output.extend: true".`});var y;Tt(l,t);const x=Jt(t),E=x.map(e=>e.globalName||"null"),v=x.map(e=>e.name);i&&!f&&l({code:"MISSING_NAME_OPTION_FOR_IIFE_EXPORT",message:'If you do not supply "output.name", you may not be able to access the exports of an IIFE bundle.'}),a&&i&&(p?(E.unshift(`${Zt(f)}${u}=${u}${Zt(f)}${u}||${u}{}`),v.unshift("exports")):(E.unshift("{}"),v.unshift("exports")));const b=c.strict?`${n}'use strict';${d}${d}`:"";let S=`(function${u}(${v.join(","+u)})${u}{${d}${b}`;!i||p&&a||!f||(S=(g?`${h} ${f}`:Zt(f))+`${u}=${u}${S}`),m&&i&&(S=function(e,t,s,i){const n=i?"":" ",r=e.split(".");r[0]=("function"==typeof s?s(r[0]):s[r[0]])||r[0],r.pop();let a=t;return r.map(e=>(a+=Xt(e),`${a}${n}=${n}${a}${n}||${n}{}${i?"":";"}`)).join(i?",":"\n")+(i&&r.length?";":"\n")}(f,"this",c.globals,c.compact)+S);let A=`${d}${d}}(${E.join(","+u)}));`;!p&&a&&i&&(A=`${d}${d}${n}return exports;${A}`);const P=Nt(t,c,h);P&&e.prepend(P+d+d),r&&e.prepend(r);const C=wt(s,t,a,c.interop,c.compact,n);return C&&e.append(d+d+C),o&&e.append(o),e.indent(n).prepend(S).append(A)},umd:function(e,{dependencies:t,exports:s,hasExports:i,indentString:n,intro:r,namedExportsMode:a,outro:o,varOrConst:h,warn:l},c){const u=c.compact?"":" ",d=c.compact?"":"\n",p=c.compact?"f":"factory",f=c.compact?"g":"global";if(i&&!c.name)return Bt({code:"MISSING_NAME_OPTION_FOR_IIFE_EXPORT",message:'You must supply "output.name" for UMD bundles that have exports so that the exports are accessible in environments without a module loader.'});Tt(l,t);const m=t.map(e=>`'${e.id}'`),g=t.map(e=>`require('${e.id}')`),y=Jt(t),x=y.map(e=>ss(e.globalName,f)),E=y.map(e=>e.name);a&&(i||c.noConflict)&&(m.unshift("'exports'"),g.unshift("exports"),x.unshift(Qt(c.name,f,c.globals,c.compact,(c.extend?`${ss(c.name,f)}${u}||${u}`:"")+"{}")),E.unshift("exports"));const v=(c.amd.id?`'${c.amd.id}',${u}`:"")+(m.length?`[${m.join(","+u)}],${u}`:""),b=c.amd.define,S=!a&&i?`module.exports${u}=${u}`:"",A=c.strict?`${u}'use strict';${d}`:"";let P;if(c.noConflict){const e=c.compact?"e":"exports";let t;!a&&i?t=`var ${e}${u}=${u}${Qt(c.name,f,c.globals,c.compact,`${p}(${x.join(","+u)})`)};`:a&&(t=`var ${e}${u}=${u}${x.shift()};${d}${n}${n}${p}(${[e].concat(x).join(","+u)});`),P=`(function${u}()${u}{${d}${n}${n}var current${u}=${u}${function(e,t,s){const i=e.split(".");let n=t;return i.map(e=>(n+=Xt(e),n)).join(`${s}&&${s}`)}(c.name,f,u)};${d}${n}${n}${t}${d}${n}${n}${e}.noConflict${u}=${u}function${u}()${u}{${u}${ss(c.name,f)}${u}=${u}current;${u}return ${e}${c.compact?"":"; "}};${d}`+n+"}())"}else P=`${p}(${x.join(","+u)})`,!a&&i&&(P=Qt(c.name,f,c.globals,c.compact,P));const C=i||!0===c.noConflict&&a||x.length>0,k=C?"this,"+u:"",w=C?`(${f}${u}=${u}${f}${u}||${u}self,${u}`:"",N=C?")":"",_=`(function${u}(${C?`${f},${u}`:""}${p})${u}{${d}`+(C?`${n}typeof exports${u}===${u}'object'${u}&&${u}typeof module${u}!==${u}'undefined'${u}?${u}${S}${p}(${g.join(","+u)})${u}:${d}`:"")+`${n}typeof ${b}${u}===${u}'function'${u}&&${u}${b}.amd${u}?${u}${b}(${v}${p})${u}:${d}`+`${n}${w}${P}${N};${d}`+`}(${k}(function${u}(${E.join(", ")})${u}{${A}${d}`,I=d+d+"})));",$=Nt(t,c,h);$&&e.prepend($+d+d),r&&e.prepend(r);const M=wt(s,t,a,c.interop,c.compact,n);return M&&e.append(d+d+M),a&&i&&c.esModule&&e.append(d+d+(c.compact?kt:Ct)),o&&e.append(o),e.trim().indent(n).append(I).prepend(_)}};const ns={ArrayPattern(e,t){for(const s of t.elements)s&&ns[s.type](e,s)},AssignmentPattern(e,t){ns[t.left.type](e,t.left)},Identifier(e,t){e.push(t.name)},MemberExpression(){},ObjectPattern(e,t){for(const s of t.properties)"RestElement"===s.type?ns.RestElement(e,s):ns[s.value.type](e,s.value)},RestElement(e,t){ns[t.argument.type](e,t.argument)}},rs=function(e){const t=[];return ns[e.type](t,e),t};class as extends qe{hasEffects(){return!1}initialise(){this.context.addExport(this)}render(e,t,s){e.remove(s.start,s.end)}}as.prototype.needsBoundaries=!0;class os extends je{addDeclaration(e,t,s=null,i){return i?this.parent.addDeclaration(e,t,"function"===i?s:q,i):super.addDeclaration(e,t,s,!1)}}class hs extends qe{initialise(){this.directive&&"use strict"!==this.directive&&"Program"===this.parent.type&&this.context.warn({code:"MODULE_LEVEL_DIRECTIVE",message:`Module level directives cause errors when bundled, '${this.directive}' was ignored.`},this.start)}render(e,t){super.render(e,t),this.included&&this.insertSemicolon(e)}shouldBeIncluded(e){return this.directive&&"use strict"!==this.directive?"Program"!==this.parent.type:super.shouldBeIncluded(e)}}class ls extends qe{constructor(){super(...arguments),this.directlyIncluded=!1}addImplicitReturnExpressionToScope(){const e=this.body[this.body.length-1];e&&"ReturnStatement"===e.type||this.scope.addReturnExpression(q)}createScope(e){this.scope=this.parent.preventChildBlockScope?e:new os(e)}hasEffects(e){if(this.deoptimizeBody)return!0;for(const t of this.body){if(t.hasEffects(e))return!0;if(e.brokenFlow)break}return!1}include(e,t){if(!this.deoptimizeBody||!this.directlyIncluded){this.included=!0,this.directlyIncluded=!0,this.deoptimizeBody&&(t=!0);for(const s of this.body)(t||s.shouldBeIncluded(e))&&s.include(e,t)}}initialise(){const e=this.body[0];this.deoptimizeBody=e instanceof hs&&"use asm"===e.directive}render(e,t){this.body.length?_(this.body,e,this.start+1,this.end-1,t):super.render(e,t)}}class cs extends qe{createScope(e){this.scope=new Ze(e,this.context)}deoptimizePath(e){1===e.length&&e[0]===V&&this.scope.getReturnExpression().deoptimizePath(F)}getReturnExpressionWhenCalledAtPath(e){return 0===e.length?this.scope.getReturnExpression():q}hasEffects(){return!1}hasEffectsWhenAccessedAtPath(e){return e.length>1}hasEffectsWhenAssignedAtPath(e){return e.length>1}hasEffectsWhenCalledAtPath(e,t,s){if(e.length>0)return!0;for(const e of this.params)if(e.hasEffects(s))return!0;const{ignore:i,brokenFlow:n}=s;return s.ignore={breaks:!1,continues:!1,labels:new Set,returnAwaitYield:!0},!!this.body.hasEffects(s)||(s.ignore=i,s.brokenFlow=n,!1)}include(e,t){this.included=!0;for(const s of this.params)s instanceof ft||s.include(e,t);const{brokenFlow:s}=e;e.brokenFlow=0,this.body.include(e,t),e.brokenFlow=s}includeCallArguments(e,t){this.scope.includeCallArguments(e,t)}initialise(){this.scope.addParameterVariables(this.params.map(e=>e.declare("parameter",q)),this.params[this.params.length-1]instanceof mt),this.body instanceof ls?this.body.addImplicitReturnExpressionToScope():this.scope.addReturnExpression(this.body)}parseNode(e){"BlockStatement"===e.body.type&&(this.body=new this.context.nodeConstructors.BlockStatement(e.body,this,this.scope.hoistedBodyVarScope)),super.parseNode(e)}}cs.prototype.preventChildBlockScope=!0;const us={"!=":(e,t)=>e!=t,"!==":(e,t)=>e!==t,"%":(e,t)=>e%t,"&":(e,t)=>e&t,"*":(e,t)=>e*t,"**":(e,t)=>e**t,"+":(e,t)=>e+t,"-":(e,t)=>e-t,"/":(e,t)=>e/t,"<":(e,t)=>ee<e<=t,"==":(e,t)=>e==t,"===":(e,t)=>e===t,">":(e,t)=>e>t,">=":(e,t)=>e>=t,">>":(e,t)=>e>>t,">>>":(e,t)=>e>>>t,"^":(e,t)=>e^t,in:()=>H,instanceof:()=>H,"|":(e,t)=>e|t};class ds extends qe{getLiteralValueAtPath(e){return e.length>0||null===this.value&&110!==this.context.code.charCodeAt(this.start)||"bigint"==typeof this.value||47===this.context.code.charCodeAt(this.start)?H:this.value}getReturnExpressionWhenCalledAtPath(e){return 1!==e.length?q:Ee(this.members,e[0])}hasEffectsWhenAccessedAtPath(e){return null===this.value?e.length>0:e.length>1}hasEffectsWhenAssignedAtPath(e){return e.length>0}hasEffectsWhenCalledAtPath(e,t,s){return 1!==e.length||xe(this.members,e[0],this.included,t,s)}initialise(){this.members=function(e){switch(typeof e){case"boolean":return me;case"number":return ge;case"string":return ye;default:return Object.create(null)}}(this.value)}parseNode(e){this.value=e.value,this.regex=e.regex,super.parseNode(e)}render(e){"string"==typeof this.value&&e.indentExclusionRanges.push([this.start+1,this.end-1])}}function ps(e){return e.computed?(t=e.property)instanceof ds?String(t.value):null:e.property.name;var t}class fs extends qe{constructor(){super(...arguments),this.variable=null,this.bound=!1,this.expressionsToBeDeoptimized=[],this.replacement=null,this.wasPathDeoptimizedWhileOptimized=!1}addExportedVariables(){}bind(){if(this.bound)return;this.bound=!0;const e=function e(t){const s=t.propertyKey,i=t.object;if("string"==typeof s){if(i instanceof ft)return[{key:i.name,pos:i.start},{key:s,pos:t.property.start}];if(i instanceof fs){const n=e(i);return n&&[...n,{key:s,pos:t.property.start}]}}return null}(this),t=e&&this.scope.findVariable(e[0].key);if(t&&t.isNamespace){const s=this.resolveNamespaceVariables(t,e.slice(1));s?"string"==typeof s?this.replacement=s:(s instanceof be&&s.module&&s.module.suggestName(e[0].key),this.variable=s,this.scope.addNamespaceMemberAccess(function(e){let t=e[0].key;for(let s=1;s0||this.value.hasEffectsWhenCalledAtPath(B,t,s)}}class Es{constructor(e){this.included=!1,this.expressions=e}deoptimizePath(e){for(const t of this.expressions)t.deoptimizePath(e)}getLiteralValueAtPath(){return H}getReturnExpressionWhenCalledAtPath(e,t,s){return new Es(this.expressions.map(i=>i.getReturnExpressionWhenCalledAtPath(e,t,s)))}hasEffectsWhenAccessedAtPath(e,t){for(const s of this.expressions)if(s.hasEffectsWhenAccessedAtPath(e,t))return!0;return!1}hasEffectsWhenAssignedAtPath(e,t){for(const s of this.expressions)if(s.hasEffectsWhenAssignedAtPath(e,t))return!0;return!1}hasEffectsWhenCalledAtPath(e,t,s){for(const i of this.expressions)if(i.hasEffectsWhenCalledAtPath(e,t,s))return!0;return!1}include(e,t){for(const s of this.expressions)s.included||s.include(e,t)}includeCallArguments(){}}class vs extends qe{bind(){null!==this.declaration&&this.declaration.bind()}hasEffects(e){return null!==this.declaration&&this.declaration.hasEffects(e)}initialise(){this.context.addExport(this)}render(e,t,s){const{start:i,end:n}=s;null===this.declaration?e.remove(i,n):(e.remove(this.start,this.declaration.start),this.declaration.render(e,t,{start:i,end:n}))}}vs.prototype.needsBoundaries=!0;const bs=Symbol("unset");class Ss extends qe{bind(){}hasEffects(){return!1}initialise(){this.context.addImport(this)}render(e,t,s){e.remove(s.start,s.end)}}Ss.prototype.needsBoundaries=!0;const As="ROLLUP_ASSET_URL_",Ps="ROLLUP_FILE_URL_",Cs={amd:["document","module","URL"],cjs:["document","require","URL"],iife:["document","URL"],system:["module"],umd:["document","require","URL"]},ks={amd:["document","require","URL"],cjs:["document","require","URL"],iife:["document","URL"],system:["module","URL"],umd:["document","require","URL"]},ws=(e,t="URL")=>`new ${t}(${e}).href`,Ns=e=>ws(`'${e}', document.currentScript && document.currentScript.src || document.baseURI`),_s=e=>(t,s)=>{const i=e(s);return null===t?`({ url: ${i} })`:"url"===t?i:"undefined"},Is=e=>`(document.currentScript && document.currentScript.src || new URL('${e}', document.baseURI).href)`,$s={amd:e=>("."!==e[0]&&(e="./"+e),ws(`require.toUrl('${e}'), document.baseURI`)),cjs:e=>`(typeof document === 'undefined' ? ${ws(`'file:' + __dirname + '/${e}'`,"(require('u' + 'rl').URL)")} : ${Ns(e)})`,es:e=>ws(`'${e}', import.meta.url`),iife:e=>Ns(e),system:e=>ws(`'${e}', module.meta.url`),umd:e=>`(typeof document === 'undefined' ? ${ws(`'file:' + __dirname + '/${e}'`,"(require('u' + 'rl').URL)")} : ${Ns(e)})`},Ms={amd:_s(()=>ws("module.uri, document.baseURI")),cjs:_s(e=>`(typeof document === 'undefined' ? ${ws("'file:' + __filename","(require('u' + 'rl').URL)")} : ${Is(e)})`),iife:_s(e=>Is(e)),system:e=>null===e?"module.meta":"module.meta."+e,umd:_s(e=>`(typeof document === 'undefined' ? ${ws("'file:' + __filename","(require('u' + 'rl').URL)")} : ${Is(e)})`)};class Ts extends qe{bind(){super.bind(),this.argument.deoptimizePath([V,V])}}class Ls extends qe{constructor(){super(...arguments),this.hasCachedEffect=!1}hasEffects(e){if(this.hasCachedEffect)return!0;for(const t of this.body)if(t.hasEffects(e))return this.hasCachedEffect=!0;return!1}include(e,t){this.included=!0;for(const s of this.body)(t||s.shouldBeIncluded(e))&&s.include(e,t)}render(e,t){this.body.length?_(this.body,e,this.start,this.end,t):super.render(e,t)}}class Rs extends qe{hasEffects(e){if(this.test&&this.test.hasEffects(e))return!0;for(const t of this.consequent){if(e.brokenFlow)break;if(t.hasEffects(e))return!0}return!1}include(e,t){this.included=!0,this.test&&this.test.include(e,t);for(const s of this.consequent)(t||s.shouldBeIncluded(e))&&s.include(e,t)}render(e,t,s){if(this.consequent.length){this.test&&this.test.render(e,t);const i=this.test?this.test.end:C(e.original,"default",this.start)+7,n=C(e.original,":",i)+1;_(this.consequent,e,n,s.end,t)}else super.render(e,t)}}Rs.prototype.needsBoundaries=!0;class Os extends qe{getLiteralValueAtPath(e){return e.length>0||1!==this.quasis.length?H:this.quasis[0].value.cooked}render(e,t){e.indentExclusionRanges.push([this.start,this.end]),super.render(e,t)}}class Ds extends je{constructor(e,t){super(e),this.context=t,this.variables.set("this",new Ue("this",null,K,t))}addExportDefaultDeclaration(e,t,s){const i=new vt(e,t,s);return this.variables.set("default",i),i}addNamespaceMemberAccess(e,t){t instanceof pt&&this.accessedOutsideVariables.set(t.name,t)}deconflict(e,t){for(const s of this.children)s.deconflict(e,t)}findLexicalBoundary(){return this}findVariable(e){const t=this.variables.get(e)||this.accessedOutsideVariables.get(e);if(t)return t;const s=this.context.traceVariable(e)||this.parent.findVariable(e);return s instanceof pt&&this.accessedOutsideVariables.set(e,s),s}}const Vs={"!":e=>!e,"+":e=>+e,"-":e=>-e,delete:()=>H,typeof:e=>typeof e,void:()=>{},"~":e=>~e};function Bs(e,t){return null!==e.renderBaseName&&t.has(e)&&e.isReassigned}class Fs extends qe{deoptimizePath(){for(const e of this.declarations)e.deoptimizePath(B)}hasEffectsWhenAssignedAtPath(){return!1}include(e,t){this.included=!0;for(const s of this.declarations)(t||s.shouldBeIncluded(e))&&s.include(e,t)}includeWithAllDeclaredVariables(e,t){this.included=!0;for(const s of this.declarations)s.include(t,e)}initialise(){for(const e of this.declarations)e.declareDeclarator(this.kind)}render(e,t,s=tt){if(function(e,t){for(const s of e){if(!s.included)return!1;if("Identifier"===s.id.type){if(t.has(s.id.variable))return!1}else{const e=[];if(s.id.addExportedVariables(e,t),e.length>0)return!1}}return!0}(this.declarations,t.exportNamesByVariable)){for(const s of this.declarations)s.render(e,t);s.isNoStatement||59===e.original.charCodeAt(this.end-1)||e.appendLeft(this.end,";")}else this.renderReplacedDeclarations(e,t,s)}renderDeclarationEnd(e,t,s,i,n,r,a,o){59===e.original.charCodeAt(this.end-1)&&e.remove(this.end-1,this.end),r&&(t+=";"),null!==s?(10!==e.original.charCodeAt(i-1)||10!==e.original.charCodeAt(this.end)&&13!==e.original.charCodeAt(this.end)||(i--,13===e.original.charCodeAt(i)&&i--),i===s+1?e.overwrite(s,n,t):(e.overwrite(s,s+1,t),e.remove(i,n))):e.appendLeft(n,t),a.length>0&&e.appendLeft(n,` ${M(a,o)};`)}renderReplacedDeclarations(e,t,{start:s=this.start,end:i=this.end,isNoStatement:n}){const r=I(this.declarations,e,this.start+this.kind.length,this.end-(59===e.original.charCodeAt(this.end-1)?1:0));let a,o;o=/\n\s*$/.test(e.slice(this.start,r[0].start))?this.start+this.kind.length:r[0].start;let h=o-1;e.remove(this.start,h);let l,c,u=!1,d=!1,p="";const f=[];for(const{node:s,start:i,separator:n,contentEnd:m,end:g}of r)if(!s.included||s.id instanceof ft&&Bs(s.id.variable,t.exportNamesByVariable)&&null===s.init)e.remove(i,g);else{if(l="",c="",s.id instanceof ft&&Bs(s.id.variable,t.exportNamesByVariable))d&&(p+=";"),u=!1;else{if("system"===t.format&&null!==s.init)if("Identifier"!==s.id.type)s.id.addExportedVariables(f,t.exportNamesByVariable);else{const i=t.exportNamesByVariable.get(s.id.variable);if(i){const n=t.compact?"":" ",r=C(e.original,"=",s.id.end);e.prependLeft(w(e.original,r+1),1===i.length?`exports('${i[0]}',${n}`:T([s.id.variable],!1,t)),c+=")"}}u?p+=",":(d&&(p+=";"),l+=this.kind+" ",u=!0)}o===h+1?e.overwrite(h,o,p+l):(e.overwrite(h,h+1,p),e.appendLeft(o,l)),s.render(e,t),a=m,o=g,d=!0,h=n,p=c}d?this.renderDeclarationEnd(e,p,h,a,o,!n,f,t):e.remove(s,i)}}const Ws={ArrayExpression:class extends qe{bind(){super.bind();for(const e of this.elements)null!==e&&e.deoptimizePath(F)}getReturnExpressionWhenCalledAtPath(e){return 1!==e.length?q:Ee(fe,e[0])}hasEffectsWhenAccessedAtPath(e){return e.length>1}hasEffectsWhenCalledAtPath(e,t,s){return 1!==e.length||xe(fe,e[0],this.included,t,s)}},ArrayPattern:class extends qe{addExportedVariables(e,t){for(const s of this.elements)null!==s&&s.addExportedVariables(e,t)}declare(e){const t=[];for(const s of this.elements)null!==s&&t.push(...s.declare(e,q));return t}deoptimizePath(e){if(0===e.length)for(const t of this.elements)null!==t&&t.deoptimizePath(e)}hasEffectsWhenAssignedAtPath(e,t){if(e.length>0)return!0;for(const e of this.elements)if(null!==e&&e.hasEffectsWhenAssignedAtPath(B,t))return!0;return!1}},ArrowFunctionExpression:cs,AssignmentExpression:class extends qe{constructor(){super(...arguments),this.deoptimized=!1}hasEffects(e){return this.deoptimized||this.applyDeoptimizations(),this.right.hasEffects(e)||this.left.hasEffects(e)||this.left.hasEffectsWhenAssignedAtPath(B,e)}hasEffectsWhenAccessedAtPath(e,t){return e.length>0&&this.right.hasEffectsWhenAccessedAtPath(e,t)}include(e,t){this.deoptimized||this.applyDeoptimizations(),this.included=!0,this.left.include(e,t),this.right.include(e,t)}render(e,t){if(this.left.render(e,t),this.right.render(e,t),"system"===t.format){const s=this.left.variable&&t.exportNamesByVariable.get(this.left.variable);if("Identifier"===this.left.type&&s){const i=t.compact?"":" ",n=C(e.original,this.operator,this.left.end),r=this.operator.length>1?`${s[0]}${i}${this.operator.slice(0,-1)}${i}`:"";e.overwrite(n,w(e.original,n+this.operator.length),`=${i}${1===s.length?`exports('${s[0]}',${i}`:T([this.left.variable],!1,t)}${r}`),e.appendLeft(this.right.end,")")}else{const s=[];this.left.addExportedVariables(s,t.exportNamesByVariable),s.length>0&&(e.prependRight(this.start,T(s,!0,t)),e.appendLeft(this.end,")"))}}}applyDeoptimizations(){this.deoptimized=!0,this.left.deoptimizePath(B),this.right.deoptimizePath(F)}},AssignmentPattern:class extends qe{addExportedVariables(e,t){this.left.addExportedVariables(e,t)}bind(){super.bind(),this.left.deoptimizePath(B),this.right.deoptimizePath(F)}declare(e,t){return this.left.declare(e,t)}deoptimizePath(e){0===e.length&&this.left.deoptimizePath(e)}hasEffectsWhenAssignedAtPath(e,t){return e.length>0||this.left.hasEffectsWhenAssignedAtPath(B,t)}render(e,t,{isShorthandProperty:s}=tt){this.left.render(e,t,{isShorthandProperty:s}),this.right.render(e,t)}},AwaitExpression:class extends qe{hasEffects(e){return!e.ignore.returnAwaitYield||this.argument.hasEffects(e)}include(e,t){if(!this.included){this.included=!0;e:if(!this.context.usesTopLevelAwait){let e=this.parent;do{if(e instanceof gt||e instanceof cs)break e}while(e=e.parent);this.context.usesTopLevelAwait=!0}}this.argument.include(e,t)}},BinaryExpression:class extends qe{deoptimizeCache(){}getLiteralValueAtPath(e,t,s){if(e.length>0)return H;const i=this.left.getLiteralValueAtPath(B,t,s);if(i===H)return H;const n=this.right.getLiteralValueAtPath(B,t,s);if(n===H)return H;const r=us[this.operator];return r?r(i,n):H}hasEffects(e){return"+"===this.operator&&this.parent instanceof hs&&""===this.left.getLiteralValueAtPath(B,z,this)||super.hasEffects(e)}hasEffectsWhenAccessedAtPath(e){return e.length>1}},BlockStatement:ls,BreakStatement:class extends qe{hasEffects(e){if(this.label){if(!e.ignore.labels.has(this.label.name))return!0;e.includedLabels.add(this.label.name),e.brokenFlow=2}else{if(!e.ignore.breaks)return!0;e.brokenFlow=1}return!1}include(e){this.included=!0,this.label&&(this.label.include(),e.includedLabels.add(this.label.name)),e.brokenFlow=this.label?2:1}},CallExpression:class extends qe{constructor(){super(...arguments),this.expressionsToBeDeoptimized=[],this.returnExpression=null,this.wasPathDeoptmizedWhileOptimized=!1}bind(){super.bind(),this.callee instanceof ft&&(this.scope.findVariable(this.callee.name).isNamespace&&this.context.warn({code:"CANNOT_CALL_NAMESPACE",message:`Cannot call a namespace ('${this.callee.name}')`},this.start),"eval"===this.callee.name&&this.context.warn({code:"EVAL",message:"Use of eval is strongly discouraged, as it poses security risks and may cause issues with minification",url:"https://rollupjs.org/guide/en/#avoiding-eval"},this.start)),this.getReturnExpression(z),this.callee instanceof fs&&!this.callee.variable&&this.callee.object.deoptimizePath(F);for(const e of this.arguments)e.deoptimizePath(F)}deoptimizeCache(){if(this.returnExpression!==q){this.returnExpression=null;const e=this.getReturnExpression(z),t=this.expressionsToBeDeoptimized;e!==q&&(this.expressionsToBeDeoptimized=[],this.wasPathDeoptmizedWhileOptimized&&(e.deoptimizePath(F),this.wasPathDeoptmizedWhileOptimized=!1));for(const e of t)e.deoptimizeCache()}}deoptimizePath(e){if(0===e.length)return;const t=this.context.deoptimizationTracker.getEntities(e);if(t.has(this))return;t.add(this);const s=this.getReturnExpression(z);s!==q&&(this.wasPathDeoptmizedWhileOptimized=!0,s.deoptimizePath(e))}getLiteralValueAtPath(e,t,s){const i=this.getReturnExpression(t);if(i===q)return H;const n=t.getEntities(e);if(n.has(i))return H;this.expressionsToBeDeoptimized.push(s),n.add(i);const r=i.getLiteralValueAtPath(e,t,s);return n.delete(i),r}getReturnExpressionWhenCalledAtPath(e,t,s){const i=this.getReturnExpression(t);if(this.returnExpression===q)return q;const n=t.getEntities(e);if(n.has(i))return q;this.expressionsToBeDeoptimized.push(s),n.add(i);const r=i.getReturnExpressionWhenCalledAtPath(e,t,s);return n.delete(i),r}hasEffects(e){for(const t of this.arguments)if(t.hasEffects(e))return!0;return(!this.context.options.treeshake.annotations||!this.annotatedPure)&&(this.callee.hasEffects(e)||this.callee.hasEffectsWhenCalledAtPath(B,this.callOptions,e))}hasEffectsWhenAccessedAtPath(e,t){if(0===e.length)return!1;const s=t.accessed.getEntities(e);return!s.has(this)&&(s.add(this),this.returnExpression.hasEffectsWhenAccessedAtPath(e,t))}hasEffectsWhenAssignedAtPath(e,t){if(0===e.length)return!0;const s=t.assigned.getEntities(e);return!s.has(this)&&(s.add(this),this.returnExpression.hasEffectsWhenAssignedAtPath(e,t))}hasEffectsWhenCalledAtPath(e,t,s){const i=(t.withNew?s.instantiated:s.called).getEntities(e,t);return!i.has(this)&&(i.add(this),this.returnExpression.hasEffectsWhenCalledAtPath(e,t,s))}include(e,t){t?(super.include(e,t),"variables"===t&&this.callee instanceof ft&&this.callee.variable&&this.callee.variable.markCalledFromTryStatement()):(this.included=!0,this.callee.include(e,!1)),this.callee.includeCallArguments(e,this.arguments),this.returnExpression.included||this.returnExpression.include(e,!1)}initialise(){this.callOptions={args:this.arguments,withNew:!1}}render(e,t,{renderedParentType:s}=tt){if(this.callee.render(e,t),this.arguments.length>0)if(this.arguments[this.arguments.length-1].included)for(const s of this.arguments)s.render(e,t);else{let s=this.arguments.length-2;for(;s>=0&&!this.arguments[s].included;)s--;if(s>=0){for(let i=0;i<=s;i++)this.arguments[i].render(e,t);e.remove(C(e.original,",",this.arguments[s].end),this.end-1)}else e.remove(C(e.original,"(",this.callee.end)+1,this.end-1)}"ExpressionStatement"===s&&"FunctionExpression"===this.callee.type&&(e.appendRight(this.start,"("),e.prependLeft(this.end,")"))}getReturnExpression(e){return null===this.returnExpression?(this.returnExpression=q,this.returnExpression=this.callee.getReturnExpressionWhenCalledAtPath(B,e,this)):this.returnExpression}},CatchClause:gs,ChainExpression:class extends qe{},ClassBody:class extends qe{createScope(e){this.scope=new ys(e)}hasEffectsWhenCalledAtPath(e,t,s){return e.length>0||null!==this.classConstructor&&this.classConstructor.hasEffectsWhenCalledAtPath(B,t,s)}initialise(){for(const e of this.body)if(e instanceof xs&&"constructor"===e.kind)return void(this.classConstructor=e);this.classConstructor=null}},ClassDeclaration:Xe,ClassExpression:class extends Ke{},ConditionalExpression:class extends qe{constructor(){super(...arguments),this.expressionsToBeDeoptimized=[],this.isBranchResolutionAnalysed=!1,this.usedBranch=null,this.wasPathDeoptimizedWhileOptimized=!1}bind(){super.bind(),this.getUsedBranch()}deoptimizeCache(){if(null!==this.usedBranch){const e=this.usedBranch===this.consequent?this.alternate:this.consequent;this.usedBranch=null;const t=this.expressionsToBeDeoptimized;this.expressionsToBeDeoptimized=[],this.wasPathDeoptimizedWhileOptimized&&e.deoptimizePath(F);for(const e of t)e.deoptimizeCache()}}deoptimizePath(e){if(e.length>0){const t=this.getUsedBranch();null===t?(this.consequent.deoptimizePath(e),this.alternate.deoptimizePath(e)):(this.wasPathDeoptimizedWhileOptimized=!0,t.deoptimizePath(e))}}getLiteralValueAtPath(e,t,s){const i=this.getUsedBranch();return null===i?H:(this.expressionsToBeDeoptimized.push(s),i.getLiteralValueAtPath(e,t,s))}getReturnExpressionWhenCalledAtPath(e,t,s){const i=this.getUsedBranch();return null===i?new Es([this.consequent.getReturnExpressionWhenCalledAtPath(e,t,s),this.alternate.getReturnExpressionWhenCalledAtPath(e,t,s)]):(this.expressionsToBeDeoptimized.push(s),i.getReturnExpressionWhenCalledAtPath(e,t,s))}hasEffects(e){return!!this.test.hasEffects(e)||(null===this.usedBranch?this.consequent.hasEffects(e)||this.alternate.hasEffects(e):this.usedBranch.hasEffects(e))}hasEffectsWhenAccessedAtPath(e,t){return 0!==e.length&&(null===this.usedBranch?this.consequent.hasEffectsWhenAccessedAtPath(e,t)||this.alternate.hasEffectsWhenAccessedAtPath(e,t):this.usedBranch.hasEffectsWhenAccessedAtPath(e,t))}hasEffectsWhenAssignedAtPath(e,t){return 0===e.length||(null===this.usedBranch?this.consequent.hasEffectsWhenAssignedAtPath(e,t)||this.alternate.hasEffectsWhenAssignedAtPath(e,t):this.usedBranch.hasEffectsWhenAssignedAtPath(e,t))}hasEffectsWhenCalledAtPath(e,t,s){return null===this.usedBranch?this.consequent.hasEffectsWhenCalledAtPath(e,t,s)||this.alternate.hasEffectsWhenCalledAtPath(e,t,s):this.usedBranch.hasEffectsWhenCalledAtPath(e,t,s)}include(e,t){this.included=!0,t||this.test.shouldBeIncluded(e)||null===this.usedBranch?(this.test.include(e,t),this.consequent.include(e,t),this.alternate.include(e,t)):this.usedBranch.include(e,t)}render(e,t,{renderedParentType:s,isCalleeOfRenderedParent:i,preventASI:n}=tt){if(this.test.included)super.render(e,t);else{const r=C(e.original,":",this.consequent.end),a=(this.consequent.included?C(e.original,"?",this.test.end):r)+1;n&&$(e,a,this.usedBranch.start),e.remove(this.start,a),this.consequent.included&&e.remove(r,this.end),A(this,e),this.usedBranch.render(e,t,{isCalleeOfRenderedParent:s?i:this.parent.callee===this,renderedParentType:s||this.parent.type})}}getUsedBranch(){if(this.isBranchResolutionAnalysed)return this.usedBranch;this.isBranchResolutionAnalysed=!0;const e=this.test.getLiteralValueAtPath(B,z,this);return e===H?null:this.usedBranch=e?this.consequent:this.alternate}},ContinueStatement:class extends qe{hasEffects(e){if(this.label){if(!e.ignore.labels.has(this.label.name))return!0;e.includedLabels.add(this.label.name),e.brokenFlow=2}else{if(!e.ignore.continues)return!0;e.brokenFlow=1}return!1}include(e){this.included=!0,this.label&&(this.label.include(),e.includedLabels.add(this.label.name)),e.brokenFlow=this.label?2:1}},DoWhileStatement:class extends qe{hasEffects(e){if(this.test.hasEffects(e))return!0;const{brokenFlow:t,ignore:{breaks:s,continues:i}}=e;return e.ignore.breaks=!0,e.ignore.continues=!0,!!this.body.hasEffects(e)||(e.ignore.breaks=s,e.ignore.continues=i,e.brokenFlow=t,!1)}include(e,t){this.included=!0,this.test.include(e,t);const{brokenFlow:s}=e;this.body.include(e,t),e.brokenFlow=s}},EmptyStatement:class extends qe{hasEffects(){return!1}},ExportAllDeclaration:as,ExportDefaultDeclaration:xt,ExportNamedDeclaration:vs,ExportSpecifier:class extends qe{},ExpressionStatement:hs,FieldDefinition:class extends qe{hasEffects(e){return this.key.hasEffects(e)||this.static&&null!==this.value&&this.value.hasEffects(e)}},ForInStatement:class extends qe{bind(){this.left.bind(),this.left.deoptimizePath(B),this.right.bind(),this.body.bind()}createScope(e){this.scope=new os(e)}hasEffects(e){if(this.left&&(this.left.hasEffects(e)||this.left.hasEffectsWhenAssignedAtPath(B,e))||this.right&&this.right.hasEffects(e))return!0;const{brokenFlow:t,ignore:{breaks:s,continues:i}}=e;return e.ignore.breaks=!0,e.ignore.continues=!0,!!this.body.hasEffects(e)||(e.ignore.breaks=s,e.ignore.continues=i,e.brokenFlow=t,!1)}include(e,t){this.included=!0,this.left.includeWithAllDeclaredVariables(t,e),this.left.deoptimizePath(B),this.right.include(e,t);const{brokenFlow:s}=e;this.body.include(e,t),e.brokenFlow=s}render(e,t){this.left.render(e,t,P),this.right.render(e,t,P),110===e.original.charCodeAt(this.right.start-1)&&e.prependLeft(this.right.start," "),this.body.render(e,t)}},ForOfStatement:class extends qe{bind(){this.left.bind(),this.left.deoptimizePath(B),this.right.bind(),this.body.bind()}createScope(e){this.scope=new os(e)}hasEffects(){return!0}include(e,t){this.included=!0,this.left.includeWithAllDeclaredVariables(t,e),this.left.deoptimizePath(B),this.right.include(e,t);const{brokenFlow:s}=e;this.body.include(e,t),e.brokenFlow=s}render(e,t){this.left.render(e,t,P),this.right.render(e,t,P),102===e.original.charCodeAt(this.right.start-1)&&e.prependLeft(this.right.start," "),this.body.render(e,t)}},ForStatement:class extends qe{createScope(e){this.scope=new os(e)}hasEffects(e){if(this.init&&this.init.hasEffects(e)||this.test&&this.test.hasEffects(e)||this.update&&this.update.hasEffects(e))return!0;const{brokenFlow:t,ignore:{breaks:s,continues:i}}=e;return e.ignore.breaks=!0,e.ignore.continues=!0,!!this.body.hasEffects(e)||(e.ignore.breaks=s,e.ignore.continues=i,e.brokenFlow=t,!1)}include(e,t){this.included=!0,this.init&&this.init.include(e,t),this.test&&this.test.include(e,t);const{brokenFlow:s}=e;this.update&&this.update.include(e,t),this.body.include(e,t),e.brokenFlow=s}render(e,t){this.init&&this.init.render(e,t,P),this.test&&this.test.render(e,t,P),this.update&&this.update.render(e,t,P),this.body.render(e,t)}},FunctionDeclaration:yt,FunctionExpression:class extends gt{},Identifier:ft,IfStatement:class extends qe{constructor(){super(...arguments),this.testValue=bs}deoptimizeCache(){this.testValue=H}hasEffects(e){if(this.test.hasEffects(e))return!0;const t=this.getTestValue();if(t===H){const{brokenFlow:t}=e;if(this.consequent.hasEffects(e))return!0;const s=e.brokenFlow;return e.brokenFlow=t,null!==this.alternate&&(!!this.alternate.hasEffects(e)||(e.brokenFlow=e.brokenFlow1}include(){if(!this.included){this.included=!0;const e=this.parent,t=this.metaProperty=e instanceof fs&&"string"==typeof e.propertyKey?e.propertyKey:null;t&&(t.startsWith(Ps)||t.startsWith(As)||t.startsWith("ROLLUP_CHUNK_URL_"))?this.scope.addAccessedGlobalsByFormat(ks):this.scope.addAccessedGlobalsByFormat(Cs)}}initialise(){"import"===this.meta.name&&this.context.addImportMeta(this)}renderFinalMechanism(e,t,s,i){if(!this.included)return;const n=this.parent,r=this.metaProperty;if(r&&(r.startsWith(Ps)||r.startsWith(As)||r.startsWith("ROLLUP_CHUNK_URL_"))){let a,o=null,h=null,l=null;r.startsWith(Ps)?(o=r.substr(Ps.length),a=i.getFileName(o)):r.startsWith(As)?(Ht(`Using the "${As}" prefix to reference files is deprecated. Use the "${Ps}" prefix instead.`,!0,this.context.options),h=r.substr(As.length),a=i.getFileName(h)):(Ht(`Using the "ROLLUP_CHUNK_URL_" prefix to reference files is deprecated. Use the "${Ps}" prefix instead.`,!0,this.context.options),l=r.substr("ROLLUP_CHUNK_URL_".length),a=i.getFileName(l));const c=Me(Oe(Le(t),a));let u;return null!==h&&(u=i.hookFirstSync("resolveAssetUrl",[{assetFileName:a,chunkId:t,format:s,moduleId:this.context.module.id,relativeAssetPath:c}])),u||(u=i.hookFirstSync("resolveFileUrl",[{assetReferenceId:h,chunkId:t,chunkReferenceId:l,fileName:a,format:s,moduleId:this.context.module.id,referenceId:o||h||l,relativePath:c}])||$s[s](c)),void e.overwrite(n.start,n.end,u,{contentOnly:!0})}const a=i.hookFirstSync("resolveImportMeta",[r,{chunkId:t,format:s,moduleId:this.context.module.id}])||Ms[s]&&Ms[s](r,t);"string"==typeof a&&(n instanceof fs?e.overwrite(n.start,n.end,a,{contentOnly:!0}):e.overwrite(this.start,this.end,a,{contentOnly:!0}))}},MethodDefinition:xs,NewExpression:class extends qe{bind(){super.bind();for(const e of this.arguments)e.deoptimizePath(F)}hasEffects(e){for(const t of this.arguments)if(t.hasEffects(e))return!0;return(!this.context.options.treeshake.annotations||!this.annotatedPure)&&(this.callee.hasEffects(e)||this.callee.hasEffectsWhenCalledAtPath(B,this.callOptions,e))}hasEffectsWhenAccessedAtPath(e){return e.length>1}initialise(){this.callOptions={args:this.arguments,withNew:!0}}},ObjectExpression:class extends qe{constructor(){super(...arguments),this.deoptimizedPaths=new Set,this.expressionsToBeDeoptimized=new Map,this.hasUnknownDeoptimizedProperty=!1,this.propertyMap=null,this.unmatchablePropertiesRead=[],this.unmatchablePropertiesWrite=[]}bind(){super.bind(),this.getPropertyMap()}deoptimizeCache(){this.hasUnknownDeoptimizedProperty||this.deoptimizeAllProperties()}deoptimizePath(e){if(this.hasUnknownDeoptimizedProperty)return;const t=this.getPropertyMap(),s=e[0];if(1===e.length){if("string"!=typeof s)return void this.deoptimizeAllProperties();if(!this.deoptimizedPaths.has(s)){this.deoptimizedPaths.add(s);const e=this.expressionsToBeDeoptimized.get(s);if(e)for(const t of e)t.deoptimizeCache()}}const i=1===e.length?F:e.slice(1);for(const e of"string"==typeof s?t[s]?t[s].propertiesRead:[]:this.properties)e.deoptimizePath(i)}getLiteralValueAtPath(e,t,s){const i=this.getPropertyMap(),n=e[0];if(0===e.length||this.hasUnknownDeoptimizedProperty||"string"!=typeof n||this.deoptimizedPaths.has(n))return H;if(1===e.length&&!i[n]&&!pe[n]&&0===this.unmatchablePropertiesRead.length){const e=this.expressionsToBeDeoptimized.get(n);return void(e?e.push(s):this.expressionsToBeDeoptimized.set(n,[s]))}if(!i[n]||null===i[n].exactMatchRead||i[n].propertiesRead.length>1)return H;const r=this.expressionsToBeDeoptimized.get(n);return r?r.push(s):this.expressionsToBeDeoptimized.set(n,[s]),i[n].exactMatchRead.getLiteralValueAtPath(e.slice(1),t,s)}getReturnExpressionWhenCalledAtPath(e,t,s){const i=this.getPropertyMap(),n=e[0];if(0===e.length||this.hasUnknownDeoptimizedProperty||"string"!=typeof n||this.deoptimizedPaths.has(n))return q;if(1===e.length&&pe[n]&&0===this.unmatchablePropertiesRead.length&&(!i[n]||null===i[n].exactMatchRead))return Ee(pe,n);if(!i[n]||null===i[n].exactMatchRead||i[n].propertiesRead.length>1)return q;const r=this.expressionsToBeDeoptimized.get(n);return r?r.push(s):this.expressionsToBeDeoptimized.set(n,[s]),i[n].exactMatchRead.getReturnExpressionWhenCalledAtPath(e.slice(1),t,s)}hasEffectsWhenAccessedAtPath(e,t){if(0===e.length)return!1;const s=e[0],i=this.propertyMap;if(e.length>1&&(this.hasUnknownDeoptimizedProperty||"string"!=typeof s||this.deoptimizedPaths.has(s)||!i[s]||null===i[s].exactMatchRead))return!0;const n=e.slice(1);for(const e of"string"!=typeof s?this.properties:i[s]?i[s].propertiesRead:[])if(e.hasEffectsWhenAccessedAtPath(n,t))return!0;return!1}hasEffectsWhenAssignedAtPath(e,t){const s=e[0],i=this.propertyMap;if(e.length>1&&(this.hasUnknownDeoptimizedProperty||this.deoptimizedPaths.has(s)||!i[s]||null===i[s].exactMatchRead))return!0;const n=e.slice(1);for(const r of"string"!=typeof s?this.properties:e.length>1?i[s].propertiesRead:i[s]?i[s].propertiesWrite:[])if(r.hasEffectsWhenAssignedAtPath(n,t))return!0;return!1}hasEffectsWhenCalledAtPath(e,t,s){const i=e[0];if("string"!=typeof i||this.hasUnknownDeoptimizedProperty||this.deoptimizedPaths.has(i)||(this.propertyMap[i]?!this.propertyMap[i].exactMatchRead:e.length>1||!pe[i]))return!0;const n=e.slice(1);if(this.propertyMap[i])for(const e of this.propertyMap[i].propertiesRead)if(e.hasEffectsWhenCalledAtPath(n,t,s))return!0;return!(1!==e.length||!pe[i])&&xe(pe,i,this.included,t,s)}render(e,t,{renderedParentType:s}=tt){super.render(e,t),"ExpressionStatement"!==s&&"ArrowFunctionExpression"!==s||(e.appendRight(this.start,"("),e.prependLeft(this.end,")"))}deoptimizeAllProperties(){this.hasUnknownDeoptimizedProperty=!0;for(const e of this.properties)e.deoptimizePath(F);for(const e of this.expressionsToBeDeoptimized.values())for(const t of e)t.deoptimizeCache()}getPropertyMap(){if(null!==this.propertyMap)return this.propertyMap;const e=this.propertyMap=Object.create(null);for(let t=this.properties.length-1;t>=0;t--){const s=this.properties[t];if(s instanceof Ts){this.unmatchablePropertiesRead.push(s);continue}const i="get"!==s.kind,n="set"!==s.kind;let r;if(s.computed){const e=s.key.getLiteralValueAtPath(B,z,this);if(e===H){n?this.unmatchablePropertiesRead.push(s):this.unmatchablePropertiesWrite.push(s);continue}r=String(e)}else r=s.key instanceof ft?s.key.name:String(s.key.value);const a=e[r];a?(n&&null===a.exactMatchRead&&(a.exactMatchRead=s,a.propertiesRead.push(s,...this.unmatchablePropertiesRead)),i&&!n&&null===a.exactMatchWrite&&(a.exactMatchWrite=s,a.propertiesWrite.push(s,...this.unmatchablePropertiesWrite))):e[r]={exactMatchRead:n?s:null,exactMatchWrite:i?s:null,propertiesRead:n?[s,...this.unmatchablePropertiesRead]:[],propertiesWrite:i&&!n?[s,...this.unmatchablePropertiesWrite]:[]}}return e}},ObjectPattern:class extends qe{addExportedVariables(e,t){for(const s of this.properties)"Property"===s.type?s.value.addExportedVariables(e,t):s.argument.addExportedVariables(e,t)}declare(e,t){const s=[];for(const i of this.properties)s.push(...i.declare(e,t));return s}deoptimizePath(e){if(0===e.length)for(const t of this.properties)t.deoptimizePath(e)}hasEffectsWhenAssignedAtPath(e,t){if(e.length>0)return!0;for(const e of this.properties)if(e.hasEffectsWhenAssignedAtPath(B,t))return!0;return!1}},PrivateName:class extends qe{},Program:Ls,Property:class extends qe{constructor(){super(...arguments),this.declarationInit=null,this.returnExpression=null}bind(){super.bind(),"get"===this.kind&&this.getReturnExpression(),null!==this.declarationInit&&this.declarationInit.deoptimizePath([V,V])}declare(e,t){return this.declarationInit=t,this.value.declare(e,q)}deoptimizeCache(){}deoptimizePath(e){"get"===this.kind?this.getReturnExpression().deoptimizePath(e):this.value.deoptimizePath(e)}getLiteralValueAtPath(e,t,s){return"get"===this.kind?this.getReturnExpression().getLiteralValueAtPath(e,t,s):this.value.getLiteralValueAtPath(e,t,s)}getReturnExpressionWhenCalledAtPath(e,t,s){return"get"===this.kind?this.getReturnExpression().getReturnExpressionWhenCalledAtPath(e,t,s):this.value.getReturnExpressionWhenCalledAtPath(e,t,s)}hasEffects(e){return this.key.hasEffects(e)||this.value.hasEffects(e)}hasEffectsWhenAccessedAtPath(e,t){if("get"===this.kind){const s=t.accessed.getEntities(e);return!s.has(this)&&(s.add(this),this.value.hasEffectsWhenCalledAtPath(B,this.accessorCallOptions,t)||e.length>0&&this.returnExpression.hasEffectsWhenAccessedAtPath(e,t))}return this.value.hasEffectsWhenAccessedAtPath(e,t)}hasEffectsWhenAssignedAtPath(e,t){if("get"===this.kind){const s=t.assigned.getEntities(e);return!s.has(this)&&(s.add(this),this.returnExpression.hasEffectsWhenAssignedAtPath(e,t))}if("set"===this.kind){const s=t.assigned.getEntities(e);return!s.has(this)&&(s.add(this),this.value.hasEffectsWhenCalledAtPath(B,this.accessorCallOptions,t))}return this.value.hasEffectsWhenAssignedAtPath(e,t)}hasEffectsWhenCalledAtPath(e,t,s){if("get"===this.kind){const i=(t.withNew?s.instantiated:s.called).getEntities(e,t);return!i.has(this)&&(i.add(this),this.returnExpression.hasEffectsWhenCalledAtPath(e,t,s))}return this.value.hasEffectsWhenCalledAtPath(e,t,s)}initialise(){this.accessorCallOptions={args:D,withNew:!1}}render(e,t){this.shorthand||this.key.render(e,t),this.value.render(e,t,{isShorthandProperty:this.shorthand})}getReturnExpression(){return null===this.returnExpression?(this.returnExpression=q,this.returnExpression=this.value.getReturnExpressionWhenCalledAtPath(B,z,this)):this.returnExpression}},RestElement:mt,ReturnStatement:class extends qe{hasEffects(e){return!(e.ignore.returnAwaitYield&&(null===this.argument||!this.argument.hasEffects(e))&&(e.brokenFlow=2,1))}include(e,t){this.included=!0,this.argument&&this.argument.include(e,t),e.brokenFlow=2}initialise(){this.scope.addReturnExpression(this.argument||q)}render(e,t){this.argument&&(this.argument.render(e,t,{preventASI:!0}),this.argument.start===this.start+6&&e.prependLeft(this.start+6," "))}},SequenceExpression:class extends qe{deoptimizePath(e){e.length>0&&this.expressions[this.expressions.length-1].deoptimizePath(e)}getLiteralValueAtPath(e,t,s){return this.expressions[this.expressions.length-1].getLiteralValueAtPath(e,t,s)}hasEffects(e){for(const t of this.expressions)if(t.hasEffects(e))return!0;return!1}hasEffectsWhenAccessedAtPath(e,t){return e.length>0&&this.expressions[this.expressions.length-1].hasEffectsWhenAccessedAtPath(e,t)}hasEffectsWhenAssignedAtPath(e,t){return 0===e.length||this.expressions[this.expressions.length-1].hasEffectsWhenAssignedAtPath(e,t)}hasEffectsWhenCalledAtPath(e,t,s){return this.expressions[this.expressions.length-1].hasEffectsWhenCalledAtPath(e,t,s)}include(e,t){this.included=!0;for(let s=0;s=0;r--){const a=this.cases[r];if(a.included&&(n=!0),!n){const e=We();e.ignore.breaks=!0,n=a.hasEffects(e)}n?(a.include(e,t),i=i0&&_(this.cases,e,this.cases[0].start,this.end-1,t)}},TaggedTemplateExpression:class extends qe{bind(){if(super.bind(),"Identifier"===this.tag.type){const e=this.tag.name;this.scope.findVariable(e).isNamespace&&this.context.warn({code:"CANNOT_CALL_NAMESPACE",message:`Cannot call a namespace ('${e}')`},this.start),"eval"===e&&this.context.warn({code:"EVAL",message:"Use of eval is strongly discouraged, as it poses security risks and may cause issues with minification",url:"https://rollupjs.org/guide/en/#avoiding-eval"},this.start)}}hasEffects(e){return super.hasEffects(e)||this.tag.hasEffectsWhenCalledAtPath(B,this.callOptions,e)}initialise(){this.callOptions={args:D,withNew:!1}}},TemplateElement:class extends qe{bind(){}hasEffects(){return!1}include(){this.included=!0}parseNode(e){this.value=e.value,super.parseNode(e)}render(){}},TemplateLiteral:Os,ThisExpression:class extends qe{bind(){super.bind(),this.variable=this.scope.findVariable("this")}hasEffectsWhenAccessedAtPath(e,t){return e.length>0&&this.variable.hasEffectsWhenAccessedAtPath(e,t)}hasEffectsWhenAssignedAtPath(e,t){return this.variable.hasEffectsWhenAssignedAtPath(e,t)}initialise(){this.alias=this.scope.findLexicalBoundary()instanceof Ds?this.context.moduleContext:null,"undefined"===this.alias&&this.context.warn({code:"THIS_IS_UNDEFINED",message:"The 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten",url:"https://rollupjs.org/guide/en/#error-this-is-undefined"},this.start)}render(e){null!==this.alias&&e.overwrite(this.start,this.end,this.alias,{contentOnly:!1,storeName:!0})}},ThrowStatement:class extends qe{hasEffects(){return!0}include(e,t){this.included=!0,this.argument.include(e,t),e.brokenFlow=2}render(e,t){this.argument.render(e,t,{preventASI:!0}),this.argument.start===this.start+5&&e.prependLeft(this.start+5," ")}},TryStatement:class extends qe{constructor(){super(...arguments),this.directlyIncluded=!1}hasEffects(e){return(this.context.options.treeshake.tryCatchDeoptimization?this.block.body.length>0:this.block.hasEffects(e))||null!==this.finalizer&&this.finalizer.hasEffects(e)}include(e,t){var s;const i=null===(s=this.context.options.treeshake)||void 0===s?void 0:s.tryCatchDeoptimization,{brokenFlow:n}=e;this.directlyIncluded&&i||(this.included=!0,this.directlyIncluded=!0,this.block.include(e,i?"variables":t),e.brokenFlow=n),null!==this.handler&&(this.handler.include(e,t),e.brokenFlow=n),null!==this.finalizer&&this.finalizer.include(e,t)}},UnaryExpression:class extends qe{bind(){super.bind(),"delete"===this.operator&&this.argument.deoptimizePath(B)}getLiteralValueAtPath(e,t,s){if(e.length>0)return H;const i=this.argument.getLiteralValueAtPath(B,t,s);return i===H?H:Vs[this.operator](i)}hasEffects(e){return!("typeof"===this.operator&&this.argument instanceof ft)&&(this.argument.hasEffects(e)||"delete"===this.operator&&this.argument.hasEffectsWhenAssignedAtPath(B,e))}hasEffectsWhenAccessedAtPath(e){return"void"===this.operator?e.length>0:e.length>1}},UnknownNode:class extends qe{hasEffects(){return!0}include(e){super.include(e,!0)}},UpdateExpression:class extends qe{bind(){super.bind(),this.argument.deoptimizePath(B),this.argument instanceof ft&&(this.scope.findVariable(this.argument.name).isReassigned=!0)}hasEffects(e){return this.argument.hasEffects(e)||this.argument.hasEffectsWhenAssignedAtPath(B,e)}hasEffectsWhenAccessedAtPath(e){return e.length>1}render(e,t){if(this.argument.render(e,t),"system"===t.format){const s=this.argument.variable,i=t.exportNamesByVariable.get(s);if(i&&i.length){const n=t.compact?"":" ",r=s.getName();if(this.prefix)1===i.length?e.overwrite(this.start,this.end,`exports('${i[0]}',${n}${this.operator}${r})`):e.overwrite(this.start,this.end,`(${this.operator}${r},${n}${M([s],t)},${n}${r})`);else if(i.length>1)e.overwrite(this.start,this.end,`${T([s],!1,t)}${this.operator}${r})`);else{let t;switch(this.operator){case"++":t=`${r}${n}+${n}1`;break;case"--":t=`${r}${n}-${n}1`}e.overwrite(this.start,this.end,`(exports('${i[0]}',${n}${t}),${n}${r}${this.operator})`)}}}}},VariableDeclaration:Fs,VariableDeclarator:class extends qe{declareDeclarator(e){this.id.declare(e,this.init||K)}deoptimizePath(e){this.id.deoptimizePath(e)}render(e,t){null===this.init||this.init.included?super.render(e,t):(e.remove(this.id.end,this.end),this.id.render(e,t))}},WhileStatement:class extends qe{hasEffects(e){if(this.test.hasEffects(e))return!0;const{brokenFlow:t,ignore:{breaks:s,continues:i}}=e;return e.ignore.breaks=!0,e.ignore.continues=!0,!!this.body.hasEffects(e)||(e.ignore.breaks=s,e.ignore.continues=i,e.brokenFlow=t,!1)}include(e,t){this.included=!0,this.test.include(e,t);const{brokenFlow:s}=e;this.body.include(e,t),e.brokenFlow=s}},YieldExpression:class extends qe{bind(){super.bind(),null!==this.argument&&this.argument.deoptimizePath(F)}hasEffects(e){return!e.ignore.returnAwaitYield||null!==this.argument&&this.argument.hasEffects(e)}render(e,t){this.argument&&(this.argument.render(e,t),this.argument.start===this.start+5&&e.prependLeft(this.start+5," "))}}};function Us(e){return e.id}function zs(e,t,s){s(e,t)}function js(e,t,s){}var Gs={};function Hs(e,t,s=e.type){let i=t.commentNodes[t.commentIndex];for(;i&&e.start>=i.end;)qs(e,i),i=t.commentNodes[++t.commentIndex];i&&i.end<=e.end&&Gs[s](e,t,Hs)}function qs(e,t){e.annotations?e.annotations.push(t):e.annotations=[t],"ExpressionStatement"===e.type&&(e=e.expression),"CallExpression"!==e.type&&"NewExpression"!==e.type||(e.annotatedPure=!0)}Gs.Program=Gs.BlockStatement=function(e,t,s){for(var i=0,n=e.body;iKs.test(e.text);let Ys="sourceMa";Ys+="ppingURL";const Qs=new RegExp("^#\\s+sourceMappingURL=.+\\n?"),Js=()=>{};let Zs=()=>[0,0],ei=()=>0,ti=()=>0,si={};function ii(e,t){switch(t){case 1:return"# "+e;case 2:return"## "+e;case 3:return e;default:return`${" ".repeat(t-4)}- ${e}`}}function ni(e,t=3){e=ii(e,t),si.hasOwnProperty(e)||(si[e]={memory:0,startMemory:void 0,startTime:void 0,time:0,totalMemory:0});const s=ti();si[e].startTime=Zs(),si[e].startMemory=s}function ri(e,t=3){if(e=ii(e,t),si.hasOwnProperty(e)){const t=ti();si[e].time+=ei(si[e].startTime),si[e].totalMemory=Math.max(si[e].totalMemory,t),si[e].memory+=t-si[e].startMemory}}function ai(){const e={};for(const t of Object.keys(si))e[t]=[si[t].time,si[t].memory,si[t].totalMemory];return e}let oi=Js,hi=Js;const li={load:!0,resolveDynamicImport:!0,resolveId:!0,transform:!0};function ci(e,t){const s={};for(const i of Object.keys(e))if(!0===li[i]){let n="plugin "+t;e.name&&(n+=` (${e.name})`),n+=" - "+i,s[i]=function(){oi(n,4);const t=e[i].apply(this===s?e:this,arguments);return hi(n,4),t&&"function"==typeof t.then&&(oi(n+" (async)",4),t.then(()=>hi(n+" (async)",4))),t}}else s[i]=e[i];return s}function ui(e){e.perf?(si={},"undefined"!=typeof process&&"function"==typeof process.hrtime?(Zs=process.hrtime.bind(process),ei=e=>{return 1e3*(t=process.hrtime(e))[0]+t[1]/1e6;var t}):"undefined"!=typeof performance&&"function"==typeof performance.now&&(Zs=()=>[performance.now(),0],ei=e=>performance.now()-e[0]),"undefined"!=typeof process&&"function"==typeof process.memoryUsage&&(ti=()=>process.memoryUsage().heapUsed),oi=ni,hi=ri,e.plugins=e.plugins.map(ci)):(oi=Js,hi=Js)}function di(e,t,s,i){return t.error({code:"MISSING_EXPORT",message:`'${e}' is not exported by ${Dt(s)}, imported by ${Dt(t.id)}`,url:"https://rollupjs.org/guide/en/#error-name-is-not-exported-by-module"},i)}const pi={identifier:null,localName:"_missingExportShim"};function fi(e,t,s,i=new Map){const n=i.get(t);if(n){if(n.has(e))return null;n.add(e)}else i.set(t,new Set([e]));return e.getVariableForExportName(t,s,i)}class mi{constructor(e,t,s,i,n,r){this.graph=e,this.id=t,this.options=s,this.moduleSideEffects=i,this.syntheticNamedExports=n,this.isEntryPoint=r,this.chunkFileNames=new Set,this.chunkName=null,this.comments=[],this.dependencies=new Set,this.dynamicDependencies=new Set,this.dynamicImporters=[],this.dynamicImports=[],this.execIndex=1/0,this.exportAllSources=new Set,this.exports=Object.create(null),this.exportsAll=Object.create(null),this.implicitlyLoadedAfter=new Set,this.implicitlyLoadedBefore=new Set,this.importDescriptions=Object.create(null),this.importers=[],this.importMetas=[],this.imports=new Set,this.includedDynamicImporters=[],this.isExecuted=!1,this.isUserDefinedEntryPoint=!1,this.preserveSignature=this.options.preserveEntrySignatures,this.reexportDescriptions=Object.create(null),this.sources=new Set,this.userChunkNames=new Set,this.usesTopLevelAwait=!1,this.allExportNames=null,this.defaultExport=null,this.exportAllModules=[],this.exportNamesByVariable=null,this.exportShimVariable=new bt(this),this.relevantDependencies=null,this.syntheticExports=new Map,this.transformDependencies=[],this.transitiveReexports=null,this.excludeFromSourcemap=/\0/.test(t),this.context=s.moduleContext(t)}basename(){const e=Te(this.id),t=Re(this.id);return we(t?e.slice(0,-t.length):e)}bindReferences(){this.ast.bind()}error(e,t){return this.addLocationToLogProps(e,t),Bt(e)}getAllExportNames(){if(this.allExportNames)return this.allExportNames;const e=this.allExportNames=new Set;for(const t of Object.keys(this.exports))e.add(t);for(const t of Object.keys(this.reexportDescriptions))e.add(t);for(const t of this.exportAllModules)if(t instanceof Ve)e.add("*"+t.id);else for(const s of t.getAllExportNames())"default"!==s&&e.add(s);return e}getDefaultExport(){return null===this.defaultExport&&(this.defaultExport=void 0,this.defaultExport=this.getVariableForExportName("default")),this.defaultExport?this.defaultExport:Bt({code:Wt.SYNTHETIC_NAMED_EXPORTS_NEED_DEFAULT,id:this.id,message:"Modules with 'syntheticNamedExports' need a default export."})}getDependenciesToBeIncluded(){if(this.relevantDependencies)return this.relevantDependencies;const e=new Set,t=new Set,s=new Set(this.dependencies);let i=this.imports;if(this.isEntryPoint||this.includedDynamicImporters.length>0||this.namespace.included){i=new Set(i);for(const e of[...this.getReexports(),...this.getExports()])i.add(this.getVariableForExportName(e))}for(let n of i){if(n instanceof At)n=n.getBaseVariable();else if(n instanceof vt){const{modules:e,original:i}=n.getOriginalVariableAndDeclarationModules();n=i;for(const i of e)t.add(i),s.add(i)}e.add(n.module)}if(this.options.treeshake){for(const i of s)if((i.moduleSideEffects||t.has(i))&&!e.has(i))if(i instanceof Ve||i.hasEffects())e.add(i);else for(const e of i.dependencies)s.add(e)}else for(const t of this.dependencies)e.add(t);return this.relevantDependencies=e}getExportNamesByVariable(){if(this.exportNamesByVariable)return this.exportNamesByVariable;const e=new Map;for(const t of this.getAllExportNames()){let s=this.getVariableForExportName(t);if(s instanceof vt&&(s=s.getOriginalVariable()),!s||!(s.included||s instanceof be))continue;const i=e.get(s);i?i.push(t):e.set(s,[t])}return this.exportNamesByVariable=e}getExports(){return Object.keys(this.exports)}getReexports(){if(this.transitiveReexports)return this.transitiveReexports;this.transitiveReexports=[];const e=new Set;for(const t in this.reexportDescriptions)e.add(t);for(const t of this.exportAllModules)if(t instanceof Ve)e.add("*"+t.id);else for(const s of[...t.getReexports(),...t.getExports()])"default"!==s&&e.add(s);return this.transitiveReexports=[...e]}getRenderedExports(){const e=[],t=[];for(const s in this.exports){const i=this.getVariableForExportName(s);(i&&i.included?e:t).push(s)}return{renderedExports:e,removedExports:t}}getVariableForExportName(e,t,s){if("*"===e[0])return 1===e.length?this.namespace:this.graph.modulesById.get(e.slice(1)).getVariableForExportName("*");const i=this.reexportDescriptions[e];if(i){const e=fi(i.module,i.localName,!1,s);return e||di(i.localName,this,i.module.id,i.start)}const n=this.exports[e];if(n){if(n===pi)return this.exportShimVariable;const e=n.localName;return this.traceVariable(e)}if("default"!==e)for(const t of this.exportAllModules){const i=fi(t,e,!0,s);if(i)return i}if(!t){if(this.syntheticNamedExports){let t=this.syntheticExports.get(e);if(!t){const s=this.getDefaultExport();return t=new At(this.astContext,e,s),this.syntheticExports.set(e,t),t}return t}if(this.options.shimMissingExports)return this.shimMissingExport(e),this.exportShimVariable}return null}hasEffects(){return this.ast.included&&this.ast.hasEffects(We())}include(){const e=Fe();this.ast.shouldBeIncluded(e)&&this.ast.include(e,!1)}includeAllExports(){this.isExecuted||(this.graph.needsTreeshakingPass=!0,Be(this));for(const e of this.getExports()){const t=this.getVariableForExportName(e);t.deoptimizePath(F),t.included||(t.include(),this.graph.needsTreeshakingPass=!0)}for(const e of this.getReexports()){const t=this.getVariableForExportName(e);t.deoptimizePath(F),t.included||(t.include(),this.graph.needsTreeshakingPass=!0),t instanceof be&&(t.module.reexported=!0)}}includeAllInBundle(){this.ast.include(Fe(),!0)}isIncluded(){return this.ast.included||this.namespace.included}linkImports(){this.addModulesToImportDescriptions(this.importDescriptions),this.addModulesToImportDescriptions(this.reexportDescriptions);for(const e in this.exports)"default"!==e&&(this.exportsAll[e]=this.id);const e=[];for(const t of this.exportAllSources){const s=this.graph.modulesById.get(this.resolvedIds[t].id);if(s instanceof Ve)e.push(s);else{this.exportAllModules.push(s);for(const e in s.exportsAll)e in this.exportsAll?this.options.onwarn(jt(e,this,s)):this.exportsAll[e]=s.exportsAll[e]}}this.exportAllModules.push(...e)}render(e){const t=this.magicString.clone();return this.ast.render(t,e),this.usesTopLevelAwait=this.astContext.usesTopLevelAwait,t}setSource({alwaysRemovedCode:e,ast:t,code:s,customTransformCache:i,moduleSideEffects:n,originalCode:r,originalSourcemap:a,resolvedIds:o,sourcemapChain:h,syntheticNamedExports:l,transformDependencies:c,transformFiles:u}){if(this.code=s,this.originalCode=r,this.originalSourcemap=a,this.sourcemapChain=h,u&&(this.transformFiles=u),this.transformDependencies=c,this.customTransformCache=i,"boolean"==typeof n&&(this.moduleSideEffects=n),"boolean"==typeof l&&(this.syntheticNamedExports=l),oi("generate ast",3),this.alwaysRemovedCode=e||[],t)this.esTreeAst=t;else{this.esTreeAst=function(e,t,s){try{return t.parse(e.code,{...s,onComment:(t,s,i,n)=>e.comments.push({block:t,text:s,start:i,end:n})})}catch(t){let s=t.message.replace(/ \(\d+:\d+\)$/,"");return e.id.endsWith(".json")?s+=" (Note that you need @rollup/plugin-json to import JSON files)":e.id.endsWith(".js")||(s+=" (Note that you need plugins to import files that are not JavaScript)"),e.error({code:"PARSE_ERROR",message:s,parserError:t},t.pos)}}(this,this.graph.acornParser,this.options.acorn);for(const e of this.comments)!e.block&&Qs.test(e.text)&&this.alwaysRemovedCode.push([e.start,e.end]);d=this.comments,Hs(this.esTreeAst,{commentIndex:0,commentNodes:d.filter(Xs)})}var d;hi("generate ast",3),this.resolvedIds=o||Object.create(null);const p=this.id;this.magicString=new x(s,{filename:this.excludeFromSourcemap?null:p,indentExclusionRanges:[]});for(const[e,t]of this.alwaysRemovedCode)this.magicString.remove(e,t);oi("analyse ast",3),this.astContext={addDynamicImport:this.addDynamicImport.bind(this),addExport:this.addExport.bind(this),addImport:this.addImport.bind(this),addImportMeta:this.addImportMeta.bind(this),code:s,deoptimizationTracker:this.graph.deoptimizationTracker,error:this.error.bind(this),fileName:p,getExports:this.getExports.bind(this),getModuleExecIndex:()=>this.execIndex,getModuleName:this.basename.bind(this),getReexports:this.getReexports.bind(this),importDescriptions:this.importDescriptions,includeAndGetAdditionalMergedNamespaces:this.includeAndGetAdditionalMergedNamespaces.bind(this),includeDynamicImport:this.includeDynamicImport.bind(this),includeVariable:this.includeVariable.bind(this),magicString:this.magicString,module:this,moduleContext:this.context,nodeConstructors:Ws,options:this.options,traceExport:this.getVariableForExportName.bind(this),traceVariable:this.traceVariable.bind(this),usesTopLevelAwait:!1,warn:this.warn.bind(this)},this.scope=new Ds(this.graph.scope,this.astContext),this.namespace=new St(this.astContext,this.syntheticNamedExports),this.ast=new Ls(this.esTreeAst,{type:"Module",context:this.astContext},this.scope),hi("analyse ast",3)}toJSON(){return{alwaysRemovedCode:this.alwaysRemovedCode,ast:this.esTreeAst,code:this.code,customTransformCache:this.customTransformCache,dependencies:Array.from(this.dependencies,Us),id:this.id,moduleSideEffects:this.moduleSideEffects,originalCode:this.originalCode,originalSourcemap:this.originalSourcemap,resolvedIds:this.resolvedIds,sourcemapChain:this.sourcemapChain,syntheticNamedExports:this.syntheticNamedExports,transformDependencies:this.transformDependencies,transformFiles:this.transformFiles}}traceVariable(e){const t=this.scope.variables.get(e);if(t)return t;if(e in this.importDescriptions){const t=this.importDescriptions[e],s=t.module;if(s instanceof mi&&"*"===t.name)return s.namespace;const i=s.getVariableForExportName(t.name);return i||di(t.name,this,s.id,t.start)}return null}warn(e,t){this.addLocationToLogProps(e,t),this.options.onwarn(e)}addDynamicImport(e){let t=e.source;t instanceof Os?1===t.quasis.length&&t.quasis[0].value.cooked&&(t=t.quasis[0].value.cooked):t instanceof ds&&"string"==typeof t.value&&(t=t.value),this.dynamicImports.push({node:e,resolution:null,argument:t})}addExport(e){if(e instanceof xt)this.exports.default={identifier:e.variable.getAssignedVariableName(),localName:"default"};else if(e instanceof as){const t=e.source.value;if(this.sources.add(t),e.exported){const s=e.exported.name;this.reexportDescriptions[s]={localName:"*",module:null,source:t,start:e.start}}else this.exportAllSources.add(t)}else if(e.source instanceof ds){const t=e.source.value;this.sources.add(t);for(const s of e.specifiers){const e=s.exported.name;this.reexportDescriptions[e]={localName:s.local.name,module:null,source:t,start:s.start}}}else if(e.declaration){const t=e.declaration;if(t instanceof Fs)for(const e of t.declarations)for(const t of rs(e.id))this.exports[t]={identifier:null,localName:t};else{const e=t.id.name;this.exports[e]={identifier:null,localName:e}}}else for(const t of e.specifiers){const e=t.local.name,s=t.exported.name;this.exports[s]={identifier:null,localName:e}}}addImport(e){const t=e.source.value;this.sources.add(t);for(const s of e.specifiers){const e="ImportDefaultSpecifier"===s.type,i="ImportNamespaceSpecifier"===s.type,n=e?"default":i?"*":s.imported.name;this.importDescriptions[s.local.name]={module:null,name:n,source:t,start:s.start}}}addImportMeta(e){this.importMetas.push(e)}addLocationToLogProps(e,t){e.id=this.id,e.pos=t;let s=this.code,{column:i,line:n}=Ge(s,t,{offsetLine:1});try{({column:i,line:n}=function(e,t){const s=e.filter(e=>e.mappings);for(;s.length>0;){const e=s.pop(),i=e.mappings[t.line-1];let n=!1;if(void 0!==i)for(const s of i)if(s[0]>=t.column){if(1===s.length)break;t={column:s[3],line:s[2]+1,name:5===s.length?e.names[s[4]]:void 0,source:e.sources[s[1]]},n=!0;break}if(!n)throw new Error("Can't resolve original location of error.")}return t}(this.sourcemapChain,{column:i,line:n})),s=this.originalCode}catch(e){this.options.onwarn({code:"SOURCEMAP_ERROR",id:this.id,loc:{column:i,file:this.id,line:n},message:"Error when using sourcemap for reporting an error: "+e.message,pos:t})}Ft(e,{column:i,line:n},s,this.id)}addModulesToImportDescriptions(e){for(const t of Object.keys(e)){const s=e[t],i=this.resolvedIds[s.source].id;s.module=this.graph.modulesById.get(i)}}includeAndGetAdditionalMergedNamespaces(){const e=[];for(const t of this.exportAllModules)if(t instanceof Ve){const s=t.getVariableForExportName("*");s.include(),this.imports.add(s),e.push(s)}else if(t.syntheticNamedExports){const s=t.getDefaultExport();s.include(),this.imports.add(s),e.push(s)}return e}includeDynamicImport(e){const t=this.dynamicImports.find(t=>t.node===e).resolution;t instanceof mi&&(t.includedDynamicImporters.push(this),t.includeAllExports())}includeVariable(e){const t=e.module;e.included||(e.include(),this.graph.needsTreeshakingPass=!0),t&&t!==this&&this.imports.add(e)}shimMissingExport(e){this.options.onwarn({code:"SHIMMED_EXPORT",exporter:Dt(this.id),exportName:e,message:`Missing export "${e}" has been shimmed in module ${Dt(this.id)}.`}),this.exports[e]=pi}}class gi{constructor(e,t){this.isOriginal=!0,this.filename=e,this.content=t}traceSegment(e,t,s){return{line:e,column:t,name:s,source:this}}}class yi{constructor(e,t){this.sources=t,this.names=e.names,this.mappings=e.mappings}traceMappings(){const e=[],t=[],s=[],i=[];for(const n of this.mappings){const r=[];for(const i of n){if(1==i.length)continue;const n=this.sources[i[1]];if(!n)continue;const a=n.traceSegment(i[2],i[3],5===i.length?this.names[i[4]]:"");if(a){let n=e.lastIndexOf(a.source.filename);if(-1===n)n=e.length,e.push(a.source.filename),t[n]=a.source.content;else if(null==t[n])t[n]=a.source.content;else if(null!=a.source.content&&t[n]!==a.source.content)return Bt({message:"Multiple conflicting contents for sourcemap source "+a.source.filename});const o=[i[0],n,a.line,a.column];if(a.name){let e=s.indexOf(a.name);-1===e&&(e=s.length,s.push(a.name)),o[4]=e}r.push(o)}}i.push(r)}return{sources:e,sourcesContent:t,names:s,mappings:i}}traceSegment(e,t,s){const i=this.mappings[e];if(!i)return null;let n=0,r=i.length-1;for(;n<=r;){const e=n+r>>1,a=i[e];if(a[0]===t){if(1==a.length)return null;const e=this.sources[a[1]];return e?e.traceSegment(a[2],a[3],5===a.length?this.names[a[4]]:s):null}a[0]>t?r=e-1:n=e+1}return null}}function xi(e){return function(t,s){return s.mappings?new yi(s,[t]):(e({code:"SOURCEMAP_BROKEN",message:`Sourcemap is likely to be incorrect: a plugin (${s.plugin}) was used to transform files, but didn't generate a sourcemap for the transformation. Consult the plugin documentation for help`,plugin:s.plugin,url:"https://rollupjs.org/guide/en/#warning-sourcemap-is-likely-to-be-incorrect"}),new yi({mappings:[],names:[]},[t]))}}function Ei(e,t,s,i,n){let r;if(s){const t=s.sources,i=s.sourcesContent||[],n=Le(e)||".",a=s.sourceRoot||".",o=t.map((e,t)=>new gi(De(n,a,e),i[t]));r=new yi(s,o)}else r=new gi(e,t);return i.reduce(n,r)}var vi=bi;function bi(e,t){if(!e)throw new Error(t||"Assertion failed")}function Si(e,t){return 55296==(64512&e.charCodeAt(t))&&!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1))}function Ai(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function Pi(e){return 1===e.length?"0"+e:e}function Ci(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}bi.equal=function(e,t,s){if(e!=t)throw new Error(s||"Assertion failed: "+e+" != "+t)};var ki={inherits:function(e,t,s){return e(s={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}()}},s.exports),s.exports}((function(e){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var s=function(){};s.prototype=t.prototype,e.prototype=new s,e.prototype.constructor=e}}})),toArray:function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var s=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),n=0;n>6|192,s[i++]=63&r|128):Si(e,n)?(r=65536+((1023&r)<<10)+(1023&e.charCodeAt(++n)),s[i++]=r>>18|240,s[i++]=r>>12&63|128,s[i++]=r>>6&63|128,s[i++]=63&r|128):(s[i++]=r>>12|224,s[i++]=r>>6&63|128,s[i++]=63&r|128)}else for(n=0;n>>0}return r},split32:function(e,t){for(var s=new Array(4*e.length),i=0,n=0;i>>24,s[n+1]=r>>>16&255,s[n+2]=r>>>8&255,s[n+3]=255&r):(s[n+3]=r>>>24,s[n+2]=r>>>16&255,s[n+1]=r>>>8&255,s[n]=255&r)}return s},rotr32:function(e,t){return e>>>t|e<<32-t},rotl32:function(e,t){return e<>>32-t},sum32:function(e,t){return e+t>>>0},sum32_3:function(e,t,s){return e+t+s>>>0},sum32_4:function(e,t,s,i){return e+t+s+i>>>0},sum32_5:function(e,t,s,i,n){return e+t+s+i+n>>>0},sum64:function(e,t,s,i){var n=e[t],r=i+e[t+1]>>>0,a=(r>>0,e[t+1]=r},sum64_hi:function(e,t,s,i){return(t+i>>>0>>0},sum64_lo:function(e,t,s,i){return t+i>>>0},sum64_4_hi:function(e,t,s,i,n,r,a,o){var h=0,l=t;return h+=(l=l+i>>>0)>>0)>>0)>>0},sum64_4_lo:function(e,t,s,i,n,r,a,o){return t+i+r+o>>>0},sum64_5_hi:function(e,t,s,i,n,r,a,o,h,l){var c=0,u=t;return c+=(u=u+i>>>0)>>0)>>0)>>0)>>0},sum64_5_lo:function(e,t,s,i,n,r,a,o,h,l){return t+i+r+o+l>>>0},rotr64_hi:function(e,t,s){return(t<<32-s|e>>>s)>>>0},rotr64_lo:function(e,t,s){return(e<<32-s|t>>>s)>>>0},shr64_hi:function(e,t,s){return e>>>s},shr64_lo:function(e,t,s){return(e<<32-s|t>>>s)>>>0}};function wi(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}var Ni=wi;wi.prototype.update=function(e,t){if(e=ki.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var s=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-s,e.length),0===this.pending.length&&(this.pending=null),e=ki.join32(e,0,e.length-s,this.endian);for(var i=0;i>>24&255,i[n++]=e>>>16&255,i[n++]=e>>>8&255,i[n++]=255&e}else for(i[n++]=255&e,i[n++]=e>>>8&255,i[n++]=e>>>16&255,i[n++]=e>>>24&255,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,r=8;r>>3},g1_256:function(e){return Ii(e,17)^Ii(e,19)^e>>>10}},Ri=ki.sum32,Oi=ki.sum32_4,Di=ki.sum32_5,Vi=Li.ch32,Bi=Li.maj32,Fi=Li.s0_256,Wi=Li.s1_256,Ui=Li.g0_256,zi=Li.g1_256,ji=_i.BlockHash,Gi=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function Hi(){if(!(this instanceof Hi))return new Hi;ji.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=Gi,this.W=new Array(64)}ki.inherits(Hi,ji);var qi=Hi;Hi.blockSize=512,Hi.outSize=256,Hi.hmacStrength=192,Hi.padLength=64,Hi.prototype._update=function(e,t){for(var s=this.W,i=0;i<16;i++)s[i]=e[t+i];for(;iqi(),Xi={amd:Ji,cjs:Ji,es:function(e,t,s,i,n,r,a){if(n)for(const t of s)t.variableName=O(t.variableName,e);Qi(e,t,0,i);for(const t of a)t.setSafeName(O(t.name,e))},iife:Ji,system:Qi,umd:Ji};function Yi(e,t,s,i,n,r,a,o,h,l){for(const t of e)t.scope.addUsedOutsideNames(i,n,l);!function(e,t){for(const s of t){for(const t of s.scope.variables.values())t.included&&!(t.renderBaseName||t instanceof vt&&t.getOriginalVariable()!==t)&&t.setRenderNames(null,O(t.name,e));const t=s.namespace;t.included&&t.setRenderNames(null,O(t.name,e))}}(i,e),Xi[n](i,s,t,r,a,o,h);for(const t of e)t.scope.deconflict(n,l)}function Qi(e,t,s,i){for(const s of t){const t=s.module,n=s.name;let r;r=t instanceof Ve&&("*"===n||"default"===n)?"default"===n&&i&&t.exportsNamespace?t.variableName+"__default":t.variableName:n,s.setRenderNames(null,O(r,e))}}function Ji(e,t,s,i,n,r){for(const t of s)t.variableName=O(t.variableName,e);for(const e of t){const t=e.module;if(t instanceof Ve){const s=e.name;"default"===s&&i&&(t.exportsNamespace||t.exportsNames)?e.setRenderNames(null,t.variableName+"__default"):"*"===s||"default"===s?e.setRenderNames(null,t.variableName):e.setRenderNames(t.variableName,null)}else{const s=r.get(t);"default"===s.exportMode||n&&e.isNamespace?e.setRenderNames(null,s.variableName):e.setRenderNames(s.variableName,s.getVariableExportName(e))}}}const Zi=/[\\'\r\n\u2028\u2029]/,en=/(['\r\n\u2028\u2029])/g,tn=/\\/g;function sn(e){return e.match(Zi)?e.replace(tn,"\\\\").replace(en,"\\$1"):e}const nn=(e,t)=>e.execIndex>t.execIndex?1:-1;function rn(e){e.sort(nn)}function an(e,t,s){const i=[Dt(e.id)];let n=t;for(;n!==e;)i.push(Dt(n.id)),n=s.get(n);return i.push(i[0]),i.reverse(),i}function on(e,{exports:t,name:s,format:i},n,r){const a=e.getExportNames();if("default"===t){if(1!==a.length||"default"!==a[0])return Bt(Ut("default",a,n))}else if("none"===t&&a.length)return Bt(Ut("none",a,n));return"auto"===t&&(0===a.length?t="none":1===a.length&&"default"===a[0]?t="default":("es"!==i&&-1!==a.indexOf("default")&&r(function(e,t){return{code:Wt.MIXED_EXPORTS,id:e,message:`Entry module "${Dt(e)}" is using named and default exports together. Consumers of your bundle will have to use \`${t||"chunk"}["default"]\` to access the default export, which may not be what you want. Use \`output.exports: "named"\` to disable this warning`,url:"https://rollupjs.org/guide/en/#output-exports"}}(n,s)),t="named")),t}function hn(e){const t=e.split("\n"),s=t.filter(e=>/^\t+/.test(e)),i=t.filter(e=>/^ {2,}/.test(e));if(0===s.length&&0===i.length)return null;if(s.length>=i.length)return"\t";const n=i.reduce((e,t)=>{const s=/^ +/.exec(t)[0].length;return Math.min(s,e)},1/0);return new Array(n+1).join(" ")}function ln(e){if(!e)return null;if("string"==typeof e&&(e=JSON.parse(e)),""===e.mappings)return{mappings:[],names:[],sources:[],version:3};let s;return s="string"==typeof e.mappings?function(e){for(var s=[],i=[],r=[0,0,0,0,0],a=0,o=0,h=0,l=0;o>>=1,p&&(l=0===l?-2147483648:-l),r[a]+=l,a++,l=h=0}}}return n(i,r,a),s.push(i),s}(e.mappings):e.mappings,{...e,mappings:s}}function cn(e,t,s){return Vt(e)?e.replace(/\[(\w+)\]/g,(e,i)=>{if(!s.hasOwnProperty(i))return Bt(Gt(`"[${i}]" is not a valid placeholder in "${t}" pattern.`));const n=s[i]();return Vt(n)?n:Bt(Gt(`Invalid substitution "${n}" for placeholder "[${i}]" in "${t}" pattern, can be neither absolute nor relative path.`))}):Bt(Gt(`Invalid pattern "${e}" for "${t}", patterns can be neither absolute nor relative paths and must not contain invalid characters.`))}function un(e,t){const s=new Set(Object.keys(t).map(e=>e.toLowerCase()));if(!s.has(e.toLocaleLowerCase()))return e;const i=Re(e);e=e.substr(0,e.length-i.length);let n,r=1;for(;s.has((n=e+ ++r+i).toLowerCase()););return n}const dn=[".js",".jsx",".ts",".tsx"];function pn(e,t,s,i){const n="function"==typeof t?t(e.id):t[e.id];return n||(s?(i({code:"MISSING_GLOBAL_NAME",guess:e.variableName,message:`No name was provided for external module '${e.id}' in output.globals – guessing '${e.variableName}'`,source:e.id}),e.variableName):void 0)}class fn{constructor(e,t,s,i,n,r,a,o){this.orderedModules=e,this.inputOptions=t,this.outputOptions=s,this.unsetOptions=i,this.modulesById=n,this.chunkByModule=r,this.facadeChunkByModule=a,this.manualChunkAlias=o,this.entryModules=[],this.exportMode="named",this.facadeModule=null,this.id=null,this.dependencies=new Set,this.dynamicDependencies=new Set,this.dynamicEntryModules=[],this.exportNamesByVariable=null,this.exports=new Set,this.exportsByName=null,this.fileName=null,this.implicitEntryModules=[],this.implicitlyLoadedBefore=new Set,this.imports=new Set,this.indentString=void 0,this.isEmpty=!0,this.name=null,this.needsExportsShim=!1,this.renderedDependencies=null,this.renderedExports=null,this.renderedHash=void 0,this.renderedModuleSources=new Map,this.renderedSource=null,this.sortedExportNames=null,this.strictFacade=!1,this.usedModules=void 0,this.execIndex=e.length>0?e[0].execIndex:1/0;const h=new Set(e);for(const t of e){this.isEmpty&&t.isIncluded()&&(this.isEmpty=!1),(t.isEntryPoint||s.preserveModules)&&this.entryModules.push(t);for(const e of t.includedDynamicImporters)h.has(e)||this.dynamicEntryModules.push(t);t.implicitlyLoadedAfter.size>0&&this.implicitEntryModules.push(t)}this.variableName=we(this.generateVariableName())}static generateFacade(e,t,s,i,n,r,a,o){const h=new fn([],e,t,s,i,n,r,null);h.assignFacadeName(o,a),r.has(a)||r.set(a,h);for(const e of a.getDependenciesToBeIncluded())h.dependencies.add(e instanceof mi?n.get(e):e);return!h.dependencies.has(n.get(a))&&a.moduleSideEffects&&a.hasEffects()&&h.dependencies.add(n.get(a)),h.ensureReexportsAreAvailableForModule(a),h.facadeModule=a,h.strictFacade=!0,h}canModuleBeFacade(e,t){const s=e.getExportNamesByVariable();for(const t of this.exports)if(!s.has(t))return 0===s.size&&e.isUserDefinedEntryPoint&&"strict"===e.preserveSignature&&this.unsetOptions.has("preserveEntrySignatures")&&this.inputOptions.onwarn({code:"EMPTY_FACADE",id:e.id,message:`To preserve the export signature of the entry module "${Dt(e.id)}", an empty facade chunk was created. This often happens when creating a bundle for a web app where chunks are placed in script tags and exports are ignored. In this case it is recommended to set "preserveEntrySignatures: false" to avoid this and reduce the number of chunks. Otherwise if this is intentional, set "preserveEntrySignatures: 'strict'" explicitly to silence this warning.`,url:"https://rollupjs.org/guide/en/#preserveentrysignatures"}),!1;for(const i of t)if(!s.has(i)&&i.module!==e)return!1;return!0}generateExports(){this.sortedExportNames=null,this.exportsByName=Object.create(null),this.exportNamesByVariable=new Map;const e=new Set(this.exports);if(null!==this.facadeModule&&(!1!==this.facadeModule.preserveSignature||this.strictFacade)){const t=this.facadeModule.getExportNamesByVariable();for(const[s,i]of t){this.exportNamesByVariable.set(s,[...i]);for(const e of i)this.exportsByName[e]=s;e.delete(s)}}this.outputOptions.minifyInternalExports?function(e,t,s){let i=0;for(const n of e){let e=n.name[0];if(t[e])do{e=L(++i),49===e.charCodeAt(0)&&(i+=9*64**(e.length-1),e=L(i))}while(R[e]||t[e]);t[e]=n,s.set(n,[e])}}(e,this.exportsByName,this.exportNamesByVariable):function(e,t,s){for(const i of e){let e=0,n=i.name;for(;t[n];)n=i.name+"$"+ ++e;t[n]=i,s.set(i,[n])}}(e,this.exportsByName,this.exportNamesByVariable),(this.outputOptions.preserveModules||this.facadeModule&&this.facadeModule.isEntryPoint)&&(this.exportMode=on(this,this.outputOptions,this.facadeModule.id,this.inputOptions.onwarn))}generateFacades(){var e;const t=[],s=new Set([...this.entryModules,...this.implicitEntryModules]),i=new Set(this.dynamicEntryModules.map(e=>e.namespace));for(const e of s)if(e.preserveSignature)for(const t of e.getExportNamesByVariable().keys())i.add(t);for(const e of s){const s=Array.from(e.userChunkNames,e=>({name:e}));0===s.length&&e.isUserDefinedEntryPoint&&s.push({}),s.push(...Array.from(e.chunkFileNames,e=>({fileName:e}))),0===s.length&&s.push({}),this.facadeModule||!this.outputOptions.preserveModules&&"strict"===e.preserveSignature&&!this.canModuleBeFacade(e,i)||(this.facadeModule=e,this.facadeChunkByModule.set(e,this),e.preserveSignature&&(this.strictFacade="strict"===e.preserveSignature,this.ensureReexportsAreAvailableForModule(e)),this.assignFacadeName(s.shift(),e));for(const i of s)t.push(fn.generateFacade(this.inputOptions,this.outputOptions,this.unsetOptions,this.modulesById,this.chunkByModule,this.facadeChunkByModule,e,i))}for(const t of this.dynamicEntryModules)!this.facadeModule&&this.canModuleBeFacade(t,i)?(this.facadeModule=t,this.facadeChunkByModule.set(t,this),this.strictFacade=!0,this.assignFacadeName({},t)):this.facadeModule===t&&!this.strictFacade&&this.canModuleBeFacade(t,i)?this.strictFacade=!0:(null===(e=this.facadeChunkByModule.get(t))||void 0===e?void 0:e.strictFacade)||(t.namespace.include(),this.exports.add(t.namespace));return t}generateId(e,t,s,i,n){if(null!==this.fileName)return this.fileName;const[r,a]=this.facadeModule&&this.facadeModule.isUserDefinedEntryPoint?[t.entryFileNames,"output.entryFileNames"]:[t.chunkFileNames,"output.chunkFileNames"];return un(cn(r,a,{format:()=>t.format,hash:()=>i?this.computeContentHashWithDependencies(e,t,s,n):"[hash]",name:()=>this.getChunkName()}),s)}generateIdPreserveModules(e,t,s,i){const n=this.orderedModules[0].id,r=Rt(n);let a;if(Ie(n)){const s=Re(n),o=i.has("entryFileNames")?dn.includes(s)?"[name].js":"[name][extname].js":t.entryFileNames;a=b(e,`${Le(r)}/${cn(o,"output.entryFileNames",{ext:()=>s.substr(1),extname:()=>s,format:()=>t.format,name:()=>this.getChunkName()})}`)}else a="_virtual/"+Te(r);return un(Me(a),s)}getChunkName(){return this.name||(this.name=Rt(this.getFallbackChunkName()))}getExportNames(){return this.sortedExportNames||(this.sortedExportNames=Object.keys(this.exportsByName).sort())}getPrerenderedChunk(){const e=this.facadeModule,t=this.getChunkName.bind(this);return{code:void 0,dynamicImports:Array.from(this.dynamicDependencies,Us),exports:this.getExportNames(),facadeModuleId:e&&e.id,fileName:void 0,implicitlyLoadedBefore:Array.from(this.implicitlyLoadedBefore,Us),imports:Array.from(this.dependencies,Us),isDynamicEntry:this.dynamicEntryModules.length>0,isEntry:null!==e&&e.isEntryPoint,isImplicitEntry:this.implicitEntryModules.length>0,map:void 0,modules:this.renderedModules,get name(){return t()},type:"chunk"}}getRenderedHash(e){if(this.renderedHash)return this.renderedHash;const t=Ki(),s=e.hookReduceValueSync("augmentChunkHash","",[this.getPrerenderedChunk()],(e,t)=>(t&&(e+=t),e));return t.update(s),t.update(this.renderedSource.toString()),t.update(this.getExportNames().map(e=>{const t=this.exportsByName[e];return`${Dt(t.module.id).replace(/\\/g,"/")}:${t.name}:${e}`}).join(",")),this.renderedHash=t.digest("hex")}getVariableExportName(e){return this.outputOptions.preserveModules&&e instanceof St?"*":this.exportNamesByVariable.get(e)[0]}link(){for(const e of this.orderedModules)this.addDependenciesToChunk(e.getDependenciesToBeIncluded(),this.dependencies),this.addDependenciesToChunk(e.dynamicDependencies,this.dynamicDependencies),this.addDependenciesToChunk(e.implicitlyLoadedBefore,this.implicitlyLoadedBefore),this.setUpChunkImportsAndExportsForModule(e)}preRender(e,t,s){const i=new v({separator:e.compact?"":"\n\n"});this.usedModules=[],this.indentString=function(e,t){if(!0!==t.indent)return t.indent;for(let t=0;te.reexports&&0!==e.reexports.length);let o=!1;const h=new Set;for(const e of this.orderedModules){e.usesTopLevelAwait&&(o=!0);const t=e.scope.accessedGlobalVariablesByFormat,s=t&&t.get(n);if(s)for(const e of s)h.add(e)}if(o&&"es"!==n&&"system"!==n)return Bt({code:"INVALID_TLA_FORMAT",message:`Module format ${n} does not support top-level await. Use the "es" or "system" output formats rather.`});const c=r(this.renderedSource,{accessedGlobals:h,dependencies:[...this.renderedDependencies.values()],exports:this.renderedExports,hasExports:a,indentString:this.indentString,intro:t.intro,isEntryModuleFacade:this.outputOptions.preserveModules||null!==this.facadeModule&&this.facadeModule.isEntryPoint,namedExportsMode:"default"!==this.exportMode,outro:t.outro,usesTopLevelAwait:o,varOrConst:e.preferConst?"const":"var",warn:this.inputOptions.onwarn},e);t.banner&&c.prepend(t.banner),t.footer&&c.append(t.footer);const u=c.toString();hi("render format",2);let d=null;const p=[];let f=await function({code:e,options:t,outputPluginDriver:s,renderChunk:i,sourcemapChain:n}){return s.hookReduceArg0("renderChunk",[e,i,t],(e,t,s)=>{if(null==t)return e;if("string"==typeof t&&(t={code:t,map:void 0}),null!==t.map){const e=ln(t.map);n.push(e||{missing:!0,plugin:s.name})}return t.code})}({code:u,options:e,outputPluginDriver:i,renderChunk:s,sourcemapChain:p});if(e.sourcemap){let t;oi("sourcemap",2),t=e.file?De(e.sourcemapFile||e.file):e.dir?De(e.dir,this.id):De(this.id);const s=c.generateDecodedMap({});d=function(e,t,s,i,n,r){const a=xi(r),o=s.filter(e=>!e.excludeFromSourcemap).map(e=>Ei(e.id,e.originalCode,e.originalSourcemap,e.sourcemapChain,a));let h=new yi(t,o);h=i.reduce(a,h);let{sources:c,sourcesContent:u,names:d,mappings:p}=h.traceMappings();if(e){const t=Le(e);c=c.map(e=>Oe(t,e)),e=Te(e)}return u=n?null:u,new l({file:e,sources:c,sourcesContent:u,names:d,mappings:p})}(t,s,this.usedModules,p,e.sourcemapExcludeSources,this.inputOptions.onwarn),d.sources=d.sources.map(s=>{const{sourcemapPathTransform:i}=e;if(i){const e=i(s,t+".map");return"string"!=typeof e&&Bt(Gt("sourcemapPathTransform function must return a string.")),e}return s}).map(Me),hi("sourcemap",2)}return!0!==e.compact&&"\n"!==f[f.length-1]&&(f+="\n"),{code:f,map:d}}addDependenciesToChunk(e,t){for(const s of e)if(s instanceof mi){const e=this.chunkByModule.get(s);e&&e!==this&&t.add(e)}else t.add(s)}assignFacadeName({fileName:e,name:t},s){e?this.fileName=e:this.name=Rt(t||s.chunkName||Ot(s.id))}computeContentHashWithDependencies(e,t,s,i){const n=Ki();n.update([e.intro,e.outro,e.banner,e.footer].map(e=>e||"").join(":")),n.update(t.format);const r=new Set([this]);for(const a of r)if(a instanceof Ve?n.update(":"+a.renderPath):(n.update(a.getRenderedHash(i)),n.update(a.generateId(e,t,s,!1,i))),!(a instanceof Ve))for(const e of[...a.dependencies,...a.dynamicDependencies])r.add(e);return n.digest("hex").substr(0,8)}ensureReexportsAreAvailableForModule(e){const t=e.getExportNamesByVariable();for(const e of t.keys()){const t=e instanceof At,s=t?e.getBaseVariable():e;if(!(s instanceof St&&this.outputOptions.preserveModules)){const e=s.module;if(e instanceof mi){const i=this.chunkByModule.get(e);i&&i!==this&&(i.exports.add(s),t&&this.imports.add(s))}}}}finaliseDynamicImports(e){const t="amd"===e.format;for(const[s,i]of this.renderedModuleSources)for(const{node:n,resolution:r}of s.dynamicImports){const s=this.chunkByModule.get(r),a=this.facadeChunkByModule.get(r);if(!r||!n.included||s===this)continue;const o=r instanceof mi?`'${this.getRelativePath((a||s).id,t)}'`:r instanceof Ve?`'${r.renormalizeRenderPath?this.getRelativePath(r.renderPath,t):r.renderPath}'`:r;n.renderFinalResolution(i,o,r instanceof mi&&!(null==a?void 0:a.strictFacade)&&s.exportNamesByVariable.get(r.namespace)[0],e)}}finaliseImportMetas(e,t){for(const[s,i]of this.renderedModuleSources)for(const n of s.importMetas)n.renderFinalMechanism(i,this.id,e,t)}generateVariableName(){if(this.manualChunkAlias)return this.manualChunkAlias;const e=this.entryModules[0]||this.implicitEntryModules[0]||this.dynamicEntryModules[0]||this.orderedModules[this.orderedModules.length-1];return e?e.chunkName||Ot(e.id):"chunk"}getChunkDependencyDeclarations(e){const t=new Map;for(let s of this.getExportNames()){let i,n,r=!1;if("*"===s[0])r=e.externalLiveBindings,i=this.modulesById.get(s.substr(1)),n=s="*";else{const t=this.exportsByName[s];if(t instanceof At)continue;const a=t.module;if(a instanceof mi){if(i=this.chunkByModule.get(a),i===this)continue;n=i.getVariableExportName(t),r=t.isReassigned}else i=a,n=t.name,r=e.externalLiveBindings}let a=t.get(i);a||t.set(i,a=[]),a.push({imported:n,reexported:s,needsLiveBinding:r})}const s=new Set,i=new Map;for(const n of this.dependencies){const r=[];for(const e of this.imports)(e.module instanceof mi?this.chunkByModule.get(e.module)!==n:e.module!==n)||s.has(e)||(s.add(e),r.push({imported:e.module instanceof Ve?e.name:this.chunkByModule.get(e.module).getVariableExportName(e),local:e.getName()}));const a=t.get(n);let o,h,l=!0;n instanceof Ve?(o=n.exportsNames||n.exportsNamespace,h="default"in n.declarations):(o=!0,h=!1,l="default"!==n.exportMode),i.set(n,{exportsDefault:h,exportsNames:o,globalName:n instanceof Ve&&("umd"===e.format||"iife"===e.format)&&pn(n,e.globals,o||h,this.inputOptions.onwarn),id:void 0,imports:r.length>0?r:null,isChunk:n instanceof fn,name:n.variableName,namedExportsMode:l,reexports:a})}return i}getChunkExportDeclarations(e){const t=[];for(const s of this.getExportNames()){if("*"===s[0])continue;const i=this.exportsByName[s];if(!(i instanceof At)){const e=i.module;if(e&&this.chunkByModule.get(e)!==this)continue}let n=null,r=!1,a=!1,o=i.getName();if(i instanceof Ue){i.init===K&&(a=!0);for(const e of i.declarations)if(e.parent instanceof yt||e instanceof xt&&e.declaration instanceof yt){r=!0;break}}else i instanceof At&&(n=o,"es"===e&&"default"!==s&&(o=i.renderName));t.push({exported:s,expression:n,hoisted:r,local:o,uninitialized:a})}return t}getFallbackChunkName(){return this.manualChunkAlias?this.manualChunkAlias:this.fileName?Ot(this.fileName):Ot(this.orderedModules[this.orderedModules.length-1].id)}getRelativePath(e,t){let s=Me(b(Le(this.id),e));return t&&s.endsWith(".js")&&(s=s.slice(0,-3)),".."===s?"../../"+Te(e):""===s?"../"+Te(e):s.startsWith("../")?s:"./"+s}inlineChunkDependencies(e){for(const t of e.dependencies)this.dependencies.has(t)||(this.dependencies.add(t),t instanceof fn&&this.inlineChunkDependencies(t))}prepareDynamicImports(){for(const e of this.orderedModules)for(const{node:t,resolution:s}of e.dynamicImports)if(t.included)if(s instanceof mi){const e=this.chunkByModule.get(s);e===this?t.setInternalResolution(s.namespace):t.setExternalResolution(e.exportMode,s)}else t.setExternalResolution("auto",s)}setExternalRenderPaths(e,t){for(const s of[...this.dependencies,...this.dynamicDependencies])s instanceof Ve&&s.setRenderPath(e,t)}setIdentifierRenderResolutions(e){const t=new Set;for(const s of this.getExportNames()){const i=this.exportsByName[s];i instanceof bt&&(this.needsExportsShim=!0),"es"!==e.format&&"system"!==e.format&&i.isReassigned&&!i.isId?i.setRenderNames("exports",s):i instanceof At?t.add(i):i.setRenderNames(null,null)}const s=new Set;switch(this.needsExportsShim&&s.add("_missingExportShim"),e.format){case"es":break;case"cjs":s.add("_interopDefault").add("require").add("__filename").add("__dirname");case"system":s.add("module");default:s.add("exports")}Yi(this.orderedModules,this.dependencies,this.imports,s,e.format,e.interop,this.outputOptions.preserveModules,this.chunkByModule,t,this.exportNamesByVariable)}setUpChunkImportsAndExportsForModule(e){const t=new Set(e.imports);if(!this.outputOptions.preserveModules){const s=e.namespace;if(s.included){const e=s.getMemberVariables();for(const s of Object.keys(e))t.add(e[s])}}for(let e of t){e instanceof vt&&(e=e.getOriginalVariable()),e instanceof At&&(e=e.getBaseVariable());const t=this.chunkByModule.get(e.module);t!==this&&(this.imports.add(e),!(e instanceof St&&this.outputOptions.preserveModules)&&e.module instanceof mi&&t.exports.add(e))}(e.namespace.included||e.isEntryPoint&&!1!==e.preserveSignature||e.includedDynamicImporters.some(e=>this.chunkByModule.get(e)!==this))&&this.ensureReexportsAreAvailableForModule(e);for(const{node:t,resolution:s}of e.dynamicImports)t.included&&s instanceof mi&&this.chunkByModule.get(s)===this&&!s.namespace.included&&(s.namespace.include(),this.ensureReexportsAreAvailableForModule(s))}}const mn=(e,t)=>t?`${e}\n${t}`:e,gn=(e,t)=>t?`${e}\n\n${t}`:e;function yn(e,t){const s=[],i=new Set(t.keys()),n=Object.create(null);for(const[e,s]of t)xn(e,n[s]=n[s]||[],i);for(const[e,t]of Object.entries(n))s.push({alias:e,modules:t});const r=new Map,{dependentEntryPointsByModule:a,dynamicEntryModules:o}=function(e){const t=new Set,s=new Map,i=new Set(e);for(const e of i){const n=new Set([e]);for(const r of n){En(s,r).add(e);for(const e of r.getDependenciesToBeIncluded())e instanceof Ve||n.add(e);for(const{resolution:e}of r.dynamicImports)e instanceof mi&&e.includedDynamicImporters.length>0&&(t.add(e),i.add(e));for(const e of r.implicitlyLoadedBefore)t.add(e),i.add(e)}}return{dependentEntryPointsByModule:s,dynamicEntryModules:t}}(e),h=function(e,t){const s=new Map;for(const i of t){const t=En(s,i);for(const s of[...i.includedDynamicImporters,...i.implicitlyLoadedAfter])for(const i of e.get(s))t.add(i)}return s}(a,o),l=new Set(e);function c(e,t){const s=new Set([e]);for(const n of s){const o=En(r,n);if(!t||!u(t,a.get(n))){o.add(e);for(const e of n.getDependenciesToBeIncluded())e instanceof Ve||i.has(e)||s.add(e)}}}function u(e,t){const s=new Set(e);for(const e of s)if(!t.has(e)){if(l.has(e))return!1;const t=h.get(e);for(const e of t)s.add(e)}return!0}for(const t of e)i.has(t)||c(t,null);for(const e of o)i.has(e)||c(e,h.get(e));return s.push(...function(e,t){const s=Object.create(null);for(const[i,n]of t){let t="";for(const s of e)t+=n.has(s)?"X":"_";const r=s[t];r?r.push(i):s[t]=[i]}return Object.keys(s).map(e=>({alias:null,modules:s[e]}))}([...e,...o],r)),s}function xn(e,t,s){const i=new Set([e]);for(const e of i){s.add(e),t.push(e);for(const t of e.dependencies)t instanceof Ve||s.has(t)||i.add(t)}}function En(e,t){const s=e.get(t)||new Set;return e.set(t,s),s}var vn;function bn(e,t,s){e in t&&s(function(e){return{code:Wt.FILE_NAME_CONFLICT,message:`The emitted file "${e}" overwrites a previously emitted file of the same name.`}}(e)),t[e]=Sn}!function(e){e[e.LOAD_AND_PARSE=0]="LOAD_AND_PARSE",e[e.ANALYSE=1]="ANALYSE",e[e.GENERATE=2]="GENERATE"}(vn||(vn={}));const Sn={type:"placeholder"};function An(e,t,s){if(!("string"==typeof e||e instanceof Uint8Array)){const e=t.fileName||t.name||s;return Bt(Gt(`Could not set source for ${"string"==typeof e?`asset "${e}"`:"unnamed asset"}, asset source needs to be a string, Uint8Array or Buffer.`))}return e}function Pn(e,t){return"string"!=typeof e.fileName?Bt((s=e.name||t,{code:Wt.ASSET_NOT_FINALISED,message:`Plugin error - Unable to get file name for asset "${s}". Ensure that the source is set and that generate is called first.`})):e.fileName;var s}function Cn(e,t){var s;const i=e.fileName||e.module&&(null===(s=null==t?void 0:t.get(e.module))||void 0===s?void 0:s.id);return i||Bt((n=e.fileName||e.name,{code:Wt.CHUNK_NOT_GENERATED,message:`Plugin error - Unable to get file name for chunk "${n}". Ensure that generate is called first.`}));var n}class kn{constructor(e,t,s){this.graph=e,this.options=t,this.facadeChunkByModule=null,this.output=null,this.assertAssetsFinalized=()=>{for(const[t,s]of this.filesByReferenceId.entries())if("asset"===s.type&&"string"!=typeof s.fileName)return Bt((e=s.name||t,{code:Wt.ASSET_SOURCE_MISSING,message:`Plugin error creating asset "${e}" - no asset source set.`}));var e},this.emitFile=e=>function(e){return e&&("asset"===e.type||"chunk"===e.type)}(e)?function(e){const t=e.fileName||e.name;return!t||"string"==typeof t&&Vt(t)}(e)?"chunk"===e.type?this.emitChunk(e):this.emitAsset(e):Bt(Gt(`The "fileName" or "name" properties of emitted files must be strings that are neither absolute nor relative paths and do not contain invalid characters, received "${e.fileName||e.name}".`)):Bt(Gt(`Emitted files must be of type "asset" or "chunk", received "${e&&e.type}".`)),this.getFileName=e=>{const t=this.filesByReferenceId.get(e);return t?"chunk"===t.type?Cn(t,this.facadeChunkByModule):Pn(t,e):Bt((s=e,{code:Wt.FILE_NOT_FOUND,message:`Plugin error - Unable to get file name for unknown file "${s}".`}));var s},this.setAssetSource=(e,t)=>{const s=this.filesByReferenceId.get(e);if(!s)return Bt((i=e,{code:Wt.ASSET_NOT_FOUND,message:`Plugin error - Unable to set the source for unknown asset "${i}".`}));var i,n;if("asset"!==s.type)return Bt(Gt(`Asset sources can only be set for emitted assets but "${e}" is an emitted chunk.`));if(void 0!==s.source)return Bt((n=s.name||e,{code:Wt.ASSET_SOURCE_ALREADY_SET,message:`Unable to set the source for asset "${n}", source already set.`}));const r=An(t,s,e);this.output?this.finalizeAsset(s,r,e,this.output):s.source=r},this.setOutputBundle=(e,t,s)=>{this.output={assetFileNames:t,bundle:e},this.facadeChunkByModule=s;for(const e of this.filesByReferenceId.values())e.fileName&&bn(e.fileName,this.output.bundle,this.options.onwarn);for(const[e,t]of this.filesByReferenceId.entries())"asset"===t.type&&void 0!==t.source&&this.finalizeAsset(t,t.source,e,this.output)},this.filesByReferenceId=s?new Map(s.filesByReferenceId):new Map}assignReferenceId(e,t){let s;do{const e=Ki();s?e.update(s):e.update(t),s=e.digest("hex").substr(0,8)}while(this.filesByReferenceId.has(s));return this.filesByReferenceId.set(s,e),s}emitAsset(e){const t=void 0!==e.source?An(e.source,e,null):void 0,s={fileName:e.fileName,name:e.name,source:t,type:"asset"},i=this.assignReferenceId(s,e.fileName||e.name||e.type);return this.output&&(e.fileName&&bn(e.fileName,this.output.bundle,this.options.onwarn),void 0!==t&&this.finalizeAsset(s,t,i,this.output)),i}emitChunk(e){if(this.graph.phase>vn.LOAD_AND_PARSE)return Bt({code:Wt.INVALID_ROLLUP_PHASE,message:"Cannot emit chunks after module loading has finished."});if("string"!=typeof e.id)return Bt(Gt(`Emitted chunks need to have a valid string id, received "${e.id}"`));const t={fileName:e.fileName,module:null,name:e.name||e.id,type:"chunk"};return this.graph.moduleLoader.emitChunk(e).then(e=>t.module=e).catch(()=>{}),this.assignReferenceId(t,e.id)}finalizeAsset(e,t,s,i){const n=e.fileName||function(e,t){for(const s of Object.keys(e)){const i=e[s];if("asset"===i.type&&wn(t,i.source))return s}return null}(i.bundle,t)||function(e,t,s){const i=e||"asset";return un(cn(s.assetFileNames,"output.assetFileNames",{hash(){const e=Ki();return e.update(i),e.update(":"),e.update(t),e.digest("hex").substr(0,8)},ext:()=>Re(i).substr(1),extname:()=>Re(i),name:()=>i.substr(0,i.length-Re(i).length)}),s.bundle)}(e.name,t,i),r={...e,source:t,fileName:n};this.filesByReferenceId.set(s,r);const a=this.options;i.bundle[n]={fileName:n,get isAsset(){return Ht('Accessing "isAsset" on files in the bundle is deprecated, please use "type === \'asset\'" instead',!0,a),!0},source:t,type:"asset"}}}function wn(e,t){if("string"==typeof e)return e===t;if("string"==typeof t)return!1;if("equals"in e)return e.equals(t);if(e.length!==t.length)return!1;for(let s=0;s1&&("umd"===(s=this.outputOptions).format||"iife"===s.format?Bt({code:"INVALID_OPTION",message:"UMD and IIFE output formats are not supported for code-splitting builds."}):"string"==typeof s.file?Bt({code:"INVALID_OPTION",message:'When building multiple chunks, the "output.dir" option must be used, not "output.file". To inline dynamic imports, set the "inlineDynamicImports" option.'}):s.sourcemapFile&&Bt({code:"INVALID_OPTION",message:'"output.sourcemapFile" is only supported for single-file builds.'}));const i=function(e){if(0===e.length)return"/";if(1===e.length)return Le(e[0]);const t=e.slice(1).reduce((e,t)=>{const s=t.split(/\/+|\\+/);let i;for(i=0;e[i]===s[i]&&i1?t.join("/"):"/"}(function(e){const t=[];for(const s of e)for(const e of s.entryModules)Ie(e.id)&&t.push(e.id);return t}(e));hi("generate chunks",2),oi("render modules",2);const n=await async function(e,t){try{let[s,i,n,r]=await Promise.all([t.hookReduceValue("banner",e.banner(),[],mn),t.hookReduceValue("footer",e.footer(),[],mn),t.hookReduceValue("intro",e.intro(),[],gn),t.hookReduceValue("outro",e.outro(),[],gn)]);return n&&(n+="\n\n"),r&&(r="\n\n"+r),s.length&&(s+="\n"),i.length&&(i="\n"+i),{intro:n,outro:r,banner:s,footer:i}}catch(e){return Bt({code:"ADDON_ERROR",message:`Could not retrieve ${e.hook}. Check configuration of plugin ${e.plugin}.\n\tError Message: ${e.message}`})}}(this.outputOptions,this.pluginDriver);this.prerenderChunks(e,i),hi("render modules",2),await this.addFinalizedChunksToBundle(e,i,n,t)}catch(e){throw await this.pluginDriver.hookParallel("renderError",[e]),e}var s;return await this.pluginDriver.hookSeq("generateBundle",[this.outputOptions,t,e]),this.finaliseAssets(t),hi("GENERATE",1),t}async addFinalizedChunksToBundle(e,t,s,i){this.assignChunkIds(e,t,s,i);for(const t of e)(i[t.id]=t.getPrerenderedChunk()).fileName=t.id;await Promise.all(e.map(e=>{const t=i[e.id];return e.render(this.outputOptions,s,t,this.pluginDriver).then(e=>{t.code=e.code,t.map=e.map})}))}async addManualChunks(e){const t=new Map,s=await Promise.all(Object.keys(e).map(async t=>({alias:t,entries:await this.graph.moduleLoader.addAdditionalModules(e[t])})));for(const{alias:e,entries:i}of s)for(const s of i)In(e,s,t);return t}assignChunkIds(e,t,s,i){const n=[],r=[];for(const t of e)(t.facadeModule&&t.facadeModule.isUserDefinedEntryPoint?n:r).push(t);const a=n.concat(r);for(const e of a)this.outputOptions.file?e.id=Te(this.outputOptions.file):this.outputOptions.preserveModules?e.id=e.generateIdPreserveModules(t,this.outputOptions,i,this.unsetOptions):e.id=e.generateId(s,this.outputOptions,i,!0,this.pluginDriver),i[e.id]=Sn}assignManualChunks(e){const t=new Map,s={getModuleIds:()=>this.graph.modulesById.keys(),getModuleInfo:this.graph.getModuleInfo};for(const i of this.graph.modulesById.values())if(i instanceof mi){const n=e(i.id,s);"string"==typeof n&&In(n,i,t)}return t}finaliseAssets(e){for(const t of Object.keys(e)){const s=e[t];s.type||(Ht('A plugin is directly adding properties to the bundle object in the "generateBundle" hook. This is deprecated and will be removed in a future Rollup version, please use "this.emitFile" instead.',!0,this.inputOptions),s.type="asset")}this.pluginDriver.finaliseAssets()}async generateChunks(){const{manualChunks:e}=this.outputOptions,t="object"==typeof e?await this.addManualChunks(e):this.assignManualChunks(e),s=[],i=new Map;for(const{alias:e,modules:n}of this.outputOptions.inlineDynamicImports?[{alias:null,modules:_n(this.graph.modulesById)}]:this.outputOptions.preserveModules?_n(this.graph.modulesById).map(e=>({alias:null,modules:[e]})):yn(this.graph.entryModules,t)){rn(n);const t=new fn(n,this.inputOptions,this.outputOptions,this.unsetOptions,this.graph.modulesById,i,this.facadeChunkByModule,e);s.push(t);for(const e of n)i.set(e,t)}for(const e of s)e.link();const n=[];for(const e of s)n.push(...e.generateFacades());return[...s,...n]}prerenderChunks(e,t){for(const t of e)t.generateExports();for(const s of e)s.preRender(this.outputOptions,t,this.pluginDriver)}}function _n(e){return[...e.values()].filter(e=>e instanceof mi&&(e.isIncluded()||e.isEntryPoint||e.includedDynamicImporters.length>0))}function In(e,t,s){const i=s.get(t);if("string"==typeof i&&i!==e)return Bt((n=t.id,r=e,a=i,{code:Wt.INVALID_CHUNK,message:`Cannot assign ${Dt(n)} to the "${r}" chunk as it is already in the "${a}" chunk.`}));var n,r,a;s.set(t,e)}var $n={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},Mn="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",Tn={5:Mn,"5module":Mn+" export import",6:Mn+" const class extends export import super"},Ln=/^in(stanceof)?$/,Rn="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࢠ-ࢴࢶ-ࣇऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲈᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-鿼ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞿꟂ-ꟊꟵ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",On="‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛࣓-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-ໍ໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠐-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿᫀᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷹᷻-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_",Dn=new RegExp("["+Rn+"]"),Vn=new RegExp("["+Rn+On+"]");Rn=On=null;var Bn=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,157,310,10,21,11,7,153,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,107,20,28,22,13,52,76,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,85,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,230,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,35,56,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,190,0,80,921,103,110,18,195,2749,1070,4050,582,8634,568,8,30,114,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8952,286,50,2,18,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,2357,44,11,6,17,0,370,43,1301,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42717,35,4148,12,221,3,5761,15,7472,3104,541,1507,4938],Fn=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,154,10,176,2,54,14,32,9,16,3,46,10,54,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,161,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,19306,9,135,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,5319,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,262,6,10,9,419,13,1495,6,110,6,6,9,4759,9,787719,239];function Wn(e,t){for(var s=65536,i=0;ie)return!1;if((s+=t[i+1])>=e)return!0}}function Un(e,t){return e<65?36===e:e<91||(e<97?95===e:e<123||(e<=65535?e>=170&&Dn.test(String.fromCharCode(e)):!1!==t&&Wn(e,Bn)))}function zn(e,t){return e<48?36===e:e<58||!(e<65)&&(e<91||(e<97?95===e:e<123||(e<=65535?e>=170&&Vn.test(String.fromCharCode(e)):!1!==t&&(Wn(e,Bn)||Wn(e,Fn)))))}var jn=function(e,t){void 0===t&&(t={}),this.label=e,this.keyword=t.keyword,this.beforeExpr=!!t.beforeExpr,this.startsExpr=!!t.startsExpr,this.isLoop=!!t.isLoop,this.isAssign=!!t.isAssign,this.prefix=!!t.prefix,this.postfix=!!t.postfix,this.binop=t.binop||null,this.updateContext=null};function Gn(e,t){return new jn(e,{beforeExpr:!0,binop:t})}var Hn={beforeExpr:!0},qn={startsExpr:!0},Kn={};function Xn(e,t){return void 0===t&&(t={}),t.keyword=e,Kn[e]=new jn(e,t)}var Yn={num:new jn("num",qn),regexp:new jn("regexp",qn),string:new jn("string",qn),name:new jn("name",qn),eof:new jn("eof"),bracketL:new jn("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new jn("]"),braceL:new jn("{",{beforeExpr:!0,startsExpr:!0}),braceR:new jn("}"),parenL:new jn("(",{beforeExpr:!0,startsExpr:!0}),parenR:new jn(")"),comma:new jn(",",Hn),semi:new jn(";",Hn),colon:new jn(":",Hn),dot:new jn("."),question:new jn("?",Hn),questionDot:new jn("?."),arrow:new jn("=>",Hn),template:new jn("template"),invalidTemplate:new jn("invalidTemplate"),ellipsis:new jn("...",Hn),backQuote:new jn("`",qn),dollarBraceL:new jn("${",{beforeExpr:!0,startsExpr:!0}),eq:new jn("=",{beforeExpr:!0,isAssign:!0}),assign:new jn("_=",{beforeExpr:!0,isAssign:!0}),incDec:new jn("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new jn("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:Gn("||",1),logicalAND:Gn("&&",2),bitwiseOR:Gn("|",3),bitwiseXOR:Gn("^",4),bitwiseAND:Gn("&",5),equality:Gn("==/!=/===/!==",6),relational:Gn("/<=/>=",7),bitShift:Gn("<>/>>>",8),plusMin:new jn("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:Gn("%",10),star:Gn("*",10),slash:Gn("/",10),starstar:new jn("**",{beforeExpr:!0}),coalesce:Gn("??",1),_break:Xn("break"),_case:Xn("case",Hn),_catch:Xn("catch"),_continue:Xn("continue"),_debugger:Xn("debugger"),_default:Xn("default",Hn),_do:Xn("do",{isLoop:!0,beforeExpr:!0}),_else:Xn("else",Hn),_finally:Xn("finally"),_for:Xn("for",{isLoop:!0}),_function:Xn("function",qn),_if:Xn("if"),_return:Xn("return",Hn),_switch:Xn("switch"),_throw:Xn("throw",Hn),_try:Xn("try"),_var:Xn("var"),_const:Xn("const"),_while:Xn("while",{isLoop:!0}),_with:Xn("with"),_new:Xn("new",{beforeExpr:!0,startsExpr:!0}),_this:Xn("this",qn),_super:Xn("super",qn),_class:Xn("class",qn),_extends:Xn("extends",Hn),_export:Xn("export"),_import:Xn("import",qn),_null:Xn("null",qn),_true:Xn("true",qn),_false:Xn("false",qn),_in:Xn("in",{beforeExpr:!0,binop:7}),_instanceof:Xn("instanceof",{beforeExpr:!0,binop:7}),_typeof:Xn("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:Xn("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:Xn("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},Qn=/\r\n?|\n|\u2028|\u2029/,Jn=new RegExp(Qn.source,"g");function Zn(e,t){return 10===e||13===e||!t&&(8232===e||8233===e)}var er=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,tr=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,sr=Object.prototype,ir=sr.hasOwnProperty,nr=sr.toString;function rr(e,t){return ir.call(e,t)}var ar=Array.isArray||function(e){return"[object Array]"===nr.call(e)};function or(e){return new RegExp("^(?:"+e.replace(/ /g,"|")+")$")}var hr=function(e,t){this.line=e,this.column=t};hr.prototype.offset=function(e){return new hr(this.line,this.column+e)};var lr=function(e,t,s){this.start=t,this.end=s,null!==e.sourceFile&&(this.source=e.sourceFile)};function cr(e,t){for(var s=1,i=0;;){Jn.lastIndex=i;var n=Jn.exec(e);if(!(n&&n.index=2015&&(t.ecmaVersion-=2009),null==t.allowReserved&&(t.allowReserved=t.ecmaVersion<5),ar(t.onToken)){var i=t.onToken;t.onToken=function(e){return i.push(e)}}return ar(t.onComment)&&(t.onComment=function(e,t){return function(s,i,n,r,a,o){var h={type:s?"Block":"Line",value:i,start:n,end:r};e.locations&&(h.loc=new lr(this,a,o)),e.ranges&&(h.range=[n,r]),t.push(h)}}(t,t.onComment)),t}function pr(e,t){return 2|(e?4:0)|(t?8:0)}var fr=function(e,t,s){this.options=e=dr(e),this.sourceFile=e.sourceFile,this.keywords=or(Tn[e.ecmaVersion>=6?6:"module"===e.sourceType?"5module":5]);var i="";if(!0!==e.allowReserved){for(var n=e.ecmaVersion;!(i=$n[n]);n--);"module"===e.sourceType&&(i+=" await")}this.reservedWords=or(i);var r=(i?i+" ":"")+$n.strict;this.reservedWordsStrict=or(r),this.reservedWordsStrictBind=or(r+" "+$n.strictBind),this.input=String(t),this.containsEsc=!1,s?(this.pos=s,this.lineStart=this.input.lastIndexOf("\n",s-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(Qn).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=Yn.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule="module"===e.sourceType,this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports={},0===this.pos&&e.allowHashBang&&"#!"===this.input.slice(0,2)&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(1),this.regexpState=null},mr={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0}};fr.prototype.parse=function(){var e=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(e)},mr.inFunction.get=function(){return(2&this.currentVarScope().flags)>0},mr.inGenerator.get=function(){return(8&this.currentVarScope().flags)>0},mr.inAsync.get=function(){return(4&this.currentVarScope().flags)>0},mr.allowSuper.get=function(){return(64&this.currentThisScope().flags)>0},mr.allowDirectSuper.get=function(){return(128&this.currentThisScope().flags)>0},mr.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},fr.prototype.inNonArrowFunction=function(){return(2&this.currentThisScope().flags)>0},fr.extend=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];for(var s=this,i=0;i=,?^&]/.test(n)||"!"===n&&"="===this.input.charAt(i+1))}e+=t[0].length,tr.lastIndex=e,e+=tr.exec(this.input)[0].length,";"===this.input[e]&&e++}},gr.eat=function(e){return this.type===e&&(this.next(),!0)},gr.isContextual=function(e){return this.type===Yn.name&&this.value===e&&!this.containsEsc},gr.eatContextual=function(e){return!!this.isContextual(e)&&(this.next(),!0)},gr.expectContextual=function(e){this.eatContextual(e)||this.unexpected()},gr.canInsertSemicolon=function(){return this.type===Yn.eof||this.type===Yn.braceR||Qn.test(this.input.slice(this.lastTokEnd,this.start))},gr.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},gr.semicolon=function(){this.eat(Yn.semi)||this.insertSemicolon()||this.unexpected()},gr.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0},gr.expect=function(e){this.eat(e)||this.unexpected()},gr.unexpected=function(e){this.raise(null!=e?e:this.start,"Unexpected token")},gr.checkPatternErrors=function(e,t){if(e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element");var s=t?e.parenthesizedAssign:e.parenthesizedBind;s>-1&&this.raiseRecoverable(s,"Parenthesized pattern")}},gr.checkExpressionErrors=function(e,t){if(!e)return!1;var s=e.shorthandAssign,i=e.doubleProto;if(!t)return s>=0||i>=0;s>=0&&this.raise(s,"Shorthand property assignments are valid only in destructuring patterns"),i>=0&&this.raiseRecoverable(i,"Redefinition of __proto__ property")},gr.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos=6&&this.unexpected(),this.parseFunctionStatement(r,!1,!e);case Yn._class:return e&&this.unexpected(),this.parseClass(r,!0);case Yn._if:return this.parseIfStatement(r);case Yn._return:return this.parseReturnStatement(r);case Yn._switch:return this.parseSwitchStatement(r);case Yn._throw:return this.parseThrowStatement(r);case Yn._try:return this.parseTryStatement(r);case Yn._const:case Yn._var:return i=i||this.value,e&&"var"!==i&&this.unexpected(),this.parseVarStatement(r,i);case Yn._while:return this.parseWhileStatement(r);case Yn._with:return this.parseWithStatement(r);case Yn.braceL:return this.parseBlock(!0,r);case Yn.semi:return this.parseEmptyStatement(r);case Yn._export:case Yn._import:if(this.options.ecmaVersion>10&&n===Yn._import){tr.lastIndex=this.pos;var a=tr.exec(this.input),o=this.pos+a[0].length,h=this.input.charCodeAt(o);if(40===h||46===h)return this.parseExpressionStatement(r,this.parseExpression())}return this.options.allowImportExportEverywhere||(t||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),n===Yn._import?this.parseImport(r):this.parseExport(r,s);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(r,!0,!e);var l=this.value,c=this.parseExpression();return n===Yn.name&&"Identifier"===c.type&&this.eat(Yn.colon)?this.parseLabeledStatement(r,l,c,e):this.parseExpressionStatement(r,c)}},Er.parseBreakContinueStatement=function(e,t){var s="break"===t;this.next(),this.eat(Yn.semi)||this.insertSemicolon()?e.label=null:this.type!==Yn.name?this.unexpected():(e.label=this.parseIdent(),this.semicolon());for(var i=0;i=6?this.eat(Yn.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")},Er.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&(this.inAsync||!this.inFunction&&this.options.allowAwaitOutsideFunction)&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(vr),this.enterScope(0),this.expect(Yn.parenL),this.type===Yn.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var s=this.isLet();if(this.type===Yn._var||this.type===Yn._const||s){var i=this.startNode(),n=s?"let":this.value;return this.next(),this.parseVar(i,!0,n),this.finishNode(i,"VariableDeclaration"),(this.type===Yn._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&1===i.declarations.length?(this.options.ecmaVersion>=9&&(this.type===Yn._in?t>-1&&this.unexpected(t):e.await=t>-1),this.parseForIn(e,i)):(t>-1&&this.unexpected(t),this.parseFor(e,i))}var r=new xr,a=this.parseExpression(!0,r);return this.type===Yn._in||this.options.ecmaVersion>=6&&this.isContextual("of")?(this.options.ecmaVersion>=9&&(this.type===Yn._in?t>-1&&this.unexpected(t):e.await=t>-1),this.toAssignable(a,!1,r),this.checkLVal(a),this.parseForIn(e,a)):(this.checkExpressionErrors(r,!0),t>-1&&this.unexpected(t),this.parseFor(e,a))},Er.parseFunctionStatement=function(e,t,s){return this.next(),this.parseFunction(e,Ar|(s?0:Pr),!1,t)},Er.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement("if"),e.alternate=this.eat(Yn._else)?this.parseStatement("if"):null,this.finishNode(e,"IfStatement")},Er.parseReturnStatement=function(e){return this.inFunction||this.options.allowReturnOutsideFunction||this.raise(this.start,"'return' outside of function"),this.next(),this.eat(Yn.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")},Er.parseSwitchStatement=function(e){var t;this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(Yn.braceL),this.labels.push(br),this.enterScope(0);for(var s=!1;this.type!==Yn.braceR;)if(this.type===Yn._case||this.type===Yn._default){var i=this.type===Yn._case;t&&this.finishNode(t,"SwitchCase"),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),i?t.test=this.parseExpression():(s&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),s=!0,t.test=null),this.expect(Yn.colon)}else t||this.unexpected(),t.consequent.push(this.parseStatement(null));return this.exitScope(),t&&this.finishNode(t,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(e,"SwitchStatement")},Er.parseThrowStatement=function(e){return this.next(),Qn.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")};var Sr=[];Er.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===Yn._catch){var t=this.startNode();if(this.next(),this.eat(Yn.parenL)){t.param=this.parseBindingAtom();var s="Identifier"===t.param.type;this.enterScope(s?32:0),this.checkLVal(t.param,s?4:2),this.expect(Yn.parenR)}else this.options.ecmaVersion<10&&this.unexpected(),t.param=null,this.enterScope(0);t.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(t,"CatchClause")}return e.finalizer=this.eat(Yn._finally)?this.parseBlock():null,e.handler||e.finalizer||this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")},Er.parseVarStatement=function(e,t){return this.next(),this.parseVar(e,!1,t),this.semicolon(),this.finishNode(e,"VariableDeclaration")},Er.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(vr),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")},Er.parseWithStatement=function(e){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement("with"),this.finishNode(e,"WithStatement")},Er.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")},Er.parseLabeledStatement=function(e,t,s,i){for(var n=0,r=this.labels;n=0;o--){var h=this.labels[o];if(h.statementStart!==e.start)break;h.statementStart=this.start,h.kind=a}return this.labels.push({name:t,kind:a,statementStart:this.start}),e.body=this.parseStatement(i?-1===i.indexOf("label")?i+"label":i:"label"),this.labels.pop(),e.label=s,this.finishNode(e,"LabeledStatement")},Er.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")},Er.parseBlock=function(e,t,s){for(void 0===e&&(e=!0),void 0===t&&(t=this.startNode()),t.body=[],this.expect(Yn.braceL),e&&this.enterScope(0);this.type!==Yn.braceR;){var i=this.parseStatement(null);t.body.push(i)}return s&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(t,"BlockStatement")},Er.parseFor=function(e,t){return e.init=t,this.expect(Yn.semi),e.test=this.type===Yn.semi?null:this.parseExpression(),this.expect(Yn.semi),e.update=this.type===Yn.parenR?null:this.parseExpression(),this.expect(Yn.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,"ForStatement")},Er.parseForIn=function(e,t){var s=this.type===Yn._in;return this.next(),"VariableDeclaration"===t.type&&null!=t.declarations[0].init&&(!s||this.options.ecmaVersion<8||this.strict||"var"!==t.kind||"Identifier"!==t.declarations[0].id.type)?this.raise(t.start,(s?"for-in":"for-of")+" loop variable declaration may not have an initializer"):"AssignmentPattern"===t.type&&this.raise(t.start,"Invalid left-hand side in for-loop"),e.left=t,e.right=s?this.parseExpression():this.parseMaybeAssign(),this.expect(Yn.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,s?"ForInStatement":"ForOfStatement")},Er.parseVar=function(e,t,s){for(e.declarations=[],e.kind=s;;){var i=this.startNode();if(this.parseVarId(i,s),this.eat(Yn.eq)?i.init=this.parseMaybeAssign(t):"const"!==s||this.type===Yn._in||this.options.ecmaVersion>=6&&this.isContextual("of")?"Identifier"===i.id.type||t&&(this.type===Yn._in||this.isContextual("of"))?i.init=null:this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):this.unexpected(),e.declarations.push(this.finishNode(i,"VariableDeclarator")),!this.eat(Yn.comma))break}return e},Er.parseVarId=function(e,t){e.id=this.parseBindingAtom(),this.checkLVal(e.id,"var"===t?1:2,!1)};var Ar=1,Pr=2;Er.parseFunction=function(e,t,s,i){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!i)&&(this.type===Yn.star&&t&Pr&&this.unexpected(),e.generator=this.eat(Yn.star)),this.options.ecmaVersion>=8&&(e.async=!!i),t&Ar&&(e.id=4&t&&this.type!==Yn.name?null:this.parseIdent(),!e.id||t&Pr||this.checkLVal(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?1:2:3));var n=this.yieldPos,r=this.awaitPos,a=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(pr(e.async,e.generator)),t&Ar||(e.id=this.type===Yn.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,s,!1),this.yieldPos=n,this.awaitPos=r,this.awaitIdentPos=a,this.finishNode(e,t&Ar?"FunctionDeclaration":"FunctionExpression")},Er.parseFunctionParams=function(e){this.expect(Yn.parenL),e.params=this.parseBindingList(Yn.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},Er.parseClass=function(e,t){this.next();var s=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var i=this.startNode(),n=!1;for(i.body=[],this.expect(Yn.braceL);this.type!==Yn.braceR;){var r=this.parseClassElement(null!==e.superClass);r&&(i.body.push(r),"MethodDefinition"===r.type&&"constructor"===r.kind&&(n&&this.raise(r.start,"Duplicate constructor in the same class"),n=!0))}return this.strict=s,this.next(),e.body=this.finishNode(i,"ClassBody"),this.finishNode(e,t?"ClassDeclaration":"ClassExpression")},Er.parseClassElement=function(e){var t=this;if(this.eat(Yn.semi))return null;var s=this.startNode(),i=function(e,i){void 0===i&&(i=!1);var n=t.start,r=t.startLoc;return!(!t.eatContextual(e)||(t.type===Yn.parenL||i&&t.canInsertSemicolon())&&(s.key&&t.unexpected(),s.computed=!1,s.key=t.startNodeAt(n,r),s.key.name=e,t.finishNode(s.key,"Identifier"),1))};s.kind="method",s.static=i("static");var n=this.eat(Yn.star),r=!1;n||(this.options.ecmaVersion>=8&&i("async",!0)?(r=!0,n=this.options.ecmaVersion>=9&&this.eat(Yn.star)):i("get")?s.kind="get":i("set")&&(s.kind="set")),s.key||this.parsePropertyName(s);var a=s.key,o=!1;return s.computed||s.static||!("Identifier"===a.type&&"constructor"===a.name||"Literal"===a.type&&"constructor"===a.value)?s.static&&"Identifier"===a.type&&"prototype"===a.name&&this.raise(a.start,"Classes may not have a static property named prototype"):("method"!==s.kind&&this.raise(a.start,"Constructor can't have get/set modifier"),n&&this.raise(a.start,"Constructor can't be a generator"),r&&this.raise(a.start,"Constructor can't be an async method"),s.kind="constructor",o=e),this.parseClassMethod(s,n,r,o),"get"===s.kind&&0!==s.value.params.length&&this.raiseRecoverable(s.value.start,"getter should have no params"),"set"===s.kind&&1!==s.value.params.length&&this.raiseRecoverable(s.value.start,"setter should have exactly one param"),"set"===s.kind&&"RestElement"===s.value.params[0].type&&this.raiseRecoverable(s.value.params[0].start,"Setter cannot use rest params"),s},Er.parseClassMethod=function(e,t,s,i){return e.value=this.parseMethod(t,s,i),this.finishNode(e,"MethodDefinition")},Er.parseClassId=function(e,t){this.type===Yn.name?(e.id=this.parseIdent(),t&&this.checkLVal(e.id,2,!1)):(!0===t&&this.unexpected(),e.id=null)},Er.parseClassSuper=function(e){e.superClass=this.eat(Yn._extends)?this.parseExprSubscripts():null},Er.parseExport=function(e,t){if(this.next(),this.eat(Yn.star))return this.options.ecmaVersion>=11&&(this.eatContextual("as")?(e.exported=this.parseIdent(!0),this.checkExport(t,e.exported.name,this.lastTokStart)):e.exported=null),this.expectContextual("from"),this.type!==Yn.string&&this.unexpected(),e.source=this.parseExprAtom(),this.semicolon(),this.finishNode(e,"ExportAllDeclaration");if(this.eat(Yn._default)){var s;if(this.checkExport(t,"default",this.lastTokStart),this.type===Yn._function||(s=this.isAsyncFunction())){var i=this.startNode();this.next(),s&&this.next(),e.declaration=this.parseFunction(i,4|Ar,!1,s)}else if(this.type===Yn._class){var n=this.startNode();e.declaration=this.parseClass(n,"nullableID")}else e.declaration=this.parseMaybeAssign(),this.semicolon();return this.finishNode(e,"ExportDefaultDeclaration")}if(this.shouldParseExportStatement())e.declaration=this.parseStatement(null),"VariableDeclaration"===e.declaration.type?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id.name,e.declaration.id.start),e.specifiers=[],e.source=null;else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual("from"))this.type!==Yn.string&&this.unexpected(),e.source=this.parseExprAtom();else{for(var r=0,a=e.specifiers;r=6&&e)switch(e.type){case"Identifier":this.inAsync&&"await"===e.name&&this.raise(e.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"RestElement":break;case"ObjectExpression":e.type="ObjectPattern",s&&this.checkPatternErrors(s,!0);for(var i=0,n=e.properties;i=8&&!r&&"async"===a.name&&!this.canInsertSemicolon()&&this.eat(Yn._function))return this.parseFunction(this.startNodeAt(i,n),0,!1,!0);if(s&&!this.canInsertSemicolon()){if(this.eat(Yn.arrow))return this.parseArrowExpression(this.startNodeAt(i,n),[a],!1);if(this.options.ecmaVersion>=8&&"async"===a.name&&this.type===Yn.name&&!r)return a=this.parseIdent(!1),!this.canInsertSemicolon()&&this.eat(Yn.arrow)||this.unexpected(),this.parseArrowExpression(this.startNodeAt(i,n),[a],!0)}return a;case Yn.regexp:var o=this.value;return(t=this.parseLiteral(o.value)).regex={pattern:o.pattern,flags:o.flags},t;case Yn.num:case Yn.string:return this.parseLiteral(this.value);case Yn._null:case Yn._true:case Yn._false:return(t=this.startNode()).value=this.type===Yn._null?null:this.type===Yn._true,t.raw=this.type.keyword,this.next(),this.finishNode(t,"Literal");case Yn.parenL:var h=this.start,l=this.parseParenAndDistinguishExpression(s);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(l)&&(e.parenthesizedAssign=h),e.parenthesizedBind<0&&(e.parenthesizedBind=h)),l;case Yn.bracketL:return t=this.startNode(),this.next(),t.elements=this.parseExprList(Yn.bracketR,!0,!0,e),this.finishNode(t,"ArrayExpression");case Yn.braceL:return this.parseObj(!1,e);case Yn._function:return t=this.startNode(),this.next(),this.parseFunction(t,0);case Yn._class:return this.parseClass(this.startNode(),!1);case Yn._new:return this.parseNew();case Yn.backQuote:return this.parseTemplate();case Yn._import:return this.options.ecmaVersion>=11?this.parseExprImport():this.unexpected();default:this.unexpected()}},kr.parseExprImport=function(){var e=this.startNode();this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import");var t=this.parseIdent(!0);switch(this.type){case Yn.parenL:return this.parseDynamicImport(e);case Yn.dot:return e.meta=t,this.parseImportMeta(e);default:this.unexpected()}},kr.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),!this.eat(Yn.parenR)){var t=this.start;this.eat(Yn.comma)&&this.eat(Yn.parenR)?this.raiseRecoverable(t,"Trailing comma is not allowed in import()"):this.unexpected(t)}return this.finishNode(e,"ImportExpression")},kr.parseImportMeta=function(e){this.next();var t=this.containsEsc;return e.property=this.parseIdent(!0),"meta"!==e.property.name&&this.raiseRecoverable(e.property.start,"The only valid meta property for import is 'import.meta'"),t&&this.raiseRecoverable(e.start,"'import.meta' must not contain escaped characters"),"module"!==this.options.sourceType&&this.raiseRecoverable(e.start,"Cannot use 'import.meta' outside a module"),this.finishNode(e,"MetaProperty")},kr.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),110===t.raw.charCodeAt(t.raw.length-1)&&(t.bigint=t.raw.slice(0,-1)),this.next(),this.finishNode(t,"Literal")},kr.parseParenExpression=function(){this.expect(Yn.parenL);var e=this.parseExpression();return this.expect(Yn.parenR),e},kr.parseParenAndDistinguishExpression=function(e){var t,s=this.start,i=this.startLoc,n=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var r,a=this.start,o=this.startLoc,h=[],l=!0,c=!1,u=new xr,d=this.yieldPos,p=this.awaitPos;for(this.yieldPos=0,this.awaitPos=0;this.type!==Yn.parenR;){if(l?l=!1:this.expect(Yn.comma),n&&this.afterTrailingComma(Yn.parenR,!0)){c=!0;break}if(this.type===Yn.ellipsis){r=this.start,h.push(this.parseParenItem(this.parseRestBinding())),this.type===Yn.comma&&this.raise(this.start,"Comma is not permitted after the rest element");break}h.push(this.parseMaybeAssign(!1,u,this.parseParenItem))}var f=this.start,m=this.startLoc;if(this.expect(Yn.parenR),e&&!this.canInsertSemicolon()&&this.eat(Yn.arrow))return this.checkPatternErrors(u,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=d,this.awaitPos=p,this.parseParenArrowList(s,i,h);h.length&&!c||this.unexpected(this.lastTokStart),r&&this.unexpected(r),this.checkExpressionErrors(u,!0),this.yieldPos=d||this.yieldPos,this.awaitPos=p||this.awaitPos,h.length>1?((t=this.startNodeAt(a,o)).expressions=h,this.finishNodeAt(t,"SequenceExpression",f,m)):t=h[0]}else t=this.parseParenExpression();if(this.options.preserveParens){var g=this.startNodeAt(s,i);return g.expression=t,this.finishNode(g,"ParenthesizedExpression")}return t},kr.parseParenItem=function(e){return e},kr.parseParenArrowList=function(e,t,s){return this.parseArrowExpression(this.startNodeAt(e,t),s)};var wr=[];kr.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var e=this.startNode(),t=this.parseIdent(!0);if(this.options.ecmaVersion>=6&&this.eat(Yn.dot)){e.meta=t;var s=this.containsEsc;return e.property=this.parseIdent(!0),"target"!==e.property.name&&this.raiseRecoverable(e.property.start,"The only valid meta property for new is 'new.target'"),s&&this.raiseRecoverable(e.start,"'new.target' must not contain escaped characters"),this.inNonArrowFunction()||this.raiseRecoverable(e.start,"'new.target' can only be used in functions"),this.finishNode(e,"MetaProperty")}var i=this.start,n=this.startLoc,r=this.type===Yn._import;return e.callee=this.parseSubscripts(this.parseExprAtom(),i,n,!0),r&&"ImportExpression"===e.callee.type&&this.raise(i,"Cannot use new with import()"),this.eat(Yn.parenL)?e.arguments=this.parseExprList(Yn.parenR,this.options.ecmaVersion>=8,!1):e.arguments=wr,this.finishNode(e,"NewExpression")},kr.parseTemplateElement=function(e){var t=e.isTagged,s=this.startNode();return this.type===Yn.invalidTemplate?(t||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),s.value={raw:this.value,cooked:null}):s.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,"\n"),cooked:this.value},this.next(),s.tail=this.type===Yn.backQuote,this.finishNode(s,"TemplateElement")},kr.parseTemplate=function(e){void 0===e&&(e={});var t=e.isTagged;void 0===t&&(t=!1);var s=this.startNode();this.next(),s.expressions=[];var i=this.parseTemplateElement({isTagged:t});for(s.quasis=[i];!i.tail;)this.type===Yn.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(Yn.dollarBraceL),s.expressions.push(this.parseExpression()),this.expect(Yn.braceR),s.quasis.push(i=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(s,"TemplateLiteral")},kr.isAsyncProp=function(e){return!e.computed&&"Identifier"===e.key.type&&"async"===e.key.name&&(this.type===Yn.name||this.type===Yn.num||this.type===Yn.string||this.type===Yn.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===Yn.star)&&!Qn.test(this.input.slice(this.lastTokEnd,this.start))},kr.parseObj=function(e,t){var s=this.startNode(),i=!0,n={};for(s.properties=[],this.next();!this.eat(Yn.braceR);){if(i)i=!1;else if(this.expect(Yn.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(Yn.braceR))break;var r=this.parseProperty(e,t);e||this.checkPropClash(r,n,t),s.properties.push(r)}return this.finishNode(s,e?"ObjectPattern":"ObjectExpression")},kr.parseProperty=function(e,t){var s,i,n,r,a=this.startNode();if(this.options.ecmaVersion>=9&&this.eat(Yn.ellipsis))return e?(a.argument=this.parseIdent(!1),this.type===Yn.comma&&this.raise(this.start,"Comma is not permitted after the rest element"),this.finishNode(a,"RestElement")):(this.type===Yn.parenL&&t&&(t.parenthesizedAssign<0&&(t.parenthesizedAssign=this.start),t.parenthesizedBind<0&&(t.parenthesizedBind=this.start)),a.argument=this.parseMaybeAssign(!1,t),this.type===Yn.comma&&t&&t.trailingComma<0&&(t.trailingComma=this.start),this.finishNode(a,"SpreadElement"));this.options.ecmaVersion>=6&&(a.method=!1,a.shorthand=!1,(e||t)&&(n=this.start,r=this.startLoc),e||(s=this.eat(Yn.star)));var o=this.containsEsc;return this.parsePropertyName(a),!e&&!o&&this.options.ecmaVersion>=8&&!s&&this.isAsyncProp(a)?(i=!0,s=this.options.ecmaVersion>=9&&this.eat(Yn.star),this.parsePropertyName(a,t)):i=!1,this.parsePropertyValue(a,e,s,i,n,r,t,o),this.finishNode(a,"Property")},kr.parsePropertyValue=function(e,t,s,i,n,r,a,o){if((s||i)&&this.type===Yn.colon&&this.unexpected(),this.eat(Yn.colon))e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,a),e.kind="init";else if(this.options.ecmaVersion>=6&&this.type===Yn.parenL)t&&this.unexpected(),e.kind="init",e.method=!0,e.value=this.parseMethod(s,i);else if(t||o||!(this.options.ecmaVersion>=5)||e.computed||"Identifier"!==e.key.type||"get"!==e.key.name&&"set"!==e.key.name||this.type===Yn.comma||this.type===Yn.braceR||this.type===Yn.eq)this.options.ecmaVersion>=6&&!e.computed&&"Identifier"===e.key.type?((s||i)&&this.unexpected(),this.checkUnreserved(e.key),"await"!==e.key.name||this.awaitIdentPos||(this.awaitIdentPos=n),e.kind="init",t?e.value=this.parseMaybeDefault(n,r,e.key):this.type===Yn.eq&&a?(a.shorthandAssign<0&&(a.shorthandAssign=this.start),e.value=this.parseMaybeDefault(n,r,e.key)):e.value=e.key,e.shorthand=!0):this.unexpected();else{(s||i)&&this.unexpected(),e.kind=e.key.name,this.parsePropertyName(e),e.value=this.parseMethod(!1);var h="get"===e.kind?0:1;if(e.value.params.length!==h){var l=e.value.start;"get"===e.kind?this.raiseRecoverable(l,"getter should have no params"):this.raiseRecoverable(l,"setter should have exactly one param")}else"set"===e.kind&&"RestElement"===e.value.params[0].type&&this.raiseRecoverable(e.value.params[0].start,"Setter cannot use rest params")}},kr.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(Yn.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(Yn.bracketR),e.key;e.computed=!1}return e.key=this.type===Yn.num||this.type===Yn.string?this.parseExprAtom():this.parseIdent("never"!==this.options.allowReserved)},kr.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)},kr.parseMethod=function(e,t,s){var i=this.startNode(),n=this.yieldPos,r=this.awaitPos,a=this.awaitIdentPos;return this.initFunction(i),this.options.ecmaVersion>=6&&(i.generator=e),this.options.ecmaVersion>=8&&(i.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(64|pr(t,i.generator)|(s?128:0)),this.expect(Yn.parenL),i.params=this.parseBindingList(Yn.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(i,!1,!0),this.yieldPos=n,this.awaitPos=r,this.awaitIdentPos=a,this.finishNode(i,"FunctionExpression")},kr.parseArrowExpression=function(e,t,s){var i=this.yieldPos,n=this.awaitPos,r=this.awaitIdentPos;return this.enterScope(16|pr(s,!1)),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!s),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0,!1),this.yieldPos=i,this.awaitPos=n,this.awaitIdentPos=r,this.finishNode(e,"ArrowFunctionExpression")},kr.parseFunctionBody=function(e,t,s){var i=t&&this.type!==Yn.braceL,n=this.strict,r=!1;if(i)e.body=this.parseMaybeAssign(),e.expression=!0,this.checkParams(e,!1);else{var a=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);n&&!a||(r=this.strictDirective(this.end))&&a&&this.raiseRecoverable(e.start,"Illegal 'use strict' directive in function with non-simple parameter list");var o=this.labels;this.labels=[],r&&(this.strict=!0),this.checkParams(e,!n&&!r&&!t&&!s&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLVal(e.id,5),e.body=this.parseBlock(!1,void 0,r&&!n),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=o}this.exitScope()},kr.isSimpleParamList=function(e){for(var t=0,s=e;t-1||n.functions.indexOf(e)>-1||n.var.indexOf(e)>-1,n.lexical.push(e),this.inModule&&1&n.flags&&delete this.undefinedExports[e]}else if(4===t)this.currentScope().lexical.push(e);else if(3===t){var r=this.currentScope();i=this.treatFunctionsAsVar?r.lexical.indexOf(e)>-1:r.lexical.indexOf(e)>-1||r.var.indexOf(e)>-1,r.functions.push(e)}else for(var a=this.scopeStack.length-1;a>=0;--a){var o=this.scopeStack[a];if(o.lexical.indexOf(e)>-1&&!(32&o.flags&&o.lexical[0]===e)||!this.treatFunctionsAsVarInScope(o)&&o.functions.indexOf(e)>-1){i=!0;break}if(o.var.push(e),this.inModule&&1&o.flags&&delete this.undefinedExports[e],3&o.flags)break}i&&this.raiseRecoverable(s,"Identifier '"+e+"' has already been declared")},_r.checkLocalExport=function(e){-1===this.scopeStack[0].lexical.indexOf(e.name)&&-1===this.scopeStack[0].var.indexOf(e.name)&&(this.undefinedExports[e.name]=e)},_r.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},_r.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(3&t.flags)return t}},_r.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(3&t.flags&&!(16&t.flags))return t}};var $r=function(e,t,s){this.type="",this.start=t,this.end=0,e.options.locations&&(this.loc=new lr(e,s)),e.options.directSourceFile&&(this.sourceFile=e.options.directSourceFile),e.options.ranges&&(this.range=[t,0])},Mr=fr.prototype;function Tr(e,t,s,i){return e.type=t,e.end=s,this.options.locations&&(e.loc.end=i),this.options.ranges&&(e.range[1]=s),e}Mr.startNode=function(){return new $r(this,this.start,this.startLoc)},Mr.startNodeAt=function(e,t){return new $r(this,e,t)},Mr.finishNode=function(e,t){return Tr.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)},Mr.finishNodeAt=function(e,t,s,i){return Tr.call(this,e,t,s,i)};var Lr=function(e,t,s,i,n){this.token=e,this.isExpr=!!t,this.preserveSpace=!!s,this.override=i,this.generator=!!n},Rr={b_stat:new Lr("{",!1),b_expr:new Lr("{",!0),b_tmpl:new Lr("${",!1),p_stat:new Lr("(",!1),p_expr:new Lr("(",!0),q_tmpl:new Lr("`",!0,!0,(function(e){return e.tryReadTemplateToken()})),f_stat:new Lr("function",!1),f_expr:new Lr("function",!0),f_expr_gen:new Lr("function",!0,!1,null,!0),f_gen:new Lr("function",!1,!1,null,!0)},Or=fr.prototype;Or.initialContext=function(){return[Rr.b_stat]},Or.braceIsBlock=function(e){var t=this.curContext();return t===Rr.f_expr||t===Rr.f_stat||(e!==Yn.colon||t!==Rr.b_stat&&t!==Rr.b_expr?e===Yn._return||e===Yn.name&&this.exprAllowed?Qn.test(this.input.slice(this.lastTokEnd,this.start)):e===Yn._else||e===Yn.semi||e===Yn.eof||e===Yn.parenR||e===Yn.arrow||(e===Yn.braceL?t===Rr.b_stat:e!==Yn._var&&e!==Yn._const&&e!==Yn.name&&!this.exprAllowed):!t.isExpr)},Or.inGeneratorContext=function(){for(var e=this.context.length-1;e>=1;e--){var t=this.context[e];if("function"===t.token)return t.generator}return!1},Or.updateContext=function(e){var t,s=this.type;s.keyword&&e===Yn.dot?this.exprAllowed=!1:(t=s.updateContext)?t.call(this,e):this.exprAllowed=s.beforeExpr},Yn.parenR.updateContext=Yn.braceR.updateContext=function(){if(1!==this.context.length){var e=this.context.pop();e===Rr.b_stat&&"function"===this.curContext().token&&(e=this.context.pop()),this.exprAllowed=!e.isExpr}else this.exprAllowed=!0},Yn.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?Rr.b_stat:Rr.b_expr),this.exprAllowed=!0},Yn.dollarBraceL.updateContext=function(){this.context.push(Rr.b_tmpl),this.exprAllowed=!0},Yn.parenL.updateContext=function(e){var t=e===Yn._if||e===Yn._for||e===Yn._with||e===Yn._while;this.context.push(t?Rr.p_stat:Rr.p_expr),this.exprAllowed=!0},Yn.incDec.updateContext=function(){},Yn._function.updateContext=Yn._class.updateContext=function(e){!e.beforeExpr||e===Yn.semi||e===Yn._else||e===Yn._return&&Qn.test(this.input.slice(this.lastTokEnd,this.start))||(e===Yn.colon||e===Yn.braceL)&&this.curContext()===Rr.b_stat?this.context.push(Rr.f_stat):this.context.push(Rr.f_expr),this.exprAllowed=!1},Yn.backQuote.updateContext=function(){this.curContext()===Rr.q_tmpl?this.context.pop():this.context.push(Rr.q_tmpl),this.exprAllowed=!1},Yn.star.updateContext=function(e){if(e===Yn._function){var t=this.context.length-1;this.context[t]===Rr.f_expr?this.context[t]=Rr.f_expr_gen:this.context[t]=Rr.f_gen}this.exprAllowed=!0},Yn.name.updateContext=function(e){var t=!1;this.options.ecmaVersion>=6&&e!==Yn.dot&&("of"===this.value&&!this.exprAllowed||"yield"===this.value&&this.inGeneratorContext())&&(t=!0),this.exprAllowed=t};var Dr="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",Vr=Dr+" Extended_Pictographic",Br={9:Dr,10:Vr,11:"ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS Extended_Pictographic"},Fr="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",Wr="Adlam Adlm Ahom Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",Ur=Wr+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",zr={9:Wr,10:Ur,11:"Adlam Adlm Ahom Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho"},jr={};function Gr(e){var t=jr[e]={binary:or(Br[e]+" "+Fr),nonBinary:{General_Category:or(Fr),Script:or(zr[e])}};t.nonBinary.Script_Extensions=t.nonBinary.Script,t.nonBinary.gc=t.nonBinary.General_Category,t.nonBinary.sc=t.nonBinary.Script,t.nonBinary.scx=t.nonBinary.Script_Extensions}Gr(9),Gr(10),Gr(11);var Hr=fr.prototype,qr=function(e){this.parser=e,this.validFlags="gim"+(e.options.ecmaVersion>=6?"uy":"")+(e.options.ecmaVersion>=9?"s":""),this.unicodeProperties=jr[e.options.ecmaVersion>=11?11:e.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=[],this.backReferenceNames=[]};function Kr(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}function Xr(e){return 36===e||e>=40&&e<=43||46===e||63===e||e>=91&&e<=94||e>=123&&e<=125}function Yr(e){return e>=65&&e<=90||e>=97&&e<=122}function Qr(e){return Yr(e)||95===e}function Jr(e){return Qr(e)||Zr(e)}function Zr(e){return e>=48&&e<=57}function ea(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function ta(e){return e>=65&&e<=70?e-65+10:e>=97&&e<=102?e-97+10:e-48}function sa(e){return e>=48&&e<=55}qr.prototype.reset=function(e,t,s){var i=-1!==s.indexOf("u");this.start=0|e,this.source=t+"",this.flags=s,this.switchU=i&&this.parser.options.ecmaVersion>=6,this.switchN=i&&this.parser.options.ecmaVersion>=9},qr.prototype.raise=function(e){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+e)},qr.prototype.at=function(e,t){void 0===t&&(t=!1);var s=this.source,i=s.length;if(e>=i)return-1;var n=s.charCodeAt(e);if(!t&&!this.switchU||n<=55295||n>=57344||e+1>=i)return n;var r=s.charCodeAt(e+1);return r>=56320&&r<=57343?(n<<10)+r-56613888:n},qr.prototype.nextIndex=function(e,t){void 0===t&&(t=!1);var s=this.source,i=s.length;if(e>=i)return i;var n,r=s.charCodeAt(e);return!t&&!this.switchU||r<=55295||r>=57344||e+1>=i||(n=s.charCodeAt(e+1))<56320||n>57343?e+1:e+2},qr.prototype.current=function(e){return void 0===e&&(e=!1),this.at(this.pos,e)},qr.prototype.lookahead=function(e){return void 0===e&&(e=!1),this.at(this.nextIndex(this.pos,e),e)},qr.prototype.advance=function(e){void 0===e&&(e=!1),this.pos=this.nextIndex(this.pos,e)},qr.prototype.eat=function(e,t){return void 0===t&&(t=!1),this.current(t)===e&&(this.advance(t),!0)},Hr.validateRegExpFlags=function(e){for(var t=e.validFlags,s=e.flags,i=0;i-1&&this.raise(e.start,"Duplicate regular expression flag")}},Hr.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&e.groupNames.length>0&&(e.switchN=!0,this.regexp_pattern(e))},Hr.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue="",e.lastAssertionIsQuantifiable=!1,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames.length=0,e.backReferenceNames.length=0,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise("Unmatched ')'"),(e.eat(93)||e.eat(125))&&e.raise("Lone quantifier brackets")),e.maxBackReference>e.numCapturingParens&&e.raise("Invalid escape");for(var t=0,s=e.backReferenceNames;t=9&&(s=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise("Unterminated group"),e.lastAssertionIsQuantifiable=!s,!0}return e.pos=t,!1},Hr.regexp_eatQuantifier=function(e,t){return void 0===t&&(t=!1),!!this.regexp_eatQuantifierPrefix(e,t)&&(e.eat(63),!0)},Hr.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)},Hr.regexp_eatBracedQuantifier=function(e,t){var s=e.pos;if(e.eat(123)){var i=0,n=-1;if(this.regexp_eatDecimalDigits(e)&&(i=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(n=e.lastIntValue),e.eat(125)))return-1!==n&&n=9?this.regexp_groupSpecifier(e):63===e.current()&&e.raise("Invalid group"),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,!0;e.raise("Unterminated group")}return!1},Hr.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)},Hr.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise("Nothing to repeat"),!1},Hr.regexp_eatSyntaxCharacter=function(e){var t=e.current();return!!Xr(t)&&(e.lastIntValue=t,e.advance(),!0)},Hr.regexp_eatPatternCharacters=function(e){for(var t=e.pos,s=0;-1!==(s=e.current())&&!Xr(s);)e.advance();return e.pos!==t},Hr.regexp_eatExtendedPatternCharacter=function(e){var t=e.current();return!(-1===t||36===t||t>=40&&t<=43||46===t||63===t||91===t||94===t||124===t||(e.advance(),0))},Hr.regexp_groupSpecifier=function(e){if(e.eat(63)){if(this.regexp_eatGroupName(e))return-1!==e.groupNames.indexOf(e.lastStringValue)&&e.raise("Duplicate capture group name"),void e.groupNames.push(e.lastStringValue);e.raise("Invalid group")}},Hr.regexp_eatGroupName=function(e){if(e.lastStringValue="",e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62))return!0;e.raise("Invalid capture group name")}return!1},Hr.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue="",this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=Kr(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=Kr(e.lastIntValue);return!0}return!1},Hr.regexp_eatRegExpIdentifierStart=function(e){var t=e.pos,s=this.options.ecmaVersion>=11,i=e.current(s);return e.advance(s),92===i&&this.regexp_eatRegExpUnicodeEscapeSequence(e,s)&&(i=e.lastIntValue),function(e){return Un(e,!0)||36===e||95===e}(i)?(e.lastIntValue=i,!0):(e.pos=t,!1)},Hr.regexp_eatRegExpIdentifierPart=function(e){var t=e.pos,s=this.options.ecmaVersion>=11,i=e.current(s);return e.advance(s),92===i&&this.regexp_eatRegExpUnicodeEscapeSequence(e,s)&&(i=e.lastIntValue),function(e){return zn(e,!0)||36===e||95===e||8204===e||8205===e}(i)?(e.lastIntValue=i,!0):(e.pos=t,!1)},Hr.regexp_eatAtomEscape=function(e){return!!(this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e))||(e.switchU&&(99===e.current()&&e.raise("Invalid unicode escape"),e.raise("Invalid escape")),!1)},Hr.regexp_eatBackReference=function(e){var t=e.pos;if(this.regexp_eatDecimalEscape(e)){var s=e.lastIntValue;if(e.switchU)return s>e.maxBackReference&&(e.maxBackReference=s),!0;if(s<=e.numCapturingParens)return!0;e.pos=t}return!1},Hr.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise("Invalid named reference")}return!1},Hr.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,!1)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)},Hr.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1},Hr.regexp_eatZero=function(e){return 48===e.current()&&!Zr(e.lookahead())&&(e.lastIntValue=0,e.advance(),!0)},Hr.regexp_eatControlEscape=function(e){var t=e.current();return 116===t?(e.lastIntValue=9,e.advance(),!0):110===t?(e.lastIntValue=10,e.advance(),!0):118===t?(e.lastIntValue=11,e.advance(),!0):102===t?(e.lastIntValue=12,e.advance(),!0):114===t&&(e.lastIntValue=13,e.advance(),!0)},Hr.regexp_eatControlLetter=function(e){var t=e.current();return!!Yr(t)&&(e.lastIntValue=t%32,e.advance(),!0)},Hr.regexp_eatRegExpUnicodeEscapeSequence=function(e,t){void 0===t&&(t=!1);var s,i=e.pos,n=t||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var r=e.lastIntValue;if(n&&r>=55296&&r<=56319){var a=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var o=e.lastIntValue;if(o>=56320&&o<=57343)return e.lastIntValue=1024*(r-55296)+(o-56320)+65536,!0}e.pos=a,e.lastIntValue=r}return!0}if(n&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&(s=e.lastIntValue)>=0&&s<=1114111)return!0;n&&e.raise("Invalid unicode escape"),e.pos=i}return!1},Hr.regexp_eatIdentityEscape=function(e){if(e.switchU)return!!this.regexp_eatSyntaxCharacter(e)||!!e.eat(47)&&(e.lastIntValue=47,!0);var t=e.current();return!(99===t||e.switchN&&107===t||(e.lastIntValue=t,e.advance(),0))},Hr.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var t=e.current();if(t>=49&&t<=57){do{e.lastIntValue=10*e.lastIntValue+(t-48),e.advance()}while((t=e.current())>=48&&t<=57);return!0}return!1},Hr.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(function(e){return 100===e||68===e||115===e||83===e||119===e||87===e}(t))return e.lastIntValue=-1,e.advance(),!0;if(e.switchU&&this.options.ecmaVersion>=9&&(80===t||112===t)){if(e.lastIntValue=-1,e.advance(),e.eat(123)&&this.regexp_eatUnicodePropertyValueExpression(e)&&e.eat(125))return!0;e.raise("Invalid property name")}return!1},Hr.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var s=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var i=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,s,i),!0}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var n=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,n),!0}return!1},Hr.regexp_validateUnicodePropertyNameAndValue=function(e,t,s){rr(e.unicodeProperties.nonBinary,t)||e.raise("Invalid property name"),e.unicodeProperties.nonBinary[t].test(s)||e.raise("Invalid property value")},Hr.regexp_validateUnicodePropertyNameOrValue=function(e,t){e.unicodeProperties.binary.test(t)||e.raise("Invalid property name")},Hr.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue="";Qr(t=e.current());)e.lastStringValue+=Kr(t),e.advance();return""!==e.lastStringValue},Hr.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue="";Jr(t=e.current());)e.lastStringValue+=Kr(t),e.advance();return""!==e.lastStringValue},Hr.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)},Hr.regexp_eatCharacterClass=function(e){if(e.eat(91)){if(e.eat(94),this.regexp_classRanges(e),e.eat(93))return!0;e.raise("Unterminated character class")}return!1},Hr.regexp_classRanges=function(e){for(;this.regexp_eatClassAtom(e);){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var s=e.lastIntValue;!e.switchU||-1!==t&&-1!==s||e.raise("Invalid character class"),-1!==t&&-1!==s&&t>s&&e.raise("Range out of order in character class")}}},Hr.regexp_eatClassAtom=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){var s=e.current();(99===s||sa(s))&&e.raise("Invalid class escape"),e.raise("Invalid escape")}e.pos=t}var i=e.current();return 93!==i&&(e.lastIntValue=i,e.advance(),!0)},Hr.regexp_eatClassEscape=function(e){var t=e.pos;if(e.eat(98))return e.lastIntValue=8,!0;if(e.switchU&&e.eat(45))return e.lastIntValue=45,!0;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return!0;e.pos=t}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)},Hr.regexp_eatClassControlLetter=function(e){var t=e.current();return!(!Zr(t)&&95!==t||(e.lastIntValue=t%32,e.advance(),0))},Hr.regexp_eatHexEscapeSequence=function(e){var t=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return!0;e.switchU&&e.raise("Invalid escape"),e.pos=t}return!1},Hr.regexp_eatDecimalDigits=function(e){var t=e.pos,s=0;for(e.lastIntValue=0;Zr(s=e.current());)e.lastIntValue=10*e.lastIntValue+(s-48),e.advance();return e.pos!==t},Hr.regexp_eatHexDigits=function(e){var t=e.pos,s=0;for(e.lastIntValue=0;ea(s=e.current());)e.lastIntValue=16*e.lastIntValue+ta(s),e.advance();return e.pos!==t},Hr.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var s=e.lastIntValue;t<=3&&this.regexp_eatOctalDigit(e)?e.lastIntValue=64*t+8*s+e.lastIntValue:e.lastIntValue=8*t+s}else e.lastIntValue=t;return!0}return!1},Hr.regexp_eatOctalDigit=function(e){var t=e.current();return sa(t)?(e.lastIntValue=t-48,e.advance(),!0):(e.lastIntValue=0,!1)},Hr.regexp_eatFixedHexDigits=function(e,t){var s=e.pos;e.lastIntValue=0;for(var i=0;i>10),56320+(1023&e)))}na.next=function(e){!e&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword),this.options.onToken&&this.options.onToken(new ia(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},na.getToken=function(){return this.next(),new ia(this)},"undefined"!=typeof Symbol&&(na[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===Yn.eof,value:t}}}}),na.curContext=function(){return this.context[this.context.length-1]},na.nextToken=function(){var e=this.curContext();return e&&e.preserveSpace||this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length?this.finishToken(Yn.eof):e.override?e.override(this):void this.readToken(this.fullCharCodeAtPos())},na.readToken=function(e){return Un(e,this.options.ecmaVersion>=6)||92===e?this.readWord():this.getTokenFromCode(e)},na.fullCharCodeAtPos=function(){var e=this.input.charCodeAt(this.pos);return e<=55295||e>=57344?e:(e<<10)+this.input.charCodeAt(this.pos+1)-56613888},na.skipBlockComment=function(){var e,t=this.options.onComment&&this.curPosition(),s=this.pos,i=this.input.indexOf("*/",this.pos+=2);if(-1===i&&this.raise(this.pos-2,"Unterminated comment"),this.pos=i+2,this.options.locations)for(Jn.lastIndex=s;(e=Jn.exec(this.input))&&e.index8&&e<14||e>=5760&&er.test(String.fromCharCode(e))))break e;++this.pos}}},na.finishToken=function(e,t){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var s=this.type;this.type=e,this.value=t,this.updateContext(s)},na.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var t=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&46===e&&46===t?(this.pos+=3,this.finishToken(Yn.ellipsis)):(++this.pos,this.finishToken(Yn.dot))},na.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):61===e?this.finishOp(Yn.assign,2):this.finishOp(Yn.slash,1)},na.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),s=1,i=42===e?Yn.star:Yn.modulo;return this.options.ecmaVersion>=7&&42===e&&42===t&&(++s,i=Yn.starstar,t=this.input.charCodeAt(this.pos+2)),61===t?this.finishOp(Yn.assign,s+1):this.finishOp(i,s)},na.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?this.finishOp(124===e?Yn.logicalOR:Yn.logicalAND,2):61===t?this.finishOp(Yn.assign,2):this.finishOp(124===e?Yn.bitwiseOR:Yn.bitwiseAND,1)},na.readToken_caret=function(){return 61===this.input.charCodeAt(this.pos+1)?this.finishOp(Yn.assign,2):this.finishOp(Yn.bitwiseXOR,1)},na.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?45!==t||this.inModule||62!==this.input.charCodeAt(this.pos+2)||0!==this.lastTokEnd&&!Qn.test(this.input.slice(this.lastTokEnd,this.pos))?this.finishOp(Yn.incDec,2):(this.skipLineComment(3),this.skipSpace(),this.nextToken()):61===t?this.finishOp(Yn.assign,2):this.finishOp(Yn.plusMin,1)},na.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),s=1;return t===e?(s=62===e&&62===this.input.charCodeAt(this.pos+2)?3:2,61===this.input.charCodeAt(this.pos+s)?this.finishOp(Yn.assign,s+1):this.finishOp(Yn.bitShift,s)):33!==t||60!==e||this.inModule||45!==this.input.charCodeAt(this.pos+2)||45!==this.input.charCodeAt(this.pos+3)?(61===t&&(s=2),this.finishOp(Yn.relational,s)):(this.skipLineComment(4),this.skipSpace(),this.nextToken())},na.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return 61===t?this.finishOp(Yn.equality,61===this.input.charCodeAt(this.pos+2)?3:2):61===e&&62===t&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(Yn.arrow)):this.finishOp(61===e?Yn.eq:Yn.prefix,1)},na.readToken_question=function(){if(this.options.ecmaVersion>=11){var e=this.input.charCodeAt(this.pos+1);if(46===e){var t=this.input.charCodeAt(this.pos+2);if(t<48||t>57)return this.finishOp(Yn.questionDot,2)}if(63===e)return this.finishOp(Yn.coalesce,2)}return this.finishOp(Yn.question,1)},na.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(Yn.parenL);case 41:return++this.pos,this.finishToken(Yn.parenR);case 59:return++this.pos,this.finishToken(Yn.semi);case 44:return++this.pos,this.finishToken(Yn.comma);case 91:return++this.pos,this.finishToken(Yn.bracketL);case 93:return++this.pos,this.finishToken(Yn.bracketR);case 123:return++this.pos,this.finishToken(Yn.braceL);case 125:return++this.pos,this.finishToken(Yn.braceR);case 58:return++this.pos,this.finishToken(Yn.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(Yn.backQuote);case 48:var t=this.input.charCodeAt(this.pos+1);if(120===t||88===t)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(111===t||79===t)return this.readRadixNumber(8);if(98===t||66===t)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(Yn.prefix,1)}this.raise(this.pos,"Unexpected character '"+ra(e)+"'")},na.finishOp=function(e,t){var s=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,s)},na.readRegexp=function(){for(var e,t,s=this.pos;;){this.pos>=this.input.length&&this.raise(s,"Unterminated regular expression");var i=this.input.charAt(this.pos);if(Qn.test(i)&&this.raise(s,"Unterminated regular expression"),e)e=!1;else{if("["===i)t=!0;else if("]"===i&&t)t=!1;else if("/"===i&&!t)break;e="\\"===i}++this.pos}var n=this.input.slice(s,this.pos);++this.pos;var r=this.pos,a=this.readWord1();this.containsEsc&&this.unexpected(r);var o=this.regexpState||(this.regexpState=new qr(this));o.reset(s,n,a),this.validateRegExpFlags(o),this.validateRegExpPattern(o);var h=null;try{h=new RegExp(n,a)}catch(e){}return this.finishToken(Yn.regexp,{pattern:n,flags:a,value:h})},na.readInt=function(e,t){for(var s=this.pos,i=0,n=0,r=null==t?1/0:t;n=97?a-97+10:a>=65?a-65+10:a>=48&&a<=57?a-48:1/0)>=e)break;++this.pos,i=i*e+o}return this.pos===s||null!=t&&this.pos-s!==t?null:i},na.readRadixNumber=function(e){var t=this.pos;this.pos+=2;var s=this.readInt(e);return null==s&&this.raise(this.start+2,"Expected number in radix "+e),this.options.ecmaVersion>=11&&110===this.input.charCodeAt(this.pos)?(s="undefined"!=typeof BigInt?BigInt(this.input.slice(t,this.pos)):null,++this.pos):Un(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(Yn.num,s)},na.readNumber=function(e){var t=this.pos;e||null!==this.readInt(10)||this.raise(t,"Invalid number");var s=this.pos-t>=2&&48===this.input.charCodeAt(t);s&&this.strict&&this.raise(t,"Invalid number");var i=this.input.charCodeAt(this.pos);if(!s&&!e&&this.options.ecmaVersion>=11&&110===i){var n=this.input.slice(t,this.pos),r="undefined"!=typeof BigInt?BigInt(n):null;return++this.pos,Un(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(Yn.num,r)}s&&/[89]/.test(this.input.slice(t,this.pos))&&(s=!1),46!==i||s||(++this.pos,this.readInt(10),i=this.input.charCodeAt(this.pos)),69!==i&&101!==i||s||(43!==(i=this.input.charCodeAt(++this.pos))&&45!==i||++this.pos,null===this.readInt(10)&&this.raise(t,"Invalid number")),Un(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var a=this.input.slice(t,this.pos),o=s?parseInt(a,8):parseFloat(a);return this.finishToken(Yn.num,o)},na.readCodePoint=function(){var e;if(123===this.input.charCodeAt(this.pos)){this.options.ecmaVersion<6&&this.unexpected();var t=++this.pos;e=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,e>1114111&&this.invalidStringToken(t,"Code point out of bounds")}else e=this.readHexChar(4);return e},na.readString=function(e){for(var t="",s=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var i=this.input.charCodeAt(this.pos);if(i===e)break;92===i?(t+=this.input.slice(s,this.pos),t+=this.readEscapedChar(!1),s=this.pos):(Zn(i,this.options.ecmaVersion>=10)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return t+=this.input.slice(s,this.pos++),this.finishToken(Yn.string,t)};var aa={};na.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e!==aa)throw e;this.readInvalidTemplateToken()}this.inTemplateElement=!1},na.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw aa;this.raise(e,t)},na.readTmplToken=function(){for(var e="",t=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var s=this.input.charCodeAt(this.pos);if(96===s||36===s&&123===this.input.charCodeAt(this.pos+1))return this.pos!==this.start||this.type!==Yn.template&&this.type!==Yn.invalidTemplate?(e+=this.input.slice(t,this.pos),this.finishToken(Yn.template,e)):36===s?(this.pos+=2,this.finishToken(Yn.dollarBraceL)):(++this.pos,this.finishToken(Yn.backQuote));if(92===s)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(!0),t=this.pos;else if(Zn(s)){switch(e+=this.input.slice(t,this.pos),++this.pos,s){case 13:10===this.input.charCodeAt(this.pos)&&++this.pos;case 10:e+="\n";break;default:e+=String.fromCharCode(s)}this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos}else++this.pos}},na.readInvalidTemplateToken=function(){for(;this.pos=48&&t<=55){var i=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],n=parseInt(i,8);return n>255&&(i=i.slice(0,-1),n=parseInt(i,8)),this.pos+=i.length-1,t=this.input.charCodeAt(this.pos),"0"===i&&56!==t&&57!==t||!this.strict&&!e||this.invalidStringToken(this.pos-1-i.length,e?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(n)}return Zn(t)?"":String.fromCharCode(t)}},na.readHexChar=function(e){var t=this.pos,s=this.readInt(16,e);return null===s&&this.invalidStringToken(t,"Bad character escape sequence"),s},na.readWord1=function(){this.containsEsc=!1;for(var e="",t=!0,s=this.pos,i=this.options.ecmaVersion>=6;this.pos(...t)=>{throw Object.assign(new Error(`Cannot access the file system (via "fs.${e}") when using the browser build of Rollup. Make sure you supply a plugin with custom resolveId and load hooks to Rollup.`),{code:"NO_FS_IN_BROWSER",url:"https://rollupjs.org/guide/en/#a-simple-example"})},ca=la("lstatSync"),ua=la("readdirSync"),da=la("readFile"),pa=la("realpathSync"),fa=la("writeFile");async function ma(e,t,s,i,n){const r=await i.hookFirst("resolveId",[e,t],null,n);return null!=r?r:void 0===t||Ie(e)||"."===e[0]?function(e,t){let s=ga(e,t);return s||(s=ga(e+".mjs",t),s||(s=ga(e+".js",t),s))}(De(t?Le(t):De(),e),s):null}function ga(e,t){try{const s=ca(e);if(!t&&s.isSymbolicLink())return ga(pa(e),t);if(t&&s.isSymbolicLink()||s.isFile()){const t=Te(e);if(-1!==ua(Le(e)).indexOf(t))return e}}catch(e){}}function ya(e,t,{hook:s,id:i}={}){return"string"==typeof e&&(e={message:e}),e.code&&e.code!==Wt.PLUGIN_ERROR&&(e.pluginCode=e.code),e.code=Wt.PLUGIN_ERROR,e.plugin=t,s&&(e.hook=s),i&&(e.id=i),Bt(e)}const xa=[{active:!0,deprecated:"resolveAssetUrl",replacement:"resolveFileUrl"}],Ea={has:()=>!1,get(){},set(){},delete:()=>!1};function va(e){return e.startsWith("at position ")||e.startsWith("at output position ")?Bt({code:"ANONYMOUS_PLUGIN_CACHE",message:"A plugin is trying to use the Rollup cache but is not declaring a plugin name or cacheKey."}):Bt({code:"DUPLICATE_PLUGIN_NAME",message:`The plugin name ${e} is being used twice in the same build. Plugin names must be distinct or provide a cacheKey (please post an issue to the plugin if you are a plugin user).`})}function ba(e,t,s,i){const n=t.id,r=[];let a=null===e.map?null:ln(e.map);const o=e.code;let h=e.ast;const c=[],u=[];let d=!1;const p=()=>d=!0;let f,m=null,g=null;const y=e.code;return s.hookReduceArg0("transform",[y,n],(function(e,t,s){if("string"==typeof t)t={ast:void 0,code:t,map:void 0};else{if(!t||"object"!=typeof t)return e;"string"==typeof t.map&&(t.map=JSON.parse(t.map)),"boolean"==typeof t.moduleSideEffects&&(m=t.moduleSideEffects),"boolean"==typeof t.syntheticNamedExports&&(g=t.syntheticNamedExports)}if(null!==t.map){const e=ln(t.map);r.push(e||{missing:!0,plugin:s.name})}return h=t.ast,t.code}),(e,t)=>{return f=t,{...e,cache:d?e.cache:(h=e.cache,m=p,{has:e=>(m(),h.has(e)),get:e=>(m(),h.get(e)),set:(e,t)=>(m(),h.set(e,t)),delete:e=>(m(),h.delete(e))}),warn(t,s){"string"==typeof t&&(t={message:t}),s&&Ft(t,s,y,n),t.id=n,t.hook="transform",e.warn(t)},error:(t,s)=>("string"==typeof t&&(t={message:t}),s&&Ft(t,s,y,n),t.id=n,t.hook="transform",e.error(t)),emitAsset(e,t){const i={type:"asset",name:e,source:t};return u.push({...i}),s.emitFile(i)},emitChunk(e,t){const i={type:"chunk",id:e,name:t&&t.name};return u.push({...i}),s.emitFile(i)},emitFile:e=>(u.push(e),s.emitFile(e)),addWatchFile(t){c.push(t),e.addWatchFile(t)},setAssetSource(){return this.error({code:"INVALID_SETASSETSOURCE",message:"setAssetSource cannot be called in transform for caching reasons. Use emitFile with a source, or call setAssetSource in another hook."})},getCombinedSourcemap(){const e=function(e,t,s,i,n){return i.length?{version:3,...Ei(e,t,s,i,xi(n)).traceMappings()}:s}(n,o,a,r,i);return e?(a!==e&&(a=e,r.length=0),new l({...e,file:null,sourcesContent:e.sourcesContent})):new x(o).generateMap({includeContent:!0,hires:!0,source:n})}};var h,m}).catch(e=>ya(e,f.name,{hook:"transform",id:n})).then(e=>(d||u.length&&(t.transformFiles=u),{ast:h,code:e,customTransformCache:d,moduleSideEffects:m,originalCode:o,originalSourcemap:a,sourcemapChain:r,syntheticNamedExports:g,transformDependencies:c}))}class Sa{constructor(e,t,s,i){this.graph=e,this.modulesById=t,this.options=s,this.pluginDriver=i,this.implicitEntryModules=new Set,this.indexedEntryModules=[],this.latestLoadModulesPromise=Promise.resolve(),this.nextEntryModuleIndex=0,this.hasModuleSideEffects=s.treeshake?s.treeshake.moduleSideEffects:()=>!0}async addAdditionalModules(e){const t=this.extendLoadModulesPromise(Promise.all(e.map(e=>this.loadEntryModule(e,!1,void 0,null))));return await this.awaitLoadModulesPromise(),t}async addEntryModules(e,t){const s=this.nextEntryModuleIndex;this.nextEntryModuleIndex+=e.length;const i=await this.extendLoadModulesPromise(Promise.all(e.map(({id:e,importer:t})=>this.loadEntryModule(e,!0,t,null))).then(i=>{let n=s;for(let s=0;se.module===r);a?a.index=Math.min(a.index,n):this.indexedEntryModules.push({module:r,index:n}),n++}return this.indexedEntryModules.sort(({index:e},{index:t})=>e>t?1:-1),i}));return await this.awaitLoadModulesPromise(),{entryModules:this.indexedEntryModules.map(({module:e})=>e),implicitEntryModules:[...this.implicitEntryModules],newEntryModules:i}}async emitChunk({fileName:e,id:t,importer:s,name:i,implicitlyLoadedAfterOneOf:n,preserveSignature:r}){const a={fileName:e||null,id:t,importer:s,name:i||null},o=n?await this.addEntryWithImplicitDependants(a,n):(await this.addEntryModules([a],!1)).newEntryModules[0];return null!=r&&(o.preserveSignature=r),o}async resolveId(e,t,s=null){return this.normalizeResolveIdResult(!this.options.external(e,t,!1)&&await ma(e,t,this.options.preserveSymlinks,this.pluginDriver,s),t,e)}addEntryWithImplicitDependants(e,t){return this.extendLoadModulesPromise(this.loadEntryModule(e.id,!1,e.importer,null).then(async s=>{if(Pa(s,e,!1),!s.isEntryPoint){this.implicitEntryModules.add(s);const i=await Promise.all(t.map(t=>this.loadEntryModule(t,!1,e.importer,s.id)));for(const e of i)s.implicitlyLoadedAfter.add(e);for(const e of s.implicitlyLoadedAfter)e.implicitlyLoadedBefore.add(s)}return s}))}async addModuleSource(e,t,s){var i;let n;oi("load modules",3);try{n=null!==(i=await this.pluginDriver.hookFirst("load",[e]))&&void 0!==i?i:await da(e)}catch(s){hi("load modules",3);let i="Could not load "+e;throw t&&(i+=` (imported by ${Dt(t)})`),i+=": "+s.message,s.message=i,s}hi("load modules",3);const r="string"==typeof n?{code:n}:"object"==typeof n&&"string"==typeof n.code?n:Bt(function(e){return{code:Wt.BAD_LOADER,message:`Error loading ${Dt(e)}: plugin load hook should return a string, a { code, map } object, or nothing/null`}}(e)),a=this.graph.cachedModules.get(e);if(a&&!a.customTransformCache&&a.originalCode===r.code){if(a.transformFiles)for(const e of a.transformFiles)this.pluginDriver.emitFile(e);s.setSource(a)}else"boolean"==typeof r.moduleSideEffects&&(s.moduleSideEffects=r.moduleSideEffects),"boolean"==typeof r.syntheticNamedExports&&(s.syntheticNamedExports=r.syntheticNamedExports),s.setSource(await ba(r,s,this.pluginDriver,this.options.onwarn))}async awaitLoadModulesPromise(){let e;do{e=this.latestLoadModulesPromise,await e}while(e!==this.latestLoadModulesPromise)}extendLoadModulesPromise(e){return this.latestLoadModulesPromise=Promise.all([e,this.latestLoadModulesPromise]),this.latestLoadModulesPromise.catch(()=>{}),e}async fetchDynamicDependencies(e){const t=await Promise.all(e.dynamicImports.map(async t=>{const s=await this.resolveDynamicImport(e,t.argument,e.id);return null===s?null:"string"==typeof s?(t.resolution=s,null):t.resolution=await this.fetchResolvedDependency(Dt(s.id),e.id,s)}));for(const s of t)s&&(e.dynamicDependencies.add(s),s.dynamicImporters.push(e.id))}async fetchModule(e,t,s,i,n){const r=this.modulesById.get(e);if(r instanceof mi){if(n){r.isEntryPoint=!0,this.implicitEntryModules.delete(r);for(const e of r.implicitlyLoadedAfter)e.implicitlyLoadedBefore.delete(r);r.implicitlyLoadedAfter.clear()}return r}const a=new mi(this.graph,e,this.options,s,i,n);return this.modulesById.set(e,a),this.graph.watchFiles[e]=!0,await this.addModuleSource(e,t,a),await Promise.all([this.fetchStaticDependencies(a),this.fetchDynamicDependencies(a)]),a.linkImports(),a}fetchResolvedDependency(e,t,s){if(s.external){this.modulesById.has(s.id)||this.modulesById.set(s.id,new Ve(this.options,s.id,s.moduleSideEffects));const i=this.modulesById.get(s.id);return i instanceof Ve?Promise.resolve(i):Bt(function(e,t){return{code:Wt.INVALID_EXTERNAL_ID,message:`'${e}' is imported as an external by ${Dt(t)}, but is already an existing non-external module id.`}}(e,t))}return this.fetchModule(s.id,t,s.moduleSideEffects,s.syntheticNamedExports,!1)}async fetchStaticDependencies(e){for(const t of await Promise.all(Array.from(e.sources,async t=>this.fetchResolvedDependency(t,e.id,e.resolvedIds[t]=e.resolvedIds[t]||this.handleResolveId(await this.resolveId(t,e.id),t,e.id)))))e.dependencies.add(t),t.importers.push(e.id)}handleResolveId(e,t,s){return null===e?$e(t)?Bt(function(e,t){return{code:Wt.UNRESOLVED_IMPORT,message:`Could not resolve '${e}' from ${Dt(t)}`}}(t,s)):(this.options.onwarn(function(e,t){return{code:Wt.UNRESOLVED_IMPORT,importer:Dt(t),message:`'${e}' is imported by ${Dt(t)}, but could not be resolved – treating it as an external dependency`,source:e,url:"https://rollupjs.org/guide/en/#warning-treating-module-as-external-dependency"}}(t,s)),{external:!0,id:t,moduleSideEffects:this.hasModuleSideEffects(t,!0),syntheticNamedExports:!1}):(e.external&&e.syntheticNamedExports&&this.options.onwarn(function(e,t){return{code:Wt.EXTERNAL_SYNTHETIC_EXPORTS,importer:Dt(t),message:`External '${e}' can not have 'syntheticNamedExports' enabled.`,source:e}}(t,s)),e)}async loadEntryModule(e,t,s,i){const n=await ma(e,s,this.options.preserveSymlinks,this.pluginDriver,null);if(!1===n||n&&"object"==typeof n&&n.external)return Bt(null===i?function(e){return{code:Wt.UNRESOLVED_ENTRY,message:`Entry module cannot be external (${Dt(e)}).`}}(e):function(e,t){return{code:Wt.MISSING_IMPLICIT_DEPENDANT,message:`Module "${Dt(e)}" that should be implicitly loaded before "${Dt(t)}" cannot be external.`}}(e,i));const r=n&&"object"==typeof n?n.id:n;return"string"==typeof r?this.fetchModule(r,void 0,!0,!1,t):Bt(null===i?function(e){return{code:Wt.UNRESOLVED_ENTRY,message:`Could not resolve entry module (${Dt(e)}).`}}(e):function(e,t){return{code:Wt.MISSING_IMPLICIT_DEPENDANT,message:`Module "${Dt(e)}" that should be implicitly loaded before "${Dt(t)}" could not be resolved.`}}(e,i))}normalizeResolveIdResult(e,t,s){let i="",n=!1,r=null,a=!1;if(e)"object"==typeof e?(i=e.id,e.external&&(n=!0),"boolean"==typeof e.moduleSideEffects&&(r=e.moduleSideEffects),"boolean"==typeof e.syntheticNamedExports&&(a=e.syntheticNamedExports)):(this.options.external(e,t,!0)&&(n=!0),i=n?Aa(e,t):e);else{if(i=Aa(s,t),!1!==e&&!this.options.external(i,t,!0))return null;n=!0}return{external:n,id:i,moduleSideEffects:"boolean"==typeof r?r:this.hasModuleSideEffects(i,n),syntheticNamedExports:a}}async resolveDynamicImport(e,t,s){const i=await this.pluginDriver.hookFirst("resolveDynamicImport",[t,s]);return"string"!=typeof t?"string"==typeof i?i:i?{external:!1,moduleSideEffects:!0,...i}:null:null==i?e.resolvedIds[t]=e.resolvedIds[t]||this.handleResolveId(await this.resolveId(t,e.id),t,e.id):this.handleResolveId(this.normalizeResolveIdResult(i,s,t),t,s)}}function Aa(e,t){return $e(e)?t?De(t,"..",e):De(e):e}function Pa(e,{fileName:t,name:s},i){null!==t?e.chunkFileNames.add(t):null!==s&&(null===e.chunkName&&(e.chunkName=s),i&&e.userChunkNames.add(s))}function Ca(e,t,s,i,n,r){let a=!1;return(...o)=>(a||(a=!0,Ht({message:`The "this.${t}" plugin context function used by plugin ${i} is deprecated. The "this.${s}" plugin context function should be used instead.`,plugin:i},n,r)),e(...o))}function ka(e,t,s,i){const n=new Set;return(r,a)=>{let o,h=!0;if("string"!=typeof r.cacheKey&&(r.name.startsWith("at position ")||r.name.startsWith("at output position ")||n.has(r.name)?h=!1:n.add(r.name)),e)if(h){const t=r.cacheKey||r.name;c=e[t]||(e[t]=Object.create(null)),o={has(e){const t=c[e];return!!t&&(t[0]=0,!0)},get(e){const t=c[e];if(t)return t[0]=0,t[1]},set(e,t){c[e]=[0,t]},delete:e=>delete c[e]}}else l=r.name,o={has:()=>va(l),get:()=>va(l),set:()=>va(l),delete:()=>va(l)};else o=Ea;var l,c;return{addWatchFile(e){if(t.phase>=vn.GENERATE)return this.error({code:Wt.INVALID_ROLLUP_PHASE,message:"Cannot call addWatchFile after the build has finished."});t.watchFiles[e]=!0},cache:o,emitAsset:Ca((e,t)=>i.emitFile({type:"asset",name:e,source:t}),"emitAsset","emitFile",r.name,!0,s),emitChunk:Ca((e,t)=>i.emitFile({type:"chunk",id:e,name:t&&t.name}),"emitChunk","emitFile",r.name,!0,s),emitFile:i.emitFile,error:e=>ya(e,r.name),getAssetFileName:Ca(i.getFileName,"getAssetFileName","getFileName",r.name,!0,s),getChunkFileName:Ca(i.getFileName,"getChunkFileName","getFileName",r.name,!0,s),getFileName:i.getFileName,getModuleIds:()=>t.modulesById.keys(),getModuleInfo:t.getModuleInfo,isExternal:Ca((e,t,i=!1)=>s.external(e,t,i),"isExternal","resolve",r.name,!0,s),meta:{rollupVersion:"2.18.0",watchMode:t.watchMode},get moduleIds(){const e=t.modulesById.keys();return function*(){Ht({message:`Accessing "this.moduleIds" on the plugin context by plugin ${r.name} is deprecated. The "this.getModuleIds" plugin context function should be used instead.`,plugin:r.name},!1,s),yield*e}()},parse:t.contextParse,resolve:(e,s,i)=>t.moduleLoader.resolveId(e,s,i&&i.skipSelf?a:null),resolveId:Ca((e,s)=>t.moduleLoader.resolveId(e,s).then(e=>e&&e.id),"resolveId","resolve",r.name,!0,s),setAssetSource:i.setAssetSource,warn(e){"string"==typeof e&&(e={message:e}),e.code&&(e.pluginCode=e.code),e.code="PLUGIN_WARNING",e.plugin=r.name,s.onwarn(e)}}}}const wa=Object.keys({buildEnd:1,buildStart:1,load:1,options:1,resolveDynamicImport:1,resolveId:1,transform:1,watchChange:1});function Na(e,t){return Bt({code:"INVALID_PLUGIN_HOOK",message:`Error running plugin hook ${e} for ${t}, expected a function hook.`})}class _a{constructor(e,t,s,i,n){if(this.graph=e,this.options=t,function(e,t){for(const{active:s,deprecated:i,replacement:n}of xa)for(const r of e)i in r&&Ht({message:`The "${i}" hook used by plugin ${r.name} is deprecated. The "${n}" hook should be used instead.`,plugin:r.name},s,t)}(s,t),this.pluginCache=i,this.fileEmitter=new kn(e,t,n&&n.fileEmitter),this.emitFile=this.fileEmitter.emitFile,this.getFileName=this.fileEmitter.getFileName,this.finaliseAssets=this.fileEmitter.assertAssetsFinalized,this.setOutputBundle=this.fileEmitter.setOutputBundle,this.plugins=s.concat(n?n.plugins:[]),this.pluginContexts=this.plugins.map(ka(i,e,t,this.fileEmitter)),n)for(const e of s)for(const s of wa)s in e&&t.onwarn((r=e.name,a=s,{code:Wt.INPUT_HOOK_IN_OUTPUT_PLUGIN,message:`The "${a}" hook used by the output plugin ${r} is a build time hook and will not be run for that plugin. Either this plugin cannot be used as an output plugin, or it should have an option to configure it as an output plugin.`}));var r,a}createOutputPluginDriver(e){return new _a(this.graph,this.options,e,this.pluginCache,this)}hookFirst(e,t,s,i){let n=Promise.resolve(void 0);for(let r=0;rnull!=i?i:this.runHook(e,t,r,!1,s)));return n}hookFirstSync(e,t,s){for(let i=0;i{})}hookReduceArg0(e,[t,...s],i,n){let r=Promise.resolve(t);for(let t=0;t{const a=[r,...s],o=this.runHook(e,a,t,!1,n);return o?o.then(e=>i.call(this.pluginContexts[t],r,e,this.plugins[t])):r});return r}hookReduceArg0Sync(e,[t,...s],i,n){for(let r=0;r{const a=this.runHook(e,s,t,!0,n);return a?a.then(e=>i.call(this.pluginContexts[t],r,e,this.plugins[t])):r});return r}hookReduceValueSync(e,t,s,i,n){let r=t;for(let t=0;tthis.runHook(e,t,n,!1,s));return i}hookSeqSync(e,t,s){for(let i=0;i"function"!=typeof a?i?a:Na(e,r.name):a.apply(o,t)).catch(t=>ya(t,r.name,{hook:e}))}runHookSync(e,t,s,i){const n=this.plugins[s],r=n[e];if(!r)return;let a=this.pluginContexts[s];i&&(a=i(a,n));try{return"function"!=typeof r?Na(e,n.name):r.apply(a,t)}catch(t){return ya(t,n.name,{hook:e})}}}class Ia{constructor(e,t){var s,i;if(this.options=e,this.entryModules=[],this.modulesById=new Map,this.needsTreeshakingPass=!1,this.phase=vn.LOAD_AND_PARSE,this.watchFiles=Object.create(null),this.watchMode=!1,this.externalModules=[],this.implicitEntryModules=[],this.modules=[],this.getModuleInfo=e=>{const t=this.modulesById.get(e);if(null==t)throw new Error("Unable to find module "+e);const s=[],i=[];if(t instanceof mi){for(const e of t.sources)s.push(t.resolvedIds[e].id);for(const{resolution:e}of t.dynamicImports)(e instanceof mi||e instanceof Ve)&&i.push(e.id)}return{dynamicallyImportedIds:i,dynamicImporters:t.dynamicImporters.sort(),hasModuleSideEffects:t.moduleSideEffects,id:t.id,implicitlyLoadedAfterOneOf:t instanceof mi?Array.from(t.implicitlyLoadedAfter,Us):[],implicitlyLoadedBefore:t instanceof mi?Array.from(t.implicitlyLoadedBefore,Us):[],importedIds:s,importers:t.importers.sort(),isEntry:t instanceof mi&&t.isEntryPoint,isExternal:t instanceof Ve}},this.deoptimizationTracker=new U,this.cachedModules=new Map,!1!==e.cache){if(null===(s=e.cache)||void 0===s?void 0:s.modules)for(const t of e.cache.modules)this.cachedModules.set(t.id,t);this.pluginCache=(null===(i=e.cache)||void 0===i?void 0:i.plugins)||Object.create(null);for(const e in this.pluginCache){const t=this.pluginCache[e];for(const e of Object.keys(t))t[e][0]++}}if(this.contextParse=(e,t={})=>this.acornParser.parse(e,{...this.options.acorn,...t}),t){this.watchMode=!0;const e=e=>this.pluginDriver.hookSeqSync("watchChange",[e]);t.on("change",e),t.once("restart",()=>{t.removeListener("change",e)})}this.pluginDriver=new _a(this,e,e.plugins,this.pluginCache),this.scope=new ha,this.acornParser=fr.extend(...e.acornInjectPlugins),this.moduleLoader=new Sa(this,this.modulesById,this.options,this.pluginDriver)}async build(){oi("generate module graph",2),await this.generateModuleGraph(),hi("generate module graph",2),oi("sort modules",2),this.phase=vn.ANALYSE,this.sortModules(),hi("sort modules",2),oi("mark included statements",2),this.includeStatements(),hi("mark included statements",2),this.phase=vn.GENERATE}getCache(){for(const e in this.pluginCache){const t=this.pluginCache[e];let s=!0;for(const e of Object.keys(t))t[e][0]>=this.options.experimentalCacheExpiry?delete t[e]:s=!1;s&&delete this.pluginCache[e]}return{modules:this.modules.map(e=>e.toJSON()),plugins:this.pluginCache}}async generateModuleGraph(){var e;if(({entryModules:this.entryModules,implicitEntryModules:this.implicitEntryModules}=await this.moduleLoader.addEntryModules((e=this.options.input,Array.isArray(e)?e.map(e=>({fileName:null,id:e,implicitlyLoadedAfter:[],importer:void 0,name:null})):Object.keys(e).map(t=>({fileName:null,id:e[t],implicitlyLoadedAfter:[],importer:void 0,name:t}))),!0)),0===this.entryModules.length)throw new Error("You must supply options.input to rollup");for(const e of this.modulesById.values())e instanceof mi?this.modules.push(e):this.externalModules.push(e)}includeStatements(){for(const e of[...this.entryModules,...this.implicitEntryModules])!1!==e.preserveSignature?e.includeAllExports():Be(e);if(this.options.treeshake){let e=1;do{oi("treeshaking pass "+e,3),this.needsTreeshakingPass=!1;for(const e of this.modules)e.isExecuted&&e.include();hi("treeshaking pass "+e++,3)}while(this.needsTreeshakingPass)}else for(const e of this.modules)e.includeAllInBundle();for(const e of this.externalModules)e.warnUnusedImports();for(const e of this.implicitEntryModules)for(const t of e.implicitlyLoadedAfter)t.isEntryPoint||t.isIncluded()||Bt(zt(t))}sortModules(){const{orderedModules:e,cyclePaths:t}=function(e){let t=0;const s=[],i=new Set,n=new Set,r=new Map,a=[],o=e=>{if(e instanceof mi){for(const t of e.dependencies)r.has(t)?i.has(t)||s.push(an(t,e,r)):(r.set(t,e),o(t));for(const t of e.implicitlyLoadedBefore)n.add(t);for(const{resolution:t}of e.dynamicImports)t instanceof mi&&n.add(t);a.push(e)}e.execIndex=t++,i.add(e)};for(const t of e)r.has(t)||(r.set(t,null),o(t));for(const e of n)r.has(e)||(r.set(e,null),o(e));return{orderedModules:a,cyclePaths:s}}(this.entryModules);for(const e of t)this.options.onwarn({code:"CIRCULAR_DEPENDENCY",cycle:e,importer:e[0],message:"Circular dependency: "+e.join(" -> ")});this.modules=e;for(const e of this.modules)e.bindReferences();this.warnForMissingExports()}warnForMissingExports(){for(const e of this.modules)for(const t of Object.keys(e.importDescriptions)){const s=e.importDescriptions[t];"*"===s.name||s.module.getVariableForExportName(s.name)||e.warn({code:"NON_EXISTENT_EXPORT",message:`Non-existent export '${s.name}' is imported from ${Dt(s.module.id)}`,name:s.name,source:s.module.id},s.start)}}}function $a(e){return Array.isArray(e)?e.filter(Boolean):e?[e]:[]}var Ma=function(e){return e&&e.default||e}(oa);const Ta=Object.getPrototypeOf||(e=>e.__proto__);var La=function(e){if(e.prototype.parsePrivateName)return e;const t=(e=>{if(e.acorn)return e.acorn;const t=Ma;if(0!=t.version.indexOf("6.")&&0==t.version.indexOf("6.0.")&&0!=t.version.indexOf("7."))throw new Error("acorn-private-class-elements requires acorn@^6.1.0 or acorn@7.0.0, not "+t.version);for(let s=e;s&&s!==t.Parser;s=Ta(s))if(s!==t.Parser)throw new Error("acorn-private-class-elements does not support mixing different acorn copies");return t})(e);return(e=class extends e{_branch(){return this.__branch=this.__branch||new e({ecmaVersion:this.options.ecmaVersion},this.input),this.__branch.end=this.end,this.__branch.pos=this.pos,this.__branch.type=this.type,this.__branch.value=this.value,this.__branch.containsEsc=this.containsEsc,this.__branch}parsePrivateClassElementName(e){e.computed=!1,e.key=this.parsePrivateName(),"constructor"==e.key.name&&this.raise(e.key.start,"Classes may not have a private element named constructor");const t={get:"set",set:"get"}[e.kind],s=this._privateBoundNames;return Object.prototype.hasOwnProperty.call(s,e.key.name)&&s[e.key.name]!==t&&this.raise(e.start,"Duplicate private element"),s[e.key.name]=e.kind||!0,delete this._unresolvedPrivateNames[e.key.name],e.key}parsePrivateName(){const e=this.startNode();return e.name=this.value,this.next(),this.finishNode(e,"PrivateName"),"never"==this.options.allowReserved&&this.checkUnreserved(e),e}getTokenFromCode(e){if(35===e){++this.pos;const e=this.readWord1();return this.finishToken(this.privateNameToken,e)}return super.getTokenFromCode(e)}parseClass(e,t){const s=this._outerPrivateBoundNames;this._outerPrivateBoundNames=this._privateBoundNames,this._privateBoundNames=Object.create(this._privateBoundNames||null);const i=this._outerUnresolvedPrivateNames;this._outerUnresolvedPrivateNames=this._unresolvedPrivateNames,this._unresolvedPrivateNames=Object.create(null);const n=super.parseClass(e,t),r=this._unresolvedPrivateNames;if(this._privateBoundNames=this._outerPrivateBoundNames,this._outerPrivateBoundNames=s,this._unresolvedPrivateNames=this._outerUnresolvedPrivateNames,this._outerUnresolvedPrivateNames=i,this._unresolvedPrivateNames)Object.assign(this._unresolvedPrivateNames,r);else{const e=Object.keys(r);e.length&&(e.sort((e,t)=>r[e]-r[t]),this.raise(r[e[0]],"Usage of undeclared private name"))}return n}parseClassSuper(e){const t=this._privateBoundNames;this._privateBoundNames=this._outerPrivateBoundNames;const s=this._unresolvedPrivateNames;this._unresolvedPrivateNames=this._outerUnresolvedPrivateNames;const i=super.parseClassSuper(e);return this._privateBoundNames=t,this._unresolvedPrivateNames=s,i}parseSubscript(e,s,i,n,r,a){const o=this.options.ecmaVersion>=11&&t.tokTypes.questionDot,h=this._branch();if(!(h.eat(t.tokTypes.dot)||o&&h.eat(t.tokTypes.questionDot))||h.type!=this.privateNameToken)return super.parseSubscript.apply(this,arguments);let l=!1;this.eat(t.tokTypes.dot)||(this.expect(t.tokTypes.questionDot),l=!0);let c=this.startNodeAt(s,i);return c.object=e,c.computed=!1,o&&(c.optional=l),this.type==this.privateNameToken?("Super"==e.type&&this.raise(this.start,"Cannot access private element on super"),c.property=this.parsePrivateName(),this._privateBoundNames&&this._privateBoundNames[c.property.name]||(this._unresolvedPrivateNames||this.raise(c.property.start,"Usage of undeclared private name"),this._unresolvedPrivateNames[c.property.name]=c.property.start)):c.property=this.parseIdent(!0),this.finishNode(c,"MemberExpression")}parseMaybeUnary(e,t){const s=super.parseMaybeUnary(e,t);return"delete"==s.operator&&"MemberExpression"==s.argument.type&&"PrivateName"==s.argument.property.type&&this.raise(s.start,"Private elements may not be deleted"),s}}).prototype.privateNameToken=new t.TokenType("privateName"),e},Ra=function(e){const t=(e.acorn||Ma).tokTypes;return e=La(e),class extends e{_maybeParseFieldValue(e){if(this.eat(t.eq)){const t=this._inFieldValue;this._inFieldValue=!0,e.value=this.parseExpression(),this._inFieldValue=t}else e.value=null}parseClassElement(e){if(this.options.ecmaVersion>=8&&(this.type==t.name||this.type.keyword||this.type==this.privateNameToken||this.type==t.bracketL||this.type==t.string||this.type==t.num)){const e=this._branch();if(e.type==t.bracketL){let s=0;do{e.eat(t.bracketL)?++s:e.eat(t.bracketR)?--s:e.next()}while(s>0)}else e.next(!0);if(e.type==t.eq||e.canInsertSemicolon()||e.type==t.semi){const e=this.startNode();return this.type==this.privateNameToken?this.parsePrivateClassElementName(e):this.parsePropertyName(e),("Identifier"===e.key.type&&"constructor"===e.key.name||"Literal"===e.key.type&&"constructor"===e.key.value)&&this.raise(e.key.start,"Classes may not have a field called constructor"),this.enterScope(67),this._maybeParseFieldValue(e),this.exitScope(),this.finishNode(e,"FieldDefinition"),this.semicolon(),e}}return super.parseClassElement.apply(this,arguments)}parseIdent(e,t){const s=super.parseIdent(e,t);return this._inFieldValue&&"arguments"==s.name&&this.raise(s.start,"A class field initializer may not contain arguments"),s}}},Oa=function(e){const t=e.acorn||Ma;return t.version.startsWith("6.")&&!t.version.startsWith("6.0.")&&!t.version.startsWith("6.1.")||t.version.startsWith("7.")?function(e,t){return class extends t{readInt(e,t){if(null!=t)return super.readInt(e,t);let s=this.pos,i=0,n=!1;for(;;){let t,s=this.input.charCodeAt(this.pos);if(s>=97)t=s-97+10;else{if(95==s){n||this.raise(this.pos,"Invalid numeric separator"),++this.pos,n=!1;continue}t=s>=65?s-65+10:s>=48&&s<=57?s-48:1/0}if(t>=e)break;++this.pos,i=i*e+t,n=!0}return this.pos===s?null:(n||this.raise(this.pos-1,"Invalid numeric separator"),i)}readNumber(t){let s=this.pos;t||null!==this.readInt(10)||this.raise(s,"Invalid number");let i=this.pos-s>=2&&48===this.input.charCodeAt(s),n=!1;i&&this.strict&&this.raise(s,"Invalid number");let r=this.input.charCodeAt(this.pos);if(!i&&!t&&this.options.ecmaVersion>=11&&110===r){let t=this.getNumberInput(s,this.pos),i="undefined"!=typeof BigInt?BigInt(t):null;return++this.pos,e.isIdentifierStart(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(e.tokTypes.num,i)}i&&/[89]/.test(this.input.slice(s,this.pos))&&(i=!1,n=!0),46!==r||i||(++this.pos,this.readInt(10),r=this.input.charCodeAt(this.pos)),69!==r&&101!==r||i||(r=this.input.charCodeAt(++this.pos),43!==r&&45!==r||++this.pos,null===this.readInt(10)&&this.raise(s,"Invalid number")),e.isIdentifierStart(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");let a=this.getNumberInput(s,this.pos);(i||n)&&a.length=11&&110===this.input.charCodeAt(this.pos)){let e=this.getNumberInput(s,this.pos);i="undefined"!=typeof BigInt?BigInt(e):null,++this.pos}else e.isIdentifierStart(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");return this.finishToken(e.tokTypes.num,i)}getNumberInput(e,t){return this.input.slice(e,t).replace(/_/g,"")}}}(t,e):function(e,t){return class extends t{readInt(e,t){if(null!=t)return super.readInt(e,t);let s=this.pos,i=0,n=!1;for(;;){let t,s=this.input.charCodeAt(this.pos);if(s>=97)t=s-97+10;else{if(95==s){n||this.raise(this.pos,"Invalid numeric separator"),++this.pos,n=!1;continue}t=s>=65?s-65+10:s>=48&&s<=57?s-48:1/0}if(t>=e)break;++this.pos,i=i*e+t,n=!0}return this.pos===s?null:(n||this.raise(this.pos-1,"Invalid numeric separator"),i)}readNumber(e){const t=super.readNumber(e);let s=this.end-this.start>=2&&48===this.input.charCodeAt(this.start);const i=this.getNumberInput(this.start,this.end);return i.length0)}else t.next();if(t.type!=s.eq&&!t.canInsertSemicolon()&&t.type!=s.semi)return super.parseClassElement.apply(this,arguments);const i=this.startNode();return i.static=this.eatContextual("static"),this.type==this.privateNameToken?this.parsePrivateClassElementName(i):this.parsePropertyName(i),("Identifier"===i.key.type&&"constructor"===i.key.name||"Literal"===i.key.type&&!i.computed&&"constructor"===i.key.value)&&this.raise(i.key.start,"Classes may not have a field called constructor"),"prototype"!==(i.key.name||i.key.value)||i.computed||this.raise(i.key.start,"Classes may not have a static property named prototype"),this._maybeParseFieldValue(i),this.finishNode(i,"FieldDefinition"),this.semicolon(),i}parsePropertyName(e){e.static&&this.type==this.privateNameToken?this.parsePrivateClassElementName(e):super.parsePropertyName(e)}parseIdent(e,t){const s=super.parseIdent(e,t);return this._inStaticFieldScope&&this.currentThisScope()===this._inStaticFieldScope&&"arguments"==s.name&&this.raise(s.start,"A static class field initializer may not contain arguments"),s}}};const Va=e=>console.warn(e.message||e);function Ba(e,t,s,i,n=/$./){const r=new Set(t),a=Object.keys(e).filter(e=>!(r.has(e)||n.test(e)));a.length>0&&i({code:"UNKNOWN_OPTION",message:`Unknown ${s}: ${a.join(", ")}. Allowed options: ${[...r].sort().join(", ")}`})}const Fa=e=>e.onwarn?t=>{t.toString=()=>{let e="";return t.plugin&&(e+=`(${t.plugin} plugin) `),t.loc&&(e+=`${Dt(t.loc.file)} (${t.loc.line}:${t.loc.column}) `),e+=t.message,e},e.onwarn(t,Va)}:Va,Wa=e=>({allowAwaitOutsideFunction:!0,ecmaVersion:2020,preserveParens:!1,sourceType:"module",...e.acorn}),Ua=e=>[Ra,Da,Oa,...$a(e.acornInjectPlugins)],za=e=>{var t;return(null===(t=e.cache)||void 0===t?void 0:t.cache)||e.cache},ja=e=>{if(!0===e)return()=>!0;if("function"==typeof e)return(t,...s)=>!t.startsWith("\0")&&e(t,...s)||!1;if(e){const t=new Set,s=[];for(const i of $a(e))i instanceof RegExp?s.push(i):t.add(i);return e=>t.has(e)||s.some(t=>t.test(e))}return()=>!1},Ga=(e,t,s)=>{const i=e.inlineDynamicImports;return i&&qt('The "inlineDynamicImports" option is deprecated. Use the "output.inlineDynamicImports" option instead.',!1,t,s),i},Ha=e=>{const t=e.input;return null==t?[]:"string"==typeof t?[t]:t},qa=(e,t,s)=>{const i=e.manualChunks;return i&&qt('The "manualChunks" option is deprecated. Use the "output.manualChunks" option instead.',!1,t,s),i},Ka=(e,t)=>{const s=e.moduleContext;if("function"==typeof s)return e=>{var i;return null!==(i=s(e))&&void 0!==i?i:t};if(s){const e=Object.create(null);for(const t of Object.keys(s))e[De(t)]=s[t];return s=>e[s]||t}return()=>t},Xa=(e,t)=>{const s=e.preserveEntrySignatures;return null==s&&t.add("preserveEntrySignatures"),null!=s?s:"strict"},Ya=(e,t,s)=>{const i=e.preserveModules;return i&&qt('The "preserveModules" option is deprecated. Use the "output.preserveModules" option instead.',!1,t,s),i},Qa=(e,t,s)=>{const i=e.treeshake;return!1!==i&&(i&&!0!==i?(void 0!==i.pureExternalModules&&qt('The "treeshake.pureExternalModules" option is deprecated. The "treeshake.moduleSideEffects" option should be used instead. "treeshake.pureExternalModules: true" is equivalent to "treeshake.moduleSideEffects: \'no-external\'"',!0,t,s),{annotations:!1!==i.annotations,moduleSideEffects:Ja(i.moduleSideEffects,i.pureExternalModules,t),propertyReadSideEffects:!1!==i.propertyReadSideEffects,tryCatchDeoptimization:!1!==i.tryCatchDeoptimization,unknownGlobalSideEffects:!1!==i.unknownGlobalSideEffects}):{annotations:!0,moduleSideEffects:()=>!0,propertyReadSideEffects:!0,tryCatchDeoptimization:!0,unknownGlobalSideEffects:!0})},Ja=(e,t,s)=>{if("boolean"==typeof e)return()=>e;if("no-external"===e)return(e,t)=>!t;if("function"==typeof e)return(t,s)=>!!t.startsWith("\0")||!1!==e(t,s);if(Array.isArray(e)){const t=new Set(e);return e=>t.has(e)}var i,n;e&&s((i="treeshake.moduleSideEffects",n='please use one of false, "no-external", a function or an array',{code:Wt.INVALID_OPTION,message:`Invalid value for option "${i}" - ${n}.`}));const r=ja(t);return(e,t)=>!(t&&r(e))},Za=(e,t,s)=>{const i=e.file;if("string"==typeof i){if(t)return Bt({code:"INVALID_OPTION",message:'You must set "output.dir" instead of "output.file" when using the "output.preserveModules" option.'});if(!Array.isArray(s.input))return Bt({code:"INVALID_OPTION",message:'You must set "output.dir" instead of "output.file" when providing named inputs.'})}return i},eo=e=>{const t=e.format;switch(t){case void 0:case"es":case"esm":case"module":return"es";case"cjs":case"commonjs":return"cjs";case"system":case"systemjs":return"system";case"amd":case"iife":case"umd":return t;default:return Bt({message:'You must specify "output.format", which can be one of "amd", "cjs", "system", "es", "iife" or "umd".',url:"https://rollupjs.org/guide/en/#output-format"})}},to=(e,t)=>{var s;const i=(null!==(s=e.inlineDynamicImports)&&void 0!==s?s:t.inlineDynamicImports)||!1,{input:n}=t;return i&&(Array.isArray(n)?n:Object.keys(n)).length>1?Bt({code:"INVALID_OPTION",message:'Multiple inputs are not supported for "output.inlineDynamicImports".'}):i},so=(e,t,s)=>{var i;const n=(null!==(i=e.preserveModules)&&void 0!==i?i:s.preserveModules)||!1;if(n){if(t)return Bt({code:"INVALID_OPTION",message:'The "output.inlineDynamicImports" option is not supported for "output.preserveModules".'});if(!1===s.preserveEntrySignatures)return Bt({code:"INVALID_OPTION",message:'Setting "preserveEntrySignatures" to "false" is not supported for "output.preserveModules".'})}return n},io=e=>({define:"define",...e.amd}),no=(e,t)=>{const s=e[t];return"function"==typeof s?s:()=>s||""},ro=(e,t)=>{const s=e.dir;return"string"==typeof s&&"string"==typeof t?Bt({code:"INVALID_OPTION",message:'You must set either "output.file" for a single-file build or "output.dir" when generating multiple chunks.'}):s},ao=(e,t)=>{const s=e.dynamicImportFunction;return s&&Ht('The "output.dynamicImportFunction" option is deprecated. Use the "renderDynamicImport" plugin hook instead.',!1,t),s},oo=(e,t)=>{const s=e.entryFileNames;return null==s&&t.add("entryFileNames"),null!=s?s:"[name].js"};function ho(e){const t=e.exports;return t&&!["default","named","none","auto"].includes(t)?Bt((s=t,{code:Wt.INVALID_EXPORT_OPTION,message:`"output.exports" must be "default", "named", "none", "auto", or left unspecified (defaults to "auto"), received "${s}"`,url:"https://rollupjs.org/guide/en/#output-exports"})):t||"auto";var s}const lo=(e,t)=>{if(t)return"";const s=e.indent;return!1===s?"":null==s||s},co=(e,t,s,i)=>{const n=e.manualChunks||i.manualChunks;if(n){if(t)return Bt({code:"INVALID_OPTION",message:'The "output.manualChunks" option is not supported for "output.inlineDynamicImports".'});if(s)return Bt({code:"INVALID_OPTION",message:'The "output.manualChunks" option is not supported for "output.preserveModules".'})}return n||{}},uo=(e,t,s)=>{var i;return null!==(i=e.minifyInternalExports)&&void 0!==i?i:s||"es"===t||"system"===t};function po(e,t){for(let s=0;sfunction(e,t){const s=De(t.dir||Le(t.file),e.fileName);let i,n;if("asset"===e.type)n=e.source;else if(n=e.code,t.sourcemap&&e.map){let r;"inline"===t.sourcemap?r=e.map.toUrl():(r=Te(e.fileName)+".map",i=fa(s+".map",e.map.toString())),"hidden"!==t.sourcemap&&(n+=`//# sourceMappingURL=${r}\n`)}return Promise.all([fa(s,n),i])}(l[e],r))),await a.hookParallel("writeBundle",[r,l])}return c=l,{output:Object.keys(c).map(e=>c[e]).filter(e=>Object.keys(e).length>0).sort((e,t)=>{const s=yo(e),i=yo(t);return s===i?0:st||e,e=>{const t=()=>e.error({code:Wt.CANNOT_EMIT_FROM_OPTIONS_HOOK,message:'Cannot emit files or set asset sources in the "outputOptions" hook, use the "renderStart" hook instead.'});return{...e,emitFile:t,setAssetSource:t}}),e,t)}var go;function yo(e){return"asset"===e.type?go.ASSET:e.isEntry?go.ENTRY_CHUNK:go.SECONDARY_CHUNK}!function(e){e[e.ENTRY_CHUNK=0]="ENTRY_CHUNK",e[e.SECONDARY_CHUNK=1]="SECONDARY_CHUNK",e[e.ASSET=2]="ASSET"}(go||(go={})),e.VERSION="2.18.0",e.rollup=function(e){return async function(e,t){const{options:s,unsetOptions:i}=function(e,t){if(!e)throw new Error("You must supply an options object to rollup");const s=$a(e.plugins),{options:i,unsetOptions:n}=function(e){var t,s;const i=new Set,n=null!==(t=e.context)&&void 0!==t?t:"undefined",r=Fa(e),a=e.strictDeprecations||!1,o={acorn:Wa(e),acornInjectPlugins:Ua(e),cache:za(e),context:n,experimentalCacheExpiry:null!==(s=e.experimentalCacheExpiry)&&void 0!==s?s:10,external:ja(e.external),inlineDynamicImports:Ga(e,r,a),input:Ha(e),manualChunks:qa(e,r,a),moduleContext:Ka(e,n),onwarn:r,perf:e.perf||!1,plugins:$a(e.plugins),preserveEntrySignatures:Xa(e,i),preserveModules:Ya(e,r,a),preserveSymlinks:e.preserveSymlinks||!1,shimMissingExports:e.shimMissingExports||!1,strictDeprecations:a,treeshake:Qa(e,r,a)};return Ba(e,[...Object.keys(o),"watch"],"input options",o.onwarn,/^(output)$/),{options:o,unsetOptions:i}}(s.reduce(function(e){return(t,s)=>s.options&&s.options.call({meta:{rollupVersion:"2.18.0",watchMode:e}},t)||t}(t),e));return po(i.plugins,"at position "),{options:i,unsetOptions:n}}(e,null!==t);ui(s);const n=new Ia(s,t),r=!1!==e.cache;delete s.cache,delete e.cache,oi("BUILD",1);try{await n.pluginDriver.hookParallel("buildStart",[s]),await n.build()}catch(e){const t=Object.keys(n.watchFiles);throw t.length>0&&(e.watchFiles=t),await n.pluginDriver.hookParallel("buildEnd",[e]),e}await n.pluginDriver.hookParallel("buildEnd",[]),hi("BUILD",1);const a={cache:r?n.getCache():void 0,generate:async e=>fo(!1,s,i,e,n),watchFiles:Object.keys(n.watchFiles),write:async e=>fo(!0,s,i,e,n)};return s.perf&&(a.getTimings=ai),a}(e,null)},Object.defineProperty(e,"__esModule",{value:!0})},"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).rollup={}); +var e,t;e=this,t=function(e){for(var t="2.79.1",i={},s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n=0;n>>=5)>0&&(i|=32),t+=s[i]}while(e>0);return t}class o{constructor(e){this.bits=e instanceof o?e.bits.slice():[]}add(e){this.bits[e>>5]|=1<<(31&e)}has(e){return!!(this.bits[e>>5]&1<<(31&e))}}class l{constructor(e,t,i){this.start=e,this.end=t,this.original=i,this.intro="",this.outro="",this.content=i,this.storeName=!1,this.edited=!1,Object.defineProperties(this,{previous:{writable:!0,value:null},next:{writable:!0,value:null}})}appendLeft(e){this.outro+=e}appendRight(e){this.intro=this.intro+e}clone(){const e=new l(this.start,this.end,this.original);return e.intro=this.intro,e.outro=this.outro,e.content=this.content,e.storeName=this.storeName,e.edited=this.edited,e}contains(e){return this.start{throw new Error("Unsupported environment: `window.btoa` or `Buffer` should be supported.")};"undefined"!=typeof window&&"function"==typeof window.btoa?h=e=>window.btoa(unescape(encodeURIComponent(e))):"function"==typeof Buffer&&(h=e=>Buffer.from(e,"utf-8").toString("base64"));class c{constructor(e){this.version=3,this.file=e.file,this.sources=e.sources,this.sourcesContent=e.sourcesContent,this.names=e.names,this.mappings=function(e){for(var t=0,i=0,s=0,n=0,r="",o=0;o0&&(r+=";"),0!==l.length){for(var h=0,c=[],u=0,d=l;u1&&(f+=a(p[1]-t)+a(p[2]-i)+a(p[3]-s),t=p[1],i=p[2],s=p[3]),5===p.length&&(f+=a(p[4]-n),n=p[4]),c.push(f)}r+=c.join(",")}}return r}(e.mappings)}toString(){return JSON.stringify(this)}toUrl(){return"data:application/json;charset=utf-8;base64,"+h(this.toString())}}function u(e){const t=e.split("\n"),i=t.filter((e=>/^\t+/.test(e))),s=t.filter((e=>/^ {2,}/.test(e)));if(0===i.length&&0===s.length)return null;if(i.length>=s.length)return"\t";const n=s.reduce(((e,t)=>{const i=/^ +/.exec(t)[0].length;return Math.min(i,e)}),1/0);return new Array(n+1).join(" ")}function d(e,t){const i=e.split(/[/\\]/),s=t.split(/[/\\]/);for(i.pop();i[0]===s[0];)i.shift(),s.shift();if(i.length){let e=i.length;for(;e--;)i[e]=".."}return i.concat(s).join("/")}const p=Object.prototype.toString;function f(e){return"[object Object]"===p.call(e)}function m(e){const t=e.split("\n"),i=[];for(let e=0,s=0;e>1;e=0&&t.push(s),this.rawSegments.push(t)}else this.pending&&this.rawSegments.push(this.pending);this.advance(t),this.pending=null}addUneditedChunk(e,t,i,s,n){let r=t.start,a=!0;for(;r1){for(let e=0;e{const n=s(e.start);e.intro.length&&i.advance(e.intro),e.edited?i.addEdit(0,e.content,n,e.storeName?t.indexOf(e.original):-1):i.addUneditedChunk(0,e,this.original,n,this.sourcemapLocations),e.outro.length&&i.advance(e.outro)})),{file:e.file?e.file.split(/[/\\]/).pop():null,sources:[e.source?d(e.file||"",e.source):null],sourcesContent:e.includeContent?[this.original]:[null],names:t,mappings:i.raw}}generateMap(e){return new c(this.generateDecodedMap(e))}getIndentString(){return null===this.indentStr?"\t":this.indentStr}indent(e,t){const i=/^[^\r\n]/gm;if(f(e)&&(t=e,e=void 0),""===(e=void 0!==e?e:this.indentStr||"\t"))return this;const s={};(t=t||{}).exclude&&("number"==typeof t.exclude[0]?[t.exclude]:t.exclude).forEach((e=>{for(let t=e[0];tn?`${e}${t}`:(n=!0,t);this.intro=this.intro.replace(i,r);let a=0,o=this.firstChunk;for(;o;){const t=o.end;if(o.edited)s[a]||(o.content=o.content.replace(i,r),o.content.length&&(n="\n"===o.content[o.content.length-1]));else for(a=o.start;a=e&&i<=t)throw new Error("Cannot move a selection inside itself");this._split(e),this._split(t),this._split(i);const s=this.byStart[e],n=this.byEnd[t],r=s.previous,a=n.next,o=this.byStart[i];if(!o&&n===this.lastChunk)return this;const l=o?o.previous:this.lastChunk;return r&&(r.next=a),a&&(a.previous=r),l&&(l.next=s),o&&(o.previous=n),s.previous||(this.firstChunk=n.next),n.next||(this.lastChunk=s.previous,this.lastChunk.next=null),s.previous=l,n.next=o||null,l||(this.firstChunk=s),o||(this.lastChunk=n),this}overwrite(e,t,i,s){if("string"!=typeof i)throw new TypeError("replacement content must be a string");for(;e<0;)e+=this.original.length;for(;t<0;)t+=this.original.length;if(t>this.original.length)throw new Error("end is out of bounds");if(e===t)throw new Error("Cannot overwrite a zero-length range – use appendLeft or prependRight instead");this._split(e),this._split(t),!0===s&&(x.storeName||(console.warn("The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string"),x.storeName=!0),s={storeName:!0});const n=void 0!==s&&s.storeName,r=void 0!==s&&s.contentOnly;if(n){const i=this.original.slice(e,t);Object.defineProperty(this.storedNames,i,{writable:!0,value:!0,enumerable:!0})}const a=this.byStart[e],o=this.byEnd[t];if(a){let e=a;for(;e!==o;){if(e.next!==this.byStart[e.end])throw new Error("Cannot overwrite across a split point");e=e.next,e.edit("",!1)}a.edit(i,n,r)}else{const s=new l(e,t,"").edit(i,n);o.next=s,s.previous=o}return this}prepend(e){if("string"!=typeof e)throw new TypeError("outro content must be a string");return this.intro=e+this.intro,this}prependLeft(e,t){if("string"!=typeof t)throw new TypeError("inserted content must be a string");this._split(e);const i=this.byEnd[e];return i?i.prependLeft(t):this.intro=t+this.intro,this}prependRight(e,t){if("string"!=typeof t)throw new TypeError("inserted content must be a string");this._split(e);const i=this.byStart[e];return i?i.prependRight(t):this.outro=t+this.outro,this}remove(e,t){for(;e<0;)e+=this.original.length;for(;t<0;)t+=this.original.length;if(e===t)return this;if(e<0||t>this.original.length)throw new Error("Character is out of bounds");if(e>t)throw new Error("end must be greater than start");this._split(e),this._split(t);let i=this.byStart[e];for(;i;)i.intro="",i.outro="",i.edit(""),i=t>i.end?this.byStart[i.end]:null;return this}lastChar(){if(this.outro.length)return this.outro[this.outro.length-1];let e=this.lastChunk;do{if(e.outro.length)return e.outro[e.outro.length-1];if(e.content.length)return e.content[e.content.length-1];if(e.intro.length)return e.intro[e.intro.length-1]}while(e=e.previous);return this.intro.length?this.intro[this.intro.length-1]:""}lastLine(){let e=this.outro.lastIndexOf(y);if(-1!==e)return this.outro.substr(e+1);let t=this.outro,i=this.lastChunk;do{if(i.outro.length>0){if(e=i.outro.lastIndexOf(y),-1!==e)return i.outro.substr(e+1)+t;t=i.outro+t}if(i.content.length>0){if(e=i.content.lastIndexOf(y),-1!==e)return i.content.substr(e+1)+t;t=i.content+t}if(i.intro.length>0){if(e=i.intro.lastIndexOf(y),-1!==e)return i.intro.substr(e+1)+t;t=i.intro+t}}while(i=i.previous);return e=this.intro.lastIndexOf(y),-1!==e?this.intro.substr(e+1)+t:this.intro+t}slice(e=0,t=this.original.length){for(;e<0;)e+=this.original.length;for(;t<0;)t+=this.original.length;let i="",s=this.firstChunk;for(;s&&(s.start>e||s.end<=e);){if(s.start=t)return i;s=s.next}if(s&&s.edited&&s.start!==e)throw new Error(`Cannot use replaced character ${e} as slice start anchor.`);const n=s;for(;s;){!s.intro||n===s&&s.start!==e||(i+=s.intro);const r=s.start=t;if(r&&s.edited&&s.end!==t)throw new Error(`Cannot use replaced character ${t} as slice end anchor.`);const a=n===s?e-s.start:0,o=r?s.content.length+t-s.end:s.content.length;if(i+=s.content.slice(a,o),!s.outro||r&&s.end!==t||(i+=s.outro),r)break;s=s.next}return i}snip(e,t){const i=this.clone();return i.remove(0,e),i.remove(t,i.original.length),i}_split(e){if(this.byStart[e]||this.byEnd[e])return;let t=this.lastSearchedChunk;const i=e>t.end;for(;t;){if(t.contains(e))return this._splitChunk(t,e);t=i?this.byStart[t.end]:this.byEnd[t.start]}}_splitChunk(e,t){if(e.edited&&e.content.length){const i=m(this.original)(t);throw new Error(`Cannot split a chunk that has already been edited (${i.line}:${i.column} – "${e.original}")`)}const i=e.split(t);return this.byEnd[t]=e,this.byStart[t]=i,this.byEnd[i.end]=i,e===this.lastChunk&&(this.lastChunk=i),this.lastSearchedChunk=e,!0}toString(){let e=this.intro,t=this.firstChunk;for(;t;)e+=t.toString(),t=t.next;return e+this.outro}isEmpty(){let e=this.firstChunk;do{if(e.intro.length&&e.intro.trim()||e.content.length&&e.content.trim()||e.outro.length&&e.outro.trim())return!1}while(e=e.next);return!0}length(){let e=this.firstChunk,t=0;do{t+=e.intro.length+e.content.length+e.outro.length}while(e=e.next);return t}trimLines(){return this.trim("[\\r\\n]")}trim(e){return this.trimStart(e).trimEnd(e)}trimEndAborted(e){const t=new RegExp((e||"\\s")+"+$");if(this.outro=this.outro.replace(t,""),this.outro.length)return!0;let i=this.lastChunk;do{const e=i.end,s=i.trimEnd(t);if(i.end!==e&&(this.lastChunk===i&&(this.lastChunk=i.next),this.byEnd[i.end]=i,this.byStart[i.next.start]=i.next,this.byEnd[i.next.end]=i.next),s)return!0;i=i.previous}while(i);return!1}trimEnd(e){return this.trimEndAborted(e),this}trimStartAborted(e){const t=new RegExp("^"+(e||"\\s")+"+");if(this.intro=this.intro.replace(t,""),this.intro.length)return!0;let i=this.firstChunk;do{const e=i.end,s=i.trimStart(t);if(i.end!==e&&(i===this.lastChunk&&(this.lastChunk=i.next),this.byEnd[i.end]=i,this.byStart[i.next.start]=i.next,this.byEnd[i.next.end]=i.next),s)return!0;i=i.next}while(i);return!1}trimStart(e){return this.trimStartAborted(e),this}hasChanged(){return this.original!==this.toString()}replace(e,t){function i(e,i){return"string"==typeof t?t.replace(/\$(\$|&|\d+)/g,((t,i)=>"$"===i?"$":"&"===i?e[0]:+i{null!=e.index&&this.overwrite(e.index,e.index+e[0].length,i(e,this.original))}));else{const t=this.original.match(e);t&&null!=t.index&&this.overwrite(t.index,t.index+t[0].length,i(t,this.original))}return this}}const b=Object.prototype.hasOwnProperty;class v{constructor(e={}){this.intro=e.intro||"",this.separator=void 0!==e.separator?e.separator:"\n",this.sources=[],this.uniqueSources=[],this.uniqueSourceIndexByFilename={}}addSource(e){if(e instanceof E)return this.addSource({content:e,filename:e.filename,separator:this.separator});if(!f(e)||!e.content)throw new Error("bundle.addSource() takes an object with a `content` property, which should be an instance of MagicString, and an optional `filename`");if(["filename","indentExclusionRanges","separator"].forEach((t=>{b.call(e,t)||(e[t]=e.content[t])})),void 0===e.separator&&(e.separator=this.separator),e.filename)if(b.call(this.uniqueSourceIndexByFilename,e.filename)){const t=this.uniqueSources[this.uniqueSourceIndexByFilename[e.filename]];if(e.content.original!==t.content)throw new Error(`Illegal source: same filename (${e.filename}), different contents`)}else this.uniqueSourceIndexByFilename[e.filename]=this.uniqueSources.length,this.uniqueSources.push({filename:e.filename,content:e.content.original});return this.sources.push(e),this}append(e,t){return this.addSource({content:new E(e),separator:t&&t.separator||""}),this}clone(){const e=new v({intro:this.intro,separator:this.separator});return this.sources.forEach((t=>{e.addSource({filename:t.filename,content:t.content.clone(),separator:t.separator})})),e}generateDecodedMap(e={}){const t=[];this.sources.forEach((e=>{Object.keys(e.content.storedNames).forEach((e=>{~t.indexOf(e)||t.push(e)}))}));const i=new g(e.hires);return this.intro&&i.advance(this.intro),this.sources.forEach(((e,s)=>{s>0&&i.advance(this.separator);const n=e.filename?this.uniqueSourceIndexByFilename[e.filename]:-1,r=e.content,a=m(r.original);r.intro&&i.advance(r.intro),r.firstChunk.eachNext((s=>{const o=a(s.start);s.intro.length&&i.advance(s.intro),e.filename?s.edited?i.addEdit(n,s.content,o,s.storeName?t.indexOf(s.original):-1):i.addUneditedChunk(n,s,r.original,o,r.sourcemapLocations):i.advance(s.content),s.outro.length&&i.advance(s.outro)})),r.outro&&i.advance(r.outro)})),{file:e.file?e.file.split(/[/\\]/).pop():null,sources:this.uniqueSources.map((t=>e.file?d(e.file,t.filename):t.filename)),sourcesContent:this.uniqueSources.map((t=>e.includeContent?t.content:null)),names:t,mappings:i.raw}}generateMap(e){return new c(this.generateDecodedMap(e))}getIndentString(){const e={};return this.sources.forEach((t=>{const i=t.content.indentStr;null!==i&&(e[i]||(e[i]=0),e[i]+=1)})),Object.keys(e).sort(((t,i)=>e[t]-e[i]))[0]||"\t"}indent(e){if(arguments.length||(e=this.getIndentString()),""===e)return this;let t=!this.intro||"\n"===this.intro.slice(-1);return this.sources.forEach(((i,s)=>{const n=void 0!==i.separator?i.separator:this.separator,r=t||s>0&&/\r?\n$/.test(n);i.content.indent(e,{exclude:i.indentExclusionRanges,indentStart:r}),t="\n"===i.content.lastChar()})),this.intro&&(this.intro=e+this.intro.replace(/^[^\n]/gm,((t,i)=>i>0?e+t:t))),this}prepend(e){return this.intro=e+this.intro,this}toString(){const e=this.sources.map(((e,t)=>{const i=void 0!==e.separator?e.separator:this.separator;return(t>0?i:"")+e.content.toString()})).join("");return this.intro+e}isEmpty(){return!(this.intro.length&&this.intro.trim()||this.sources.some((e=>!e.content.isEmpty())))}length(){return this.sources.reduce(((e,t)=>e+t.content.length()),this.intro.length)}trimLines(){return this.trim("[\\r\\n]")}trim(e){return this.trimStart(e).trimEnd(e)}trimStart(e){const t=new RegExp("^"+(e||"\\s")+"+");if(this.intro=this.intro.replace(t,""),!this.intro){let t,i=0;do{if(t=this.sources[i++],!t)break}while(!t.content.trimStartAborted(e))}return this}trimEnd(e){const t=new RegExp((e||"\\s")+"+$");let i,s=this.sources.length-1;do{if(i=this.sources[s--],!i){this.intro=this.intro.replace(t,"");break}}while(!i.content.trimEndAborted(e));return this}}const S=/^(?:\/|(?:[A-Za-z]:)?[\\|/])/,A=/^\.?\.\//,I=/\\/g,P=/[/\\]/,k=/\.[^.]+$/;function w(e){return S.test(e)}function C(e){return A.test(e)}function N(e){return e.replace(I,"/")}function _(e){return e.split(P).pop()||""}function $(e){const t=/[/\\][^/\\]*$/.exec(e);if(!t)return".";const i=e.slice(0,-t[0].length);return i||"/"}function T(e){const t=k.exec(_(e));return t?t[0]:""}function O(e,t){const i=e.split(P).filter(Boolean),s=t.split(P).filter(Boolean);for("."===i[0]&&i.shift(),"."===s[0]&&s.shift();i[0]&&s[0]&&i[0]===s[0];)i.shift(),s.shift();for(;".."===s[0]&&i.length>0;)s.shift(),i.pop();for(;i.pop();)s.unshift("..");return s.join("/")}function M(...e){const t=e.shift();if(!t)return"/";let i=t.split(P);for(const t of e)if(w(t))i=t.split(P);else{const e=t.split(P);for(;"."===e[0]||".."===e[0];)".."===e.shift()&&i.pop();i.push(...e)}return i.join("/")}function R(e,t,i){const s=e.get(t);if(s)return s;const n=i();return e.set(t,n),n}const D=Symbol("Unknown Key"),L=Symbol("Unknown Non-Accessor Key"),V=Symbol("Unknown Integer"),B=[],F=[D],z=[L],j=[V],U=Symbol("Entities");class G{constructor(){this.entityPaths=Object.create(null,{[U]:{value:new Set}})}trackEntityAtPathAndGetIfTracked(e,t){const i=this.getEntities(e);return!!i.has(t)||(i.add(t),!1)}withTrackedEntityAtPath(e,t,i,s){const n=this.getEntities(e);if(n.has(t))return s;n.add(t);const r=i();return n.delete(t),r}getEntities(e){let t=this.entityPaths;for(const i of e)t=t[i]=t[i]||Object.create(null,{[U]:{value:new Set}});return t[U]}}const H=new G;class W{constructor(){this.entityPaths=Object.create(null,{[U]:{value:new Map}})}trackEntityAtPathAndGetIfTracked(e,t,i){let s=this.entityPaths;for(const t of e)s=s[t]=s[t]||Object.create(null,{[U]:{value:new Map}});const n=R(s[U],t,(()=>new Set));return!!n.has(i)||(n.add(i),!1)}}const q=Symbol("Unknown Value"),K=Symbol("Unknown Truthy Value");class X{constructor(){this.included=!1}deoptimizePath(e){}deoptimizeThisOnInteractionAtPath({thisArg:e},t,i){e.deoptimizePath(F)}getLiteralValueAtPath(e,t,i){return q}getReturnExpressionWhenCalledAtPath(e,t,i,s){return Y}hasEffectsOnInteractionAtPath(e,t,i){return!0}include(e,t,i){this.included=!0}includeCallArguments(e,t){for(const i of t)i.include(e,!1)}shouldBeIncluded(e){return!0}}const Y=new class extends X{},Q={thisArg:null,type:0},J={args:[Y],thisArg:null,type:1},Z=[],ee={args:Z,thisArg:null,type:2,withNew:!1};class te extends X{constructor(e){super(),this.name=e,this.alwaysRendered=!1,this.initReached=!1,this.isId=!1,this.isReassigned=!1,this.kind=null,this.renderBaseName=null,this.renderName=null}addReference(e){}getBaseVariableName(){return this.renderBaseName||this.renderName||this.name}getName(e){const t=this.renderName||this.name;return this.renderBaseName?`${this.renderBaseName}${e(t)}`:t}hasEffectsOnInteractionAtPath(e,{type:t},i){return 0!==t||e.length>0}include(){this.included=!0}markCalledFromTryStatement(){}setRenderNames(e,t){this.renderBaseName=e,this.renderName=t}}class ie extends te{constructor(e,t){super(t),this.referenced=!1,this.module=e,this.isNamespace="*"===t}addReference(e){this.referenced=!0,"default"!==this.name&&"*"!==this.name||this.module.suggestName(e.name)}hasEffectsOnInteractionAtPath(e,{type:t}){return 0!==t||e.length>(this.isNamespace?1:0)}include(){this.included||(this.included=!0,this.module.used=!0)}}const se=Object.freeze(Object.create(null)),ne=Object.freeze({}),re=Object.freeze([]);function ae(e,t,i){if("number"==typeof i)throw new Error("locate takes a { startIndex, offsetLine, offsetColumn } object as the third argument");return function(e,t){void 0===t&&(t={});var i=t.offsetLine||0,s=t.offsetColumn||0,n=e.split("\n"),r=0,a=n.map((function(e,t){var i=r+e.length+1,s={start:r,end:i,line:t};return r=i,s})),o=0;function l(e,t){return e.start<=t&&t=s.end?1:-1;s;){if(l(s,t))return h(s,t);s=a[o+=n]}}}(e,i)(t,i&&i.startIndex)}function oe(e){return e.replace(/^\t+/,(e=>e.split("\t").join(" ")))}function le(e,t){const i=e.length<=1,s=e.map((e=>`"${e}"`));let n=i?s[0]:`${s.slice(0,-1).join(", ")} and ${s.slice(-1)[0]}`;return t&&(n+=` ${i?t[0]:t[1]}`),n}function he(e){const t=_(e);return t.substring(0,t.length-T(e).length)}function ce(e){return w(e)?O(M(),e):e}function ue(e){return"/"===e[0]||"."===e[0]&&("/"===e[1]||"."===e[1])||w(e)}const de=/^(\.\.\/)*\.\.$/;function pe(e,t,i,s){let n=N(O($(e),t));if(i&&n.endsWith(".js")&&(n=n.slice(0,-3)),s){if(""===n)return"../"+_(t);if(de.test(n))return n.split("/").concat(["..",_(t)]).join("/")}return n?n.startsWith("..")?n:"./"+n:"."}function fe(e){throw e instanceof Error||(e=Object.assign(new Error(e.message),e)),e}function me(e,t,i,s){if("object"==typeof t){const{line:i,column:n}=t;e.loc={column:n,file:s,line:i}}else{e.pos=t;const{line:n,column:r}=ae(i,t,{offsetLine:1});e.loc={column:r,file:s,line:n}}if(void 0===e.frame){const{line:t,column:s}=e.loc;e.frame=function(e,t,i){let s=e.split("\n");const n=Math.max(0,t-3);let r=Math.min(t+2,s.length);for(s=s.slice(n,r);!/\S/.test(s[s.length-1]);)s.pop(),r-=1;const a=String(r).length;return s.map(((e,s)=>{const r=n+s+1===t;let o=String(s+n+1);for(;o.lengthce(e.id))).sort();return{code:ge.MISSING_IMPLICIT_DEPENDANT,message:`Module "${ce(e.id)}" that should be implicitly loaded before ${le(t)} is not included in the module graph. Either it was not imported by an included module or only via a tree-shaken dynamic import, or no imported bindings were used and it had otherwise no side-effects.`}}function Se(e,t,i){const s=i?"reexport":"import";return{code:ge.UNEXPECTED_NAMED_IMPORT,id:e,message:`The named export "${t}" was ${s}ed from the external module ${ce(e)} even though its interop type is "defaultOnly". Either remove or change this ${s} or change the value of the "output.interop" option.`,url:"https://rollupjs.org/guide/en/#outputinterop"}}function Ae(e){return{code:ge.UNEXPECTED_NAMED_IMPORT,id:e,message:`There was a namespace "*" reexport from the external module ${ce(e)} even though its interop type is "defaultOnly". This will be ignored as namespace reexports only reexport named exports. If this is not intended, either remove or change this reexport or change the value of the "output.interop" option.`,url:"https://rollupjs.org/guide/en/#outputinterop"}}function Ie(e){return{code:ge.VALIDATION_ERROR,message:e}}function Pe(){return{code:ge.ALREADY_CLOSED,message:'Bundle is already closed, no more calls to "generate" or "write" are allowed.'}}function ke(e,t,i){we(e,t,i.onwarn,i.strictDeprecations)}function we(e,t,i,s){if(t||s){const t=function(e){return{code:ge.DEPRECATED_FEATURE,..."string"==typeof e?{message:e}:e}}(e);if(s)return fe(t);i(t)}}!function(e){e.ALREADY_CLOSED="ALREADY_CLOSED",e.ASSET_NOT_FINALISED="ASSET_NOT_FINALISED",e.ASSET_NOT_FOUND="ASSET_NOT_FOUND",e.ASSET_SOURCE_ALREADY_SET="ASSET_SOURCE_ALREADY_SET",e.ASSET_SOURCE_MISSING="ASSET_SOURCE_MISSING",e.BAD_LOADER="BAD_LOADER",e.CANNOT_EMIT_FROM_OPTIONS_HOOK="CANNOT_EMIT_FROM_OPTIONS_HOOK",e.CHUNK_NOT_GENERATED="CHUNK_NOT_GENERATED",e.CHUNK_INVALID="CHUNK_INVALID",e.CIRCULAR_REEXPORT="CIRCULAR_REEXPORT",e.CYCLIC_CROSS_CHUNK_REEXPORT="CYCLIC_CROSS_CHUNK_REEXPORT",e.DEPRECATED_FEATURE="DEPRECATED_FEATURE",e.EXTERNAL_SYNTHETIC_EXPORTS="EXTERNAL_SYNTHETIC_EXPORTS",e.FILE_NAME_CONFLICT="FILE_NAME_CONFLICT",e.FILE_NOT_FOUND="FILE_NOT_FOUND",e.INPUT_HOOK_IN_OUTPUT_PLUGIN="INPUT_HOOK_IN_OUTPUT_PLUGIN",e.INVALID_CHUNK="INVALID_CHUNK",e.INVALID_EXPORT_OPTION="INVALID_EXPORT_OPTION",e.INVALID_EXTERNAL_ID="INVALID_EXTERNAL_ID",e.INVALID_OPTION="INVALID_OPTION",e.INVALID_PLUGIN_HOOK="INVALID_PLUGIN_HOOK",e.INVALID_ROLLUP_PHASE="INVALID_ROLLUP_PHASE",e.MISSING_EXPORT="MISSING_EXPORT",e.MISSING_IMPLICIT_DEPENDANT="MISSING_IMPLICIT_DEPENDANT",e.MIXED_EXPORTS="MIXED_EXPORTS",e.NAMESPACE_CONFLICT="NAMESPACE_CONFLICT",e.AMBIGUOUS_EXTERNAL_NAMESPACES="AMBIGUOUS_EXTERNAL_NAMESPACES",e.NO_TRANSFORM_MAP_OR_AST_WITHOUT_CODE="NO_TRANSFORM_MAP_OR_AST_WITHOUT_CODE",e.PLUGIN_ERROR="PLUGIN_ERROR",e.PREFER_NAMED_EXPORTS="PREFER_NAMED_EXPORTS",e.SYNTHETIC_NAMED_EXPORTS_NEED_NAMESPACE_EXPORT="SYNTHETIC_NAMED_EXPORTS_NEED_NAMESPACE_EXPORT",e.UNEXPECTED_NAMED_IMPORT="UNEXPECTED_NAMED_IMPORT",e.UNRESOLVED_ENTRY="UNRESOLVED_ENTRY",e.UNRESOLVED_IMPORT="UNRESOLVED_IMPORT",e.VALIDATION_ERROR="VALIDATION_ERROR"}(ge||(ge={}));var Ce=new Set(["await","break","case","catch","class","const","continue","debugger","default","delete","do","else","enum","eval","export","extends","false","finally","for","function","if","implements","import","in","instanceof","interface","let","NaN","new","null","package","private","protected","public","return","static","super","switch","this","throw","true","try","typeof","undefined","var","void","while","with","yield"]);const Ne=/[^$_a-zA-Z0-9]/g,_e=e=>(e=>/\d/.test(e[0]))(e)||Ce.has(e)||"arguments"===e;function $e(e){return e=e.replace(/-(\w)/g,((e,t)=>t.toUpperCase())).replace(Ne,"_"),_e(e)&&(e=`_${e}`),e||"_"}class Te{constructor(e,t,i,s,n){this.options=e,this.id=t,this.renormalizeRenderPath=n,this.declarations=new Map,this.defaultVariableName="",this.dynamicImporters=[],this.execIndex=1/0,this.exportedVariables=new Map,this.importers=[],this.mostCommonSuggestion=0,this.nameSuggestions=new Map,this.namespaceVariableName="",this.reexported=!1,this.renderPath=void 0,this.used=!1,this.variableName="",this.suggestedVariableName=$e(t.split(/[\\/]/).pop());const{importers:r,dynamicImporters:a}=this,o=this.info={ast:null,code:null,dynamicallyImportedIdResolutions:re,dynamicallyImportedIds:re,get dynamicImporters(){return a.sort()},hasDefaultExport:null,get hasModuleSideEffects(){return ke("Accessing ModuleInfo.hasModuleSideEffects from plugins is deprecated. Please use ModuleInfo.moduleSideEffects instead.",!1,e),o.moduleSideEffects},id:t,implicitlyLoadedAfterOneOf:re,implicitlyLoadedBefore:re,importedIdResolutions:re,importedIds:re,get importers(){return r.sort()},isEntry:!1,isExternal:!0,isIncluded:null,meta:s,moduleSideEffects:i,syntheticNamedExports:!1};Object.defineProperty(this.info,"hasModuleSideEffects",{enumerable:!1})}getVariableForExportName(e){const t=this.declarations.get(e);if(t)return[t];const i=new ie(this,e);return this.declarations.set(e,i),this.exportedVariables.set(i,e),[i]}setRenderPath(e,t){this.renderPath="function"==typeof e.paths?e.paths(this.id):e.paths[this.id],this.renderPath||(this.renderPath=this.renormalizeRenderPath?N(O(t,this.id)):this.id)}suggestName(e){var t;const i=(null!==(t=this.nameSuggestions.get(e))&&void 0!==t?t:0)+1;this.nameSuggestions.set(e,i),i>this.mostCommonSuggestion&&(this.mostCommonSuggestion=i,this.suggestedVariableName=e)}warnUnusedImports(){const e=Array.from(this.declarations).filter((([e,t])=>"*"!==e&&!t.included&&!this.reexported&&!t.referenced)).map((([e])=>e));if(0===e.length)return;const t=new Set;for(const i of e)for(const e of this.declarations.get(i).module.importers)t.add(e);const i=[...t];this.options.onwarn({code:"UNUSED_EXTERNAL_IMPORT",message:`${le(e,["is","are"])} imported from external module "${this.id}" but never used in ${le(i.map((e=>ce(e))))}.`,names:e,source:this.id,sources:i})}}const Oe={ArrayPattern(e,t){for(const i of t.elements)i&&Oe[i.type](e,i)},AssignmentPattern(e,t){Oe[t.left.type](e,t.left)},Identifier(e,t){e.push(t.name)},MemberExpression(){},ObjectPattern(e,t){for(const i of t.properties)"RestElement"===i.type?Oe.RestElement(e,i):Oe[i.value.type](e,i.value)},RestElement(e,t){Oe[t.argument.type](e,t.argument)}},Me=function(e){const t=[];return Oe[e.type](t,e),t};function Re(){return{brokenFlow:0,includedCallArguments:new Set,includedLabels:new Set}}function De(){return{accessed:new G,assigned:new G,brokenFlow:0,called:new W,ignore:{breaks:!1,continues:!1,labels:new Set,returnYield:!1},includedLabels:new Set,instantiated:new W,replacedVariableInits:new Map}}function Le(e,t=null){return Object.create(t,e)}new Set("break case class catch const continue debugger default delete do else export extends finally for function if import in instanceof let new return super switch this throw try typeof var void while with yield enum await implements package protected static interface private public arguments Infinity NaN undefined null true false eval uneval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Symbol Error EvalError InternalError RangeError ReferenceError SyntaxError TypeError URIError Number Math Date String RegExp Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array Map Set WeakMap WeakSet SIMD ArrayBuffer DataView JSON Promise Generator GeneratorFunction Reflect Proxy Intl".split(" ")).add("");const Ve=new class extends X{getLiteralValueAtPath(){}},Be={value:{hasEffectsWhenCalled:null,returns:Y}},Fe=new class extends X{getReturnExpressionWhenCalledAtPath(e){return 1===e.length?Je(Ke,e[0]):Y}hasEffectsOnInteractionAtPath(e,t,i){return 0===t.type?e.length>1:2!==t.type||1!==e.length||Qe(Ke,e[0],t,i)}},ze={value:{hasEffectsWhenCalled:null,returns:Fe}},je=new class extends X{getReturnExpressionWhenCalledAtPath(e){return 1===e.length?Je(Xe,e[0]):Y}hasEffectsOnInteractionAtPath(e,t,i){return 0===t.type?e.length>1:2!==t.type||1!==e.length||Qe(Xe,e[0],t,i)}},Ue={value:{hasEffectsWhenCalled:null,returns:je}},Ge=new class extends X{getReturnExpressionWhenCalledAtPath(e){return 1===e.length?Je(Ye,e[0]):Y}hasEffectsOnInteractionAtPath(e,t,i){return 0===t.type?e.length>1:2!==t.type||1!==e.length||Qe(Ye,e[0],t,i)}},He={value:{hasEffectsWhenCalled:null,returns:Ge}},We={value:{hasEffectsWhenCalled({args:e},t){const i=e[1];return e.length<2||"symbol"==typeof i.getLiteralValueAtPath(B,H,{deoptimizeCache(){}})&&i.hasEffectsOnInteractionAtPath(B,ee,t)},returns:Ge}},qe=Le({hasOwnProperty:ze,isPrototypeOf:ze,propertyIsEnumerable:ze,toLocaleString:He,toString:He,valueOf:Be}),Ke=Le({valueOf:ze},qe),Xe=Le({toExponential:He,toFixed:He,toLocaleString:He,toPrecision:He,valueOf:Ue},qe),Ye=Le({anchor:He,at:Be,big:He,blink:He,bold:He,charAt:He,charCodeAt:Ue,codePointAt:Be,concat:He,endsWith:ze,fixed:He,fontcolor:He,fontsize:He,includes:ze,indexOf:Ue,italics:He,lastIndexOf:Ue,link:He,localeCompare:Ue,match:Be,matchAll:Be,normalize:He,padEnd:He,padStart:He,repeat:He,replace:We,replaceAll:We,search:Ue,slice:He,small:He,split:Be,startsWith:ze,strike:He,sub:He,substr:He,substring:He,sup:He,toLocaleLowerCase:He,toLocaleUpperCase:He,toLowerCase:He,toString:He,toUpperCase:He,trim:He,trimEnd:He,trimLeft:He,trimRight:He,trimStart:He,valueOf:He},qe);function Qe(e,t,i,s){var n,r;return"string"!=typeof t||!e[t]||(null===(r=(n=e[t]).hasEffectsWhenCalled)||void 0===r?void 0:r.call(n,i,s))||!1}function Je(e,t){return"string"==typeof t&&e[t]?e[t].returns:Y}function Ze(e,t,i){i(e,t)}function et(e,t,i){}var tt={};tt.Program=tt.BlockStatement=tt.StaticBlock=function(e,t,i){for(var s=0,n=e.body;s=n.end;)mt(e,n,t.code),n=s[++t.annotationIndex];if(n&&n.end<=e.end)for(tt[i](e,t,dt);(n=s[t.annotationIndex])&&n.end<=e.end;)++t.annotationIndex,xt(e,n,!1)}const pt=/[^\s(]/g,ft=/\S/g;function mt(e,t,i){const s=[];let n;if(gt(i.slice(t.end,e.start),pt)){const t=e.start;for(;;){switch(s.push(e),e.type){case rt:case"ChainExpression":e=e.expression;continue;case"SequenceExpression":if(gt(i.slice(t,e.start),ft)){e=e.expressions[0];continue}n=!0;break;case"ConditionalExpression":if(gt(i.slice(t,e.start),ft)){e=e.test;continue}n=!0;break;case"LogicalExpression":case"BinaryExpression":if(gt(i.slice(t,e.start),ft)){e=e.left;continue}n=!0;break;case nt:case"NewExpression":break;default:n=!0}break}}else n=!0;if(n)xt(e,t,!1);else for(const e of s)xt(e,t,!0)}function gt(e,t){let i;for(;null!==(i=t.exec(e));){if("/"===i[0]){const i=e.charCodeAt(t.lastIndex);if(42===i){t.lastIndex=e.indexOf("*/",t.lastIndex+1)+2;continue}if(47===i){t.lastIndex=e.indexOf("\n",t.lastIndex+1)+1;continue}}return t.lastIndex=0,!1}return!0}const yt=/[@#]__PURE__/;function xt(e,t,i){const s=i?ct:ut,n=e[s];n?n.push(t):e[s]=[t]}const Et={Literal:[],Program:["body"]},bt="variables";class vt extends X{constructor(e,t,i){super(),this.deoptimized=!1,this.esTreeNode=e,this.keys=Et[e.type]||function(e){return Et[e.type]=Object.keys(e).filter((t=>"object"==typeof e[t]&&95!==t.charCodeAt(0))),Et[e.type]}(e),this.parent=t,this.context=t.context,this.createScope(i),this.parseNode(e),this.initialise(),this.context.magicString.addSourcemapLocation(this.start),this.context.magicString.addSourcemapLocation(this.end)}addExportedVariables(e,t){}bind(){for(const e of this.keys){const t=this[e];if(null!==t)if(Array.isArray(t))for(const e of t)null==e||e.bind();else t.bind()}}createScope(e){this.scope=e}hasEffects(e){this.deoptimized||this.applyDeoptimizations();for(const t of this.keys){const i=this[t];if(null!==i)if(Array.isArray(i)){for(const t of i)if(null==t?void 0:t.hasEffects(e))return!0}else if(i.hasEffects(e))return!0}return!1}hasEffectsAsAssignmentTarget(e,t){return this.hasEffects(e)||this.hasEffectsOnInteractionAtPath(B,this.assignmentInteraction,e)}include(e,t,i){this.deoptimized||this.applyDeoptimizations(),this.included=!0;for(const i of this.keys){const s=this[i];if(null!==s)if(Array.isArray(s))for(const i of s)null==i||i.include(e,t);else s.include(e,t)}}includeAsAssignmentTarget(e,t,i){this.include(e,t)}initialise(){}insertSemicolon(e){";"!==e.original[this.end-1]&&e.appendLeft(this.end,";")}parseNode(e){for(const[t,i]of Object.entries(e))if(!this.hasOwnProperty(t))if(95===t.charCodeAt(0)){if(t===ct)this.annotations=i;else if(t===ut)for(const{start:e,end:t}of i)this.context.magicString.remove(e,t)}else if("object"!=typeof i||null===i)this[t]=i;else if(Array.isArray(i)){this[t]=[];for(const e of i)this[t].push(null===e?null:new(this.context.getNodeConstructor(e.type))(e,this,this.scope))}else this[t]=new(this.context.getNodeConstructor(i.type))(i,this,this.scope)}render(e,t){for(const i of this.keys){const s=this[i];if(null!==s)if(Array.isArray(s))for(const i of s)null==i||i.render(e,t);else s.render(e,t)}}setAssignedValue(e){this.assignmentInteraction={args:[e],thisArg:null,type:1}}shouldBeIncluded(e){return this.included||!e.brokenFlow&&this.hasEffects(De())}applyDeoptimizations(){this.deoptimized=!0;for(const e of this.keys){const t=this[e];if(null!==t)if(Array.isArray(t))for(const e of t)null==e||e.deoptimizePath(F);else t.deoptimizePath(F)}this.context.requestTreeshakingPass()}}class St extends vt{deoptimizeThisOnInteractionAtPath(e,t,i){t.length>0&&this.argument.deoptimizeThisOnInteractionAtPath(e,[D,...t],i)}hasEffects(e){this.deoptimized||this.applyDeoptimizations();const{propertyReadSideEffects:t}=this.context.options.treeshake;return this.argument.hasEffects(e)||t&&("always"===t||this.argument.hasEffectsOnInteractionAtPath(F,Q,e))}applyDeoptimizations(){this.deoptimized=!0,this.argument.deoptimizePath([D,D]),this.context.requestTreeshakingPass()}}class At extends X{constructor(e){super(),this.description=e}deoptimizeThisOnInteractionAtPath({type:e,thisArg:t},i){2===e&&0===i.length&&this.description.mutatesSelfAsArray&&t.deoptimizePath(j)}getReturnExpressionWhenCalledAtPath(e,{thisArg:t}){return e.length>0?Y:this.description.returnsPrimitive||("self"===this.description.returns?t||Y:this.description.returns())}hasEffectsOnInteractionAtPath(e,t,i){var s,n;const{type:r}=t;if(e.length>(0===r?1:0))return!0;if(2===r){if(!0===this.description.mutatesSelfAsArray&&(null===(s=t.thisArg)||void 0===s?void 0:s.hasEffectsOnInteractionAtPath(j,J,i)))return!0;if(this.description.callsArgs)for(const e of this.description.callsArgs)if(null===(n=t.args[e])||void 0===n?void 0:n.hasEffectsOnInteractionAtPath(B,ee,i))return!0}return!1}}const It=[new At({callsArgs:null,mutatesSelfAsArray:!1,returns:null,returnsPrimitive:Fe})],Pt=[new At({callsArgs:null,mutatesSelfAsArray:!1,returns:null,returnsPrimitive:Ge})],kt=[new At({callsArgs:null,mutatesSelfAsArray:!1,returns:null,returnsPrimitive:je})],wt=[new At({callsArgs:null,mutatesSelfAsArray:!1,returns:null,returnsPrimitive:Y})],Ct=/^\d+$/;class Nt extends X{constructor(e,t,i=!1){if(super(),this.prototypeExpression=t,this.immutable=i,this.allProperties=[],this.deoptimizedPaths=Object.create(null),this.expressionsToBeDeoptimizedByKey=Object.create(null),this.gettersByKey=Object.create(null),this.hasLostTrack=!1,this.hasUnknownDeoptimizedInteger=!1,this.hasUnknownDeoptimizedProperty=!1,this.propertiesAndGettersByKey=Object.create(null),this.propertiesAndSettersByKey=Object.create(null),this.settersByKey=Object.create(null),this.thisParametersToBeDeoptimized=new Set,this.unknownIntegerProps=[],this.unmatchableGetters=[],this.unmatchablePropertiesAndGetters=[],this.unmatchableSetters=[],Array.isArray(e))this.buildPropertyMaps(e);else{this.propertiesAndGettersByKey=this.propertiesAndSettersByKey=e;for(const t of Object.values(e))this.allProperties.push(...t)}}deoptimizeAllProperties(e){var t;const i=this.hasLostTrack||this.hasUnknownDeoptimizedProperty;if(e?this.hasUnknownDeoptimizedProperty=!0:this.hasLostTrack=!0,!i){for(const e of Object.values(this.propertiesAndGettersByKey).concat(Object.values(this.settersByKey)))for(const t of e)t.deoptimizePath(F);null===(t=this.prototypeExpression)||void 0===t||t.deoptimizePath([D,D]),this.deoptimizeCachedEntities()}}deoptimizeIntegerProperties(){if(!(this.hasLostTrack||this.hasUnknownDeoptimizedProperty||this.hasUnknownDeoptimizedInteger)){this.hasUnknownDeoptimizedInteger=!0;for(const[e,t]of Object.entries(this.propertiesAndGettersByKey))if(Ct.test(e))for(const e of t)e.deoptimizePath(F);this.deoptimizeCachedIntegerEntities()}}deoptimizePath(e){var t;if(this.hasLostTrack||this.immutable)return;const i=e[0];if(1===e.length){if("string"!=typeof i)return i===V?this.deoptimizeIntegerProperties():this.deoptimizeAllProperties(i===L);if(!this.deoptimizedPaths[i]){this.deoptimizedPaths[i]=!0;const e=this.expressionsToBeDeoptimizedByKey[i];if(e)for(const t of e)t.deoptimizeCache()}}const s=1===e.length?F:e.slice(1);for(const e of"string"==typeof i?(this.propertiesAndGettersByKey[i]||this.unmatchablePropertiesAndGetters).concat(this.settersByKey[i]||this.unmatchableSetters):this.allProperties)e.deoptimizePath(s);null===(t=this.prototypeExpression)||void 0===t||t.deoptimizePath(1===e.length?[...e,D]:e)}deoptimizeThisOnInteractionAtPath(e,t,i){var s;const[n,...r]=t;if(this.hasLostTrack||(2===e.type||t.length>1)&&(this.hasUnknownDeoptimizedProperty||"string"==typeof n&&this.deoptimizedPaths[n]))return void e.thisArg.deoptimizePath(F);const[a,o,l]=2===e.type||t.length>1?[this.propertiesAndGettersByKey,this.propertiesAndGettersByKey,this.unmatchablePropertiesAndGetters]:0===e.type?[this.propertiesAndGettersByKey,this.gettersByKey,this.unmatchableGetters]:[this.propertiesAndSettersByKey,this.settersByKey,this.unmatchableSetters];if("string"==typeof n){if(a[n]){const t=o[n];if(t)for(const s of t)s.deoptimizeThisOnInteractionAtPath(e,r,i);return void(this.immutable||this.thisParametersToBeDeoptimized.add(e.thisArg))}for(const t of l)t.deoptimizeThisOnInteractionAtPath(e,r,i);if(Ct.test(n))for(const t of this.unknownIntegerProps)t.deoptimizeThisOnInteractionAtPath(e,r,i)}else{for(const t of Object.values(o).concat([l]))for(const s of t)s.deoptimizeThisOnInteractionAtPath(e,r,i);for(const t of this.unknownIntegerProps)t.deoptimizeThisOnInteractionAtPath(e,r,i)}this.immutable||this.thisParametersToBeDeoptimized.add(e.thisArg),null===(s=this.prototypeExpression)||void 0===s||s.deoptimizeThisOnInteractionAtPath(e,t,i)}getLiteralValueAtPath(e,t,i){if(0===e.length)return K;const s=e[0],n=this.getMemberExpressionAndTrackDeopt(s,i);return n?n.getLiteralValueAtPath(e.slice(1),t,i):this.prototypeExpression?this.prototypeExpression.getLiteralValueAtPath(e,t,i):1!==e.length?q:void 0}getReturnExpressionWhenCalledAtPath(e,t,i,s){if(0===e.length)return Y;const[n,...r]=e,a=this.getMemberExpressionAndTrackDeopt(n,s);return a?a.getReturnExpressionWhenCalledAtPath(r,t,i,s):this.prototypeExpression?this.prototypeExpression.getReturnExpressionWhenCalledAtPath(e,t,i,s):Y}hasEffectsOnInteractionAtPath(e,t,i){const[s,...n]=e;if(n.length||2===t.type){const r=this.getMemberExpression(s);return r?r.hasEffectsOnInteractionAtPath(n,t,i):!this.prototypeExpression||this.prototypeExpression.hasEffectsOnInteractionAtPath(e,t,i)}if(s===L)return!1;if(this.hasLostTrack)return!0;const[r,a,o]=0===t.type?[this.propertiesAndGettersByKey,this.gettersByKey,this.unmatchableGetters]:[this.propertiesAndSettersByKey,this.settersByKey,this.unmatchableSetters];if("string"==typeof s){if(r[s]){const e=a[s];if(e)for(const s of e)if(s.hasEffectsOnInteractionAtPath(n,t,i))return!0;return!1}for(const e of o)if(e.hasEffectsOnInteractionAtPath(n,t,i))return!0}else for(const e of Object.values(a).concat([o]))for(const s of e)if(s.hasEffectsOnInteractionAtPath(n,t,i))return!0;return!!this.prototypeExpression&&this.prototypeExpression.hasEffectsOnInteractionAtPath(e,t,i)}buildPropertyMaps(e){const{allProperties:t,propertiesAndGettersByKey:i,propertiesAndSettersByKey:s,settersByKey:n,gettersByKey:r,unknownIntegerProps:a,unmatchablePropertiesAndGetters:o,unmatchableGetters:l,unmatchableSetters:h}=this,c=[];for(let u=e.length-1;u>=0;u--){const{key:d,kind:p,property:f}=e[u];if(t.push(f),"string"!=typeof d){if(d===V){a.push(f);continue}"set"===p&&h.push(f),"get"===p&&l.push(f),"get"!==p&&c.push(f),"set"!==p&&o.push(f)}else"set"===p?s[d]||(s[d]=[f,...c],n[d]=[f,...h]):"get"===p?i[d]||(i[d]=[f,...o],r[d]=[f,...l]):(s[d]||(s[d]=[f,...c]),i[d]||(i[d]=[f,...o]))}}deoptimizeCachedEntities(){for(const e of Object.values(this.expressionsToBeDeoptimizedByKey))for(const t of e)t.deoptimizeCache();for(const e of this.thisParametersToBeDeoptimized)e.deoptimizePath(F)}deoptimizeCachedIntegerEntities(){for(const[e,t]of Object.entries(this.expressionsToBeDeoptimizedByKey))if(Ct.test(e))for(const e of t)e.deoptimizeCache();for(const e of this.thisParametersToBeDeoptimized)e.deoptimizePath(j)}getMemberExpression(e){if(this.hasLostTrack||this.hasUnknownDeoptimizedProperty||"string"!=typeof e||this.hasUnknownDeoptimizedInteger&&Ct.test(e)||this.deoptimizedPaths[e])return Y;const t=this.propertiesAndGettersByKey[e];return 1===(null==t?void 0:t.length)?t[0]:t||this.unmatchablePropertiesAndGetters.length>0||this.unknownIntegerProps.length&&Ct.test(e)?Y:null}getMemberExpressionAndTrackDeopt(e,t){if("string"!=typeof e)return Y;const i=this.getMemberExpression(e);return i===Y||this.immutable||(this.expressionsToBeDeoptimizedByKey[e]=this.expressionsToBeDeoptimizedByKey[e]||[]).push(t),i}}const _t=e=>"string"==typeof e&&/^\d+$/.test(e),$t=new class extends X{deoptimizeThisOnInteractionAtPath({type:e,thisArg:t},i){2!==e||1!==i.length||_t(i[0])||t.deoptimizePath(F)}getLiteralValueAtPath(e){return 1===e.length&&_t(e[0])?void 0:q}hasEffectsOnInteractionAtPath(e,{type:t}){return e.length>1||2===t}},Tt=new Nt({__proto__:null,hasOwnProperty:It,isPrototypeOf:It,propertyIsEnumerable:It,toLocaleString:Pt,toString:Pt,valueOf:wt},$t,!0),Ot=[{key:V,kind:"init",property:Y},{key:"length",kind:"init",property:je}],Mt=[new At({callsArgs:[0],mutatesSelfAsArray:"deopt-only",returns:null,returnsPrimitive:Fe})],Rt=[new At({callsArgs:[0],mutatesSelfAsArray:"deopt-only",returns:null,returnsPrimitive:je})],Dt=[new At({callsArgs:null,mutatesSelfAsArray:!0,returns:()=>new Nt(Ot,Ht),returnsPrimitive:null})],Lt=[new At({callsArgs:null,mutatesSelfAsArray:"deopt-only",returns:()=>new Nt(Ot,Ht),returnsPrimitive:null})],Vt=[new At({callsArgs:[0],mutatesSelfAsArray:"deopt-only",returns:()=>new Nt(Ot,Ht),returnsPrimitive:null})],Bt=[new At({callsArgs:null,mutatesSelfAsArray:!0,returns:null,returnsPrimitive:je})],Ft=[new At({callsArgs:null,mutatesSelfAsArray:!0,returns:null,returnsPrimitive:Y})],zt=[new At({callsArgs:null,mutatesSelfAsArray:"deopt-only",returns:null,returnsPrimitive:Y})],jt=[new At({callsArgs:[0],mutatesSelfAsArray:"deopt-only",returns:null,returnsPrimitive:Y})],Ut=[new At({callsArgs:null,mutatesSelfAsArray:!0,returns:"self",returnsPrimitive:null})],Gt=[new At({callsArgs:[0],mutatesSelfAsArray:!0,returns:"self",returnsPrimitive:null})],Ht=new Nt({__proto__:null,at:zt,concat:Lt,copyWithin:Ut,entries:Lt,every:Mt,fill:Ut,filter:Vt,find:jt,findIndex:Rt,findLast:jt,findLastIndex:Rt,flat:Lt,flatMap:Vt,forEach:jt,group:jt,groupToMap:jt,includes:It,indexOf:kt,join:Pt,keys:wt,lastIndexOf:kt,map:Vt,pop:Ft,push:Bt,reduce:jt,reduceRight:jt,reverse:Ut,shift:Ft,slice:Lt,some:Mt,sort:Gt,splice:Dt,toLocaleString:Pt,toString:Pt,unshift:Bt,values:zt},Tt,!0);class Wt extends te{constructor(e,t,i,s){super(e),this.calledFromTryStatement=!1,this.additionalInitializers=null,this.expressionsToBeDeoptimized=[],this.declarations=t?[t]:[],this.init=i,this.deoptimizationTracker=s.deoptimizationTracker,this.module=s.module}addDeclaration(e,t){this.declarations.push(e);const i=this.markInitializersForDeoptimization();null!==t&&i.push(t)}consolidateInitializers(){if(null!==this.additionalInitializers){for(const e of this.additionalInitializers)e.deoptimizePath(F);this.additionalInitializers=null}}deoptimizePath(e){var t,i;if(!this.isReassigned&&!this.deoptimizationTracker.trackEntityAtPathAndGetIfTracked(e,this))if(0===e.length){if(!this.isReassigned){this.isReassigned=!0;const e=this.expressionsToBeDeoptimized;this.expressionsToBeDeoptimized=[];for(const t of e)t.deoptimizeCache();null===(t=this.init)||void 0===t||t.deoptimizePath(F)}}else null===(i=this.init)||void 0===i||i.deoptimizePath(e)}deoptimizeThisOnInteractionAtPath(e,t,i){if(this.isReassigned||!this.init)return e.thisArg.deoptimizePath(F);i.withTrackedEntityAtPath(t,this.init,(()=>this.init.deoptimizeThisOnInteractionAtPath(e,t,i)),void 0)}getLiteralValueAtPath(e,t,i){return this.isReassigned||!this.init?q:t.withTrackedEntityAtPath(e,this.init,(()=>(this.expressionsToBeDeoptimized.push(i),this.init.getLiteralValueAtPath(e,t,i))),q)}getReturnExpressionWhenCalledAtPath(e,t,i,s){return this.isReassigned||!this.init?Y:i.withTrackedEntityAtPath(e,this.init,(()=>(this.expressionsToBeDeoptimized.push(s),this.init.getReturnExpressionWhenCalledAtPath(e,t,i,s))),Y)}hasEffectsOnInteractionAtPath(e,t,i){switch(t.type){case 0:return!!this.isReassigned||this.init&&!i.accessed.trackEntityAtPathAndGetIfTracked(e,this)&&this.init.hasEffectsOnInteractionAtPath(e,t,i);case 1:return!!this.included||0!==e.length&&(!!this.isReassigned||this.init&&!i.assigned.trackEntityAtPathAndGetIfTracked(e,this)&&this.init.hasEffectsOnInteractionAtPath(e,t,i));case 2:return!!this.isReassigned||this.init&&!(t.withNew?i.instantiated:i.called).trackEntityAtPathAndGetIfTracked(e,t.args,this)&&this.init.hasEffectsOnInteractionAtPath(e,t,i)}}include(){if(!this.included){this.included=!0;for(const e of this.declarations){e.included||e.include(Re(),!1);let t=e.parent;for(;!t.included&&(t.included=!0,t.type!==ot);)t=t.parent}}}includeCallArguments(e,t){if(this.isReassigned||this.init&&e.includedCallArguments.has(this.init))for(const i of t)i.include(e,!1);else this.init&&(e.includedCallArguments.add(this.init),this.init.includeCallArguments(e,t),e.includedCallArguments.delete(this.init))}markCalledFromTryStatement(){this.calledFromTryStatement=!0}markInitializersForDeoptimization(){return null===this.additionalInitializers&&(this.additionalInitializers=null===this.init?[]:[this.init],this.init=Y,this.isReassigned=!0),this.additionalInitializers}}function qt(e){let t="";do{const i=e%64;e=Math.floor(e/64),t="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_$"[i]+t}while(0!==e);return t}function Kt(e,t){let i=e,s=1;for(;t.has(i)||Ce.has(i);)i=`${e}$${qt(s++)}`;return t.add(i),i}class Xt{constructor(){this.children=[],this.variables=new Map}addDeclaration(e,t,i,s){const n=e.name;let r=this.variables.get(n);return r?r.addDeclaration(e,i):(r=new Wt(e.name,e,i||Ve,t),this.variables.set(n,r)),r}contains(e){return this.variables.has(e)}findVariable(e){throw new Error("Internal Error: findVariable needs to be implemented by a subclass")}}class Yt extends Xt{constructor(e){super(),this.accessedOutsideVariables=new Map,this.parent=e,e.children.push(this)}addAccessedDynamicImport(e){(this.accessedDynamicImports||(this.accessedDynamicImports=new Set)).add(e),this.parent instanceof Yt&&this.parent.addAccessedDynamicImport(e)}addAccessedGlobals(e,t){const i=t.get(this)||new Set;for(const t of e)i.add(t);t.set(this,i),this.parent instanceof Yt&&this.parent.addAccessedGlobals(e,t)}addNamespaceMemberAccess(e,t){this.accessedOutsideVariables.set(e,t),this.parent.addNamespaceMemberAccess(e,t)}addReturnExpression(e){this.parent instanceof Yt&&this.parent.addReturnExpression(e)}addUsedOutsideNames(e,t,i,s){for(const s of this.accessedOutsideVariables.values())s.included&&(e.add(s.getBaseVariableName()),"system"===t&&i.has(s)&&e.add("exports"));const n=s.get(this);if(n)for(const t of n)e.add(t)}contains(e){return this.variables.has(e)||this.parent.contains(e)}deconflict(e,t,i){const s=new Set;if(this.addUsedOutsideNames(s,e,t,i),this.accessedDynamicImports)for(const e of this.accessedDynamicImports)e.inlineNamespace&&s.add(e.inlineNamespace.getBaseVariableName());for(const[e,t]of this.variables)(t.included||t.alwaysRendered)&&t.setRenderNames(null,Kt(e,s));for(const s of this.children)s.deconflict(e,t,i)}findLexicalBoundary(){return this.parent.findLexicalBoundary()}findVariable(e){const t=this.variables.get(e)||this.accessedOutsideVariables.get(e);if(t)return t;const i=this.parent.findVariable(e);return this.accessedOutsideVariables.set(e,i),i}}class Qt extends Yt{constructor(e,t){super(e),this.parameters=[],this.hasRest=!1,this.context=t,this.hoistedBodyVarScope=new Yt(this)}addParameterDeclaration(e){const t=e.name;let i=this.hoistedBodyVarScope.variables.get(t);return i?i.addDeclaration(e,null):i=new Wt(t,e,Y,this.context),this.variables.set(t,i),i}addParameterVariables(e,t){this.parameters=e;for(const t of e)for(const e of t)e.alwaysRendered=!0;this.hasRest=t}includeCallArguments(e,t){let i=!1,s=!1;const n=this.hasRest&&this.parameters[this.parameters.length-1];for(const i of t)if(i instanceof St){for(const i of t)i.include(e,!1);break}for(let r=t.length-1;r>=0;r--){const a=this.parameters[r]||n,o=t[r];if(a)if(i=!1,0===a.length)s=!0;else for(const e of a)e.included&&(s=!0),e.calledFromTryStatement&&(i=!0);!s&&o.shouldBeIncluded(e)&&(s=!0),s&&o.include(e,i)}}}class Jt extends Qt{constructor(){super(...arguments),this.returnExpression=null,this.returnExpressions=[]}addReturnExpression(e){this.returnExpressions.push(e)}getReturnExpression(){return null===this.returnExpression&&this.updateReturnExpression(),this.returnExpression}updateReturnExpression(){if(1===this.returnExpressions.length)this.returnExpression=this.returnExpressions[0];else{this.returnExpression=Y;for(const e of this.returnExpressions)e.deoptimizePath(F)}}}function Zt(e,t){if("MemberExpression"===e.type)return!e.computed&&Zt(e.object,e);if("Identifier"===e.type){if(!t)return!0;switch(t.type){case"MemberExpression":return t.computed||e===t.object;case"MethodDefinition":return t.computed;case"PropertyDefinition":case"Property":return t.computed||e===t.value;case"ExportSpecifier":case"ImportSpecifier":return e===t.local;case"LabeledStatement":case"BreakStatement":case"ContinueStatement":return!1;default:return!0}}return!1}const ei=Symbol("Value Properties"),ti={hasEffectsWhenCalled:()=>!1},ii={hasEffectsWhenCalled:()=>!0},si={__proto__:null,[ei]:ii},ni={__proto__:null,[ei]:ti},ri={__proto__:null,[ei]:{hasEffectsWhenCalled:({args:e},t)=>!e.length||e[0].hasEffectsOnInteractionAtPath(z,J,t)}},ai={__proto__:null,[ei]:ii,prototype:si},oi={__proto__:null,[ei]:ti,prototype:si},li={__proto__:null,[ei]:ti,from:ni,of:ni,prototype:si},hi={__proto__:null,[ei]:ti,supportedLocalesOf:oi},ci={global:si,globalThis:si,self:si,window:si,__proto__:null,[ei]:ii,Array:{__proto__:null,[ei]:ii,from:si,isArray:ni,of:ni,prototype:si},ArrayBuffer:{__proto__:null,[ei]:ti,isView:ni,prototype:si},Atomics:si,BigInt:ai,BigInt64Array:ai,BigUint64Array:ai,Boolean:oi,constructor:ai,DataView:oi,Date:{__proto__:null,[ei]:ti,now:ni,parse:ni,prototype:si,UTC:ni},decodeURI:ni,decodeURIComponent:ni,encodeURI:ni,encodeURIComponent:ni,Error:oi,escape:ni,eval:si,EvalError:oi,Float32Array:li,Float64Array:li,Function:ai,hasOwnProperty:si,Infinity:si,Int16Array:li,Int32Array:li,Int8Array:li,isFinite:ni,isNaN:ni,isPrototypeOf:si,JSON:si,Map:oi,Math:{__proto__:null,[ei]:ii,abs:ni,acos:ni,acosh:ni,asin:ni,asinh:ni,atan:ni,atan2:ni,atanh:ni,cbrt:ni,ceil:ni,clz32:ni,cos:ni,cosh:ni,exp:ni,expm1:ni,floor:ni,fround:ni,hypot:ni,imul:ni,log:ni,log10:ni,log1p:ni,log2:ni,max:ni,min:ni,pow:ni,random:ni,round:ni,sign:ni,sin:ni,sinh:ni,sqrt:ni,tan:ni,tanh:ni,trunc:ni},NaN:si,Number:{__proto__:null,[ei]:ti,isFinite:ni,isInteger:ni,isNaN:ni,isSafeInteger:ni,parseFloat:ni,parseInt:ni,prototype:si},Object:{__proto__:null,[ei]:ti,create:ni,defineProperty:ri,defineProperties:ri,getOwnPropertyDescriptor:ni,getOwnPropertyNames:ni,getOwnPropertySymbols:ni,getPrototypeOf:ni,hasOwn:ni,is:ni,isExtensible:ni,isFrozen:ni,isSealed:ni,keys:ni,fromEntries:ni,entries:ni,prototype:si},parseFloat:ni,parseInt:ni,Promise:{__proto__:null,[ei]:ii,all:si,prototype:si,race:si,reject:si,resolve:si},propertyIsEnumerable:si,Proxy:si,RangeError:oi,ReferenceError:oi,Reflect:si,RegExp:oi,Set:oi,SharedArrayBuffer:ai,String:{__proto__:null,[ei]:ti,fromCharCode:ni,fromCodePoint:ni,prototype:si,raw:ni},Symbol:{__proto__:null,[ei]:ti,for:ni,keyFor:ni,prototype:si},SyntaxError:oi,toLocaleString:si,toString:si,TypeError:oi,Uint16Array:li,Uint32Array:li,Uint8Array:li,Uint8ClampedArray:li,unescape:ni,URIError:oi,valueOf:si,WeakMap:oi,WeakSet:oi,clearInterval:ai,clearTimeout:ai,console:si,Intl:{__proto__:null,[ei]:ii,Collator:hi,DateTimeFormat:hi,ListFormat:hi,NumberFormat:hi,PluralRules:hi,RelativeTimeFormat:hi},setInterval:ai,setTimeout:ai,TextDecoder:ai,TextEncoder:ai,URL:ai,URLSearchParams:ai,AbortController:ai,AbortSignal:ai,addEventListener:si,alert:si,AnalyserNode:ai,Animation:ai,AnimationEvent:ai,applicationCache:si,ApplicationCache:ai,ApplicationCacheErrorEvent:ai,atob:si,Attr:ai,Audio:ai,AudioBuffer:ai,AudioBufferSourceNode:ai,AudioContext:ai,AudioDestinationNode:ai,AudioListener:ai,AudioNode:ai,AudioParam:ai,AudioProcessingEvent:ai,AudioScheduledSourceNode:ai,AudioWorkletNode:ai,BarProp:ai,BaseAudioContext:ai,BatteryManager:ai,BeforeUnloadEvent:ai,BiquadFilterNode:ai,Blob:ai,BlobEvent:ai,blur:si,BroadcastChannel:ai,btoa:si,ByteLengthQueuingStrategy:ai,Cache:ai,caches:si,CacheStorage:ai,cancelAnimationFrame:si,cancelIdleCallback:si,CanvasCaptureMediaStreamTrack:ai,CanvasGradient:ai,CanvasPattern:ai,CanvasRenderingContext2D:ai,ChannelMergerNode:ai,ChannelSplitterNode:ai,CharacterData:ai,clientInformation:si,ClipboardEvent:ai,close:si,closed:si,CloseEvent:ai,Comment:ai,CompositionEvent:ai,confirm:si,ConstantSourceNode:ai,ConvolverNode:ai,CountQueuingStrategy:ai,createImageBitmap:si,Credential:ai,CredentialsContainer:ai,crypto:si,Crypto:ai,CryptoKey:ai,CSS:ai,CSSConditionRule:ai,CSSFontFaceRule:ai,CSSGroupingRule:ai,CSSImportRule:ai,CSSKeyframeRule:ai,CSSKeyframesRule:ai,CSSMediaRule:ai,CSSNamespaceRule:ai,CSSPageRule:ai,CSSRule:ai,CSSRuleList:ai,CSSStyleDeclaration:ai,CSSStyleRule:ai,CSSStyleSheet:ai,CSSSupportsRule:ai,CustomElementRegistry:ai,customElements:si,CustomEvent:ai,DataTransfer:ai,DataTransferItem:ai,DataTransferItemList:ai,defaultstatus:si,defaultStatus:si,DelayNode:ai,DeviceMotionEvent:ai,DeviceOrientationEvent:ai,devicePixelRatio:si,dispatchEvent:si,document:si,Document:ai,DocumentFragment:ai,DocumentType:ai,DOMError:ai,DOMException:ai,DOMImplementation:ai,DOMMatrix:ai,DOMMatrixReadOnly:ai,DOMParser:ai,DOMPoint:ai,DOMPointReadOnly:ai,DOMQuad:ai,DOMRect:ai,DOMRectReadOnly:ai,DOMStringList:ai,DOMStringMap:ai,DOMTokenList:ai,DragEvent:ai,DynamicsCompressorNode:ai,Element:ai,ErrorEvent:ai,Event:ai,EventSource:ai,EventTarget:ai,external:si,fetch:si,File:ai,FileList:ai,FileReader:ai,find:si,focus:si,FocusEvent:ai,FontFace:ai,FontFaceSetLoadEvent:ai,FormData:ai,frames:si,GainNode:ai,Gamepad:ai,GamepadButton:ai,GamepadEvent:ai,getComputedStyle:si,getSelection:si,HashChangeEvent:ai,Headers:ai,history:si,History:ai,HTMLAllCollection:ai,HTMLAnchorElement:ai,HTMLAreaElement:ai,HTMLAudioElement:ai,HTMLBaseElement:ai,HTMLBodyElement:ai,HTMLBRElement:ai,HTMLButtonElement:ai,HTMLCanvasElement:ai,HTMLCollection:ai,HTMLContentElement:ai,HTMLDataElement:ai,HTMLDataListElement:ai,HTMLDetailsElement:ai,HTMLDialogElement:ai,HTMLDirectoryElement:ai,HTMLDivElement:ai,HTMLDListElement:ai,HTMLDocument:ai,HTMLElement:ai,HTMLEmbedElement:ai,HTMLFieldSetElement:ai,HTMLFontElement:ai,HTMLFormControlsCollection:ai,HTMLFormElement:ai,HTMLFrameElement:ai,HTMLFrameSetElement:ai,HTMLHeadElement:ai,HTMLHeadingElement:ai,HTMLHRElement:ai,HTMLHtmlElement:ai,HTMLIFrameElement:ai,HTMLImageElement:ai,HTMLInputElement:ai,HTMLLabelElement:ai,HTMLLegendElement:ai,HTMLLIElement:ai,HTMLLinkElement:ai,HTMLMapElement:ai,HTMLMarqueeElement:ai,HTMLMediaElement:ai,HTMLMenuElement:ai,HTMLMetaElement:ai,HTMLMeterElement:ai,HTMLModElement:ai,HTMLObjectElement:ai,HTMLOListElement:ai,HTMLOptGroupElement:ai,HTMLOptionElement:ai,HTMLOptionsCollection:ai,HTMLOutputElement:ai,HTMLParagraphElement:ai,HTMLParamElement:ai,HTMLPictureElement:ai,HTMLPreElement:ai,HTMLProgressElement:ai,HTMLQuoteElement:ai,HTMLScriptElement:ai,HTMLSelectElement:ai,HTMLShadowElement:ai,HTMLSlotElement:ai,HTMLSourceElement:ai,HTMLSpanElement:ai,HTMLStyleElement:ai,HTMLTableCaptionElement:ai,HTMLTableCellElement:ai,HTMLTableColElement:ai,HTMLTableElement:ai,HTMLTableRowElement:ai,HTMLTableSectionElement:ai,HTMLTemplateElement:ai,HTMLTextAreaElement:ai,HTMLTimeElement:ai,HTMLTitleElement:ai,HTMLTrackElement:ai,HTMLUListElement:ai,HTMLUnknownElement:ai,HTMLVideoElement:ai,IDBCursor:ai,IDBCursorWithValue:ai,IDBDatabase:ai,IDBFactory:ai,IDBIndex:ai,IDBKeyRange:ai,IDBObjectStore:ai,IDBOpenDBRequest:ai,IDBRequest:ai,IDBTransaction:ai,IDBVersionChangeEvent:ai,IdleDeadline:ai,IIRFilterNode:ai,Image:ai,ImageBitmap:ai,ImageBitmapRenderingContext:ai,ImageCapture:ai,ImageData:ai,indexedDB:si,innerHeight:si,innerWidth:si,InputEvent:ai,IntersectionObserver:ai,IntersectionObserverEntry:ai,isSecureContext:si,KeyboardEvent:ai,KeyframeEffect:ai,length:si,localStorage:si,location:si,Location:ai,locationbar:si,matchMedia:si,MediaDeviceInfo:ai,MediaDevices:ai,MediaElementAudioSourceNode:ai,MediaEncryptedEvent:ai,MediaError:ai,MediaKeyMessageEvent:ai,MediaKeySession:ai,MediaKeyStatusMap:ai,MediaKeySystemAccess:ai,MediaList:ai,MediaQueryList:ai,MediaQueryListEvent:ai,MediaRecorder:ai,MediaSettingsRange:ai,MediaSource:ai,MediaStream:ai,MediaStreamAudioDestinationNode:ai,MediaStreamAudioSourceNode:ai,MediaStreamEvent:ai,MediaStreamTrack:ai,MediaStreamTrackEvent:ai,menubar:si,MessageChannel:ai,MessageEvent:ai,MessagePort:ai,MIDIAccess:ai,MIDIConnectionEvent:ai,MIDIInput:ai,MIDIInputMap:ai,MIDIMessageEvent:ai,MIDIOutput:ai,MIDIOutputMap:ai,MIDIPort:ai,MimeType:ai,MimeTypeArray:ai,MouseEvent:ai,moveBy:si,moveTo:si,MutationEvent:ai,MutationObserver:ai,MutationRecord:ai,name:si,NamedNodeMap:ai,NavigationPreloadManager:ai,navigator:si,Navigator:ai,NetworkInformation:ai,Node:ai,NodeFilter:si,NodeIterator:ai,NodeList:ai,Notification:ai,OfflineAudioCompletionEvent:ai,OfflineAudioContext:ai,offscreenBuffering:si,OffscreenCanvas:ai,open:si,openDatabase:si,Option:ai,origin:si,OscillatorNode:ai,outerHeight:si,outerWidth:si,PageTransitionEvent:ai,pageXOffset:si,pageYOffset:si,PannerNode:ai,parent:si,Path2D:ai,PaymentAddress:ai,PaymentRequest:ai,PaymentRequestUpdateEvent:ai,PaymentResponse:ai,performance:si,Performance:ai,PerformanceEntry:ai,PerformanceLongTaskTiming:ai,PerformanceMark:ai,PerformanceMeasure:ai,PerformanceNavigation:ai,PerformanceNavigationTiming:ai,PerformanceObserver:ai,PerformanceObserverEntryList:ai,PerformancePaintTiming:ai,PerformanceResourceTiming:ai,PerformanceTiming:ai,PeriodicWave:ai,Permissions:ai,PermissionStatus:ai,personalbar:si,PhotoCapabilities:ai,Plugin:ai,PluginArray:ai,PointerEvent:ai,PopStateEvent:ai,postMessage:si,Presentation:ai,PresentationAvailability:ai,PresentationConnection:ai,PresentationConnectionAvailableEvent:ai,PresentationConnectionCloseEvent:ai,PresentationConnectionList:ai,PresentationReceiver:ai,PresentationRequest:ai,print:si,ProcessingInstruction:ai,ProgressEvent:ai,PromiseRejectionEvent:ai,prompt:si,PushManager:ai,PushSubscription:ai,PushSubscriptionOptions:ai,queueMicrotask:si,RadioNodeList:ai,Range:ai,ReadableStream:ai,RemotePlayback:ai,removeEventListener:si,Request:ai,requestAnimationFrame:si,requestIdleCallback:si,resizeBy:si,ResizeObserver:ai,ResizeObserverEntry:ai,resizeTo:si,Response:ai,RTCCertificate:ai,RTCDataChannel:ai,RTCDataChannelEvent:ai,RTCDtlsTransport:ai,RTCIceCandidate:ai,RTCIceTransport:ai,RTCPeerConnection:ai,RTCPeerConnectionIceEvent:ai,RTCRtpReceiver:ai,RTCRtpSender:ai,RTCSctpTransport:ai,RTCSessionDescription:ai,RTCStatsReport:ai,RTCTrackEvent:ai,screen:si,Screen:ai,screenLeft:si,ScreenOrientation:ai,screenTop:si,screenX:si,screenY:si,ScriptProcessorNode:ai,scroll:si,scrollbars:si,scrollBy:si,scrollTo:si,scrollX:si,scrollY:si,SecurityPolicyViolationEvent:ai,Selection:ai,ServiceWorker:ai,ServiceWorkerContainer:ai,ServiceWorkerRegistration:ai,sessionStorage:si,ShadowRoot:ai,SharedWorker:ai,SourceBuffer:ai,SourceBufferList:ai,speechSynthesis:si,SpeechSynthesisEvent:ai,SpeechSynthesisUtterance:ai,StaticRange:ai,status:si,statusbar:si,StereoPannerNode:ai,stop:si,Storage:ai,StorageEvent:ai,StorageManager:ai,styleMedia:si,StyleSheet:ai,StyleSheetList:ai,SubtleCrypto:ai,SVGAElement:ai,SVGAngle:ai,SVGAnimatedAngle:ai,SVGAnimatedBoolean:ai,SVGAnimatedEnumeration:ai,SVGAnimatedInteger:ai,SVGAnimatedLength:ai,SVGAnimatedLengthList:ai,SVGAnimatedNumber:ai,SVGAnimatedNumberList:ai,SVGAnimatedPreserveAspectRatio:ai,SVGAnimatedRect:ai,SVGAnimatedString:ai,SVGAnimatedTransformList:ai,SVGAnimateElement:ai,SVGAnimateMotionElement:ai,SVGAnimateTransformElement:ai,SVGAnimationElement:ai,SVGCircleElement:ai,SVGClipPathElement:ai,SVGComponentTransferFunctionElement:ai,SVGDefsElement:ai,SVGDescElement:ai,SVGDiscardElement:ai,SVGElement:ai,SVGEllipseElement:ai,SVGFEBlendElement:ai,SVGFEColorMatrixElement:ai,SVGFEComponentTransferElement:ai,SVGFECompositeElement:ai,SVGFEConvolveMatrixElement:ai,SVGFEDiffuseLightingElement:ai,SVGFEDisplacementMapElement:ai,SVGFEDistantLightElement:ai,SVGFEDropShadowElement:ai,SVGFEFloodElement:ai,SVGFEFuncAElement:ai,SVGFEFuncBElement:ai,SVGFEFuncGElement:ai,SVGFEFuncRElement:ai,SVGFEGaussianBlurElement:ai,SVGFEImageElement:ai,SVGFEMergeElement:ai,SVGFEMergeNodeElement:ai,SVGFEMorphologyElement:ai,SVGFEOffsetElement:ai,SVGFEPointLightElement:ai,SVGFESpecularLightingElement:ai,SVGFESpotLightElement:ai,SVGFETileElement:ai,SVGFETurbulenceElement:ai,SVGFilterElement:ai,SVGForeignObjectElement:ai,SVGGElement:ai,SVGGeometryElement:ai,SVGGradientElement:ai,SVGGraphicsElement:ai,SVGImageElement:ai,SVGLength:ai,SVGLengthList:ai,SVGLinearGradientElement:ai,SVGLineElement:ai,SVGMarkerElement:ai,SVGMaskElement:ai,SVGMatrix:ai,SVGMetadataElement:ai,SVGMPathElement:ai,SVGNumber:ai,SVGNumberList:ai,SVGPathElement:ai,SVGPatternElement:ai,SVGPoint:ai,SVGPointList:ai,SVGPolygonElement:ai,SVGPolylineElement:ai,SVGPreserveAspectRatio:ai,SVGRadialGradientElement:ai,SVGRect:ai,SVGRectElement:ai,SVGScriptElement:ai,SVGSetElement:ai,SVGStopElement:ai,SVGStringList:ai,SVGStyleElement:ai,SVGSVGElement:ai,SVGSwitchElement:ai,SVGSymbolElement:ai,SVGTextContentElement:ai,SVGTextElement:ai,SVGTextPathElement:ai,SVGTextPositioningElement:ai,SVGTitleElement:ai,SVGTransform:ai,SVGTransformList:ai,SVGTSpanElement:ai,SVGUnitTypes:ai,SVGUseElement:ai,SVGViewElement:ai,TaskAttributionTiming:ai,Text:ai,TextEvent:ai,TextMetrics:ai,TextTrack:ai,TextTrackCue:ai,TextTrackCueList:ai,TextTrackList:ai,TimeRanges:ai,toolbar:si,top:si,Touch:ai,TouchEvent:ai,TouchList:ai,TrackEvent:ai,TransitionEvent:ai,TreeWalker:ai,UIEvent:ai,ValidityState:ai,visualViewport:si,VisualViewport:ai,VTTCue:ai,WaveShaperNode:ai,WebAssembly:si,WebGL2RenderingContext:ai,WebGLActiveInfo:ai,WebGLBuffer:ai,WebGLContextEvent:ai,WebGLFramebuffer:ai,WebGLProgram:ai,WebGLQuery:ai,WebGLRenderbuffer:ai,WebGLRenderingContext:ai,WebGLSampler:ai,WebGLShader:ai,WebGLShaderPrecisionFormat:ai,WebGLSync:ai,WebGLTexture:ai,WebGLTransformFeedback:ai,WebGLUniformLocation:ai,WebGLVertexArrayObject:ai,WebSocket:ai,WheelEvent:ai,Window:ai,Worker:ai,WritableStream:ai,XMLDocument:ai,XMLHttpRequest:ai,XMLHttpRequestEventTarget:ai,XMLHttpRequestUpload:ai,XMLSerializer:ai,XPathEvaluator:ai,XPathExpression:ai,XPathResult:ai,XSLTProcessor:ai};for(const e of["window","global","self","globalThis"])ci[e]=ci;function ui(e){let t=ci;for(const i of e){if("string"!=typeof i)return null;if(t=t[i],!t)return null}return t[ei]}class di extends te{constructor(){super(...arguments),this.isReassigned=!0}getLiteralValueAtPath(e,t,i){return ui([this.name,...e])?K:q}hasEffectsOnInteractionAtPath(e,t,i){switch(t.type){case 0:return 0===e.length?"undefined"!==this.name&&!ui([this.name]):!ui([this.name,...e].slice(0,-1));case 1:return!0;case 2:{const s=ui([this.name,...e]);return!s||s.hasEffectsWhenCalled(t,i)}}}}const pi={__proto__:null,class:!0,const:!0,let:!0,var:!0};class fi extends vt{constructor(){super(...arguments),this.variable=null,this.isTDZAccess=null}addExportedVariables(e,t){t.has(this.variable)&&e.push(this.variable)}bind(){!this.variable&&Zt(this,this.parent)&&(this.variable=this.scope.findVariable(this.name),this.variable.addReference(this))}declare(e,t){let i;const{treeshake:s}=this.context.options;switch(e){case"var":i=this.scope.addDeclaration(this,this.context,t,!0),s&&s.correctVarValueBeforeDeclaration&&i.markInitializersForDeoptimization();break;case"function":case"let":case"const":case"class":i=this.scope.addDeclaration(this,this.context,t,!1);break;case"parameter":i=this.scope.addParameterDeclaration(this);break;default:throw new Error(`Internal Error: Unexpected identifier kind ${e}.`)}return i.kind=e,[this.variable=i]}deoptimizePath(e){var t;0!==e.length||this.scope.contains(this.name)||this.disallowImportReassignment(),null===(t=this.variable)||void 0===t||t.deoptimizePath(e)}deoptimizeThisOnInteractionAtPath(e,t,i){this.variable.deoptimizeThisOnInteractionAtPath(e,t,i)}getLiteralValueAtPath(e,t,i){return this.getVariableRespectingTDZ().getLiteralValueAtPath(e,t,i)}getReturnExpressionWhenCalledAtPath(e,t,i,s){return this.getVariableRespectingTDZ().getReturnExpressionWhenCalledAtPath(e,t,i,s)}hasEffects(e){return this.deoptimized||this.applyDeoptimizations(),!(!this.isPossibleTDZ()||"var"===this.variable.kind)||this.context.options.treeshake.unknownGlobalSideEffects&&this.variable instanceof di&&this.variable.hasEffectsOnInteractionAtPath(B,Q,e)}hasEffectsOnInteractionAtPath(e,t,i){switch(t.type){case 0:return null!==this.variable&&this.getVariableRespectingTDZ().hasEffectsOnInteractionAtPath(e,t,i);case 1:return(e.length>0?this.getVariableRespectingTDZ():this.variable).hasEffectsOnInteractionAtPath(e,t,i);case 2:return this.getVariableRespectingTDZ().hasEffectsOnInteractionAtPath(e,t,i)}}include(){this.deoptimized||this.applyDeoptimizations(),this.included||(this.included=!0,null!==this.variable&&this.context.includeVariableInModule(this.variable))}includeCallArguments(e,t){this.variable.includeCallArguments(e,t)}isPossibleTDZ(){if(null!==this.isTDZAccess)return this.isTDZAccess;if(!(this.variable instanceof Wt&&this.variable.kind&&this.variable.kind in pi))return this.isTDZAccess=!1;let e;return this.variable.declarations&&1===this.variable.declarations.length&&(e=this.variable.declarations[0])&&this.start=s)return s;n=e.charCodeAt(++i),++i,(i=47===n?e.indexOf("\n",i)+1:e.indexOf("*/",i)+2)>s&&(s=e.indexOf(t,i))}}const bi=/\S/g;function vi(e,t){return bi.lastIndex=t,bi.exec(e).index}function Si(e){let t,i,s=0;for(t=e.indexOf("\n",s);;){if(s=e.indexOf("/",s),-1===s||s>t)return[t,t+1];if(i=e.charCodeAt(s+1),47===i)return[s,t+1];s=e.indexOf("*/",s+3)+2,s>t&&(t=e.indexOf("\n",s))}}function Ai(e,t,i,s,n){let r,a,o,l,h=e[0],c=!h.included||h.needsBoundaries;c&&(l=i+Si(t.original.slice(i,h.start))[1]);for(let i=1;i<=e.length;i++)r=h,a=l,o=c,h=e[i],c=void 0!==h&&(!h.included||h.needsBoundaries),o||c?(l=r.end+Si(t.original.slice(r.end,void 0===h?s:h.start))[1],r.included?o?r.render(t,n,{end:l,start:a}):r.render(t,n):gi(r,t,a,l)):r.render(t,n)}function Ii(e,t,i,s){const n=[];let r,a,o,l,h,c=i-1;for(let s=0;s0||this.argument.hasEffectsOnInteractionAtPath(B,t,i)}markDeclarationReached(){this.argument.markDeclarationReached()}applyDeoptimizations(){this.deoptimized=!0,null!==this.declarationInit&&(this.declarationInit.deoptimizePath([D,D]),this.context.requestTreeshakingPass())}}class _i extends vt{constructor(){super(...arguments),this.objectEntity=null,this.deoptimizedReturn=!1}deoptimizePath(e){this.getObjectEntity().deoptimizePath(e),1===e.length&&e[0]===D&&this.scope.getReturnExpression().deoptimizePath(F)}deoptimizeThisOnInteractionAtPath(e,t,i){t.length>0&&this.getObjectEntity().deoptimizeThisOnInteractionAtPath(e,t,i)}getLiteralValueAtPath(e,t,i){return this.getObjectEntity().getLiteralValueAtPath(e,t,i)}getReturnExpressionWhenCalledAtPath(e,t,i,s){return e.length>0?this.getObjectEntity().getReturnExpressionWhenCalledAtPath(e,t,i,s):this.async?(this.deoptimizedReturn||(this.deoptimizedReturn=!0,this.scope.getReturnExpression().deoptimizePath(F),this.context.requestTreeshakingPass()),Y):this.scope.getReturnExpression()}hasEffectsOnInteractionAtPath(e,t,i){if(e.length>0||2!==t.type)return this.getObjectEntity().hasEffectsOnInteractionAtPath(e,t,i);if(this.async){const{propertyReadSideEffects:e}=this.context.options.treeshake,t=this.scope.getReturnExpression();if(t.hasEffectsOnInteractionAtPath(["then"],ee,i)||e&&("always"===e||t.hasEffectsOnInteractionAtPath(["then"],Q,i)))return!0}for(const e of this.params)if(e.hasEffects(i))return!0;return!1}include(e,t){this.deoptimized||this.applyDeoptimizations(),this.included=!0;const{brokenFlow:i}=e;e.brokenFlow=0,this.body.include(e,t),e.brokenFlow=i}includeCallArguments(e,t){this.scope.includeCallArguments(e,t)}initialise(){this.scope.addParameterVariables(this.params.map((e=>e.declare("parameter",Y))),this.params[this.params.length-1]instanceof Ni),this.body instanceof Ci?this.body.addImplicitReturnExpressionToScope():this.scope.addReturnExpression(this.body)}parseNode(e){e.body.type===st&&(this.body=new Ci(e.body,this,this.scope.hoistedBodyVarScope)),super.parseNode(e)}applyDeoptimizations(){}}_i.prototype.preventChildBlockScope=!0;class $i extends _i{constructor(){super(...arguments),this.objectEntity=null}createScope(e){this.scope=new Jt(e,this.context)}hasEffects(){return this.deoptimized||this.applyDeoptimizations(),!1}hasEffectsOnInteractionAtPath(e,t,i){if(super.hasEffectsOnInteractionAtPath(e,t,i))return!0;if(2===t.type){const{ignore:e,brokenFlow:t}=i;if(i.ignore={breaks:!1,continues:!1,labels:new Set,returnYield:!0},this.body.hasEffects(i))return!0;i.ignore=e,i.brokenFlow=t}return!1}include(e,t){super.include(e,t);for(const i of this.params)i instanceof fi||i.include(e,t)}getObjectEntity(){return null!==this.objectEntity?this.objectEntity:this.objectEntity=new Nt([],Tt)}}function Ti(e,{exportNamesByVariable:t,snippets:{_:i,getObject:s,getPropertyAccess:n}},r=""){if(1===e.length&&1===t.get(e[0]).length){const s=e[0];return`exports('${t.get(s)}',${i}${s.getName(n)}${r})`}{const i=[];for(const s of e)for(const e of t.get(s))i.push([e,s.getName(n)+r]);return`exports(${s(i,{lineBreakIndent:null})})`}}function Oi(e,t,i,s,{exportNamesByVariable:n,snippets:{_:r}}){s.prependRight(t,`exports('${n.get(e)}',${r}`),s.appendLeft(i,")")}function Mi(e,t,i,s,n,r){const{_:a,getPropertyAccess:o}=r.snippets;n.appendLeft(i,`,${a}${Ti([e],r)},${a}${e.getName(o)}`),s&&(n.prependRight(t,"("),n.appendLeft(i,")"))}class Ri extends vt{addExportedVariables(e,t){for(const i of this.properties)"Property"===i.type?i.value.addExportedVariables(e,t):i.argument.addExportedVariables(e,t)}declare(e,t){const i=[];for(const s of this.properties)i.push(...s.declare(e,t));return i}deoptimizePath(e){if(0===e.length)for(const t of this.properties)t.deoptimizePath(e)}hasEffectsOnInteractionAtPath(e,t,i){for(const e of this.properties)if(e.hasEffectsOnInteractionAtPath(B,t,i))return!0;return!1}markDeclarationReached(){for(const e of this.properties)e.markDeclarationReached()}}class Di extends Wt{constructor(e){super("arguments",null,Y,e)}hasEffectsOnInteractionAtPath(e,{type:t}){return 0!==t||e.length>1}}class Li extends Wt{constructor(e){super("this",null,null,e),this.deoptimizedPaths=[],this.entitiesToBeDeoptimized=new Set,this.thisDeoptimizationList=[],this.thisDeoptimizations=new W}addEntityToBeDeoptimized(e){for(const t of this.deoptimizedPaths)e.deoptimizePath(t);for(const{interaction:t,path:i}of this.thisDeoptimizationList)e.deoptimizeThisOnInteractionAtPath(t,i,H);this.entitiesToBeDeoptimized.add(e)}deoptimizePath(e){if(0!==e.length&&!this.deoptimizationTracker.trackEntityAtPathAndGetIfTracked(e,this)){this.deoptimizedPaths.push(e);for(const t of this.entitiesToBeDeoptimized)t.deoptimizePath(e)}}deoptimizeThisOnInteractionAtPath(e,t){const i={interaction:e,path:t};if(!this.thisDeoptimizations.trackEntityAtPathAndGetIfTracked(t,e.type,e.thisArg)){for(const i of this.entitiesToBeDeoptimized)i.deoptimizeThisOnInteractionAtPath(e,t,H);this.thisDeoptimizationList.push(i)}}hasEffectsOnInteractionAtPath(e,t,i){return this.getInit(i).hasEffectsOnInteractionAtPath(e,t,i)||super.hasEffectsOnInteractionAtPath(e,t,i)}getInit(e){return e.replacedVariableInits.get(this)||Y}}class Vi extends Jt{constructor(e,t){super(e,t),this.variables.set("arguments",this.argumentsVariable=new Di(t)),this.variables.set("this",this.thisVariable=new Li(t))}findLexicalBoundary(){return this}includeCallArguments(e,t){if(super.includeCallArguments(e,t),this.argumentsVariable.included)for(const i of t)i.included||i.include(e,!1)}}class Bi extends _i{constructor(){super(...arguments),this.objectEntity=null}createScope(e){this.scope=new Vi(e,this.context)}deoptimizeThisOnInteractionAtPath(e,t,i){super.deoptimizeThisOnInteractionAtPath(e,t,i),2===e.type&&0===t.length&&this.scope.thisVariable.addEntityToBeDeoptimized(e.thisArg)}hasEffects(e){var t;return this.deoptimized||this.applyDeoptimizations(),!!(null===(t=this.id)||void 0===t?void 0:t.hasEffects(e))}hasEffectsOnInteractionAtPath(e,t,i){if(super.hasEffectsOnInteractionAtPath(e,t,i))return!0;if(2===t.type){const e=i.replacedVariableInits.get(this.scope.thisVariable);i.replacedVariableInits.set(this.scope.thisVariable,t.withNew?new Nt(Object.create(null),Tt):Y);const{brokenFlow:s,ignore:n}=i;if(i.ignore={breaks:!1,continues:!1,labels:new Set,returnYield:!0},this.body.hasEffects(i))return!0;i.brokenFlow=s,e?i.replacedVariableInits.set(this.scope.thisVariable,e):i.replacedVariableInits.delete(this.scope.thisVariable),i.ignore=n}return!1}include(e,t){var i;super.include(e,t),null===(i=this.id)||void 0===i||i.include();const s=this.scope.argumentsVariable.included;for(const i of this.params)i instanceof fi&&!s||i.include(e,t)}initialise(){var e;super.initialise(),null===(e=this.id)||void 0===e||e.declare("function",this)}getObjectEntity(){return null!==this.objectEntity?this.objectEntity:this.objectEntity=new Nt([{key:"prototype",kind:"init",property:new Nt([],Tt)}],Tt)}}const Fi={"!=":(e,t)=>e!=t,"!==":(e,t)=>e!==t,"%":(e,t)=>e%t,"&":(e,t)=>e&t,"*":(e,t)=>e*t,"**":(e,t)=>e**t,"+":(e,t)=>e+t,"-":(e,t)=>e-t,"/":(e,t)=>e/t,"<":(e,t)=>ee<e<=t,"==":(e,t)=>e==t,"===":(e,t)=>e===t,">":(e,t)=>e>t,">=":(e,t)=>e>=t,">>":(e,t)=>e>>t,">>>":(e,t)=>e>>>t,"^":(e,t)=>e^t,"|":(e,t)=>e|t};function zi(e,t,i){if(i.arguments.length>0)if(i.arguments[i.arguments.length-1].included)for(const s of i.arguments)s.render(e,t);else{let s=i.arguments.length-2;for(;s>=0&&!i.arguments[s].included;)s--;if(s>=0){for(let n=0;n<=s;n++)i.arguments[n].render(e,t);e.remove(Ei(e.original,",",i.arguments[s].end),i.end-1)}else e.remove(Ei(e.original,"(",i.callee.end)+1,i.end-1)}}class ji extends vt{deoptimizeThisOnInteractionAtPath(){}getLiteralValueAtPath(e){return e.length>0||null===this.value&&110!==this.context.code.charCodeAt(this.start)||"bigint"==typeof this.value||47===this.context.code.charCodeAt(this.start)?q:this.value}getReturnExpressionWhenCalledAtPath(e){return 1!==e.length?Y:Je(this.members,e[0])}hasEffectsOnInteractionAtPath(e,t,i){switch(t.type){case 0:return e.length>(null===this.value?0:1);case 1:return!0;case 2:return 1!==e.length||Qe(this.members,e[0],t,i)}}initialise(){this.members=function(e){switch(typeof e){case"boolean":return Ke;case"number":return Xe;case"string":return Ye}return Object.create(null)}(this.value)}parseNode(e){this.value=e.value,this.regex=e.regex,super.parseNode(e)}render(e){"string"==typeof this.value&&e.indentExclusionRanges.push([this.start+1,this.end-1])}}function Ui(e){return e.computed?(t=e.property)instanceof ji?String(t.value):null:e.property.name;var t}function Gi(e){const t=e.propertyKey,i=e.object;if("string"==typeof t){if(i instanceof fi)return[{key:i.name,pos:i.start},{key:t,pos:e.property.start}];if(i instanceof Hi){const s=Gi(i);return s&&[...s,{key:t,pos:e.property.start}]}}return null}class Hi extends vt{constructor(){super(...arguments),this.variable=null,this.assignmentDeoptimized=!1,this.bound=!1,this.expressionsToBeDeoptimized=[],this.replacement=null}bind(){this.bound=!0;const e=Gi(this),t=e&&this.scope.findVariable(e[0].key);if(t&&t.isNamespace){const i=Wi(t,e.slice(1),this.context);i?"string"==typeof i?this.replacement=i:(this.variable=i,this.scope.addNamespaceMemberAccess(function(e){let t=e[0].key;for(let i=1;i{this.expressionsToBeDeoptimized.add(e.thisArg),s.deoptimizeThisOnInteractionAtPath(e,t,i)}),void 0)}getLiteralValueAtPath(e,t,i){const s=this.getReturnExpression(t);return s===Y?q:t.withTrackedEntityAtPath(e,s,(()=>(this.deoptimizableDependentExpressions.push(i),s.getLiteralValueAtPath(e,t,i))),q)}getReturnExpressionWhenCalledAtPath(e,t,i,s){const n=this.getReturnExpression(i);return this.returnExpression===Y?Y:i.withTrackedEntityAtPath(e,n,(()=>(this.deoptimizableDependentExpressions.push(s),n.getReturnExpressionWhenCalledAtPath(e,t,i,s))),Y)}hasEffectsOnInteractionAtPath(e,t,i){const{type:s}=t;if(2===s){if((t.withNew?i.instantiated:i.called).trackEntityAtPathAndGetIfTracked(e,t.args,this))return!1}else if((1===s?i.assigned:i.accessed).trackEntityAtPathAndGetIfTracked(e,this))return!1;return this.getReturnExpression().hasEffectsOnInteractionAtPath(e,t,i)}}class Ki extends Qt{addDeclaration(e,t,i,s){const n=this.variables.get(e.name);return n?(this.parent.addDeclaration(e,t,Ve,s),n.addDeclaration(e,i),n):this.parent.addDeclaration(e,t,i,s)}}class Xi extends Yt{constructor(e,t,i){super(e),this.variables.set("this",this.thisVariable=new Wt("this",null,t,i)),this.instanceScope=new Yt(this),this.instanceScope.variables.set("this",new Li(i))}findLexicalBoundary(){return this}}class Yi extends vt{constructor(){super(...arguments),this.accessedValue=null}deoptimizeCache(){}deoptimizePath(e){this.getAccessedValue().deoptimizePath(e)}deoptimizeThisOnInteractionAtPath(e,t,i){return 0===e.type&&"get"===this.kind&&0===t.length?this.value.deoptimizeThisOnInteractionAtPath({args:Z,thisArg:e.thisArg,type:2,withNew:!1},B,i):1===e.type&&"set"===this.kind&&0===t.length?this.value.deoptimizeThisOnInteractionAtPath({args:e.args,thisArg:e.thisArg,type:2,withNew:!1},B,i):void this.getAccessedValue().deoptimizeThisOnInteractionAtPath(e,t,i)}getLiteralValueAtPath(e,t,i){return this.getAccessedValue().getLiteralValueAtPath(e,t,i)}getReturnExpressionWhenCalledAtPath(e,t,i,s){return this.getAccessedValue().getReturnExpressionWhenCalledAtPath(e,t,i,s)}hasEffects(e){return this.key.hasEffects(e)}hasEffectsOnInteractionAtPath(e,t,i){return"get"===this.kind&&0===t.type&&0===e.length?this.value.hasEffectsOnInteractionAtPath(B,{args:Z,thisArg:t.thisArg,type:2,withNew:!1},i):"set"===this.kind&&1===t.type?this.value.hasEffectsOnInteractionAtPath(B,{args:t.args,thisArg:t.thisArg,type:2,withNew:!1},i):this.getAccessedValue().hasEffectsOnInteractionAtPath(e,t,i)}applyDeoptimizations(){}getAccessedValue(){return null===this.accessedValue?"get"===this.kind?(this.accessedValue=Y,this.accessedValue=this.value.getReturnExpressionWhenCalledAtPath(B,ee,H,this)):this.accessedValue=this.value:this.accessedValue}}class Qi extends Yi{applyDeoptimizations(){}}class Ji extends X{constructor(e,t){super(),this.object=e,this.key=t}deoptimizePath(e){this.object.deoptimizePath([this.key,...e])}deoptimizeThisOnInteractionAtPath(e,t,i){this.object.deoptimizeThisOnInteractionAtPath(e,[this.key,...t],i)}getLiteralValueAtPath(e,t,i){return this.object.getLiteralValueAtPath([this.key,...e],t,i)}getReturnExpressionWhenCalledAtPath(e,t,i,s){return this.object.getReturnExpressionWhenCalledAtPath([this.key,...e],t,i,s)}hasEffectsOnInteractionAtPath(e,t,i){return this.object.hasEffectsOnInteractionAtPath([this.key,...e],t,i)}}class Zi extends vt{constructor(){super(...arguments),this.objectEntity=null}createScope(e){this.scope=new Yt(e)}deoptimizeCache(){this.getObjectEntity().deoptimizeAllProperties()}deoptimizePath(e){this.getObjectEntity().deoptimizePath(e)}deoptimizeThisOnInteractionAtPath(e,t,i){this.getObjectEntity().deoptimizeThisOnInteractionAtPath(e,t,i)}getLiteralValueAtPath(e,t,i){return this.getObjectEntity().getLiteralValueAtPath(e,t,i)}getReturnExpressionWhenCalledAtPath(e,t,i,s){return this.getObjectEntity().getReturnExpressionWhenCalledAtPath(e,t,i,s)}hasEffects(e){var t,i;this.deoptimized||this.applyDeoptimizations();const s=(null===(t=this.superClass)||void 0===t?void 0:t.hasEffects(e))||this.body.hasEffects(e);return null===(i=this.id)||void 0===i||i.markDeclarationReached(),s||super.hasEffects(e)}hasEffectsOnInteractionAtPath(e,t,i){var s;return 2===t.type&&0===e.length?!t.withNew||(null!==this.classConstructor?this.classConstructor.hasEffectsOnInteractionAtPath(e,t,i):null===(s=this.superClass)||void 0===s?void 0:s.hasEffectsOnInteractionAtPath(e,t,i))||!1:this.getObjectEntity().hasEffectsOnInteractionAtPath(e,t,i)}include(e,t){var i;this.deoptimized||this.applyDeoptimizations(),this.included=!0,null===(i=this.superClass)||void 0===i||i.include(e,t),this.body.include(e,t),this.id&&(this.id.markDeclarationReached(),this.id.include())}initialise(){var e;null===(e=this.id)||void 0===e||e.declare("class",this);for(const e of this.body.body)if(e instanceof Qi&&"constructor"===e.kind)return void(this.classConstructor=e);this.classConstructor=null}applyDeoptimizations(){this.deoptimized=!0;for(const e of this.body.body)e.static||e instanceof Qi&&"constructor"===e.kind||e.deoptimizePath(F);this.context.requestTreeshakingPass()}getObjectEntity(){if(null!==this.objectEntity)return this.objectEntity;const e=[],t=[];for(const i of this.body.body){const s=i.static?e:t,n=i.kind;if(s===t&&!n)continue;const r="set"===n||"get"===n?n:"init";let a;if(i.computed){const e=i.key.getLiteralValueAtPath(B,H,this);if("symbol"==typeof e){s.push({key:D,kind:r,property:i});continue}a=String(e)}else a=i.key instanceof fi?i.key.name:String(i.key.value);s.push({key:a,kind:r,property:i})}return e.unshift({key:"prototype",kind:"init",property:new Nt(t,this.superClass?new Ji(this.superClass,"prototype"):Tt)}),this.objectEntity=new Nt(e,this.superClass||Tt)}}class es extends Zi{initialise(){super.initialise(),null!==this.id&&(this.id.variable.isId=!0)}parseNode(e){null!==e.id&&(this.id=new fi(e.id,this,this.scope.parent)),super.parseNode(e)}render(e,t){const{exportNamesByVariable:i,format:s,snippets:{_:n}}=t;"system"===s&&this.id&&i.has(this.id.variable)&&e.appendLeft(this.end,`${n}${Ti([this.id.variable],t)};`),super.render(e,t)}}class ts extends X{constructor(e){super(),this.expressions=e,this.included=!1}deoptimizePath(e){for(const t of this.expressions)t.deoptimizePath(e)}getReturnExpressionWhenCalledAtPath(e,t,i,s){return new ts(this.expressions.map((n=>n.getReturnExpressionWhenCalledAtPath(e,t,i,s))))}hasEffectsOnInteractionAtPath(e,t,i){for(const s of this.expressions)if(s.hasEffectsOnInteractionAtPath(e,t,i))return!0;return!1}}class is extends vt{hasEffects(){return!1}initialise(){this.context.addExport(this)}render(e,t,i){e.remove(i.start,i.end)}applyDeoptimizations(){}}is.prototype.needsBoundaries=!0;class ss extends Bi{initialise(){super.initialise(),null!==this.id&&(this.id.variable.isId=!0)}parseNode(e){null!==e.id&&(this.id=new fi(e.id,this,this.scope.parent)),super.parseNode(e)}}class ns extends vt{include(e,t){super.include(e,t),t&&this.context.includeVariableInModule(this.variable)}initialise(){const e=this.declaration;this.declarationName=e.id&&e.id.name||this.declaration.name,this.variable=this.scope.addExportDefaultDeclaration(this.declarationName||this.context.getModuleName(),this,this.context),this.context.addExport(this)}render(e,t,i){const{start:s,end:n}=i,r=function(e,t){return vi(e,Ei(e,"default",t)+7)}(e.original,this.start);if(this.declaration instanceof ss)this.renderNamedDeclaration(e,r,"function","(",null===this.declaration.id,t);else if(this.declaration instanceof es)this.renderNamedDeclaration(e,r,"class","{",null===this.declaration.id,t);else{if(this.variable.getOriginalVariable()!==this.variable)return void gi(this,e,s,n);if(!this.variable.included)return e.remove(this.start,r),this.declaration.render(e,t,{renderedSurroundingElement:rt}),void(";"!==e.original[this.end-1]&&e.appendLeft(this.end,";"));this.renderVariableDeclaration(e,r,t)}this.declaration.render(e,t)}applyDeoptimizations(){}renderNamedDeclaration(e,t,i,s,n,r){const{exportNamesByVariable:a,format:o,snippets:{getPropertyAccess:l}}=r,h=this.variable.getName(l);e.remove(this.start,t),n&&e.appendLeft(function(e,t,i,s){const n=Ei(e,t,s)+t.length;e=e.slice(n,Ei(e,i,n));const r=Ei(e,"*");return-1===r?n:n+r+1}(e.original,i,s,t),` ${h}`),"system"===o&&this.declaration instanceof es&&a.has(this.variable)&&e.appendLeft(this.end,` ${Ti([this.variable],r)};`)}renderVariableDeclaration(e,t,{format:i,exportNamesByVariable:s,snippets:{cnst:n,getPropertyAccess:r}}){const a=59===e.original.charCodeAt(this.end-1),o="system"===i&&s.get(this.variable);o?(e.overwrite(this.start,t,`${n} ${this.variable.getName(r)} = exports('${o[0]}', `),e.appendRight(a?this.end-1:this.end,")"+(a?"":";"))):(e.overwrite(this.start,t,`${n} ${this.variable.getName(r)} = `),a||e.appendLeft(this.end,";"))}}ns.prototype.needsBoundaries=!0;class rs extends vt{bind(){var e;null===(e=this.declaration)||void 0===e||e.bind()}hasEffects(e){var t;return!!(null===(t=this.declaration)||void 0===t?void 0:t.hasEffects(e))}initialise(){this.context.addExport(this)}render(e,t,i){const{start:s,end:n}=i;null===this.declaration?e.remove(s,n):(e.remove(this.start,this.declaration.start),this.declaration.render(e,t,{end:n,start:s}))}applyDeoptimizations(){}}rs.prototype.needsBoundaries=!0;class as extends ki{constructor(){super(...arguments),this.hoistedDeclarations=[]}addDeclaration(e,t,i,s){return this.hoistedDeclarations.push(e),super.addDeclaration(e,t,i,s)}}const os=Symbol("unset");class ls extends vt{constructor(){super(...arguments),this.testValue=os}deoptimizeCache(){this.testValue=q}hasEffects(e){var t;if(this.test.hasEffects(e))return!0;const i=this.getTestValue();if("symbol"==typeof i){const{brokenFlow:t}=e;if(this.consequent.hasEffects(e))return!0;const i=e.brokenFlow;return e.brokenFlow=t,null!==this.alternate&&(!!this.alternate.hasEffects(e)||(e.brokenFlow=e.brokenFlow{const t=e.variable;return t.included?t.getName(i):""})))].filter(Boolean).join(", ");if(s){const e=this.parent.type,i=e!==ot&&e!==st;t.prependRight(this.start,`${i?"{ ":""}var ${s}; `),i&&t.appendLeft(this.end," }")}}shouldKeepAlternateBranch(){let e=this.parent;do{if(e instanceof ls&&e.alternate)return!0;if(e instanceof Ci)return!1;e=e.parent}while(e);return!1}}class hs extends vt{bind(){}hasEffects(){return!1}initialise(){this.context.addImport(this)}render(e,t,i){e.remove(i.start,i.end)}applyDeoptimizations(){}}hs.prototype.needsBoundaries=!0;const cs="_interopDefault",us="_interopDefaultLegacy",ds="_interopNamespace",ps="_interopNamespaceDefault",fs="_interopNamespaceDefaultOnly",ms="_mergeNamespaces",gs={auto:cs,default:null,defaultOnly:null,esModule:null,false:null,true:us},ys=(e,t)=>"esModule"===e||t&&("auto"===e||"true"===e),xs={auto:ds,default:ps,defaultOnly:fs,esModule:null,false:null,true:ds},Es=(e,t)=>ys(e,t)&&gs[e]===cs,bs=(e,t,i,s,n,r,a)=>{const o=new Set(e);for(const e of Os)t.has(e)&&o.add(e);return Os.map((e=>o.has(e)?vs[e](i,s,n,r,a,o):"")).join("")},vs={[us](e,t,i){const{_:s,getDirectReturnFunction:n,n:r}=t,[a,o]=n(["e"],{functionReturn:!0,lineBreakIndent:null,name:us});return`${a}e${s}&&${s}typeof e${s}===${s}'object'${s}&&${s}'default'${s}in e${s}?${s}${i?Ss(t):As(t)}${o}${r}${r}`},[cs](e,t,i){const{_:s,getDirectReturnFunction:n,n:r}=t,[a,o]=n(["e"],{functionReturn:!0,lineBreakIndent:null,name:cs});return`${a}e${s}&&${s}e.__esModule${s}?${s}${i?Ss(t):As(t)}${o}${r}${r}`},[fs](e,t,i,s,n){const{getDirectReturnFunction:r,getObject:a,n:o}=t,[l,h]=r(["e"],{functionReturn:!0,lineBreakIndent:null,name:fs});return`${l}${$s(s,Ts(n,a([["__proto__","null"],["default","e"]],{lineBreakIndent:null}),t))}${h}${o}${o}`},[ps](e,t,i,s,n){const{_:r,n:a}=t;return`function _interopNamespaceDefault(e)${r}{${a}`+Is(e,e,t,i,s,n)+`}${a}${a}`},[ds](e,t,i,s,n,r){const{_:a,getDirectReturnFunction:o,n:l}=t;if(r.has(ps)){const[e,t]=o(["e"],{functionReturn:!0,lineBreakIndent:null,name:ds});return`${e}e${a}&&${a}e.__esModule${a}?${a}e${a}:${a}_interopNamespaceDefault(e)${t}${l}${l}`}return`function _interopNamespace(e)${a}{${l}${e}if${a}(e${a}&&${a}e.__esModule)${a}return e;${l}`+Is(e,e,t,i,s,n)+`}${l}${l}`},[ms](e,t,i,s,n){const{_:r,cnst:a,n:o}=t,l="var"===a&&i;return`function _mergeNamespaces(n, m)${r}{${o}${e}${ks(`{${o}${e}${e}${e}if${r}(k${r}!==${r}'default'${r}&&${r}!(k in n))${r}{${o}`+(i?l?Cs:Ns:_s)(e,e+e+e+e,t)+`${e}${e}${e}}${o}`+`${e}${e}}`,l,e,t)}${o}${e}return ${$s(s,Ts(n,"n",t))};${o}}${o}${o}`}},Ss=({_:e,getObject:t})=>`e${e}:${e}${t([["default","e"]],{lineBreakIndent:null})}`,As=({_:e,getPropertyAccess:t})=>`e${t("default")}${e}:${e}e`,Is=(e,t,i,s,n,r)=>{const{_:a,cnst:o,getObject:l,getPropertyAccess:h,n:c,s:u}=i,d=`{${c}`+(s?ws:_s)(e,t+e+e,i)+`${t}${e}}`;return`${t}${o} n${a}=${a}Object.create(null${r?`,${a}{${a}[Symbol.toStringTag]:${a}${Ms(l)}${a}}`:""});${c}${t}if${a}(e)${a}{${c}${t}${e}${Ps(d,!s,i)}${c}${t}}${c}${t}n${h("default")}${a}=${a}e;${c}${t}return ${$s(n,"n")}${u}${c}`},Ps=(e,t,{_:i,cnst:s,getFunctionIntro:n,s:r})=>"var"!==s||t?`for${i}(${s} k in e)${i}${e}`:`Object.keys(e).forEach(${n(["k"],{isAsync:!1,name:null})}${e})${r}`,ks=(e,t,i,{_:s,cnst:n,getDirectReturnFunction:r,getFunctionIntro:a,n:o})=>{if(t){const[t,n]=r(["e"],{functionReturn:!1,lineBreakIndent:{base:i,t:i},name:null});return`m.forEach(${t}e${s}&&${s}typeof e${s}!==${s}'string'${s}&&${s}!Array.isArray(e)${s}&&${s}Object.keys(e).forEach(${a(["k"],{isAsync:!1,name:null})}${e})${n});`}return`for${s}(var i${s}=${s}0;${s}i${s}<${s}m.length;${s}i++)${s}{${o}${i}${i}${n} e${s}=${s}m[i];${o}${i}${i}if${s}(typeof e${s}!==${s}'string'${s}&&${s}!Array.isArray(e))${s}{${s}for${s}(${n} k in e)${s}${e}${s}}${o}${i}}`},ws=(e,t,i)=>{const{_:s,n:n}=i;return`${t}if${s}(k${s}!==${s}'default')${s}{${n}`+Cs(e,t+e,i)+`${t}}${n}`},Cs=(e,t,{_:i,cnst:s,getDirectReturnFunction:n,n:r})=>{const[a,o]=n([],{functionReturn:!0,lineBreakIndent:null,name:null});return`${t}${s} d${i}=${i}Object.getOwnPropertyDescriptor(e,${i}k);${r}${t}Object.defineProperty(n,${i}k,${i}d.get${i}?${i}d${i}:${i}{${r}${t}${e}enumerable:${i}true,${r}${t}${e}get:${i}${a}e[k]${o}${r}${t}});${r}`},Ns=(e,t,{_:i,cnst:s,getDirectReturnFunction:n,n:r})=>{const[a,o]=n([],{functionReturn:!0,lineBreakIndent:null,name:null});return`${t}${s} d${i}=${i}Object.getOwnPropertyDescriptor(e,${i}k);${r}${t}if${i}(d)${i}{${r}${t}${e}Object.defineProperty(n,${i}k,${i}d.get${i}?${i}d${i}:${i}{${r}${t}${e}${e}enumerable:${i}true,${r}${t}${e}${e}get:${i}${a}e[k]${o}${r}${t}${e}});${r}${t}}${r}`},_s=(e,t,{_:i,n:s})=>`${t}n[k]${i}=${i}e[k];${s}`,$s=(e,t)=>e?`Object.freeze(${t})`:t,Ts=(e,t,{_:i,getObject:s})=>e?`Object.defineProperty(${t},${i}Symbol.toStringTag,${i}${Ms(s)})`:t,Os=Object.keys(vs);function Ms(e){return e([["value","'Module'"]],{lineBreakIndent:null})}function Rs(e,t,i){return"external"===t?xs[String(i(e instanceof Te?e.id:null))]:"default"===t?fs:null}const Ds={amd:["require"],cjs:["require"],system:["module"]},Ls="ROLLUP_ASSET_URL_",Vs="ROLLUP_CHUNK_URL_",Bs="ROLLUP_FILE_URL_",Fs={amd:["document","module","URL"],cjs:["document","require","URL"],es:[],iife:["document","URL"],system:["module"],umd:["document","require","URL"]},zs={amd:["document","require","URL"],cjs:["document","require","URL"],es:[],iife:["document","URL"],system:["module","URL"],umd:["document","require","URL"]},js=(e,t="URL")=>`new ${t}(${e}).href`,Us=(e,t=!1)=>js(`'${e}', ${t?"typeof document === 'undefined' ? location.href : ":""}document.currentScript && document.currentScript.src || document.baseURI`),Gs=e=>(t,{chunkId:i})=>{const s=e(i);return null===t?`({ url: ${s} })`:"url"===t?s:"undefined"},Hs=(e,t=!1)=>`${t?"typeof document === 'undefined' ? location.href : ":""}(document.currentScript && document.currentScript.src || new URL('${e}', document.baseURI).href)`,Ws={amd:e=>("."!==e[0]&&(e="./"+e),js(`require.toUrl('${e}'), document.baseURI`)),cjs:e=>`(typeof document === 'undefined' ? ${js(`'file:' + __dirname + '/${e}'`,"(require('u' + 'rl').URL)")} : ${Us(e)})`,es:e=>js(`'${e}', import.meta.url`),iife:e=>Us(e),system:e=>js(`'${e}', module.meta.url`),umd:e=>`(typeof document === 'undefined' && typeof location === 'undefined' ? ${js(`'file:' + __dirname + '/${e}'`,"(require('u' + 'rl').URL)")} : ${Us(e,!0)})`},qs={amd:Gs((()=>js("module.uri, document.baseURI"))),cjs:Gs((e=>`(typeof document === 'undefined' ? ${js("'file:' + __filename","(require('u' + 'rl').URL)")} : ${Hs(e)})`)),iife:Gs((e=>Hs(e))),system:(e,{snippets:{getPropertyAccess:t}})=>null===e?"module.meta":`module.meta${t(e)}`,umd:Gs((e=>`(typeof document === 'undefined' && typeof location === 'undefined' ? ${js("'file:' + __filename","(require('u' + 'rl').URL)")} : ${Hs(e,!0)})`))};class Ks extends vt{constructor(){super(...arguments),this.hasCachedEffect=!1}hasEffects(e){if(this.hasCachedEffect)return!0;for(const t of this.body)if(t.hasEffects(e))return this.hasCachedEffect=!0;return!1}include(e,t){this.included=!0;for(const i of this.body)(t||i.shouldBeIncluded(e))&&i.include(e,t)}render(e,t){this.body.length?Ai(this.body,e,this.start,this.end,t):super.render(e,t)}applyDeoptimizations(){}}class Xs extends vt{hasEffects(e){var t;if(null===(t=this.test)||void 0===t?void 0:t.hasEffects(e))return!0;for(const t of this.consequent){if(e.brokenFlow)break;if(t.hasEffects(e))return!0}return!1}include(e,t){var i;this.included=!0,null===(i=this.test)||void 0===i||i.include(e,t);for(const i of this.consequent)(t||i.shouldBeIncluded(e))&&i.include(e,t)}render(e,t,i){if(this.consequent.length){this.test&&this.test.render(e,t);const s=this.test?this.test.end:Ei(e.original,"default",this.start)+7,n=Ei(e.original,":",s)+1;Ai(this.consequent,e,n,i.end,t)}else super.render(e,t)}}Xs.prototype.needsBoundaries=!0;class Ys extends vt{deoptimizeThisOnInteractionAtPath(){}getLiteralValueAtPath(e){return e.length>0||1!==this.quasis.length?q:this.quasis[0].value.cooked}getReturnExpressionWhenCalledAtPath(e){return 1!==e.length?Y:Je(Ye,e[0])}hasEffectsOnInteractionAtPath(e,t,i){return 0===t.type?e.length>1:2!==t.type||1!==e.length||Qe(Ye,e[0],t,i)}render(e,t){e.indentExclusionRanges.push([this.start,this.end]),super.render(e,t)}}class Qs extends te{constructor(){super("undefined")}getLiteralValueAtPath(){}}class Js extends Wt{constructor(e,t,i){super(e,t,t.declaration,i),this.hasId=!1,this.originalId=null,this.originalVariable=null;const s=t.declaration;(s instanceof ss||s instanceof es)&&s.id?(this.hasId=!0,this.originalId=s.id):s instanceof fi&&(this.originalId=s)}addReference(e){this.hasId||(this.name=e.name)}getAssignedVariableName(){return this.originalId&&this.originalId.name||null}getBaseVariableName(){const e=this.getOriginalVariable();return e===this?super.getBaseVariableName():e.getBaseVariableName()}getDirectOriginalVariable(){return!this.originalId||!this.hasId&&(this.originalId.isPossibleTDZ()||this.originalId.variable.isReassigned||this.originalId.variable instanceof Qs||"syntheticNamespace"in this.originalId.variable)?null:this.originalId.variable}getName(e){const t=this.getOriginalVariable();return t===this?super.getName(e):t.getName(e)}getOriginalVariable(){if(this.originalVariable)return this.originalVariable;let e,t=this;const i=new Set;do{i.add(t),e=t,t=e.getDirectOriginalVariable()}while(t instanceof Js&&!i.has(t));return this.originalVariable=t||e}}class Zs extends Yt{constructor(e,t){super(e),this.context=t,this.variables.set("this",new Wt("this",null,Ve,t))}addExportDefaultDeclaration(e,t,i){const s=new Js(e,t,i);return this.variables.set("default",s),s}addNamespaceMemberAccess(){}deconflict(e,t,i){for(const s of this.children)s.deconflict(e,t,i)}findLexicalBoundary(){return this}findVariable(e){const t=this.variables.get(e)||this.accessedOutsideVariables.get(e);if(t)return t;const i=this.context.traceVariable(e)||this.parent.findVariable(e);return i instanceof di&&this.accessedOutsideVariables.set(e,i),i}}const en={"!":e=>!e,"+":e=>+e,"-":e=>-e,delete:()=>q,typeof:e=>typeof e,void:()=>{},"~":e=>~e};function tn(e,t){return null!==e.renderBaseName&&t.has(e)&&e.isReassigned}class sn extends vt{deoptimizePath(){for(const e of this.declarations)e.deoptimizePath(B)}hasEffectsOnInteractionAtPath(){return!1}include(e,t,{asSingleStatement:i}=se){this.included=!0;for(const s of this.declarations)(t||s.shouldBeIncluded(e))&&s.include(e,t),i&&s.id.include(e,t)}initialise(){for(const e of this.declarations)e.declareDeclarator(this.kind)}render(e,t,i=se){if(function(e,t){for(const i of e){if(!i.id.included)return!1;if(i.id.type===at){if(t.has(i.id.variable))return!1}else{const e=[];if(i.id.addExportedVariables(e,t),e.length>0)return!1}}return!0}(this.declarations,t.exportNamesByVariable)){for(const i of this.declarations)i.render(e,t);i.isNoStatement||59===e.original.charCodeAt(this.end-1)||e.appendLeft(this.end,";")}else this.renderReplacedDeclarations(e,t)}applyDeoptimizations(){}renderDeclarationEnd(e,t,i,s,n,r,a){59===e.original.charCodeAt(this.end-1)&&e.remove(this.end-1,this.end),t+=";",null!==i?(10!==e.original.charCodeAt(s-1)||10!==e.original.charCodeAt(this.end)&&13!==e.original.charCodeAt(this.end)||(s--,13===e.original.charCodeAt(s)&&s--),s===i+1?e.overwrite(i,n,t):(e.overwrite(i,i+1,t),e.remove(s,n))):e.appendLeft(n,t),r.length>0&&e.appendLeft(n,` ${Ti(r,a)};`)}renderReplacedDeclarations(e,t){const i=Ii(this.declarations,e,this.start+this.kind.length,this.end-(59===e.original.charCodeAt(this.end-1)?1:0));let s,n;n=vi(e.original,this.start+this.kind.length);let r=n-1;e.remove(this.start,r);let a,o,l=!1,h=!1,c="";const u=[],d=function(e,t,i){var s;let n=null;if("system"===t.format){for(const{node:r}of e)r.id instanceof fi&&r.init&&0===i.length&&1===(null===(s=t.exportNamesByVariable.get(r.id.variable))||void 0===s?void 0:s.length)?(n=r.id.variable,i.push(n)):r.id.addExportedVariables(i,t.exportNamesByVariable);i.length>1?n=null:n&&(i.length=0)}return n}(i,t,u);for(const{node:u,start:p,separator:f,contentEnd:m,end:g}of i)if(u.included){if(u.render(e,t),a="",o="",!u.id.included||u.id instanceof fi&&tn(u.id.variable,t.exportNamesByVariable))h&&(c+=";"),l=!1;else{if(d&&d===u.id.variable){const i=Ei(e.original,"=",u.id.end);Oi(d,vi(e.original,i+1),null===f?m:f,e,t)}l?c+=",":(h&&(c+=";"),a+=`${this.kind} `,l=!0)}n===r+1?e.overwrite(r,n,c+a):(e.overwrite(r,r+1,c),e.appendLeft(n,a)),s=m,n=g,h=!0,r=f,c=""}else e.remove(p,g);this.renderDeclarationEnd(e,c,r,s,n,u,t)}}const nn={ArrayExpression:class extends vt{constructor(){super(...arguments),this.objectEntity=null}deoptimizePath(e){this.getObjectEntity().deoptimizePath(e)}deoptimizeThisOnInteractionAtPath(e,t,i){this.getObjectEntity().deoptimizeThisOnInteractionAtPath(e,t,i)}getLiteralValueAtPath(e,t,i){return this.getObjectEntity().getLiteralValueAtPath(e,t,i)}getReturnExpressionWhenCalledAtPath(e,t,i,s){return this.getObjectEntity().getReturnExpressionWhenCalledAtPath(e,t,i,s)}hasEffectsOnInteractionAtPath(e,t,i){return this.getObjectEntity().hasEffectsOnInteractionAtPath(e,t,i)}applyDeoptimizations(){this.deoptimized=!0;let e=!1;for(let t=0;t0)return void function(e,t,i,s,n,r){const{_:a,getDirectReturnIifeLeft:o}=r.snippets;n.prependRight(t,o(["v"],`${Ti(e,r)},${a}v`,{needsArrowReturnParens:!0,needsWrappedFunction:s})),n.appendLeft(i,")")}(i,o,l,n===rt,e,t)}r.included&&r instanceof Ri&&(n===rt||n===it)&&(e.appendRight(o,"("),e.prependLeft(l,")"))}applyDeoptimizations(){this.deoptimized=!0,this.left.deoptimizePath(B),this.right.deoptimizePath(F),this.context.requestTreeshakingPass()}},AssignmentPattern:class extends vt{addExportedVariables(e,t){this.left.addExportedVariables(e,t)}declare(e,t){return this.left.declare(e,t)}deoptimizePath(e){0===e.length&&this.left.deoptimizePath(e)}hasEffectsOnInteractionAtPath(e,t,i){return e.length>0||this.left.hasEffectsOnInteractionAtPath(B,t,i)}markDeclarationReached(){this.left.markDeclarationReached()}render(e,t,{isShorthandProperty:i}=se){this.left.render(e,t,{isShorthandProperty:i}),this.right.render(e,t)}applyDeoptimizations(){this.deoptimized=!0,this.left.deoptimizePath(B),this.right.deoptimizePath(F),this.context.requestTreeshakingPass()}},AwaitExpression:class extends vt{hasEffects(){return this.deoptimized||this.applyDeoptimizations(),!0}include(e,t){if(this.deoptimized||this.applyDeoptimizations(),!this.included){this.included=!0;e:if(!this.context.usesTopLevelAwait){let e=this.parent;do{if(e instanceof Bi||e instanceof $i)break e}while(e=e.parent);this.context.usesTopLevelAwait=!0}}this.argument.include(e,t)}},BinaryExpression:class extends vt{deoptimizeCache(){}getLiteralValueAtPath(e,t,i){if(e.length>0)return q;const s=this.left.getLiteralValueAtPath(B,t,i);if("symbol"==typeof s)return q;const n=this.right.getLiteralValueAtPath(B,t,i);if("symbol"==typeof n)return q;const r=Fi[this.operator];return r?r(s,n):q}hasEffects(e){return"+"===this.operator&&this.parent instanceof wi&&""===this.left.getLiteralValueAtPath(B,H,this)||super.hasEffects(e)}hasEffectsOnInteractionAtPath(e,{type:t}){return 0!==t||e.length>1}render(e,t,{renderedSurroundingElement:i}=se){this.left.render(e,t,{renderedSurroundingElement:i}),this.right.render(e,t)}},BlockStatement:Ci,BreakStatement:class extends vt{hasEffects(e){if(this.label){if(!e.ignore.labels.has(this.label.name))return!0;e.includedLabels.add(this.label.name),e.brokenFlow=2}else{if(!e.ignore.breaks)return!0;e.brokenFlow=1}return!1}include(e){this.included=!0,this.label&&(this.label.include(),e.includedLabels.add(this.label.name)),e.brokenFlow=this.label?2:1}},CallExpression:class extends qi{bind(){super.bind(),this.callee instanceof fi&&(this.scope.findVariable(this.callee.name).isNamespace&&this.context.warn({code:"CANNOT_CALL_NAMESPACE",message:`Cannot call a namespace ('${this.callee.name}')`},this.start),"eval"===this.callee.name&&this.context.warn({code:"EVAL",message:"Use of eval is strongly discouraged, as it poses security risks and may cause issues with minification",url:"https://rollupjs.org/guide/en/#avoiding-eval"},this.start)),this.interaction={args:this.arguments,thisArg:this.callee instanceof Hi&&!this.callee.variable?this.callee.object:null,type:2,withNew:!1}}hasEffects(e){try{for(const t of this.arguments)if(t.hasEffects(e))return!0;return(!this.context.options.treeshake.annotations||!this.annotations)&&(this.callee.hasEffects(e)||this.callee.hasEffectsOnInteractionAtPath(B,this.interaction,e))}finally{this.deoptimized||this.applyDeoptimizations()}}include(e,t){this.deoptimized||this.applyDeoptimizations(),t?(super.include(e,t),t===bt&&this.callee instanceof fi&&this.callee.variable&&this.callee.variable.markCalledFromTryStatement()):(this.included=!0,this.callee.include(e,!1)),this.callee.includeCallArguments(e,this.arguments)}render(e,t,{renderedSurroundingElement:i}=se){this.callee.render(e,t,{isCalleeOfRenderedParent:!0,renderedSurroundingElement:i}),zi(e,t,this)}applyDeoptimizations(){this.deoptimized=!0,this.interaction.thisArg&&this.callee.deoptimizeThisOnInteractionAtPath(this.interaction,B,H);for(const e of this.arguments)e.deoptimizePath(F);this.context.requestTreeshakingPass()}getReturnExpression(e=H){return null===this.returnExpression?(this.returnExpression=Y,this.returnExpression=this.callee.getReturnExpressionWhenCalledAtPath(B,this.interaction,e,this)):this.returnExpression}},CatchClause:class extends vt{createScope(e){this.scope=new Ki(e,this.context)}parseNode(e){const{param:t}=e;t&&(this.param=new(this.context.getNodeConstructor(t.type))(t,this,this.scope),this.param.declare("parameter",Y)),super.parseNode(e)}},ChainExpression:class extends vt{},ClassBody:class extends vt{createScope(e){this.scope=new Xi(e,this.parent,this.context)}include(e,t){this.included=!0,this.context.includeVariableInModule(this.scope.thisVariable);for(const i of this.body)i.include(e,t)}parseNode(e){const t=this.body=[];for(const i of e.body)t.push(new(this.context.getNodeConstructor(i.type))(i,this,i.static?this.scope:this.scope.instanceScope));super.parseNode(e)}applyDeoptimizations(){}},ClassDeclaration:es,ClassExpression:class extends Zi{render(e,t,{renderedSurroundingElement:i}=se){super.render(e,t),i===rt&&(e.appendRight(this.start,"("),e.prependLeft(this.end,")"))}},ConditionalExpression:class extends vt{constructor(){super(...arguments),this.expressionsToBeDeoptimized=[],this.isBranchResolutionAnalysed=!1,this.usedBranch=null}deoptimizeCache(){if(null!==this.usedBranch){const e=this.usedBranch===this.consequent?this.alternate:this.consequent;this.usedBranch=null,e.deoptimizePath(F);for(const e of this.expressionsToBeDeoptimized)e.deoptimizeCache()}}deoptimizePath(e){const t=this.getUsedBranch();t?t.deoptimizePath(e):(this.consequent.deoptimizePath(e),this.alternate.deoptimizePath(e))}deoptimizeThisOnInteractionAtPath(e,t,i){this.consequent.deoptimizeThisOnInteractionAtPath(e,t,i),this.alternate.deoptimizeThisOnInteractionAtPath(e,t,i)}getLiteralValueAtPath(e,t,i){const s=this.getUsedBranch();return s?(this.expressionsToBeDeoptimized.push(i),s.getLiteralValueAtPath(e,t,i)):q}getReturnExpressionWhenCalledAtPath(e,t,i,s){const n=this.getUsedBranch();return n?(this.expressionsToBeDeoptimized.push(s),n.getReturnExpressionWhenCalledAtPath(e,t,i,s)):new ts([this.consequent.getReturnExpressionWhenCalledAtPath(e,t,i,s),this.alternate.getReturnExpressionWhenCalledAtPath(e,t,i,s)])}hasEffects(e){if(this.test.hasEffects(e))return!0;const t=this.getUsedBranch();return t?t.hasEffects(e):this.consequent.hasEffects(e)||this.alternate.hasEffects(e)}hasEffectsOnInteractionAtPath(e,t,i){const s=this.getUsedBranch();return s?s.hasEffectsOnInteractionAtPath(e,t,i):this.consequent.hasEffectsOnInteractionAtPath(e,t,i)||this.alternate.hasEffectsOnInteractionAtPath(e,t,i)}include(e,t){this.included=!0;const i=this.getUsedBranch();t||this.test.shouldBeIncluded(e)||null===i?(this.test.include(e,t),this.consequent.include(e,t),this.alternate.include(e,t)):i.include(e,t)}includeCallArguments(e,t){const i=this.getUsedBranch();i?i.includeCallArguments(e,t):(this.consequent.includeCallArguments(e,t),this.alternate.includeCallArguments(e,t))}render(e,t,{isCalleeOfRenderedParent:i,preventASI:s,renderedParentType:n,renderedSurroundingElement:r}=se){const a=this.getUsedBranch();if(this.test.included)this.test.render(e,t,{renderedSurroundingElement:r}),this.consequent.render(e,t),this.alternate.render(e,t);else{const o=Ei(e.original,":",this.consequent.end),l=vi(e.original,(this.consequent.included?Ei(e.original,"?",this.test.end):o)+1);s&&Pi(e,l,a.start),e.remove(this.start,l),this.consequent.included&&e.remove(o,this.end),yi(this,e),a.render(e,t,{isCalleeOfRenderedParent:i,preventASI:!0,renderedParentType:n||this.parent.type,renderedSurroundingElement:r||this.parent.type})}}getUsedBranch(){if(this.isBranchResolutionAnalysed)return this.usedBranch;this.isBranchResolutionAnalysed=!0;const e=this.test.getLiteralValueAtPath(B,H,this);return"symbol"==typeof e?null:this.usedBranch=e?this.consequent:this.alternate}},ContinueStatement:class extends vt{hasEffects(e){if(this.label){if(!e.ignore.labels.has(this.label.name))return!0;e.includedLabels.add(this.label.name),e.brokenFlow=2}else{if(!e.ignore.continues)return!0;e.brokenFlow=1}return!1}include(e){this.included=!0,this.label&&(this.label.include(),e.includedLabels.add(this.label.name)),e.brokenFlow=this.label?2:1}},DoWhileStatement:class extends vt{hasEffects(e){if(this.test.hasEffects(e))return!0;const{brokenFlow:t,ignore:{breaks:i,continues:s}}=e;return e.ignore.breaks=!0,e.ignore.continues=!0,!!this.body.hasEffects(e)||(e.ignore.breaks=i,e.ignore.continues=s,e.brokenFlow=t,!1)}include(e,t){this.included=!0,this.test.include(e,t);const{brokenFlow:i}=e;this.body.include(e,t,{asSingleStatement:!0}),e.brokenFlow=i}},EmptyStatement:class extends vt{hasEffects(){return!1}},ExportAllDeclaration:is,ExportDefaultDeclaration:ns,ExportNamedDeclaration:rs,ExportSpecifier:class extends vt{applyDeoptimizations(){}},ExpressionStatement:wi,ForInStatement:class extends vt{createScope(e){this.scope=new ki(e)}hasEffects(e){const{deoptimized:t,left:i,right:s}=this;if(t||this.applyDeoptimizations(),i.hasEffectsAsAssignmentTarget(e,!1)||s.hasEffects(e))return!0;const{brokenFlow:n,ignore:{breaks:r,continues:a}}=e;return e.ignore.breaks=!0,e.ignore.continues=!0,!!this.body.hasEffects(e)||(e.ignore.breaks=r,e.ignore.continues=a,e.brokenFlow=n,!1)}include(e,t){const{body:i,deoptimized:s,left:n,right:r}=this;s||this.applyDeoptimizations(),this.included=!0,n.includeAsAssignmentTarget(e,t||!0,!1),r.include(e,t);const{brokenFlow:a}=e;i.include(e,t,{asSingleStatement:!0}),e.brokenFlow=a}initialise(){this.left.setAssignedValue(Y)}render(e,t){this.left.render(e,t,xi),this.right.render(e,t,xi),110===e.original.charCodeAt(this.right.start-1)&&e.prependLeft(this.right.start," "),this.body.render(e,t)}applyDeoptimizations(){this.deoptimized=!0,this.left.deoptimizePath(B),this.context.requestTreeshakingPass()}},ForOfStatement:class extends vt{createScope(e){this.scope=new ki(e)}hasEffects(){return this.deoptimized||this.applyDeoptimizations(),!0}include(e,t){const{body:i,deoptimized:s,left:n,right:r}=this;s||this.applyDeoptimizations(),this.included=!0,n.includeAsAssignmentTarget(e,t||!0,!1),r.include(e,t);const{brokenFlow:a}=e;i.include(e,t,{asSingleStatement:!0}),e.brokenFlow=a}initialise(){this.left.setAssignedValue(Y)}render(e,t){this.left.render(e,t,xi),this.right.render(e,t,xi),102===e.original.charCodeAt(this.right.start-1)&&e.prependLeft(this.right.start," "),this.body.render(e,t)}applyDeoptimizations(){this.deoptimized=!0,this.left.deoptimizePath(B),this.context.requestTreeshakingPass()}},ForStatement:class extends vt{createScope(e){this.scope=new ki(e)}hasEffects(e){var t,i,s;if((null===(t=this.init)||void 0===t?void 0:t.hasEffects(e))||(null===(i=this.test)||void 0===i?void 0:i.hasEffects(e))||(null===(s=this.update)||void 0===s?void 0:s.hasEffects(e)))return!0;const{brokenFlow:n,ignore:{breaks:r,continues:a}}=e;return e.ignore.breaks=!0,e.ignore.continues=!0,!!this.body.hasEffects(e)||(e.ignore.breaks=r,e.ignore.continues=a,e.brokenFlow=n,!1)}include(e,t){var i,s,n;this.included=!0,null===(i=this.init)||void 0===i||i.include(e,t,{asSingleStatement:!0}),null===(s=this.test)||void 0===s||s.include(e,t);const{brokenFlow:r}=e;null===(n=this.update)||void 0===n||n.include(e,t),this.body.include(e,t,{asSingleStatement:!0}),e.brokenFlow=r}render(e,t){var i,s,n;null===(i=this.init)||void 0===i||i.render(e,t,xi),null===(s=this.test)||void 0===s||s.render(e,t,xi),null===(n=this.update)||void 0===n||n.render(e,t,xi),this.body.render(e,t)}},FunctionDeclaration:ss,FunctionExpression:class extends Bi{render(e,t,{renderedSurroundingElement:i}=se){super.render(e,t),i===rt&&(e.appendRight(this.start,"("),e.prependLeft(this.end,")"))}},Identifier:fi,IfStatement:ls,ImportDeclaration:hs,ImportDefaultSpecifier:class extends vt{applyDeoptimizations(){}},ImportExpression:class extends vt{constructor(){super(...arguments),this.inlineNamespace=null,this.mechanism=null,this.resolution=null}hasEffects(){return!0}include(e,t){this.included||(this.included=!0,this.context.includeDynamicImport(this),this.scope.addAccessedDynamicImport(this)),this.source.include(e,t)}initialise(){this.context.addDynamicImport(this)}render(e,t){if(this.inlineNamespace){const{snippets:{getDirectReturnFunction:i,getPropertyAccess:s}}=t,[n,r]=i([],{functionReturn:!0,lineBreakIndent:null,name:null});e.overwrite(this.start,this.end,`Promise.resolve().then(${n}${this.inlineNamespace.getName(s)}${r})`,{contentOnly:!0})}else this.mechanism&&(e.overwrite(this.start,Ei(e.original,"(",this.start+6)+1,this.mechanism.left,{contentOnly:!0}),e.overwrite(this.end-1,this.end,this.mechanism.right,{contentOnly:!0})),this.source.render(e,t)}renderFinalResolution(e,t,i,{getDirectReturnFunction:s}){if(e.overwrite(this.source.start,this.source.end,t),i){const[t,n]=s(["n"],{functionReturn:!0,lineBreakIndent:null,name:null});e.prependLeft(this.end,`.then(${t}n.${i}${n})`)}}setExternalResolution(e,t,i,s,n,r){const{format:a}=i;this.inlineNamespace=null,this.resolution=t;const o=[...Ds[a]||[]];let l;({helper:l,mechanism:this.mechanism}=this.getDynamicImportMechanismAndHelper(t,e,i,s,n)),l&&o.push(l),o.length>0&&this.scope.addAccessedGlobals(o,r)}setInternalResolution(e){this.inlineNamespace=e}applyDeoptimizations(){}getDynamicImportMechanismAndHelper(e,t,{compact:i,dynamicImportFunction:s,format:n,generatedCode:{arrowFunctions:r},interop:a},{_:o,getDirectReturnFunction:l,getDirectReturnIifeLeft:h},c){const u=c.hookFirstSync("renderDynamicImport",[{customResolution:"string"==typeof this.resolution?this.resolution:null,format:n,moduleId:this.context.module.id,targetModuleId:this.resolution&&"string"!=typeof this.resolution?this.resolution.id:null}]);if(u)return{helper:null,mechanism:u};const d=!this.resolution||"string"==typeof this.resolution;switch(n){case"cjs":{const i=Rs(e,t,a);let s="require(",n=")";i&&(s=`/*#__PURE__*/${i}(${s}`,n+=")");const[o,c]=l([],{functionReturn:!0,lineBreakIndent:null,name:null});return s=`Promise.resolve().then(${o}${s}`,n+=`${c})`,!r&&d&&(s=h(["t"],`${s}t${n}`,{needsArrowReturnParens:!1,needsWrappedFunction:!0}),n=")"),{helper:i,mechanism:{left:s,right:n}}}case"amd":{const s=i?"c":"resolve",n=i?"e":"reject",c=Rs(e,t,a),[u,p]=l(["m"],{functionReturn:!1,lineBreakIndent:null,name:null}),f=c?`${u}${s}(/*#__PURE__*/${c}(m))${p}`:s,[m,g]=l([s,n],{functionReturn:!1,lineBreakIndent:null,name:null});let y=`new Promise(${m}require([`,x=`],${o}${f},${o}${n})${g})`;return!r&&d&&(y=h(["t"],`${y}t${x}`,{needsArrowReturnParens:!1,needsWrappedFunction:!0}),x=")"),{helper:c,mechanism:{left:y,right:x}}}case"system":return{helper:null,mechanism:{left:"module.import(",right:")"}};case"es":if(s)return{helper:null,mechanism:{left:`${s}(`,right:")"}}}return{helper:null,mechanism:null}}},ImportNamespaceSpecifier:class extends vt{applyDeoptimizations(){}},ImportSpecifier:class extends vt{applyDeoptimizations(){}},LabeledStatement:class extends vt{hasEffects(e){const t=e.brokenFlow;return e.ignore.labels.add(this.label.name),!!this.body.hasEffects(e)||(e.ignore.labels.delete(this.label.name),e.includedLabels.has(this.label.name)&&(e.includedLabels.delete(this.label.name),e.brokenFlow=t),!1)}include(e,t){this.included=!0;const i=e.brokenFlow;this.body.include(e,t),(t||e.includedLabels.has(this.label.name))&&(this.label.include(),e.includedLabels.delete(this.label.name),e.brokenFlow=i)}render(e,t){this.label.included?this.label.render(e,t):e.remove(this.start,vi(e.original,Ei(e.original,":",this.label.end)+1)),this.body.render(e,t)}},Literal:ji,LogicalExpression:class extends vt{constructor(){super(...arguments),this.expressionsToBeDeoptimized=[],this.isBranchResolutionAnalysed=!1,this.usedBranch=null}deoptimizeCache(){if(this.usedBranch){const e=this.usedBranch===this.left?this.right:this.left;this.usedBranch=null,e.deoptimizePath(F);for(const e of this.expressionsToBeDeoptimized)e.deoptimizeCache();this.context.requestTreeshakingPass()}}deoptimizePath(e){const t=this.getUsedBranch();t?t.deoptimizePath(e):(this.left.deoptimizePath(e),this.right.deoptimizePath(e))}deoptimizeThisOnInteractionAtPath(e,t,i){this.left.deoptimizeThisOnInteractionAtPath(e,t,i),this.right.deoptimizeThisOnInteractionAtPath(e,t,i)}getLiteralValueAtPath(e,t,i){const s=this.getUsedBranch();return s?(this.expressionsToBeDeoptimized.push(i),s.getLiteralValueAtPath(e,t,i)):q}getReturnExpressionWhenCalledAtPath(e,t,i,s){const n=this.getUsedBranch();return n?(this.expressionsToBeDeoptimized.push(s),n.getReturnExpressionWhenCalledAtPath(e,t,i,s)):new ts([this.left.getReturnExpressionWhenCalledAtPath(e,t,i,s),this.right.getReturnExpressionWhenCalledAtPath(e,t,i,s)])}hasEffects(e){return!!this.left.hasEffects(e)||this.getUsedBranch()!==this.left&&this.right.hasEffects(e)}hasEffectsOnInteractionAtPath(e,t,i){const s=this.getUsedBranch();return s?s.hasEffectsOnInteractionAtPath(e,t,i):this.left.hasEffectsOnInteractionAtPath(e,t,i)||this.right.hasEffectsOnInteractionAtPath(e,t,i)}include(e,t){this.included=!0;const i=this.getUsedBranch();t||i===this.right&&this.left.shouldBeIncluded(e)||!i?(this.left.include(e,t),this.right.include(e,t)):i.include(e,t)}render(e,t,{isCalleeOfRenderedParent:i,preventASI:s,renderedParentType:n,renderedSurroundingElement:r}=se){if(this.left.included&&this.right.included)this.left.render(e,t,{preventASI:s,renderedSurroundingElement:r}),this.right.render(e,t);else{const a=Ei(e.original,this.operator,this.left.end);if(this.right.included){const t=vi(e.original,a+2);e.remove(this.start,t),s&&Pi(e,t,this.right.start)}else e.remove(a,this.end);yi(this,e),this.getUsedBranch().render(e,t,{isCalleeOfRenderedParent:i,preventASI:s,renderedParentType:n||this.parent.type,renderedSurroundingElement:r||this.parent.type})}}getUsedBranch(){if(!this.isBranchResolutionAnalysed){this.isBranchResolutionAnalysed=!0;const e=this.left.getLiteralValueAtPath(B,H,this);if("symbol"==typeof e)return null;this.usedBranch="||"===this.operator&&e||"&&"===this.operator&&!e||"??"===this.operator&&null!=e?this.left:this.right}return this.usedBranch}},MemberExpression:Hi,MetaProperty:class extends vt{addAccessedGlobals(e,t){const i=this.metaProperty,s=(i&&(i.startsWith(Bs)||i.startsWith(Ls)||i.startsWith(Vs))?zs:Fs)[e];s.length>0&&this.scope.addAccessedGlobals(s,t)}getReferencedFileName(e){const t=this.metaProperty;return t&&t.startsWith(Bs)?e.getFileName(t.substring(Bs.length)):null}hasEffects(){return!1}hasEffectsOnInteractionAtPath(e,{type:t}){return e.length>1||0!==t}include(){if(!this.included&&(this.included=!0,"import"===this.meta.name)){this.context.addImportMeta(this);const e=this.parent;this.metaProperty=e instanceof Hi&&"string"==typeof e.propertyKey?e.propertyKey:null}}renderFinalMechanism(e,t,i,s,n){var r;const a=this.parent,o=this.metaProperty;if(o&&(o.startsWith(Bs)||o.startsWith(Ls)||o.startsWith(Vs))){let s,r=null,l=null,h=null;o.startsWith(Bs)?(r=o.substring(Bs.length),s=n.getFileName(r)):o.startsWith(Ls)?(ke(`Using the "${Ls}" prefix to reference files is deprecated. Use the "${Bs}" prefix instead.`,!0,this.context.options),l=o.substring(Ls.length),s=n.getFileName(l)):(ke(`Using the "${Vs}" prefix to reference files is deprecated. Use the "${Bs}" prefix instead.`,!0,this.context.options),h=o.substring(Vs.length),s=n.getFileName(h));const c=N(O($(t),s));let u;return null!==l&&(u=n.hookFirstSync("resolveAssetUrl",[{assetFileName:s,chunkId:t,format:i,moduleId:this.context.module.id,relativeAssetPath:c}])),u||(u=n.hookFirstSync("resolveFileUrl",[{assetReferenceId:l,chunkId:t,chunkReferenceId:h,fileName:s,format:i,moduleId:this.context.module.id,referenceId:r||l||h,relativePath:c}])||Ws[i](c)),void e.overwrite(a.start,a.end,u,{contentOnly:!0})}const l=n.hookFirstSync("resolveImportMeta",[o,{chunkId:t,format:i,moduleId:this.context.module.id}])||(null===(r=qs[i])||void 0===r?void 0:r.call(qs,o,{chunkId:t,snippets:s}));"string"==typeof l&&(a instanceof Hi?e.overwrite(a.start,a.end,l,{contentOnly:!0}):e.overwrite(this.start,this.end,l,{contentOnly:!0}))}},MethodDefinition:Qi,NewExpression:class extends vt{hasEffects(e){try{for(const t of this.arguments)if(t.hasEffects(e))return!0;return(!this.context.options.treeshake.annotations||!this.annotations)&&(this.callee.hasEffects(e)||this.callee.hasEffectsOnInteractionAtPath(B,this.interaction,e))}finally{this.deoptimized||this.applyDeoptimizations()}}hasEffectsOnInteractionAtPath(e,{type:t}){return e.length>0||0!==t}include(e,t){this.deoptimized||this.applyDeoptimizations(),t?super.include(e,t):(this.included=!0,this.callee.include(e,!1)),this.callee.includeCallArguments(e,this.arguments)}initialise(){this.interaction={args:this.arguments,thisArg:null,type:2,withNew:!0}}render(e,t){this.callee.render(e,t),zi(e,t,this)}applyDeoptimizations(){this.deoptimized=!0;for(const e of this.arguments)e.deoptimizePath(F);this.context.requestTreeshakingPass()}},ObjectExpression:class extends vt{constructor(){super(...arguments),this.objectEntity=null}deoptimizeCache(){this.getObjectEntity().deoptimizeAllProperties()}deoptimizePath(e){this.getObjectEntity().deoptimizePath(e)}deoptimizeThisOnInteractionAtPath(e,t,i){this.getObjectEntity().deoptimizeThisOnInteractionAtPath(e,t,i)}getLiteralValueAtPath(e,t,i){return this.getObjectEntity().getLiteralValueAtPath(e,t,i)}getReturnExpressionWhenCalledAtPath(e,t,i,s){return this.getObjectEntity().getReturnExpressionWhenCalledAtPath(e,t,i,s)}hasEffectsOnInteractionAtPath(e,t,i){return this.getObjectEntity().hasEffectsOnInteractionAtPath(e,t,i)}render(e,t,{renderedSurroundingElement:i}=se){super.render(e,t),i!==rt&&i!==it||(e.appendRight(this.start,"("),e.prependLeft(this.end,")"))}applyDeoptimizations(){}getObjectEntity(){if(null!==this.objectEntity)return this.objectEntity;let e=Tt;const t=[];for(const i of this.properties){if(i instanceof St){t.push({key:D,kind:"init",property:i});continue}let s;if(i.computed){const e=i.key.getLiteralValueAtPath(B,H,this);if("symbol"==typeof e){t.push({key:D,kind:i.kind,property:i});continue}s=String(e)}else if(s=i.key instanceof fi?i.key.name:String(i.key.value),"__proto__"===s&&"init"===i.kind){e=i.value instanceof ji&&null===i.value.value?null:i.value;continue}t.push({key:s,kind:i.kind,property:i})}return this.objectEntity=new Nt(t,e)}},ObjectPattern:Ri,PrivateIdentifier:class extends vt{},Program:Ks,Property:class extends Yi{constructor(){super(...arguments),this.declarationInit=null}declare(e,t){return this.declarationInit=t,this.value.declare(e,Y)}hasEffects(e){this.deoptimized||this.applyDeoptimizations();const t=this.context.options.treeshake.propertyReadSideEffects;return"ObjectPattern"===this.parent.type&&"always"===t||this.key.hasEffects(e)||this.value.hasEffects(e)}markDeclarationReached(){this.value.markDeclarationReached()}render(e,t){this.shorthand||this.key.render(e,t),this.value.render(e,t,{isShorthandProperty:this.shorthand})}applyDeoptimizations(){this.deoptimized=!0,null!==this.declarationInit&&(this.declarationInit.deoptimizePath([D,D]),this.context.requestTreeshakingPass())}},PropertyDefinition:class extends vt{deoptimizePath(e){var t;null===(t=this.value)||void 0===t||t.deoptimizePath(e)}deoptimizeThisOnInteractionAtPath(e,t,i){var s;null===(s=this.value)||void 0===s||s.deoptimizeThisOnInteractionAtPath(e,t,i)}getLiteralValueAtPath(e,t,i){return this.value?this.value.getLiteralValueAtPath(e,t,i):q}getReturnExpressionWhenCalledAtPath(e,t,i,s){return this.value?this.value.getReturnExpressionWhenCalledAtPath(e,t,i,s):Y}hasEffects(e){var t;return this.key.hasEffects(e)||this.static&&!!(null===(t=this.value)||void 0===t?void 0:t.hasEffects(e))}hasEffectsOnInteractionAtPath(e,t,i){return!this.value||this.value.hasEffectsOnInteractionAtPath(e,t,i)}applyDeoptimizations(){}},RestElement:Ni,ReturnStatement:class extends vt{hasEffects(e){var t;return!(e.ignore.returnYield&&!(null===(t=this.argument)||void 0===t?void 0:t.hasEffects(e))&&(e.brokenFlow=2,1))}include(e,t){var i;this.included=!0,null===(i=this.argument)||void 0===i||i.include(e,t),e.brokenFlow=2}initialise(){this.scope.addReturnExpression(this.argument||Y)}render(e,t){this.argument&&(this.argument.render(e,t,{preventASI:!0}),this.argument.start===this.start+6&&e.prependLeft(this.start+6," "))}},SequenceExpression:class extends vt{deoptimizePath(e){this.expressions[this.expressions.length-1].deoptimizePath(e)}deoptimizeThisOnInteractionAtPath(e,t,i){this.expressions[this.expressions.length-1].deoptimizeThisOnInteractionAtPath(e,t,i)}getLiteralValueAtPath(e,t,i){return this.expressions[this.expressions.length-1].getLiteralValueAtPath(e,t,i)}hasEffects(e){for(const t of this.expressions)if(t.hasEffects(e))return!0;return!1}hasEffectsOnInteractionAtPath(e,t,i){return this.expressions[this.expressions.length-1].hasEffectsOnInteractionAtPath(e,t,i)}include(e,t){this.included=!0;const i=this.expressions[this.expressions.length-1];for(const s of this.expressions)(t||s===i&&!(this.parent instanceof wi)||s.shouldBeIncluded(e))&&s.include(e,t)}render(e,t,{renderedParentType:i,isCalleeOfRenderedParent:s,preventASI:n}=se){let r=0,a=null;const o=this.expressions[this.expressions.length-1];for(const{node:l,separator:h,start:c,end:u}of Ii(this.expressions,e,this.start,this.end))if(l.included)if(r++,a=h,1===r&&n&&Pi(e,c,l.start),1===r){const n=i||this.parent.type;l.render(e,t,{isCalleeOfRenderedParent:s&&l===o,renderedParentType:n,renderedSurroundingElement:n})}else l.render(e,t);else gi(l,e,c,u);a&&e.remove(a,this.end)}},SpreadElement:St,StaticBlock:class extends vt{createScope(e){this.scope=new ki(e)}hasEffects(e){for(const t of this.body)if(t.hasEffects(e))return!0;return!1}include(e,t){this.included=!0;for(const i of this.body)(t||i.shouldBeIncluded(e))&&i.include(e,t)}render(e,t){this.body.length?Ai(this.body,e,this.start+1,this.end-1,t):super.render(e,t)}},Super:class extends vt{bind(){this.variable=this.scope.findVariable("this")}deoptimizePath(e){this.variable.deoptimizePath(e)}deoptimizeThisOnInteractionAtPath(e,t,i){this.variable.deoptimizeThisOnInteractionAtPath(e,t,i)}include(){this.included||(this.included=!0,this.context.includeVariableInModule(this.variable))}},SwitchCase:Xs,SwitchStatement:class extends vt{createScope(e){this.scope=new ki(e)}hasEffects(e){if(this.discriminant.hasEffects(e))return!0;const{brokenFlow:t,ignore:{breaks:i}}=e;let s=1/0;e.ignore.breaks=!0;for(const i of this.cases){if(i.hasEffects(e))return!0;s=e.brokenFlow=0;r--){const a=this.cases[r];if(a.included&&(n=!0),!n){const e=De();e.ignore.breaks=!0,n=a.hasEffects(e)}n?(a.include(e,t),s=s0&&Ai(this.cases,e,this.cases[0].start,this.end-1,t)}},TaggedTemplateExpression:class extends qi{bind(){if(super.bind(),this.tag.type===at){const e=this.tag.name;this.scope.findVariable(e).isNamespace&&this.context.warn({code:"CANNOT_CALL_NAMESPACE",message:`Cannot call a namespace ('${e}')`},this.start)}}hasEffects(e){try{for(const t of this.quasi.expressions)if(t.hasEffects(e))return!0;return this.tag.hasEffects(e)||this.tag.hasEffectsOnInteractionAtPath(B,this.interaction,e)}finally{this.deoptimized||this.applyDeoptimizations()}}include(e,t){this.deoptimized||this.applyDeoptimizations(),t?super.include(e,t):(this.included=!0,this.tag.include(e,t),this.quasi.include(e,t)),this.tag.includeCallArguments(e,this.interaction.args);const i=this.getReturnExpression();i.included||i.include(e,!1)}initialise(){this.interaction={args:[Y,...this.quasi.expressions],thisArg:this.tag instanceof Hi&&!this.tag.variable?this.tag.object:null,type:2,withNew:!1}}render(e,t){this.tag.render(e,t,{isCalleeOfRenderedParent:!0}),this.quasi.render(e,t)}applyDeoptimizations(){this.deoptimized=!0,this.interaction.thisArg&&this.tag.deoptimizeThisOnInteractionAtPath(this.interaction,B,H);for(const e of this.quasi.expressions)e.deoptimizePath(F);this.context.requestTreeshakingPass()}getReturnExpression(e=H){return null===this.returnExpression?(this.returnExpression=Y,this.returnExpression=this.tag.getReturnExpressionWhenCalledAtPath(B,this.interaction,e,this)):this.returnExpression}},TemplateElement:class extends vt{bind(){}hasEffects(){return!1}include(){this.included=!0}parseNode(e){this.value=e.value,super.parseNode(e)}render(){}},TemplateLiteral:Ys,ThisExpression:class extends vt{bind(){this.variable=this.scope.findVariable("this")}deoptimizePath(e){this.variable.deoptimizePath(e)}deoptimizeThisOnInteractionAtPath(e,t,i){this.variable.deoptimizeThisOnInteractionAtPath(e.thisArg===this?{...e,thisArg:this.variable}:e,t,i)}hasEffectsOnInteractionAtPath(e,t,i){return 0===e.length?0!==t.type:this.variable.hasEffectsOnInteractionAtPath(e,t,i)}include(){this.included||(this.included=!0,this.context.includeVariableInModule(this.variable))}initialise(){this.alias=this.scope.findLexicalBoundary()instanceof Zs?this.context.moduleContext:null,"undefined"===this.alias&&this.context.warn({code:"THIS_IS_UNDEFINED",message:"The 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten",url:"https://rollupjs.org/guide/en/#error-this-is-undefined"},this.start)}render(e){null!==this.alias&&e.overwrite(this.start,this.end,this.alias,{contentOnly:!1,storeName:!0})}},ThrowStatement:class extends vt{hasEffects(){return!0}include(e,t){this.included=!0,this.argument.include(e,t),e.brokenFlow=2}render(e,t){this.argument.render(e,t,{preventASI:!0}),this.argument.start===this.start+5&&e.prependLeft(this.start+5," ")}},TryStatement:class extends vt{constructor(){super(...arguments),this.directlyIncluded=!1,this.includedLabelsAfterBlock=null}hasEffects(e){var t;return(this.context.options.treeshake.tryCatchDeoptimization?this.block.body.length>0:this.block.hasEffects(e))||!!(null===(t=this.finalizer)||void 0===t?void 0:t.hasEffects(e))}include(e,t){var i,s;const n=null===(i=this.context.options.treeshake)||void 0===i?void 0:i.tryCatchDeoptimization,{brokenFlow:r}=e;if(this.directlyIncluded&&n){if(this.includedLabelsAfterBlock)for(const t of this.includedLabelsAfterBlock)e.includedLabels.add(t)}else this.included=!0,this.directlyIncluded=!0,this.block.include(e,n?bt:t),e.includedLabels.size>0&&(this.includedLabelsAfterBlock=[...e.includedLabels]),e.brokenFlow=r;null!==this.handler&&(this.handler.include(e,t),e.brokenFlow=r),null===(s=this.finalizer)||void 0===s||s.include(e,t)}},UnaryExpression:class extends vt{getLiteralValueAtPath(e,t,i){if(e.length>0)return q;const s=this.argument.getLiteralValueAtPath(B,t,i);return"symbol"==typeof s?q:en[this.operator](s)}hasEffects(e){return this.deoptimized||this.applyDeoptimizations(),!("typeof"===this.operator&&this.argument instanceof fi)&&(this.argument.hasEffects(e)||"delete"===this.operator&&this.argument.hasEffectsOnInteractionAtPath(B,J,e))}hasEffectsOnInteractionAtPath(e,{type:t}){return 0!==t||e.length>("void"===this.operator?0:1)}applyDeoptimizations(){this.deoptimized=!0,"delete"===this.operator&&(this.argument.deoptimizePath(B),this.context.requestTreeshakingPass())}},UnknownNode:class extends vt{hasEffects(){return!0}include(e){super.include(e,!0)}},UpdateExpression:class extends vt{hasEffects(e){return this.deoptimized||this.applyDeoptimizations(),this.argument.hasEffectsAsAssignmentTarget(e,!0)}hasEffectsOnInteractionAtPath(e,{type:t}){return e.length>1||0!==t}include(e,t){this.deoptimized||this.applyDeoptimizations(),this.included=!0,this.argument.includeAsAssignmentTarget(e,t,!0)}initialise(){this.argument.setAssignedValue(Y)}render(e,t){const{exportNamesByVariable:i,format:s,snippets:{_:n}}=t;if(this.argument.render(e,t),"system"===s){const s=this.argument.variable,r=i.get(s);if(r)if(this.prefix)1===r.length?Oi(s,this.start,this.end,e,t):Mi(s,this.start,this.end,this.parent.type!==rt,e,t);else{const i=this.operator[0];!function(e,t,i,s,n,r,a){const{_:o}=r.snippets;n.prependRight(t,`${Ti([e],r,a)},${o}`),s&&(n.prependRight(t,"("),n.appendLeft(i,")"))}(s,this.start,this.end,this.parent.type!==rt,e,t,`${n}${i}${n}1`)}}}applyDeoptimizations(){this.deoptimized=!0,this.argument.deoptimizePath(B),this.argument instanceof fi&&(this.scope.findVariable(this.argument.name).isReassigned=!0),this.context.requestTreeshakingPass()}},VariableDeclaration:sn,VariableDeclarator:class extends vt{declareDeclarator(e){this.id.declare(e,this.init||Ve)}deoptimizePath(e){this.id.deoptimizePath(e)}hasEffects(e){var t;const i=null===(t=this.init)||void 0===t?void 0:t.hasEffects(e);return this.id.markDeclarationReached(),i||this.id.hasEffects(e)}include(e,t){var i;this.included=!0,null===(i=this.init)||void 0===i||i.include(e,t),this.id.markDeclarationReached(),(t||this.id.shouldBeIncluded(e))&&this.id.include(e,t)}render(e,t){const{exportNamesByVariable:i,snippets:{_:s}}=t,n=this.id.included;if(n)this.id.render(e,t);else{const t=Ei(e.original,"=",this.id.end);e.remove(this.start,vi(e.original,t+1))}this.init?this.init.render(e,t,n?se:{renderedSurroundingElement:rt}):this.id instanceof fi&&tn(this.id.variable,i)&&e.appendLeft(this.end,`${s}=${s}void 0`)}applyDeoptimizations(){}},WhileStatement:class extends vt{hasEffects(e){if(this.test.hasEffects(e))return!0;const{brokenFlow:t,ignore:{breaks:i,continues:s}}=e;return e.ignore.breaks=!0,e.ignore.continues=!0,!!this.body.hasEffects(e)||(e.ignore.breaks=i,e.ignore.continues=s,e.brokenFlow=t,!1)}include(e,t){this.included=!0,this.test.include(e,t);const{brokenFlow:i}=e;this.body.include(e,t,{asSingleStatement:!0}),e.brokenFlow=i}},YieldExpression:class extends vt{hasEffects(e){var t;return this.deoptimized||this.applyDeoptimizations(),!(e.ignore.returnYield&&!(null===(t=this.argument)||void 0===t?void 0:t.hasEffects(e)))}render(e,t){this.argument&&(this.argument.render(e,t,{preventASI:!0}),this.argument.start===this.start+5&&e.prependLeft(this.start+5," "))}}},rn="_missingExportShim";class an extends te{constructor(e){super(rn),this.module=e}include(){super.include(),this.module.needsExportShim=!0}}class on extends te{constructor(e){super(e.getModuleName()),this.memberVariables=null,this.mergedNamespaces=[],this.referencedEarly=!1,this.references=[],this.context=e,this.module=e.module}addReference(e){this.references.push(e),this.name=e.name}getMemberVariables(){if(this.memberVariables)return this.memberVariables;const e=Object.create(null);for(const t of this.context.getExports().concat(this.context.getReexports()))if("*"!==t[0]&&t!==this.module.info.syntheticNamedExports){const i=this.context.traceExport(t);i&&(e[t]=i)}return this.memberVariables=e}include(){this.included=!0,this.context.includeAllExports()}prepare(e){this.mergedNamespaces.length>0&&this.module.scope.addAccessedGlobals([ms],e)}renderBlock(e){const{exportNamesByVariable:t,format:i,freeze:s,indent:n,namespaceToStringTag:r,snippets:{_:a,cnst:o,getObject:l,getPropertyAccess:h,n:c,s:u}}=e,d=this.getMemberVariables(),p=Object.entries(d).map((([e,t])=>this.referencedEarly||t.isReassigned?[null,`get ${e}${a}()${a}{${a}return ${t.getName(h)}${u}${a}}`]:[e,t.getName(h)]));p.unshift([null,`__proto__:${a}null`]);let f=l(p,{lineBreakIndent:{base:"",t:n}});if(this.mergedNamespaces.length>0){const e=this.mergedNamespaces.map((e=>e.getName(h)));f=`/*#__PURE__*/_mergeNamespaces(${f},${a}[${e.join(`,${a}`)}])`}else r&&(f=`/*#__PURE__*/Object.defineProperty(${f},${a}Symbol.toStringTag,${a}${Ms(l)})`),s&&(f=`/*#__PURE__*/Object.freeze(${f})`);return f=`${o} ${this.getName(h)}${a}=${a}${f};`,"system"===i&&t.has(this)&&(f+=`${c}${Ti([this],e)};`),f}renderFirst(){return this.referencedEarly}setMergedNamespaces(e){this.mergedNamespaces=e;const t=this.context.getModuleExecIndex();for(const e of this.references)if(e.context.getModuleExecIndex()<=t){this.referencedEarly=!0;break}}}on.prototype.isNamespace=!0;class ln extends te{constructor(e,t,i){super(t),this.baseVariable=null,this.context=e,this.module=e.module,this.syntheticNamespace=i}getBaseVariable(){if(this.baseVariable)return this.baseVariable;let e=this.syntheticNamespace;for(;e instanceof Js||e instanceof ln;){if(e instanceof Js){const t=e.getOriginalVariable();if(t===e)break;e=t}e instanceof ln&&(e=e.syntheticNamespace)}return this.baseVariable=e}getBaseVariableName(){return this.syntheticNamespace.getBaseVariableName()}getName(e){return`${this.syntheticNamespace.getName(e)}${e(this.name)}`}include(){this.included=!0,this.context.includeVariableInModule(this.syntheticNamespace)}setRenderNames(e,t){super.setRenderNames(e,t)}}var hn;function cn(e){return e.id}!function(e){e[e.LOAD_AND_PARSE=0]="LOAD_AND_PARSE",e[e.ANALYSE=1]="ANALYSE",e[e.GENERATE=2]="GENERATE"}(hn||(hn={}));var un="performance"in("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:{})?performance:{now:()=>0},dn={memoryUsage:()=>({heapUsed:0})};const pn=()=>{};let fn=new Map;function mn(e,t){switch(t){case 1:return`# ${e}`;case 2:return`## ${e}`;case 3:return e;default:return`${" ".repeat(t-4)}- ${e}`}}function gn(e,t=3){e=mn(e,t);const i=dn.memoryUsage().heapUsed,s=un.now(),n=fn.get(e);void 0===n?fn.set(e,{memory:0,startMemory:i,startTime:s,time:0,totalMemory:0}):(n.startMemory=i,n.startTime=s)}function yn(e,t=3){e=mn(e,t);const i=fn.get(e);if(void 0!==i){const e=dn.memoryUsage().heapUsed;i.memory+=e-i.startMemory,i.time+=un.now()-i.startTime,i.totalMemory=Math.max(i.totalMemory,e)}}function xn(){const e={};for(const[t,{memory:i,time:s,totalMemory:n}]of fn)e[t]=[s,i,n];return e}let En=pn,bn=pn;const vn=["load","resolveDynamicImport","resolveId","transform"];function Sn(e,t){for(const i of vn)if(i in e){let s=`plugin ${t}`;e.name&&(s+=` (${e.name})`),s+=` - ${i}`;const n=e[i];e[i]=function(...e){En(s,4);const t=n.apply(this,e);return bn(s,4),t&&"function"==typeof t.then?(En(`${s} (async)`,4),t.then((e=>(bn(`${s} (async)`,4),e)))):t}}return e}function An(e){e.isExecuted=!0;const t=[e],i=new Set;for(const e of t)for(const s of[...e.dependencies,...e.implicitlyLoadedBefore])s instanceof Te||s.isExecuted||!s.info.moduleSideEffects&&!e.implicitlyLoadedBefore.has(s)||i.has(s.id)||(s.isExecuted=!0,i.add(s.id),t.push(s))}const In={identifier:null,localName:rn};function Pn(e,t,i,s,n=new Map){const r=n.get(t);if(r){if(r.has(e))return s?[null]:fe((a=t,o=e.id,{code:ge.CIRCULAR_REEXPORT,id:o,message:`"${a}" cannot be exported from ${ce(o)} as it is a reexport that references itself.`}));r.add(e)}else n.set(t,new Set([e]));var a,o;return e.getVariableForExportName(t,{importerForSideEffects:i,isExportAllSearch:s,searchedNamesAndModules:n})}class kn{constructor(e,t,i,s,n,r,a){this.graph=e,this.id=t,this.options=i,this.alternativeReexportModules=new Map,this.chunkFileNames=new Set,this.chunkNames=[],this.cycles=new Set,this.dependencies=new Set,this.dynamicDependencies=new Set,this.dynamicImporters=[],this.dynamicImports=[],this.execIndex=1/0,this.implicitlyLoadedAfter=new Set,this.implicitlyLoadedBefore=new Set,this.importDescriptions=new Map,this.importMetas=[],this.importedFromNotTreeshaken=!1,this.importers=[],this.includedDynamicImporters=[],this.includedImports=new Set,this.isExecuted=!1,this.isUserDefinedEntryPoint=!1,this.needsExportShim=!1,this.sideEffectDependenciesByVariable=new Map,this.sources=new Set,this.usesTopLevelAwait=!1,this.allExportNames=null,this.ast=null,this.exportAllModules=[],this.exportAllSources=new Set,this.exportNamesByVariable=null,this.exportShimVariable=new an(this),this.exports=new Map,this.namespaceReexportsByName=new Map,this.reexportDescriptions=new Map,this.relevantDependencies=null,this.syntheticExports=new Map,this.syntheticNamespace=null,this.transformDependencies=[],this.transitiveReexports=null,this.excludeFromSourcemap=/\0/.test(t),this.context=i.moduleContext(t),this.preserveSignature=this.options.preserveEntrySignatures;const o=this,{dynamicImports:l,dynamicImporters:h,implicitlyLoadedAfter:c,implicitlyLoadedBefore:u,importers:d,reexportDescriptions:p,sources:f}=this;this.info={ast:null,code:null,get dynamicallyImportedIdResolutions(){return l.map((({argument:e})=>"string"==typeof e&&o.resolvedIds[e])).filter(Boolean)},get dynamicallyImportedIds(){return l.map((({id:e})=>e)).filter((e=>null!=e))},get dynamicImporters(){return h.sort()},get hasDefaultExport(){return o.ast?o.exports.has("default")||p.has("default"):null},get hasModuleSideEffects(){return ke("Accessing ModuleInfo.hasModuleSideEffects from plugins is deprecated. Please use ModuleInfo.moduleSideEffects instead.",!1,i),this.moduleSideEffects},id:t,get implicitlyLoadedAfterOneOf(){return Array.from(c,cn).sort()},get implicitlyLoadedBefore(){return Array.from(u,cn).sort()},get importedIdResolutions(){return Array.from(f,(e=>o.resolvedIds[e])).filter(Boolean)},get importedIds(){return Array.from(f,(e=>{var t;return null===(t=o.resolvedIds[e])||void 0===t?void 0:t.id})).filter(Boolean)},get importers(){return d.sort()},isEntry:s,isExternal:!1,get isIncluded(){return e.phase!==hn.GENERATE?null:o.isIncluded()},meta:{...a},moduleSideEffects:n,syntheticNamedExports:r},Object.defineProperty(this.info,"hasModuleSideEffects",{enumerable:!1})}basename(){const e=_(this.id),t=T(this.id);return $e(t?e.slice(0,-t.length):e)}bindReferences(){this.ast.bind()}error(e,t){return this.addLocationToLogProps(e,t),fe(e)}getAllExportNames(){if(this.allExportNames)return this.allExportNames;this.allExportNames=new Set([...this.exports.keys(),...this.reexportDescriptions.keys()]);for(const e of this.exportAllModules)if(e instanceof Te)this.allExportNames.add(`*${e.id}`);else for(const t of e.getAllExportNames())"default"!==t&&this.allExportNames.add(t);return"string"==typeof this.info.syntheticNamedExports&&this.allExportNames.delete(this.info.syntheticNamedExports),this.allExportNames}getDependenciesToBeIncluded(){if(this.relevantDependencies)return this.relevantDependencies;this.relevantDependencies=new Set;const e=new Set,t=new Set,i=new Set(this.includedImports);if(this.info.isEntry||this.includedDynamicImporters.length>0||this.namespace.included||this.implicitlyLoadedAfter.size>0)for(const e of[...this.getReexports(),...this.getExports()]){const[t]=this.getVariableForExportName(e);t&&i.add(t)}for(let s of i){const i=this.sideEffectDependenciesByVariable.get(s);if(i)for(const e of i)t.add(e);s instanceof ln?s=s.getBaseVariable():s instanceof Js&&(s=s.getOriginalVariable()),e.add(s.module)}if(this.options.treeshake&&"no-treeshake"!==this.info.moduleSideEffects)this.addRelevantSideEffectDependencies(this.relevantDependencies,e,t);else for(const e of this.dependencies)this.relevantDependencies.add(e);for(const t of e)this.relevantDependencies.add(t);return this.relevantDependencies}getExportNamesByVariable(){if(this.exportNamesByVariable)return this.exportNamesByVariable;const e=new Map;for(const t of this.getAllExportNames()){let[i]=this.getVariableForExportName(t);if(i instanceof Js&&(i=i.getOriginalVariable()),!i||!(i.included||i instanceof ie))continue;const s=e.get(i);s?s.push(t):e.set(i,[t])}return this.exportNamesByVariable=e}getExports(){return Array.from(this.exports.keys())}getReexports(){if(this.transitiveReexports)return this.transitiveReexports;this.transitiveReexports=[];const e=new Set(this.reexportDescriptions.keys());for(const t of this.exportAllModules)if(t instanceof Te)e.add(`*${t.id}`);else for(const i of[...t.getReexports(),...t.getExports()])"default"!==i&&e.add(i);return this.transitiveReexports=[...e]}getRenderedExports(){const e=[],t=[];for(const i of this.exports.keys()){const[s]=this.getVariableForExportName(i);(s&&s.included?e:t).push(i)}return{removedExports:t,renderedExports:e}}getSyntheticNamespace(){return null===this.syntheticNamespace&&(this.syntheticNamespace=void 0,[this.syntheticNamespace]=this.getVariableForExportName("string"==typeof this.info.syntheticNamedExports?this.info.syntheticNamedExports:"default",{onlyExplicit:!0})),this.syntheticNamespace?this.syntheticNamespace:fe((e=this.id,t=this.info.syntheticNamedExports,{code:ge.SYNTHETIC_NAMED_EXPORTS_NEED_NAMESPACE_EXPORT,id:e,message:`Module "${ce(e)}" that is marked with 'syntheticNamedExports: ${JSON.stringify(t)}' needs ${"string"==typeof t&&"default"!==t?`an explicit export named "${t}"`:"a default export"} that does not reexport an unresolved named export of the same module.`}));var e,t}getVariableForExportName(e,{importerForSideEffects:t,isExportAllSearch:i,onlyExplicit:s,searchedNamesAndModules:n}=ne){var r;if("*"===e[0])return 1===e.length?[this.namespace]:this.graph.modulesById.get(e.slice(1)).getVariableForExportName("*");const a=this.reexportDescriptions.get(e);if(a){const[e]=Pn(a.module,a.localName,t,!1,n);return e?(t&&wn(e,t,this),[e]):this.error(be(a.localName,this.id,a.module.id),a.start)}const o=this.exports.get(e);if(o){if(o===In)return[this.exportShimVariable];const e=o.localName,i=this.traceVariable(e,{importerForSideEffects:t,searchedNamesAndModules:n});return t&&(R(t.sideEffectDependenciesByVariable,i,(()=>new Set)).add(this),wn(i,t,this)),[i]}if(s)return[null];if("default"!==e){const i=null!==(r=this.namespaceReexportsByName.get(e))&&void 0!==r?r:this.getVariableFromNamespaceReexports(e,t,n);if(this.namespaceReexportsByName.set(e,i),i[0])return i}return this.info.syntheticNamedExports?[R(this.syntheticExports,e,(()=>new ln(this.astContext,e,this.getSyntheticNamespace())))]:!i&&this.options.shimMissingExports?(this.shimMissingExport(e),[this.exportShimVariable]):[null]}hasEffects(){return"no-treeshake"===this.info.moduleSideEffects||this.ast.included&&this.ast.hasEffects(De())}include(){const e=Re();this.ast.shouldBeIncluded(e)&&this.ast.include(e,!1)}includeAllExports(e){this.isExecuted||(An(this),this.graph.needsTreeshakingPass=!0);for(const t of this.exports.keys())if(e||t!==this.info.syntheticNamedExports){const e=this.getVariableForExportName(t)[0];e.deoptimizePath(F),e.included||this.includeVariable(e)}for(const e of this.getReexports()){const[t]=this.getVariableForExportName(e);t&&(t.deoptimizePath(F),t.included||this.includeVariable(t),t instanceof ie&&(t.module.reexported=!0))}e&&this.namespace.setMergedNamespaces(this.includeAndGetAdditionalMergedNamespaces())}includeAllInBundle(){this.ast.include(Re(),!0),this.includeAllExports(!1)}isIncluded(){return this.ast.included||this.namespace.included||this.importedFromNotTreeshaken}linkImports(){this.addModulesToImportDescriptions(this.importDescriptions),this.addModulesToImportDescriptions(this.reexportDescriptions);const e=[];for(const t of this.exportAllSources){const i=this.graph.modulesById.get(this.resolvedIds[t].id);i instanceof Te?e.push(i):this.exportAllModules.push(i)}this.exportAllModules.push(...e)}render(e){const t=this.magicString.clone();return this.ast.render(t,e),this.usesTopLevelAwait=this.astContext.usesTopLevelAwait,t}setSource({ast:e,code:t,customTransformCache:i,originalCode:s,originalSourcemap:n,resolvedIds:r,sourcemapChain:a,transformDependencies:o,transformFiles:l,...h}){this.info.code=t,this.originalCode=s,this.originalSourcemap=n,this.sourcemapChain=a,l&&(this.transformFiles=l),this.transformDependencies=o,this.customTransformCache=i,this.updateOptions(h),En("generate ast",3),e||(e=this.tryParse()),bn("generate ast",3),this.resolvedIds=r||Object.create(null);const c=this.id;this.magicString=new E(t,{filename:this.excludeFromSourcemap?null:c,indentExclusionRanges:[]}),En("analyse ast",3),this.astContext={addDynamicImport:this.addDynamicImport.bind(this),addExport:this.addExport.bind(this),addImport:this.addImport.bind(this),addImportMeta:this.addImportMeta.bind(this),code:t,deoptimizationTracker:this.graph.deoptimizationTracker,error:this.error.bind(this),fileName:c,getExports:this.getExports.bind(this),getModuleExecIndex:()=>this.execIndex,getModuleName:this.basename.bind(this),getNodeConstructor:e=>nn[e]||nn.UnknownNode,getReexports:this.getReexports.bind(this),importDescriptions:this.importDescriptions,includeAllExports:()=>this.includeAllExports(!0),includeDynamicImport:this.includeDynamicImport.bind(this),includeVariableInModule:this.includeVariableInModule.bind(this),magicString:this.magicString,module:this,moduleContext:this.context,options:this.options,requestTreeshakingPass:()=>this.graph.needsTreeshakingPass=!0,traceExport:e=>this.getVariableForExportName(e)[0],traceVariable:this.traceVariable.bind(this),usesTopLevelAwait:!1,warn:this.warn.bind(this)},this.scope=new Zs(this.graph.scope,this.astContext),this.namespace=new on(this.astContext),this.ast=new Ks(e,{context:this.astContext,type:"Module"},this.scope),this.info.ast=e,bn("analyse ast",3)}toJSON(){return{ast:this.ast.esTreeNode,code:this.info.code,customTransformCache:this.customTransformCache,dependencies:Array.from(this.dependencies,cn),id:this.id,meta:this.info.meta,moduleSideEffects:this.info.moduleSideEffects,originalCode:this.originalCode,originalSourcemap:this.originalSourcemap,resolvedIds:this.resolvedIds,sourcemapChain:this.sourcemapChain,syntheticNamedExports:this.info.syntheticNamedExports,transformDependencies:this.transformDependencies,transformFiles:this.transformFiles}}traceVariable(e,{importerForSideEffects:t,isExportAllSearch:i,searchedNamesAndModules:s}=ne){const n=this.scope.variables.get(e);if(n)return n;const r=this.importDescriptions.get(e);if(r){const e=r.module;if(e instanceof kn&&"*"===r.name)return e.namespace;const[n]=Pn(e,r.name,t||this,i,s);return n||this.error(be(r.name,this.id,e.id),r.start)}return null}tryParse(){try{return this.graph.contextParse(this.info.code)}catch(e){let t=e.message.replace(/ \(\d+:\d+\)$/,"");return this.id.endsWith(".json")?t+=" (Note that you need @rollup/plugin-json to import JSON files)":this.id.endsWith(".js")||(t+=" (Note that you need plugins to import files that are not JavaScript)"),this.error({code:"PARSE_ERROR",message:t,parserError:e},e.pos)}}updateOptions({meta:e,moduleSideEffects:t,syntheticNamedExports:i}){null!=t&&(this.info.moduleSideEffects=t),null!=i&&(this.info.syntheticNamedExports=i),null!=e&&Object.assign(this.info.meta,e)}warn(e,t){this.addLocationToLogProps(e,t),this.options.onwarn(e)}addDynamicImport(e){let t=e.source;t instanceof Ys?1===t.quasis.length&&t.quasis[0].value.cooked&&(t=t.quasis[0].value.cooked):t instanceof ji&&"string"==typeof t.value&&(t=t.value),this.dynamicImports.push({argument:t,id:null,node:e,resolution:null})}addExport(e){if(e instanceof ns)this.exports.set("default",{identifier:e.variable.getAssignedVariableName(),localName:"default"});else if(e instanceof is){const t=e.source.value;if(this.sources.add(t),e.exported){const i=e.exported.name;this.reexportDescriptions.set(i,{localName:"*",module:null,source:t,start:e.start})}else this.exportAllSources.add(t)}else if(e.source instanceof ji){const t=e.source.value;this.sources.add(t);for(const i of e.specifiers){const e=i.exported.name;this.reexportDescriptions.set(e,{localName:i.local.name,module:null,source:t,start:i.start})}}else if(e.declaration){const t=e.declaration;if(t instanceof sn)for(const e of t.declarations)for(const t of Me(e.id))this.exports.set(t,{identifier:null,localName:t});else{const e=t.id.name;this.exports.set(e,{identifier:null,localName:e})}}else for(const t of e.specifiers){const e=t.local.name,i=t.exported.name;this.exports.set(i,{identifier:null,localName:e})}}addImport(e){const t=e.source.value;this.sources.add(t);for(const i of e.specifiers){const e="ImportDefaultSpecifier"===i.type,s="ImportNamespaceSpecifier"===i.type,n=e?"default":s?"*":i.imported.name;this.importDescriptions.set(i.local.name,{module:null,name:n,source:t,start:i.start})}}addImportMeta(e){this.importMetas.push(e)}addLocationToLogProps(e,t){e.id=this.id,e.pos=t;let i=this.info.code;const s=ae(i,t,{offsetLine:1});if(s){let{column:n,line:r}=s;try{({column:n,line:r}=function(e,t){const i=e.filter((e=>!!e.mappings));e:for(;i.length>0;){const e=i.pop().mappings[t.line-1];if(e){const i=e.filter((e=>e.length>1)),s=i[i.length-1];for(const e of i)if(e[0]>=t.column||e===s){t={column:e[3],line:e[2]+1};continue e}}throw new Error("Can't resolve original location of error.")}return t}(this.sourcemapChain,{column:n,line:r})),i=this.originalCode}catch(e){this.options.onwarn({code:"SOURCEMAP_ERROR",id:this.id,loc:{column:n,file:this.id,line:r},message:`Error when using sourcemap for reporting an error: ${e.message}`,pos:t})}me(e,{column:n,line:r},i,this.id)}}addModulesToImportDescriptions(e){for(const t of e.values()){const{id:e}=this.resolvedIds[t.source];t.module=this.graph.modulesById.get(e)}}addRelevantSideEffectDependencies(e,t,i){const s=new Set,n=r=>{for(const a of r)s.has(a)||(s.add(a),t.has(a)?e.add(a):(a.info.moduleSideEffects||i.has(a))&&(a instanceof Te||a.hasEffects()?e.add(a):n(a.dependencies)))};n(this.dependencies),n(i)}getVariableFromNamespaceReexports(e,t,i){let s=null;const n=new Map,r=new Set;for(const a of this.exportAllModules){if(a.info.syntheticNamedExports===e)continue;const[o,l]=Pn(a,e,t,!0,Cn(i));a instanceof Te||l?r.add(o):o instanceof ln?s||(s=o):o&&n.set(o,a)}if(n.size>0){const t=[...n],i=t[0][0];return 1===t.length?[i]:(this.options.onwarn(function(e,t,i){return{code:ge.NAMESPACE_CONFLICT,message:`Conflicting namespaces: "${ce(t)}" re-exports "${e}" from one of the modules ${le(i.map((e=>ce(e))))} (will be ignored)`,name:e,reexporter:t,sources:i}}(e,this.id,t.map((([,e])=>e.id)))),[null])}if(r.size>0){const t=[...r],i=t[0];return t.length>1&&this.options.onwarn(function(e,t,i,s){return{code:ge.AMBIGUOUS_EXTERNAL_NAMESPACES,message:`Ambiguous external namespace resolution: "${ce(t)}" re-exports "${e}" from one of the external modules ${le(s.map((e=>ce(e))))}, guessing "${ce(i)}".`,name:e,reexporter:t,sources:s}}(e,this.id,i.module.id,t.map((e=>e.module.id)))),[i,!0]}return s?[s]:[null]}includeAndGetAdditionalMergedNamespaces(){const e=new Set,t=new Set;for(const i of[this,...this.exportAllModules])if(i instanceof Te){const[t]=i.getVariableForExportName("*");t.include(),this.includedImports.add(t),e.add(t)}else if(i.info.syntheticNamedExports){const e=i.getSyntheticNamespace();e.include(),this.includedImports.add(e),t.add(e)}return[...t,...e]}includeDynamicImport(e){const t=this.dynamicImports.find((t=>t.node===e)).resolution;t instanceof kn&&(t.includedDynamicImporters.push(this),t.includeAllExports(!0))}includeVariable(e){if(!e.included){e.include(),this.graph.needsTreeshakingPass=!0;const t=e.module;if(t instanceof kn&&(t.isExecuted||An(t),t!==this)){const t=function(e,t){const i=R(t.sideEffectDependenciesByVariable,e,(()=>new Set));let s=e;const n=new Set([s]);for(;;){const e=s.module;if(s=s instanceof Js?s.getDirectOriginalVariable():s instanceof ln?s.syntheticNamespace:null,!s||n.has(s))break;n.add(s),i.add(e);const t=e.sideEffectDependenciesByVariable.get(s);if(t)for(const e of t)i.add(e)}return i}(e,this);for(const e of t)e.isExecuted||An(e)}}}includeVariableInModule(e){this.includeVariable(e);const t=e.module;t&&t!==this&&this.includedImports.add(e)}shimMissingExport(e){this.options.onwarn({code:"SHIMMED_EXPORT",exporter:ce(this.id),exportName:e,message:`Missing export "${e}" has been shimmed in module ${ce(this.id)}.`}),this.exports.set(e,In)}}function wn(e,t,i){if(e.module instanceof kn&&e.module!==i){const s=e.module.cycles;if(s.size>0){const n=i.cycles;for(const r of n)if(s.has(r)){t.alternativeReexportModules.set(e,i);break}}}}const Cn=e=>e&&new Map(Array.from(e,(([e,t])=>[e,new Set(t)])));function Nn(e){return e.endsWith(".js")?e.slice(0,-3):e}function _n(e,t){return e.autoId?`${e.basePath?e.basePath+"/":""}${Nn(t)}`:e.id||""}function $n(e,t,i,s,n,r,a,o="return "){const{_:l,cnst:h,getDirectReturnFunction:c,getFunctionIntro:u,getPropertyAccess:d,n:p,s:f}=n;if(!i)return`${p}${p}${o}${function(e,t,i,s,n){if(e.length>0)return e[0].local;for(const{defaultVariableName:e,id:r,isChunk:a,name:o,namedExportsMode:l,namespaceVariableName:h,reexports:c}of t)if(c)return Tn(o,c[0].imported,l,a,e,h,i,r,s,n)}(e,t,s,a,d)};`;let m="";for(const{defaultVariableName:e,id:n,isChunk:o,name:h,namedExportsMode:u,namespaceVariableName:f,reexports:g}of t)if(g&&i)for(const t of g)if("*"!==t.reexported){const i=Tn(h,t.imported,u,o,e,f,s,n,a,d);if(m&&(m+=p),"*"!==t.imported&&t.needsLiveBinding){const[e,s]=c([],{functionReturn:!0,lineBreakIndent:null,name:null});m+=`Object.defineProperty(exports,${l}'${t.reexported}',${l}{${p}${r}enumerable:${l}true,${p}${r}get:${l}${e}${i}${s}${p}});`}else m+=`exports${d(t.reexported)}${l}=${l}${i};`}for(const{exported:t,local:i}of e){const e=`exports${d(t)}`,s=i;e!==s&&(m&&(m+=p),m+=`${e}${l}=${l}${s};`)}for(const{name:e,reexports:s}of t)if(s&&i)for(const t of s)if("*"===t.reexported){m&&(m+=p);const i=`{${p}${r}if${l}(k${l}!==${l}'default'${l}&&${l}!exports.hasOwnProperty(k))${l}${Rn(e,t.needsLiveBinding,r,n)}${f}${p}}`;m+="var"===h&&t.needsLiveBinding?`Object.keys(${e}).forEach(${u(["k"],{isAsync:!1,name:null})}${i});`:`for${l}(${h} k in ${e})${l}${i}`}return m?`${p}${p}${m}`:""}function Tn(e,t,i,s,n,r,a,o,l,h){if("default"===t){if(!s){const t=String(a(o)),i=gs[t]?n:e;return ys(t,l)?`${i}${h("default")}`:i}return i?`${e}${h("default")}`:e}return"*"===t?(s?!i:xs[String(a(o))])?r:e:`${e}${h(t)}`}function On(e){return e([["value","true"]],{lineBreakIndent:null})}function Mn(e,t,i,{_:s,getObject:n}){if(e){if(t)return i?`Object.defineProperties(exports,${s}${n([["__esModule",On(n)],[null,`[Symbol.toStringTag]:${s}${Ms(n)}`]],{lineBreakIndent:null})});`:`Object.defineProperty(exports,${s}'__esModule',${s}${On(n)});`;if(i)return`Object.defineProperty(exports,${s}Symbol.toStringTag,${s}${Ms(n)});`}return""}const Rn=(e,t,i,{_:s,getDirectReturnFunction:n,n:r})=>{if(t){const[t,a]=n([],{functionReturn:!0,lineBreakIndent:null,name:null});return`Object.defineProperty(exports,${s}k,${s}{${r}${i}${i}enumerable:${s}true,${r}${i}${i}get:${s}${t}${e}[k]${a}${r}${i}})`}return`exports[k]${s}=${s}${e}[k]`};function Dn(e,t,i,s,n,r,a,o){const{_:l,cnst:h,n:c}=o,u=new Set,d=[],p=(e,t,i)=>{u.add(t),d.push(`${h} ${e}${l}=${l}/*#__PURE__*/${t}(${i});`)};for(const{defaultVariableName:i,imports:s,id:n,isChunk:r,name:a,namedExportsMode:o,namespaceVariableName:l,reexports:h}of e)if(r){for(const{imported:e,reexported:t}of[...s||[],...h||[]])if("*"===e&&"*"!==t){o||p(l,fs,a);break}}else{const e=String(t(n));let r=!1,o=!1;for(const{imported:t,reexported:n}of[...s||[],...h||[]]){let s,h;"default"===t?r||(r=!0,i!==l&&(h=i,s=gs[e])):"*"===t&&"*"!==n&&(o||(o=!0,s=xs[e],h=l)),s&&p(h,s,a)}}return`${bs(u,r,a,o,i,s,n)}${d.length>0?`${d.join(c)}${c}${c}`:""}`}function Ln(e,t){return"."!==e[0]?e:t?(i=e).endsWith(".js")?i:i+".js":Nn(e);var i}const Vn={assert:!0,buffer:!0,console:!0,constants:!0,domain:!0,events:!0,http:!0,https:!0,os:!0,path:!0,process:!0,punycode:!0,querystring:!0,stream:!0,string_decoder:!0,timers:!0,tty:!0,url:!0,util:!0,vm:!0,zlib:!0};function Bn(e,t){const i=t.map((({id:e})=>e)).filter((e=>e in Vn));i.length&&e({code:"MISSING_NODE_BUILTINS",message:`Creating a browser bundle that depends on Node.js built-in modules (${le(i)}). You might need to include https://github.com/FredKSchott/rollup-plugin-polyfill-node`,modules:i})}const Fn=(e,t)=>e.split(".").map(t).join("");function zn(e,t,i,s,{_:n,getPropertyAccess:r}){const a=e.split(".");a[0]=("function"==typeof i?i(a[0]):i[a[0]])||a[0];const o=a.pop();let l=t,h=a.map((e=>(l+=r(e),`${l}${n}=${n}${l}${n}||${n}{}`))).concat(`${l}${r(o)}`).join(`,${n}`)+`${n}=${n}${s}`;return a.length>0&&(h=`(${h})`),h}function jn(e){let t=e.length;for(;t--;){const{imports:i,reexports:s}=e[t];if(i||s)return e.slice(0,t+1)}return[]}const Un=({dependencies:e,exports:t})=>{const i=new Set(t.map((e=>e.exported)));i.add("default");for(const{reexports:t}of e)if(t)for(const e of t)"*"!==e.reexported&&i.add(e.reexported);return i},Gn=(e,t,{_:i,cnst:s,getObject:n,n:r})=>e?`${r}${t}${s} _starExcludes${i}=${i}${n([...e].map((e=>[e,"1"])),{lineBreakIndent:{base:t,t:t}})};`:"",Hn=(e,t,{_:i,n:s})=>e.length?`${s}${t}var ${e.join(`,${i}`)};`:"",Wn=(e,t,i)=>qn(e.filter((e=>e.hoisted)).map((e=>({name:e.exported,value:e.local}))),t,i);function qn(e,t,{_:i,n:s}){return 0===e.length?"":1===e.length?`exports('${e[0].name}',${i}${e[0].value});${s}${s}`:`exports({${s}`+e.map((({name:e,value:s})=>`${t}${e}:${i}${s}`)).join(`,${s}`)+`${s}});${s}${s}`}const Kn=(e,t,i)=>qn(e.filter((e=>e.expression)).map((e=>({name:e.exported,value:e.local}))),t,i),Xn=(e,t,i)=>qn(e.filter((e=>e.local===rn)).map((e=>({name:e.exported,value:rn}))),t,i);function Yn(e,t,i){return e?`${t}${Fn(e,i)}`:"null"}var Qn={amd:function(e,{accessedGlobals:t,dependencies:i,exports:s,hasExports:n,id:r,indent:a,intro:o,isEntryFacade:l,isModuleFacade:h,namedExportsMode:c,outro:u,snippets:d,warn:p},{amd:f,esModule:m,externalLiveBindings:g,freeze:y,interop:x,namespaceToStringTag:E,strict:b}){Bn(p,i);const v=i.map((e=>`'${Ln(e.id,f.forceJsExtensionForImports)}'`)),S=i.map((e=>e.name)),{n:A,getNonArrowFunctionIntro:I,_:P}=d;c&&n&&(S.unshift("exports"),v.unshift("'exports'")),t.has("require")&&(S.unshift("require"),v.unshift("'require'")),t.has("module")&&(S.unshift("module"),v.unshift("'module'"));const k=_n(f,r),w=(k?`'${k}',${P}`:"")+(v.length?`[${v.join(`,${P}`)}],${P}`:""),C=b?`${P}'use strict';`:"";e.prepend(`${o}${Dn(i,x,g,y,E,t,a,d)}`);const N=$n(s,i,c,x,d,a,g);let _=Mn(c&&n,l&&m,h&&E,d);return _&&(_=A+A+_),e.append(`${N}${_}${u}`),e.indent(a).prepend(`${f.define}(${w}(${I(S,{isAsync:!1,name:null})}{${C}${A}${A}`).append(`${A}${A}}));`)},cjs:function(e,{accessedGlobals:t,dependencies:i,exports:s,hasExports:n,indent:r,intro:a,isEntryFacade:o,isModuleFacade:l,namedExportsMode:h,outro:c,snippets:u},{compact:d,esModule:p,externalLiveBindings:f,freeze:m,interop:g,namespaceToStringTag:y,strict:x}){const{_:E,n:b}=u,v=x?`'use strict';${b}${b}`:"";let S=Mn(h&&n,o&&p,l&&y,u);S&&(S+=b+b);const A=function(e,{_:t,cnst:i,n:s},n){let r="",a=!1;for(const{id:o,name:l,reexports:h,imports:c}of e)h||c?(r+=n&&a?",":`${r?`;${s}`:""}${i} `,a=!0,r+=`${l}${t}=${t}require('${o}')`):(r&&(r+=n&&!a?",":`;${s}`),a=!1,r+=`require('${o}')`);return r?`${r};${s}${s}`:""}(i,u,d),I=Dn(i,g,f,m,y,t,r,u);e.prepend(`${v}${a}${S}${A}${I}`);const P=$n(s,i,h,g,u,r,f,`module.exports${E}=${E}`);return e.append(`${P}${c}`)},es:function(e,{accessedGlobals:t,indent:i,intro:s,outro:n,dependencies:r,exports:a,snippets:o},{externalLiveBindings:l,freeze:h,namespaceToStringTag:c}){const{_:u,n:d}=o,p=function(e,t){const i=[];for(const{id:s,reexports:n,imports:r,name:a}of e)if(n||r){if(r){let e=null,n=null;const a=[];for(const t of r)"default"===t.imported?e=t:"*"===t.imported?n=t:a.push(t);n&&i.push(`import${t}*${t}as ${n.local} from${t}'${s}';`),e&&0===a.length?i.push(`import ${e.local} from${t}'${s}';`):a.length>0&&i.push(`import ${e?`${e.local},${t}`:""}{${t}${a.map((e=>e.imported===e.local?e.imported:`${e.imported} as ${e.local}`)).join(`,${t}`)}${t}}${t}from${t}'${s}';`)}if(n){let e=null;const o=[],l=[];for(const t of n)"*"===t.reexported?e=t:"*"===t.imported?o.push(t):l.push(t);if(e&&i.push(`export${t}*${t}from${t}'${s}';`),o.length>0){r&&r.some((e=>"*"===e.imported&&e.local===a))||i.push(`import${t}*${t}as ${a} from${t}'${s}';`);for(const e of o)i.push(`export${t}{${t}${a===e.reexported?a:`${a} as ${e.reexported}`} };`)}l.length>0&&i.push(`export${t}{${t}${l.map((e=>e.imported===e.reexported?e.imported:`${e.imported} as ${e.reexported}`)).join(`,${t}`)}${t}}${t}from${t}'${s}';`)}}else i.push(`import${t}'${s}';`);return i}(r,u);p.length>0&&(s+=p.join(d)+d+d),(s+=bs(null,t,i,o,l,h,c))&&e.prepend(s);const f=function(e,{_:t,cnst:i}){const s=[],n=[];for(const r of e)r.expression&&s.push(`${i} ${r.local}${t}=${t}${r.expression};`),n.push(r.exported===r.local?r.local:`${r.local} as ${r.exported}`);return n.length&&s.push(`export${t}{${t}${n.join(`,${t}`)}${t}};`),s}(a,o);return f.length&&e.append(d+d+f.join(d).trim()),n&&e.append(n),e.trim()},iife:function(e,{accessedGlobals:t,dependencies:i,exports:s,hasExports:n,indent:r,intro:a,namedExportsMode:o,outro:l,snippets:h,warn:c},{compact:u,esModule:d,extend:p,freeze:f,externalLiveBindings:m,globals:g,interop:y,name:x,namespaceToStringTag:E,strict:b}){const{_:v,getNonArrowFunctionIntro:S,getPropertyAccess:A,n:I}=h,P=x&&x.includes("."),k=!p&&!P;if(x&&k&&(_e(w=x)||Ne.test(w)))return fe({code:"ILLEGAL_IDENTIFIER_AS_NAME",message:`Given name "${x}" is not a legal JS identifier. If you need this, you can try "output.extend: true".`});var w;Bn(c,i);const C=jn(i),N=C.map((e=>e.globalName||"null")),_=C.map((e=>e.name));n&&!x&&c({code:"MISSING_NAME_OPTION_FOR_IIFE_EXPORT",message:'If you do not supply "output.name", you may not be able to access the exports of an IIFE bundle.'}),o&&n&&(p?(N.unshift(`this${Fn(x,A)}${v}=${v}this${Fn(x,A)}${v}||${v}{}`),_.unshift("exports")):(N.unshift("{}"),_.unshift("exports")));const $=b?`${r}'use strict';${I}`:"",T=Dn(i,y,m,f,E,t,r,h);e.prepend(`${a}${T}`);let O=`(${S(_,{isAsync:!1,name:null})}{${I}${$}${I}`;n&&(!x||p&&o||(O=(k?`var ${x}`:`this${Fn(x,A)}`)+`${v}=${v}${O}`),P&&(O=function(e,t,i,{_:s,getPropertyAccess:n,s:r},a){const o=e.split(".");o[0]=("function"==typeof i?i(o[0]):i[o[0]])||o[0],o.pop();let l=t;return o.map((e=>(l+=n(e),`${l}${s}=${s}${l}${s}||${s}{}${r}`))).join(a?",":"\n")+(a&&o.length?";":"\n")}(x,"this",g,h,u)+O));let M=`${I}${I}})(${N.join(`,${v}`)});`;n&&!p&&o&&(M=`${I}${I}${r}return exports;${M}`);const R=$n(s,i,o,y,h,r,m);let D=Mn(o&&n,d,E,h);return D&&(D=I+I+D),e.append(`${R}${D}${l}`),e.indent(r).prepend(O).append(M)},system:function(e,{accessedGlobals:t,dependencies:i,exports:s,hasExports:n,indent:r,intro:a,snippets:o,outro:l,usesTopLevelAwait:h},{externalLiveBindings:c,freeze:u,name:d,namespaceToStringTag:p,strict:f,systemNullSetters:m}){const{_:g,getFunctionIntro:y,getNonArrowFunctionIntro:x,n:E,s:b}=o,{importBindings:v,setters:S,starExcludes:A}=function(e,t,i,{_:s,cnst:n,getObject:r,getPropertyAccess:a,n:o}){const l=[],h=[];let c=null;for(const{imports:u,reexports:d}of e){const p=[];if(u)for(const e of u)l.push(e.local),"*"===e.imported?p.push(`${e.local}${s}=${s}module;`):p.push(`${e.local}${s}=${s}module${a(e.imported)};`);if(d){const o=[];let l=!1;for(const{imported:e,reexported:t}of d)"*"===t?l=!0:o.push([t,"*"===e?"module":`module${a(e)}`]);if(o.length>1||l){const a=r(o,{lineBreakIndent:null});l?(c||(c=Un({dependencies:e,exports:t})),p.push(`${n} setter${s}=${s}${a};`,`for${s}(${n} name in module)${s}{`,`${i}if${s}(!_starExcludes[name])${s}setter[name]${s}=${s}module[name];`,"}","exports(setter);")):p.push(`exports(${a});`)}else{const[e,t]=o[0];p.push(`exports('${e}',${s}${t});`)}}h.push(p.join(`${o}${i}${i}${i}`))}return{importBindings:l,setters:h,starExcludes:c}}(i,s,r,o),I=d?`'${d}',${g}`:"",P=t.has("module")?["exports","module"]:n?["exports"]:[];let k=`System.register(${I}[`+i.map((({id:e})=>`'${e}'`)).join(`,${g}`)+`],${g}(${x(P,{isAsync:!1,name:null})}{${E}${r}${f?"'use strict';":""}`+Gn(A,r,o)+Hn(v,r,o)+`${E}${r}return${g}{${S.length?`${E}${r}${r}setters:${g}[${S.map((e=>e?`${y(["module"],{isAsync:!1,name:null})}{${E}${r}${r}${r}${e}${E}${r}${r}}`:m?"null":`${y([],{isAsync:!1,name:null})}{}`)).join(`,${g}`)}],`:""}${E}`;k+=`${r}${r}execute:${g}(${x([],{isAsync:h,name:null})}{${E}${E}`;const w=`${r}${r}})${E}${r}}${b}${E}}));`;return e.prepend(a+bs(null,t,r,o,c,u,p)+Wn(s,r,o)),e.append(`${l}${E}${E}`+Kn(s,r,o)+Xn(s,r,o)),e.indent(`${r}${r}${r}`).append(w).prepend(k)},umd:function(e,{accessedGlobals:t,dependencies:i,exports:s,hasExports:n,id:r,indent:a,intro:o,namedExportsMode:l,outro:h,snippets:c,warn:u},{amd:d,compact:p,esModule:f,extend:m,externalLiveBindings:g,freeze:y,interop:x,name:E,namespaceToStringTag:b,globals:v,noConflict:S,strict:A}){const{_:I,cnst:P,getFunctionIntro:k,getNonArrowFunctionIntro:w,getPropertyAccess:C,n:N,s:_}=c,$=p?"f":"factory",T=p?"g":"global";if(n&&!E)return fe({code:"MISSING_NAME_OPTION_FOR_IIFE_EXPORT",message:'You must supply "output.name" for UMD bundles that have exports so that the exports are accessible in environments without a module loader.'});Bn(u,i);const O=i.map((e=>`'${Ln(e.id,d.forceJsExtensionForImports)}'`)),M=i.map((e=>`require('${e.id}')`)),R=jn(i),D=R.map((e=>Yn(e.globalName,T,C))),L=R.map((e=>e.name));l&&(n||S)&&(O.unshift("'exports'"),M.unshift("exports"),D.unshift(zn(E,T,v,(m?`${Yn(E,T,C)}${I}||${I}`:"")+"{}",c)),L.unshift("exports"));const V=_n(d,r),B=(V?`'${V}',${I}`:"")+(O.length?`[${O.join(`,${I}`)}],${I}`:""),F=d.define,z=!l&&n?`module.exports${I}=${I}`:"",j=A?`${I}'use strict';${N}`:"";let U;if(S){const e=p?"e":"exports";let t;t=!l&&n?`${P} ${e}${I}=${I}${zn(E,T,v,`${$}(${D.join(`,${I}`)})`,c)};`:`${P} ${e}${I}=${I}${D.shift()};${N}${a}${a}${$}(${[e].concat(D).join(`,${I}`)});`,U=`(${k([],{isAsync:!1,name:null})}{${N}${a}${a}${P} current${I}=${I}${function(e,t,{_:i,getPropertyAccess:s}){let n=t;return e.split(".").map((e=>n+=s(e))).join(`${i}&&${i}`)}(E,T,c)};${N}${a}${a}${t}${N}${a}${a}${e}.noConflict${I}=${I}${k([],{isAsync:!1,name:null})}{${I}${Yn(E,T,C)}${I}=${I}current;${I}return ${e}${_}${I}};${N}${a}})()`}else U=`${$}(${D.join(`,${I}`)})`,!l&&n&&(U=zn(E,T,v,U,c));const G=n||S&&l||D.length>0,H=[$];G&&H.unshift(T);const W=G?`this,${I}`:"",q=G?`(${T}${I}=${I}typeof globalThis${I}!==${I}'undefined'${I}?${I}globalThis${I}:${I}${T}${I}||${I}self,${I}`:"",K=G?")":"",X=G?`${a}typeof exports${I}===${I}'object'${I}&&${I}typeof module${I}!==${I}'undefined'${I}?${I}${z}${$}(${M.join(`,${I}`)})${I}:${N}`:"",Y=`(${w(H,{isAsync:!1,name:null})}{${N}`+X+`${a}typeof ${F}${I}===${I}'function'${I}&&${I}${F}.amd${I}?${I}${F}(${B}${$})${I}:${N}`+`${a}${q}${U}${K};${N}`+`})(${W}(${w(L,{isAsync:!1,name:null})}{${j}${N}`,Q=N+N+"}));";e.prepend(`${o}${Dn(i,x,g,y,b,t,a,c)}`);const J=$n(s,i,l,x,c,a,g);let Z=Mn(l&&n,f,b,c);return Z&&(Z=N+N+Z),e.append(`${J}${Z}${h}`),e.trim().indent(a).append(Q).prepend(Y)}};class Jn{constructor(e,t){this.isOriginal=!0,this.filename=e,this.content=t}traceSegment(e,t,i){return{column:t,line:e,name:i,source:this}}}class Zn{constructor(e,t){this.sources=t,this.names=e.names,this.mappings=e.mappings}traceMappings(){const e=[],t=new Map,i=[],s=[],n=new Map,r=[];for(const a of this.mappings){const o=[];for(const r of a){if(1===r.length)continue;const a=this.sources[r[1]];if(!a)continue;const l=a.traceSegment(r[2],r[3],5===r.length?this.names[r[4]]:"");if(l){const{column:a,line:h,name:c,source:{content:u,filename:d}}=l;let p=t.get(d);if(void 0===p)p=e.length,e.push(d),t.set(d,p),i[p]=u;else if(null==i[p])i[p]=u;else if(null!=u&&i[p]!==u)return fe({message:`Multiple conflicting contents for sourcemap source ${d}`});const f=[r[0],p,h,a];if(c){let e=n.get(c);void 0===e&&(e=s.length,s.push(c),n.set(c,e)),f[4]=e}o.push(f)}}r.push(o)}return{mappings:r,names:s,sources:e,sourcesContent:i}}traceSegment(e,t,i){const s=this.mappings[e];if(!s)return null;let n=0,r=s.length-1;for(;n<=r;){const e=n+r>>1,a=s[e];if(a[0]===t||n===r){if(1==a.length)return null;const e=this.sources[a[1]];return e?e.traceSegment(a[2],a[3],5===a.length?this.names[a[4]]:i):null}a[0]>t?r=e-1:n=e+1}return null}}function er(e){return function(t,i){return i.mappings?new Zn(i,[t]):(e({code:"SOURCEMAP_BROKEN",message:`Sourcemap is likely to be incorrect: a plugin (${i.plugin}) was used to transform files, but didn't generate a sourcemap for the transformation. Consult the plugin documentation for help`,plugin:i.plugin,url:"https://rollupjs.org/guide/en/#warning-sourcemap-is-likely-to-be-incorrect"}),new Zn({mappings:[],names:[]},[t]))}}function tr(e,t,i,s,n){let r;if(i){const t=i.sources,s=i.sourcesContent||[],n=$(e)||".",a=i.sourceRoot||".",o=t.map(((e,t)=>new Jn(M(n,a,e),s[t])));r=new Zn(i,o)}else r=new Jn(e,t);return s.reduce(n,r)}var ir={},sr=nr;function nr(e,t){if(!e)throw new Error(t||"Assertion failed")}nr.equal=function(e,t,i){if(e!=t)throw new Error(i||"Assertion failed: "+e+" != "+t)};var rr={exports:{}};"function"==typeof Object.create?rr.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:rr.exports=function(e,t){if(t){e.super_=t;var i=function(){};i.prototype=t.prototype,e.prototype=new i,e.prototype.constructor=e}};var ar=sr,or=rr.exports;function lr(e,t){return 55296==(64512&e.charCodeAt(t))&&!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1))}function hr(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function cr(e){return 1===e.length?"0"+e:e}function ur(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}ir.inherits=or,ir.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var i=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),n=0;n>6|192,i[s++]=63&r|128):lr(e,n)?(r=65536+((1023&r)<<10)+(1023&e.charCodeAt(++n)),i[s++]=r>>18|240,i[s++]=r>>12&63|128,i[s++]=r>>6&63|128,i[s++]=63&r|128):(i[s++]=r>>12|224,i[s++]=r>>6&63|128,i[s++]=63&r|128)}else for(n=0;n>>0}return r},ir.split32=function(e,t){for(var i=new Array(4*e.length),s=0,n=0;s>>24,i[n+1]=r>>>16&255,i[n+2]=r>>>8&255,i[n+3]=255&r):(i[n+3]=r>>>24,i[n+2]=r>>>16&255,i[n+1]=r>>>8&255,i[n]=255&r)}return i},ir.rotr32=function(e,t){return e>>>t|e<<32-t},ir.rotl32=function(e,t){return e<>>32-t},ir.sum32=function(e,t){return e+t>>>0},ir.sum32_3=function(e,t,i){return e+t+i>>>0},ir.sum32_4=function(e,t,i,s){return e+t+i+s>>>0},ir.sum32_5=function(e,t,i,s,n){return e+t+i+s+n>>>0},ir.sum64=function(e,t,i,s){var n=e[t],r=s+e[t+1]>>>0,a=(r>>0,e[t+1]=r},ir.sum64_hi=function(e,t,i,s){return(t+s>>>0>>0},ir.sum64_lo=function(e,t,i,s){return t+s>>>0},ir.sum64_4_hi=function(e,t,i,s,n,r,a,o){var l=0,h=t;return l+=(h=h+s>>>0)>>0)>>0)>>0},ir.sum64_4_lo=function(e,t,i,s,n,r,a,o){return t+s+r+o>>>0},ir.sum64_5_hi=function(e,t,i,s,n,r,a,o,l,h){var c=0,u=t;return c+=(u=u+s>>>0)>>0)>>0)>>0)>>0},ir.sum64_5_lo=function(e,t,i,s,n,r,a,o,l,h){return t+s+r+o+h>>>0},ir.rotr64_hi=function(e,t,i){return(t<<32-i|e>>>i)>>>0},ir.rotr64_lo=function(e,t,i){return(e<<32-i|t>>>i)>>>0},ir.shr64_hi=function(e,t,i){return e>>>i},ir.shr64_lo=function(e,t,i){return(e<<32-i|t>>>i)>>>0};var dr={},pr=ir,fr=sr;function mr(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}dr.BlockHash=mr,mr.prototype.update=function(e,t){if(e=pr.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var i=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-i,e.length),0===this.pending.length&&(this.pending=null),e=pr.join32(e,0,e.length-i,this.endian);for(var s=0;s>>24&255,s[n++]=e>>>16&255,s[n++]=e>>>8&255,s[n++]=255&e}else for(s[n++]=255&e,s[n++]=e>>>8&255,s[n++]=e>>>16&255,s[n++]=e>>>24&255,s[n++]=0,s[n++]=0,s[n++]=0,s[n++]=0,r=8;r>>3},gr.g1_256=function(e){return yr(e,17)^yr(e,19)^e>>>10};var vr=ir,Sr=dr,Ar=gr,Ir=sr,Pr=vr.sum32,kr=vr.sum32_4,wr=vr.sum32_5,Cr=Ar.ch32,Nr=Ar.maj32,_r=Ar.s0_256,$r=Ar.s1_256,Tr=Ar.g0_256,Or=Ar.g1_256,Mr=Sr.BlockHash,Rr=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function Dr(){if(!(this instanceof Dr))return new Dr;Mr.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=Rr,this.W=new Array(64)}vr.inherits(Dr,Mr);var Lr=Dr;Dr.blockSize=512,Dr.outSize=256,Dr.hmacStrength=192,Dr.padLength=64,Dr.prototype._update=function(e,t){for(var i=this.W,s=0;s<16;s++)i[s]=e[t+s];for(;sVr(),Fr={amd:Ur,cjs:Ur,es:jr,iife:Ur,system:jr,umd:Ur};function zr(e,t,i,s,n,r,a,o,l,h,c,u,d){const p=e.slice().reverse();for(const e of p)e.scope.addUsedOutsideNames(s,n,c,u);!function(e,t,i){for(const s of t){for(const t of s.scope.variables.values())t.included&&!(t.renderBaseName||t instanceof Js&&t.getOriginalVariable()!==t)&&t.setRenderNames(null,Kt(t.name,e));if(i.has(s)){const t=s.namespace;t.setRenderNames(null,Kt(t.name,e))}}}(s,p,d),Fr[n](s,i,t,r,a,o,l,h);for(const e of p)e.scope.deconflict(n,c,u)}function jr(e,t,i,s,n,r,a,o){for(const t of i.dependencies)(n||t instanceof Te)&&(t.variableName=Kt(t.suggestedVariableName,e));for(const i of t){const t=i.module,s=i.name;i.isNamespace&&(n||t instanceof Te)?i.setRenderNames(null,(t instanceof Te?t:a.get(t)).variableName):t instanceof Te&&"default"===s?i.setRenderNames(null,Kt([...t.exportedVariables].some((([e,t])=>"*"===t&&e.included))?t.suggestedVariableName+"__default":t.suggestedVariableName,e)):i.setRenderNames(null,Kt(s,e))}for(const t of o)t.setRenderNames(null,Kt(t.name,e))}function Ur(e,t,{deconflictedDefault:i,deconflictedNamespace:s,dependencies:n},r,a,o,l){for(const t of n)t.variableName=Kt(t.suggestedVariableName,e);for(const t of s)t.namespaceVariableName=Kt(`${t.suggestedVariableName}__namespace`,e);for(const t of i)s.has(t)&&Es(String(r(t.id)),o)?t.defaultVariableName=t.namespaceVariableName:t.defaultVariableName=Kt(`${t.suggestedVariableName}__default`,e);for(const e of t){const t=e.module;if(t instanceof Te){const i=e.name;if("default"===i){const i=String(r(t.id)),s=gs[i]?t.defaultVariableName:t.variableName;ys(i,o)?e.setRenderNames(s,"default"):e.setRenderNames(null,s)}else"*"===i?e.setRenderNames(null,xs[String(r(t.id))]?t.namespaceVariableName:t.variableName):e.setRenderNames(t.variableName,null)}else{const i=l.get(t);a&&e.isNamespace?e.setRenderNames(null,"default"===i.exportMode?i.namespaceVariableName:i.variableName):"default"===i.exportMode?e.setRenderNames(null,i.variableName):e.setRenderNames(i.variableName,i.getVariableExportName(e))}}}const Gr=/[\\'\r\n\u2028\u2029]/,Hr=/(['\r\n\u2028\u2029])/g,Wr=/\\/g;function qr(e){return e.match(Gr)?e.replace(Wr,"\\\\").replace(Hr,"\\$1"):e}function Kr(e,{exports:t,name:i,format:s},n,r,a){const o=e.getExportNames();if("default"===t){if(1!==o.length||"default"!==o[0])return fe(xe("default",o,r))}else if("none"===t&&o.length)return fe(xe("none",o,r));return"auto"===t&&(0===o.length?t="none":1===o.length&&"default"===o[0]?("cjs"===s&&n.has("exports")&&a(function(e){const t=ce(e);return{code:ge.PREFER_NAMED_EXPORTS,id:e,message:`Entry module "${t}" is implicitly using "default" export mode, which means for CommonJS output that its default export is assigned to "module.exports". For many tools, such CommonJS output will not be interchangeable with the original ES module. If this is intended, explicitly set "output.exports" to either "auto" or "default", otherwise you might want to consider changing the signature of "${t}" to use named exports only.`,url:"https://rollupjs.org/guide/en/#outputexports"}}(r)),t="default"):("es"!==s&&"system"!==s&&o.includes("default")&&a(function(e,t){return{code:ge.MIXED_EXPORTS,id:e,message:`Entry module "${ce(e)}" is using named and default exports together. Consumers of your bundle will have to use \`${t||"chunk"}["default"]\` to access the default export, which may not be what you want. Use \`output.exports: "named"\` to disable this warning`,url:"https://rollupjs.org/guide/en/#outputexports"}}(r,i)),t="named")),t}function Xr(e){const t=e.split("\n"),i=t.filter((e=>/^\t+/.test(e))),s=t.filter((e=>/^ {2,}/.test(e)));if(0===i.length&&0===s.length)return null;if(i.length>=s.length)return"\t";const n=s.reduce(((e,t)=>{const i=/^ +/.exec(t)[0].length;return Math.min(i,e)}),1/0);return new Array(n+1).join(" ")}function Yr(e,t,i,s,n){const r=e.getDependenciesToBeIncluded();for(const e of r){if(e instanceof Te){t.push(e);continue}const r=n.get(e);r===s?i.has(e)||(i.add(e),Yr(e,t,i,s,n)):t.push(r)}}function Qr(e){if(!e)return null;if("string"==typeof e&&(e=JSON.parse(e)),""===e.mappings)return{mappings:[],names:[],sources:[],version:3};const t="string"==typeof e.mappings?function(e){for(var t=[],s=[],n=[0,0,0,0,0],a=0,o=0,l=0,h=0;o>>=1,p&&(h=0===h?-2147483648:-h),n[a]+=h,a++,h=l=0}}}return r(s,n,a),t.push(s),t}(e.mappings):e.mappings;return{...e,mappings:t}}const Jr=Symbol("bundleKeys"),Zr={type:"placeholder"};function ea(e,t,i){return ue(e)?fe(Ie(`Invalid pattern "${e}" for "${t}", patterns can be neither absolute nor relative paths. If you want your files to be stored in a subdirectory, write its name without a leading slash like this: subdirectory/pattern.`)):e.replace(/\[(\w+)\]/g,((e,s)=>{if(!i.hasOwnProperty(s))return fe(Ie(`"[${s}]" is not a valid placeholder in "${t}" pattern.`));const n=i[s]();return ue(n)?fe(Ie(`Invalid substitution "${n}" for placeholder "[${s}]" in "${t}" pattern, can be neither absolute nor relative path.`)):n}))}function ta(e,{[Jr]:t}){if(!t.has(e.toLowerCase()))return e;const i=T(e);e=e.substring(0,e.length-i.length);let s,n=1;for(;t.has((s=e+ ++n+i).toLowerCase()););return s}const ia=[".js",".jsx",".ts",".tsx"];function sa(e,t,i,s){const n="function"==typeof t?t(e.id):t[e.id];return n||(i?(s({code:"MISSING_GLOBAL_NAME",guess:e.variableName,message:`No name was provided for external module '${e.id}' in output.globals – guessing '${e.variableName}'`,source:e.id}),e.variableName):void 0)}class na{constructor(e,t,i,s,n,r,a,o,l,h){this.orderedModules=e,this.inputOptions=t,this.outputOptions=i,this.unsetOptions=s,this.pluginDriver=n,this.modulesById=r,this.chunkByModule=a,this.facadeChunkByModule=o,this.includedNamespaces=l,this.manualChunkAlias=h,this.entryModules=[],this.exportMode="named",this.facadeModule=null,this.id=null,this.namespaceVariableName="",this.needsExportsShim=!1,this.variableName="",this.accessedGlobalsByScope=new Map,this.dependencies=new Set,this.dynamicDependencies=new Set,this.dynamicEntryModules=[],this.dynamicName=null,this.exportNamesByVariable=new Map,this.exports=new Set,this.exportsByName=new Map,this.fileName=null,this.implicitEntryModules=[],this.implicitlyLoadedBefore=new Set,this.imports=new Set,this.includedReexportsByModule=new Map,this.indentString=void 0,this.isEmpty=!0,this.name=null,this.renderedDependencies=null,this.renderedExports=null,this.renderedHash=void 0,this.renderedModuleSources=new Map,this.renderedModules=Object.create(null),this.renderedSource=null,this.sortedExportNames=null,this.strictFacade=!1,this.usedModules=void 0,this.execIndex=e.length>0?e[0].execIndex:1/0;const c=new Set(e);for(const t of e){t.namespace.included&&l.add(t),this.isEmpty&&t.isIncluded()&&(this.isEmpty=!1),(t.info.isEntry||i.preserveModules)&&this.entryModules.push(t);for(const e of t.includedDynamicImporters)c.has(e)||(this.dynamicEntryModules.push(t),t.info.syntheticNamedExports&&!i.preserveModules&&(l.add(t),this.exports.add(t.namespace)));t.implicitlyLoadedAfter.size>0&&this.implicitEntryModules.push(t)}this.suggestedVariableName=$e(this.generateVariableName())}static generateFacade(e,t,i,s,n,r,a,o,l,h){const c=new na([],e,t,i,s,n,r,a,o,null);c.assignFacadeName(h,l),a.has(l)||a.set(l,c);for(const e of l.getDependenciesToBeIncluded())c.dependencies.add(e instanceof kn?r.get(e):e);return!c.dependencies.has(r.get(l))&&l.info.moduleSideEffects&&l.hasEffects()&&c.dependencies.add(r.get(l)),c.ensureReexportsAreAvailableForModule(l),c.facadeModule=l,c.strictFacade=!0,c}canModuleBeFacade(e,t){const i=e.getExportNamesByVariable();for(const t of this.exports)if(!i.has(t))return 0===i.size&&e.isUserDefinedEntryPoint&&"strict"===e.preserveSignature&&this.unsetOptions.has("preserveEntrySignatures")&&this.inputOptions.onwarn({code:"EMPTY_FACADE",id:e.id,message:`To preserve the export signature of the entry module "${ce(e.id)}", an empty facade chunk was created. This often happens when creating a bundle for a web app where chunks are placed in script tags and exports are ignored. In this case it is recommended to set "preserveEntrySignatures: false" to avoid this and reduce the number of chunks. Otherwise if this is intentional, set "preserveEntrySignatures: 'strict'" explicitly to silence this warning.`,url:"https://rollupjs.org/guide/en/#preserveentrysignatures"}),!1;for(const s of t)if(!i.has(s)&&s.module!==e)return!1;return!0}generateExports(){this.sortedExportNames=null;const e=new Set(this.exports);if(null!==this.facadeModule&&(!1!==this.facadeModule.preserveSignature||this.strictFacade)){const t=this.facadeModule.getExportNamesByVariable();for(const[i,s]of t){this.exportNamesByVariable.set(i,[...s]);for(const e of s)this.exportsByName.set(e,i);e.delete(i)}}this.outputOptions.minifyInternalExports?function(e,t,i){let s=0;for(const n of e){let[e]=n.name;if(t.has(e))do{e=qt(++s),49===e.charCodeAt(0)&&(s+=9*64**(e.length-1),e=qt(s))}while(Ce.has(e)||t.has(e));t.set(e,n),i.set(n,[e])}}(e,this.exportsByName,this.exportNamesByVariable):function(e,t,i){for(const s of e){let e=0,n=s.name;for(;t.has(n);)n=s.name+"$"+ ++e;t.set(n,s),i.set(s,[n])}}(e,this.exportsByName,this.exportNamesByVariable),(this.outputOptions.preserveModules||this.facadeModule&&this.facadeModule.info.isEntry)&&(this.exportMode=Kr(this,this.outputOptions,this.unsetOptions,this.facadeModule.id,this.inputOptions.onwarn))}generateFacades(){var e;const t=[],i=new Set([...this.entryModules,...this.implicitEntryModules]),s=new Set(this.dynamicEntryModules.map((({namespace:e})=>e)));for(const e of i)if(e.preserveSignature)for(const t of e.getExportNamesByVariable().keys())s.add(t);for(const e of i){const i=Array.from(new Set(e.chunkNames.filter((({isUserDefined:e})=>e)).map((({name:e})=>e))),(e=>({name:e})));if(0===i.length&&e.isUserDefinedEntryPoint&&i.push({}),i.push(...Array.from(e.chunkFileNames,(e=>({fileName:e})))),0===i.length&&i.push({}),!this.facadeModule){const t="strict"===e.preserveSignature||"exports-only"===e.preserveSignature&&0!==e.getExportNamesByVariable().size;(!t||this.outputOptions.preserveModules||this.canModuleBeFacade(e,s))&&(this.facadeModule=e,this.facadeChunkByModule.set(e,this),e.preserveSignature&&(this.strictFacade=t),this.assignFacadeName(i.shift(),e))}for(const s of i)t.push(na.generateFacade(this.inputOptions,this.outputOptions,this.unsetOptions,this.pluginDriver,this.modulesById,this.chunkByModule,this.facadeChunkByModule,this.includedNamespaces,e,s))}for(const t of this.dynamicEntryModules)t.info.syntheticNamedExports||(!this.facadeModule&&this.canModuleBeFacade(t,s)?(this.facadeModule=t,this.facadeChunkByModule.set(t,this),this.strictFacade=!0,this.dynamicName=ra(t)):this.facadeModule===t&&!this.strictFacade&&this.canModuleBeFacade(t,s)?this.strictFacade=!0:(null===(e=this.facadeChunkByModule.get(t))||void 0===e?void 0:e.strictFacade)||(this.includedNamespaces.add(t),this.exports.add(t.namespace)));return this.outputOptions.preserveModules||this.addNecessaryImportsForFacades(),t}generateId(e,t,i,s){if(null!==this.fileName)return this.fileName;const[n,r]=this.facadeModule&&this.facadeModule.isUserDefinedEntryPoint?[t.entryFileNames,"output.entryFileNames"]:[t.chunkFileNames,"output.chunkFileNames"];return ta(ea("function"==typeof n?n(this.getChunkInfo()):n,r,{format:()=>t.format,hash:()=>s?this.computeContentHashWithDependencies(e,t,i):"[hash]",name:()=>this.getChunkName()}),i)}generateIdPreserveModules(e,t,i,s){const[{id:n}]=this.orderedModules,r=this.outputOptions.sanitizeFileName(n.split(aa,1)[0]);let a;const o=s.has("entryFileNames")?"[name][assetExtname].js":t.entryFileNames,l="function"==typeof o?o(this.getChunkInfo()):o;if(w(r)){const i=$(r),s=T(r),n=`${i}/${ea(l,"output.entryFileNames",{assetExtname:()=>ia.includes(s)?"":s,ext:()=>s.substring(1),extname:()=>s,format:()=>t.format,name:()=>this.getChunkName()})}`,{preserveModulesRoot:o}=t;a=o&&M(n).startsWith(o)?n.slice(o.length).replace(/^[\\/]/,""):O(e,n)}else{const e=T(r);a=`_virtual/${ea(l,"output.entryFileNames",{assetExtname:()=>ia.includes(e)?"":e,ext:()=>e.substring(1),extname:()=>e,format:()=>t.format,name:()=>he(r)})}`}return ta(N(a),i)}getChunkInfo(){const e=this.facadeModule,t=this.getChunkName.bind(this);return{exports:this.getExportNames(),facadeModuleId:e&&e.id,isDynamicEntry:this.dynamicEntryModules.length>0,isEntry:null!==e&&e.info.isEntry,isImplicitEntry:this.implicitEntryModules.length>0,modules:this.renderedModules,get name(){return t()},type:"chunk"}}getChunkInfoWithFileNames(){return Object.assign(this.getChunkInfo(),{code:void 0,dynamicImports:Array.from(this.dynamicDependencies,cn),fileName:this.id,implicitlyLoadedBefore:Array.from(this.implicitlyLoadedBefore,cn),importedBindings:this.getImportedBindingsPerDependency(),imports:Array.from(this.dependencies,cn),map:void 0,referencedFiles:this.getReferencedFiles()})}getChunkName(){var e;return null!==(e=this.name)&&void 0!==e?e:this.name=this.outputOptions.sanitizeFileName(this.getFallbackChunkName())}getExportNames(){var e;return null!==(e=this.sortedExportNames)&&void 0!==e?e:this.sortedExportNames=Array.from(this.exportsByName.keys()).sort()}getRenderedHash(){if(this.renderedHash)return this.renderedHash;const e=Br(),t=this.pluginDriver.hookReduceValueSync("augmentChunkHash","",[this.getChunkInfo()],((e,t)=>(t&&(e+=t),e)));return e.update(t),e.update(this.renderedSource.toString()),e.update(this.getExportNames().map((e=>{const t=this.exportsByName.get(e);return`${ce(t.module.id).replace(/\\/g,"/")}:${t.name}:${e}`})).join(",")),this.renderedHash=e.digest("hex")}getVariableExportName(e){return this.outputOptions.preserveModules&&e instanceof on?"*":this.exportNamesByVariable.get(e)[0]}link(){this.dependencies=function(e,t,i){const s=[],n=new Set;for(let r=t.length-1;r>=0;r--){const a=t[r];if(!n.has(a)){const t=[];Yr(a,t,n,e,i),s.unshift(t)}}const r=new Set;for(const e of s)for(const t of e)r.add(t);return r}(this,this.orderedModules,this.chunkByModule);for(const e of this.orderedModules)this.addDependenciesToChunk(e.dynamicDependencies,this.dynamicDependencies),this.addDependenciesToChunk(e.implicitlyLoadedBefore,this.implicitlyLoadedBefore),this.setUpChunkImportsAndExportsForModule(e)}preRender(e,t,i){const{_:s,getPropertyAccess:n,n:r}=i,a=new v({separator:`${r}${r}`});this.usedModules=[],this.indentString=function(e,t){if(!0!==t.indent)return t.indent;for(const t of e){const e=Xr(t.originalCode);if(null!==e)return e}return"\t"}(this.orderedModules,e);const o={dynamicImportFunction:e.dynamicImportFunction,exportNamesByVariable:this.exportNamesByVariable,format:e.format,freeze:e.freeze,indent:this.indentString,namespaceToStringTag:e.namespaceToStringTag,outputPluginDriver:this.pluginDriver,snippets:i};if(e.hoistTransitiveImports&&!this.outputOptions.preserveModules&&null!==this.facadeModule)for(const e of this.dependencies)e instanceof na&&this.inlineChunkDependencies(e);this.prepareModulesForRendering(i),this.setIdentifierRenderResolutions(e);let l="";const h=this.renderedModules;for(const t of this.orderedModules){let i=0;if(t.isIncluded()||this.includedNamespaces.has(t)){const s=t.render(o).trim();i=s.length(),i&&(e.compact&&s.lastLine().includes("//")&&s.append("\n"),this.renderedModuleSources.set(t,s),a.addSource(s),this.usedModules.push(t));const n=t.namespace;if(this.includedNamespaces.has(t)&&!this.outputOptions.preserveModules){const e=n.renderBlock(o);n.renderFirst()?l+=r+e:a.addSource(new E(e))}}const{renderedExports:s,removedExports:n}=t.getRenderedExports(),{renderedModuleSources:c}=this;h[t.id]={get code(){var e,i;return null!==(i=null===(e=c.get(t))||void 0===e?void 0:e.toString())&&void 0!==i?i:null},originalLength:t.originalCode.length,removedExports:n,renderedExports:s,renderedLength:i}}if(l&&a.prepend(l+r+r),this.needsExportsShim&&a.prepend(`${r}${i.cnst} _missingExportShim${s}=${s}void 0;${r}${r}`),e.compact?this.renderedSource=a:this.renderedSource=a.trim(),this.renderedHash=void 0,this.isEmpty&&0===this.getExportNames().length&&0===this.dependencies.size){const e=this.getChunkName();this.inputOptions.onwarn({chunkName:e,code:"EMPTY_BUNDLE",message:`Generated an empty chunk: "${e}"`})}this.setExternalRenderPaths(e,t),this.renderedDependencies=this.getChunkDependencyDeclarations(e,n),this.renderedExports="none"===this.exportMode?[]:this.getChunkExportDeclarations(e.format,n)}async render(e,t,i,s){En("render format",2);const n=e.format,r=Qn[n];e.dynamicImportFunction&&"es"!==n&&this.inputOptions.onwarn(Ee("output.dynamicImportFunction","outputdynamicImportFunction",'this option is ignored for formats other than "es"'));for(const e of this.dependencies){const t=this.renderedDependencies.get(e);if(e instanceof Te){const i=e.renderPath;t.id=qr(e.renormalizeRenderPath?pe(this.id,i,!1,!1):i)}else t.namedExportsMode="default"!==e.exportMode,t.id=qr(pe(this.id,e.id,!1,!0))}this.finaliseDynamicImports(e,s),this.finaliseImportMetas(n,s);const a=0!==this.renderedExports.length||[...this.renderedDependencies.values()].some((e=>e.reexports&&0!==e.reexports.length));let o=null;const l=new Set;for(const e of this.orderedModules){e.usesTopLevelAwait&&(o=e.id);const t=this.accessedGlobalsByScope.get(e.scope);if(t)for(const e of t)l.add(e)}if(null!==o&&"es"!==n&&"system"!==n)return fe({code:"INVALID_TLA_FORMAT",id:o,message:`Module format ${n} does not support top-level await. Use the "es" or "system" output formats rather.`});if(!this.id)throw new Error("Internal Error: expecting chunk id");const h=r(this.renderedSource,{accessedGlobals:l,dependencies:[...this.renderedDependencies.values()],exports:this.renderedExports,hasExports:a,id:this.id,indent:this.indentString,intro:t.intro,isEntryFacade:this.outputOptions.preserveModules||null!==this.facadeModule&&this.facadeModule.info.isEntry,isModuleFacade:null!==this.facadeModule,namedExportsMode:"default"!==this.exportMode,outro:t.outro,snippets:s,usesTopLevelAwait:null!==o,warn:this.inputOptions.onwarn},e);t.banner&&h.prepend(t.banner),t.footer&&h.append(t.footer);const u=h.toString();bn("render format",2);let d=null;const p=[];let f=await function({code:e,options:t,outputPluginDriver:i,renderChunk:s,sourcemapChain:n}){return i.hookReduceArg0("renderChunk",[e,s,t],((e,t,i)=>{if(null==t)return e;if("string"==typeof t&&(t={code:t,map:void 0}),null!==t.map){const e=Qr(t.map);n.push(e||{missing:!0,plugin:i.name})}return t.code}))}({code:u,options:e,outputPluginDriver:this.pluginDriver,renderChunk:i,sourcemapChain:p});if(e.sourcemap){let t;En("sourcemap",2),t=e.file?M(e.sourcemapFile||e.file):e.dir?M(e.dir,this.id):M(this.id);const i=h.generateDecodedMap({});d=function(e,t,i,s,n,r){const a=er(r),o=i.filter((e=>!e.excludeFromSourcemap)).map((e=>tr(e.id,e.originalCode,e.originalSourcemap,e.sourcemapChain,a))),l=new Zn(t,o),h=s.reduce(a,l);let{sources:u,sourcesContent:d,names:p,mappings:f}=h.traceMappings();if(e){const t=$(e);u=u.map((e=>O(t,e))),e=_(e)}return d=n?null:d,new c({file:e,mappings:f,names:p,sources:u,sourcesContent:d})}(t,i,this.usedModules,p,e.sourcemapExcludeSources,this.inputOptions.onwarn),d.sources=d.sources.map((i=>{const{sourcemapPathTransform:s}=e;if(s){const e=s(i,`${t}.map`);return"string"!=typeof e&&fe(Ie("sourcemapPathTransform function must return a string.")),e}return i})).map(N),bn("sourcemap",2)}return e.compact||"\n"===f[f.length-1]||(f+="\n"),{code:f,map:d}}addDependenciesToChunk(e,t){for(const i of e)if(i instanceof kn){const e=this.chunkByModule.get(i);e&&e!==this&&t.add(e)}else t.add(i)}addNecessaryImportsForFacades(){for(const[e,t]of this.includedReexportsByModule)if(this.includedNamespaces.has(e))for(const e of t)this.imports.add(e)}assignFacadeName({fileName:e,name:t},i){e?this.fileName=e:this.name=this.outputOptions.sanitizeFileName(t||ra(i))}checkCircularDependencyImport(e,t){const i=e.module;if(i instanceof kn){const o=this.chunkByModule.get(i);let l;do{if(l=t.alternativeReexportModules.get(e),l){const h=this.chunkByModule.get(l);h&&h!==o&&this.inputOptions.onwarn((s=i.getExportNamesByVariable().get(e)[0],n=i.id,r=l.id,a=t.id,{code:ge.CYCLIC_CROSS_CHUNK_REEXPORT,exporter:n,importer:a,message:`Export "${s}" of module ${ce(n)} was reexported through module ${ce(r)} while both modules are dependencies of each other and will end up in different chunks by current Rollup settings. This scenario is not well supported at the moment as it will produce a circular dependency between chunks and will likely lead to broken execution order.\nEither change the import in ${ce(a)} to point directly to the exporting module or do not use "preserveModules" to ensure these modules end up in the same chunk.`,reexporter:r})),t=l}}while(l)}var s,n,r,a}computeContentHashWithDependencies(e,t,i){const s=Br();s.update([e.intro,e.outro,e.banner,e.footer].join(":")),s.update(t.format);const n=new Set([this]);for(const r of n)if(r instanceof Te?s.update(`:${r.renderPath}`):(s.update(r.getRenderedHash()),s.update(r.generateId(e,t,i,!1))),!(r instanceof Te))for(const e of[...r.dependencies,...r.dynamicDependencies])n.add(e);return s.digest("hex").substr(0,8)}ensureReexportsAreAvailableForModule(e){const t=[],i=e.getExportNamesByVariable();for(const s of i.keys()){const i=s instanceof ln,n=i?s.getBaseVariable():s;if(!(n instanceof on&&this.outputOptions.preserveModules)){this.checkCircularDependencyImport(n,e);const s=n.module;if(s instanceof kn){const e=this.chunkByModule.get(s);e&&e!==this&&(e.exports.add(n),t.push(n),i&&this.imports.add(n))}}}t.length&&this.includedReexportsByModule.set(e,t)}finaliseDynamicImports(e,t){const i="amd"===e.format&&!e.amd.forceJsExtensionForImports;for(const[e,s]of this.renderedModuleSources)for(const{node:n,resolution:r}of e.dynamicImports){const e=this.chunkByModule.get(r),a=this.facadeChunkByModule.get(r);if(!r||!n.included||e===this)continue;const o=r instanceof kn?`'${qr(pe(this.id,(a||e).id,i,!0))}'`:r instanceof Te?`'${qr(r.renormalizeRenderPath?pe(this.id,r.renderPath,i,!1):r.renderPath)}'`:r;n.renderFinalResolution(s,o,r instanceof kn&&!(null==a?void 0:a.strictFacade)&&e.exportNamesByVariable.get(r.namespace)[0],t)}}finaliseImportMetas(e,t){for(const[i,s]of this.renderedModuleSources)for(const n of i.importMetas)n.renderFinalMechanism(s,this.id,e,t,this.pluginDriver)}generateVariableName(){if(this.manualChunkAlias)return this.manualChunkAlias;const e=this.entryModules[0]||this.implicitEntryModules[0]||this.dynamicEntryModules[0]||this.orderedModules[this.orderedModules.length-1];return e?ra(e):"chunk"}getChunkDependencyDeclarations(e,t){const i=this.getImportSpecifiers(t),s=this.getReexportSpecifiers(),n=new Map;for(const t of this.dependencies){const r=i.get(t)||null,a=s.get(t)||null,o=t instanceof Te||"default"!==t.exportMode;n.set(t,{defaultVariableName:t.defaultVariableName,globalName:t instanceof Te&&("umd"===e.format||"iife"===e.format)&&sa(t,e.globals,null!==(r||a),this.inputOptions.onwarn),id:void 0,imports:r,isChunk:t instanceof na,name:t.variableName,namedExportsMode:o,namespaceVariableName:t.namespaceVariableName,reexports:a})}return n}getChunkExportDeclarations(e,t){const i=[];for(const s of this.getExportNames()){if("*"===s[0])continue;const n=this.exportsByName.get(s);if(!(n instanceof ln)){const e=n.module;if(e&&this.chunkByModule.get(e)!==this)continue}let r=null,a=!1,o=n.getName(t);if(n instanceof Wt){for(const e of n.declarations)if(e.parent instanceof ss||e instanceof ns&&e.declaration instanceof ss){a=!0;break}}else n instanceof ln&&(r=o,"es"===e&&(o=n.renderName));i.push({exported:s,expression:r,hoisted:a,local:o})}return i}getDependenciesToBeDeconflicted(e,t,i){const s=new Set,n=new Set,r=new Set;for(const t of[...this.exportNamesByVariable.keys(),...this.imports])if(e||t.isNamespace){const a=t.module;if(a instanceof Te)s.add(a),e&&("default"===t.name?gs[String(i(a.id))]&&n.add(a):"*"===t.name&&xs[String(i(a.id))]&&r.add(a));else{const i=this.chunkByModule.get(a);i!==this&&(s.add(i),e&&"default"===i.exportMode&&t.isNamespace&&r.add(i))}}if(t)for(const e of this.dependencies)s.add(e);return{deconflictedDefault:n,deconflictedNamespace:r,dependencies:s}}getFallbackChunkName(){return this.manualChunkAlias?this.manualChunkAlias:this.dynamicName?this.dynamicName:this.fileName?he(this.fileName):he(this.orderedModules[this.orderedModules.length-1].id)}getImportSpecifiers(e){const{interop:t}=this.outputOptions,i=new Map;for(const s of this.imports){const n=s.module;let r,a;if(n instanceof Te){if(r=n,a=s.name,"default"!==a&&"*"!==a&&"defaultOnly"===t(n.id))return fe(Se(n.id,a,!1))}else r=this.chunkByModule.get(n),a=r.getVariableExportName(s);R(i,r,(()=>[])).push({imported:a,local:s.getName(e)})}return i}getImportedBindingsPerDependency(){const e={};for(const[t,i]of this.renderedDependencies){const s=new Set;if(i.imports)for(const{imported:e}of i.imports)s.add(e);if(i.reexports)for(const{imported:e}of i.reexports)s.add(e);e[t.id]=[...s]}return e}getReexportSpecifiers(){const{externalLiveBindings:e,interop:t}=this.outputOptions,i=new Map;for(let s of this.getExportNames()){let n,r,a=!1;if("*"===s[0]){const i=s.substring(1);"defaultOnly"===t(i)&&this.inputOptions.onwarn(Ae(i)),a=e,n=this.modulesById.get(i),r=s="*"}else{const i=this.exportsByName.get(s);if(i instanceof ln)continue;const o=i.module;if(o instanceof kn){if(n=this.chunkByModule.get(o),n===this)continue;r=n.getVariableExportName(i),a=i.isReassigned}else{if(n=o,r=i.name,"default"!==r&&"*"!==r&&"defaultOnly"===t(o.id))return fe(Se(o.id,r,!0));a=e&&("default"!==r||ys(String(t(o.id)),!0))}}R(i,n,(()=>[])).push({imported:r,needsLiveBinding:a,reexported:s})}return i}getReferencedFiles(){const e=[];for(const t of this.orderedModules)for(const i of t.importMetas){const t=i.getReferencedFileName(this.pluginDriver);t&&e.push(t)}return e}inlineChunkDependencies(e){for(const t of e.dependencies)this.dependencies.has(t)||(this.dependencies.add(t),t instanceof na&&this.inlineChunkDependencies(t))}prepareModulesForRendering(e){var t;const i=this.accessedGlobalsByScope;for(const s of this.orderedModules){for(const{node:n,resolution:r}of s.dynamicImports)if(n.included)if(r instanceof kn){const s=this.chunkByModule.get(r);s===this?n.setInternalResolution(r.namespace):n.setExternalResolution((null===(t=this.facadeChunkByModule.get(r))||void 0===t?void 0:t.exportMode)||s.exportMode,r,this.outputOptions,e,this.pluginDriver,i)}else n.setExternalResolution("external",r,this.outputOptions,e,this.pluginDriver,i);for(const e of s.importMetas)e.addAccessedGlobals(this.outputOptions.format,i);this.includedNamespaces.has(s)&&!this.outputOptions.preserveModules&&s.namespace.prepare(i)}}setExternalRenderPaths(e,t){for(const i of[...this.dependencies,...this.dynamicDependencies])i instanceof Te&&i.setRenderPath(e,t)}setIdentifierRenderResolutions({format:e,interop:t,namespaceToStringTag:i}){const s=new Set;for(const t of this.getExportNames()){const i=this.exportsByName.get(t);"es"!==e&&"system"!==e&&i.isReassigned&&!i.isId?i.setRenderNames("exports",t):i instanceof ln?s.add(i):i.setRenderNames(null,null)}for(const e of this.orderedModules)if(e.needsExportShim){this.needsExportsShim=!0;break}const n=new Set(["Object","Promise"]);switch(this.needsExportsShim&&n.add(rn),i&&n.add("Symbol"),e){case"system":n.add("module").add("exports");break;case"es":break;case"cjs":n.add("module").add("require").add("__filename").add("__dirname");default:n.add("exports");for(const e of Os)n.add(e)}zr(this.orderedModules,this.getDependenciesToBeDeconflicted("es"!==e&&"system"!==e,"amd"===e||"umd"===e||"iife"===e,t),this.imports,n,e,t,this.outputOptions.preserveModules,this.outputOptions.externalLiveBindings,this.chunkByModule,s,this.exportNamesByVariable,this.accessedGlobalsByScope,this.includedNamespaces)}setUpChunkImportsAndExportsForModule(e){const t=new Set(e.includedImports);if(!this.outputOptions.preserveModules&&this.includedNamespaces.has(e)){const i=e.namespace.getMemberVariables();for(const e of Object.values(i))t.add(e)}for(let i of t){i instanceof Js&&(i=i.getOriginalVariable()),i instanceof ln&&(i=i.getBaseVariable());const t=this.chunkByModule.get(i.module);t!==this&&(this.imports.add(i),!(i instanceof on&&this.outputOptions.preserveModules)&&i.module instanceof kn&&(t.exports.add(i),this.checkCircularDependencyImport(i,e)))}(this.includedNamespaces.has(e)||e.info.isEntry&&!1!==e.preserveSignature||e.includedDynamicImporters.some((e=>this.chunkByModule.get(e)!==this)))&&this.ensureReexportsAreAvailableForModule(e);for(const{node:t,resolution:i}of e.dynamicImports)t.included&&i instanceof kn&&this.chunkByModule.get(i)===this&&!this.includedNamespaces.has(i)&&(this.includedNamespaces.add(i),this.ensureReexportsAreAvailableForModule(i))}}function ra(e){var t,i,s,n;return null!==(n=null!==(i=null===(t=e.chunkNames.find((({isUserDefined:e})=>e)))||void 0===t?void 0:t.name)&&void 0!==i?i:null===(s=e.chunkNames[0])||void 0===s?void 0:s.name)&&void 0!==n?n:he(e.id)}const aa=/[?#]/,oa=(e,t)=>t?`${e}\n${t}`:e,la=(e,t)=>t?`${e}\n\n${t}`:e;function ha(e,t){const i=[],s=new Set(t.keys()),n=Object.create(null);for(const[e,i]of t)ca(e,n[i]=n[i]||[],s);for(const[e,t]of Object.entries(n))i.push({alias:e,modules:t});const r=new Map,{dependentEntryPointsByModule:a,dynamicEntryModules:o}=function(e){const t=new Set,i=new Map,s=new Set(e);for(const e of s){const n=new Set([e]);for(const r of n){R(i,r,(()=>new Set)).add(e);for(const e of r.getDependenciesToBeIncluded())e instanceof Te||n.add(e);for(const{resolution:e}of r.dynamicImports)e instanceof kn&&e.includedDynamicImporters.length>0&&(t.add(e),s.add(e));for(const e of r.implicitlyLoadedBefore)t.add(e),s.add(e)}}return{dependentEntryPointsByModule:i,dynamicEntryModules:t}}(e),l=function(e,t){const i=new Map;for(const s of t){const t=R(i,s,(()=>new Set));for(const i of[...s.includedDynamicImporters,...s.implicitlyLoadedAfter])for(const s of e.get(i))t.add(s)}return i}(a,o),h=new Set(e);function c(e,t){const i=new Set([e]);for(const n of i){const o=R(r,n,(()=>new Set));if(!t||!u(t,a.get(n))){o.add(e);for(const e of n.getDependenciesToBeIncluded())e instanceof Te||s.has(e)||i.add(e)}}}function u(e,t){const i=new Set(e);for(const e of i)if(!t.has(e)){if(h.has(e))return!1;const t=l.get(e);for(const e of t)i.add(e)}return!0}for(const t of e)s.has(t)||c(t,null);for(const e of o)s.has(e)||c(e,l.get(e));return i.push(...function(e,t){const i=Object.create(null);for(const[s,n]of t){let t="";for(const i of e)t+=n.has(i)?"X":"_";const r=i[t];r?r.push(s):i[t]=[s]}return Object.values(i).map((e=>({alias:null,modules:e})))}([...e,...o],r)),i}function ca(e,t,i){const s=new Set([e]);for(const e of s){i.add(e),t.push(e);for(const t of e.dependencies)t instanceof Te||i.has(t)||s.add(t)}}const ua=(e,t)=>e.execIndex>t.execIndex?1:-1;function da(e,t,i){const s=Symbol(e.id),n=[ce(e.id)];let r=t;for(e.cycles.add(s);r!==e;)r.cycles.add(s),n.push(ce(r.id)),r=i.get(r);return n.push(n[0]),n.reverse(),n}const pa=(e,t)=>t?`(${e})`:e,fa=/^(?!\d)[\w$]+$/;class ma{constructor(e,t,i,s,n){this.outputOptions=e,this.unsetOptions=t,this.inputOptions=i,this.pluginDriver=s,this.graph=n,this.facadeChunkByModule=new Map,this.includedNamespaces=new Set}async generate(e){En("GENERATE",1);const t=Object.create(null),i=(e=>{const t=new Set;return new Proxy(e,{deleteProperty:(e,i)=>("string"==typeof i&&t.delete(i.toLowerCase()),Reflect.deleteProperty(e,i)),get:(e,i)=>i===Jr?t:Reflect.get(e,i),set:(e,i,s)=>("string"==typeof i&&t.add(i.toLowerCase()),Reflect.set(e,i,s))})})(t);this.pluginDriver.setOutputBundle(i,this.outputOptions,this.facadeChunkByModule);try{await this.pluginDriver.hookParallel("renderStart",[this.outputOptions,this.inputOptions]),En("generate chunks",2);const e=await this.generateChunks();e.length>1&&(s=this.outputOptions,n=this.inputOptions.onwarn,"umd"===s.format||"iife"===s.format?fe(Ee("output.format","outputformat","UMD and IIFE output formats are not supported for code-splitting builds",s.format)):"string"==typeof s.file?fe(Ee("output.file","outputdir",'when building multiple chunks, the "output.dir" option must be used, not "output.file". To inline dynamic imports, set the "inlineDynamicImports" option')):s.sourcemapFile?fe(Ee("output.sourcemapFile","outputsourcemapfile",'"output.sourcemapFile" is only supported for single-file builds')):!s.amd.autoId&&s.amd.id&&n(Ee("output.amd.id","outputamd",'this option is only properly supported for single-file builds. Use "output.amd.autoId" and "output.amd.basePath" instead')));const t=function(e){if(0===e.length)return"/";if(1===e.length)return $(e[0]);const t=e.slice(1).reduce(((e,t)=>{const i=t.split(/\/+|\\+/);let s;for(s=0;e[s]===i[s]&&s1?t.join("/"):"/"}(function(e){const t=[];for(const i of e)for(const e of i.entryModules)w(e.id)&&t.push(e.id);return t}(e));bn("generate chunks",2),En("render modules",2);const r=await async function(e,t){try{let[i,s,n,r]=await Promise.all([t.hookReduceValue("banner",e.banner(),[],oa),t.hookReduceValue("footer",e.footer(),[],oa),t.hookReduceValue("intro",e.intro(),[],la),t.hookReduceValue("outro",e.outro(),[],la)]);return n&&(n+="\n\n"),r&&(r=`\n\n${r}`),i.length&&(i+="\n"),s.length&&(s="\n"+s),{banner:i,footer:s,intro:n,outro:r}}catch(e){return fe({code:"ADDON_ERROR",message:`Could not retrieve ${e.hook}. Check configuration of plugin ${e.plugin}.\n\tError Message: ${e.message}`})}}(this.outputOptions,this.pluginDriver),a=function({compact:e,generatedCode:{arrowFunctions:t,constBindings:i,objectShorthand:s,reservedNamesAsProps:n}}){const{_:r,n:a,s:o}=e?{_:"",n:"",s:""}:{_:" ",n:"\n",s:";"},l=i?"const":"var",h=(e,{isAsync:t,name:i})=>`${t?"async ":""}function${i?` ${i}`:""}${r}(${e.join(`,${r}`)})${r}`,c=t?(e,{isAsync:t,name:i})=>{const s=1===e.length;return`${i?`${l} ${i}${r}=${r}`:""}${t?`async${s?" ":r}`:""}${s?e[0]:`(${e.join(`,${r}`)})`}${r}=>${r}`}:h,u=(e,{functionReturn:i,lineBreakIndent:s,name:n})=>[`${c(e,{isAsync:!1,name:n})}${t?s?`${a}${s.base}${s.t}`:"":`{${s?`${a}${s.base}${s.t}`:r}${i?"return ":""}`}`,t?`${n?";":""}${s?`${a}${s.base}`:""}`:`${o}${s?`${a}${s.base}`:r}}`],d=n?e=>fa.test(e):e=>!Ce.has(e)&&fa.test(e);return{_:r,cnst:l,getDirectReturnFunction:u,getDirectReturnIifeLeft:(e,i,{needsArrowReturnParens:s,needsWrappedFunction:n})=>{const[r,a]=u(e,{functionReturn:!0,lineBreakIndent:null,name:null});return`${pa(`${r}${pa(i,t&&s)}${a}`,t||n)}(`},getFunctionIntro:c,getNonArrowFunctionIntro:h,getObject(e,{lineBreakIndent:t}){const i=t?`${a}${t.base}${t.t}`:r;return`{${e.map((([e,t])=>{if(null===e)return`${i}${t}`;const n=!d(e);return e===t&&s&&!n?i+e:`${i}${n?`'${e}'`:e}:${r}${t}`})).join(",")}${0===e.length?"":t?`${a}${t.base}`:r}}`},getPropertyAccess:e=>d(e)?`.${e}`:`[${JSON.stringify(e)}]`,n:a,s:o}}(this.outputOptions);this.prerenderChunks(e,t,a),bn("render modules",2),await this.addFinalizedChunksToBundle(e,t,r,i,a)}catch(e){throw await this.pluginDriver.hookParallel("renderError",[e]),e}var s,n;return await this.pluginDriver.hookSeq("generateBundle",[this.outputOptions,i,e]),this.finaliseAssets(i),bn("GENERATE",1),t}async addFinalizedChunksToBundle(e,t,i,s,n){this.assignChunkIds(e,t,i,s);for(const t of e)s[t.id]=t.getChunkInfoWithFileNames();await Promise.all(e.map((async e=>{const t=s[e.id];Object.assign(t,await e.render(this.outputOptions,i,t,n))})))}async addManualChunks(e){const t=new Map,i=await Promise.all(Object.entries(e).map((async([e,t])=>({alias:e,entries:await this.graph.moduleLoader.addAdditionalModules(t)}))));for(const{alias:e,entries:s}of i)for(const i of s)ya(e,i,t);return t}assignChunkIds(e,t,i,s){const n=[],r=[];for(const t of e)(t.facadeModule&&t.facadeModule.isUserDefinedEntryPoint?n:r).push(t);const a=n.concat(r);for(const e of a)this.outputOptions.file?e.id=_(this.outputOptions.file):this.outputOptions.preserveModules?e.id=e.generateIdPreserveModules(t,this.outputOptions,s,this.unsetOptions):e.id=e.generateId(i,this.outputOptions,s,!0),s[e.id]=Zr}assignManualChunks(e){const t=[],i={getModuleIds:()=>this.graph.modulesById.keys(),getModuleInfo:this.graph.getModuleInfo};for(const s of this.graph.modulesById.values())if(s instanceof kn){const n=e(s.id,i);"string"==typeof n&&t.push([n,s])}t.sort((([e],[t])=>e>t?1:e({alias:null,modules:[e]}))):ha(this.graph.entryModules,t)){n.sort(ua);const t=new na(n,this.inputOptions,this.outputOptions,this.unsetOptions,this.pluginDriver,this.graph.modulesById,s,this.facadeChunkByModule,this.includedNamespaces,e);i.push(t);for(const e of n)s.set(e,t)}for(const e of i)e.link();const n=[];for(const e of i)n.push(...e.generateFacades());return[...i,...n]}prerenderChunks(e,t,i){for(const t of e)t.generateExports();for(const s of e)s.preRender(this.outputOptions,t,i)}}function ga(e){return[...e.values()].filter((e=>e instanceof kn&&(e.isIncluded()||e.info.isEntry||e.includedDynamicImporters.length>0)))}function ya(e,t,i){const s=i.get(t);if("string"==typeof s&&s!==e)return fe((n=t.id,r=e,a=s,{code:ge.INVALID_CHUNK,message:`Cannot assign ${ce(n)} to the "${r}" chunk as it is already in the "${a}" chunk.`}));var n,r,a;i.set(t,e)}var xa=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,154,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,161,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,19306,9,87,9,39,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,4706,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,262,6,10,9,357,0,62,13,1495,6,110,6,6,9,4759,9,787719,239],Ea=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,68,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,85,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,190,0,80,921,103,110,18,195,2637,96,16,1070,4050,582,8634,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8936,3,2,6,2,1,2,290,46,2,18,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,482,44,11,6,17,0,322,29,19,43,1269,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4152,8,221,3,5761,15,7472,3104,541,1507,4938],ba="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢎࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೝೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲈᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꟊꟐꟑꟓꟕ-ꟙꟲ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",va={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},Sa="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",Aa={5:Sa,"5module":Sa+" export import",6:Sa+" const class extends export import super"},Ia=/^in(stanceof)?$/,Pa=new RegExp("["+ba+"]"),ka=new RegExp("["+ba+"‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛࢘-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-ໍ໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-ᫎᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_]");function wa(e,t){for(var i=65536,s=0;se)return!1;if((i+=t[s+1])>=e)return!0}}function Ca(e,t){return e<65?36===e:e<91||(e<97?95===e:e<123||(e<=65535?e>=170&&Pa.test(String.fromCharCode(e)):!1!==t&&wa(e,Ea)))}function Na(e,t){return e<48?36===e:e<58||!(e<65)&&(e<91||(e<97?95===e:e<123||(e<=65535?e>=170&&ka.test(String.fromCharCode(e)):!1!==t&&(wa(e,Ea)||wa(e,xa)))))}var _a=function(e,t){void 0===t&&(t={}),this.label=e,this.keyword=t.keyword,this.beforeExpr=!!t.beforeExpr,this.startsExpr=!!t.startsExpr,this.isLoop=!!t.isLoop,this.isAssign=!!t.isAssign,this.prefix=!!t.prefix,this.postfix=!!t.postfix,this.binop=t.binop||null,this.updateContext=null};function $a(e,t){return new _a(e,{beforeExpr:!0,binop:t})}var Ta={beforeExpr:!0},Oa={startsExpr:!0},Ma={};function Ra(e,t){return void 0===t&&(t={}),t.keyword=e,Ma[e]=new _a(e,t)}var Da={num:new _a("num",Oa),regexp:new _a("regexp",Oa),string:new _a("string",Oa),name:new _a("name",Oa),privateId:new _a("privateId",Oa),eof:new _a("eof"),bracketL:new _a("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new _a("]"),braceL:new _a("{",{beforeExpr:!0,startsExpr:!0}),braceR:new _a("}"),parenL:new _a("(",{beforeExpr:!0,startsExpr:!0}),parenR:new _a(")"),comma:new _a(",",Ta),semi:new _a(";",Ta),colon:new _a(":",Ta),dot:new _a("."),question:new _a("?",Ta),questionDot:new _a("?."),arrow:new _a("=>",Ta),template:new _a("template"),invalidTemplate:new _a("invalidTemplate"),ellipsis:new _a("...",Ta),backQuote:new _a("`",Oa),dollarBraceL:new _a("${",{beforeExpr:!0,startsExpr:!0}),eq:new _a("=",{beforeExpr:!0,isAssign:!0}),assign:new _a("_=",{beforeExpr:!0,isAssign:!0}),incDec:new _a("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new _a("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:$a("||",1),logicalAND:$a("&&",2),bitwiseOR:$a("|",3),bitwiseXOR:$a("^",4),bitwiseAND:$a("&",5),equality:$a("==/!=/===/!==",6),relational:$a("/<=/>=",7),bitShift:$a("<>/>>>",8),plusMin:new _a("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:$a("%",10),star:$a("*",10),slash:$a("/",10),starstar:new _a("**",{beforeExpr:!0}),coalesce:$a("??",1),_break:Ra("break"),_case:Ra("case",Ta),_catch:Ra("catch"),_continue:Ra("continue"),_debugger:Ra("debugger"),_default:Ra("default",Ta),_do:Ra("do",{isLoop:!0,beforeExpr:!0}),_else:Ra("else",Ta),_finally:Ra("finally"),_for:Ra("for",{isLoop:!0}),_function:Ra("function",Oa),_if:Ra("if"),_return:Ra("return",Ta),_switch:Ra("switch"),_throw:Ra("throw",Ta),_try:Ra("try"),_var:Ra("var"),_const:Ra("const"),_while:Ra("while",{isLoop:!0}),_with:Ra("with"),_new:Ra("new",{beforeExpr:!0,startsExpr:!0}),_this:Ra("this",Oa),_super:Ra("super",Oa),_class:Ra("class",Oa),_extends:Ra("extends",Ta),_export:Ra("export"),_import:Ra("import",Oa),_null:Ra("null",Oa),_true:Ra("true",Oa),_false:Ra("false",Oa),_in:Ra("in",{beforeExpr:!0,binop:7}),_instanceof:Ra("instanceof",{beforeExpr:!0,binop:7}),_typeof:Ra("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:Ra("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:Ra("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},La=/\r\n?|\n|\u2028|\u2029/,Va=new RegExp(La.source,"g");function Ba(e){return 10===e||13===e||8232===e||8233===e}function Fa(e,t,i){void 0===i&&(i=e.length);for(var s=t;s>10),56320+(1023&e)))}var Ya=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,Qa=function(e,t){this.line=e,this.column=t};Qa.prototype.offset=function(e){return new Qa(this.line,this.column+e)};var Ja=function(e,t,i){this.start=t,this.end=i,null!==e.sourceFile&&(this.source=e.sourceFile)};function Za(e,t){for(var i=1,s=0;;){var n=Fa(e,s,t);if(n<0)return new Qa(i,t-s);++i,s=n}}var eo={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},to=!1;function io(e){var t={};for(var i in eo)t[i]=e&&Wa(e,i)?e[i]:eo[i];if("latest"===t.ecmaVersion?t.ecmaVersion=1e8:null==t.ecmaVersion?(!to&&"object"==typeof console&&console.warn&&(to=!0,console.warn("Since Acorn 8.0.0, options.ecmaVersion is required.\nDefaulting to 2020, but this will stop working in the future.")),t.ecmaVersion=11):t.ecmaVersion>=2015&&(t.ecmaVersion-=2009),null==t.allowReserved&&(t.allowReserved=t.ecmaVersion<5),qa(t.onToken)){var s=t.onToken;t.onToken=function(e){return s.push(e)}}return qa(t.onComment)&&(t.onComment=function(e,t){return function(i,s,n,r,a,o){var l={type:i?"Block":"Line",value:s,start:n,end:r};e.locations&&(l.loc=new Ja(this,a,o)),e.ranges&&(l.range=[n,r]),t.push(l)}}(t,t.onComment)),t}var so=256;function no(e,t){return 2|(e?4:0)|(t?8:0)}var ro=function(e,t,i){this.options=e=io(e),this.sourceFile=e.sourceFile,this.keywords=Ka(Aa[e.ecmaVersion>=6?6:"module"===e.sourceType?"5module":5]);var s="";!0!==e.allowReserved&&(s=va[e.ecmaVersion>=6?6:5===e.ecmaVersion?5:3],"module"===e.sourceType&&(s+=" await")),this.reservedWords=Ka(s);var n=(s?s+" ":"")+va.strict;this.reservedWordsStrict=Ka(n),this.reservedWordsStrictBind=Ka(n+" "+va.strictBind),this.input=String(t),this.containsEsc=!1,i?(this.pos=i,this.lineStart=this.input.lastIndexOf("\n",i-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(La).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=Da.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule="module"===e.sourceType,this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),0===this.pos&&e.allowHashBang&&"#!"===this.input.slice(0,2)&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(1),this.regexpState=null,this.privateNameStack=[]},ao={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},inClassStaticBlock:{configurable:!0}};ro.prototype.parse=function(){var e=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(e)},ao.inFunction.get=function(){return(2&this.currentVarScope().flags)>0},ao.inGenerator.get=function(){return(8&this.currentVarScope().flags)>0&&!this.currentVarScope().inClassFieldInit},ao.inAsync.get=function(){return(4&this.currentVarScope().flags)>0&&!this.currentVarScope().inClassFieldInit},ao.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e];if(t.inClassFieldInit||t.flags&so)return!1;if(2&t.flags)return(4&t.flags)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction},ao.allowSuper.get=function(){var e=this.currentThisScope(),t=e.flags,i=e.inClassFieldInit;return(64&t)>0||i||this.options.allowSuperOutsideMethod},ao.allowDirectSuper.get=function(){return(128&this.currentThisScope().flags)>0},ao.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},ao.allowNewDotTarget.get=function(){var e=this.currentThisScope(),t=e.flags,i=e.inClassFieldInit;return(258&t)>0||i},ao.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&so)>0},ro.extend=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];for(var i=this,s=0;s=,?^&]/.test(n)||"!"===n&&"="===this.input.charAt(s+1))}e+=t[0].length,ja.lastIndex=e,e+=ja.exec(this.input)[0].length,";"===this.input[e]&&e++}},oo.eat=function(e){return this.type===e&&(this.next(),!0)},oo.isContextual=function(e){return this.type===Da.name&&this.value===e&&!this.containsEsc},oo.eatContextual=function(e){return!!this.isContextual(e)&&(this.next(),!0)},oo.expectContextual=function(e){this.eatContextual(e)||this.unexpected()},oo.canInsertSemicolon=function(){return this.type===Da.eof||this.type===Da.braceR||La.test(this.input.slice(this.lastTokEnd,this.start))},oo.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},oo.semicolon=function(){this.eat(Da.semi)||this.insertSemicolon()||this.unexpected()},oo.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0},oo.expect=function(e){this.eat(e)||this.unexpected()},oo.unexpected=function(e){this.raise(null!=e?e:this.start,"Unexpected token")};var ho=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};oo.checkPatternErrors=function(e,t){if(e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element");var i=t?e.parenthesizedAssign:e.parenthesizedBind;i>-1&&this.raiseRecoverable(i,"Parenthesized pattern")}},oo.checkExpressionErrors=function(e,t){if(!e)return!1;var i=e.shorthandAssign,s=e.doubleProto;if(!t)return i>=0||s>=0;i>=0&&this.raise(i,"Shorthand property assignments are valid only in destructuring patterns"),s>=0&&this.raiseRecoverable(s,"Redefinition of __proto__ property")},oo.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos55295&&s<56320)return!0;if(e)return!1;if(123===s)return!0;if(Ca(s,!0)){for(var n=i+1;Na(s=this.input.charCodeAt(n),!0);)++n;if(92===s||s>55295&&s<56320)return!0;var r=this.input.slice(i,n);if(!Ia.test(r))return!0}return!1},co.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;ja.lastIndex=this.pos;var e,t=ja.exec(this.input),i=this.pos+t[0].length;return!(La.test(this.input.slice(this.pos,i))||"function"!==this.input.slice(i,i+8)||i+8!==this.input.length&&(Na(e=this.input.charCodeAt(i+8))||e>55295&&e<56320))},co.parseStatement=function(e,t,i){var s,n=this.type,r=this.startNode();switch(this.isLet(e)&&(n=Da._var,s="let"),n){case Da._break:case Da._continue:return this.parseBreakContinueStatement(r,n.keyword);case Da._debugger:return this.parseDebuggerStatement(r);case Da._do:return this.parseDoStatement(r);case Da._for:return this.parseForStatement(r);case Da._function:return e&&(this.strict||"if"!==e&&"label"!==e)&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(r,!1,!e);case Da._class:return e&&this.unexpected(),this.parseClass(r,!0);case Da._if:return this.parseIfStatement(r);case Da._return:return this.parseReturnStatement(r);case Da._switch:return this.parseSwitchStatement(r);case Da._throw:return this.parseThrowStatement(r);case Da._try:return this.parseTryStatement(r);case Da._const:case Da._var:return s=s||this.value,e&&"var"!==s&&this.unexpected(),this.parseVarStatement(r,s);case Da._while:return this.parseWhileStatement(r);case Da._with:return this.parseWithStatement(r);case Da.braceL:return this.parseBlock(!0,r);case Da.semi:return this.parseEmptyStatement(r);case Da._export:case Da._import:if(this.options.ecmaVersion>10&&n===Da._import){ja.lastIndex=this.pos;var a=ja.exec(this.input),o=this.pos+a[0].length,l=this.input.charCodeAt(o);if(40===l||46===l)return this.parseExpressionStatement(r,this.parseExpression())}return this.options.allowImportExportEverywhere||(t||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),n===Da._import?this.parseImport(r):this.parseExport(r,i);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(r,!0,!e);var h=this.value,c=this.parseExpression();return n===Da.name&&"Identifier"===c.type&&this.eat(Da.colon)?this.parseLabeledStatement(r,h,c,e):this.parseExpressionStatement(r,c)}},co.parseBreakContinueStatement=function(e,t){var i="break"===t;this.next(),this.eat(Da.semi)||this.insertSemicolon()?e.label=null:this.type!==Da.name?this.unexpected():(e.label=this.parseIdent(),this.semicolon());for(var s=0;s=6?this.eat(Da.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")},co.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(uo),this.enterScope(0),this.expect(Da.parenL),this.type===Da.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var i=this.isLet();if(this.type===Da._var||this.type===Da._const||i){var s=this.startNode(),n=i?"let":this.value;return this.next(),this.parseVar(s,!0,n),this.finishNode(s,"VariableDeclaration"),(this.type===Da._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&1===s.declarations.length?(this.options.ecmaVersion>=9&&(this.type===Da._in?t>-1&&this.unexpected(t):e.await=t>-1),this.parseForIn(e,s)):(t>-1&&this.unexpected(t),this.parseFor(e,s))}var r=this.isContextual("let"),a=!1,o=new ho,l=this.parseExpression(!(t>-1)||"await",o);return this.type===Da._in||(a=this.options.ecmaVersion>=6&&this.isContextual("of"))?(this.options.ecmaVersion>=9&&(this.type===Da._in?t>-1&&this.unexpected(t):e.await=t>-1),r&&a&&this.raise(l.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(l,!1,o),this.checkLValPattern(l),this.parseForIn(e,l)):(this.checkExpressionErrors(o,!0),t>-1&&this.unexpected(t),this.parseFor(e,l))},co.parseFunctionStatement=function(e,t,i){return this.next(),this.parseFunction(e,mo|(i?0:go),!1,t)},co.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement("if"),e.alternate=this.eat(Da._else)?this.parseStatement("if"):null,this.finishNode(e,"IfStatement")},co.parseReturnStatement=function(e){return this.inFunction||this.options.allowReturnOutsideFunction||this.raise(this.start,"'return' outside of function"),this.next(),this.eat(Da.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")},co.parseSwitchStatement=function(e){var t;this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(Da.braceL),this.labels.push(po),this.enterScope(0);for(var i=!1;this.type!==Da.braceR;)if(this.type===Da._case||this.type===Da._default){var s=this.type===Da._case;t&&this.finishNode(t,"SwitchCase"),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),s?t.test=this.parseExpression():(i&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),i=!0,t.test=null),this.expect(Da.colon)}else t||this.unexpected(),t.consequent.push(this.parseStatement(null));return this.exitScope(),t&&this.finishNode(t,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(e,"SwitchStatement")},co.parseThrowStatement=function(e){return this.next(),La.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")};var fo=[];co.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===Da._catch){var t=this.startNode();if(this.next(),this.eat(Da.parenL)){t.param=this.parseBindingAtom();var i="Identifier"===t.param.type;this.enterScope(i?32:0),this.checkLValPattern(t.param,i?4:2),this.expect(Da.parenR)}else this.options.ecmaVersion<10&&this.unexpected(),t.param=null,this.enterScope(0);t.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(t,"CatchClause")}return e.finalizer=this.eat(Da._finally)?this.parseBlock():null,e.handler||e.finalizer||this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")},co.parseVarStatement=function(e,t){return this.next(),this.parseVar(e,!1,t),this.semicolon(),this.finishNode(e,"VariableDeclaration")},co.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(uo),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")},co.parseWithStatement=function(e){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement("with"),this.finishNode(e,"WithStatement")},co.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")},co.parseLabeledStatement=function(e,t,i,s){for(var n=0,r=this.labels;n=0;o--){var l=this.labels[o];if(l.statementStart!==e.start)break;l.statementStart=this.start,l.kind=a}return this.labels.push({name:t,kind:a,statementStart:this.start}),e.body=this.parseStatement(s?-1===s.indexOf("label")?s+"label":s:"label"),this.labels.pop(),e.label=i,this.finishNode(e,"LabeledStatement")},co.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")},co.parseBlock=function(e,t,i){for(void 0===e&&(e=!0),void 0===t&&(t=this.startNode()),t.body=[],this.expect(Da.braceL),e&&this.enterScope(0);this.type!==Da.braceR;){var s=this.parseStatement(null);t.body.push(s)}return i&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(t,"BlockStatement")},co.parseFor=function(e,t){return e.init=t,this.expect(Da.semi),e.test=this.type===Da.semi?null:this.parseExpression(),this.expect(Da.semi),e.update=this.type===Da.parenR?null:this.parseExpression(),this.expect(Da.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,"ForStatement")},co.parseForIn=function(e,t){var i=this.type===Da._in;return this.next(),"VariableDeclaration"===t.type&&null!=t.declarations[0].init&&(!i||this.options.ecmaVersion<8||this.strict||"var"!==t.kind||"Identifier"!==t.declarations[0].id.type)&&this.raise(t.start,(i?"for-in":"for-of")+" loop variable declaration may not have an initializer"),e.left=t,e.right=i?this.parseExpression():this.parseMaybeAssign(),this.expect(Da.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,i?"ForInStatement":"ForOfStatement")},co.parseVar=function(e,t,i){for(e.declarations=[],e.kind=i;;){var s=this.startNode();if(this.parseVarId(s,i),this.eat(Da.eq)?s.init=this.parseMaybeAssign(t):"const"!==i||this.type===Da._in||this.options.ecmaVersion>=6&&this.isContextual("of")?"Identifier"===s.id.type||t&&(this.type===Da._in||this.isContextual("of"))?s.init=null:this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):this.unexpected(),e.declarations.push(this.finishNode(s,"VariableDeclarator")),!this.eat(Da.comma))break}return e},co.parseVarId=function(e,t){e.id=this.parseBindingAtom(),this.checkLValPattern(e.id,"var"===t?1:2,!1)};var mo=1,go=2;function yo(e,t){var i=t.key.name,s=e[i],n="true";return"MethodDefinition"!==t.type||"get"!==t.kind&&"set"!==t.kind||(n=(t.static?"s":"i")+t.kind),"iget"===s&&"iset"===n||"iset"===s&&"iget"===n||"sget"===s&&"sset"===n||"sset"===s&&"sget"===n?(e[i]="true",!1):!!s||(e[i]=n,!1)}function xo(e,t){var i=e.computed,s=e.key;return!i&&("Identifier"===s.type&&s.name===t||"Literal"===s.type&&s.value===t)}co.parseFunction=function(e,t,i,s,n){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!s)&&(this.type===Da.star&&t&go&&this.unexpected(),e.generator=this.eat(Da.star)),this.options.ecmaVersion>=8&&(e.async=!!s),t&mo&&(e.id=4&t&&this.type!==Da.name?null:this.parseIdent(),!e.id||t&go||this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?1:2:3));var r=this.yieldPos,a=this.awaitPos,o=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(no(e.async,e.generator)),t&mo||(e.id=this.type===Da.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,i,!1,n),this.yieldPos=r,this.awaitPos=a,this.awaitIdentPos=o,this.finishNode(e,t&mo?"FunctionDeclaration":"FunctionExpression")},co.parseFunctionParams=function(e){this.expect(Da.parenL),e.params=this.parseBindingList(Da.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},co.parseClass=function(e,t){this.next();var i=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var s=this.enterClassBody(),n=this.startNode(),r=!1;for(n.body=[],this.expect(Da.braceL);this.type!==Da.braceR;){var a=this.parseClassElement(null!==e.superClass);a&&(n.body.push(a),"MethodDefinition"===a.type&&"constructor"===a.kind?(r&&this.raise(a.start,"Duplicate constructor in the same class"),r=!0):a.key&&"PrivateIdentifier"===a.key.type&&yo(s,a)&&this.raiseRecoverable(a.key.start,"Identifier '#"+a.key.name+"' has already been declared"))}return this.strict=i,this.next(),e.body=this.finishNode(n,"ClassBody"),this.exitClassBody(),this.finishNode(e,t?"ClassDeclaration":"ClassExpression")},co.parseClassElement=function(e){if(this.eat(Da.semi))return null;var t=this.options.ecmaVersion,i=this.startNode(),s="",n=!1,r=!1,a="method",o=!1;if(this.eatContextual("static")){if(t>=13&&this.eat(Da.braceL))return this.parseClassStaticBlock(i),i;this.isClassElementNameStart()||this.type===Da.star?o=!0:s="static"}if(i.static=o,!s&&t>=8&&this.eatContextual("async")&&(!this.isClassElementNameStart()&&this.type!==Da.star||this.canInsertSemicolon()?s="async":r=!0),!s&&(t>=9||!r)&&this.eat(Da.star)&&(n=!0),!s&&!r&&!n){var l=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?a=l:s=l)}if(s?(i.computed=!1,i.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),i.key.name=s,this.finishNode(i.key,"Identifier")):this.parseClassElementName(i),t<13||this.type===Da.parenL||"method"!==a||n||r){var h=!i.static&&xo(i,"constructor"),c=h&&e;h&&"method"!==a&&this.raise(i.key.start,"Constructor can't have get/set modifier"),i.kind=h?"constructor":a,this.parseClassMethod(i,n,r,c)}else this.parseClassField(i);return i},co.isClassElementNameStart=function(){return this.type===Da.name||this.type===Da.privateId||this.type===Da.num||this.type===Da.string||this.type===Da.bracketL||this.type.keyword},co.parseClassElementName=function(e){this.type===Da.privateId?("constructor"===this.value&&this.raise(this.start,"Classes can't have an element named '#constructor'"),e.computed=!1,e.key=this.parsePrivateIdent()):this.parsePropertyName(e)},co.parseClassMethod=function(e,t,i,s){var n=e.key;"constructor"===e.kind?(t&&this.raise(n.start,"Constructor can't be a generator"),i&&this.raise(n.start,"Constructor can't be an async method")):e.static&&xo(e,"prototype")&&this.raise(n.start,"Classes may not have a static property named prototype");var r=e.value=this.parseMethod(t,i,s);return"get"===e.kind&&0!==r.params.length&&this.raiseRecoverable(r.start,"getter should have no params"),"set"===e.kind&&1!==r.params.length&&this.raiseRecoverable(r.start,"setter should have exactly one param"),"set"===e.kind&&"RestElement"===r.params[0].type&&this.raiseRecoverable(r.params[0].start,"Setter cannot use rest params"),this.finishNode(e,"MethodDefinition")},co.parseClassField=function(e){if(xo(e,"constructor")?this.raise(e.key.start,"Classes can't have a field named 'constructor'"):e.static&&xo(e,"prototype")&&this.raise(e.key.start,"Classes can't have a static field named 'prototype'"),this.eat(Da.eq)){var t=this.currentThisScope(),i=t.inClassFieldInit;t.inClassFieldInit=!0,e.value=this.parseMaybeAssign(),t.inClassFieldInit=i}else e.value=null;return this.semicolon(),this.finishNode(e,"PropertyDefinition")},co.parseClassStaticBlock=function(e){e.body=[];var t=this.labels;for(this.labels=[],this.enterScope(320);this.type!==Da.braceR;){var i=this.parseStatement(null);e.body.push(i)}return this.next(),this.exitScope(),this.labels=t,this.finishNode(e,"StaticBlock")},co.parseClassId=function(e,t){this.type===Da.name?(e.id=this.parseIdent(),t&&this.checkLValSimple(e.id,2,!1)):(!0===t&&this.unexpected(),e.id=null)},co.parseClassSuper=function(e){e.superClass=this.eat(Da._extends)?this.parseExprSubscripts(!1):null},co.enterClassBody=function(){var e={declared:Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared},co.exitClassBody=function(){for(var e=this.privateNameStack.pop(),t=e.declared,i=e.used,s=this.privateNameStack.length,n=0===s?null:this.privateNameStack[s-1],r=0;r=11&&(this.eatContextual("as")?(e.exported=this.parseModuleExportName(),this.checkExport(t,e.exported,this.lastTokStart)):e.exported=null),this.expectContextual("from"),this.type!==Da.string&&this.unexpected(),e.source=this.parseExprAtom(),this.semicolon(),this.finishNode(e,"ExportAllDeclaration");if(this.eat(Da._default)){var i;if(this.checkExport(t,"default",this.lastTokStart),this.type===Da._function||(i=this.isAsyncFunction())){var s=this.startNode();this.next(),i&&this.next(),e.declaration=this.parseFunction(s,4|mo,!1,i)}else if(this.type===Da._class){var n=this.startNode();e.declaration=this.parseClass(n,"nullableID")}else e.declaration=this.parseMaybeAssign(),this.semicolon();return this.finishNode(e,"ExportDefaultDeclaration")}if(this.shouldParseExportStatement())e.declaration=this.parseStatement(null),"VariableDeclaration"===e.declaration.type?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id,e.declaration.id.start),e.specifiers=[],e.source=null;else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual("from"))this.type!==Da.string&&this.unexpected(),e.source=this.parseExprAtom();else{for(var r=0,a=e.specifiers;r=13&&this.type===Da.string){var e=this.parseLiteral(this.value);return Ya.test(e.value)&&this.raise(e.start,"An export name cannot include a lone surrogate."),e}return this.parseIdent(!0)},co.adaptDirectivePrologue=function(e){for(var t=0;t=6&&e)switch(e.type){case"Identifier":this.inAsync&&"await"===e.name&&this.raise(e.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":e.type="ObjectPattern",i&&this.checkPatternErrors(i,!0);for(var s=0,n=e.properties;s=8&&!a&&"async"===o.name&&!this.canInsertSemicolon()&&this.eat(Da._function))return this.overrideContext(vo.f_expr),this.parseFunction(this.startNodeAt(n,r),0,!1,!0,t);if(s&&!this.canInsertSemicolon()){if(this.eat(Da.arrow))return this.parseArrowExpression(this.startNodeAt(n,r),[o],!1,t);if(this.options.ecmaVersion>=8&&"async"===o.name&&this.type===Da.name&&!a&&(!this.potentialArrowInForAwait||"of"!==this.value||this.containsEsc))return o=this.parseIdent(!1),!this.canInsertSemicolon()&&this.eat(Da.arrow)||this.unexpected(),this.parseArrowExpression(this.startNodeAt(n,r),[o],!0,t)}return o;case Da.regexp:var l=this.value;return(i=this.parseLiteral(l.value)).regex={pattern:l.pattern,flags:l.flags},i;case Da.num:case Da.string:return this.parseLiteral(this.value);case Da._null:case Da._true:case Da._false:return(i=this.startNode()).value=this.type===Da._null?null:this.type===Da._true,i.raw=this.type.keyword,this.next(),this.finishNode(i,"Literal");case Da.parenL:var h=this.start,c=this.parseParenAndDistinguishExpression(s,t);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(c)&&(e.parenthesizedAssign=h),e.parenthesizedBind<0&&(e.parenthesizedBind=h)),c;case Da.bracketL:return i=this.startNode(),this.next(),i.elements=this.parseExprList(Da.bracketR,!0,!0,e),this.finishNode(i,"ArrayExpression");case Da.braceL:return this.overrideContext(vo.b_expr),this.parseObj(!1,e);case Da._function:return i=this.startNode(),this.next(),this.parseFunction(i,0);case Da._class:return this.parseClass(this.startNode(),!1);case Da._new:return this.parseNew();case Da.backQuote:return this.parseTemplate();case Da._import:return this.options.ecmaVersion>=11?this.parseExprImport():this.unexpected();default:this.unexpected()}},Ao.parseExprImport=function(){var e=this.startNode();this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import");var t=this.parseIdent(!0);switch(this.type){case Da.parenL:return this.parseDynamicImport(e);case Da.dot:return e.meta=t,this.parseImportMeta(e);default:this.unexpected()}},Ao.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),!this.eat(Da.parenR)){var t=this.start;this.eat(Da.comma)&&this.eat(Da.parenR)?this.raiseRecoverable(t,"Trailing comma is not allowed in import()"):this.unexpected(t)}return this.finishNode(e,"ImportExpression")},Ao.parseImportMeta=function(e){this.next();var t=this.containsEsc;return e.property=this.parseIdent(!0),"meta"!==e.property.name&&this.raiseRecoverable(e.property.start,"The only valid meta property for import is 'import.meta'"),t&&this.raiseRecoverable(e.start,"'import.meta' must not contain escaped characters"),"module"===this.options.sourceType||this.options.allowImportExportEverywhere||this.raiseRecoverable(e.start,"Cannot use 'import.meta' outside a module"),this.finishNode(e,"MetaProperty")},Ao.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),110===t.raw.charCodeAt(t.raw.length-1)&&(t.bigint=t.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(t,"Literal")},Ao.parseParenExpression=function(){this.expect(Da.parenL);var e=this.parseExpression();return this.expect(Da.parenR),e},Ao.parseParenAndDistinguishExpression=function(e,t){var i,s=this.start,n=this.startLoc,r=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var a,o=this.start,l=this.startLoc,h=[],c=!0,u=!1,d=new ho,p=this.yieldPos,f=this.awaitPos;for(this.yieldPos=0,this.awaitPos=0;this.type!==Da.parenR;){if(c?c=!1:this.expect(Da.comma),r&&this.afterTrailingComma(Da.parenR,!0)){u=!0;break}if(this.type===Da.ellipsis){a=this.start,h.push(this.parseParenItem(this.parseRestBinding())),this.type===Da.comma&&this.raise(this.start,"Comma is not permitted after the rest element");break}h.push(this.parseMaybeAssign(!1,d,this.parseParenItem))}var m=this.lastTokEnd,g=this.lastTokEndLoc;if(this.expect(Da.parenR),e&&!this.canInsertSemicolon()&&this.eat(Da.arrow))return this.checkPatternErrors(d,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=p,this.awaitPos=f,this.parseParenArrowList(s,n,h,t);h.length&&!u||this.unexpected(this.lastTokStart),a&&this.unexpected(a),this.checkExpressionErrors(d,!0),this.yieldPos=p||this.yieldPos,this.awaitPos=f||this.awaitPos,h.length>1?((i=this.startNodeAt(o,l)).expressions=h,this.finishNodeAt(i,"SequenceExpression",m,g)):i=h[0]}else i=this.parseParenExpression();if(this.options.preserveParens){var y=this.startNodeAt(s,n);return y.expression=i,this.finishNode(y,"ParenthesizedExpression")}return i},Ao.parseParenItem=function(e){return e},Ao.parseParenArrowList=function(e,t,i,s){return this.parseArrowExpression(this.startNodeAt(e,t),i,!1,s)};var Po=[];Ao.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var e=this.startNode(),t=this.parseIdent(!0);if(this.options.ecmaVersion>=6&&this.eat(Da.dot)){e.meta=t;var i=this.containsEsc;return e.property=this.parseIdent(!0),"target"!==e.property.name&&this.raiseRecoverable(e.property.start,"The only valid meta property for new is 'new.target'"),i&&this.raiseRecoverable(e.start,"'new.target' must not contain escaped characters"),this.allowNewDotTarget||this.raiseRecoverable(e.start,"'new.target' can only be used in functions and class static block"),this.finishNode(e,"MetaProperty")}var s=this.start,n=this.startLoc,r=this.type===Da._import;return e.callee=this.parseSubscripts(this.parseExprAtom(),s,n,!0,!1),r&&"ImportExpression"===e.callee.type&&this.raise(s,"Cannot use new with import()"),this.eat(Da.parenL)?e.arguments=this.parseExprList(Da.parenR,this.options.ecmaVersion>=8,!1):e.arguments=Po,this.finishNode(e,"NewExpression")},Ao.parseTemplateElement=function(e){var t=e.isTagged,i=this.startNode();return this.type===Da.invalidTemplate?(t||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),i.value={raw:this.value,cooked:null}):i.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,"\n"),cooked:this.value},this.next(),i.tail=this.type===Da.backQuote,this.finishNode(i,"TemplateElement")},Ao.parseTemplate=function(e){void 0===e&&(e={});var t=e.isTagged;void 0===t&&(t=!1);var i=this.startNode();this.next(),i.expressions=[];var s=this.parseTemplateElement({isTagged:t});for(i.quasis=[s];!s.tail;)this.type===Da.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(Da.dollarBraceL),i.expressions.push(this.parseExpression()),this.expect(Da.braceR),i.quasis.push(s=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(i,"TemplateLiteral")},Ao.isAsyncProp=function(e){return!e.computed&&"Identifier"===e.key.type&&"async"===e.key.name&&(this.type===Da.name||this.type===Da.num||this.type===Da.string||this.type===Da.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===Da.star)&&!La.test(this.input.slice(this.lastTokEnd,this.start))},Ao.parseObj=function(e,t){var i=this.startNode(),s=!0,n={};for(i.properties=[],this.next();!this.eat(Da.braceR);){if(s)s=!1;else if(this.expect(Da.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(Da.braceR))break;var r=this.parseProperty(e,t);e||this.checkPropClash(r,n,t),i.properties.push(r)}return this.finishNode(i,e?"ObjectPattern":"ObjectExpression")},Ao.parseProperty=function(e,t){var i,s,n,r,a=this.startNode();if(this.options.ecmaVersion>=9&&this.eat(Da.ellipsis))return e?(a.argument=this.parseIdent(!1),this.type===Da.comma&&this.raise(this.start,"Comma is not permitted after the rest element"),this.finishNode(a,"RestElement")):(this.type===Da.parenL&&t&&(t.parenthesizedAssign<0&&(t.parenthesizedAssign=this.start),t.parenthesizedBind<0&&(t.parenthesizedBind=this.start)),a.argument=this.parseMaybeAssign(!1,t),this.type===Da.comma&&t&&t.trailingComma<0&&(t.trailingComma=this.start),this.finishNode(a,"SpreadElement"));this.options.ecmaVersion>=6&&(a.method=!1,a.shorthand=!1,(e||t)&&(n=this.start,r=this.startLoc),e||(i=this.eat(Da.star)));var o=this.containsEsc;return this.parsePropertyName(a),!e&&!o&&this.options.ecmaVersion>=8&&!i&&this.isAsyncProp(a)?(s=!0,i=this.options.ecmaVersion>=9&&this.eat(Da.star),this.parsePropertyName(a,t)):s=!1,this.parsePropertyValue(a,e,i,s,n,r,t,o),this.finishNode(a,"Property")},Ao.parsePropertyValue=function(e,t,i,s,n,r,a,o){if((i||s)&&this.type===Da.colon&&this.unexpected(),this.eat(Da.colon))e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,a),e.kind="init";else if(this.options.ecmaVersion>=6&&this.type===Da.parenL)t&&this.unexpected(),e.kind="init",e.method=!0,e.value=this.parseMethod(i,s);else if(t||o||!(this.options.ecmaVersion>=5)||e.computed||"Identifier"!==e.key.type||"get"!==e.key.name&&"set"!==e.key.name||this.type===Da.comma||this.type===Da.braceR||this.type===Da.eq)this.options.ecmaVersion>=6&&!e.computed&&"Identifier"===e.key.type?((i||s)&&this.unexpected(),this.checkUnreserved(e.key),"await"!==e.key.name||this.awaitIdentPos||(this.awaitIdentPos=n),e.kind="init",t?e.value=this.parseMaybeDefault(n,r,this.copyNode(e.key)):this.type===Da.eq&&a?(a.shorthandAssign<0&&(a.shorthandAssign=this.start),e.value=this.parseMaybeDefault(n,r,this.copyNode(e.key))):e.value=this.copyNode(e.key),e.shorthand=!0):this.unexpected();else{(i||s)&&this.unexpected(),e.kind=e.key.name,this.parsePropertyName(e),e.value=this.parseMethod(!1);var l="get"===e.kind?0:1;if(e.value.params.length!==l){var h=e.value.start;"get"===e.kind?this.raiseRecoverable(h,"getter should have no params"):this.raiseRecoverable(h,"setter should have exactly one param")}else"set"===e.kind&&"RestElement"===e.value.params[0].type&&this.raiseRecoverable(e.value.params[0].start,"Setter cannot use rest params")}},Ao.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(Da.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(Da.bracketR),e.key;e.computed=!1}return e.key=this.type===Da.num||this.type===Da.string?this.parseExprAtom():this.parseIdent("never"!==this.options.allowReserved)},Ao.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)},Ao.parseMethod=function(e,t,i){var s=this.startNode(),n=this.yieldPos,r=this.awaitPos,a=this.awaitIdentPos;return this.initFunction(s),this.options.ecmaVersion>=6&&(s.generator=e),this.options.ecmaVersion>=8&&(s.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(64|no(t,s.generator)|(i?128:0)),this.expect(Da.parenL),s.params=this.parseBindingList(Da.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(s,!1,!0,!1),this.yieldPos=n,this.awaitPos=r,this.awaitIdentPos=a,this.finishNode(s,"FunctionExpression")},Ao.parseArrowExpression=function(e,t,i,s){var n=this.yieldPos,r=this.awaitPos,a=this.awaitIdentPos;return this.enterScope(16|no(i,!1)),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!i),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0,!1,s),this.yieldPos=n,this.awaitPos=r,this.awaitIdentPos=a,this.finishNode(e,"ArrowFunctionExpression")},Ao.parseFunctionBody=function(e,t,i,s){var n=t&&this.type!==Da.braceL,r=this.strict,a=!1;if(n)e.body=this.parseMaybeAssign(s),e.expression=!0,this.checkParams(e,!1);else{var o=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);r&&!o||(a=this.strictDirective(this.end))&&o&&this.raiseRecoverable(e.start,"Illegal 'use strict' directive in function with non-simple parameter list");var l=this.labels;this.labels=[],a&&(this.strict=!0),this.checkParams(e,!r&&!a&&!t&&!i&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLValSimple(e.id,5),e.body=this.parseBlock(!1,void 0,a&&!r),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=l}this.exitScope()},Ao.isSimpleParamList=function(e){for(var t=0,i=e;t-1||n.functions.indexOf(e)>-1||n.var.indexOf(e)>-1,n.lexical.push(e),this.inModule&&1&n.flags&&delete this.undefinedExports[e]}else if(4===t)this.currentScope().lexical.push(e);else if(3===t){var r=this.currentScope();s=this.treatFunctionsAsVar?r.lexical.indexOf(e)>-1:r.lexical.indexOf(e)>-1||r.var.indexOf(e)>-1,r.functions.push(e)}else for(var a=this.scopeStack.length-1;a>=0;--a){var o=this.scopeStack[a];if(o.lexical.indexOf(e)>-1&&!(32&o.flags&&o.lexical[0]===e)||!this.treatFunctionsAsVarInScope(o)&&o.functions.indexOf(e)>-1){s=!0;break}if(o.var.push(e),this.inModule&&1&o.flags&&delete this.undefinedExports[e],259&o.flags)break}s&&this.raiseRecoverable(i,"Identifier '"+e+"' has already been declared")},wo.checkLocalExport=function(e){-1===this.scopeStack[0].lexical.indexOf(e.name)&&-1===this.scopeStack[0].var.indexOf(e.name)&&(this.undefinedExports[e.name]=e)},wo.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},wo.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(259&t.flags)return t}},wo.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(259&t.flags&&!(16&t.flags))return t}};var No=function(e,t,i){this.type="",this.start=t,this.end=0,e.options.locations&&(this.loc=new Ja(e,i)),e.options.directSourceFile&&(this.sourceFile=e.options.directSourceFile),e.options.ranges&&(this.range=[t,0])},_o=ro.prototype;function $o(e,t,i,s){return e.type=t,e.end=i,this.options.locations&&(e.loc.end=s),this.options.ranges&&(e.range[1]=i),e}_o.startNode=function(){return new No(this,this.start,this.startLoc)},_o.startNodeAt=function(e,t){return new No(this,e,t)},_o.finishNode=function(e,t){return $o.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)},_o.finishNodeAt=function(e,t,i,s){return $o.call(this,e,t,i,s)},_o.copyNode=function(e){var t=new No(this,e.start,this.startLoc);for(var i in e)t[i]=e[i];return t};var To="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",Oo=To+" Extended_Pictographic",Mo=Oo+" EBase EComp EMod EPres ExtPict",Ro={9:To,10:Oo,11:Oo,12:Mo,13:"ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS Extended_Pictographic EBase EComp EMod EPres ExtPict"},Do="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",Lo="Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",Vo=Lo+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",Bo=Vo+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",Fo=Bo+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",zo={9:Lo,10:Vo,11:Bo,12:Fo,13:"Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith"},jo={};function Uo(e){var t=jo[e]={binary:Ka(Ro[e]+" "+Do),nonBinary:{General_Category:Ka(Do),Script:Ka(zo[e])}};t.nonBinary.Script_Extensions=t.nonBinary.Script,t.nonBinary.gc=t.nonBinary.General_Category,t.nonBinary.sc=t.nonBinary.Script,t.nonBinary.scx=t.nonBinary.Script_Extensions}for(var Go=0,Ho=[9,10,11,12,13];Go=6?"uy":"")+(e.options.ecmaVersion>=9?"s":"")+(e.options.ecmaVersion>=13?"d":""),this.unicodeProperties=jo[e.options.ecmaVersion>=13?13:e.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=[],this.backReferenceNames=[]};function Ko(e){return 36===e||e>=40&&e<=43||46===e||63===e||e>=91&&e<=94||e>=123&&e<=125}function Xo(e){return e>=65&&e<=90||e>=97&&e<=122}function Yo(e){return Xo(e)||95===e}function Qo(e){return Yo(e)||Jo(e)}function Jo(e){return e>=48&&e<=57}function Zo(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function el(e){return e>=65&&e<=70?e-65+10:e>=97&&e<=102?e-97+10:e-48}function tl(e){return e>=48&&e<=55}qo.prototype.reset=function(e,t,i){var s=-1!==i.indexOf("u");this.start=0|e,this.source=t+"",this.flags=i,this.switchU=s&&this.parser.options.ecmaVersion>=6,this.switchN=s&&this.parser.options.ecmaVersion>=9},qo.prototype.raise=function(e){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+e)},qo.prototype.at=function(e,t){void 0===t&&(t=!1);var i=this.source,s=i.length;if(e>=s)return-1;var n=i.charCodeAt(e);if(!t&&!this.switchU||n<=55295||n>=57344||e+1>=s)return n;var r=i.charCodeAt(e+1);return r>=56320&&r<=57343?(n<<10)+r-56613888:n},qo.prototype.nextIndex=function(e,t){void 0===t&&(t=!1);var i=this.source,s=i.length;if(e>=s)return s;var n,r=i.charCodeAt(e);return!t&&!this.switchU||r<=55295||r>=57344||e+1>=s||(n=i.charCodeAt(e+1))<56320||n>57343?e+1:e+2},qo.prototype.current=function(e){return void 0===e&&(e=!1),this.at(this.pos,e)},qo.prototype.lookahead=function(e){return void 0===e&&(e=!1),this.at(this.nextIndex(this.pos,e),e)},qo.prototype.advance=function(e){void 0===e&&(e=!1),this.pos=this.nextIndex(this.pos,e)},qo.prototype.eat=function(e,t){return void 0===t&&(t=!1),this.current(t)===e&&(this.advance(t),!0)},Wo.validateRegExpFlags=function(e){for(var t=e.validFlags,i=e.flags,s=0;s-1&&this.raise(e.start,"Duplicate regular expression flag")}},Wo.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&e.groupNames.length>0&&(e.switchN=!0,this.regexp_pattern(e))},Wo.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue="",e.lastAssertionIsQuantifiable=!1,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames.length=0,e.backReferenceNames.length=0,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise("Unmatched ')'"),(e.eat(93)||e.eat(125))&&e.raise("Lone quantifier brackets")),e.maxBackReference>e.numCapturingParens&&e.raise("Invalid escape");for(var t=0,i=e.backReferenceNames;t=9&&(i=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise("Unterminated group"),e.lastAssertionIsQuantifiable=!i,!0}return e.pos=t,!1},Wo.regexp_eatQuantifier=function(e,t){return void 0===t&&(t=!1),!!this.regexp_eatQuantifierPrefix(e,t)&&(e.eat(63),!0)},Wo.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)},Wo.regexp_eatBracedQuantifier=function(e,t){var i=e.pos;if(e.eat(123)){var s=0,n=-1;if(this.regexp_eatDecimalDigits(e)&&(s=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(n=e.lastIntValue),e.eat(125)))return-1!==n&&n=9?this.regexp_groupSpecifier(e):63===e.current()&&e.raise("Invalid group"),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,!0;e.raise("Unterminated group")}return!1},Wo.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)},Wo.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise("Nothing to repeat"),!1},Wo.regexp_eatSyntaxCharacter=function(e){var t=e.current();return!!Ko(t)&&(e.lastIntValue=t,e.advance(),!0)},Wo.regexp_eatPatternCharacters=function(e){for(var t=e.pos,i=0;-1!==(i=e.current())&&!Ko(i);)e.advance();return e.pos!==t},Wo.regexp_eatExtendedPatternCharacter=function(e){var t=e.current();return!(-1===t||36===t||t>=40&&t<=43||46===t||63===t||91===t||94===t||124===t||(e.advance(),0))},Wo.regexp_groupSpecifier=function(e){if(e.eat(63)){if(this.regexp_eatGroupName(e))return-1!==e.groupNames.indexOf(e.lastStringValue)&&e.raise("Duplicate capture group name"),void e.groupNames.push(e.lastStringValue);e.raise("Invalid group")}},Wo.regexp_eatGroupName=function(e){if(e.lastStringValue="",e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62))return!0;e.raise("Invalid capture group name")}return!1},Wo.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue="",this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=Xa(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=Xa(e.lastIntValue);return!0}return!1},Wo.regexp_eatRegExpIdentifierStart=function(e){var t=e.pos,i=this.options.ecmaVersion>=11,s=e.current(i);return e.advance(i),92===s&&this.regexp_eatRegExpUnicodeEscapeSequence(e,i)&&(s=e.lastIntValue),function(e){return Ca(e,!0)||36===e||95===e}(s)?(e.lastIntValue=s,!0):(e.pos=t,!1)},Wo.regexp_eatRegExpIdentifierPart=function(e){var t=e.pos,i=this.options.ecmaVersion>=11,s=e.current(i);return e.advance(i),92===s&&this.regexp_eatRegExpUnicodeEscapeSequence(e,i)&&(s=e.lastIntValue),function(e){return Na(e,!0)||36===e||95===e||8204===e||8205===e}(s)?(e.lastIntValue=s,!0):(e.pos=t,!1)},Wo.regexp_eatAtomEscape=function(e){return!!(this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e))||(e.switchU&&(99===e.current()&&e.raise("Invalid unicode escape"),e.raise("Invalid escape")),!1)},Wo.regexp_eatBackReference=function(e){var t=e.pos;if(this.regexp_eatDecimalEscape(e)){var i=e.lastIntValue;if(e.switchU)return i>e.maxBackReference&&(e.maxBackReference=i),!0;if(i<=e.numCapturingParens)return!0;e.pos=t}return!1},Wo.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise("Invalid named reference")}return!1},Wo.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,!1)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)},Wo.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1},Wo.regexp_eatZero=function(e){return 48===e.current()&&!Jo(e.lookahead())&&(e.lastIntValue=0,e.advance(),!0)},Wo.regexp_eatControlEscape=function(e){var t=e.current();return 116===t?(e.lastIntValue=9,e.advance(),!0):110===t?(e.lastIntValue=10,e.advance(),!0):118===t?(e.lastIntValue=11,e.advance(),!0):102===t?(e.lastIntValue=12,e.advance(),!0):114===t&&(e.lastIntValue=13,e.advance(),!0)},Wo.regexp_eatControlLetter=function(e){var t=e.current();return!!Xo(t)&&(e.lastIntValue=t%32,e.advance(),!0)},Wo.regexp_eatRegExpUnicodeEscapeSequence=function(e,t){void 0===t&&(t=!1);var i,s=e.pos,n=t||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var r=e.lastIntValue;if(n&&r>=55296&&r<=56319){var a=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var o=e.lastIntValue;if(o>=56320&&o<=57343)return e.lastIntValue=1024*(r-55296)+(o-56320)+65536,!0}e.pos=a,e.lastIntValue=r}return!0}if(n&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&(i=e.lastIntValue)>=0&&i<=1114111)return!0;n&&e.raise("Invalid unicode escape"),e.pos=s}return!1},Wo.regexp_eatIdentityEscape=function(e){if(e.switchU)return!!this.regexp_eatSyntaxCharacter(e)||!!e.eat(47)&&(e.lastIntValue=47,!0);var t=e.current();return!(99===t||e.switchN&&107===t||(e.lastIntValue=t,e.advance(),0))},Wo.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var t=e.current();if(t>=49&&t<=57){do{e.lastIntValue=10*e.lastIntValue+(t-48),e.advance()}while((t=e.current())>=48&&t<=57);return!0}return!1},Wo.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(function(e){return 100===e||68===e||115===e||83===e||119===e||87===e}(t))return e.lastIntValue=-1,e.advance(),!0;if(e.switchU&&this.options.ecmaVersion>=9&&(80===t||112===t)){if(e.lastIntValue=-1,e.advance(),e.eat(123)&&this.regexp_eatUnicodePropertyValueExpression(e)&&e.eat(125))return!0;e.raise("Invalid property name")}return!1},Wo.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var i=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var s=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,i,s),!0}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var n=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,n),!0}return!1},Wo.regexp_validateUnicodePropertyNameAndValue=function(e,t,i){Wa(e.unicodeProperties.nonBinary,t)||e.raise("Invalid property name"),e.unicodeProperties.nonBinary[t].test(i)||e.raise("Invalid property value")},Wo.regexp_validateUnicodePropertyNameOrValue=function(e,t){e.unicodeProperties.binary.test(t)||e.raise("Invalid property name")},Wo.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue="";Yo(t=e.current());)e.lastStringValue+=Xa(t),e.advance();return""!==e.lastStringValue},Wo.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue="";Qo(t=e.current());)e.lastStringValue+=Xa(t),e.advance();return""!==e.lastStringValue},Wo.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)},Wo.regexp_eatCharacterClass=function(e){if(e.eat(91)){if(e.eat(94),this.regexp_classRanges(e),e.eat(93))return!0;e.raise("Unterminated character class")}return!1},Wo.regexp_classRanges=function(e){for(;this.regexp_eatClassAtom(e);){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var i=e.lastIntValue;!e.switchU||-1!==t&&-1!==i||e.raise("Invalid character class"),-1!==t&&-1!==i&&t>i&&e.raise("Range out of order in character class")}}},Wo.regexp_eatClassAtom=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){var i=e.current();(99===i||tl(i))&&e.raise("Invalid class escape"),e.raise("Invalid escape")}e.pos=t}var s=e.current();return 93!==s&&(e.lastIntValue=s,e.advance(),!0)},Wo.regexp_eatClassEscape=function(e){var t=e.pos;if(e.eat(98))return e.lastIntValue=8,!0;if(e.switchU&&e.eat(45))return e.lastIntValue=45,!0;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return!0;e.pos=t}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)},Wo.regexp_eatClassControlLetter=function(e){var t=e.current();return!(!Jo(t)&&95!==t||(e.lastIntValue=t%32,e.advance(),0))},Wo.regexp_eatHexEscapeSequence=function(e){var t=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return!0;e.switchU&&e.raise("Invalid escape"),e.pos=t}return!1},Wo.regexp_eatDecimalDigits=function(e){var t=e.pos,i=0;for(e.lastIntValue=0;Jo(i=e.current());)e.lastIntValue=10*e.lastIntValue+(i-48),e.advance();return e.pos!==t},Wo.regexp_eatHexDigits=function(e){var t=e.pos,i=0;for(e.lastIntValue=0;Zo(i=e.current());)e.lastIntValue=16*e.lastIntValue+el(i),e.advance();return e.pos!==t},Wo.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var i=e.lastIntValue;t<=3&&this.regexp_eatOctalDigit(e)?e.lastIntValue=64*t+8*i+e.lastIntValue:e.lastIntValue=8*t+i}else e.lastIntValue=t;return!0}return!1},Wo.regexp_eatOctalDigit=function(e){var t=e.current();return tl(t)?(e.lastIntValue=t-48,e.advance(),!0):(e.lastIntValue=0,!1)},Wo.regexp_eatFixedHexDigits=function(e,t){var i=e.pos;e.lastIntValue=0;for(var s=0;s=this.input.length?this.finishToken(Da.eof):e.override?e.override(this):void this.readToken(this.fullCharCodeAtPos())},sl.readToken=function(e){return Ca(e,this.options.ecmaVersion>=6)||92===e?this.readWord():this.getTokenFromCode(e)},sl.fullCharCodeAtPos=function(){var e=this.input.charCodeAt(this.pos);if(e<=55295||e>=56320)return e;var t=this.input.charCodeAt(this.pos+1);return t<=56319||t>=57344?e:(e<<10)+t-56613888},sl.skipBlockComment=function(){var e=this.options.onComment&&this.curPosition(),t=this.pos,i=this.input.indexOf("*/",this.pos+=2);if(-1===i&&this.raise(this.pos-2,"Unterminated comment"),this.pos=i+2,this.options.locations)for(var s=void 0,n=t;(s=Fa(this.input,n,this.pos))>-1;)++this.curLine,n=this.lineStart=s;this.options.onComment&&this.options.onComment(!0,this.input.slice(t+2,i),t,this.pos,e,this.curPosition())},sl.skipLineComment=function(e){for(var t=this.pos,i=this.options.onComment&&this.curPosition(),s=this.input.charCodeAt(this.pos+=e);this.pos8&&e<14||e>=5760&&za.test(String.fromCharCode(e))))break e;++this.pos}}},sl.finishToken=function(e,t){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var i=this.type;this.type=e,this.value=t,this.updateContext(i)},sl.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var t=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&46===e&&46===t?(this.pos+=3,this.finishToken(Da.ellipsis)):(++this.pos,this.finishToken(Da.dot))},sl.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):61===e?this.finishOp(Da.assign,2):this.finishOp(Da.slash,1)},sl.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),i=1,s=42===e?Da.star:Da.modulo;return this.options.ecmaVersion>=7&&42===e&&42===t&&(++i,s=Da.starstar,t=this.input.charCodeAt(this.pos+2)),61===t?this.finishOp(Da.assign,i+1):this.finishOp(s,i)},sl.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?this.options.ecmaVersion>=12&&61===this.input.charCodeAt(this.pos+2)?this.finishOp(Da.assign,3):this.finishOp(124===e?Da.logicalOR:Da.logicalAND,2):61===t?this.finishOp(Da.assign,2):this.finishOp(124===e?Da.bitwiseOR:Da.bitwiseAND,1)},sl.readToken_caret=function(){return 61===this.input.charCodeAt(this.pos+1)?this.finishOp(Da.assign,2):this.finishOp(Da.bitwiseXOR,1)},sl.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?45!==t||this.inModule||62!==this.input.charCodeAt(this.pos+2)||0!==this.lastTokEnd&&!La.test(this.input.slice(this.lastTokEnd,this.pos))?this.finishOp(Da.incDec,2):(this.skipLineComment(3),this.skipSpace(),this.nextToken()):61===t?this.finishOp(Da.assign,2):this.finishOp(Da.plusMin,1)},sl.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),i=1;return t===e?(i=62===e&&62===this.input.charCodeAt(this.pos+2)?3:2,61===this.input.charCodeAt(this.pos+i)?this.finishOp(Da.assign,i+1):this.finishOp(Da.bitShift,i)):33!==t||60!==e||this.inModule||45!==this.input.charCodeAt(this.pos+2)||45!==this.input.charCodeAt(this.pos+3)?(61===t&&(i=2),this.finishOp(Da.relational,i)):(this.skipLineComment(4),this.skipSpace(),this.nextToken())},sl.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return 61===t?this.finishOp(Da.equality,61===this.input.charCodeAt(this.pos+2)?3:2):61===e&&62===t&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(Da.arrow)):this.finishOp(61===e?Da.eq:Da.prefix,1)},sl.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var t=this.input.charCodeAt(this.pos+1);if(46===t){var i=this.input.charCodeAt(this.pos+2);if(i<48||i>57)return this.finishOp(Da.questionDot,2)}if(63===t)return e>=12&&61===this.input.charCodeAt(this.pos+2)?this.finishOp(Da.assign,3):this.finishOp(Da.coalesce,2)}return this.finishOp(Da.question,1)},sl.readToken_numberSign=function(){var e=35;if(this.options.ecmaVersion>=13&&(++this.pos,Ca(e=this.fullCharCodeAtPos(),!0)||92===e))return this.finishToken(Da.privateId,this.readWord1());this.raise(this.pos,"Unexpected character '"+Xa(e)+"'")},sl.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(Da.parenL);case 41:return++this.pos,this.finishToken(Da.parenR);case 59:return++this.pos,this.finishToken(Da.semi);case 44:return++this.pos,this.finishToken(Da.comma);case 91:return++this.pos,this.finishToken(Da.bracketL);case 93:return++this.pos,this.finishToken(Da.bracketR);case 123:return++this.pos,this.finishToken(Da.braceL);case 125:return++this.pos,this.finishToken(Da.braceR);case 58:return++this.pos,this.finishToken(Da.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(Da.backQuote);case 48:var t=this.input.charCodeAt(this.pos+1);if(120===t||88===t)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(111===t||79===t)return this.readRadixNumber(8);if(98===t||66===t)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(Da.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+Xa(e)+"'")},sl.finishOp=function(e,t){var i=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,i)},sl.readRegexp=function(){for(var e,t,i=this.pos;;){this.pos>=this.input.length&&this.raise(i,"Unterminated regular expression");var s=this.input.charAt(this.pos);if(La.test(s)&&this.raise(i,"Unterminated regular expression"),e)e=!1;else{if("["===s)t=!0;else if("]"===s&&t)t=!1;else if("/"===s&&!t)break;e="\\"===s}++this.pos}var n=this.input.slice(i,this.pos);++this.pos;var r=this.pos,a=this.readWord1();this.containsEsc&&this.unexpected(r);var o=this.regexpState||(this.regexpState=new qo(this));o.reset(i,n,a),this.validateRegExpFlags(o),this.validateRegExpPattern(o);var l=null;try{l=new RegExp(n,a)}catch(e){}return this.finishToken(Da.regexp,{pattern:n,flags:a,value:l})},sl.readInt=function(e,t,i){for(var s=this.options.ecmaVersion>=12&&void 0===t,n=i&&48===this.input.charCodeAt(this.pos),r=this.pos,a=0,o=0,l=0,h=null==t?1/0:t;l=97?c-97+10:c>=65?c-65+10:c>=48&&c<=57?c-48:1/0)>=e)break;o=c,a=a*e+u}}return s&&95===o&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===r||null!=t&&this.pos-r!==t?null:a},sl.readRadixNumber=function(e){var t=this.pos;this.pos+=2;var i=this.readInt(e);return null==i&&this.raise(this.start+2,"Expected number in radix "+e),this.options.ecmaVersion>=11&&110===this.input.charCodeAt(this.pos)?(i=nl(this.input.slice(t,this.pos)),++this.pos):Ca(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(Da.num,i)},sl.readNumber=function(e){var t=this.pos;e||null!==this.readInt(10,void 0,!0)||this.raise(t,"Invalid number");var i=this.pos-t>=2&&48===this.input.charCodeAt(t);i&&this.strict&&this.raise(t,"Invalid number");var s=this.input.charCodeAt(this.pos);if(!i&&!e&&this.options.ecmaVersion>=11&&110===s){var n=nl(this.input.slice(t,this.pos));return++this.pos,Ca(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(Da.num,n)}i&&/[89]/.test(this.input.slice(t,this.pos))&&(i=!1),46!==s||i||(++this.pos,this.readInt(10),s=this.input.charCodeAt(this.pos)),69!==s&&101!==s||i||(43!==(s=this.input.charCodeAt(++this.pos))&&45!==s||++this.pos,null===this.readInt(10)&&this.raise(t,"Invalid number")),Ca(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var r,a=(r=this.input.slice(t,this.pos),i?parseInt(r,8):parseFloat(r.replace(/_/g,"")));return this.finishToken(Da.num,a)},sl.readCodePoint=function(){var e;if(123===this.input.charCodeAt(this.pos)){this.options.ecmaVersion<6&&this.unexpected();var t=++this.pos;e=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,e>1114111&&this.invalidStringToken(t,"Code point out of bounds")}else e=this.readHexChar(4);return e},sl.readString=function(e){for(var t="",i=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var s=this.input.charCodeAt(this.pos);if(s===e)break;92===s?(t+=this.input.slice(i,this.pos),t+=this.readEscapedChar(!1),i=this.pos):8232===s||8233===s?(this.options.ecmaVersion<10&&this.raise(this.start,"Unterminated string constant"),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(Ba(s)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return t+=this.input.slice(i,this.pos++),this.finishToken(Da.string,t)};var rl={};sl.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e!==rl)throw e;this.readInvalidTemplateToken()}this.inTemplateElement=!1},sl.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw rl;this.raise(e,t)},sl.readTmplToken=function(){for(var e="",t=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var i=this.input.charCodeAt(this.pos);if(96===i||36===i&&123===this.input.charCodeAt(this.pos+1))return this.pos!==this.start||this.type!==Da.template&&this.type!==Da.invalidTemplate?(e+=this.input.slice(t,this.pos),this.finishToken(Da.template,e)):36===i?(this.pos+=2,this.finishToken(Da.dollarBraceL)):(++this.pos,this.finishToken(Da.backQuote));if(92===i)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(!0),t=this.pos;else if(Ba(i)){switch(e+=this.input.slice(t,this.pos),++this.pos,i){case 13:10===this.input.charCodeAt(this.pos)&&++this.pos;case 10:e+="\n";break;default:e+=String.fromCharCode(i)}this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos}else++this.pos}},sl.readInvalidTemplateToken=function(){for(;this.pos=48&&t<=55){var s=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],n=parseInt(s,8);return n>255&&(s=s.slice(0,-1),n=parseInt(s,8)),this.pos+=s.length-1,t=this.input.charCodeAt(this.pos),"0"===s&&56!==t&&57!==t||!this.strict&&!e||this.invalidStringToken(this.pos-1-s.length,e?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(n)}return Ba(t)?"":String.fromCharCode(t)}},sl.readHexChar=function(e){var t=this.pos,i=this.readInt(16,e);return null===i&&this.invalidStringToken(t,"Bad character escape sequence"),i},sl.readWord1=function(){this.containsEsc=!1;for(var e="",t=!0,i=this.pos,s=this.options.ecmaVersion>=6;this.pos()=>{fe({code:"NO_FS_IN_BROWSER",message:`Cannot access the file system (via "${e}") when using the browser build of Rollup. Make sure you supply a plugin with custom resolveId and load hooks to Rollup.`,url:"https://rollupjs.org/guide/en/#a-simple-example"})},ol={mkdir:al("fs.mkdir"),readFile:al("fs.readFile"),writeFile:al("fs.writeFile")};async function ll(e,t,i,s,n,r,a,o){const l=await function(e,t,i,s,n,r,a){let o=null,l=null;if(n){o=new Set;for(const i of n)e===i.source&&t===i.importer&&o.add(i.plugin);l=(e,t)=>({...e,resolve:(e,i,{custom:r,isEntry:a,skipSelf:o}=se)=>s(e,i,r,a,o?[...n,{importer:i,plugin:t,source:e}]:n)})}return i.hookFirst("resolveId",[e,t,{custom:r,isEntry:a}],l,o)}(e,t,s,n,r,a,o);return null==l&&al("path.resolve"),l}const hl="at position ",cl="at output position ";function ul(e,t,{hook:i,id:s}={}){return"string"==typeof e&&(e={message:e}),e.code&&e.code!==ge.PLUGIN_ERROR&&(e.pluginCode=e.code),e.code=ge.PLUGIN_ERROR,e.plugin=t,i&&(e.hook=i),s&&(e.id=s),fe(e)}const dl=[{active:!0,deprecated:"resolveAssetUrl",replacement:"resolveFileUrl"}],pl={delete:()=>!1,get(){},has:()=>!1,set(){}};function fl(e){return e.startsWith(hl)||e.startsWith(cl)?fe({code:"ANONYMOUS_PLUGIN_CACHE",message:"A plugin is trying to use the Rollup cache but is not declaring a plugin name or cacheKey."}):fe({code:"DUPLICATE_PLUGIN_NAME",message:`The plugin name ${e} is being used twice in the same build. Plugin names must be distinct or provide a cacheKey (please post an issue to the plugin if you are a plugin user).`})}async function ml(e,t,i,s){const n=t.id,r=[];let a=null===e.map?null:Qr(e.map);const o=e.code;let l=e.ast;const h=[],u=[];let d=!1;const p=()=>d=!0;let f="";const m=e.code;let g;try{g=await i.hookReduceArg0("transform",[m,n],(function(e,i,n){let a,o;if("string"==typeof i)a=i;else{if(!i||"object"!=typeof i)return e;if(t.updateOptions(i),null==i.code)return(i.map||i.ast)&&s(function(e){return{code:ge.NO_TRANSFORM_MAP_OR_AST_WITHOUT_CODE,message:`The plugin "${e}" returned a "map" or "ast" without returning a "code". This will be ignored.`}}(n.name)),e;({code:a,map:o,ast:l}=i)}return null!==o&&r.push(Qr("string"==typeof o?JSON.parse(o):o)||{missing:!0,plugin:n.name}),a}),((e,t)=>{return f=t.name,{...e,addWatchFile(t){h.push(t),e.addWatchFile(t)},cache:d?e.cache:(l=e.cache,g=p,{delete:e=>(g(),l.delete(e)),get:e=>(g(),l.get(e)),has:e=>(g(),l.has(e)),set:(e,t)=>(g(),l.set(e,t))}),emitAsset:(t,i)=>(u.push({name:t,source:i,type:"asset"}),e.emitAsset(t,i)),emitChunk:(t,i)=>(u.push({id:t,name:i&&i.name,type:"chunk"}),e.emitChunk(t,i)),emitFile:e=>(u.push(e),i.emitFile(e)),error:(t,i)=>("string"==typeof t&&(t={message:t}),i&&me(t,i,m,n),t.id=n,t.hook="transform",e.error(t)),getCombinedSourcemap(){const e=function(e,t,i,s,n){return s.length?{version:3,...tr(e,t,i,s,er(n)).traceMappings()}:i}(n,o,a,r,s);return e?(a!==e&&(a=e,r.length=0),new c({...e,file:null,sourcesContent:e.sourcesContent})):new E(o).generateMap({hires:!0,includeContent:!0,source:n})},setAssetSource(){return this.error({code:"INVALID_SETASSETSOURCE",message:"setAssetSource cannot be called in transform for caching reasons. Use emitFile with a source, or call setAssetSource in another hook."})},warn(t,i){"string"==typeof t&&(t={message:t}),i&&me(t,i,m,n),t.id=n,t.hook="transform",e.warn(t)}};var l,g}))}catch(e){ul(e,f,{hook:"transform",id:n})}return d||u.length&&(t.transformFiles=u),{ast:l,code:g,customTransformCache:d,originalCode:o,originalSourcemap:a,sourcemapChain:r,transformDependencies:h}}const gl="resolveDependencies";class yl{constructor(e,t,i,s){this.graph=e,this.modulesById=t,this.options=i,this.pluginDriver=s,this.implicitEntryModules=new Set,this.indexedEntryModules=[],this.latestLoadModulesPromise=Promise.resolve(),this.moduleLoadPromises=new Map,this.modulesWithLoadedDependencies=new Set,this.nextChunkNamePriority=0,this.nextEntryModuleIndex=0,this.resolveId=async(e,t,i,s,n=null)=>this.getResolvedIdWithDefaults(this.getNormalizedResolvedIdWithoutDefaults(!this.options.external(e,t,!1)&&await ll(e,t,this.options.preserveSymlinks,this.pluginDriver,this.resolveId,n,i,"boolean"==typeof s?s:!t),t,e)),this.hasModuleSideEffects=i.treeshake?i.treeshake.moduleSideEffects:()=>!0}async addAdditionalModules(e){const t=this.extendLoadModulesPromise(Promise.all(e.map((e=>this.loadEntryModule(e,!1,void 0,null)))));return await this.awaitLoadModulesPromise(),t}async addEntryModules(e,t){const i=this.nextEntryModuleIndex;this.nextEntryModuleIndex+=e.length;const s=this.nextChunkNamePriority;this.nextChunkNamePriority+=e.length;const n=await this.extendLoadModulesPromise(Promise.all(e.map((({id:e,importer:t})=>this.loadEntryModule(e,!0,t,null)))).then((n=>{for(let r=0;re.module===a));o?o.index=Math.min(o.index,i+r):this.indexedEntryModules.push({index:i+r,module:a})}return this.indexedEntryModules.sort((({index:e},{index:t})=>e>t?1:-1)),n})));return await this.awaitLoadModulesPromise(),{entryModules:this.indexedEntryModules.map((({module:e})=>e)),implicitEntryModules:[...this.implicitEntryModules],newEntryModules:n}}async emitChunk({fileName:e,id:t,importer:i,name:s,implicitlyLoadedAfterOneOf:n,preserveSignature:r}){const a={fileName:e||null,id:t,importer:i,name:s||null},o=n?await this.addEntryWithImplicitDependants(a,n):(await this.addEntryModules([a],!1)).newEntryModules[0];return null!=r&&(o.preserveSignature=r),o}async preloadModule(e){return(await this.fetchModule(this.getResolvedIdWithDefaults(e),void 0,!1,!e.resolveDependencies||gl)).info}addEntryWithImplicitDependants(e,t){const i=this.nextChunkNamePriority++;return this.extendLoadModulesPromise(this.loadEntryModule(e.id,!1,e.importer,null).then((async s=>{if(El(s,e,!1,i),!s.info.isEntry){this.implicitEntryModules.add(s);const i=await Promise.all(t.map((t=>this.loadEntryModule(t,!1,e.importer,s.id))));for(const e of i)s.implicitlyLoadedAfter.add(e);for(const e of s.implicitlyLoadedAfter)e.implicitlyLoadedBefore.add(s)}return s})))}async addModuleSource(e,t,i){let s;En("load modules",3);try{s=await this.graph.fileOperationQueue.run((async()=>{var t;return null!==(t=await this.pluginDriver.hookFirst("load",[e]))&&void 0!==t?t:await ol.readFile(e,"utf8")}))}catch(i){bn("load modules",3);let s=`Could not load ${e}`;throw t&&(s+=` (imported by ${ce(t)})`),s+=`: ${i.message}`,i.message=s,i}bn("load modules",3);const n="string"==typeof s?{code:s}:null!=s&&"object"==typeof s&&"string"==typeof s.code?s:fe(function(e){return{code:ge.BAD_LOADER,message:`Error loading ${ce(e)}: plugin load hook should return a string, a { code, map } object, or nothing/null`}}(e)),r=this.graph.cachedModules.get(e);if(!r||r.customTransformCache||r.originalCode!==n.code||await this.pluginDriver.hookFirst("shouldTransformCachedModule",[{ast:r.ast,code:r.code,id:r.id,meta:r.meta,moduleSideEffects:r.moduleSideEffects,resolvedSources:r.resolvedIds,syntheticNamedExports:r.syntheticNamedExports}]))i.updateOptions(n),i.setSource(await ml(n,i,this.pluginDriver,this.options.onwarn));else{if(r.transformFiles)for(const e of r.transformFiles)this.pluginDriver.emitFile(e);i.setSource(r)}}async awaitLoadModulesPromise(){let e;do{e=this.latestLoadModulesPromise,await e}while(e!==this.latestLoadModulesPromise)}extendLoadModulesPromise(e){return this.latestLoadModulesPromise=Promise.all([e,this.latestLoadModulesPromise]),this.latestLoadModulesPromise.catch((()=>{})),e}async fetchDynamicDependencies(e,t){const i=await Promise.all(t.map((t=>t.then((async([t,i])=>null===i?null:"string"==typeof i?(t.resolution=i,null):t.resolution=await this.fetchResolvedDependency(ce(i.id),e.id,i))))));for(const t of i)t&&(e.dynamicDependencies.add(t),t.dynamicImporters.push(e.id))}async fetchModule({id:e,meta:t,moduleSideEffects:i,syntheticNamedExports:s},n,r,a){const o=this.modulesById.get(e);if(o instanceof kn)return await this.handleExistingModule(o,r,a),o;const l=new kn(this.graph,e,this.options,r,i,s,t);this.modulesById.set(e,l),this.graph.watchFiles[e]=!0;const h=this.addModuleSource(e,n,l).then((()=>[this.getResolveStaticDependencyPromises(l),this.getResolveDynamicImportPromises(l),c])),c=vl(h).then((()=>this.pluginDriver.hookParallel("moduleParsed",[l.info])));c.catch((()=>{})),this.moduleLoadPromises.set(l,h);const u=await h;return a?a===gl&&await c:await this.fetchModuleDependencies(l,...u),l}async fetchModuleDependencies(e,t,i,s){this.modulesWithLoadedDependencies.has(e)||(this.modulesWithLoadedDependencies.add(e),await Promise.all([this.fetchStaticDependencies(e,t),this.fetchDynamicDependencies(e,i)]),e.linkImports(),await s)}fetchResolvedDependency(e,t,i){if(i.external){const{external:s,id:n,moduleSideEffects:r,meta:a}=i;this.modulesById.has(n)||this.modulesById.set(n,new Te(this.options,n,r,a,"absolute"!==s&&w(n)));const o=this.modulesById.get(n);return o instanceof Te?Promise.resolve(o):fe(function(e,t){return{code:ge.INVALID_EXTERNAL_ID,message:`'${e}' is imported as an external by ${ce(t)}, but is already an existing non-external module id.`}}(e,t))}return this.fetchModule(i,t,!1,!1)}async fetchStaticDependencies(e,t){for(const i of await Promise.all(t.map((t=>t.then((([t,i])=>this.fetchResolvedDependency(t,e.id,i)))))))e.dependencies.add(i),i.importers.push(e.id);if(!this.options.treeshake||"no-treeshake"===e.info.moduleSideEffects)for(const t of e.dependencies)t instanceof kn&&(t.importedFromNotTreeshaken=!0)}getNormalizedResolvedIdWithoutDefaults(e,t,i){const{makeAbsoluteExternalsRelative:s}=this.options;if(e){if("object"==typeof e){const n=e.external||this.options.external(e.id,t,!0);return{...e,external:n&&("relative"===n||!w(e.id)||!0===n&&bl(e.id,i,s)||"absolute")}}const n=this.options.external(e,t,!0);return{external:n&&(bl(e,i,s)||"absolute"),id:n&&s?xl(e,t):e}}const n=s?xl(i,t):i;return!1===e||this.options.external(n,t,!0)?{external:bl(n,i,s)||"absolute",id:n}:null}getResolveDynamicImportPromises(e){return e.dynamicImports.map((async t=>{const i=await this.resolveDynamicImport(e,"string"==typeof t.argument?t.argument:t.argument.esTreeNode,e.id);return i&&"object"==typeof i&&(t.id=i.id),[t,i]}))}getResolveStaticDependencyPromises(e){return Array.from(e.sources,(async t=>[t,e.resolvedIds[t]=e.resolvedIds[t]||this.handleResolveId(await this.resolveId(t,e.id,ne,!1),t,e.id)]))}getResolvedIdWithDefaults(e){var t,i;if(!e)return null;const s=e.external||!1;return{external:s,id:e.id,meta:e.meta||{},moduleSideEffects:null!==(t=e.moduleSideEffects)&&void 0!==t?t:this.hasModuleSideEffects(e.id,!!s),syntheticNamedExports:null!==(i=e.syntheticNamedExports)&&void 0!==i&&i}}async handleExistingModule(e,t,i){const s=this.moduleLoadPromises.get(e);if(i)return i===gl?vl(s):s;if(t){e.info.isEntry=!0,this.implicitEntryModules.delete(e);for(const t of e.implicitlyLoadedAfter)t.implicitlyLoadedBefore.delete(e);e.implicitlyLoadedAfter.clear()}return this.fetchModuleDependencies(e,...await s)}handleResolveId(e,t,i){return null===e?C(t)?fe(function(e,t){return{code:ge.UNRESOLVED_IMPORT,message:`Could not resolve '${e}' from ${ce(t)}`}}(t,i)):(this.options.onwarn(function(e,t){return{code:ge.UNRESOLVED_IMPORT,importer:ce(t),message:`'${e}' is imported by ${ce(t)}, but could not be resolved – treating it as an external dependency`,source:e,url:"https://rollupjs.org/guide/en/#warning-treating-module-as-external-dependency"}}(t,i)),{external:!0,id:t,meta:{},moduleSideEffects:this.hasModuleSideEffects(t,!0),syntheticNamedExports:!1}):(e.external&&e.syntheticNamedExports&&this.options.onwarn(function(e,t){return{code:ge.EXTERNAL_SYNTHETIC_EXPORTS,importer:ce(t),message:`External '${e}' can not have 'syntheticNamedExports' enabled.`,source:e}}(t,i)),e)}async loadEntryModule(e,t,i,s){const n=await ll(e,i,this.options.preserveSymlinks,this.pluginDriver,this.resolveId,null,ne,!0);return null==n?fe(null===s?function(e){return{code:ge.UNRESOLVED_ENTRY,message:`Could not resolve entry module (${ce(e)}).`}}(e):function(e,t){return{code:ge.MISSING_IMPLICIT_DEPENDANT,message:`Module "${ce(e)}" that should be implicitly loaded before "${ce(t)}" could not be resolved.`}}(e,s)):!1===n||"object"==typeof n&&n.external?fe(null===s?function(e){return{code:ge.UNRESOLVED_ENTRY,message:`Entry module cannot be external (${ce(e)}).`}}(e):function(e,t){return{code:ge.MISSING_IMPLICIT_DEPENDANT,message:`Module "${ce(e)}" that should be implicitly loaded before "${ce(t)}" cannot be external.`}}(e,s)):this.fetchModule(this.getResolvedIdWithDefaults("object"==typeof n?n:{id:n}),void 0,t,!1)}async resolveDynamicImport(e,t,i){var s,n;const r=await this.pluginDriver.hookFirst("resolveDynamicImport",[t,i]);return"string"!=typeof t?"string"==typeof r?r:r?{external:!1,moduleSideEffects:!0,...r}:null:null==r?null!==(s=(n=e.resolvedIds)[t])&&void 0!==s?s:n[t]=this.handleResolveId(await this.resolveId(t,e.id,ne,!1),t,e.id):this.handleResolveId(this.getResolvedIdWithDefaults(this.getNormalizedResolvedIdWithoutDefaults(r,i,t)),t,i)}}function xl(e,t){return C(e)?t?M(t,"..",e):M(e):e}function El(e,{fileName:t,name:i},s,n){var r;if(null!==t)e.chunkFileNames.add(t);else if(null!==i){let t=0;for(;(null===(r=e.chunkNames[t])||void 0===r?void 0:r.priority){for(const[t,i]of this.filesByReferenceId)if("asset"===i.type&&"string"!=typeof i.fileName)return fe((e=i.name||t,{code:ge.ASSET_SOURCE_MISSING,message:`Plugin error creating asset "${e}" - no asset source set.`}));var e},this.emitFile=e=>function(e){return Boolean(e&&("asset"===e.type||"chunk"===e.type))}(e)?function(e){const t=e.fileName||e.name;return!t||"string"==typeof t&&!ue(t)}(e)?"chunk"===e.type?this.emitChunk(e):this.emitAsset(e):fe(Ie(`The "fileName" or "name" properties of emitted files must be strings that are neither absolute nor relative paths, received "${e.fileName||e.name}".`)):fe(Ie(`Emitted files must be of type "asset" or "chunk", received "${e&&e.type}".`)),this.getFileName=e=>{const t=this.filesByReferenceId.get(e);return t?"chunk"===t.type?kl(t,this.facadeChunkByModule):Pl(t,e):fe((i=e,{code:ge.FILE_NOT_FOUND,message:`Plugin error - Unable to get file name for unknown file "${i}".`}));var i},this.setAssetSource=(e,t)=>{const i=this.filesByReferenceId.get(e);if(!i)return fe((s=e,{code:ge.ASSET_NOT_FOUND,message:`Plugin error - Unable to set the source for unknown asset "${s}".`}));var s,n;if("asset"!==i.type)return fe(Ie(`Asset sources can only be set for emitted assets but "${e}" is an emitted chunk.`));if(void 0!==i.source)return fe((n=i.name||e,{code:ge.ASSET_SOURCE_ALREADY_SET,message:`Unable to set the source for asset "${n}", source already set.`}));const r=Il(t,i,e);this.bundle?this.finalizeAsset(i,r,e,this.bundle):i.source=r},this.setOutputBundle=(e,t,i)=>{this.outputOptions=t,this.bundle=e,this.facadeChunkByModule=i;for(const{fileName:t}of this.filesByReferenceId.values())t&&Al(t,e,this.options.onwarn);for(const[t,i]of this.filesByReferenceId)"asset"===i.type&&void 0!==i.source&&this.finalizeAsset(i,i.source,t,e)},this.filesByReferenceId=i?new Map(i.filesByReferenceId):new Map}assignReferenceId(e,t){let i;do{i=Br().update(i||t).digest("hex").substring(0,8)}while(this.filesByReferenceId.has(i));return this.filesByReferenceId.set(i,e),i}emitAsset(e){const t=void 0!==e.source?Il(e.source,e,null):void 0,i={fileName:e.fileName,name:e.name,source:t,type:"asset"},s=this.assignReferenceId(i,e.fileName||e.name||e.type);return this.bundle&&(e.fileName&&Al(e.fileName,this.bundle,this.options.onwarn),void 0!==t&&this.finalizeAsset(i,t,s,this.bundle)),s}emitChunk(e){if(this.graph.phase>hn.LOAD_AND_PARSE)return fe({code:ge.INVALID_ROLLUP_PHASE,message:"Cannot emit chunks after module loading has finished."});if("string"!=typeof e.id)return fe(Ie(`Emitted chunks need to have a valid string id, received "${e.id}"`));const t={fileName:e.fileName,module:null,name:e.name||e.id,type:"chunk"};return this.graph.moduleLoader.emitChunk(e).then((e=>t.module=e)).catch((()=>{})),this.assignReferenceId(t,e.id)}finalizeAsset(e,t,i,s){const n=e.fileName||function(e,t){for(const[i,s]of Object.entries(e))if("asset"===s.type&&Cl(t,s.source))return i;return null}(s,t)||function(e,t,i,s){const n=i.sanitizeFileName(e||"asset");return ta(ea("function"==typeof i.assetFileNames?i.assetFileNames({name:e,source:t,type:"asset"}):i.assetFileNames,"output.assetFileNames",{ext:()=>T(n).substring(1),extname:()=>T(n),hash:()=>Br().update(n).update(":").update(t).digest("hex").substring(0,8),name:()=>n.substring(0,n.length-T(n).length)}),s)}(e.name,t,this.outputOptions,s),r={...e,fileName:n,source:t};this.filesByReferenceId.set(i,r);const{options:a}=this;s[n]={fileName:n,get isAsset(){return ke('Accessing "isAsset" on files in the bundle is deprecated, please use "type === \'asset\'" instead',!0,a),!0},name:e.name,source:t,type:"asset"}}}function Cl(e,t){if("string"==typeof e)return e===t;if("string"==typeof t)return!1;if("equals"in e)return e.equals(t);if(e.length!==t.length)return!1;for(let i=0;i(a||(a=!0,ke({message:`The "this.${t}" plugin context function used by plugin ${s} is deprecated. The "this.${i}" plugin context function should be used instead.`,plugin:s},n,r)),e(...o))}function _l(e,i,s,n,r,a){let o,l=!0;if("string"!=typeof e.cacheKey&&(e.name.startsWith(hl)||e.name.startsWith(cl)||a.has(e.name)?l=!1:a.add(e.name)),i)if(l){const t=e.cacheKey||e.name;c=i[t]||(i[t]=Object.create(null)),o={delete:e=>delete c[e],get(e){const t=c[e];if(t)return t[0]=0,t[1]},has(e){const t=c[e];return!!t&&(t[0]=0,!0)},set(e,t){c[e]=[0,t]}}}else h=e.name,o={delete:()=>fl(h),get:()=>fl(h),has:()=>fl(h),set:()=>fl(h)};else o=pl;var h,c;return{addWatchFile(e){if(s.phase>=hn.GENERATE)return this.error({code:ge.INVALID_ROLLUP_PHASE,message:"Cannot call addWatchFile after the build has finished."});s.watchFiles[e]=!0},cache:o,emitAsset:Nl(((e,t)=>r.emitFile({name:e,source:t,type:"asset"})),"emitAsset","emitFile",e.name,!0,n),emitChunk:Nl(((e,t)=>r.emitFile({id:e,name:t&&t.name,type:"chunk"})),"emitChunk","emitFile",e.name,!0,n),emitFile:r.emitFile.bind(r),error:t=>ul(t,e.name),getAssetFileName:Nl(r.getFileName,"getAssetFileName","getFileName",e.name,!0,n),getChunkFileName:Nl(r.getFileName,"getChunkFileName","getFileName",e.name,!0,n),getFileName:r.getFileName,getModuleIds:()=>s.modulesById.keys(),getModuleInfo:s.getModuleInfo,getWatchFiles:()=>Object.keys(s.watchFiles),isExternal:Nl(((e,t,i=!1)=>n.external(e,t,i)),"isExternal","resolve",e.name,!0,n),load:e=>s.moduleLoader.preloadModule(e),meta:{rollupVersion:t,watchMode:s.watchMode},get moduleIds(){const t=s.modulesById.keys();return function*(){ke({message:`Accessing "this.moduleIds" on the plugin context by plugin ${e.name} is deprecated. The "this.getModuleIds" plugin context function should be used instead.`,plugin:e.name},!1,n),yield*t}()},parse:s.contextParse.bind(s),resolve:(t,i,{custom:n,isEntry:r,skipSelf:a}=se)=>s.moduleLoader.resolveId(t,i,n,r,a?[{importer:i,plugin:e,source:t}]:null),resolveId:Nl(((e,t)=>s.moduleLoader.resolveId(e,t,se,void 0).then((e=>e&&e.id))),"resolveId","resolve",e.name,!0,n),setAssetSource:r.setAssetSource,warn(t){"string"==typeof t&&(t={message:t}),t.code&&(t.pluginCode=t.code),t.code="PLUGIN_WARNING",t.plugin=e.name,n.onwarn(t)}}}const $l=Object.keys({buildEnd:1,buildStart:1,closeBundle:1,closeWatcher:1,load:1,moduleParsed:1,options:1,resolveDynamicImport:1,resolveId:1,shouldTransformCachedModule:1,transform:1,watchChange:1});class Tl{constructor(e,t,i,s,n){this.graph=e,this.options=t,this.pluginCache=s,this.sortedPlugins=new Map,this.unfulfilledActions=new Set,function(e,t){for(const{active:i,deprecated:s,replacement:n}of dl)for(const r of e)s in r&&ke({message:`The "${s}" hook used by plugin ${r.name} is deprecated. The "${n}" hook should be used instead.`,plugin:r.name},i,t)}(i,t),this.fileEmitter=new wl(e,t,n&&n.fileEmitter),this.emitFile=this.fileEmitter.emitFile.bind(this.fileEmitter),this.getFileName=this.fileEmitter.getFileName.bind(this.fileEmitter),this.finaliseAssets=this.fileEmitter.assertAssetsFinalized.bind(this.fileEmitter),this.setOutputBundle=this.fileEmitter.setOutputBundle.bind(this.fileEmitter),this.plugins=i.concat(n?n.plugins:[]);const r=new Set;if(this.pluginContexts=new Map(this.plugins.map((i=>[i,_l(i,s,e,t,this.fileEmitter,r)]))),n)for(const e of i)for(const i of $l)i in e&&t.onwarn((a=e.name,o=i,{code:ge.INPUT_HOOK_IN_OUTPUT_PLUGIN,message:`The "${o}" hook used by the output plugin ${a} is a build time hook and will not be run for that plugin. Either this plugin cannot be used as an output plugin, or it should have an option to configure it as an output plugin.`}));var a,o}createOutputPluginDriver(e){return new Tl(this.graph,this.options,e,this.pluginCache,this)}getUnfulfilledHookActions(){return this.unfulfilledActions}hookFirst(e,t,i,s){let n=Promise.resolve(null);for(const r of this.getSortedPlugins(e))s&&s.has(r)||(n=n.then((s=>null!=s?s:this.runHook(e,t,r,i))));return n}hookFirstSync(e,t,i){for(const s of this.getSortedPlugins(e)){const n=this.runHookSync(e,t,s,i);if(null!=n)return n}return null}async hookParallel(e,t,i){const s=[];for(const n of this.getSortedPlugins(e))n[e].sequential?(await Promise.all(s),s.length=0,await this.runHook(e,t,n,i)):s.push(this.runHook(e,t,n,i));await Promise.all(s)}hookReduceArg0(e,[t,...i],s,n){let r=Promise.resolve(t);for(const t of this.getSortedPlugins(e))r=r.then((r=>this.runHook(e,[r,...i],t,n).then((e=>s.call(this.pluginContexts.get(t),r,e,t)))));return r}hookReduceArg0Sync(e,[t,...i],s,n){for(const r of this.getSortedPlugins(e)){const a=[t,...i],o=this.runHookSync(e,a,r,n);t=s.call(this.pluginContexts.get(r),t,o,r)}return t}async hookReduceValue(e,t,i,s){const n=[],r=[];for(const t of this.getSortedPlugins(e,Rl))t[e].sequential?(n.push(...await Promise.all(r)),r.length=0,n.push(await this.runHook(e,i,t))):r.push(this.runHook(e,i,t));return n.push(...await Promise.all(r)),n.reduce(s,await t)}hookReduceValueSync(e,t,i,s,n){let r=t;for(const t of this.getSortedPlugins(e)){const a=this.runHookSync(e,i,t,n);r=s.call(this.pluginContexts.get(t),r,a,t)}return r}hookSeq(e,t,i){let s=Promise.resolve();for(const n of this.getSortedPlugins(e))s=s.then((()=>this.runHook(e,t,n,i)));return s.then(Dl)}getSortedPlugins(e,t){return R(this.sortedPlugins,e,(()=>Ol(e,this.plugins,t)))}runHook(e,t,i,s){const n=i[e],r="object"==typeof n?n.handler:n;let a=this.pluginContexts.get(i);s&&(a=s(a,i));let o=null;return Promise.resolve().then((()=>{if("function"!=typeof r)return r;const s=r.apply(a,t);return(null==s?void 0:s.then)?(o=[i.name,e,t],this.unfulfilledActions.add(o),Promise.resolve(s).then((e=>(this.unfulfilledActions.delete(o),e)))):s})).catch((t=>(null!==o&&this.unfulfilledActions.delete(o),ul(t,i.name,{hook:e}))))}runHookSync(e,t,i,s){const n=i[e],r="object"==typeof n?n.handler:n;let a=this.pluginContexts.get(i);s&&(a=s(a,i));try{return r.apply(a,t)}catch(t){return ul(t,i.name,{hook:e})}}}function Ol(e,t,i=Ml){const s=[],n=[],r=[];for(const a of t){const t=a[e];if(t){if("object"==typeof t){if(i(t.handler,e,a),"pre"===t.order){s.push(a);continue}if("post"===t.order){r.push(a);continue}}else i(t,e,a);n.push(a)}}return[...s,...n,...r]}function Ml(e,t,i){"function"!=typeof e&&fe(function(e,t){return{code:ge.INVALID_PLUGIN_HOOK,hook:e,message:`Error running plugin hook ${e} for plugin ${t}, expected a function hook or an object with a "handler" function.`,plugin:t}}(t,i.name))}function Rl(e,t,i){if("string"!=typeof e&&"function"!=typeof e)return fe(function(e,t){return{code:ge.INVALID_PLUGIN_HOOK,hook:e,message:`Error running plugin hook ${e} for plugin ${t}, expected a string, a function hook or an object with a "handler" string or function.`,plugin:t}}(t,i.name))}function Dl(){}class Ll{constructor(e){this.maxParallel=e,this.queue=[],this.workerCount=0}run(e){return new Promise(((t,i)=>{this.queue.push({reject:i,resolve:t,task:e}),this.work()}))}async work(){if(this.workerCount>=this.maxParallel)return;let e;for(this.workerCount++;e=this.queue.shift();){const{reject:t,resolve:i,task:s}=e;try{i(await s())}catch(e){t(e)}}this.workerCount--}}class Vl{constructor(e,t){var i,s;if(this.options=e,this.cachedModules=new Map,this.deoptimizationTracker=new G,this.entryModules=[],this.modulesById=new Map,this.needsTreeshakingPass=!1,this.phase=hn.LOAD_AND_PARSE,this.scope=new Sl,this.watchFiles=Object.create(null),this.watchMode=!1,this.externalModules=[],this.implicitEntryModules=[],this.modules=[],this.getModuleInfo=e=>{const t=this.modulesById.get(e);return t?t.info:null},!1!==e.cache){if(null===(i=e.cache)||void 0===i?void 0:i.modules)for(const t of e.cache.modules)this.cachedModules.set(t.id,t);this.pluginCache=(null===(s=e.cache)||void 0===s?void 0:s.plugins)||Object.create(null);for(const e in this.pluginCache){const t=this.pluginCache[e];for(const e of Object.values(t))e[0]++}}if(t){this.watchMode=!0;const e=(...e)=>this.pluginDriver.hookParallel("watchChange",e),i=()=>this.pluginDriver.hookParallel("closeWatcher",[]);t.onCurrentAwaited("change",e),t.onCurrentAwaited("close",i)}this.pluginDriver=new Tl(this,e,e.plugins,this.pluginCache),this.acornParser=ro.extend(...e.acornInjectPlugins),this.moduleLoader=new yl(this,this.modulesById,this.options,this.pluginDriver),this.fileOperationQueue=new Ll(e.maxParallelFileOps)}async build(){En("generate module graph",2),await this.generateModuleGraph(),bn("generate module graph",2),En("sort modules",2),this.phase=hn.ANALYSE,this.sortModules(),bn("sort modules",2),En("mark included statements",2),this.includeStatements(),bn("mark included statements",2),this.phase=hn.GENERATE}contextParse(e,t={}){const i=t.onComment,s=[];t.onComment=i&&"function"==typeof i?(e,n,r,a,...o)=>(s.push({end:a,start:r,type:e?"Block":"Line",value:n}),i.call(t,e,n,r,a,...o)):s;const n=this.acornParser.parse(e,{...this.options.acorn,...t});return"object"==typeof i&&i.push(...s),t.onComment=i,function(e,t,i){const s=[],n=[];for(const t of e)yt.test(t.value)?s.push(t):ht.test(t.value)&&n.push(t);for(const e of n)xt(t,e,!1);dt(t,{annotationIndex:0,annotations:s,code:i})}(s,n,e),n}getCache(){for(const e in this.pluginCache){const t=this.pluginCache[e];let i=!0;for(const[e,s]of Object.entries(t))s[0]>=this.options.experimentalCacheExpiry?delete t[e]:i=!1;i&&delete this.pluginCache[e]}return{modules:this.modules.map((e=>e.toJSON())),plugins:this.pluginCache}}async generateModuleGraph(){var e;if(({entryModules:this.entryModules,implicitEntryModules:this.implicitEntryModules}=await this.moduleLoader.addEntryModules((e=this.options.input,Array.isArray(e)?e.map((e=>({fileName:null,id:e,implicitlyLoadedAfter:[],importer:void 0,name:null}))):Object.entries(e).map((([e,t])=>({fileName:null,id:t,implicitlyLoadedAfter:[],importer:void 0,name:e})))),!0)),0===this.entryModules.length)throw new Error("You must supply options.input to rollup");for(const e of this.modulesById.values())e instanceof kn?this.modules.push(e):this.externalModules.push(e)}includeStatements(){for(const e of[...this.entryModules,...this.implicitEntryModules])An(e);if(this.options.treeshake){let e=1;do{En(`treeshaking pass ${e}`,3),this.needsTreeshakingPass=!1;for(const e of this.modules)e.isExecuted&&("no-treeshake"===e.info.moduleSideEffects?e.includeAllInBundle():e.include());if(1===e)for(const e of[...this.entryModules,...this.implicitEntryModules])!1!==e.preserveSignature&&(e.includeAllExports(!1),this.needsTreeshakingPass=!0);bn("treeshaking pass "+e++,3)}while(this.needsTreeshakingPass)}else for(const e of this.modules)e.includeAllInBundle();for(const e of this.externalModules)e.warnUnusedImports();for(const e of this.implicitEntryModules)for(const t of e.implicitlyLoadedAfter)t.info.isEntry||t.isIncluded()||fe(ve(t))}sortModules(){const{orderedModules:e,cyclePaths:t}=function(e){let t=0;const i=[],s=new Set,n=new Set,r=new Map,a=[],o=e=>{if(e instanceof kn){for(const t of e.dependencies)r.has(t)?s.has(t)||i.push(da(t,e,r)):(r.set(t,e),o(t));for(const t of e.implicitlyLoadedBefore)n.add(t);for(const{resolution:t}of e.dynamicImports)t instanceof kn&&n.add(t);a.push(e)}e.execIndex=t++,s.add(e)};for(const t of e)r.has(t)||(r.set(t,null),o(t));for(const e of n)r.has(e)||(r.set(e,null),o(e));return{cyclePaths:i,orderedModules:a}}(this.entryModules);for(const e of t)this.options.onwarn({code:"CIRCULAR_DEPENDENCY",cycle:e,importer:e[0],message:`Circular dependency: ${e.join(" -> ")}`});this.modules=e;for(const e of this.modules)e.bindReferences();this.warnForMissingExports()}warnForMissingExports(){for(const e of this.modules)for(const t of e.importDescriptions.values())"*"===t.name||t.module.getVariableForExportName(t.name)[0]||e.warn({code:"NON_EXISTENT_EXPORT",message:`Non-existent export '${t.name}' is imported from ${ce(t.module.id)}`,name:t.name,source:t.module.id},t.start)}}function Bl(e){return Array.isArray(e)?e.filter(Boolean):e?[e]:[]}function Fl(e,t){return t()}const zl=e=>console.warn(e.message||e);function jl(e,t,i,s,n=/$./){const r=new Set(t),a=Object.keys(e).filter((e=>!(r.has(e)||n.test(e))));a.length>0&&s({code:"UNKNOWN_OPTION",message:`Unknown ${i}: ${a.join(", ")}. Allowed options: ${[...r].sort().join(", ")}`})}const Ul={recommended:{annotations:!0,correctVarValueBeforeDeclaration:!1,moduleSideEffects:()=>!0,propertyReadSideEffects:!0,tryCatchDeoptimization:!0,unknownGlobalSideEffects:!1},safest:{annotations:!0,correctVarValueBeforeDeclaration:!0,moduleSideEffects:()=>!0,propertyReadSideEffects:!0,tryCatchDeoptimization:!0,unknownGlobalSideEffects:!0},smallest:{annotations:!0,correctVarValueBeforeDeclaration:!1,moduleSideEffects:()=>!1,propertyReadSideEffects:!1,tryCatchDeoptimization:!1,unknownGlobalSideEffects:!1}},Gl={es2015:{arrowFunctions:!0,constBindings:!0,objectShorthand:!0,reservedNamesAsProps:!0,symbols:!0},es5:{arrowFunctions:!1,constBindings:!1,objectShorthand:!1,reservedNamesAsProps:!0,symbols:!1}},Hl=(e,t,i,s)=>{const n=null==e?void 0:e.preset;if(n){const s=t[n];if(s)return{...s,...e};fe(Ee(`${i}.preset`,Wl(i),`valid values are ${le(Object.keys(t))}`,n))}return((e,t,i)=>s=>{if("string"==typeof s){const n=e[s];if(n)return n;fe(Ee(t,Wl(t),`valid values are ${i}${le(Object.keys(e))}. You can also supply an object for more fine-grained control`,s))}return(e=>e&&"object"==typeof e?e:{})(s)})(t,i,s)(e)},Wl=e=>e.split(".").join("").toLowerCase(),ql=e=>{const{onwarn:t}=e;return t?e=>{e.toString=()=>{let t="";return e.plugin&&(t+=`(${e.plugin} plugin) `),e.loc&&(t+=`${ce(e.loc.file)} (${e.loc.line}:${e.loc.column}) `),t+=e.message,t},t(e,zl)}:zl},Kl=e=>({allowAwaitOutsideFunction:!0,ecmaVersion:"latest",preserveParens:!1,sourceType:"module",...e.acorn}),Xl=e=>Bl(e.acornInjectPlugins),Yl=e=>{var t;return(null===(t=e.cache)||void 0===t?void 0:t.cache)||e.cache},Ql=e=>{if(!0===e)return()=>!0;if("function"==typeof e)return(t,...i)=>!t.startsWith("\0")&&e(t,...i)||!1;if(e){const t=new Set,i=[];for(const s of Bl(e))s instanceof RegExp?i.push(s):t.add(s);return(e,...s)=>t.has(e)||i.some((t=>t.test(e)))}return()=>!1},Jl=(e,t,i)=>{const s=e.inlineDynamicImports;return s&&we('The "inlineDynamicImports" option is deprecated. Use the "output.inlineDynamicImports" option instead.',!1,t,i),s},Zl=e=>{const t=e.input;return null==t?[]:"string"==typeof t?[t]:t},eh=(e,t,i)=>{const s=e.manualChunks;return s&&we('The "manualChunks" option is deprecated. Use the "output.manualChunks" option instead.',!1,t,i),s},th=(e,t,i)=>{var s;const n=e.maxParallelFileReads;"number"==typeof n&&we('The "maxParallelFileReads" option is deprecated. Use the "maxParallelFileOps" option instead.',!1,t,i);const r=null!==(s=e.maxParallelFileOps)&&void 0!==s?s:n;return"number"==typeof r?r<=0?1/0:r:20},ih=(e,t)=>{const i=e.moduleContext;if("function"==typeof i)return e=>{var s;return null!==(s=i(e))&&void 0!==s?s:t};if(i){const e=Object.create(null);for(const[t,s]of Object.entries(i))e[M(t)]=s;return i=>e[i]||t}return()=>t},sh=(e,t)=>{const i=e.preserveEntrySignatures;return null==i&&t.add("preserveEntrySignatures"),null!=i?i:"strict"},nh=(e,t,i)=>{const s=e.preserveModules;return s&&we('The "preserveModules" option is deprecated. Use the "output.preserveModules" option instead.',!1,t,i),s},rh=(e,t,i)=>{const s=e.treeshake;if(!1===s)return!1;const n=Hl(e.treeshake,Ul,"treeshake","false, true, ");return void 0!==n.pureExternalModules&&we('The "treeshake.pureExternalModules" option is deprecated. The "treeshake.moduleSideEffects" option should be used instead. "treeshake.pureExternalModules: true" is equivalent to "treeshake.moduleSideEffects: \'no-external\'"',!0,t,i),{annotations:!1!==n.annotations,correctVarValueBeforeDeclaration:!0===n.correctVarValueBeforeDeclaration,moduleSideEffects:"object"==typeof s&&s.pureExternalModules?ah(s.moduleSideEffects,s.pureExternalModules):ah(n.moduleSideEffects,void 0),propertyReadSideEffects:"always"===n.propertyReadSideEffects?"always":!1!==n.propertyReadSideEffects,tryCatchDeoptimization:!1!==n.tryCatchDeoptimization,unknownGlobalSideEffects:!1!==n.unknownGlobalSideEffects}},ah=(e,t)=>{if("boolean"==typeof e)return()=>e;if("no-external"===e)return(e,t)=>!t;if("function"==typeof e)return(t,i)=>!!t.startsWith("\0")||!1!==e(t,i);if(Array.isArray(e)){const t=new Set(e);return e=>t.has(e)}e&&fe(Ee("treeshake.moduleSideEffects","treeshake",'please use one of false, "no-external", a function or an array'));const i=Ql(t);return(e,t)=>!(t&&i(e))},oh=/[\x00-\x1F\x7F<>*#"{}|^[\]`;?:&=+$,]/g,lh=/^[a-z]:/i;function hh(e){const t=lh.exec(e),i=t?t[0]:"";return i+e.substr(i.length).replace(oh,"_")}const ch=(e,t,i)=>{const{file:s}=e;if("string"==typeof s){if(t)return fe(Ee("output.file","outputdir",'you must set "output.dir" instead of "output.file" when using the "output.preserveModules" option'));if(!Array.isArray(i.input))return fe(Ee("output.file","outputdir",'you must set "output.dir" instead of "output.file" when providing named inputs'))}return s},uh=e=>{const t=e.format;switch(t){case void 0:case"es":case"esm":case"module":return"es";case"cjs":case"commonjs":return"cjs";case"system":case"systemjs":return"system";case"amd":case"iife":case"umd":return t;default:return fe({message:'You must specify "output.format", which can be one of "amd", "cjs", "system", "es", "iife" or "umd".',url:"https://rollupjs.org/guide/en/#outputformat"})}},dh=(e,t)=>{var i;const s=(null!==(i=e.inlineDynamicImports)&&void 0!==i?i:t.inlineDynamicImports)||!1,{input:n}=t;return s&&(Array.isArray(n)?n:Object.keys(n)).length>1?fe(Ee("output.inlineDynamicImports","outputinlinedynamicimports",'multiple inputs are not supported when "output.inlineDynamicImports" is true')):s},ph=(e,t,i)=>{var s;const n=(null!==(s=e.preserveModules)&&void 0!==s?s:i.preserveModules)||!1;if(n){if(t)return fe(Ee("output.inlineDynamicImports","outputinlinedynamicimports",'this option is not supported for "output.preserveModules"'));if(!1===i.preserveEntrySignatures)return fe(Ee("preserveEntrySignatures","preserveentrysignatures",'setting this option to false is not supported for "output.preserveModules"'))}return n},fh=(e,t)=>{const i=e.preferConst;return null!=i&&ke('The "output.preferConst" option is deprecated. Use the "output.generatedCode.constBindings" option instead.',!1,t),!!i},mh=e=>{const{preserveModulesRoot:t}=e;if(null!=t)return M(t)},gh=e=>{const t={autoId:!1,basePath:"",define:"define",forceJsExtensionForImports:!1,...e.amd};if((t.autoId||t.basePath)&&t.id)return fe(Ee("output.amd.id","outputamd",'this option cannot be used together with "output.amd.autoId"/"output.amd.basePath"'));if(t.basePath&&!t.autoId)return fe(Ee("output.amd.basePath","outputamd",'this option only works with "output.amd.autoId"'));let i;return i=t.autoId?{autoId:!0,basePath:t.basePath,define:t.define,forceJsExtensionForImports:t.forceJsExtensionForImports}:{autoId:!1,define:t.define,forceJsExtensionForImports:t.forceJsExtensionForImports,id:t.id},i},yh=(e,t)=>{const i=e[t];return"function"==typeof i?i:()=>i||""},xh=(e,t)=>{const{dir:i}=e;return"string"==typeof i&&"string"==typeof t?fe(Ee("output.dir","outputdir",'you must set either "output.file" for a single-file build or "output.dir" when generating multiple chunks')):i},Eh=(e,t)=>{const i=e.dynamicImportFunction;return i&&ke('The "output.dynamicImportFunction" option is deprecated. Use the "renderDynamicImport" plugin hook instead.',!1,t),i},bh=(e,t)=>{const i=e.entryFileNames;return null==i&&t.add("entryFileNames"),null!=i?i:"[name].js"};function vh(e,t){const i=e.exports;if(null==i)t.add("exports");else if(!["default","named","none","auto"].includes(i))return fe((s=i,{code:ge.INVALID_EXPORT_OPTION,message:`"output.exports" must be "default", "named", "none", "auto", or left unspecified (defaults to "auto"), received "${s}"`,url:"https://rollupjs.org/guide/en/#outputexports"}));var s;return i||"auto"}const Sh=(e,t)=>{const i=Hl(e.generatedCode,Gl,"output.generatedCode","");return{arrowFunctions:!0===i.arrowFunctions,constBindings:!0===i.constBindings||t,objectShorthand:!0===i.objectShorthand,reservedNamesAsProps:!0===i.reservedNamesAsProps,symbols:!0===i.symbols}},Ah=(e,t)=>{if(t)return"";const i=e.indent;return!1===i?"":null==i||i},Ih=new Set(["auto","esModule","default","defaultOnly",!0,!1]),Ph=(e,t)=>{const i=e.interop,s=new Set,n=e=>{if(!s.has(e)){if(s.add(e),!Ih.has(e))return fe(Ee("output.interop","outputinterop",`use one of ${Array.from(Ih,(e=>JSON.stringify(e))).join(", ")}`,e));"boolean"==typeof e&&ke({message:`The boolean value "${e}" for the "output.interop" option is deprecated. Use ${e?'"auto"':'"esModule", "default" or "defaultOnly"'} instead.`,url:"https://rollupjs.org/guide/en/#outputinterop"},!1,t)}return e};if("function"==typeof i){const e=Object.create(null);let t=null;return s=>null===s?t||n(t=i(s)):s in e?e[s]:n(e[s]=i(s))}return void 0===i?()=>!0:()=>n(i)},kh=(e,t,i,s)=>{const n=e.manualChunks||s.manualChunks;if(n){if(t)return fe(Ee("output.manualChunks","outputmanualchunks",'this option is not supported for "output.inlineDynamicImports"'));if(i)return fe(Ee("output.manualChunks","outputmanualchunks",'this option is not supported for "output.preserveModules"'))}return n||{}},wh=(e,t,i)=>{var s;return null!==(s=e.minifyInternalExports)&&void 0!==s?s:i||"es"===t||"system"===t},Ch=(e,t,i)=>{const s=e.namespaceToStringTag;return null!=s?(ke('The "output.namespaceToStringTag" option is deprecated. Use the "output.generatedCode.symbols" option instead.',!1,i),s):t.symbols||!1},Nh=e=>{const{sourcemapBaseUrl:t}=e;if(t)return function(e){try{new URL(e)}catch(e){return!1}return!0}(t)?t:fe(Ee("output.sourcemapBaseUrl","outputsourcemapbaseurl",`must be a valid URL, received ${JSON.stringify(t)}`))};function _h(e,t){e.forEach(((e,i)=>{e.name||(e.name=`${t}${i+1}`)}))}function $h(e,t,i,s,n){const{options:r,outputPluginDriver:a,unsetOptions:o}=function(e,t,i,s){if(!e)throw new Error("You must supply an options object");const n=Bl(e.plugins);_h(n,cl);const r=t.createOutputPluginDriver(n);return{...Th(i,s,e,r),outputPluginDriver:r}}(s,n.pluginDriver,t,i);return Fl(0,(async()=>{const i=new ma(r,o,t,a,n),s=await i.generate(e);if(e){if(!r.dir&&!r.file)return fe({code:"MISSING_OPTION",message:'You must specify "output.file" or "output.dir" for the build.'});await Promise.all(Object.values(s).map((e=>n.fileOperationQueue.run((()=>async function(e,t){const i=M(t.dir||$(t.file),e.fileName);let s,n;if(await ol.mkdir($(i),{recursive:!0}),"asset"===e.type)n=e.source;else if(n=e.code,t.sourcemap&&e.map){let r;if("inline"===t.sourcemap)r=e.map.toUrl();else{const{sourcemapBaseUrl:n}=t,a=`${_(e.fileName)}.map`;r=n?new URL(a,n).toString():a,s=ol.writeFile(`${i}.map`,e.map.toString())}"hidden"!==t.sourcemap&&(n+=`//# sourceMappingURL=${r}\n`)}return Promise.all([ol.writeFile(i,n),s])}(e,r)))))),await a.hookParallel("writeBundle",[r,s])}return l=s,{output:Object.values(l).filter((e=>Object.keys(e).length>0)).sort(((e,t)=>Mh(e)-Mh(t)))};var l}))}function Th(e,t,i,s){return function(e,t,i){var s,n,r,a,o,l,h;const c=new Set(i),u=e.compact||!1,d=uh(e),p=dh(e,t),f=ph(e,p,t),m=ch(e,f,t),g=fh(e,t),y=Sh(e,g),x={amd:gh(e),assetFileNames:null!==(s=e.assetFileNames)&&void 0!==s?s:"assets/[name]-[hash][extname]",banner:yh(e,"banner"),chunkFileNames:null!==(n=e.chunkFileNames)&&void 0!==n?n:"[name]-[hash].js",compact:u,dir:xh(e,m),dynamicImportFunction:Eh(e,t),entryFileNames:bh(e,c),esModule:null===(r=e.esModule)||void 0===r||r,exports:vh(e,c),extend:e.extend||!1,externalLiveBindings:null===(a=e.externalLiveBindings)||void 0===a||a,file:m,footer:yh(e,"footer"),format:d,freeze:null===(o=e.freeze)||void 0===o||o,generatedCode:y,globals:e.globals||{},hoistTransitiveImports:null===(l=e.hoistTransitiveImports)||void 0===l||l,indent:Ah(e,u),inlineDynamicImports:p,interop:Ph(e,t),intro:yh(e,"intro"),manualChunks:kh(e,p,f,t),minifyInternalExports:wh(e,d,u),name:e.name,namespaceToStringTag:Ch(e,y,t),noConflict:e.noConflict||!1,outro:yh(e,"outro"),paths:e.paths||{},plugins:Bl(e.plugins),preferConst:g,preserveModules:f,preserveModulesRoot:mh(e),sanitizeFileName:"function"==typeof e.sanitizeFileName?e.sanitizeFileName:!1===e.sanitizeFileName?e=>e:hh,sourcemap:e.sourcemap||!1,sourcemapBaseUrl:Nh(e),sourcemapExcludeSources:e.sourcemapExcludeSources||!1,sourcemapFile:e.sourcemapFile,sourcemapPathTransform:e.sourcemapPathTransform,strict:null===(h=e.strict)||void 0===h||h,systemNullSetters:e.systemNullSetters||!1,validate:e.validate||!1};return jl(e,Object.keys(x),"output options",t.onwarn),{options:x,unsetOptions:c}}(s.hookReduceArg0Sync("outputOptions",[i.output||i],((e,t)=>t||e),(e=>{const t=()=>e.error({code:ge.CANNOT_EMIT_FROM_OPTIONS_HOOK,message:'Cannot emit files or set asset sources in the "outputOptions" hook, use the "renderStart" hook instead.'});return{...e,emitFile:t,setAssetSource:t}})),e,t)}var Oh;function Mh(e){return"asset"===e.type?Oh.ASSET:e.isEntry?Oh.ENTRY_CHUNK:Oh.SECONDARY_CHUNK}!function(e){e[e.ENTRY_CHUNK=0]="ENTRY_CHUNK",e[e.SECONDARY_CHUNK=1]="SECONDARY_CHUNK",e[e.ASSET=2]="ASSET"}(Oh||(Oh={})),e.VERSION=t,e.defineConfig=function(e){return e},e.rollup=function(e){return async function(e,i){const{options:s,unsetOptions:n}=await async function(e,i){if(!e)throw new Error("You must supply an options object to rollup");const s=Ol("options",Bl(e.plugins)),{options:n,unsetOptions:r}=function(e){var t,i,s;const n=new Set,r=null!==(t=e.context)&&void 0!==t?t:"undefined",a=ql(e),o=e.strictDeprecations||!1,l=th(e,a,o),h={acorn:Kl(e),acornInjectPlugins:Xl(e),cache:Yl(e),context:r,experimentalCacheExpiry:null!==(i=e.experimentalCacheExpiry)&&void 0!==i?i:10,external:Ql(e.external),inlineDynamicImports:Jl(e,a,o),input:Zl(e),makeAbsoluteExternalsRelative:null===(s=e.makeAbsoluteExternalsRelative)||void 0===s||s,manualChunks:eh(e,a,o),maxParallelFileOps:l,maxParallelFileReads:l,moduleContext:ih(e,r),onwarn:a,perf:e.perf||!1,plugins:Bl(e.plugins),preserveEntrySignatures:sh(e,n),preserveModules:nh(e,a,o),preserveSymlinks:e.preserveSymlinks||!1,shimMissingExports:e.shimMissingExports||!1,strictDeprecations:o,treeshake:rh(e,a,o)};return jl(e,[...Object.keys(h),"watch"],"input options",h.onwarn,/^(output)$/),{options:h,unsetOptions:n}}(await s.reduce(function(e){return async(i,s)=>{const n="handler"in s.options?s.options.handler:s.options;return await n.call({meta:{rollupVersion:t,watchMode:e}},await i)||i}}(i),Promise.resolve(e)));return _h(n.plugins,hl),{options:n,unsetOptions:r}}(e,null!==i);!function(e){e.perf?(fn=new Map,En=gn,bn=yn,e.plugins=e.plugins.map(Sn)):(En=pn,bn=pn)}(s);const r=new Vl(s,i),a=!1!==e.cache;delete s.cache,delete e.cache,En("BUILD",1),await Fl(r.pluginDriver,(async()=>{try{await r.pluginDriver.hookParallel("buildStart",[s]),await r.build()}catch(e){const t=Object.keys(r.watchFiles);throw t.length>0&&(e.watchFiles=t),await r.pluginDriver.hookParallel("buildEnd",[e]),await r.pluginDriver.hookParallel("closeBundle",[]),e}await r.pluginDriver.hookParallel("buildEnd",[])})),bn("BUILD",1);const o={cache:a?r.getCache():void 0,async close(){o.closed||(o.closed=!0,await r.pluginDriver.hookParallel("closeBundle",[]))},closed:!1,generate:async e=>o.closed?fe(Pe()):$h(!1,s,n,e,r),watchFiles:Object.keys(r.watchFiles),write:async e=>o.closed?fe(Pe()):$h(!0,s,n,e,r)};return s.perf&&(o.getTimings=xn),o}(e,null)},Object.defineProperty(e,"__esModule",{value:!0})},"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).rollup={}); +//# sourceMappingURL=rollup.browser.js.map diff --git a/node_modules/rollup/dist/rollup.browser.js.map b/node_modules/rollup/dist/rollup.browser.js.map new file mode 100644 index 000000000000..108a36cf6f73 --- /dev/null +++ b/node_modules/rollup/dist/rollup.browser.js.map @@ -0,0 +1 @@ +{"version":3,"file":"rollup.browser.js","sources":["../node_modules/sourcemap-codec/dist/sourcemap-codec.es.js","../node_modules/magic-string/dist/magic-string.es.mjs","../browser/path.ts","../src/utils/getOrCreate.ts","../src/ast/utils/PathTracker.ts","../src/ast/nodes/shared/Expression.ts","../src/ast/NodeInteractions.ts","../src/ast/variables/Variable.ts","../src/ast/variables/ExternalVariable.ts","../src/utils/blank.ts","../node_modules/locate-character/dist/locate-character.es.js","../src/utils/getCodeFrame.ts","../src/utils/printStringList.ts","../src/utils/relativeId.ts","../src/utils/error.ts","../src/utils/RESERVED_NAMES.ts","../src/utils/identifierHelpers.ts","../src/ExternalModule.ts","../node_modules/@rollup/pluginutils/dist/es/index.js","../src/ast/ExecutionContext.ts","../src/ast/values.ts","../node_modules/acorn-walk/dist/walk.mjs","../src/ast/nodes/NodeType.ts","../src/utils/sourceMappingURL.ts","../src/utils/pureComments.ts","../src/ast/keys.ts","../src/ast/nodes/shared/Node.ts","../src/ast/nodes/SpreadElement.ts","../src/ast/nodes/shared/MethodTypes.ts","../src/ast/nodes/shared/ObjectEntity.ts","../src/ast/nodes/shared/ObjectPrototype.ts","../src/ast/nodes/shared/ArrayPrototype.ts","../src/ast/variables/LocalVariable.ts","../src/utils/base64.ts","../src/utils/safeName.ts","../src/ast/scopes/Scope.ts","../src/ast/scopes/ChildScope.ts","../src/ast/scopes/ParameterScope.ts","../src/ast/scopes/ReturnValueScope.ts","../node_modules/is-reference/src/index.js","../src/ast/nodes/shared/knownGlobals.ts","../src/ast/variables/GlobalVariable.ts","../src/ast/nodes/Identifier.ts","../src/utils/treeshakeNode.ts","../src/utils/renderHelpers.ts","../src/ast/scopes/BlockScope.ts","../src/ast/nodes/ExpressionStatement.ts","../src/ast/nodes/BlockStatement.ts","../src/ast/nodes/RestElement.ts","../src/ast/nodes/shared/FunctionBase.ts","../src/ast/nodes/ArrowFunctionExpression.ts","../src/utils/systemJsRendering.ts","../src/ast/nodes/ObjectPattern.ts","../src/ast/variables/ArgumentsVariable.ts","../src/ast/variables/ThisVariable.ts","../src/ast/scopes/FunctionScope.ts","../src/ast/nodes/shared/FunctionNode.ts","../src/ast/nodes/BinaryExpression.ts","../src/utils/renderCallArguments.ts","../src/ast/nodes/Literal.ts","../src/ast/nodes/MemberExpression.ts","../src/ast/nodes/shared/CallExpressionBase.ts","../src/ast/scopes/CatchScope.ts","../src/ast/scopes/ClassBodyScope.ts","../src/ast/nodes/shared/MethodBase.ts","../src/ast/nodes/MethodDefinition.ts","../src/ast/nodes/shared/ObjectMember.ts","../src/ast/nodes/shared/ClassNode.ts","../src/ast/nodes/ClassDeclaration.ts","../src/ast/nodes/shared/MultiExpression.ts","../src/ast/nodes/ExportAllDeclaration.ts","../src/ast/nodes/FunctionDeclaration.ts","../src/ast/nodes/ExportDefaultDeclaration.ts","../src/ast/nodes/ExportNamedDeclaration.ts","../src/ast/scopes/TrackingScope.ts","../src/ast/nodes/IfStatement.ts","../src/ast/nodes/ImportDeclaration.ts","../src/utils/interopHelpers.ts","../src/ast/nodes/ImportExpression.ts","../src/ast/nodes/MetaProperty.ts","../src/ast/nodes/Program.ts","../src/ast/nodes/SwitchCase.ts","../src/ast/nodes/TemplateLiteral.ts","../src/ast/variables/UndefinedVariable.ts","../src/ast/variables/ExportDefaultVariable.ts","../src/ast/scopes/ModuleScope.ts","../src/ast/nodes/UnaryExpression.ts","../src/utils/reassignedExportsMember.ts","../src/ast/nodes/VariableDeclaration.ts","../src/ast/nodes/index.ts","../src/ast/nodes/ArrayExpression.ts","../src/ast/nodes/ArrayPattern.ts","../src/ast/nodes/AssignmentExpression.ts","../src/ast/nodes/AssignmentPattern.ts","../src/ast/nodes/AwaitExpression.ts","../src/ast/nodes/BreakStatement.ts","../src/ast/nodes/CallExpression.ts","../src/ast/nodes/CatchClause.ts","../src/ast/nodes/ChainExpression.ts","../src/ast/nodes/ClassBody.ts","../src/ast/nodes/ClassExpression.ts","../src/ast/nodes/ConditionalExpression.ts","../src/ast/nodes/ContinueStatement.ts","../src/ast/nodes/DoWhileStatement.ts","../src/ast/nodes/EmptyStatement.ts","../src/ast/nodes/ExportSpecifier.ts","../src/ast/nodes/ForInStatement.ts","../src/ast/nodes/ForOfStatement.ts","../src/ast/nodes/ForStatement.ts","../src/ast/nodes/FunctionExpression.ts","../src/ast/nodes/ImportDefaultSpecifier.ts","../src/ast/nodes/ImportNamespaceSpecifier.ts","../src/ast/nodes/ImportSpecifier.ts","../src/ast/nodes/LabeledStatement.ts","../src/ast/nodes/LogicalExpression.ts","../src/ast/nodes/NewExpression.ts","../src/ast/nodes/ObjectExpression.ts","../src/ast/nodes/PrivateIdentifier.ts","../src/ast/nodes/Property.ts","../src/ast/nodes/PropertyDefinition.ts","../src/ast/nodes/ReturnStatement.ts","../src/ast/nodes/SequenceExpression.ts","../src/ast/nodes/StaticBlock.ts","../src/ast/nodes/Super.ts","../src/ast/nodes/SwitchStatement.ts","../src/ast/nodes/TaggedTemplateExpression.ts","../src/ast/nodes/TemplateElement.ts","../src/ast/nodes/ThisExpression.ts","../src/ast/nodes/ThrowStatement.ts","../src/ast/nodes/TryStatement.ts","../src/ast/nodes/UnknownNode.ts","../src/ast/nodes/UpdateExpression.ts","../src/ast/nodes/VariableDeclarator.ts","../src/ast/nodes/WhileStatement.ts","../src/ast/nodes/YieldExpression.ts","../src/utils/variableNames.ts","../src/ast/variables/ExportShimVariable.ts","../src/ast/variables/NamespaceVariable.ts","../src/ast/variables/SyntheticNamedExportVariable.ts","../src/utils/buildPhase.ts","../src/utils/getId.ts","../browser/performance.ts","../browser/process.ts","../src/utils/timers.ts","../src/utils/traverseStaticDependencies.ts","../src/Module.ts","../src/utils/getOriginalLocation.ts","../src/finalisers/shared/removeJsExtension.ts","../src/finalisers/shared/getCompleteAmdId.ts","../src/finalisers/shared/getExportBlock.ts","../src/finalisers/shared/getInteropBlock.ts","../src/finalisers/shared/updateExtensionForRelativeAmdId.ts","../src/finalisers/shared/addJsExtension.ts","../src/finalisers/shared/warnOnBuiltins.ts","../src/finalisers/shared/sanitize.ts","../src/finalisers/shared/setupNamespace.ts","../src/finalisers/shared/trimEmptyImports.ts","../src/finalisers/system.ts","../src/finalisers/umd.ts","../src/finalisers/index.ts","../src/finalisers/amd.ts","../src/finalisers/cjs.ts","../src/finalisers/es.ts","../src/finalisers/iife.ts","../src/utils/collapseSourcemaps.ts","../node_modules/minimalistic-assert/index.js","../node_modules/inherits/inherits_browser.js","../node_modules/hash.js/lib/hash/utils.js","../node_modules/hash.js/lib/hash/common.js","../node_modules/hash.js/lib/hash/sha/common.js","../node_modules/hash.js/lib/hash/sha/256.js","../browser/crypto.ts","../src/utils/deconflictChunk.ts","../src/utils/escapeId.ts","../src/utils/getExportMode.ts","../src/utils/getIndentString.ts","../src/utils/getStaticDependencies.ts","../src/utils/decodedSourcemap.ts","../src/utils/outputBundle.ts","../src/utils/renderNamePattern.ts","../src/Chunk.ts","../src/utils/exportNames.ts","../src/utils/renderChunk.ts","../src/utils/addons.ts","../src/utils/chunkAssignment.ts","../src/utils/executionOrder.ts","../src/utils/generateCodeSnippets.ts","../src/Bundle.ts","../src/utils/commondir.ts","../node_modules/acorn/dist/acorn.mjs","../browser/error.ts","../browser/fs.ts","../browser/resolveId.ts","../src/utils/resolveIdViaPlugins.ts","../src/utils/pluginUtils.ts","../src/utils/PluginCache.ts","../src/utils/transform.ts","../src/ModuleLoader.ts","../src/ast/scopes/GlobalScope.ts","../src/utils/FileEmitter.ts","../src/utils/PluginContext.ts","../src/utils/PluginDriver.ts","../src/utils/Queue.ts","../src/Graph.ts","../src/utils/ensureArray.ts","../browser/hookActions.ts","../src/utils/options/options.ts","../src/utils/options/normalizeInputOptions.ts","../src/utils/sanitizeFileName.ts","../src/utils/options/normalizeOutputOptions.ts","../src/utils/url.ts","../src/rollup/rollup.ts"],"sourcesContent":["var charToInteger = {};\nvar chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\nfor (var i = 0; i < chars.length; i++) {\n charToInteger[chars.charCodeAt(i)] = i;\n}\nfunction decode(mappings) {\n var decoded = [];\n var line = [];\n var segment = [\n 0,\n 0,\n 0,\n 0,\n 0,\n ];\n var j = 0;\n for (var i = 0, shift = 0, value = 0; i < mappings.length; i++) {\n var c = mappings.charCodeAt(i);\n if (c === 44) { // \",\"\n segmentify(line, segment, j);\n j = 0;\n }\n else if (c === 59) { // \";\"\n segmentify(line, segment, j);\n j = 0;\n decoded.push(line);\n line = [];\n segment[0] = 0;\n }\n else {\n var integer = charToInteger[c];\n if (integer === undefined) {\n throw new Error('Invalid character (' + String.fromCharCode(c) + ')');\n }\n var hasContinuationBit = integer & 32;\n integer &= 31;\n value += integer << shift;\n if (hasContinuationBit) {\n shift += 5;\n }\n else {\n var shouldNegate = value & 1;\n value >>>= 1;\n if (shouldNegate) {\n value = value === 0 ? -0x80000000 : -value;\n }\n segment[j] += value;\n j++;\n value = shift = 0; // reset\n }\n }\n }\n segmentify(line, segment, j);\n decoded.push(line);\n return decoded;\n}\nfunction segmentify(line, segment, j) {\n // This looks ugly, but we're creating specialized arrays with a specific\n // length. This is much faster than creating a new array (which v8 expands to\n // a capacity of 17 after pushing the first item), or slicing out a subarray\n // (which is slow). Length 4 is assumed to be the most frequent, followed by\n // length 5 (since not everything will have an associated name), followed by\n // length 1 (it's probably rare for a source substring to not have an\n // associated segment data).\n if (j === 4)\n line.push([segment[0], segment[1], segment[2], segment[3]]);\n else if (j === 5)\n line.push([segment[0], segment[1], segment[2], segment[3], segment[4]]);\n else if (j === 1)\n line.push([segment[0]]);\n}\nfunction encode(decoded) {\n var sourceFileIndex = 0; // second field\n var sourceCodeLine = 0; // third field\n var sourceCodeColumn = 0; // fourth field\n var nameIndex = 0; // fifth field\n var mappings = '';\n for (var i = 0; i < decoded.length; i++) {\n var line = decoded[i];\n if (i > 0)\n mappings += ';';\n if (line.length === 0)\n continue;\n var generatedCodeColumn = 0; // first field\n var lineMappings = [];\n for (var _i = 0, line_1 = line; _i < line_1.length; _i++) {\n var segment = line_1[_i];\n var segmentMappings = encodeInteger(segment[0] - generatedCodeColumn);\n generatedCodeColumn = segment[0];\n if (segment.length > 1) {\n segmentMappings +=\n encodeInteger(segment[1] - sourceFileIndex) +\n encodeInteger(segment[2] - sourceCodeLine) +\n encodeInteger(segment[3] - sourceCodeColumn);\n sourceFileIndex = segment[1];\n sourceCodeLine = segment[2];\n sourceCodeColumn = segment[3];\n }\n if (segment.length === 5) {\n segmentMappings += encodeInteger(segment[4] - nameIndex);\n nameIndex = segment[4];\n }\n lineMappings.push(segmentMappings);\n }\n mappings += lineMappings.join(',');\n }\n return mappings;\n}\nfunction encodeInteger(num) {\n var result = '';\n num = num < 0 ? (-num << 1) | 1 : num << 1;\n do {\n var clamped = num & 31;\n num >>>= 5;\n if (num > 0) {\n clamped |= 32;\n }\n result += chars[clamped];\n } while (num > 0);\n return result;\n}\n\nexport { decode, encode };\n//# sourceMappingURL=sourcemap-codec.es.js.map\n","import { encode } from 'sourcemap-codec';\n\nclass BitSet {\n\tconstructor(arg) {\n\t\tthis.bits = arg instanceof BitSet ? arg.bits.slice() : [];\n\t}\n\n\tadd(n) {\n\t\tthis.bits[n >> 5] |= 1 << (n & 31);\n\t}\n\n\thas(n) {\n\t\treturn !!(this.bits[n >> 5] & (1 << (n & 31)));\n\t}\n}\n\nclass Chunk {\n\tconstructor(start, end, content) {\n\t\tthis.start = start;\n\t\tthis.end = end;\n\t\tthis.original = content;\n\n\t\tthis.intro = '';\n\t\tthis.outro = '';\n\n\t\tthis.content = content;\n\t\tthis.storeName = false;\n\t\tthis.edited = false;\n\n\t\t// we make these non-enumerable, for sanity while debugging\n\t\tObject.defineProperties(this, {\n\t\t\tprevious: { writable: true, value: null },\n\t\t\tnext: { writable: true, value: null },\n\t\t});\n\t}\n\n\tappendLeft(content) {\n\t\tthis.outro += content;\n\t}\n\n\tappendRight(content) {\n\t\tthis.intro = this.intro + content;\n\t}\n\n\tclone() {\n\t\tconst chunk = new Chunk(this.start, this.end, this.original);\n\n\t\tchunk.intro = this.intro;\n\t\tchunk.outro = this.outro;\n\t\tchunk.content = this.content;\n\t\tchunk.storeName = this.storeName;\n\t\tchunk.edited = this.edited;\n\n\t\treturn chunk;\n\t}\n\n\tcontains(index) {\n\t\treturn this.start < index && index < this.end;\n\t}\n\n\teachNext(fn) {\n\t\tlet chunk = this;\n\t\twhile (chunk) {\n\t\t\tfn(chunk);\n\t\t\tchunk = chunk.next;\n\t\t}\n\t}\n\n\teachPrevious(fn) {\n\t\tlet chunk = this;\n\t\twhile (chunk) {\n\t\t\tfn(chunk);\n\t\t\tchunk = chunk.previous;\n\t\t}\n\t}\n\n\tedit(content, storeName, contentOnly) {\n\t\tthis.content = content;\n\t\tif (!contentOnly) {\n\t\t\tthis.intro = '';\n\t\t\tthis.outro = '';\n\t\t}\n\t\tthis.storeName = storeName;\n\n\t\tthis.edited = true;\n\n\t\treturn this;\n\t}\n\n\tprependLeft(content) {\n\t\tthis.outro = content + this.outro;\n\t}\n\n\tprependRight(content) {\n\t\tthis.intro = content + this.intro;\n\t}\n\n\tsplit(index) {\n\t\tconst sliceIndex = index - this.start;\n\n\t\tconst originalBefore = this.original.slice(0, sliceIndex);\n\t\tconst originalAfter = this.original.slice(sliceIndex);\n\n\t\tthis.original = originalBefore;\n\n\t\tconst newChunk = new Chunk(index, this.end, originalAfter);\n\t\tnewChunk.outro = this.outro;\n\t\tthis.outro = '';\n\n\t\tthis.end = index;\n\n\t\tif (this.edited) {\n\t\t\t// TODO is this block necessary?...\n\t\t\tnewChunk.edit('', false);\n\t\t\tthis.content = '';\n\t\t} else {\n\t\t\tthis.content = originalBefore;\n\t\t}\n\n\t\tnewChunk.next = this.next;\n\t\tif (newChunk.next) newChunk.next.previous = newChunk;\n\t\tnewChunk.previous = this;\n\t\tthis.next = newChunk;\n\n\t\treturn newChunk;\n\t}\n\n\ttoString() {\n\t\treturn this.intro + this.content + this.outro;\n\t}\n\n\ttrimEnd(rx) {\n\t\tthis.outro = this.outro.replace(rx, '');\n\t\tif (this.outro.length) return true;\n\n\t\tconst trimmed = this.content.replace(rx, '');\n\n\t\tif (trimmed.length) {\n\t\t\tif (trimmed !== this.content) {\n\t\t\t\tthis.split(this.start + trimmed.length).edit('', undefined, true);\n\t\t\t}\n\t\t\treturn true;\n\t\t} else {\n\t\t\tthis.edit('', undefined, true);\n\n\t\t\tthis.intro = this.intro.replace(rx, '');\n\t\t\tif (this.intro.length) return true;\n\t\t}\n\t}\n\n\ttrimStart(rx) {\n\t\tthis.intro = this.intro.replace(rx, '');\n\t\tif (this.intro.length) return true;\n\n\t\tconst trimmed = this.content.replace(rx, '');\n\n\t\tif (trimmed.length) {\n\t\t\tif (trimmed !== this.content) {\n\t\t\t\tthis.split(this.end - trimmed.length);\n\t\t\t\tthis.edit('', undefined, true);\n\t\t\t}\n\t\t\treturn true;\n\t\t} else {\n\t\t\tthis.edit('', undefined, true);\n\n\t\t\tthis.outro = this.outro.replace(rx, '');\n\t\t\tif (this.outro.length) return true;\n\t\t}\n\t}\n}\n\nlet btoa = () => {\n\tthrow new Error('Unsupported environment: `window.btoa` or `Buffer` should be supported.');\n};\nif (typeof window !== 'undefined' && typeof window.btoa === 'function') {\n\tbtoa = (str) => window.btoa(unescape(encodeURIComponent(str)));\n} else if (typeof Buffer === 'function') {\n\tbtoa = (str) => Buffer.from(str, 'utf-8').toString('base64');\n}\n\nclass SourceMap {\n\tconstructor(properties) {\n\t\tthis.version = 3;\n\t\tthis.file = properties.file;\n\t\tthis.sources = properties.sources;\n\t\tthis.sourcesContent = properties.sourcesContent;\n\t\tthis.names = properties.names;\n\t\tthis.mappings = encode(properties.mappings);\n\t}\n\n\ttoString() {\n\t\treturn JSON.stringify(this);\n\t}\n\n\ttoUrl() {\n\t\treturn 'data:application/json;charset=utf-8;base64,' + btoa(this.toString());\n\t}\n}\n\nfunction guessIndent(code) {\n\tconst lines = code.split('\\n');\n\n\tconst tabbed = lines.filter((line) => /^\\t+/.test(line));\n\tconst spaced = lines.filter((line) => /^ {2,}/.test(line));\n\n\tif (tabbed.length === 0 && spaced.length === 0) {\n\t\treturn null;\n\t}\n\n\t// More lines tabbed than spaced? Assume tabs, and\n\t// default to tabs in the case of a tie (or nothing\n\t// to go on)\n\tif (tabbed.length >= spaced.length) {\n\t\treturn '\\t';\n\t}\n\n\t// Otherwise, we need to guess the multiple\n\tconst min = spaced.reduce((previous, current) => {\n\t\tconst numSpaces = /^ +/.exec(current)[0].length;\n\t\treturn Math.min(numSpaces, previous);\n\t}, Infinity);\n\n\treturn new Array(min + 1).join(' ');\n}\n\nfunction getRelativePath(from, to) {\n\tconst fromParts = from.split(/[/\\\\]/);\n\tconst toParts = to.split(/[/\\\\]/);\n\n\tfromParts.pop(); // get dirname\n\n\twhile (fromParts[0] === toParts[0]) {\n\t\tfromParts.shift();\n\t\ttoParts.shift();\n\t}\n\n\tif (fromParts.length) {\n\t\tlet i = fromParts.length;\n\t\twhile (i--) fromParts[i] = '..';\n\t}\n\n\treturn fromParts.concat(toParts).join('/');\n}\n\nconst toString = Object.prototype.toString;\n\nfunction isObject(thing) {\n\treturn toString.call(thing) === '[object Object]';\n}\n\nfunction getLocator(source) {\n\tconst originalLines = source.split('\\n');\n\tconst lineOffsets = [];\n\n\tfor (let i = 0, pos = 0; i < originalLines.length; i++) {\n\t\tlineOffsets.push(pos);\n\t\tpos += originalLines[i].length + 1;\n\t}\n\n\treturn function locate(index) {\n\t\tlet i = 0;\n\t\tlet j = lineOffsets.length;\n\t\twhile (i < j) {\n\t\t\tconst m = (i + j) >> 1;\n\t\t\tif (index < lineOffsets[m]) {\n\t\t\t\tj = m;\n\t\t\t} else {\n\t\t\t\ti = m + 1;\n\t\t\t}\n\t\t}\n\t\tconst line = i - 1;\n\t\tconst column = index - lineOffsets[line];\n\t\treturn { line, column };\n\t};\n}\n\nclass Mappings {\n\tconstructor(hires) {\n\t\tthis.hires = hires;\n\t\tthis.generatedCodeLine = 0;\n\t\tthis.generatedCodeColumn = 0;\n\t\tthis.raw = [];\n\t\tthis.rawSegments = this.raw[this.generatedCodeLine] = [];\n\t\tthis.pending = null;\n\t}\n\n\taddEdit(sourceIndex, content, loc, nameIndex) {\n\t\tif (content.length) {\n\t\t\tconst segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column];\n\t\t\tif (nameIndex >= 0) {\n\t\t\t\tsegment.push(nameIndex);\n\t\t\t}\n\t\t\tthis.rawSegments.push(segment);\n\t\t} else if (this.pending) {\n\t\t\tthis.rawSegments.push(this.pending);\n\t\t}\n\n\t\tthis.advance(content);\n\t\tthis.pending = null;\n\t}\n\n\taddUneditedChunk(sourceIndex, chunk, original, loc, sourcemapLocations) {\n\t\tlet originalCharIndex = chunk.start;\n\t\tlet first = true;\n\n\t\twhile (originalCharIndex < chunk.end) {\n\t\t\tif (this.hires || first || sourcemapLocations.has(originalCharIndex)) {\n\t\t\t\tthis.rawSegments.push([this.generatedCodeColumn, sourceIndex, loc.line, loc.column]);\n\t\t\t}\n\n\t\t\tif (original[originalCharIndex] === '\\n') {\n\t\t\t\tloc.line += 1;\n\t\t\t\tloc.column = 0;\n\t\t\t\tthis.generatedCodeLine += 1;\n\t\t\t\tthis.raw[this.generatedCodeLine] = this.rawSegments = [];\n\t\t\t\tthis.generatedCodeColumn = 0;\n\t\t\t\tfirst = true;\n\t\t\t} else {\n\t\t\t\tloc.column += 1;\n\t\t\t\tthis.generatedCodeColumn += 1;\n\t\t\t\tfirst = false;\n\t\t\t}\n\n\t\t\toriginalCharIndex += 1;\n\t\t}\n\n\t\tthis.pending = null;\n\t}\n\n\tadvance(str) {\n\t\tif (!str) return;\n\n\t\tconst lines = str.split('\\n');\n\n\t\tif (lines.length > 1) {\n\t\t\tfor (let i = 0; i < lines.length - 1; i++) {\n\t\t\t\tthis.generatedCodeLine++;\n\t\t\t\tthis.raw[this.generatedCodeLine] = this.rawSegments = [];\n\t\t\t}\n\t\t\tthis.generatedCodeColumn = 0;\n\t\t}\n\n\t\tthis.generatedCodeColumn += lines[lines.length - 1].length;\n\t}\n}\n\nconst n = '\\n';\n\nconst warned = {\n\tinsertLeft: false,\n\tinsertRight: false,\n\tstoreName: false,\n};\n\nclass MagicString {\n\tconstructor(string, options = {}) {\n\t\tconst chunk = new Chunk(0, string.length, string);\n\n\t\tObject.defineProperties(this, {\n\t\t\toriginal: { writable: true, value: string },\n\t\t\toutro: { writable: true, value: '' },\n\t\t\tintro: { writable: true, value: '' },\n\t\t\tfirstChunk: { writable: true, value: chunk },\n\t\t\tlastChunk: { writable: true, value: chunk },\n\t\t\tlastSearchedChunk: { writable: true, value: chunk },\n\t\t\tbyStart: { writable: true, value: {} },\n\t\t\tbyEnd: { writable: true, value: {} },\n\t\t\tfilename: { writable: true, value: options.filename },\n\t\t\tindentExclusionRanges: { writable: true, value: options.indentExclusionRanges },\n\t\t\tsourcemapLocations: { writable: true, value: new BitSet() },\n\t\t\tstoredNames: { writable: true, value: {} },\n\t\t\tindentStr: { writable: true, value: guessIndent(string) },\n\t\t});\n\n\t\tthis.byStart[0] = chunk;\n\t\tthis.byEnd[string.length] = chunk;\n\t}\n\n\taddSourcemapLocation(char) {\n\t\tthis.sourcemapLocations.add(char);\n\t}\n\n\tappend(content) {\n\t\tif (typeof content !== 'string') throw new TypeError('outro content must be a string');\n\n\t\tthis.outro += content;\n\t\treturn this;\n\t}\n\n\tappendLeft(index, content) {\n\t\tif (typeof content !== 'string') throw new TypeError('inserted content must be a string');\n\n\t\tthis._split(index);\n\n\t\tconst chunk = this.byEnd[index];\n\n\t\tif (chunk) {\n\t\t\tchunk.appendLeft(content);\n\t\t} else {\n\t\t\tthis.intro += content;\n\t\t}\n\t\treturn this;\n\t}\n\n\tappendRight(index, content) {\n\t\tif (typeof content !== 'string') throw new TypeError('inserted content must be a string');\n\n\t\tthis._split(index);\n\n\t\tconst chunk = this.byStart[index];\n\n\t\tif (chunk) {\n\t\t\tchunk.appendRight(content);\n\t\t} else {\n\t\t\tthis.outro += content;\n\t\t}\n\t\treturn this;\n\t}\n\n\tclone() {\n\t\tconst cloned = new MagicString(this.original, { filename: this.filename });\n\n\t\tlet originalChunk = this.firstChunk;\n\t\tlet clonedChunk = (cloned.firstChunk = cloned.lastSearchedChunk = originalChunk.clone());\n\n\t\twhile (originalChunk) {\n\t\t\tcloned.byStart[clonedChunk.start] = clonedChunk;\n\t\t\tcloned.byEnd[clonedChunk.end] = clonedChunk;\n\n\t\t\tconst nextOriginalChunk = originalChunk.next;\n\t\t\tconst nextClonedChunk = nextOriginalChunk && nextOriginalChunk.clone();\n\n\t\t\tif (nextClonedChunk) {\n\t\t\t\tclonedChunk.next = nextClonedChunk;\n\t\t\t\tnextClonedChunk.previous = clonedChunk;\n\n\t\t\t\tclonedChunk = nextClonedChunk;\n\t\t\t}\n\n\t\t\toriginalChunk = nextOriginalChunk;\n\t\t}\n\n\t\tcloned.lastChunk = clonedChunk;\n\n\t\tif (this.indentExclusionRanges) {\n\t\t\tcloned.indentExclusionRanges = this.indentExclusionRanges.slice();\n\t\t}\n\n\t\tcloned.sourcemapLocations = new BitSet(this.sourcemapLocations);\n\n\t\tcloned.intro = this.intro;\n\t\tcloned.outro = this.outro;\n\n\t\treturn cloned;\n\t}\n\n\tgenerateDecodedMap(options) {\n\t\toptions = options || {};\n\n\t\tconst sourceIndex = 0;\n\t\tconst names = Object.keys(this.storedNames);\n\t\tconst mappings = new Mappings(options.hires);\n\n\t\tconst locate = getLocator(this.original);\n\n\t\tif (this.intro) {\n\t\t\tmappings.advance(this.intro);\n\t\t}\n\n\t\tthis.firstChunk.eachNext((chunk) => {\n\t\t\tconst loc = locate(chunk.start);\n\n\t\t\tif (chunk.intro.length) mappings.advance(chunk.intro);\n\n\t\t\tif (chunk.edited) {\n\t\t\t\tmappings.addEdit(\n\t\t\t\t\tsourceIndex,\n\t\t\t\t\tchunk.content,\n\t\t\t\t\tloc,\n\t\t\t\t\tchunk.storeName ? names.indexOf(chunk.original) : -1\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tmappings.addUneditedChunk(sourceIndex, chunk, this.original, loc, this.sourcemapLocations);\n\t\t\t}\n\n\t\t\tif (chunk.outro.length) mappings.advance(chunk.outro);\n\t\t});\n\n\t\treturn {\n\t\t\tfile: options.file ? options.file.split(/[/\\\\]/).pop() : null,\n\t\t\tsources: [options.source ? getRelativePath(options.file || '', options.source) : null],\n\t\t\tsourcesContent: options.includeContent ? [this.original] : [null],\n\t\t\tnames,\n\t\t\tmappings: mappings.raw,\n\t\t};\n\t}\n\n\tgenerateMap(options) {\n\t\treturn new SourceMap(this.generateDecodedMap(options));\n\t}\n\n\tgetIndentString() {\n\t\treturn this.indentStr === null ? '\\t' : this.indentStr;\n\t}\n\n\tindent(indentStr, options) {\n\t\tconst pattern = /^[^\\r\\n]/gm;\n\n\t\tif (isObject(indentStr)) {\n\t\t\toptions = indentStr;\n\t\t\tindentStr = undefined;\n\t\t}\n\n\t\tindentStr = indentStr !== undefined ? indentStr : this.indentStr || '\\t';\n\n\t\tif (indentStr === '') return this; // noop\n\n\t\toptions = options || {};\n\n\t\t// Process exclusion ranges\n\t\tconst isExcluded = {};\n\n\t\tif (options.exclude) {\n\t\t\tconst exclusions =\n\t\t\t\ttypeof options.exclude[0] === 'number' ? [options.exclude] : options.exclude;\n\t\t\texclusions.forEach((exclusion) => {\n\t\t\t\tfor (let i = exclusion[0]; i < exclusion[1]; i += 1) {\n\t\t\t\t\tisExcluded[i] = true;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tlet shouldIndentNextCharacter = options.indentStart !== false;\n\t\tconst replacer = (match) => {\n\t\t\tif (shouldIndentNextCharacter) return `${indentStr}${match}`;\n\t\t\tshouldIndentNextCharacter = true;\n\t\t\treturn match;\n\t\t};\n\n\t\tthis.intro = this.intro.replace(pattern, replacer);\n\n\t\tlet charIndex = 0;\n\t\tlet chunk = this.firstChunk;\n\n\t\twhile (chunk) {\n\t\t\tconst end = chunk.end;\n\n\t\t\tif (chunk.edited) {\n\t\t\t\tif (!isExcluded[charIndex]) {\n\t\t\t\t\tchunk.content = chunk.content.replace(pattern, replacer);\n\n\t\t\t\t\tif (chunk.content.length) {\n\t\t\t\t\t\tshouldIndentNextCharacter = chunk.content[chunk.content.length - 1] === '\\n';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcharIndex = chunk.start;\n\n\t\t\t\twhile (charIndex < end) {\n\t\t\t\t\tif (!isExcluded[charIndex]) {\n\t\t\t\t\t\tconst char = this.original[charIndex];\n\n\t\t\t\t\t\tif (char === '\\n') {\n\t\t\t\t\t\t\tshouldIndentNextCharacter = true;\n\t\t\t\t\t\t} else if (char !== '\\r' && shouldIndentNextCharacter) {\n\t\t\t\t\t\t\tshouldIndentNextCharacter = false;\n\n\t\t\t\t\t\t\tif (charIndex === chunk.start) {\n\t\t\t\t\t\t\t\tchunk.prependRight(indentStr);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthis._splitChunk(chunk, charIndex);\n\t\t\t\t\t\t\t\tchunk = chunk.next;\n\t\t\t\t\t\t\t\tchunk.prependRight(indentStr);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tcharIndex += 1;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tcharIndex = chunk.end;\n\t\t\tchunk = chunk.next;\n\t\t}\n\n\t\tthis.outro = this.outro.replace(pattern, replacer);\n\n\t\treturn this;\n\t}\n\n\tinsert() {\n\t\tthrow new Error(\n\t\t\t'magicString.insert(...) is deprecated. Use prependRight(...) or appendLeft(...)'\n\t\t);\n\t}\n\n\tinsertLeft(index, content) {\n\t\tif (!warned.insertLeft) {\n\t\t\tconsole.warn(\n\t\t\t\t'magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead'\n\t\t\t); // eslint-disable-line no-console\n\t\t\twarned.insertLeft = true;\n\t\t}\n\n\t\treturn this.appendLeft(index, content);\n\t}\n\n\tinsertRight(index, content) {\n\t\tif (!warned.insertRight) {\n\t\t\tconsole.warn(\n\t\t\t\t'magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead'\n\t\t\t); // eslint-disable-line no-console\n\t\t\twarned.insertRight = true;\n\t\t}\n\n\t\treturn this.prependRight(index, content);\n\t}\n\n\tmove(start, end, index) {\n\t\tif (index >= start && index <= end) throw new Error('Cannot move a selection inside itself');\n\n\t\tthis._split(start);\n\t\tthis._split(end);\n\t\tthis._split(index);\n\n\t\tconst first = this.byStart[start];\n\t\tconst last = this.byEnd[end];\n\n\t\tconst oldLeft = first.previous;\n\t\tconst oldRight = last.next;\n\n\t\tconst newRight = this.byStart[index];\n\t\tif (!newRight && last === this.lastChunk) return this;\n\t\tconst newLeft = newRight ? newRight.previous : this.lastChunk;\n\n\t\tif (oldLeft) oldLeft.next = oldRight;\n\t\tif (oldRight) oldRight.previous = oldLeft;\n\n\t\tif (newLeft) newLeft.next = first;\n\t\tif (newRight) newRight.previous = last;\n\n\t\tif (!first.previous) this.firstChunk = last.next;\n\t\tif (!last.next) {\n\t\t\tthis.lastChunk = first.previous;\n\t\t\tthis.lastChunk.next = null;\n\t\t}\n\n\t\tfirst.previous = newLeft;\n\t\tlast.next = newRight || null;\n\n\t\tif (!newLeft) this.firstChunk = first;\n\t\tif (!newRight) this.lastChunk = last;\n\t\treturn this;\n\t}\n\n\toverwrite(start, end, content, options) {\n\t\tif (typeof content !== 'string') throw new TypeError('replacement content must be a string');\n\n\t\twhile (start < 0) start += this.original.length;\n\t\twhile (end < 0) end += this.original.length;\n\n\t\tif (end > this.original.length) throw new Error('end is out of bounds');\n\t\tif (start === end)\n\t\t\tthrow new Error(\n\t\t\t\t'Cannot overwrite a zero-length range – use appendLeft or prependRight instead'\n\t\t\t);\n\n\t\tthis._split(start);\n\t\tthis._split(end);\n\n\t\tif (options === true) {\n\t\t\tif (!warned.storeName) {\n\t\t\t\tconsole.warn(\n\t\t\t\t\t'The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string'\n\t\t\t\t); // eslint-disable-line no-console\n\t\t\t\twarned.storeName = true;\n\t\t\t}\n\n\t\t\toptions = { storeName: true };\n\t\t}\n\t\tconst storeName = options !== undefined ? options.storeName : false;\n\t\tconst contentOnly = options !== undefined ? options.contentOnly : false;\n\n\t\tif (storeName) {\n\t\t\tconst original = this.original.slice(start, end);\n\t\t\tObject.defineProperty(this.storedNames, original, {\n\t\t\t\twritable: true,\n\t\t\t\tvalue: true,\n\t\t\t\tenumerable: true,\n\t\t\t});\n\t\t}\n\n\t\tconst first = this.byStart[start];\n\t\tconst last = this.byEnd[end];\n\n\t\tif (first) {\n\t\t\tlet chunk = first;\n\t\t\twhile (chunk !== last) {\n\t\t\t\tif (chunk.next !== this.byStart[chunk.end]) {\n\t\t\t\t\tthrow new Error('Cannot overwrite across a split point');\n\t\t\t\t}\n\t\t\t\tchunk = chunk.next;\n\t\t\t\tchunk.edit('', false);\n\t\t\t}\n\n\t\t\tfirst.edit(content, storeName, contentOnly);\n\t\t} else {\n\t\t\t// must be inserting at the end\n\t\t\tconst newChunk = new Chunk(start, end, '').edit(content, storeName);\n\n\t\t\t// TODO last chunk in the array may not be the last chunk, if it's moved...\n\t\t\tlast.next = newChunk;\n\t\t\tnewChunk.previous = last;\n\t\t}\n\t\treturn this;\n\t}\n\n\tprepend(content) {\n\t\tif (typeof content !== 'string') throw new TypeError('outro content must be a string');\n\n\t\tthis.intro = content + this.intro;\n\t\treturn this;\n\t}\n\n\tprependLeft(index, content) {\n\t\tif (typeof content !== 'string') throw new TypeError('inserted content must be a string');\n\n\t\tthis._split(index);\n\n\t\tconst chunk = this.byEnd[index];\n\n\t\tif (chunk) {\n\t\t\tchunk.prependLeft(content);\n\t\t} else {\n\t\t\tthis.intro = content + this.intro;\n\t\t}\n\t\treturn this;\n\t}\n\n\tprependRight(index, content) {\n\t\tif (typeof content !== 'string') throw new TypeError('inserted content must be a string');\n\n\t\tthis._split(index);\n\n\t\tconst chunk = this.byStart[index];\n\n\t\tif (chunk) {\n\t\t\tchunk.prependRight(content);\n\t\t} else {\n\t\t\tthis.outro = content + this.outro;\n\t\t}\n\t\treturn this;\n\t}\n\n\tremove(start, end) {\n\t\twhile (start < 0) start += this.original.length;\n\t\twhile (end < 0) end += this.original.length;\n\n\t\tif (start === end) return this;\n\n\t\tif (start < 0 || end > this.original.length) throw new Error('Character is out of bounds');\n\t\tif (start > end) throw new Error('end must be greater than start');\n\n\t\tthis._split(start);\n\t\tthis._split(end);\n\n\t\tlet chunk = this.byStart[start];\n\n\t\twhile (chunk) {\n\t\t\tchunk.intro = '';\n\t\t\tchunk.outro = '';\n\t\t\tchunk.edit('');\n\n\t\t\tchunk = end > chunk.end ? this.byStart[chunk.end] : null;\n\t\t}\n\t\treturn this;\n\t}\n\n\tlastChar() {\n\t\tif (this.outro.length) return this.outro[this.outro.length - 1];\n\t\tlet chunk = this.lastChunk;\n\t\tdo {\n\t\t\tif (chunk.outro.length) return chunk.outro[chunk.outro.length - 1];\n\t\t\tif (chunk.content.length) return chunk.content[chunk.content.length - 1];\n\t\t\tif (chunk.intro.length) return chunk.intro[chunk.intro.length - 1];\n\t\t} while ((chunk = chunk.previous));\n\t\tif (this.intro.length) return this.intro[this.intro.length - 1];\n\t\treturn '';\n\t}\n\n\tlastLine() {\n\t\tlet lineIndex = this.outro.lastIndexOf(n);\n\t\tif (lineIndex !== -1) return this.outro.substr(lineIndex + 1);\n\t\tlet lineStr = this.outro;\n\t\tlet chunk = this.lastChunk;\n\t\tdo {\n\t\t\tif (chunk.outro.length > 0) {\n\t\t\t\tlineIndex = chunk.outro.lastIndexOf(n);\n\t\t\t\tif (lineIndex !== -1) return chunk.outro.substr(lineIndex + 1) + lineStr;\n\t\t\t\tlineStr = chunk.outro + lineStr;\n\t\t\t}\n\n\t\t\tif (chunk.content.length > 0) {\n\t\t\t\tlineIndex = chunk.content.lastIndexOf(n);\n\t\t\t\tif (lineIndex !== -1) return chunk.content.substr(lineIndex + 1) + lineStr;\n\t\t\t\tlineStr = chunk.content + lineStr;\n\t\t\t}\n\n\t\t\tif (chunk.intro.length > 0) {\n\t\t\t\tlineIndex = chunk.intro.lastIndexOf(n);\n\t\t\t\tif (lineIndex !== -1) return chunk.intro.substr(lineIndex + 1) + lineStr;\n\t\t\t\tlineStr = chunk.intro + lineStr;\n\t\t\t}\n\t\t} while ((chunk = chunk.previous));\n\t\tlineIndex = this.intro.lastIndexOf(n);\n\t\tif (lineIndex !== -1) return this.intro.substr(lineIndex + 1) + lineStr;\n\t\treturn this.intro + lineStr;\n\t}\n\n\tslice(start = 0, end = this.original.length) {\n\t\twhile (start < 0) start += this.original.length;\n\t\twhile (end < 0) end += this.original.length;\n\n\t\tlet result = '';\n\n\t\t// find start chunk\n\t\tlet chunk = this.firstChunk;\n\t\twhile (chunk && (chunk.start > start || chunk.end <= start)) {\n\t\t\t// found end chunk before start\n\t\t\tif (chunk.start < end && chunk.end >= end) {\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tchunk = chunk.next;\n\t\t}\n\n\t\tif (chunk && chunk.edited && chunk.start !== start)\n\t\t\tthrow new Error(`Cannot use replaced character ${start} as slice start anchor.`);\n\n\t\tconst startChunk = chunk;\n\t\twhile (chunk) {\n\t\t\tif (chunk.intro && (startChunk !== chunk || chunk.start === start)) {\n\t\t\t\tresult += chunk.intro;\n\t\t\t}\n\n\t\t\tconst containsEnd = chunk.start < end && chunk.end >= end;\n\t\t\tif (containsEnd && chunk.edited && chunk.end !== end)\n\t\t\t\tthrow new Error(`Cannot use replaced character ${end} as slice end anchor.`);\n\n\t\t\tconst sliceStart = startChunk === chunk ? start - chunk.start : 0;\n\t\t\tconst sliceEnd = containsEnd ? chunk.content.length + end - chunk.end : chunk.content.length;\n\n\t\t\tresult += chunk.content.slice(sliceStart, sliceEnd);\n\n\t\t\tif (chunk.outro && (!containsEnd || chunk.end === end)) {\n\t\t\t\tresult += chunk.outro;\n\t\t\t}\n\n\t\t\tif (containsEnd) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tchunk = chunk.next;\n\t\t}\n\n\t\treturn result;\n\t}\n\n\t// TODO deprecate this? not really very useful\n\tsnip(start, end) {\n\t\tconst clone = this.clone();\n\t\tclone.remove(0, start);\n\t\tclone.remove(end, clone.original.length);\n\n\t\treturn clone;\n\t}\n\n\t_split(index) {\n\t\tif (this.byStart[index] || this.byEnd[index]) return;\n\n\t\tlet chunk = this.lastSearchedChunk;\n\t\tconst searchForward = index > chunk.end;\n\n\t\twhile (chunk) {\n\t\t\tif (chunk.contains(index)) return this._splitChunk(chunk, index);\n\n\t\t\tchunk = searchForward ? this.byStart[chunk.end] : this.byEnd[chunk.start];\n\t\t}\n\t}\n\n\t_splitChunk(chunk, index) {\n\t\tif (chunk.edited && chunk.content.length) {\n\t\t\t// zero-length edited chunks are a special case (overlapping replacements)\n\t\t\tconst loc = getLocator(this.original)(index);\n\t\t\tthrow new Error(\n\t\t\t\t`Cannot split a chunk that has already been edited (${loc.line}:${loc.column} – \"${chunk.original}\")`\n\t\t\t);\n\t\t}\n\n\t\tconst newChunk = chunk.split(index);\n\n\t\tthis.byEnd[index] = chunk;\n\t\tthis.byStart[index] = newChunk;\n\t\tthis.byEnd[newChunk.end] = newChunk;\n\n\t\tif (chunk === this.lastChunk) this.lastChunk = newChunk;\n\n\t\tthis.lastSearchedChunk = chunk;\n\t\treturn true;\n\t}\n\n\ttoString() {\n\t\tlet str = this.intro;\n\n\t\tlet chunk = this.firstChunk;\n\t\twhile (chunk) {\n\t\t\tstr += chunk.toString();\n\t\t\tchunk = chunk.next;\n\t\t}\n\n\t\treturn str + this.outro;\n\t}\n\n\tisEmpty() {\n\t\tlet chunk = this.firstChunk;\n\t\tdo {\n\t\t\tif (\n\t\t\t\t(chunk.intro.length && chunk.intro.trim()) ||\n\t\t\t\t(chunk.content.length && chunk.content.trim()) ||\n\t\t\t\t(chunk.outro.length && chunk.outro.trim())\n\t\t\t)\n\t\t\t\treturn false;\n\t\t} while ((chunk = chunk.next));\n\t\treturn true;\n\t}\n\n\tlength() {\n\t\tlet chunk = this.firstChunk;\n\t\tlet length = 0;\n\t\tdo {\n\t\t\tlength += chunk.intro.length + chunk.content.length + chunk.outro.length;\n\t\t} while ((chunk = chunk.next));\n\t\treturn length;\n\t}\n\n\ttrimLines() {\n\t\treturn this.trim('[\\\\r\\\\n]');\n\t}\n\n\ttrim(charType) {\n\t\treturn this.trimStart(charType).trimEnd(charType);\n\t}\n\n\ttrimEndAborted(charType) {\n\t\tconst rx = new RegExp((charType || '\\\\s') + '+$');\n\n\t\tthis.outro = this.outro.replace(rx, '');\n\t\tif (this.outro.length) return true;\n\n\t\tlet chunk = this.lastChunk;\n\n\t\tdo {\n\t\t\tconst end = chunk.end;\n\t\t\tconst aborted = chunk.trimEnd(rx);\n\n\t\t\t// if chunk was trimmed, we have a new lastChunk\n\t\t\tif (chunk.end !== end) {\n\t\t\t\tif (this.lastChunk === chunk) {\n\t\t\t\t\tthis.lastChunk = chunk.next;\n\t\t\t\t}\n\n\t\t\t\tthis.byEnd[chunk.end] = chunk;\n\t\t\t\tthis.byStart[chunk.next.start] = chunk.next;\n\t\t\t\tthis.byEnd[chunk.next.end] = chunk.next;\n\t\t\t}\n\n\t\t\tif (aborted) return true;\n\t\t\tchunk = chunk.previous;\n\t\t} while (chunk);\n\n\t\treturn false;\n\t}\n\n\ttrimEnd(charType) {\n\t\tthis.trimEndAborted(charType);\n\t\treturn this;\n\t}\n\ttrimStartAborted(charType) {\n\t\tconst rx = new RegExp('^' + (charType || '\\\\s') + '+');\n\n\t\tthis.intro = this.intro.replace(rx, '');\n\t\tif (this.intro.length) return true;\n\n\t\tlet chunk = this.firstChunk;\n\n\t\tdo {\n\t\t\tconst end = chunk.end;\n\t\t\tconst aborted = chunk.trimStart(rx);\n\n\t\t\tif (chunk.end !== end) {\n\t\t\t\t// special case...\n\t\t\t\tif (chunk === this.lastChunk) this.lastChunk = chunk.next;\n\n\t\t\t\tthis.byEnd[chunk.end] = chunk;\n\t\t\t\tthis.byStart[chunk.next.start] = chunk.next;\n\t\t\t\tthis.byEnd[chunk.next.end] = chunk.next;\n\t\t\t}\n\n\t\t\tif (aborted) return true;\n\t\t\tchunk = chunk.next;\n\t\t} while (chunk);\n\n\t\treturn false;\n\t}\n\n\ttrimStart(charType) {\n\t\tthis.trimStartAborted(charType);\n\t\treturn this;\n\t}\n\n\thasChanged() {\n\t\treturn this.original !== this.toString();\n\t}\n\n\treplace(searchValue, replacement) {\n\t\tfunction getReplacement(match, str) {\n\t\t\tif (typeof replacement === 'string') {\n\t\t\t\treturn replacement.replace(/\\$(\\$|&|\\d+)/g, (_, i) => {\n\t\t\t\t\t// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace#specifying_a_string_as_a_parameter\n\t\t\t\t\tif (i === '$') return '$';\n\t\t\t\t\tif (i === '&') return match[0];\n\t\t\t\t\tconst num = +i;\n\t\t\t\t\tif (num < match.length) return match[+i];\n\t\t\t\t\treturn `$${i}`;\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\treturn replacement(...match, match.index, str, match.groups);\n\t\t\t}\n\t\t}\n\t\tfunction matchAll(re, str) {\n\t\t\tlet match;\n\t\t\tconst matches = [];\n\t\t\twhile ((match = re.exec(str))) {\n\t\t\t\tmatches.push(match);\n\t\t\t}\n\t\t\treturn matches;\n\t\t}\n\t\tif (typeof searchValue !== 'string' && searchValue.global) {\n\t\t\tconst matches = matchAll(searchValue, this.original);\n\t\t\tmatches.forEach((match) => {\n\t\t\t\tif (match.index != null)\n\t\t\t\t\tthis.overwrite(\n\t\t\t\t\t\tmatch.index,\n\t\t\t\t\t\tmatch.index + match[0].length,\n\t\t\t\t\t\tgetReplacement(match, this.original)\n\t\t\t\t\t);\n\t\t\t});\n\t\t} else {\n\t\t\tconst match = this.original.match(searchValue);\n\t\t\tif (match && match.index != null)\n\t\t\t\tthis.overwrite(\n\t\t\t\t\tmatch.index,\n\t\t\t\t\tmatch.index + match[0].length,\n\t\t\t\t\tgetReplacement(match, this.original)\n\t\t\t\t);\n\t\t}\n\t\treturn this;\n\t}\n}\n\nconst hasOwnProp = Object.prototype.hasOwnProperty;\n\nclass Bundle {\n\tconstructor(options = {}) {\n\t\tthis.intro = options.intro || '';\n\t\tthis.separator = options.separator !== undefined ? options.separator : '\\n';\n\t\tthis.sources = [];\n\t\tthis.uniqueSources = [];\n\t\tthis.uniqueSourceIndexByFilename = {};\n\t}\n\n\taddSource(source) {\n\t\tif (source instanceof MagicString) {\n\t\t\treturn this.addSource({\n\t\t\t\tcontent: source,\n\t\t\t\tfilename: source.filename,\n\t\t\t\tseparator: this.separator,\n\t\t\t});\n\t\t}\n\n\t\tif (!isObject(source) || !source.content) {\n\t\t\tthrow new Error(\n\t\t\t\t'bundle.addSource() takes an object with a `content` property, which should be an instance of MagicString, and an optional `filename`'\n\t\t\t);\n\t\t}\n\n\t\t['filename', 'indentExclusionRanges', 'separator'].forEach((option) => {\n\t\t\tif (!hasOwnProp.call(source, option)) source[option] = source.content[option];\n\t\t});\n\n\t\tif (source.separator === undefined) {\n\t\t\t// TODO there's a bunch of this sort of thing, needs cleaning up\n\t\t\tsource.separator = this.separator;\n\t\t}\n\n\t\tif (source.filename) {\n\t\t\tif (!hasOwnProp.call(this.uniqueSourceIndexByFilename, source.filename)) {\n\t\t\t\tthis.uniqueSourceIndexByFilename[source.filename] = this.uniqueSources.length;\n\t\t\t\tthis.uniqueSources.push({ filename: source.filename, content: source.content.original });\n\t\t\t} else {\n\t\t\t\tconst uniqueSource = this.uniqueSources[this.uniqueSourceIndexByFilename[source.filename]];\n\t\t\t\tif (source.content.original !== uniqueSource.content) {\n\t\t\t\t\tthrow new Error(`Illegal source: same filename (${source.filename}), different contents`);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tthis.sources.push(source);\n\t\treturn this;\n\t}\n\n\tappend(str, options) {\n\t\tthis.addSource({\n\t\t\tcontent: new MagicString(str),\n\t\t\tseparator: (options && options.separator) || '',\n\t\t});\n\n\t\treturn this;\n\t}\n\n\tclone() {\n\t\tconst bundle = new Bundle({\n\t\t\tintro: this.intro,\n\t\t\tseparator: this.separator,\n\t\t});\n\n\t\tthis.sources.forEach((source) => {\n\t\t\tbundle.addSource({\n\t\t\t\tfilename: source.filename,\n\t\t\t\tcontent: source.content.clone(),\n\t\t\t\tseparator: source.separator,\n\t\t\t});\n\t\t});\n\n\t\treturn bundle;\n\t}\n\n\tgenerateDecodedMap(options = {}) {\n\t\tconst names = [];\n\t\tthis.sources.forEach((source) => {\n\t\t\tObject.keys(source.content.storedNames).forEach((name) => {\n\t\t\t\tif (!~names.indexOf(name)) names.push(name);\n\t\t\t});\n\t\t});\n\n\t\tconst mappings = new Mappings(options.hires);\n\n\t\tif (this.intro) {\n\t\t\tmappings.advance(this.intro);\n\t\t}\n\n\t\tthis.sources.forEach((source, i) => {\n\t\t\tif (i > 0) {\n\t\t\t\tmappings.advance(this.separator);\n\t\t\t}\n\n\t\t\tconst sourceIndex = source.filename ? this.uniqueSourceIndexByFilename[source.filename] : -1;\n\t\t\tconst magicString = source.content;\n\t\t\tconst locate = getLocator(magicString.original);\n\n\t\t\tif (magicString.intro) {\n\t\t\t\tmappings.advance(magicString.intro);\n\t\t\t}\n\n\t\t\tmagicString.firstChunk.eachNext((chunk) => {\n\t\t\t\tconst loc = locate(chunk.start);\n\n\t\t\t\tif (chunk.intro.length) mappings.advance(chunk.intro);\n\n\t\t\t\tif (source.filename) {\n\t\t\t\t\tif (chunk.edited) {\n\t\t\t\t\t\tmappings.addEdit(\n\t\t\t\t\t\t\tsourceIndex,\n\t\t\t\t\t\t\tchunk.content,\n\t\t\t\t\t\t\tloc,\n\t\t\t\t\t\t\tchunk.storeName ? names.indexOf(chunk.original) : -1\n\t\t\t\t\t\t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmappings.addUneditedChunk(\n\t\t\t\t\t\t\tsourceIndex,\n\t\t\t\t\t\t\tchunk,\n\t\t\t\t\t\t\tmagicString.original,\n\t\t\t\t\t\t\tloc,\n\t\t\t\t\t\t\tmagicString.sourcemapLocations\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tmappings.advance(chunk.content);\n\t\t\t\t}\n\n\t\t\t\tif (chunk.outro.length) mappings.advance(chunk.outro);\n\t\t\t});\n\n\t\t\tif (magicString.outro) {\n\t\t\t\tmappings.advance(magicString.outro);\n\t\t\t}\n\t\t});\n\n\t\treturn {\n\t\t\tfile: options.file ? options.file.split(/[/\\\\]/).pop() : null,\n\t\t\tsources: this.uniqueSources.map((source) => {\n\t\t\t\treturn options.file ? getRelativePath(options.file, source.filename) : source.filename;\n\t\t\t}),\n\t\t\tsourcesContent: this.uniqueSources.map((source) => {\n\t\t\t\treturn options.includeContent ? source.content : null;\n\t\t\t}),\n\t\t\tnames,\n\t\t\tmappings: mappings.raw,\n\t\t};\n\t}\n\n\tgenerateMap(options) {\n\t\treturn new SourceMap(this.generateDecodedMap(options));\n\t}\n\n\tgetIndentString() {\n\t\tconst indentStringCounts = {};\n\n\t\tthis.sources.forEach((source) => {\n\t\t\tconst indentStr = source.content.indentStr;\n\n\t\t\tif (indentStr === null) return;\n\n\t\t\tif (!indentStringCounts[indentStr]) indentStringCounts[indentStr] = 0;\n\t\t\tindentStringCounts[indentStr] += 1;\n\t\t});\n\n\t\treturn (\n\t\t\tObject.keys(indentStringCounts).sort((a, b) => {\n\t\t\t\treturn indentStringCounts[a] - indentStringCounts[b];\n\t\t\t})[0] || '\\t'\n\t\t);\n\t}\n\n\tindent(indentStr) {\n\t\tif (!arguments.length) {\n\t\t\tindentStr = this.getIndentString();\n\t\t}\n\n\t\tif (indentStr === '') return this; // noop\n\n\t\tlet trailingNewline = !this.intro || this.intro.slice(-1) === '\\n';\n\n\t\tthis.sources.forEach((source, i) => {\n\t\t\tconst separator = source.separator !== undefined ? source.separator : this.separator;\n\t\t\tconst indentStart = trailingNewline || (i > 0 && /\\r?\\n$/.test(separator));\n\n\t\t\tsource.content.indent(indentStr, {\n\t\t\t\texclude: source.indentExclusionRanges,\n\t\t\t\tindentStart, //: trailingNewline || /\\r?\\n$/.test( separator ) //true///\\r?\\n/.test( separator )\n\t\t\t});\n\n\t\t\ttrailingNewline = source.content.lastChar() === '\\n';\n\t\t});\n\n\t\tif (this.intro) {\n\t\t\tthis.intro =\n\t\t\t\tindentStr +\n\t\t\t\tthis.intro.replace(/^[^\\n]/gm, (match, index) => {\n\t\t\t\t\treturn index > 0 ? indentStr + match : match;\n\t\t\t\t});\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tprepend(str) {\n\t\tthis.intro = str + this.intro;\n\t\treturn this;\n\t}\n\n\ttoString() {\n\t\tconst body = this.sources\n\t\t\t.map((source, i) => {\n\t\t\t\tconst separator = source.separator !== undefined ? source.separator : this.separator;\n\t\t\t\tconst str = (i > 0 ? separator : '') + source.content.toString();\n\n\t\t\t\treturn str;\n\t\t\t})\n\t\t\t.join('');\n\n\t\treturn this.intro + body;\n\t}\n\n\tisEmpty() {\n\t\tif (this.intro.length && this.intro.trim()) return false;\n\t\tif (this.sources.some((source) => !source.content.isEmpty())) return false;\n\t\treturn true;\n\t}\n\n\tlength() {\n\t\treturn this.sources.reduce(\n\t\t\t(length, source) => length + source.content.length(),\n\t\t\tthis.intro.length\n\t\t);\n\t}\n\n\ttrimLines() {\n\t\treturn this.trim('[\\\\r\\\\n]');\n\t}\n\n\ttrim(charType) {\n\t\treturn this.trimStart(charType).trimEnd(charType);\n\t}\n\n\ttrimStart(charType) {\n\t\tconst rx = new RegExp('^' + (charType || '\\\\s') + '+');\n\t\tthis.intro = this.intro.replace(rx, '');\n\n\t\tif (!this.intro) {\n\t\t\tlet source;\n\t\t\tlet i = 0;\n\n\t\t\tdo {\n\t\t\t\tsource = this.sources[i++];\n\t\t\t\tif (!source) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} while (!source.content.trimStartAborted(charType));\n\t\t}\n\n\t\treturn this;\n\t}\n\n\ttrimEnd(charType) {\n\t\tconst rx = new RegExp((charType || '\\\\s') + '+$');\n\n\t\tlet source;\n\t\tlet i = this.sources.length - 1;\n\n\t\tdo {\n\t\t\tsource = this.sources[i--];\n\t\t\tif (!source) {\n\t\t\t\tthis.intro = this.intro.replace(rx, '');\n\t\t\t\tbreak;\n\t\t\t}\n\t\t} while (!source.content.trimEndAborted(charType));\n\n\t\treturn this;\n\t}\n}\n\nexport { Bundle, SourceMap, MagicString as default };\n//# sourceMappingURL=magic-string.es.mjs.map\n","const ABSOLUTE_PATH_REGEX = /^(?:\\/|(?:[A-Za-z]:)?[\\\\|/])/;\nconst RELATIVE_PATH_REGEX = /^\\.?\\.\\//;\nconst ALL_BACKSLASHES_REGEX = /\\\\/g;\nconst ANY_SLASH_REGEX = /[/\\\\]/;\nconst EXTNAME_REGEX = /\\.[^.]+$/;\n\nexport function isAbsolute(path: string): boolean {\n\treturn ABSOLUTE_PATH_REGEX.test(path);\n}\n\nexport function isRelative(path: string): boolean {\n\treturn RELATIVE_PATH_REGEX.test(path);\n}\n\nexport function normalize(path: string): string {\n\treturn path.replace(ALL_BACKSLASHES_REGEX, '/');\n}\n\nexport function basename(path: string): string {\n\treturn path.split(ANY_SLASH_REGEX).pop() || '';\n}\n\nexport function dirname(path: string): string {\n\tconst match = /[/\\\\][^/\\\\]*$/.exec(path);\n\tif (!match) return '.';\n\n\tconst dir = path.slice(0, -match[0].length);\n\n\t// If `dir` is the empty string, we're at root.\n\treturn dir ? dir : '/';\n}\n\nexport function extname(path: string): string {\n\tconst match = EXTNAME_REGEX.exec(basename(path)!);\n\treturn match ? match[0] : '';\n}\n\nexport function relative(from: string, to: string): string {\n\tconst fromParts = from.split(ANY_SLASH_REGEX).filter(Boolean);\n\tconst toParts = to.split(ANY_SLASH_REGEX).filter(Boolean);\n\n\tif (fromParts[0] === '.') fromParts.shift();\n\tif (toParts[0] === '.') toParts.shift();\n\n\twhile (fromParts[0] && toParts[0] && fromParts[0] === toParts[0]) {\n\t\tfromParts.shift();\n\t\ttoParts.shift();\n\t}\n\n\twhile (toParts[0] === '..' && fromParts.length > 0) {\n\t\ttoParts.shift();\n\t\tfromParts.pop();\n\t}\n\n\twhile (fromParts.pop()) {\n\t\ttoParts.unshift('..');\n\t}\n\n\treturn toParts.join('/');\n}\n\nexport function resolve(...paths: string[]): string {\n\tconst firstPathSegment = paths.shift();\n\tif (!firstPathSegment) {\n\t\treturn '/';\n\t}\n\tlet resolvedParts = firstPathSegment.split(ANY_SLASH_REGEX);\n\n\tfor (const path of paths) {\n\t\tif (isAbsolute(path)) {\n\t\t\tresolvedParts = path.split(ANY_SLASH_REGEX);\n\t\t} else {\n\t\t\tconst parts = path.split(ANY_SLASH_REGEX);\n\n\t\t\twhile (parts[0] === '.' || parts[0] === '..') {\n\t\t\t\tconst part = parts.shift();\n\t\t\t\tif (part === '..') {\n\t\t\t\t\tresolvedParts.pop();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tresolvedParts.push(...parts);\n\t\t}\n\t}\n\n\treturn resolvedParts.join('/');\n}\n","export function getOrCreate(map: Map, key: K, init: () => V): V {\n\tconst existing = map.get(key);\n\tif (existing) {\n\t\treturn existing;\n\t}\n\tconst value = init();\n\tmap.set(key, value);\n\treturn value;\n}\n","import { getOrCreate } from '../../utils/getOrCreate';\nimport type { Entity } from '../Entity';\n\nexport const UnknownKey = Symbol('Unknown Key');\nexport const UnknownNonAccessorKey = Symbol('Unknown Non-Accessor Key');\nexport const UnknownInteger = Symbol('Unknown Integer');\nexport type ObjectPathKey =\n\t| string\n\t| typeof UnknownKey\n\t| typeof UnknownNonAccessorKey\n\t| typeof UnknownInteger;\n\nexport type ObjectPath = ObjectPathKey[];\nexport const EMPTY_PATH: ObjectPath = [];\nexport const UNKNOWN_PATH: ObjectPath = [UnknownKey];\n// For deoptimizations, this means we are modifying an unknown property but did\n// not lose track of the object or are creating a setter/getter;\n// For assignment effects it means we do not check for setter/getter effects\n// but only if something is mutated that is included, which is relevant for\n// Object.defineProperty\nexport const UNKNOWN_NON_ACCESSOR_PATH: ObjectPath = [UnknownNonAccessorKey];\nexport const UNKNOWN_INTEGER_PATH: ObjectPath = [UnknownInteger];\n\nconst EntitiesKey = Symbol('Entities');\ninterface EntityPaths {\n\t[pathSegment: string]: EntityPaths;\n\t[EntitiesKey]: Set;\n\t[UnknownInteger]?: EntityPaths;\n\t[UnknownKey]?: EntityPaths;\n\t[UnknownNonAccessorKey]?: EntityPaths;\n}\n\nexport class PathTracker {\n\tprivate entityPaths: EntityPaths = Object.create(null, {\n\t\t[EntitiesKey]: { value: new Set() }\n\t});\n\n\ttrackEntityAtPathAndGetIfTracked(path: ObjectPath, entity: Entity): boolean {\n\t\tconst trackedEntities = this.getEntities(path);\n\t\tif (trackedEntities.has(entity)) return true;\n\t\ttrackedEntities.add(entity);\n\t\treturn false;\n\t}\n\n\twithTrackedEntityAtPath(\n\t\tpath: ObjectPath,\n\t\tentity: Entity,\n\t\tonUntracked: () => T,\n\t\treturnIfTracked: T\n\t): T {\n\t\tconst trackedEntities = this.getEntities(path);\n\t\tif (trackedEntities.has(entity)) return returnIfTracked;\n\t\ttrackedEntities.add(entity);\n\t\tconst result = onUntracked();\n\t\ttrackedEntities.delete(entity);\n\t\treturn result;\n\t}\n\n\tprivate getEntities(path: ObjectPath): Set {\n\t\tlet currentPaths = this.entityPaths;\n\t\tfor (const pathSegment of path) {\n\t\t\tcurrentPaths = currentPaths[pathSegment] =\n\t\t\t\tcurrentPaths[pathSegment] ||\n\t\t\t\tObject.create(null, { [EntitiesKey]: { value: new Set() } });\n\t\t}\n\t\treturn currentPaths[EntitiesKey];\n\t}\n}\n\nexport const SHARED_RECURSION_TRACKER = new PathTracker();\n\ninterface DiscriminatedEntityPaths {\n\t[pathSegment: string]: DiscriminatedEntityPaths;\n\t[EntitiesKey]: Map>;\n\t[UnknownInteger]?: DiscriminatedEntityPaths;\n\t[UnknownKey]?: DiscriminatedEntityPaths;\n\t[UnknownNonAccessorKey]?: DiscriminatedEntityPaths;\n}\n\nexport class DiscriminatedPathTracker {\n\tprivate entityPaths: DiscriminatedEntityPaths = Object.create(null, {\n\t\t[EntitiesKey]: { value: new Map>() }\n\t});\n\n\ttrackEntityAtPathAndGetIfTracked(\n\t\tpath: ObjectPath,\n\t\tdiscriminator: unknown,\n\t\tentity: Entity\n\t): boolean {\n\t\tlet currentPaths = this.entityPaths;\n\t\tfor (const pathSegment of path) {\n\t\t\tcurrentPaths = currentPaths[pathSegment] =\n\t\t\t\tcurrentPaths[pathSegment] ||\n\t\t\t\tObject.create(null, { [EntitiesKey]: { value: new Map>() } });\n\t\t}\n\t\tconst trackedEntities = getOrCreate(currentPaths[EntitiesKey], discriminator, () => new Set());\n\t\tif (trackedEntities.has(entity)) return true;\n\t\ttrackedEntities.add(entity);\n\t\treturn false;\n\t}\n}\n","import { DeoptimizableEntity } from '../../DeoptimizableEntity';\nimport { WritableEntity } from '../../Entity';\nimport { HasEffectsContext, InclusionContext } from '../../ExecutionContext';\nimport {\n\tNodeInteraction,\n\tNodeInteractionCalled,\n\tNodeInteractionWithThisArg\n} from '../../NodeInteractions';\nimport { ObjectPath, PathTracker, UNKNOWN_PATH } from '../../utils/PathTracker';\nimport { LiteralValue } from '../Literal';\nimport SpreadElement from '../SpreadElement';\nimport { IncludeChildren } from './Node';\n\nexport const UnknownValue = Symbol('Unknown Value');\nexport const UnknownTruthyValue = Symbol('Unknown Truthy Value');\n\nexport type LiteralValueOrUnknown = LiteralValue | typeof UnknownValue | typeof UnknownTruthyValue;\n\nexport interface InclusionOptions {\n\t/**\n\t * Include the id of a declarator even if unused to ensure it is a valid statement.\n\t */\n\tasSingleStatement?: boolean;\n}\n\nexport class ExpressionEntity implements WritableEntity {\n\tincluded = false;\n\n\tdeoptimizePath(_path: ObjectPath): void {}\n\n\tdeoptimizeThisOnInteractionAtPath(\n\t\t{ thisArg }: NodeInteractionWithThisArg,\n\t\t_path: ObjectPath,\n\t\t_recursionTracker: PathTracker\n\t): void {\n\t\tthisArg!.deoptimizePath(UNKNOWN_PATH);\n\t}\n\n\t/**\n\t * If possible it returns a stringifyable literal value for this node that can be used\n\t * for inlining or comparing values.\n\t * Otherwise it should return UnknownValue.\n\t */\n\tgetLiteralValueAtPath(\n\t\t_path: ObjectPath,\n\t\t_recursionTracker: PathTracker,\n\t\t_origin: DeoptimizableEntity\n\t): LiteralValueOrUnknown {\n\t\treturn UnknownValue;\n\t}\n\n\tgetReturnExpressionWhenCalledAtPath(\n\t\t_path: ObjectPath,\n\t\t_interaction: NodeInteractionCalled,\n\t\t_recursionTracker: PathTracker,\n\t\t_origin: DeoptimizableEntity\n\t): ExpressionEntity {\n\t\treturn UNKNOWN_EXPRESSION;\n\t}\n\n\thasEffectsOnInteractionAtPath(\n\t\t_path: ObjectPath,\n\t\t_interaction: NodeInteraction,\n\t\t_context: HasEffectsContext\n\t): boolean {\n\t\treturn true;\n\t}\n\n\tinclude(\n\t\t_context: InclusionContext,\n\t\t_includeChildrenRecursively: IncludeChildren,\n\t\t_options?: InclusionOptions\n\t): void {\n\t\tthis.included = true;\n\t}\n\n\tincludeCallArguments(\n\t\tcontext: InclusionContext,\n\t\targs: readonly (ExpressionEntity | SpreadElement)[]\n\t): void {\n\t\tfor (const arg of args) {\n\t\t\targ.include(context, false);\n\t\t}\n\t}\n\n\tshouldBeIncluded(_context: InclusionContext): boolean {\n\t\treturn true;\n\t}\n}\n\nexport const UNKNOWN_EXPRESSION: ExpressionEntity =\n\tnew (class UnknownExpression extends ExpressionEntity {})();\n","import SpreadElement from './nodes/SpreadElement';\nimport { ExpressionEntity, UNKNOWN_EXPRESSION } from './nodes/shared/Expression';\n\nexport const INTERACTION_ACCESSED = 0;\nexport const INTERACTION_ASSIGNED = 1;\nexport const INTERACTION_CALLED = 2;\n\nexport interface NodeInteractionAccessed {\n\tthisArg: ExpressionEntity | null;\n\ttype: typeof INTERACTION_ACCESSED;\n}\n\nexport const NODE_INTERACTION_UNKNOWN_ACCESS: NodeInteractionAccessed = {\n\tthisArg: null,\n\ttype: INTERACTION_ACCESSED\n};\n\nexport interface NodeInteractionAssigned {\n\targs: readonly [ExpressionEntity];\n\tthisArg: ExpressionEntity | null;\n\ttype: typeof INTERACTION_ASSIGNED;\n}\n\nexport const UNKNOWN_ARG = [UNKNOWN_EXPRESSION] as const;\n\nexport const NODE_INTERACTION_UNKNOWN_ASSIGNMENT: NodeInteractionAssigned = {\n\targs: UNKNOWN_ARG,\n\tthisArg: null,\n\ttype: INTERACTION_ASSIGNED\n};\n\nexport interface NodeInteractionCalled {\n\targs: readonly (ExpressionEntity | SpreadElement)[];\n\tthisArg: ExpressionEntity | null;\n\ttype: typeof INTERACTION_CALLED;\n\twithNew: boolean;\n}\n\nexport const NO_ARGS = [];\n\n// While this is technically a call without arguments, we can compare against\n// this reference in places where precise values or thisArg would make a\n// difference\nexport const NODE_INTERACTION_UNKNOWN_CALL: NodeInteractionCalled = {\n\targs: NO_ARGS,\n\tthisArg: null,\n\ttype: INTERACTION_CALLED,\n\twithNew: false\n};\n\nexport type NodeInteraction =\n\t| NodeInteractionAccessed\n\t| NodeInteractionAssigned\n\t| NodeInteractionCalled;\n\nexport type NodeInteractionWithThisArg = NodeInteraction & { thisArg: ExpressionEntity };\n","import type ExternalModule from '../../ExternalModule';\nimport type Module from '../../Module';\nimport type { HasEffectsContext } from '../ExecutionContext';\nimport { INTERACTION_ACCESSED, NodeInteraction } from '../NodeInteractions';\nimport type Identifier from '../nodes/Identifier';\nimport { ExpressionEntity } from '../nodes/shared/Expression';\nimport type { ObjectPath } from '../utils/PathTracker';\n\nexport default class Variable extends ExpressionEntity {\n\talwaysRendered = false;\n\tinitReached = false;\n\tisId = false;\n\t// both NamespaceVariable and ExternalVariable can be namespaces\n\tdeclare isNamespace?: boolean;\n\tisReassigned = false;\n\tkind: string | null = null;\n\tdeclare module?: Module | ExternalModule;\n\trenderBaseName: string | null = null;\n\trenderName: string | null = null;\n\n\tconstructor(public name: string) {\n\t\tsuper();\n\t}\n\n\t/**\n\t * Binds identifiers that reference this variable to this variable.\n\t * Necessary to be able to change variable names.\n\t */\n\taddReference(_identifier: Identifier): void {}\n\n\tgetBaseVariableName(): string {\n\t\treturn this.renderBaseName || this.renderName || this.name;\n\t}\n\n\tgetName(getPropertyAccess: (name: string) => string): string {\n\t\tconst name = this.renderName || this.name;\n\t\treturn this.renderBaseName ? `${this.renderBaseName}${getPropertyAccess(name)}` : name;\n\t}\n\n\thasEffectsOnInteractionAtPath(\n\t\tpath: ObjectPath,\n\t\t{ type }: NodeInteraction,\n\t\t_context: HasEffectsContext\n\t): boolean {\n\t\treturn type !== INTERACTION_ACCESSED || path.length > 0;\n\t}\n\n\t/**\n\t * Marks this variable as being part of the bundle, which is usually the case when one of\n\t * its identifiers becomes part of the bundle. Returns true if it has not been included\n\t * previously.\n\t * Once a variable is included, it should take care all its declarations are included.\n\t */\n\tinclude(): void {\n\t\tthis.included = true;\n\t}\n\n\tmarkCalledFromTryStatement(): void {}\n\n\tsetRenderNames(baseName: string | null, name: string | null): void {\n\t\tthis.renderBaseName = baseName;\n\t\tthis.renderName = name;\n\t}\n}\n","import type ExternalModule from '../../ExternalModule';\nimport { INTERACTION_ACCESSED, NodeInteraction } from '../NodeInteractions';\nimport type Identifier from '../nodes/Identifier';\nimport type { ObjectPath } from '../utils/PathTracker';\nimport Variable from './Variable';\n\nexport default class ExternalVariable extends Variable {\n\tisNamespace: boolean;\n\tmodule: ExternalModule;\n\treferenced = false;\n\n\tconstructor(module: ExternalModule, name: string) {\n\t\tsuper(name);\n\t\tthis.module = module;\n\t\tthis.isNamespace = name === '*';\n\t}\n\n\taddReference(identifier: Identifier): void {\n\t\tthis.referenced = true;\n\t\tif (this.name === 'default' || this.name === '*') {\n\t\t\tthis.module.suggestName(identifier.name);\n\t\t}\n\t}\n\n\thasEffectsOnInteractionAtPath(path: ObjectPath, { type }: NodeInteraction): boolean {\n\t\treturn type !== INTERACTION_ACCESSED || path.length > (this.isNamespace ? 1 : 0);\n\t}\n\n\tinclude(): void {\n\t\tif (!this.included) {\n\t\t\tthis.included = true;\n\t\t\tthis.module.used = true;\n\t\t}\n\t}\n}\n","export const BLANK: Record = Object.freeze(Object.create(null));\nexport const EMPTY_OBJECT = Object.freeze({});\nexport const EMPTY_ARRAY = Object.freeze([]);\n","function getLocator(source, options) {\n if (options === void 0) { options = {}; }\n var offsetLine = options.offsetLine || 0;\n var offsetColumn = options.offsetColumn || 0;\n var originalLines = source.split('\\n');\n var start = 0;\n var lineRanges = originalLines.map(function (line, i) {\n var end = start + line.length + 1;\n var range = { start: start, end: end, line: i };\n start = end;\n return range;\n });\n var i = 0;\n function rangeContains(range, index) {\n return range.start <= index && index < range.end;\n }\n function getLocation(range, index) {\n return { line: offsetLine + range.line, column: offsetColumn + index - range.start, character: index };\n }\n function locate(search, startIndex) {\n if (typeof search === 'string') {\n search = source.indexOf(search, startIndex || 0);\n }\n var range = lineRanges[i];\n var d = search >= range.end ? 1 : -1;\n while (range) {\n if (rangeContains(range, search))\n return getLocation(range, search);\n i += d;\n range = lineRanges[i];\n }\n }\n ;\n return locate;\n}\nfunction locate(source, search, options) {\n if (typeof options === 'number') {\n throw new Error('locate takes a { startIndex, offsetLine, offsetColumn } object as the third argument');\n }\n return getLocator(source, options)(search, options && options.startIndex);\n}\n\nexport { getLocator, locate };","function spaces(i: number): string {\n\tlet result = '';\n\twhile (i--) result += ' ';\n\treturn result;\n}\n\nfunction tabsToSpaces(str: string): string {\n\treturn str.replace(/^\\t+/, match => match.split('\\t').join(' '));\n}\n\nexport default function getCodeFrame(source: string, line: number, column: number): string {\n\tlet lines = source.split('\\n');\n\n\tconst frameStart = Math.max(0, line - 3);\n\tlet frameEnd = Math.min(line + 2, lines.length);\n\n\tlines = lines.slice(frameStart, frameEnd);\n\twhile (!/\\S/.test(lines[lines.length - 1])) {\n\t\tlines.pop();\n\t\tframeEnd -= 1;\n\t}\n\n\tconst digits = String(frameEnd).length;\n\n\treturn lines\n\t\t.map((str, i) => {\n\t\t\tconst isErrorLine = frameStart + i + 1 === line;\n\n\t\t\tlet lineNum = String(i + frameStart + 1);\n\t\t\twhile (lineNum.length < digits) lineNum = ` ${lineNum}`;\n\n\t\t\tif (isErrorLine) {\n\t\t\t\tconst indicator = spaces(digits + 2 + tabsToSpaces(str.slice(0, column)).length) + '^';\n\t\t\t\treturn `${lineNum}: ${tabsToSpaces(str)}\\n${indicator}`;\n\t\t\t}\n\n\t\t\treturn `${lineNum}: ${tabsToSpaces(str)}`;\n\t\t})\n\t\t.join('\\n');\n}\n","export function printQuotedStringList(\n\tlist: readonly string[],\n\tverbs?: readonly [string, string]\n): string {\n\tconst isSingleItem = list.length <= 1;\n\tconst quotedList = list.map(item => `\"${item}\"`);\n\tlet output = isSingleItem\n\t\t? quotedList[0]\n\t\t: `${quotedList.slice(0, -1).join(', ')} and ${quotedList.slice(-1)[0]}`;\n\tif (verbs) {\n\t\toutput += ` ${isSingleItem ? verbs[0] : verbs[1]}`;\n\t}\n\treturn output;\n}\n","import { relative } from '../../browser/path';\nimport { basename, dirname, extname, isAbsolute, normalize, resolve } from './path';\n\nexport function getAliasName(id: string): string {\n\tconst base = basename(id);\n\treturn base.substring(0, base.length - extname(id).length);\n}\n\nexport default function relativeId(id: string): string {\n\tif (!isAbsolute(id)) return id;\n\treturn relative(resolve(), id);\n}\n\nexport function isPathFragment(name: string): boolean {\n\t// starting with \"/\", \"./\", \"../\", \"C:/\"\n\treturn (\n\t\tname[0] === '/' || (name[0] === '.' && (name[1] === '/' || name[1] === '.')) || isAbsolute(name)\n\t);\n}\n\nconst UPPER_DIR_REGEX = /^(\\.\\.\\/)*\\.\\.$/;\n\nexport function getImportPath(\n\timporterId: string,\n\ttargetPath: string,\n\tstripJsExtension: boolean,\n\tensureFileName: boolean\n): string {\n\tlet relativePath = normalize(relative(dirname(importerId), targetPath));\n\tif (stripJsExtension && relativePath.endsWith('.js')) {\n\t\trelativePath = relativePath.slice(0, -3);\n\t}\n\tif (ensureFileName) {\n\t\tif (relativePath === '') return '../' + basename(targetPath);\n\t\tif (UPPER_DIR_REGEX.test(relativePath)) {\n\t\t\treturn relativePath\n\t\t\t\t.split('/')\n\t\t\t\t.concat(['..', basename(targetPath)])\n\t\t\t\t.join('/');\n\t\t}\n\t}\n\treturn !relativePath ? '.' : relativePath.startsWith('..') ? relativePath : './' + relativePath;\n}\n","import { locate } from 'locate-character';\nimport type Module from '../Module';\nimport type {\n\tNormalizedInputOptions,\n\tRollupError,\n\tRollupLogProps,\n\tRollupWarning,\n\tWarningHandler\n} from '../rollup/types';\nimport getCodeFrame from './getCodeFrame';\nimport { printQuotedStringList } from './printStringList';\nimport relativeId from './relativeId';\n\nexport function error(base: Error | RollupError): never {\n\tif (!(base instanceof Error)) base = Object.assign(new Error(base.message), base);\n\tthrow base;\n}\n\nexport function augmentCodeLocation(\n\tprops: RollupLogProps,\n\tpos: number | { column: number; line: number },\n\tsource: string,\n\tid: string\n): void {\n\tif (typeof pos === 'object') {\n\t\tconst { line, column } = pos;\n\t\tprops.loc = { column, file: id, line };\n\t} else {\n\t\tprops.pos = pos;\n\t\tconst { line, column } = locate(source, pos, { offsetLine: 1 });\n\t\tprops.loc = { column, file: id, line };\n\t}\n\n\tif (props.frame === undefined) {\n\t\tconst { line, column } = props.loc;\n\t\tprops.frame = getCodeFrame(source, line, column);\n\t}\n}\n\nexport const enum Errors {\n\tALREADY_CLOSED = 'ALREADY_CLOSED',\n\tASSET_NOT_FINALISED = 'ASSET_NOT_FINALISED',\n\tASSET_NOT_FOUND = 'ASSET_NOT_FOUND',\n\tASSET_SOURCE_ALREADY_SET = 'ASSET_SOURCE_ALREADY_SET',\n\tASSET_SOURCE_MISSING = 'ASSET_SOURCE_MISSING',\n\tBAD_LOADER = 'BAD_LOADER',\n\tCANNOT_EMIT_FROM_OPTIONS_HOOK = 'CANNOT_EMIT_FROM_OPTIONS_HOOK',\n\tCHUNK_NOT_GENERATED = 'CHUNK_NOT_GENERATED',\n\tCHUNK_INVALID = 'CHUNK_INVALID',\n\tCIRCULAR_REEXPORT = 'CIRCULAR_REEXPORT',\n\tCYCLIC_CROSS_CHUNK_REEXPORT = 'CYCLIC_CROSS_CHUNK_REEXPORT',\n\tDEPRECATED_FEATURE = 'DEPRECATED_FEATURE',\n\tEXTERNAL_SYNTHETIC_EXPORTS = 'EXTERNAL_SYNTHETIC_EXPORTS',\n\tFILE_NAME_CONFLICT = 'FILE_NAME_CONFLICT',\n\tFILE_NOT_FOUND = 'FILE_NOT_FOUND',\n\tINPUT_HOOK_IN_OUTPUT_PLUGIN = 'INPUT_HOOK_IN_OUTPUT_PLUGIN',\n\tINVALID_CHUNK = 'INVALID_CHUNK',\n\tINVALID_EXPORT_OPTION = 'INVALID_EXPORT_OPTION',\n\tINVALID_EXTERNAL_ID = 'INVALID_EXTERNAL_ID',\n\tINVALID_OPTION = 'INVALID_OPTION',\n\tINVALID_PLUGIN_HOOK = 'INVALID_PLUGIN_HOOK',\n\tINVALID_ROLLUP_PHASE = 'INVALID_ROLLUP_PHASE',\n\tMISSING_EXPORT = 'MISSING_EXPORT',\n\tMISSING_IMPLICIT_DEPENDANT = 'MISSING_IMPLICIT_DEPENDANT',\n\tMIXED_EXPORTS = 'MIXED_EXPORTS',\n\tNAMESPACE_CONFLICT = 'NAMESPACE_CONFLICT',\n\tAMBIGUOUS_EXTERNAL_NAMESPACES = 'AMBIGUOUS_EXTERNAL_NAMESPACES',\n\tNO_TRANSFORM_MAP_OR_AST_WITHOUT_CODE = 'NO_TRANSFORM_MAP_OR_AST_WITHOUT_CODE',\n\tPLUGIN_ERROR = 'PLUGIN_ERROR',\n\tPREFER_NAMED_EXPORTS = 'PREFER_NAMED_EXPORTS',\n\tSYNTHETIC_NAMED_EXPORTS_NEED_NAMESPACE_EXPORT = 'SYNTHETIC_NAMED_EXPORTS_NEED_NAMESPACE_EXPORT',\n\tUNEXPECTED_NAMED_IMPORT = 'UNEXPECTED_NAMED_IMPORT',\n\tUNRESOLVED_ENTRY = 'UNRESOLVED_ENTRY',\n\tUNRESOLVED_IMPORT = 'UNRESOLVED_IMPORT',\n\tVALIDATION_ERROR = 'VALIDATION_ERROR'\n}\n\nexport function errAssetNotFinalisedForFileName(name: string): RollupLogProps {\n\treturn {\n\t\tcode: Errors.ASSET_NOT_FINALISED,\n\t\tmessage: `Plugin error - Unable to get file name for asset \"${name}\". Ensure that the source is set and that generate is called first.`\n\t};\n}\n\nexport function errCannotEmitFromOptionsHook(): RollupLogProps {\n\treturn {\n\t\tcode: Errors.CANNOT_EMIT_FROM_OPTIONS_HOOK,\n\t\tmessage: `Cannot emit files or set asset sources in the \"outputOptions\" hook, use the \"renderStart\" hook instead.`\n\t};\n}\n\nexport function errChunkNotGeneratedForFileName(name: string): RollupLogProps {\n\treturn {\n\t\tcode: Errors.CHUNK_NOT_GENERATED,\n\t\tmessage: `Plugin error - Unable to get file name for chunk \"${name}\". Ensure that generate is called first.`\n\t};\n}\n\nexport function errChunkInvalid(\n\t{ fileName, code }: { code: string; fileName: string },\n\texception: { loc: { column: number; line: number }; message: string }\n): RollupLogProps {\n\tconst errorProps = {\n\t\tcode: Errors.CHUNK_INVALID,\n\t\tmessage: `Chunk \"${fileName}\" is not valid JavaScript: ${exception.message}.`\n\t};\n\taugmentCodeLocation(errorProps, exception.loc, code, fileName);\n\treturn errorProps;\n}\n\nexport function errCircularReexport(exportName: string, importedModule: string): RollupLogProps {\n\treturn {\n\t\tcode: Errors.CIRCULAR_REEXPORT,\n\t\tid: importedModule,\n\t\tmessage: `\"${exportName}\" cannot be exported from ${relativeId(\n\t\t\timportedModule\n\t\t)} as it is a reexport that references itself.`\n\t};\n}\n\nexport function errCyclicCrossChunkReexport(\n\texportName: string,\n\texporter: string,\n\treexporter: string,\n\timporter: string\n): RollupWarning {\n\treturn {\n\t\tcode: Errors.CYCLIC_CROSS_CHUNK_REEXPORT,\n\t\texporter,\n\t\timporter,\n\t\tmessage: `Export \"${exportName}\" of module ${relativeId(\n\t\t\texporter\n\t\t)} was reexported through module ${relativeId(\n\t\t\treexporter\n\t\t)} while both modules are dependencies of each other and will end up in different chunks by current Rollup settings. This scenario is not well supported at the moment as it will produce a circular dependency between chunks and will likely lead to broken execution order.\\nEither change the import in ${relativeId(\n\t\t\timporter\n\t\t)} to point directly to the exporting module or do not use \"preserveModules\" to ensure these modules end up in the same chunk.`,\n\t\treexporter\n\t};\n}\n\nexport function errAssetReferenceIdNotFoundForSetSource(assetReferenceId: string): RollupLogProps {\n\treturn {\n\t\tcode: Errors.ASSET_NOT_FOUND,\n\t\tmessage: `Plugin error - Unable to set the source for unknown asset \"${assetReferenceId}\".`\n\t};\n}\n\nexport function errAssetSourceAlreadySet(name: string): RollupLogProps {\n\treturn {\n\t\tcode: Errors.ASSET_SOURCE_ALREADY_SET,\n\t\tmessage: `Unable to set the source for asset \"${name}\", source already set.`\n\t};\n}\n\nexport function errNoAssetSourceSet(assetName: string): RollupLogProps {\n\treturn {\n\t\tcode: Errors.ASSET_SOURCE_MISSING,\n\t\tmessage: `Plugin error creating asset \"${assetName}\" - no asset source set.`\n\t};\n}\n\nexport function errBadLoader(id: string): RollupLogProps {\n\treturn {\n\t\tcode: Errors.BAD_LOADER,\n\t\tmessage: `Error loading ${relativeId(\n\t\t\tid\n\t\t)}: plugin load hook should return a string, a { code, map } object, or nothing/null`\n\t};\n}\n\nexport function errDeprecation(deprecation: string | RollupWarning): RollupLogProps {\n\treturn {\n\t\tcode: Errors.DEPRECATED_FEATURE,\n\t\t...(typeof deprecation === 'string' ? { message: deprecation } : deprecation)\n\t};\n}\n\nexport function errFileReferenceIdNotFoundForFilename(assetReferenceId: string): RollupLogProps {\n\treturn {\n\t\tcode: Errors.FILE_NOT_FOUND,\n\t\tmessage: `Plugin error - Unable to get file name for unknown file \"${assetReferenceId}\".`\n\t};\n}\n\nexport function errFileNameConflict(fileName: string): RollupLogProps {\n\treturn {\n\t\tcode: Errors.FILE_NAME_CONFLICT,\n\t\tmessage: `The emitted file \"${fileName}\" overwrites a previously emitted file of the same name.`\n\t};\n}\n\nexport function errInputHookInOutputPlugin(pluginName: string, hookName: string): RollupLogProps {\n\treturn {\n\t\tcode: Errors.INPUT_HOOK_IN_OUTPUT_PLUGIN,\n\t\tmessage: `The \"${hookName}\" hook used by the output plugin ${pluginName} is a build time hook and will not be run for that plugin. Either this plugin cannot be used as an output plugin, or it should have an option to configure it as an output plugin.`\n\t};\n}\n\nexport function errCannotAssignModuleToChunk(\n\tmoduleId: string,\n\tassignToAlias: string,\n\tcurrentAlias: string\n): RollupLogProps {\n\treturn {\n\t\tcode: Errors.INVALID_CHUNK,\n\t\tmessage: `Cannot assign ${relativeId(\n\t\t\tmoduleId\n\t\t)} to the \"${assignToAlias}\" chunk as it is already in the \"${currentAlias}\" chunk.`\n\t};\n}\n\nexport function errInvalidExportOptionValue(optionValue: string): RollupLogProps {\n\treturn {\n\t\tcode: Errors.INVALID_EXPORT_OPTION,\n\t\tmessage: `\"output.exports\" must be \"default\", \"named\", \"none\", \"auto\", or left unspecified (defaults to \"auto\"), received \"${optionValue}\"`,\n\t\turl: `https://rollupjs.org/guide/en/#outputexports`\n\t};\n}\n\nexport function errIncompatibleExportOptionValue(\n\toptionValue: string,\n\tkeys: readonly string[],\n\tentryModule: string\n): RollupLogProps {\n\treturn {\n\t\tcode: 'INVALID_EXPORT_OPTION',\n\t\tmessage: `\"${optionValue}\" was specified for \"output.exports\", but entry module \"${relativeId(\n\t\t\tentryModule\n\t\t)}\" has the following exports: ${keys.join(', ')}`\n\t};\n}\n\nexport function errInternalIdCannotBeExternal(source: string, importer: string): RollupLogProps {\n\treturn {\n\t\tcode: Errors.INVALID_EXTERNAL_ID,\n\t\tmessage: `'${source}' is imported as an external by ${relativeId(\n\t\t\timporter\n\t\t)}, but is already an existing non-external module id.`\n\t};\n}\n\nexport function errInvalidOption(\n\toption: string,\n\turlHash: string,\n\texplanation: string,\n\tvalue?: string | boolean | null\n): RollupLogProps {\n\treturn {\n\t\tcode: Errors.INVALID_OPTION,\n\t\tmessage: `Invalid value ${\n\t\t\tvalue !== undefined ? `${JSON.stringify(value)} ` : ''\n\t\t}for option \"${option}\" - ${explanation}.`,\n\t\turl: `https://rollupjs.org/guide/en/#${urlHash}`\n\t};\n}\n\nexport function errInvalidAddonPluginHook(hook: string, plugin: string): RollupLogProps {\n\treturn {\n\t\tcode: Errors.INVALID_PLUGIN_HOOK,\n\t\thook,\n\t\tmessage: `Error running plugin hook ${hook} for plugin ${plugin}, expected a string, a function hook or an object with a \"handler\" string or function.`,\n\t\tplugin\n\t};\n}\n\nexport function errInvalidFunctionPluginHook(hook: string, plugin: string): RollupLogProps {\n\treturn {\n\t\tcode: Errors.INVALID_PLUGIN_HOOK,\n\t\thook,\n\t\tmessage: `Error running plugin hook ${hook} for plugin ${plugin}, expected a function hook or an object with a \"handler\" function.`,\n\t\tplugin\n\t};\n}\n\nexport function errInvalidRollupPhaseForAddWatchFile(): RollupLogProps {\n\treturn {\n\t\tcode: Errors.INVALID_ROLLUP_PHASE,\n\t\tmessage: `Cannot call addWatchFile after the build has finished.`\n\t};\n}\n\nexport function errInvalidRollupPhaseForChunkEmission(): RollupLogProps {\n\treturn {\n\t\tcode: Errors.INVALID_ROLLUP_PHASE,\n\t\tmessage: `Cannot emit chunks after module loading has finished.`\n\t};\n}\n\nexport function errMissingExport(\n\texportName: string,\n\timportingModule: string,\n\timportedModule: string\n): RollupLogProps {\n\treturn {\n\t\tcode: Errors.MISSING_EXPORT,\n\t\tmessage: `'${exportName}' is not exported by ${relativeId(\n\t\t\timportedModule\n\t\t)}, imported by ${relativeId(importingModule)}`,\n\t\turl: `https://rollupjs.org/guide/en/#error-name-is-not-exported-by-module`\n\t};\n}\n\nexport function errImplicitDependantCannotBeExternal(\n\tunresolvedId: string,\n\timplicitlyLoadedBefore: string\n): RollupLogProps {\n\treturn {\n\t\tcode: Errors.MISSING_IMPLICIT_DEPENDANT,\n\t\tmessage: `Module \"${relativeId(\n\t\t\tunresolvedId\n\t\t)}\" that should be implicitly loaded before \"${relativeId(\n\t\t\timplicitlyLoadedBefore\n\t\t)}\" cannot be external.`\n\t};\n}\n\nexport function errUnresolvedImplicitDependant(\n\tunresolvedId: string,\n\timplicitlyLoadedBefore: string\n): RollupLogProps {\n\treturn {\n\t\tcode: Errors.MISSING_IMPLICIT_DEPENDANT,\n\t\tmessage: `Module \"${relativeId(\n\t\t\tunresolvedId\n\t\t)}\" that should be implicitly loaded before \"${relativeId(\n\t\t\timplicitlyLoadedBefore\n\t\t)}\" could not be resolved.`\n\t};\n}\n\nexport function errImplicitDependantIsNotIncluded(module: Module): RollupLogProps {\n\tconst implicitDependencies = Array.from(module.implicitlyLoadedBefore, dependency =>\n\t\trelativeId(dependency.id)\n\t).sort();\n\treturn {\n\t\tcode: Errors.MISSING_IMPLICIT_DEPENDANT,\n\t\tmessage: `Module \"${relativeId(\n\t\t\tmodule.id\n\t\t)}\" that should be implicitly loaded before ${printQuotedStringList(\n\t\t\timplicitDependencies\n\t\t)} is not included in the module graph. Either it was not imported by an included module or only via a tree-shaken dynamic import, or no imported bindings were used and it had otherwise no side-effects.`\n\t};\n}\n\nexport function errMixedExport(facadeModuleId: string, name?: string): RollupLogProps {\n\treturn {\n\t\tcode: Errors.MIXED_EXPORTS,\n\t\tid: facadeModuleId,\n\t\tmessage: `Entry module \"${relativeId(\n\t\t\tfacadeModuleId\n\t\t)}\" is using named and default exports together. Consumers of your bundle will have to use \\`${\n\t\t\tname || 'chunk'\n\t\t}[\"default\"]\\` to access the default export, which may not be what you want. Use \\`output.exports: \"named\"\\` to disable this warning`,\n\t\turl: `https://rollupjs.org/guide/en/#outputexports`\n\t};\n}\n\nexport function errNamespaceConflict(\n\tname: string,\n\treexportingModuleId: string,\n\tsources: string[]\n): RollupWarning {\n\treturn {\n\t\tcode: Errors.NAMESPACE_CONFLICT,\n\t\tmessage: `Conflicting namespaces: \"${relativeId(\n\t\t\treexportingModuleId\n\t\t)}\" re-exports \"${name}\" from one of the modules ${printQuotedStringList(\n\t\t\tsources.map(moduleId => relativeId(moduleId))\n\t\t)} (will be ignored)`,\n\t\tname,\n\t\treexporter: reexportingModuleId,\n\t\tsources\n\t};\n}\n\nexport function errAmbiguousExternalNamespaces(\n\tname: string,\n\treexportingModule: string,\n\tusedModule: string,\n\tsources: string[]\n): RollupWarning {\n\treturn {\n\t\tcode: Errors.AMBIGUOUS_EXTERNAL_NAMESPACES,\n\t\tmessage: `Ambiguous external namespace resolution: \"${relativeId(\n\t\t\treexportingModule\n\t\t)}\" re-exports \"${name}\" from one of the external modules ${printQuotedStringList(\n\t\t\tsources.map(module => relativeId(module))\n\t\t)}, guessing \"${relativeId(usedModule)}\".`,\n\t\tname,\n\t\treexporter: reexportingModule,\n\t\tsources\n\t};\n}\n\nexport function errNoTransformMapOrAstWithoutCode(pluginName: string): RollupLogProps {\n\treturn {\n\t\tcode: Errors.NO_TRANSFORM_MAP_OR_AST_WITHOUT_CODE,\n\t\tmessage:\n\t\t\t`The plugin \"${pluginName}\" returned a \"map\" or \"ast\" without returning ` +\n\t\t\t'a \"code\". This will be ignored.'\n\t};\n}\n\nexport function errPreferNamedExports(facadeModuleId: string): RollupLogProps {\n\tconst file = relativeId(facadeModuleId);\n\treturn {\n\t\tcode: Errors.PREFER_NAMED_EXPORTS,\n\t\tid: facadeModuleId,\n\t\tmessage: `Entry module \"${file}\" is implicitly using \"default\" export mode, which means for CommonJS output that its default export is assigned to \"module.exports\". For many tools, such CommonJS output will not be interchangeable with the original ES module. If this is intended, explicitly set \"output.exports\" to either \"auto\" or \"default\", otherwise you might want to consider changing the signature of \"${file}\" to use named exports only.`,\n\t\turl: `https://rollupjs.org/guide/en/#outputexports`\n\t};\n}\n\nexport function errSyntheticNamedExportsNeedNamespaceExport(\n\tid: string,\n\tsyntheticNamedExportsOption: boolean | string\n): RollupLogProps {\n\treturn {\n\t\tcode: Errors.SYNTHETIC_NAMED_EXPORTS_NEED_NAMESPACE_EXPORT,\n\t\tid,\n\t\tmessage: `Module \"${relativeId(\n\t\t\tid\n\t\t)}\" that is marked with 'syntheticNamedExports: ${JSON.stringify(\n\t\t\tsyntheticNamedExportsOption\n\t\t)}' needs ${\n\t\t\ttypeof syntheticNamedExportsOption === 'string' && syntheticNamedExportsOption !== 'default'\n\t\t\t\t? `an explicit export named \"${syntheticNamedExportsOption}\"`\n\t\t\t\t: 'a default export'\n\t\t} that does not reexport an unresolved named export of the same module.`\n\t};\n}\n\nexport function errUnexpectedNamedImport(\n\tid: string,\n\timported: string,\n\tisReexport: boolean\n): RollupLogProps {\n\tconst importType = isReexport ? 'reexport' : 'import';\n\treturn {\n\t\tcode: Errors.UNEXPECTED_NAMED_IMPORT,\n\t\tid,\n\t\tmessage: `The named export \"${imported}\" was ${importType}ed from the external module ${relativeId(\n\t\t\tid\n\t\t)} even though its interop type is \"defaultOnly\". Either remove or change this ${importType} or change the value of the \"output.interop\" option.`,\n\t\turl: 'https://rollupjs.org/guide/en/#outputinterop'\n\t};\n}\n\nexport function errUnexpectedNamespaceReexport(id: string): RollupLogProps {\n\treturn {\n\t\tcode: Errors.UNEXPECTED_NAMED_IMPORT,\n\t\tid,\n\t\tmessage: `There was a namespace \"*\" reexport from the external module ${relativeId(\n\t\t\tid\n\t\t)} even though its interop type is \"defaultOnly\". This will be ignored as namespace reexports only reexport named exports. If this is not intended, either remove or change this reexport or change the value of the \"output.interop\" option.`,\n\t\turl: 'https://rollupjs.org/guide/en/#outputinterop'\n\t};\n}\n\nexport function errEntryCannotBeExternal(unresolvedId: string): RollupLogProps {\n\treturn {\n\t\tcode: Errors.UNRESOLVED_ENTRY,\n\t\tmessage: `Entry module cannot be external (${relativeId(unresolvedId)}).`\n\t};\n}\n\nexport function errUnresolvedEntry(unresolvedId: string): RollupLogProps {\n\treturn {\n\t\tcode: Errors.UNRESOLVED_ENTRY,\n\t\tmessage: `Could not resolve entry module (${relativeId(unresolvedId)}).`\n\t};\n}\n\nexport function errUnresolvedImport(source: string, importer: string): RollupLogProps {\n\treturn {\n\t\tcode: Errors.UNRESOLVED_IMPORT,\n\t\tmessage: `Could not resolve '${source}' from ${relativeId(importer)}`\n\t};\n}\n\nexport function errUnresolvedImportTreatedAsExternal(\n\tsource: string,\n\timporter: string\n): RollupWarning {\n\treturn {\n\t\tcode: Errors.UNRESOLVED_IMPORT,\n\t\timporter: relativeId(importer),\n\t\tmessage: `'${source}' is imported by ${relativeId(\n\t\t\timporter\n\t\t)}, but could not be resolved – treating it as an external dependency`,\n\t\tsource,\n\t\turl: 'https://rollupjs.org/guide/en/#warning-treating-module-as-external-dependency'\n\t};\n}\n\nexport function errExternalSyntheticExports(source: string, importer: string): RollupWarning {\n\treturn {\n\t\tcode: Errors.EXTERNAL_SYNTHETIC_EXPORTS,\n\t\timporter: relativeId(importer),\n\t\tmessage: `External '${source}' can not have 'syntheticNamedExports' enabled.`,\n\t\tsource\n\t};\n}\n\nexport function errFailedValidation(message: string): RollupLogProps {\n\treturn {\n\t\tcode: Errors.VALIDATION_ERROR,\n\t\tmessage\n\t};\n}\n\nexport function errAlreadyClosed(): RollupLogProps {\n\treturn {\n\t\tcode: Errors.ALREADY_CLOSED,\n\t\tmessage: 'Bundle is already closed, no more calls to \"generate\" or \"write\" are allowed.'\n\t};\n}\n\nexport function warnDeprecation(\n\tdeprecation: string | RollupWarning,\n\tactiveDeprecation: boolean,\n\toptions: NormalizedInputOptions\n): void {\n\twarnDeprecationWithOptions(\n\t\tdeprecation,\n\t\tactiveDeprecation,\n\t\toptions.onwarn,\n\t\toptions.strictDeprecations\n\t);\n}\n\nexport function warnDeprecationWithOptions(\n\tdeprecation: string | RollupWarning,\n\tactiveDeprecation: boolean,\n\twarn: WarningHandler,\n\tstrictDeprecations: boolean\n): void {\n\tif (activeDeprecation || strictDeprecations) {\n\t\tconst warning = errDeprecation(deprecation);\n\t\tif (strictDeprecations) {\n\t\t\treturn error(warning);\n\t\t}\n\t\twarn(warning);\n\t}\n}\n","const RESERVED_NAMES: ReadonlySet = new Set([\n\t'await',\n\t'break',\n\t'case',\n\t'catch',\n\t'class',\n\t'const',\n\t'continue',\n\t'debugger',\n\t'default',\n\t'delete',\n\t'do',\n\t'else',\n\t'enum',\n\t'eval',\n\t'export',\n\t'extends',\n\t'false',\n\t'finally',\n\t'for',\n\t'function',\n\t'if',\n\t'implements',\n\t'import',\n\t'in',\n\t'instanceof',\n\t'interface',\n\t'let',\n\t'NaN',\n\t'new',\n\t'null',\n\t'package',\n\t'private',\n\t'protected',\n\t'public',\n\t'return',\n\t'static',\n\t'super',\n\t'switch',\n\t'this',\n\t'throw',\n\t'true',\n\t'try',\n\t'typeof',\n\t'undefined',\n\t'var',\n\t'void',\n\t'while',\n\t'with',\n\t'yield'\n]);\n\nexport default RESERVED_NAMES;\n","import RESERVED_NAMES from './RESERVED_NAMES';\n\nconst illegalCharacters = /[^$_a-zA-Z0-9]/g;\n\nconst startsWithDigit = (str: string): boolean => /\\d/.test(str[0]);\n\nconst needsEscape = (str: string) =>\n\tstartsWithDigit(str) || RESERVED_NAMES.has(str) || str === 'arguments';\n\nexport function isLegal(str: string): boolean {\n\tif (needsEscape(str)) {\n\t\treturn false;\n\t}\n\treturn !illegalCharacters.test(str);\n}\n\nexport function makeLegal(str: string): string {\n\tstr = str.replace(/-(\\w)/g, (_, letter) => letter.toUpperCase()).replace(illegalCharacters, '_');\n\n\tif (needsEscape(str)) str = `_${str}`;\n\n\treturn str || '_';\n}\n","import ExternalVariable from './ast/variables/ExternalVariable';\nimport type {\n\tCustomPluginOptions,\n\tModuleInfo,\n\tNormalizedInputOptions,\n\tNormalizedOutputOptions\n} from './rollup/types';\nimport { EMPTY_ARRAY } from './utils/blank';\nimport { warnDeprecation } from './utils/error';\nimport { makeLegal } from './utils/identifierHelpers';\nimport { normalize, relative } from './utils/path';\nimport { printQuotedStringList } from './utils/printStringList';\nimport relativeId from './utils/relativeId';\n\nexport default class ExternalModule {\n\treadonly declarations = new Map();\n\tdefaultVariableName = '';\n\treadonly dynamicImporters: string[] = [];\n\texecIndex = Infinity;\n\treadonly exportedVariables = new Map();\n\treadonly importers: string[] = [];\n\treadonly info: ModuleInfo;\n\tmostCommonSuggestion = 0;\n\treadonly nameSuggestions = new Map();\n\tnamespaceVariableName = '';\n\treexported = false;\n\trenderPath: string = undefined as never;\n\tsuggestedVariableName: string;\n\tused = false;\n\tvariableName = '';\n\n\tconstructor(\n\t\tprivate readonly options: NormalizedInputOptions,\n\t\tpublic readonly id: string,\n\t\tmoduleSideEffects: boolean | 'no-treeshake',\n\t\tmeta: CustomPluginOptions,\n\t\tpublic readonly renormalizeRenderPath: boolean\n\t) {\n\t\tthis.suggestedVariableName = makeLegal(id.split(/[\\\\/]/).pop()!);\n\n\t\tconst { importers, dynamicImporters } = this;\n\t\tconst info: ModuleInfo = (this.info = {\n\t\t\tast: null,\n\t\t\tcode: null,\n\t\t\tdynamicallyImportedIdResolutions: EMPTY_ARRAY,\n\t\t\tdynamicallyImportedIds: EMPTY_ARRAY,\n\t\t\tget dynamicImporters() {\n\t\t\t\treturn dynamicImporters.sort();\n\t\t\t},\n\t\t\thasDefaultExport: null,\n\t\t\tget hasModuleSideEffects() {\n\t\t\t\twarnDeprecation(\n\t\t\t\t\t'Accessing ModuleInfo.hasModuleSideEffects from plugins is deprecated. Please use ModuleInfo.moduleSideEffects instead.',\n\t\t\t\t\tfalse,\n\t\t\t\t\toptions\n\t\t\t\t);\n\t\t\t\treturn info.moduleSideEffects;\n\t\t\t},\n\t\t\tid,\n\t\t\timplicitlyLoadedAfterOneOf: EMPTY_ARRAY,\n\t\t\timplicitlyLoadedBefore: EMPTY_ARRAY,\n\t\t\timportedIdResolutions: EMPTY_ARRAY,\n\t\t\timportedIds: EMPTY_ARRAY,\n\t\t\tget importers() {\n\t\t\t\treturn importers.sort();\n\t\t\t},\n\t\t\tisEntry: false,\n\t\t\tisExternal: true,\n\t\t\tisIncluded: null,\n\t\t\tmeta,\n\t\t\tmoduleSideEffects,\n\t\t\tsyntheticNamedExports: false\n\t\t});\n\t\t// Hide the deprecated key so that it only warns when accessed explicitly\n\t\tObject.defineProperty(this.info, 'hasModuleSideEffects', {\n\t\t\tenumerable: false\n\t\t});\n\t}\n\n\tgetVariableForExportName(name: string): [variable: ExternalVariable] {\n\t\tconst declaration = this.declarations.get(name);\n\t\tif (declaration) return [declaration];\n\t\tconst externalVariable = new ExternalVariable(this, name);\n\n\t\tthis.declarations.set(name, externalVariable);\n\t\tthis.exportedVariables.set(externalVariable, name);\n\t\treturn [externalVariable];\n\t}\n\n\tsetRenderPath(options: NormalizedOutputOptions, inputBase: string): void {\n\t\tthis.renderPath =\n\t\t\ttypeof options.paths === 'function' ? options.paths(this.id) : options.paths[this.id];\n\t\tif (!this.renderPath) {\n\t\t\tthis.renderPath = this.renormalizeRenderPath\n\t\t\t\t? normalize(relative(inputBase, this.id))\n\t\t\t\t: this.id;\n\t\t}\n\t}\n\n\tsuggestName(name: string): void {\n\t\tconst value = (this.nameSuggestions.get(name) ?? 0) + 1;\n\t\tthis.nameSuggestions.set(name, value);\n\n\t\tif (value > this.mostCommonSuggestion) {\n\t\t\tthis.mostCommonSuggestion = value;\n\t\t\tthis.suggestedVariableName = name;\n\t\t}\n\t}\n\n\twarnUnusedImports(): void {\n\t\tconst unused = Array.from(this.declarations)\n\t\t\t.filter(\n\t\t\t\t([name, declaration]) =>\n\t\t\t\t\tname !== '*' && !declaration.included && !this.reexported && !declaration.referenced\n\t\t\t)\n\t\t\t.map(([name]) => name);\n\n\t\tif (unused.length === 0) return;\n\n\t\tconst importersSet = new Set();\n\t\tfor (const name of unused) {\n\t\t\tfor (const importer of this.declarations.get(name)!.module.importers) {\n\t\t\t\timportersSet.add(importer);\n\t\t\t}\n\t\t}\n\t\tconst importersArray = [...importersSet];\n\t\tthis.options.onwarn({\n\t\t\tcode: 'UNUSED_EXTERNAL_IMPORT',\n\t\t\tmessage: `${printQuotedStringList(unused, ['is', 'are'])} imported from external module \"${\n\t\t\t\tthis.id\n\t\t\t}\" but never used in ${printQuotedStringList(\n\t\t\t\timportersArray.map(importer => relativeId(importer))\n\t\t\t)}.`,\n\t\t\tnames: unused,\n\t\t\tsource: this.id,\n\t\t\tsources: importersArray\n\t\t});\n\t}\n}\n","import { extname, win32, posix, isAbsolute, resolve } from 'path';\nimport pm from 'picomatch';\n\nconst addExtension = function addExtension(filename, ext = '.js') {\n let result = `${filename}`;\n if (!extname(filename))\n result += ext;\n return result;\n};\n\nclass WalkerBase {constructor() { WalkerBase.prototype.__init.call(this);WalkerBase.prototype.__init2.call(this);WalkerBase.prototype.__init3.call(this);WalkerBase.prototype.__init4.call(this); }\n\t __init() {this.should_skip = false;}\n\t __init2() {this.should_remove = false;}\n\t __init3() {this.replacement = null;}\n\n\t __init4() {this.context = {\n\t\tskip: () => (this.should_skip = true),\n\t\tremove: () => (this.should_remove = true),\n\t\treplace: (node) => (this.replacement = node)\n\t};}\n\n\t replace(parent, prop, index, node) {\n\t\tif (parent) {\n\t\t\tif (index !== null) {\n\t\t\t\tparent[prop][index] = node;\n\t\t\t} else {\n\t\t\t\tparent[prop] = node;\n\t\t\t}\n\t\t}\n\t}\n\n\t remove(parent, prop, index) {\n\t\tif (parent) {\n\t\t\tif (index !== null) {\n\t\t\t\tparent[prop].splice(index, 1);\n\t\t\t} else {\n\t\t\t\tdelete parent[prop];\n\t\t\t}\n\t\t}\n\t}\n}\n\nclass SyncWalkerClass extends WalkerBase {\n\t\n\t\n\n\tconstructor(walker) {\n\t\tsuper();\n\t\tthis.enter = walker.enter;\n\t\tthis.leave = walker.leave;\n\t}\n\n\t visit(\n\t\tnode,\n\t\tparent,\n\t\tenter,\n\t\tleave,\n\t\tprop,\n\t\tindex\n\t) {\n\t\tif (node) {\n\t\t\tif (enter) {\n\t\t\t\tconst _should_skip = this.should_skip;\n\t\t\t\tconst _should_remove = this.should_remove;\n\t\t\t\tconst _replacement = this.replacement;\n\t\t\t\tthis.should_skip = false;\n\t\t\t\tthis.should_remove = false;\n\t\t\t\tthis.replacement = null;\n\n\t\t\t\tenter.call(this.context, node, parent, prop, index);\n\n\t\t\t\tif (this.replacement) {\n\t\t\t\t\tnode = this.replacement;\n\t\t\t\t\tthis.replace(parent, prop, index, node);\n\t\t\t\t}\n\n\t\t\t\tif (this.should_remove) {\n\t\t\t\t\tthis.remove(parent, prop, index);\n\t\t\t\t}\n\n\t\t\t\tconst skipped = this.should_skip;\n\t\t\t\tconst removed = this.should_remove;\n\n\t\t\t\tthis.should_skip = _should_skip;\n\t\t\t\tthis.should_remove = _should_remove;\n\t\t\t\tthis.replacement = _replacement;\n\n\t\t\t\tif (skipped) return node;\n\t\t\t\tif (removed) return null;\n\t\t\t}\n\n\t\t\tfor (const key in node) {\n\t\t\t\tconst value = (node )[key];\n\n\t\t\t\tif (typeof value !== \"object\") {\n\t\t\t\t\tcontinue;\n\t\t\t\t} else if (Array.isArray(value)) {\n\t\t\t\t\tfor (let i = 0; i < value.length; i += 1) {\n\t\t\t\t\t\tif (value[i] !== null && typeof value[i].type === 'string') {\n\t\t\t\t\t\t\tif (!this.visit(value[i], node, enter, leave, key, i)) {\n\t\t\t\t\t\t\t\t// removed\n\t\t\t\t\t\t\t\ti--;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else if (value !== null && typeof value.type === \"string\") {\n\t\t\t\t\tthis.visit(value, node, enter, leave, key, null);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (leave) {\n\t\t\t\tconst _replacement = this.replacement;\n\t\t\t\tconst _should_remove = this.should_remove;\n\t\t\t\tthis.replacement = null;\n\t\t\t\tthis.should_remove = false;\n\n\t\t\t\tleave.call(this.context, node, parent, prop, index);\n\n\t\t\t\tif (this.replacement) {\n\t\t\t\t\tnode = this.replacement;\n\t\t\t\t\tthis.replace(parent, prop, index, node);\n\t\t\t\t}\n\n\t\t\t\tif (this.should_remove) {\n\t\t\t\t\tthis.remove(parent, prop, index);\n\t\t\t\t}\n\n\t\t\t\tconst removed = this.should_remove;\n\n\t\t\t\tthis.replacement = _replacement;\n\t\t\t\tthis.should_remove = _should_remove;\n\n\t\t\t\tif (removed) return null;\n\t\t\t}\n\t\t}\n\n\t\treturn node;\n\t}\n}\n\nfunction walk(ast, walker) {\n\tconst instance = new SyncWalkerClass(walker);\n\treturn instance.visit(ast, null, walker.enter, walker.leave);\n}\n\nconst extractors = {\n ArrayPattern(names, param) {\n for (const element of param.elements) {\n if (element)\n extractors[element.type](names, element);\n }\n },\n AssignmentPattern(names, param) {\n extractors[param.left.type](names, param.left);\n },\n Identifier(names, param) {\n names.push(param.name);\n },\n MemberExpression() { },\n ObjectPattern(names, param) {\n for (const prop of param.properties) {\n // @ts-ignore Typescript reports that this is not a valid type\n if (prop.type === 'RestElement') {\n extractors.RestElement(names, prop);\n }\n else {\n extractors[prop.value.type](names, prop.value);\n }\n }\n },\n RestElement(names, param) {\n extractors[param.argument.type](names, param.argument);\n }\n};\nconst extractAssignedNames = function extractAssignedNames(param) {\n const names = [];\n extractors[param.type](names, param);\n return names;\n};\n\nconst blockDeclarations = {\n const: true,\n let: true\n};\nclass Scope {\n constructor(options = {}) {\n this.parent = options.parent;\n this.isBlockScope = !!options.block;\n this.declarations = Object.create(null);\n if (options.params) {\n options.params.forEach((param) => {\n extractAssignedNames(param).forEach((name) => {\n this.declarations[name] = true;\n });\n });\n }\n }\n addDeclaration(node, isBlockDeclaration, isVar) {\n if (!isBlockDeclaration && this.isBlockScope) {\n // it's a `var` or function node, and this\n // is a block scope, so we need to go up\n this.parent.addDeclaration(node, isBlockDeclaration, isVar);\n }\n else if (node.id) {\n extractAssignedNames(node.id).forEach((name) => {\n this.declarations[name] = true;\n });\n }\n }\n contains(name) {\n return this.declarations[name] || (this.parent ? this.parent.contains(name) : false);\n }\n}\nconst attachScopes = function attachScopes(ast, propertyName = 'scope') {\n let scope = new Scope();\n walk(ast, {\n enter(n, parent) {\n const node = n;\n // function foo () {...}\n // class Foo {...}\n if (/(Function|Class)Declaration/.test(node.type)) {\n scope.addDeclaration(node, false, false);\n }\n // var foo = 1\n if (node.type === 'VariableDeclaration') {\n const { kind } = node;\n const isBlockDeclaration = blockDeclarations[kind];\n node.declarations.forEach((declaration) => {\n scope.addDeclaration(declaration, isBlockDeclaration, true);\n });\n }\n let newScope;\n // create new function scope\n if (/Function/.test(node.type)) {\n const func = node;\n newScope = new Scope({\n parent: scope,\n block: false,\n params: func.params\n });\n // named function expressions - the name is considered\n // part of the function's scope\n if (func.type === 'FunctionExpression' && func.id) {\n newScope.addDeclaration(func, false, false);\n }\n }\n // create new for scope\n if (/For(In|Of)?Statement/.test(node.type)) {\n newScope = new Scope({\n parent: scope,\n block: true\n });\n }\n // create new block scope\n if (node.type === 'BlockStatement' && !/Function/.test(parent.type)) {\n newScope = new Scope({\n parent: scope,\n block: true\n });\n }\n // catch clause has its own block scope\n if (node.type === 'CatchClause') {\n newScope = new Scope({\n parent: scope,\n params: node.param ? [node.param] : [],\n block: true\n });\n }\n if (newScope) {\n Object.defineProperty(node, propertyName, {\n value: newScope,\n configurable: true\n });\n scope = newScope;\n }\n },\n leave(n) {\n const node = n;\n if (node[propertyName])\n scope = scope.parent;\n }\n });\n return scope;\n};\n\n// Helper since Typescript can't detect readonly arrays with Array.isArray\nfunction isArray(arg) {\n return Array.isArray(arg);\n}\nfunction ensureArray(thing) {\n if (isArray(thing))\n return thing;\n if (thing == null)\n return [];\n return [thing];\n}\n\nconst normalizePath = function normalizePath(filename) {\n return filename.split(win32.sep).join(posix.sep);\n};\n\nfunction getMatcherString(id, resolutionBase) {\n if (resolutionBase === false || isAbsolute(id) || id.startsWith('*')) {\n return normalizePath(id);\n }\n // resolve('') is valid and will default to process.cwd()\n const basePath = normalizePath(resolve(resolutionBase || ''))\n // escape all possible (posix + win) path characters that might interfere with regex\n .replace(/[-^$*+?.()|[\\]{}]/g, '\\\\$&');\n // Note that we use posix.join because:\n // 1. the basePath has been normalized to use /\n // 2. the incoming glob (id) matcher, also uses /\n // otherwise Node will force backslash (\\) on windows\n return posix.join(basePath, normalizePath(id));\n}\nconst createFilter = function createFilter(include, exclude, options) {\n const resolutionBase = options && options.resolve;\n const getMatcher = (id) => id instanceof RegExp\n ? id\n : {\n test: (what) => {\n // this refactor is a tad overly verbose but makes for easy debugging\n const pattern = getMatcherString(id, resolutionBase);\n const fn = pm(pattern, { dot: true });\n const result = fn(what);\n return result;\n }\n };\n const includeMatchers = ensureArray(include).map(getMatcher);\n const excludeMatchers = ensureArray(exclude).map(getMatcher);\n return function result(id) {\n if (typeof id !== 'string')\n return false;\n if (/\\0/.test(id))\n return false;\n const pathId = normalizePath(id);\n for (let i = 0; i < excludeMatchers.length; ++i) {\n const matcher = excludeMatchers[i];\n if (matcher.test(pathId))\n return false;\n }\n for (let i = 0; i < includeMatchers.length; ++i) {\n const matcher = includeMatchers[i];\n if (matcher.test(pathId))\n return true;\n }\n return !includeMatchers.length;\n };\n};\n\nconst reservedWords = 'break case class catch const continue debugger default delete do else export extends finally for function if import in instanceof let new return super switch this throw try typeof var void while with yield enum await implements package protected static interface private public';\nconst builtins = 'arguments Infinity NaN undefined null true false eval uneval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Symbol Error EvalError InternalError RangeError ReferenceError SyntaxError TypeError URIError Number Math Date String RegExp Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array Map Set WeakMap WeakSet SIMD ArrayBuffer DataView JSON Promise Generator GeneratorFunction Reflect Proxy Intl';\nconst forbiddenIdentifiers = new Set(`${reservedWords} ${builtins}`.split(' '));\nforbiddenIdentifiers.add('');\nconst makeLegalIdentifier = function makeLegalIdentifier(str) {\n let identifier = str\n .replace(/-(\\w)/g, (_, letter) => letter.toUpperCase())\n .replace(/[^$_a-zA-Z0-9]/g, '_');\n if (/\\d/.test(identifier[0]) || forbiddenIdentifiers.has(identifier)) {\n identifier = `_${identifier}`;\n }\n return identifier || '_';\n};\n\nfunction stringify(obj) {\n return (JSON.stringify(obj) || 'undefined').replace(/[\\u2028\\u2029]/g, (char) => `\\\\u${`000${char.charCodeAt(0).toString(16)}`.slice(-4)}`);\n}\nfunction serializeArray(arr, indent, baseIndent) {\n let output = '[';\n const separator = indent ? `\\n${baseIndent}${indent}` : '';\n for (let i = 0; i < arr.length; i++) {\n const key = arr[i];\n output += `${i > 0 ? ',' : ''}${separator}${serialize(key, indent, baseIndent + indent)}`;\n }\n return `${output}${indent ? `\\n${baseIndent}` : ''}]`;\n}\nfunction serializeObject(obj, indent, baseIndent) {\n let output = '{';\n const separator = indent ? `\\n${baseIndent}${indent}` : '';\n const entries = Object.entries(obj);\n for (let i = 0; i < entries.length; i++) {\n const [key, value] = entries[i];\n const stringKey = makeLegalIdentifier(key) === key ? key : stringify(key);\n output += `${i > 0 ? ',' : ''}${separator}${stringKey}:${indent ? ' ' : ''}${serialize(value, indent, baseIndent + indent)}`;\n }\n return `${output}${indent ? `\\n${baseIndent}` : ''}}`;\n}\nfunction serialize(obj, indent, baseIndent) {\n if (typeof obj === 'object' && obj !== null) {\n if (Array.isArray(obj))\n return serializeArray(obj, indent, baseIndent);\n if (obj instanceof Date)\n return `new Date(${obj.getTime()})`;\n if (obj instanceof RegExp)\n return obj.toString();\n return serializeObject(obj, indent, baseIndent);\n }\n if (typeof obj === 'number') {\n if (obj === Infinity)\n return 'Infinity';\n if (obj === -Infinity)\n return '-Infinity';\n if (obj === 0)\n return 1 / obj === Infinity ? '0' : '-0';\n if (obj !== obj)\n return 'NaN'; // eslint-disable-line no-self-compare\n }\n if (typeof obj === 'symbol') {\n const key = Symbol.keyFor(obj);\n if (key !== undefined)\n return `Symbol.for(${stringify(key)})`;\n }\n if (typeof obj === 'bigint')\n return `${obj}n`;\n return stringify(obj);\n}\nconst dataToEsm = function dataToEsm(data, options = {}) {\n const t = options.compact ? '' : 'indent' in options ? options.indent : '\\t';\n const _ = options.compact ? '' : ' ';\n const n = options.compact ? '' : '\\n';\n const declarationType = options.preferConst ? 'const' : 'var';\n if (options.namedExports === false ||\n typeof data !== 'object' ||\n Array.isArray(data) ||\n data instanceof Date ||\n data instanceof RegExp ||\n data === null) {\n const code = serialize(data, options.compact ? null : t, '');\n const magic = _ || (/^[{[\\-\\/]/.test(code) ? '' : ' '); // eslint-disable-line no-useless-escape\n return `export default${magic}${code};`;\n }\n let namedExportCode = '';\n const defaultExportRows = [];\n for (const [key, value] of Object.entries(data)) {\n if (key === makeLegalIdentifier(key)) {\n if (options.objectShorthand)\n defaultExportRows.push(key);\n else\n defaultExportRows.push(`${key}:${_}${key}`);\n namedExportCode += `export ${declarationType} ${key}${_}=${_}${serialize(value, options.compact ? null : t, '')};${n}`;\n }\n else {\n defaultExportRows.push(`${stringify(key)}:${_}${serialize(value, options.compact ? null : t, '')}`);\n }\n }\n return `${namedExportCode}export default${_}{${n}${t}${defaultExportRows.join(`,${n}${t}`)}${n}};${n}`;\n};\n\n// TODO: remove this in next major\nvar index = {\n addExtension,\n attachScopes,\n createFilter,\n dataToEsm,\n extractAssignedNames,\n makeLegalIdentifier,\n normalizePath\n};\n\nexport { addExtension, attachScopes, createFilter, dataToEsm, index as default, extractAssignedNames, makeLegalIdentifier, normalizePath };\n","import type { Entity } from './Entity';\nimport type { ExpressionEntity } from './nodes/shared/Expression';\nimport { DiscriminatedPathTracker, PathTracker } from './utils/PathTracker';\nimport type ThisVariable from './variables/ThisVariable';\n\ninterface ExecutionContextIgnore {\n\tbreaks: boolean;\n\tcontinues: boolean;\n\tlabels: Set;\n\treturnYield: boolean;\n}\n\nexport const BROKEN_FLOW_NONE = 0;\nexport const BROKEN_FLOW_BREAK_CONTINUE = 1;\nexport const BROKEN_FLOW_ERROR_RETURN_LABEL = 2;\n\ninterface ControlFlowContext {\n\tbrokenFlow: number;\n\tincludedLabels: Set;\n}\n\nexport interface InclusionContext extends ControlFlowContext {\n\tincludedCallArguments: Set;\n}\n\nexport interface HasEffectsContext extends ControlFlowContext {\n\taccessed: PathTracker;\n\tassigned: PathTracker;\n\tbrokenFlow: number;\n\tcalled: DiscriminatedPathTracker;\n\tignore: ExecutionContextIgnore;\n\tinstantiated: DiscriminatedPathTracker;\n\treplacedVariableInits: Map;\n}\n\nexport function createInclusionContext(): InclusionContext {\n\treturn {\n\t\tbrokenFlow: BROKEN_FLOW_NONE,\n\t\tincludedCallArguments: new Set(),\n\t\tincludedLabels: new Set()\n\t};\n}\n\nexport function createHasEffectsContext(): HasEffectsContext {\n\treturn {\n\t\taccessed: new PathTracker(),\n\t\tassigned: new PathTracker(),\n\t\tbrokenFlow: BROKEN_FLOW_NONE,\n\t\tcalled: new DiscriminatedPathTracker(),\n\t\tignore: {\n\t\t\tbreaks: false,\n\t\t\tcontinues: false,\n\t\t\tlabels: new Set(),\n\t\t\treturnYield: false\n\t\t},\n\t\tincludedLabels: new Set(),\n\t\tinstantiated: new DiscriminatedPathTracker(),\n\t\treplacedVariableInits: new Map()\n\t};\n}\n","import type { HasEffectsContext } from './ExecutionContext';\nimport {\n\tINTERACTION_ACCESSED,\n\tINTERACTION_CALLED,\n\tNODE_INTERACTION_UNKNOWN_CALL,\n\tNodeInteraction,\n\tNodeInteractionCalled\n} from './NodeInteractions';\nimport type { LiteralValue } from './nodes/Literal';\nimport { ExpressionEntity, UNKNOWN_EXPRESSION } from './nodes/shared/Expression';\nimport {\n\tEMPTY_PATH,\n\ttype ObjectPath,\n\ttype ObjectPathKey,\n\tSHARED_RECURSION_TRACKER\n} from './utils/PathTracker';\n\nexport interface MemberDescription {\n\thasEffectsWhenCalled:\n\t\t| ((interaction: NodeInteractionCalled, context: HasEffectsContext) => boolean)\n\t\t| null;\n\treturns: ExpressionEntity;\n}\n\nexport interface MemberDescriptions {\n\t[key: string]: MemberDescription;\n}\n\ninterface RawMemberDescription {\n\tvalue: MemberDescription;\n}\n\nfunction assembleMemberDescriptions(\n\tmemberDescriptions: { [key: string]: RawMemberDescription },\n\tinheritedDescriptions: MemberDescriptions | null = null\n): MemberDescriptions {\n\treturn Object.create(inheritedDescriptions, memberDescriptions);\n}\n\nexport const UNDEFINED_EXPRESSION: ExpressionEntity =\n\tnew (class UndefinedExpression extends ExpressionEntity {\n\t\tgetLiteralValueAtPath() {\n\t\t\treturn undefined;\n\t\t}\n\t})();\n\nconst returnsUnknown: RawMemberDescription = {\n\tvalue: {\n\t\thasEffectsWhenCalled: null,\n\t\treturns: UNKNOWN_EXPRESSION\n\t}\n};\n\nexport const UNKNOWN_LITERAL_BOOLEAN: ExpressionEntity =\n\tnew (class UnknownBoolean extends ExpressionEntity {\n\t\tgetReturnExpressionWhenCalledAtPath(path: ObjectPath): ExpressionEntity {\n\t\t\tif (path.length === 1) {\n\t\t\t\treturn getMemberReturnExpressionWhenCalled(literalBooleanMembers, path[0]);\n\t\t\t}\n\t\t\treturn UNKNOWN_EXPRESSION;\n\t\t}\n\n\t\thasEffectsOnInteractionAtPath(\n\t\t\tpath: ObjectPath,\n\t\t\tinteraction: NodeInteraction,\n\t\t\tcontext: HasEffectsContext\n\t\t): boolean {\n\t\t\tif (interaction.type === INTERACTION_ACCESSED) {\n\t\t\t\treturn path.length > 1;\n\t\t\t}\n\t\t\tif (interaction.type === INTERACTION_CALLED && path.length === 1) {\n\t\t\t\treturn hasMemberEffectWhenCalled(literalBooleanMembers, path[0], interaction, context);\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t})();\n\nconst returnsBoolean: RawMemberDescription = {\n\tvalue: {\n\t\thasEffectsWhenCalled: null,\n\t\treturns: UNKNOWN_LITERAL_BOOLEAN\n\t}\n};\n\nexport const UNKNOWN_LITERAL_NUMBER: ExpressionEntity =\n\tnew (class UnknownNumber extends ExpressionEntity {\n\t\tgetReturnExpressionWhenCalledAtPath(path: ObjectPath): ExpressionEntity {\n\t\t\tif (path.length === 1) {\n\t\t\t\treturn getMemberReturnExpressionWhenCalled(literalNumberMembers, path[0]);\n\t\t\t}\n\t\t\treturn UNKNOWN_EXPRESSION;\n\t\t}\n\n\t\thasEffectsOnInteractionAtPath(\n\t\t\tpath: ObjectPath,\n\t\t\tinteraction: NodeInteraction,\n\t\t\tcontext: HasEffectsContext\n\t\t): boolean {\n\t\t\tif (interaction.type === INTERACTION_ACCESSED) {\n\t\t\t\treturn path.length > 1;\n\t\t\t}\n\t\t\tif (interaction.type === INTERACTION_CALLED && path.length === 1) {\n\t\t\t\treturn hasMemberEffectWhenCalled(literalNumberMembers, path[0], interaction, context);\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t})();\n\nconst returnsNumber: RawMemberDescription = {\n\tvalue: {\n\t\thasEffectsWhenCalled: null,\n\t\treturns: UNKNOWN_LITERAL_NUMBER\n\t}\n};\n\nexport const UNKNOWN_LITERAL_STRING: ExpressionEntity =\n\tnew (class UnknownString extends ExpressionEntity {\n\t\tgetReturnExpressionWhenCalledAtPath(path: ObjectPath): ExpressionEntity {\n\t\t\tif (path.length === 1) {\n\t\t\t\treturn getMemberReturnExpressionWhenCalled(literalStringMembers, path[0]);\n\t\t\t}\n\t\t\treturn UNKNOWN_EXPRESSION;\n\t\t}\n\n\t\thasEffectsOnInteractionAtPath(\n\t\t\tpath: ObjectPath,\n\t\t\tinteraction: NodeInteraction,\n\t\t\tcontext: HasEffectsContext\n\t\t): boolean {\n\t\t\tif (interaction.type === INTERACTION_ACCESSED) {\n\t\t\t\treturn path.length > 1;\n\t\t\t}\n\t\t\tif (interaction.type === INTERACTION_CALLED && path.length === 1) {\n\t\t\t\treturn hasMemberEffectWhenCalled(literalStringMembers, path[0], interaction, context);\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t})();\n\nconst returnsString: RawMemberDescription = {\n\tvalue: {\n\t\thasEffectsWhenCalled: null,\n\t\treturns: UNKNOWN_LITERAL_STRING\n\t}\n};\n\nconst stringReplace: RawMemberDescription = {\n\tvalue: {\n\t\thasEffectsWhenCalled({ args }, context) {\n\t\t\tconst arg1 = args[1];\n\t\t\treturn (\n\t\t\t\targs.length < 2 ||\n\t\t\t\t(typeof arg1.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, {\n\t\t\t\t\tdeoptimizeCache() {}\n\t\t\t\t}) === 'symbol' &&\n\t\t\t\t\targ1.hasEffectsOnInteractionAtPath(EMPTY_PATH, NODE_INTERACTION_UNKNOWN_CALL, context))\n\t\t\t);\n\t\t},\n\t\treturns: UNKNOWN_LITERAL_STRING\n\t}\n};\n\nconst objectMembers: MemberDescriptions = assembleMemberDescriptions({\n\thasOwnProperty: returnsBoolean,\n\tisPrototypeOf: returnsBoolean,\n\tpropertyIsEnumerable: returnsBoolean,\n\ttoLocaleString: returnsString,\n\ttoString: returnsString,\n\tvalueOf: returnsUnknown\n});\n\nconst literalBooleanMembers: MemberDescriptions = assembleMemberDescriptions(\n\t{\n\t\tvalueOf: returnsBoolean\n\t},\n\tobjectMembers\n);\n\nconst literalNumberMembers: MemberDescriptions = assembleMemberDescriptions(\n\t{\n\t\ttoExponential: returnsString,\n\t\ttoFixed: returnsString,\n\t\ttoLocaleString: returnsString,\n\t\ttoPrecision: returnsString,\n\t\tvalueOf: returnsNumber\n\t},\n\tobjectMembers\n);\n\nexport const literalStringMembers: MemberDescriptions = assembleMemberDescriptions(\n\t{\n\t\tanchor: returnsString,\n\n\t\tat: returnsUnknown,\n\t\tbig: returnsString,\n\t\tblink: returnsString,\n\t\tbold: returnsString,\n\t\tcharAt: returnsString,\n\t\tcharCodeAt: returnsNumber,\n\t\tcodePointAt: returnsUnknown,\n\t\tconcat: returnsString,\n\t\tendsWith: returnsBoolean,\n\t\tfixed: returnsString,\n\t\tfontcolor: returnsString,\n\t\tfontsize: returnsString,\n\t\tincludes: returnsBoolean,\n\t\tindexOf: returnsNumber,\n\t\titalics: returnsString,\n\t\tlastIndexOf: returnsNumber,\n\t\tlink: returnsString,\n\t\tlocaleCompare: returnsNumber,\n\t\tmatch: returnsUnknown,\n\t\tmatchAll: returnsUnknown,\n\t\tnormalize: returnsString,\n\t\tpadEnd: returnsString,\n\t\tpadStart: returnsString,\n\t\trepeat: returnsString,\n\t\treplace: stringReplace,\n\t\treplaceAll: stringReplace,\n\t\tsearch: returnsNumber,\n\t\tslice: returnsString,\n\t\tsmall: returnsString,\n\t\tsplit: returnsUnknown,\n\t\tstartsWith: returnsBoolean,\n\t\tstrike: returnsString,\n\t\tsub: returnsString,\n\t\tsubstr: returnsString,\n\t\tsubstring: returnsString,\n\t\tsup: returnsString,\n\t\ttoLocaleLowerCase: returnsString,\n\t\ttoLocaleUpperCase: returnsString,\n\t\ttoLowerCase: returnsString,\n\t\ttoString: returnsString, // overrides the toString() method of the Object object; it does not inherit Object.prototype.toString()\n\t\ttoUpperCase: returnsString,\n\t\ttrim: returnsString,\n\t\ttrimEnd: returnsString,\n\t\ttrimLeft: returnsString,\n\t\ttrimRight: returnsString,\n\t\ttrimStart: returnsString,\n\t\tvalueOf: returnsString\n\t},\n\tobjectMembers\n);\n\nexport function getLiteralMembersForValue(\n\tvalue: T\n): MemberDescriptions {\n\tswitch (typeof value) {\n\t\tcase 'boolean':\n\t\t\treturn literalBooleanMembers;\n\t\tcase 'number':\n\t\t\treturn literalNumberMembers;\n\t\tcase 'string':\n\t\t\treturn literalStringMembers;\n\t}\n\treturn Object.create(null);\n}\n\nexport function hasMemberEffectWhenCalled(\n\tmembers: MemberDescriptions,\n\tmemberName: ObjectPathKey,\n\tinteraction: NodeInteractionCalled,\n\tcontext: HasEffectsContext\n): boolean {\n\tif (typeof memberName !== 'string' || !members[memberName]) {\n\t\treturn true;\n\t}\n\treturn members[memberName].hasEffectsWhenCalled?.(interaction, context) || false;\n}\n\nexport function getMemberReturnExpressionWhenCalled(\n\tmembers: MemberDescriptions,\n\tmemberName: ObjectPathKey\n): ExpressionEntity {\n\tif (typeof memberName !== 'string' || !members[memberName]) return UNKNOWN_EXPRESSION;\n\treturn members[memberName].returns;\n}\n","// AST walker module for Mozilla Parser API compatible trees\n\n// A simple walk is one where you simply specify callbacks to be\n// called on specific nodes. The last two arguments are optional. A\n// simple use would be\n//\n// walk.simple(myTree, {\n// Expression: function(node) { ... }\n// });\n//\n// to do something with all expressions. All Parser API node types\n// can be used to identify node types, as well as Expression and\n// Statement, which denote categories of nodes.\n//\n// The base argument can be used to pass a custom (recursive)\n// walker, and state can be used to give this walked an initial\n// state.\n\nfunction simple(node, visitors, baseVisitor, state, override) {\n if (!baseVisitor) { baseVisitor = base\n ; }(function c(node, st, override) {\n var type = override || node.type, found = visitors[type];\n baseVisitor[type](node, st, c);\n if (found) { found(node, st); }\n })(node, state, override);\n}\n\n// An ancestor walk keeps an array of ancestor nodes (including the\n// current node) and passes them to the callback as third parameter\n// (and also as state parameter when no other state is present).\nfunction ancestor(node, visitors, baseVisitor, state, override) {\n var ancestors = [];\n if (!baseVisitor) { baseVisitor = base\n ; }(function c(node, st, override) {\n var type = override || node.type, found = visitors[type];\n var isNew = node !== ancestors[ancestors.length - 1];\n if (isNew) { ancestors.push(node); }\n baseVisitor[type](node, st, c);\n if (found) { found(node, st || ancestors, ancestors); }\n if (isNew) { ancestors.pop(); }\n })(node, state, override);\n}\n\n// A recursive walk is one where your functions override the default\n// walkers. They can modify and replace the state parameter that's\n// threaded through the walk, and can opt how and whether to walk\n// their child nodes (by calling their third argument on these\n// nodes).\nfunction recursive(node, state, funcs, baseVisitor, override) {\n var visitor = funcs ? make(funcs, baseVisitor || undefined) : baseVisitor\n ;(function c(node, st, override) {\n visitor[override || node.type](node, st, c);\n })(node, state, override);\n}\n\nfunction makeTest(test) {\n if (typeof test === \"string\")\n { return function (type) { return type === test; } }\n else if (!test)\n { return function () { return true; } }\n else\n { return test }\n}\n\nvar Found = function Found(node, state) { this.node = node; this.state = state; };\n\n// A full walk triggers the callback on each node\nfunction full(node, callback, baseVisitor, state, override) {\n if (!baseVisitor) { baseVisitor = base; }\n var last\n ;(function c(node, st, override) {\n var type = override || node.type;\n baseVisitor[type](node, st, c);\n if (last !== node) {\n callback(node, st, type);\n last = node;\n }\n })(node, state, override);\n}\n\n// An fullAncestor walk is like an ancestor walk, but triggers\n// the callback on each node\nfunction fullAncestor(node, callback, baseVisitor, state) {\n if (!baseVisitor) { baseVisitor = base; }\n var ancestors = [], last\n ;(function c(node, st, override) {\n var type = override || node.type;\n var isNew = node !== ancestors[ancestors.length - 1];\n if (isNew) { ancestors.push(node); }\n baseVisitor[type](node, st, c);\n if (last !== node) {\n callback(node, st || ancestors, ancestors, type);\n last = node;\n }\n if (isNew) { ancestors.pop(); }\n })(node, state);\n}\n\n// Find a node with a given start, end, and type (all are optional,\n// null can be used as wildcard). Returns a {node, state} object, or\n// undefined when it doesn't find a matching node.\nfunction findNodeAt(node, start, end, test, baseVisitor, state) {\n if (!baseVisitor) { baseVisitor = base; }\n test = makeTest(test);\n try {\n (function c(node, st, override) {\n var type = override || node.type;\n if ((start == null || node.start <= start) &&\n (end == null || node.end >= end))\n { baseVisitor[type](node, st, c); }\n if ((start == null || node.start === start) &&\n (end == null || node.end === end) &&\n test(type, node))\n { throw new Found(node, st) }\n })(node, state);\n } catch (e) {\n if (e instanceof Found) { return e }\n throw e\n }\n}\n\n// Find the innermost node of a given type that contains the given\n// position. Interface similar to findNodeAt.\nfunction findNodeAround(node, pos, test, baseVisitor, state) {\n test = makeTest(test);\n if (!baseVisitor) { baseVisitor = base; }\n try {\n (function c(node, st, override) {\n var type = override || node.type;\n if (node.start > pos || node.end < pos) { return }\n baseVisitor[type](node, st, c);\n if (test(type, node)) { throw new Found(node, st) }\n })(node, state);\n } catch (e) {\n if (e instanceof Found) { return e }\n throw e\n }\n}\n\n// Find the outermost matching node after a given position.\nfunction findNodeAfter(node, pos, test, baseVisitor, state) {\n test = makeTest(test);\n if (!baseVisitor) { baseVisitor = base; }\n try {\n (function c(node, st, override) {\n if (node.end < pos) { return }\n var type = override || node.type;\n if (node.start >= pos && test(type, node)) { throw new Found(node, st) }\n baseVisitor[type](node, st, c);\n })(node, state);\n } catch (e) {\n if (e instanceof Found) { return e }\n throw e\n }\n}\n\n// Find the outermost matching node before a given position.\nfunction findNodeBefore(node, pos, test, baseVisitor, state) {\n test = makeTest(test);\n if (!baseVisitor) { baseVisitor = base; }\n var max\n ;(function c(node, st, override) {\n if (node.start > pos) { return }\n var type = override || node.type;\n if (node.end <= pos && (!max || max.node.end < node.end) && test(type, node))\n { max = new Found(node, st); }\n baseVisitor[type](node, st, c);\n })(node, state);\n return max\n}\n\n// Used to create a custom walker. Will fill in all missing node\n// type properties with the defaults.\nfunction make(funcs, baseVisitor) {\n var visitor = Object.create(baseVisitor || base);\n for (var type in funcs) { visitor[type] = funcs[type]; }\n return visitor\n}\n\nfunction skipThrough(node, st, c) { c(node, st); }\nfunction ignore(_node, _st, _c) {}\n\n// Node walkers.\n\nvar base = {};\n\nbase.Program = base.BlockStatement = base.StaticBlock = function (node, st, c) {\n for (var i = 0, list = node.body; i < list.length; i += 1)\n {\n var stmt = list[i];\n\n c(stmt, st, \"Statement\");\n }\n};\nbase.Statement = skipThrough;\nbase.EmptyStatement = ignore;\nbase.ExpressionStatement = base.ParenthesizedExpression = base.ChainExpression =\n function (node, st, c) { return c(node.expression, st, \"Expression\"); };\nbase.IfStatement = function (node, st, c) {\n c(node.test, st, \"Expression\");\n c(node.consequent, st, \"Statement\");\n if (node.alternate) { c(node.alternate, st, \"Statement\"); }\n};\nbase.LabeledStatement = function (node, st, c) { return c(node.body, st, \"Statement\"); };\nbase.BreakStatement = base.ContinueStatement = ignore;\nbase.WithStatement = function (node, st, c) {\n c(node.object, st, \"Expression\");\n c(node.body, st, \"Statement\");\n};\nbase.SwitchStatement = function (node, st, c) {\n c(node.discriminant, st, \"Expression\");\n for (var i$1 = 0, list$1 = node.cases; i$1 < list$1.length; i$1 += 1) {\n var cs = list$1[i$1];\n\n if (cs.test) { c(cs.test, st, \"Expression\"); }\n for (var i = 0, list = cs.consequent; i < list.length; i += 1)\n {\n var cons = list[i];\n\n c(cons, st, \"Statement\");\n }\n }\n};\nbase.SwitchCase = function (node, st, c) {\n if (node.test) { c(node.test, st, \"Expression\"); }\n for (var i = 0, list = node.consequent; i < list.length; i += 1)\n {\n var cons = list[i];\n\n c(cons, st, \"Statement\");\n }\n};\nbase.ReturnStatement = base.YieldExpression = base.AwaitExpression = function (node, st, c) {\n if (node.argument) { c(node.argument, st, \"Expression\"); }\n};\nbase.ThrowStatement = base.SpreadElement =\n function (node, st, c) { return c(node.argument, st, \"Expression\"); };\nbase.TryStatement = function (node, st, c) {\n c(node.block, st, \"Statement\");\n if (node.handler) { c(node.handler, st); }\n if (node.finalizer) { c(node.finalizer, st, \"Statement\"); }\n};\nbase.CatchClause = function (node, st, c) {\n if (node.param) { c(node.param, st, \"Pattern\"); }\n c(node.body, st, \"Statement\");\n};\nbase.WhileStatement = base.DoWhileStatement = function (node, st, c) {\n c(node.test, st, \"Expression\");\n c(node.body, st, \"Statement\");\n};\nbase.ForStatement = function (node, st, c) {\n if (node.init) { c(node.init, st, \"ForInit\"); }\n if (node.test) { c(node.test, st, \"Expression\"); }\n if (node.update) { c(node.update, st, \"Expression\"); }\n c(node.body, st, \"Statement\");\n};\nbase.ForInStatement = base.ForOfStatement = function (node, st, c) {\n c(node.left, st, \"ForInit\");\n c(node.right, st, \"Expression\");\n c(node.body, st, \"Statement\");\n};\nbase.ForInit = function (node, st, c) {\n if (node.type === \"VariableDeclaration\") { c(node, st); }\n else { c(node, st, \"Expression\"); }\n};\nbase.DebuggerStatement = ignore;\n\nbase.FunctionDeclaration = function (node, st, c) { return c(node, st, \"Function\"); };\nbase.VariableDeclaration = function (node, st, c) {\n for (var i = 0, list = node.declarations; i < list.length; i += 1)\n {\n var decl = list[i];\n\n c(decl, st);\n }\n};\nbase.VariableDeclarator = function (node, st, c) {\n c(node.id, st, \"Pattern\");\n if (node.init) { c(node.init, st, \"Expression\"); }\n};\n\nbase.Function = function (node, st, c) {\n if (node.id) { c(node.id, st, \"Pattern\"); }\n for (var i = 0, list = node.params; i < list.length; i += 1)\n {\n var param = list[i];\n\n c(param, st, \"Pattern\");\n }\n c(node.body, st, node.expression ? \"Expression\" : \"Statement\");\n};\n\nbase.Pattern = function (node, st, c) {\n if (node.type === \"Identifier\")\n { c(node, st, \"VariablePattern\"); }\n else if (node.type === \"MemberExpression\")\n { c(node, st, \"MemberPattern\"); }\n else\n { c(node, st); }\n};\nbase.VariablePattern = ignore;\nbase.MemberPattern = skipThrough;\nbase.RestElement = function (node, st, c) { return c(node.argument, st, \"Pattern\"); };\nbase.ArrayPattern = function (node, st, c) {\n for (var i = 0, list = node.elements; i < list.length; i += 1) {\n var elt = list[i];\n\n if (elt) { c(elt, st, \"Pattern\"); }\n }\n};\nbase.ObjectPattern = function (node, st, c) {\n for (var i = 0, list = node.properties; i < list.length; i += 1) {\n var prop = list[i];\n\n if (prop.type === \"Property\") {\n if (prop.computed) { c(prop.key, st, \"Expression\"); }\n c(prop.value, st, \"Pattern\");\n } else if (prop.type === \"RestElement\") {\n c(prop.argument, st, \"Pattern\");\n }\n }\n};\n\nbase.Expression = skipThrough;\nbase.ThisExpression = base.Super = base.MetaProperty = ignore;\nbase.ArrayExpression = function (node, st, c) {\n for (var i = 0, list = node.elements; i < list.length; i += 1) {\n var elt = list[i];\n\n if (elt) { c(elt, st, \"Expression\"); }\n }\n};\nbase.ObjectExpression = function (node, st, c) {\n for (var i = 0, list = node.properties; i < list.length; i += 1)\n {\n var prop = list[i];\n\n c(prop, st);\n }\n};\nbase.FunctionExpression = base.ArrowFunctionExpression = base.FunctionDeclaration;\nbase.SequenceExpression = function (node, st, c) {\n for (var i = 0, list = node.expressions; i < list.length; i += 1)\n {\n var expr = list[i];\n\n c(expr, st, \"Expression\");\n }\n};\nbase.TemplateLiteral = function (node, st, c) {\n for (var i = 0, list = node.quasis; i < list.length; i += 1)\n {\n var quasi = list[i];\n\n c(quasi, st);\n }\n\n for (var i$1 = 0, list$1 = node.expressions; i$1 < list$1.length; i$1 += 1)\n {\n var expr = list$1[i$1];\n\n c(expr, st, \"Expression\");\n }\n};\nbase.TemplateElement = ignore;\nbase.UnaryExpression = base.UpdateExpression = function (node, st, c) {\n c(node.argument, st, \"Expression\");\n};\nbase.BinaryExpression = base.LogicalExpression = function (node, st, c) {\n c(node.left, st, \"Expression\");\n c(node.right, st, \"Expression\");\n};\nbase.AssignmentExpression = base.AssignmentPattern = function (node, st, c) {\n c(node.left, st, \"Pattern\");\n c(node.right, st, \"Expression\");\n};\nbase.ConditionalExpression = function (node, st, c) {\n c(node.test, st, \"Expression\");\n c(node.consequent, st, \"Expression\");\n c(node.alternate, st, \"Expression\");\n};\nbase.NewExpression = base.CallExpression = function (node, st, c) {\n c(node.callee, st, \"Expression\");\n if (node.arguments)\n { for (var i = 0, list = node.arguments; i < list.length; i += 1)\n {\n var arg = list[i];\n\n c(arg, st, \"Expression\");\n } }\n};\nbase.MemberExpression = function (node, st, c) {\n c(node.object, st, \"Expression\");\n if (node.computed) { c(node.property, st, \"Expression\"); }\n};\nbase.ExportNamedDeclaration = base.ExportDefaultDeclaration = function (node, st, c) {\n if (node.declaration)\n { c(node.declaration, st, node.type === \"ExportNamedDeclaration\" || node.declaration.id ? \"Statement\" : \"Expression\"); }\n if (node.source) { c(node.source, st, \"Expression\"); }\n};\nbase.ExportAllDeclaration = function (node, st, c) {\n if (node.exported)\n { c(node.exported, st); }\n c(node.source, st, \"Expression\");\n};\nbase.ImportDeclaration = function (node, st, c) {\n for (var i = 0, list = node.specifiers; i < list.length; i += 1)\n {\n var spec = list[i];\n\n c(spec, st);\n }\n c(node.source, st, \"Expression\");\n};\nbase.ImportExpression = function (node, st, c) {\n c(node.source, st, \"Expression\");\n};\nbase.ImportSpecifier = base.ImportDefaultSpecifier = base.ImportNamespaceSpecifier = base.Identifier = base.PrivateIdentifier = base.Literal = ignore;\n\nbase.TaggedTemplateExpression = function (node, st, c) {\n c(node.tag, st, \"Expression\");\n c(node.quasi, st, \"Expression\");\n};\nbase.ClassDeclaration = base.ClassExpression = function (node, st, c) { return c(node, st, \"Class\"); };\nbase.Class = function (node, st, c) {\n if (node.id) { c(node.id, st, \"Pattern\"); }\n if (node.superClass) { c(node.superClass, st, \"Expression\"); }\n c(node.body, st);\n};\nbase.ClassBody = function (node, st, c) {\n for (var i = 0, list = node.body; i < list.length; i += 1)\n {\n var elt = list[i];\n\n c(elt, st);\n }\n};\nbase.MethodDefinition = base.PropertyDefinition = base.Property = function (node, st, c) {\n if (node.computed) { c(node.key, st, \"Expression\"); }\n if (node.value) { c(node.value, st, \"Expression\"); }\n};\n\nexport { ancestor, base, findNodeAfter, findNodeAround, findNodeAt, findNodeBefore, full, fullAncestor, make, recursive, simple };\n","export type tArrayExpression = 'ArrayExpression';\nexport type tArrayPattern = 'ArrayPattern';\nexport type tArrowFunctionExpression = 'ArrowFunctionExpression';\nexport type tAssignmentExpression = 'AssignmentExpression';\nexport type tAssignmentPattern = 'AssignmentPattern';\nexport type tAwaitExpression = 'AwaitExpression';\nexport type tBinaryExpression = 'BinaryExpression';\nexport type tBlockStatement = 'BlockStatement';\nexport type tBreakStatement = 'BreakStatement';\nexport type tCallExpression = 'CallExpression';\nexport type tCatchClause = 'CatchClause';\nexport type tChainExpression = 'ChainExpression';\nexport type tClassBody = 'ClassBody';\nexport type tClassDeclaration = 'ClassDeclaration';\nexport type tClassExpression = 'ClassExpression';\nexport type tConditionalExpression = 'ConditionalExpression';\nexport type tContinueStatement = 'ContinueStatement';\nexport type tDoWhileStatement = 'DoWhileStatement';\nexport type tEmptyStatement = 'EmptyStatement';\nexport type tExportAllDeclaration = 'ExportAllDeclaration';\nexport type tExportDefaultDeclaration = 'ExportDefaultDeclaration';\nexport type tExportNamedDeclaration = 'ExportNamedDeclaration';\nexport type tExportSpecifier = 'ExportSpecifier';\nexport type tExpressionStatement = 'ExpressionStatement';\nexport type tForStatement = 'ForStatement';\nexport type tForInStatement = 'ForInStatement';\nexport type tForOfStatement = 'ForOfStatement';\nexport type tFunctionDeclaration = 'FunctionDeclaration';\nexport type tFunctionExpression = 'FunctionExpression';\nexport type tIdentifier = 'Identifier';\nexport type tIfStatement = 'IfStatement';\nexport type tImport = 'Import';\nexport type tImportDeclaration = 'ImportDeclaration';\nexport type tImportExpression = 'ImportExpression';\nexport type tImportDefaultSpecifier = 'ImportDefaultSpecifier';\nexport type tImportNamespaceSpecifier = 'ImportNamespaceSpecifier';\nexport type tImportSpecifier = 'ImportSpecifier';\nexport type tLabeledStatement = 'LabeledStatement';\nexport type tLiteral = 'Literal';\nexport type tLogicalExpression = 'LogicalExpression';\nexport type tMemberExpression = 'MemberExpression';\nexport type tMetaProperty = 'MetaProperty';\nexport type tMethodDefinition = 'MethodDefinition';\nexport type tNewExpression = 'NewExpression';\nexport type tObjectExpression = 'ObjectExpression';\nexport type tObjectPattern = 'ObjectPattern';\nexport type tPrivateIdentifier = 'PrivateIdentifier';\nexport type tProgram = 'Program';\nexport type tProperty = 'Property';\nexport type tPropertyDefinition = 'PropertyDefinition';\nexport type tRestElement = 'RestElement';\nexport type tReturnStatement = 'ReturnStatement';\nexport type tSequenceExpression = 'SequenceExpression';\nexport type tSpreadElement = 'SpreadElement';\nexport type tStaticBlock = 'StaticBlock';\nexport type tSuper = 'Super';\nexport type tSwitchCase = 'SwitchCase';\nexport type tSwitchStatement = 'SwitchStatement';\nexport type tTaggedTemplateExpression = 'TaggedTemplateExpression';\nexport type tTemplateElement = 'TemplateElement';\nexport type tTemplateLiteral = 'TemplateLiteral';\nexport type tThisExpression = 'ThisExpression';\nexport type tThrowStatement = 'ThrowStatement';\nexport type tTryStatement = 'TryStatement';\nexport type tUnaryExpression = 'UnaryExpression';\nexport type tUpdateExpression = 'UpdateExpression';\nexport type tVariableDeclarator = 'VariableDeclarator';\nexport type tVariableDeclaration = 'VariableDeclaration';\nexport type tWhileStatement = 'WhileStatement';\nexport type tYieldExpression = 'YieldExpression';\n\nexport const ArrayExpression: tArrayExpression = 'ArrayExpression';\nexport const ArrayPattern: tArrayPattern = 'ArrayPattern';\nexport const ArrowFunctionExpression: tArrowFunctionExpression = 'ArrowFunctionExpression';\nexport const AssignmentExpression: tAssignmentExpression = 'AssignmentExpression';\nexport const AssignmentPattern: tAssignmentPattern = 'AssignmentPattern';\nexport const AwaitExpression: tAwaitExpression = 'AwaitExpression';\nexport const BinaryExpression: tBinaryExpression = 'BinaryExpression';\nexport const BlockStatement: tBlockStatement = 'BlockStatement';\nexport const BreakStatement: tBreakStatement = 'BreakStatement';\nexport const CallExpression: tCallExpression = 'CallExpression';\nexport const CatchClause: tCatchClause = 'CatchClause';\nexport const ChainExpression: tChainExpression = 'ChainExpression';\nexport const ClassBody: tClassBody = 'ClassBody';\nexport const ClassDeclaration: tClassDeclaration = 'ClassDeclaration';\nexport const ClassExpression: tClassExpression = 'ClassExpression';\nexport const ConditionalExpression: tConditionalExpression = 'ConditionalExpression';\nexport const ContinueStatement: tContinueStatement = 'ContinueStatement';\nexport const DoWhileStatement: tDoWhileStatement = 'DoWhileStatement';\nexport const EmptyStatement: tEmptyStatement = 'EmptyStatement';\nexport const ExportAllDeclaration: tExportAllDeclaration = 'ExportAllDeclaration';\nexport const ExportDefaultDeclaration: tExportDefaultDeclaration = 'ExportDefaultDeclaration';\nexport const ExportNamedDeclaration: tExportNamedDeclaration = 'ExportNamedDeclaration';\nexport const ExportSpecifier: tExportSpecifier = 'ExportSpecifier';\nexport const ExpressionStatement: tExpressionStatement = 'ExpressionStatement';\nexport const ForStatement: tForStatement = 'ForStatement';\nexport const ForInStatement: tForInStatement = 'ForInStatement';\nexport const ForOfStatement: tForOfStatement = 'ForOfStatement';\nexport const FunctionDeclaration: tFunctionDeclaration = 'FunctionDeclaration';\nexport const FunctionExpression: tFunctionExpression = 'FunctionExpression';\nexport const Identifier: tIdentifier = 'Identifier';\nexport const IfStatement: tIfStatement = 'IfStatement';\nexport const Import: tImport = 'Import';\nexport const ImportDeclaration: tImportDeclaration = 'ImportDeclaration';\nexport const ImportExpression: tImportExpression = 'ImportExpression';\nexport const ImportDefaultSpecifier: tImportDefaultSpecifier = 'ImportDefaultSpecifier';\nexport const ImportNamespaceSpecifier: tImportNamespaceSpecifier = 'ImportNamespaceSpecifier';\nexport const ImportSpecifier: tImportSpecifier = 'ImportSpecifier';\nexport const LabeledStatement: tLabeledStatement = 'LabeledStatement';\nexport const Literal: tLiteral = 'Literal';\nexport const LogicalExpression: tLogicalExpression = 'LogicalExpression';\nexport const MemberExpression: tMemberExpression = 'MemberExpression';\nexport const MetaProperty: tMetaProperty = 'MetaProperty';\nexport const MethodDefinition: tMethodDefinition = 'MethodDefinition';\nexport const NewExpression: tNewExpression = 'NewExpression';\nexport const ObjectExpression: tObjectExpression = 'ObjectExpression';\nexport const ObjectPattern: tObjectPattern = 'ObjectPattern';\nexport const PrivateIdentifier: tPrivateIdentifier = 'PrivateIdentifier';\nexport const Program: tProgram = 'Program';\nexport const Property: tProperty = 'Property';\nexport const PropertyDefinition: tPropertyDefinition = 'PropertyDefinition';\nexport const RestElement: tRestElement = 'RestElement';\nexport const ReturnStatement: tReturnStatement = 'ReturnStatement';\nexport const SequenceExpression: tSequenceExpression = 'SequenceExpression';\nexport const SpreadElement: tSpreadElement = 'SpreadElement';\nexport const StaticBlock: tStaticBlock = 'StaticBlock';\nexport const Super: tSuper = 'Super';\nexport const SwitchCase: tSwitchCase = 'SwitchCase';\nexport const SwitchStatement: tSwitchStatement = 'SwitchStatement';\nexport const TaggedTemplateExpression: tTaggedTemplateExpression = 'TaggedTemplateExpression';\nexport const TemplateElement: tTemplateElement = 'TemplateElement';\nexport const TemplateLiteral: tTemplateLiteral = 'TemplateLiteral';\nexport const ThisExpression: tThisExpression = 'ThisExpression';\nexport const ThrowStatement: tThrowStatement = 'ThrowStatement';\nexport const TryStatement: tTryStatement = 'TryStatement';\nexport const UnaryExpression: tUnaryExpression = 'UnaryExpression';\nexport const UpdateExpression: tUpdateExpression = 'UpdateExpression';\nexport const VariableDeclarator: tVariableDeclarator = 'VariableDeclarator';\nexport const VariableDeclaration: tVariableDeclaration = 'VariableDeclaration';\nexport const WhileStatement: tWhileStatement = 'WhileStatement';\nexport const YieldExpression: tYieldExpression = 'YieldExpression';\n","// this looks ridiculous, but it prevents sourcemap tooling from mistaking\n// this for an actual sourceMappingURL\nexport let SOURCEMAPPING_URL = 'sourceMa';\nSOURCEMAPPING_URL += 'ppingURL';\n\nconst whiteSpaceNoNewline =\n\t'[ \\\\f\\\\r\\\\t\\\\v\\\\u00a0\\\\u1680\\\\u2000-\\\\u200a\\\\u2028\\\\u2029\\\\u202f\\\\u205f\\\\u3000\\\\ufeff]';\n\nexport const SOURCEMAPPING_URL_RE = new RegExp(`^#${whiteSpaceNoNewline}+${SOURCEMAPPING_URL}=.+`);\n","import * as acorn from 'acorn';\nimport { base as basicWalker } from 'acorn-walk';\nimport {\n\tBinaryExpression,\n\tCallExpression,\n\tChainExpression,\n\tConditionalExpression,\n\tExpressionStatement,\n\tLogicalExpression,\n\tNewExpression,\n\tSequenceExpression\n} from '../ast/nodes/NodeType';\nimport { SOURCEMAPPING_URL_RE } from './sourceMappingURL';\n\ninterface CommentState {\n\tannotationIndex: number;\n\tannotations: acorn.Comment[];\n\tcode: string;\n}\n\nexport const ANNOTATION_KEY = '_rollupAnnotations';\nexport const INVALID_COMMENT_KEY = '_rollupRemoved';\n\ninterface NodeWithComments extends acorn.Node {\n\t[ANNOTATION_KEY]?: acorn.Comment[];\n\t[INVALID_COMMENT_KEY]?: acorn.Comment[];\n}\n\nfunction handlePureAnnotationsOfNode(\n\tnode: acorn.Node,\n\tstate: CommentState,\n\ttype = node.type\n): void {\n\tconst { annotations } = state;\n\tlet comment = annotations[state.annotationIndex];\n\twhile (comment && node.start >= comment.end) {\n\t\tmarkPureNode(node, comment, state.code);\n\t\tcomment = annotations[++state.annotationIndex];\n\t}\n\tif (comment && comment.end <= node.end) {\n\t\tbasicWalker[type](node, state, handlePureAnnotationsOfNode);\n\t\twhile ((comment = annotations[state.annotationIndex]) && comment.end <= node.end) {\n\t\t\t++state.annotationIndex;\n\t\t\tannotateNode(node, comment, false);\n\t\t}\n\t}\n}\n\nconst neitherWithespaceNorBrackets = /[^\\s(]/g;\nconst noWhitespace = /\\S/g;\n\nfunction markPureNode(node: NodeWithComments, comment: acorn.Comment, code: string): void {\n\tconst annotatedNodes: NodeWithComments[] = [];\n\tlet invalidAnnotation: boolean | undefined;\n\tconst codeInBetween = code.slice(comment.end, node.start);\n\tif (doesNotMatchOutsideComment(codeInBetween, neitherWithespaceNorBrackets)) {\n\t\tconst parentStart = node.start;\n\t\twhile (true) {\n\t\t\tannotatedNodes.push(node);\n\t\t\tswitch (node.type) {\n\t\t\t\tcase ExpressionStatement:\n\t\t\t\tcase ChainExpression:\n\t\t\t\t\tnode = (node as any).expression;\n\t\t\t\t\tcontinue;\n\t\t\t\tcase SequenceExpression:\n\t\t\t\t\t// if there are parentheses, the annotation would apply to the entire expression\n\t\t\t\t\tif (doesNotMatchOutsideComment(code.slice(parentStart, node.start), noWhitespace)) {\n\t\t\t\t\t\tnode = (node as any).expressions[0];\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tinvalidAnnotation = true;\n\t\t\t\t\tbreak;\n\t\t\t\tcase ConditionalExpression:\n\t\t\t\t\t// if there are parentheses, the annotation would apply to the entire expression\n\t\t\t\t\tif (doesNotMatchOutsideComment(code.slice(parentStart, node.start), noWhitespace)) {\n\t\t\t\t\t\tnode = (node as any).test;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tinvalidAnnotation = true;\n\t\t\t\t\tbreak;\n\t\t\t\tcase LogicalExpression:\n\t\t\t\tcase BinaryExpression:\n\t\t\t\t\t// if there are parentheses, the annotation would apply to the entire expression\n\t\t\t\t\tif (doesNotMatchOutsideComment(code.slice(parentStart, node.start), noWhitespace)) {\n\t\t\t\t\t\tnode = (node as any).left;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tinvalidAnnotation = true;\n\t\t\t\t\tbreak;\n\t\t\t\tcase CallExpression:\n\t\t\t\tcase NewExpression:\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tinvalidAnnotation = true;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t} else {\n\t\tinvalidAnnotation = true;\n\t}\n\tif (invalidAnnotation) {\n\t\tannotateNode(node, comment, false);\n\t} else {\n\t\tfor (const node of annotatedNodes) {\n\t\t\tannotateNode(node, comment, true);\n\t\t}\n\t}\n}\n\nfunction doesNotMatchOutsideComment(code: string, forbiddenChars: RegExp): boolean {\n\tlet nextMatch: RegExpExecArray | null;\n\twhile ((nextMatch = forbiddenChars.exec(code)) !== null) {\n\t\tif (nextMatch[0] === '/') {\n\t\t\tconst charCodeAfterSlash = code.charCodeAt(forbiddenChars.lastIndex);\n\t\t\tif (charCodeAfterSlash === 42 /*\"*\"*/) {\n\t\t\t\tforbiddenChars.lastIndex = code.indexOf('*/', forbiddenChars.lastIndex + 1) + 2;\n\t\t\t\tcontinue;\n\t\t\t} else if (charCodeAfterSlash === 47 /*\"/\"*/) {\n\t\t\t\tforbiddenChars.lastIndex = code.indexOf('\\n', forbiddenChars.lastIndex + 1) + 1;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t\tforbiddenChars.lastIndex = 0;\n\t\treturn false;\n\t}\n\treturn true;\n}\n\nconst pureCommentRegex = /[@#]__PURE__/;\n\nexport function addAnnotations(\n\tcomments: readonly acorn.Comment[],\n\tesTreeAst: acorn.Node,\n\tcode: string\n): void {\n\tconst annotations: acorn.Comment[] = [];\n\tconst sourceMappingComments: acorn.Comment[] = [];\n\tfor (const comment of comments) {\n\t\tif (pureCommentRegex.test(comment.value)) {\n\t\t\tannotations.push(comment);\n\t\t} else if (SOURCEMAPPING_URL_RE.test(comment.value)) {\n\t\t\tsourceMappingComments.push(comment);\n\t\t}\n\t}\n\tfor (const comment of sourceMappingComments) {\n\t\tannotateNode(esTreeAst, comment, false);\n\t}\n\thandlePureAnnotationsOfNode(esTreeAst, {\n\t\tannotationIndex: 0,\n\t\tannotations,\n\t\tcode\n\t});\n}\n\nfunction annotateNode(node: NodeWithComments, comment: acorn.Comment, valid: boolean): void {\n\tconst key = valid ? ANNOTATION_KEY : INVALID_COMMENT_KEY;\n\tconst property = node[key];\n\tif (property) {\n\t\tproperty.push(comment);\n\t} else {\n\t\tnode[key] = [comment];\n\t}\n}\n","import type { GenericEsTreeNode } from './nodes/shared/Node';\n\nexport const keys: {\n\t[name: string]: string[];\n} = {\n\tLiteral: [],\n\tProgram: ['body']\n};\n\nexport function getAndCreateKeys(esTreeNode: GenericEsTreeNode): string[] {\n\tkeys[esTreeNode.type] = Object.keys(esTreeNode).filter(\n\t\tkey => typeof esTreeNode[key] === 'object' && key.charCodeAt(0) !== 95 /* _ */\n\t);\n\treturn keys[esTreeNode.type];\n}\n","import * as acorn from 'acorn';\nimport { locate, type Location } from 'locate-character';\nimport type MagicString from 'magic-string';\nimport type { AstContext } from '../../../Module';\nimport { ANNOTATION_KEY, INVALID_COMMENT_KEY } from '../../../utils/pureComments';\nimport type { NodeRenderOptions, RenderOptions } from '../../../utils/renderHelpers';\nimport type { Entity } from '../../Entity';\nimport {\n\tcreateHasEffectsContext,\n\ttype HasEffectsContext,\n\ttype InclusionContext\n} from '../../ExecutionContext';\nimport { INTERACTION_ASSIGNED, NodeInteractionAssigned } from '../../NodeInteractions';\nimport { getAndCreateKeys, keys } from '../../keys';\nimport type ChildScope from '../../scopes/ChildScope';\nimport { EMPTY_PATH, UNKNOWN_PATH } from '../../utils/PathTracker';\nimport type Variable from '../../variables/Variable';\nimport * as NodeType from '../NodeType';\nimport { ExpressionEntity, InclusionOptions } from './Expression';\n\nexport interface GenericEsTreeNode extends acorn.Node {\n\t[key: string]: any;\n}\n\nexport const INCLUDE_PARAMETERS = 'variables' as const;\nexport type IncludeChildren = boolean | typeof INCLUDE_PARAMETERS;\n\nexport interface Node extends Entity {\n\tannotations?: acorn.Comment[];\n\tcontext: AstContext;\n\tend: number;\n\tesTreeNode: GenericEsTreeNode;\n\tincluded: boolean;\n\tkeys: string[];\n\tneedsBoundaries?: boolean;\n\tparent: Node | { type?: string };\n\tpreventChildBlockScope?: boolean;\n\tstart: number;\n\ttype: string;\n\tvariable?: Variable | null;\n\n\taddExportedVariables(\n\t\tvariables: readonly Variable[],\n\t\texportNamesByVariable: ReadonlyMap\n\t): void;\n\n\t/**\n\t * Called once all nodes have been initialised and the scopes have been\n\t * populated.\n\t */\n\tbind(): void;\n\n\t/**\n\t * Determine if this Node would have an effect on the bundle. This is usually\n\t * true for already included nodes. Exceptions are e.g. break statements which\n\t * only have an effect if their surrounding loop or switch statement is\n\t * included.\n\t * The options pass on information like this about the current execution path.\n\t */\n\thasEffects(context: HasEffectsContext): boolean;\n\n\t/**\n\t * Special version of hasEffects for assignment left-hand sides which ensures\n\t * that accessor effects are checked as well. This is necessary to do from the\n\t * child so that member expressions can use the correct thisArg value.\n\t * setAssignedValue needs to be called during initialise to use this.\n\t */\n\thasEffectsAsAssignmentTarget(context: HasEffectsContext, checkAccess: boolean): boolean;\n\n\t/**\n\t * Includes the node in the bundle. If the flag is not set, children are\n\t * usually included if they are necessary for this node (e.g. a function body)\n\t * or if they have effects. Necessary variables need to be included as well.\n\t */\n\tinclude(\n\t\tcontext: InclusionContext,\n\t\tincludeChildrenRecursively: IncludeChildren,\n\t\toptions?: InclusionOptions\n\t): void;\n\n\t/**\n\t * Special version of include for assignment left-hand sides which ensures\n\t * that accessors are handled correctly. This is necessary to do from the\n\t * child so that member expressions can use the correct thisArg value.\n\t * setAssignedValue needs to be called during initialise to use this.\n\t */\n\tincludeAsAssignmentTarget(\n\t\tcontext: InclusionContext,\n\t\tincludeChildrenRecursively: IncludeChildren,\n\t\tdeoptimizeAccess: boolean\n\t): void;\n\n\trender(code: MagicString, options: RenderOptions, nodeRenderOptions?: NodeRenderOptions): void;\n\n\t/**\n\t * Sets the assigned value e.g. for assignment expression left. This must be\n\t * called during initialise in case hasEffects/includeAsAssignmentTarget are\n\t * used.\n\t */\n\tsetAssignedValue(value: ExpressionEntity): void;\n\n\t/**\n\t * Start a new execution path to determine if this node has an effect on the\n\t * bundle and should therefore be included. Included nodes should always be\n\t * included again in subsequent visits as the inclusion of additional\n\t * variables may require the inclusion of more child nodes in e.g. block\n\t * statements.\n\t */\n\tshouldBeIncluded(context: InclusionContext): boolean;\n}\n\nexport type StatementNode = Node;\n\nexport interface ExpressionNode extends ExpressionEntity, Node {}\n\nexport class NodeBase extends ExpressionEntity implements ExpressionNode {\n\tdeclare annotations?: acorn.Comment[];\n\tcontext: AstContext;\n\tdeclare end: number;\n\tesTreeNode: acorn.Node;\n\tkeys: string[];\n\tparent: Node | { context: AstContext; type: string };\n\tdeclare scope: ChildScope;\n\tdeclare start: number;\n\tdeclare type: keyof typeof NodeType;\n\t/**\n\t * This will be populated during initialise if setAssignedValue is called.\n\t */\n\tprotected declare assignmentInteraction: NodeInteractionAssigned;\n\t/**\n\t * Nodes can apply custom deoptimizations once they become part of the\n\t * executed code. To do this, they must initialize this as false, implement\n\t * applyDeoptimizations and call this from include and hasEffects if they have\n\t * custom handlers\n\t */\n\tprotected deoptimized = false;\n\n\tconstructor(\n\t\tesTreeNode: GenericEsTreeNode,\n\t\tparent: Node | { context: AstContext; type: string },\n\t\tparentScope: ChildScope\n\t) {\n\t\tsuper();\n\t\tthis.esTreeNode = esTreeNode;\n\t\tthis.keys = keys[esTreeNode.type] || getAndCreateKeys(esTreeNode);\n\t\tthis.parent = parent;\n\t\tthis.context = parent.context;\n\t\tthis.createScope(parentScope);\n\t\tthis.parseNode(esTreeNode);\n\t\tthis.initialise();\n\t\tthis.context.magicString.addSourcemapLocation(this.start);\n\t\tthis.context.magicString.addSourcemapLocation(this.end);\n\t}\n\n\taddExportedVariables(\n\t\t_variables: readonly Variable[],\n\t\t_exportNamesByVariable: ReadonlyMap\n\t): void {}\n\n\t/**\n\t * Override this to bind assignments to variables and do any initialisations that\n\t * require the scopes to be populated with variables.\n\t */\n\tbind(): void {\n\t\tfor (const key of this.keys) {\n\t\t\tconst value = (this as GenericEsTreeNode)[key];\n\t\t\tif (value === null) continue;\n\t\t\tif (Array.isArray(value)) {\n\t\t\t\tfor (const child of value) {\n\t\t\t\t\tchild?.bind();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tvalue.bind();\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Override if this node should receive a different scope than the parent scope.\n\t */\n\tcreateScope(parentScope: ChildScope): void {\n\t\tthis.scope = parentScope;\n\t}\n\n\thasEffects(context: HasEffectsContext): boolean {\n\t\tif (!this.deoptimized) this.applyDeoptimizations();\n\t\tfor (const key of this.keys) {\n\t\t\tconst value = (this as GenericEsTreeNode)[key];\n\t\t\tif (value === null) continue;\n\t\t\tif (Array.isArray(value)) {\n\t\t\t\tfor (const child of value) {\n\t\t\t\t\tif (child?.hasEffects(context)) return true;\n\t\t\t\t}\n\t\t\t} else if (value.hasEffects(context)) return true;\n\t\t}\n\t\treturn false;\n\t}\n\n\thasEffectsAsAssignmentTarget(context: HasEffectsContext, _checkAccess: boolean): boolean {\n\t\treturn (\n\t\t\tthis.hasEffects(context) ||\n\t\t\tthis.hasEffectsOnInteractionAtPath(EMPTY_PATH, this.assignmentInteraction, context)\n\t\t);\n\t}\n\n\tinclude(\n\t\tcontext: InclusionContext,\n\t\tincludeChildrenRecursively: IncludeChildren,\n\t\t_options?: InclusionOptions\n\t): void {\n\t\tif (!this.deoptimized) this.applyDeoptimizations();\n\t\tthis.included = true;\n\t\tfor (const key of this.keys) {\n\t\t\tconst value = (this as GenericEsTreeNode)[key];\n\t\t\tif (value === null) continue;\n\t\t\tif (Array.isArray(value)) {\n\t\t\t\tfor (const child of value) {\n\t\t\t\t\tchild?.include(context, includeChildrenRecursively);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tvalue.include(context, includeChildrenRecursively);\n\t\t\t}\n\t\t}\n\t}\n\n\tincludeAsAssignmentTarget(\n\t\tcontext: InclusionContext,\n\t\tincludeChildrenRecursively: IncludeChildren,\n\t\t_deoptimizeAccess: boolean\n\t) {\n\t\tthis.include(context, includeChildrenRecursively);\n\t}\n\n\t/**\n\t * Override to perform special initialisation steps after the scope is initialised\n\t */\n\tinitialise(): void {}\n\n\tinsertSemicolon(code: MagicString): void {\n\t\tif (code.original[this.end - 1] !== ';') {\n\t\t\tcode.appendLeft(this.end, ';');\n\t\t}\n\t}\n\n\tparseNode(esTreeNode: GenericEsTreeNode): void {\n\t\tfor (const [key, value] of Object.entries(esTreeNode)) {\n\t\t\t// That way, we can override this function to add custom initialisation and then call super.parseNode\n\t\t\tif (this.hasOwnProperty(key)) continue;\n\t\t\tif (key.charCodeAt(0) === 95 /* _ */) {\n\t\t\t\tif (key === ANNOTATION_KEY) {\n\t\t\t\t\tthis.annotations = value;\n\t\t\t\t} else if (key === INVALID_COMMENT_KEY) {\n\t\t\t\t\tfor (const { start, end } of value as acorn.Comment[])\n\t\t\t\t\t\tthis.context.magicString.remove(start, end);\n\t\t\t\t}\n\t\t\t} else if (typeof value !== 'object' || value === null) {\n\t\t\t\t(this as GenericEsTreeNode)[key] = value;\n\t\t\t} else if (Array.isArray(value)) {\n\t\t\t\t(this as GenericEsTreeNode)[key] = [];\n\t\t\t\tfor (const child of value) {\n\t\t\t\t\t(this as GenericEsTreeNode)[key].push(\n\t\t\t\t\t\tchild === null\n\t\t\t\t\t\t\t? null\n\t\t\t\t\t\t\t: new (this.context.getNodeConstructor(child.type))(child, this, this.scope)\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t(this as GenericEsTreeNode)[key] = new (this.context.getNodeConstructor(value.type))(\n\t\t\t\t\tvalue,\n\t\t\t\t\tthis,\n\t\t\t\t\tthis.scope\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\trender(code: MagicString, options: RenderOptions): void {\n\t\tfor (const key of this.keys) {\n\t\t\tconst value = (this as GenericEsTreeNode)[key];\n\t\t\tif (value === null) continue;\n\t\t\tif (Array.isArray(value)) {\n\t\t\t\tfor (const child of value) {\n\t\t\t\t\tchild?.render(code, options);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tvalue.render(code, options);\n\t\t\t}\n\t\t}\n\t}\n\n\tsetAssignedValue(value: ExpressionEntity): void {\n\t\tthis.assignmentInteraction = { args: [value], thisArg: null, type: INTERACTION_ASSIGNED };\n\t}\n\n\tshouldBeIncluded(context: InclusionContext): boolean {\n\t\treturn this.included || (!context.brokenFlow && this.hasEffects(createHasEffectsContext()));\n\t}\n\n\t/**\n\t * Just deoptimize everything by default so that when e.g. we do not track\n\t * something properly, it is deoptimized.\n\t * @protected\n\t */\n\tprotected applyDeoptimizations(): void {\n\t\tthis.deoptimized = true;\n\t\tfor (const key of this.keys) {\n\t\t\tconst value = (this as GenericEsTreeNode)[key];\n\t\t\tif (value === null) continue;\n\t\t\tif (Array.isArray(value)) {\n\t\t\t\tfor (const child of value) {\n\t\t\t\t\tchild?.deoptimizePath(UNKNOWN_PATH);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tvalue.deoptimizePath(UNKNOWN_PATH);\n\t\t\t}\n\t\t}\n\t\tthis.context.requestTreeshakingPass();\n\t}\n}\n\nexport { NodeBase as StatementBase };\n\nexport function locateNode(node: Node): Location & { file: string } {\n\tconst location = locate(node.context.code, node.start, { offsetLine: 1 }) as Location & {\n\t\tfile: string;\n\t};\n\tlocation.file = node.context.fileName;\n\tlocation.toString = () => JSON.stringify(location);\n\n\treturn location;\n}\n\nexport function logNode(node: Node): string {\n\treturn node.context.code.slice(node.start, node.end);\n}\n","import type { NormalizedTreeshakingOptions } from '../../rollup/types';\nimport type { HasEffectsContext } from '../ExecutionContext';\nimport type { NodeInteractionWithThisArg } from '../NodeInteractions';\nimport { NODE_INTERACTION_UNKNOWN_ACCESS } from '../NodeInteractions';\nimport { type ObjectPath, type PathTracker, UNKNOWN_PATH, UnknownKey } from '../utils/PathTracker';\nimport type * as NodeType from './NodeType';\nimport { type ExpressionNode, NodeBase } from './shared/Node';\n\nexport default class SpreadElement extends NodeBase {\n\tdeclare argument: ExpressionNode;\n\tdeclare type: NodeType.tSpreadElement;\n\n\tdeoptimizeThisOnInteractionAtPath(\n\t\tinteraction: NodeInteractionWithThisArg,\n\t\tpath: ObjectPath,\n\t\trecursionTracker: PathTracker\n\t): void {\n\t\tif (path.length > 0) {\n\t\t\tthis.argument.deoptimizeThisOnInteractionAtPath(\n\t\t\t\tinteraction,\n\t\t\t\t[UnknownKey, ...path],\n\t\t\t\trecursionTracker\n\t\t\t);\n\t\t}\n\t}\n\n\thasEffects(context: HasEffectsContext): boolean {\n\t\tif (!this.deoptimized) this.applyDeoptimizations();\n\t\tconst { propertyReadSideEffects } = this.context.options\n\t\t\t.treeshake as NormalizedTreeshakingOptions;\n\t\treturn (\n\t\t\tthis.argument.hasEffects(context) ||\n\t\t\t(propertyReadSideEffects &&\n\t\t\t\t(propertyReadSideEffects === 'always' ||\n\t\t\t\t\tthis.argument.hasEffectsOnInteractionAtPath(\n\t\t\t\t\t\tUNKNOWN_PATH,\n\t\t\t\t\t\tNODE_INTERACTION_UNKNOWN_ACCESS,\n\t\t\t\t\t\tcontext\n\t\t\t\t\t)))\n\t\t);\n\t}\n\n\tprotected applyDeoptimizations(): void {\n\t\tthis.deoptimized = true;\n\t\t// Only properties of properties of the argument could become subject to reassignment\n\t\t// This will also reassign the return values of iterators\n\t\tthis.argument.deoptimizePath([UnknownKey, UnknownKey]);\n\t\tthis.context.requestTreeshakingPass();\n\t}\n}\n","import type { HasEffectsContext } from '../../ExecutionContext';\nimport {\n\tINTERACTION_ACCESSED,\n\tINTERACTION_CALLED,\n\tNODE_INTERACTION_UNKNOWN_ASSIGNMENT,\n\tNODE_INTERACTION_UNKNOWN_CALL,\n\tNodeInteraction,\n\tNodeInteractionCalled,\n\tNodeInteractionWithThisArg\n} from '../../NodeInteractions';\nimport { EMPTY_PATH, type ObjectPath, UNKNOWN_INTEGER_PATH } from '../../utils/PathTracker';\nimport {\n\tUNKNOWN_LITERAL_BOOLEAN,\n\tUNKNOWN_LITERAL_NUMBER,\n\tUNKNOWN_LITERAL_STRING\n} from '../../values';\nimport { ExpressionEntity, UNKNOWN_EXPRESSION } from './Expression';\n\ntype MethodDescription = {\n\tcallsArgs: number[] | null;\n\tmutatesSelfAsArray: boolean | 'deopt-only';\n} & (\n\t| {\n\t\t\treturns: 'self' | (() => ExpressionEntity);\n\t\t\treturnsPrimitive: null;\n\t }\n\t| {\n\t\t\treturns: null;\n\t\t\treturnsPrimitive: ExpressionEntity;\n\t }\n);\n\nexport class Method extends ExpressionEntity {\n\tconstructor(private readonly description: MethodDescription) {\n\t\tsuper();\n\t}\n\n\tdeoptimizeThisOnInteractionAtPath(\n\t\t{ type, thisArg }: NodeInteractionWithThisArg,\n\t\tpath: ObjectPath\n\t): void {\n\t\tif (type === INTERACTION_CALLED && path.length === 0 && this.description.mutatesSelfAsArray) {\n\t\t\tthisArg.deoptimizePath(UNKNOWN_INTEGER_PATH);\n\t\t}\n\t}\n\n\tgetReturnExpressionWhenCalledAtPath(\n\t\tpath: ObjectPath,\n\t\t{ thisArg }: NodeInteractionCalled\n\t): ExpressionEntity {\n\t\tif (path.length > 0) {\n\t\t\treturn UNKNOWN_EXPRESSION;\n\t\t}\n\t\treturn (\n\t\t\tthis.description.returnsPrimitive ||\n\t\t\t(this.description.returns === 'self'\n\t\t\t\t? thisArg || UNKNOWN_EXPRESSION\n\t\t\t\t: this.description.returns())\n\t\t);\n\t}\n\n\thasEffectsOnInteractionAtPath(\n\t\tpath: ObjectPath,\n\t\tinteraction: NodeInteraction,\n\t\tcontext: HasEffectsContext\n\t): boolean {\n\t\tconst { type } = interaction;\n\t\tif (path.length > (type === INTERACTION_ACCESSED ? 1 : 0)) {\n\t\t\treturn true;\n\t\t}\n\t\tif (type === INTERACTION_CALLED) {\n\t\t\tif (\n\t\t\t\tthis.description.mutatesSelfAsArray === true &&\n\t\t\t\tinteraction.thisArg?.hasEffectsOnInteractionAtPath(\n\t\t\t\t\tUNKNOWN_INTEGER_PATH,\n\t\t\t\t\tNODE_INTERACTION_UNKNOWN_ASSIGNMENT,\n\t\t\t\t\tcontext\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tif (this.description.callsArgs) {\n\t\t\t\tfor (const argIndex of this.description.callsArgs) {\n\t\t\t\t\tif (\n\t\t\t\t\t\tinteraction.args[argIndex]?.hasEffectsOnInteractionAtPath(\n\t\t\t\t\t\t\tEMPTY_PATH,\n\t\t\t\t\t\t\tNODE_INTERACTION_UNKNOWN_CALL,\n\t\t\t\t\t\t\tcontext\n\t\t\t\t\t\t)\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n}\n\nexport const METHOD_RETURNS_BOOLEAN = [\n\tnew Method({\n\t\tcallsArgs: null,\n\t\tmutatesSelfAsArray: false,\n\t\treturns: null,\n\t\treturnsPrimitive: UNKNOWN_LITERAL_BOOLEAN\n\t})\n];\n\nexport const METHOD_RETURNS_STRING = [\n\tnew Method({\n\t\tcallsArgs: null,\n\t\tmutatesSelfAsArray: false,\n\t\treturns: null,\n\t\treturnsPrimitive: UNKNOWN_LITERAL_STRING\n\t})\n];\n\nexport const METHOD_RETURNS_NUMBER = [\n\tnew Method({\n\t\tcallsArgs: null,\n\t\tmutatesSelfAsArray: false,\n\t\treturns: null,\n\t\treturnsPrimitive: UNKNOWN_LITERAL_NUMBER\n\t})\n];\n\nexport const METHOD_RETURNS_UNKNOWN = [\n\tnew Method({\n\t\tcallsArgs: null,\n\t\tmutatesSelfAsArray: false,\n\t\treturns: null,\n\t\treturnsPrimitive: UNKNOWN_EXPRESSION\n\t})\n];\n","import { DeoptimizableEntity } from '../../DeoptimizableEntity';\nimport { HasEffectsContext } from '../../ExecutionContext';\nimport {\n\tINTERACTION_ACCESSED,\n\tINTERACTION_CALLED,\n\tNodeInteraction,\n\tNodeInteractionCalled,\n\tNodeInteractionWithThisArg\n} from '../../NodeInteractions';\nimport {\n\tObjectPath,\n\tObjectPathKey,\n\tPathTracker,\n\tUNKNOWN_INTEGER_PATH,\n\tUNKNOWN_PATH,\n\tUnknownInteger,\n\tUnknownKey,\n\tUnknownNonAccessorKey\n} from '../../utils/PathTracker';\nimport {\n\tExpressionEntity,\n\tLiteralValueOrUnknown,\n\tUNKNOWN_EXPRESSION,\n\tUnknownTruthyValue,\n\tUnknownValue\n} from './Expression';\n\nexport interface ObjectProperty {\n\tkey: ObjectPathKey;\n\tkind: 'init' | 'set' | 'get';\n\tproperty: ExpressionEntity;\n}\n\nexport interface PropertyMap {\n\t[key: string]: ExpressionEntity[];\n}\nconst INTEGER_REG_EXP = /^\\d+$/;\n\nexport class ObjectEntity extends ExpressionEntity {\n\tprivate readonly allProperties: ExpressionEntity[] = [];\n\tprivate readonly deoptimizedPaths: Record = Object.create(null);\n\tprivate readonly expressionsToBeDeoptimizedByKey: Record =\n\t\tObject.create(null);\n\tprivate readonly gettersByKey: PropertyMap = Object.create(null);\n\tprivate hasLostTrack = false;\n\tprivate hasUnknownDeoptimizedInteger = false;\n\tprivate hasUnknownDeoptimizedProperty = false;\n\tprivate readonly propertiesAndGettersByKey: PropertyMap = Object.create(null);\n\tprivate readonly propertiesAndSettersByKey: PropertyMap = Object.create(null);\n\tprivate readonly settersByKey: PropertyMap = Object.create(null);\n\tprivate readonly thisParametersToBeDeoptimized = new Set();\n\tprivate readonly unknownIntegerProps: ExpressionEntity[] = [];\n\tprivate readonly unmatchableGetters: ExpressionEntity[] = [];\n\tprivate readonly unmatchablePropertiesAndGetters: ExpressionEntity[] = [];\n\tprivate readonly unmatchableSetters: ExpressionEntity[] = [];\n\n\t// If a PropertyMap is used, this will be taken as propertiesAndGettersByKey\n\t// and we assume there are no setters or getters\n\tconstructor(\n\t\tproperties: ObjectProperty[] | PropertyMap,\n\t\tprivate prototypeExpression: ExpressionEntity | null,\n\t\tprivate immutable = false\n\t) {\n\t\tsuper();\n\t\tif (Array.isArray(properties)) {\n\t\t\tthis.buildPropertyMaps(properties);\n\t\t} else {\n\t\t\tthis.propertiesAndGettersByKey = this.propertiesAndSettersByKey = properties;\n\t\t\tfor (const propertiesForKey of Object.values(properties)) {\n\t\t\t\tthis.allProperties.push(...propertiesForKey);\n\t\t\t}\n\t\t}\n\t}\n\n\tdeoptimizeAllProperties(noAccessors?: boolean): void {\n\t\tconst isDeoptimized = this.hasLostTrack || this.hasUnknownDeoptimizedProperty;\n\t\tif (noAccessors) {\n\t\t\tthis.hasUnknownDeoptimizedProperty = true;\n\t\t} else {\n\t\t\tthis.hasLostTrack = true;\n\t\t}\n\t\tif (isDeoptimized) {\n\t\t\treturn;\n\t\t}\n\t\tfor (const properties of Object.values(this.propertiesAndGettersByKey).concat(\n\t\t\tObject.values(this.settersByKey)\n\t\t)) {\n\t\t\tfor (const property of properties) {\n\t\t\t\tproperty.deoptimizePath(UNKNOWN_PATH);\n\t\t\t}\n\t\t}\n\t\t// While the prototype itself cannot be mutated, each property can\n\t\tthis.prototypeExpression?.deoptimizePath([UnknownKey, UnknownKey]);\n\t\tthis.deoptimizeCachedEntities();\n\t}\n\n\tdeoptimizeIntegerProperties(): void {\n\t\tif (\n\t\t\tthis.hasLostTrack ||\n\t\t\tthis.hasUnknownDeoptimizedProperty ||\n\t\t\tthis.hasUnknownDeoptimizedInteger\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t\tthis.hasUnknownDeoptimizedInteger = true;\n\t\tfor (const [key, propertiesAndGetters] of Object.entries(this.propertiesAndGettersByKey)) {\n\t\t\tif (INTEGER_REG_EXP.test(key)) {\n\t\t\t\tfor (const property of propertiesAndGetters) {\n\t\t\t\t\tproperty.deoptimizePath(UNKNOWN_PATH);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tthis.deoptimizeCachedIntegerEntities();\n\t}\n\n\t// Assumption: If only a specific path is deoptimized, no accessors are created\n\tdeoptimizePath(path: ObjectPath): void {\n\t\tif (this.hasLostTrack || this.immutable) {\n\t\t\treturn;\n\t\t}\n\t\tconst key = path[0];\n\t\tif (path.length === 1) {\n\t\t\tif (typeof key !== 'string') {\n\t\t\t\tif (key === UnknownInteger) {\n\t\t\t\t\treturn this.deoptimizeIntegerProperties();\n\t\t\t\t}\n\t\t\t\treturn this.deoptimizeAllProperties(key === UnknownNonAccessorKey);\n\t\t\t}\n\t\t\tif (!this.deoptimizedPaths[key]) {\n\t\t\t\tthis.deoptimizedPaths[key] = true;\n\n\t\t\t\t// we only deoptimizeCache exact matches as in all other cases,\n\t\t\t\t// we do not return a literal value or return expression\n\t\t\t\tconst expressionsToBeDeoptimized = this.expressionsToBeDeoptimizedByKey[key];\n\t\t\t\tif (expressionsToBeDeoptimized) {\n\t\t\t\t\tfor (const expression of expressionsToBeDeoptimized) {\n\t\t\t\t\t\texpression.deoptimizeCache();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst subPath = path.length === 1 ? UNKNOWN_PATH : path.slice(1);\n\t\tfor (const property of typeof key === 'string'\n\t\t\t? (this.propertiesAndGettersByKey[key] || this.unmatchablePropertiesAndGetters).concat(\n\t\t\t\t\tthis.settersByKey[key] || this.unmatchableSetters\n\t\t\t )\n\t\t\t: this.allProperties) {\n\t\t\tproperty.deoptimizePath(subPath);\n\t\t}\n\t\tthis.prototypeExpression?.deoptimizePath(path.length === 1 ? [...path, UnknownKey] : path);\n\t}\n\n\tdeoptimizeThisOnInteractionAtPath(\n\t\tinteraction: NodeInteractionWithThisArg,\n\t\tpath: ObjectPath,\n\t\trecursionTracker: PathTracker\n\t): void {\n\t\tconst [key, ...subPath] = path;\n\n\t\tif (\n\t\t\tthis.hasLostTrack ||\n\t\t\t// single paths that are deoptimized will not become getters or setters\n\t\t\t((interaction.type === INTERACTION_CALLED || path.length > 1) &&\n\t\t\t\t(this.hasUnknownDeoptimizedProperty ||\n\t\t\t\t\t(typeof key === 'string' && this.deoptimizedPaths[key])))\n\t\t) {\n\t\t\tinteraction.thisArg.deoptimizePath(UNKNOWN_PATH);\n\t\t\treturn;\n\t\t}\n\n\t\tconst [propertiesForExactMatchByKey, relevantPropertiesByKey, relevantUnmatchableProperties] =\n\t\t\tinteraction.type === INTERACTION_CALLED || path.length > 1\n\t\t\t\t? [\n\t\t\t\t\t\tthis.propertiesAndGettersByKey,\n\t\t\t\t\t\tthis.propertiesAndGettersByKey,\n\t\t\t\t\t\tthis.unmatchablePropertiesAndGetters\n\t\t\t\t ]\n\t\t\t\t: interaction.type === INTERACTION_ACCESSED\n\t\t\t\t? [this.propertiesAndGettersByKey, this.gettersByKey, this.unmatchableGetters]\n\t\t\t\t: [this.propertiesAndSettersByKey, this.settersByKey, this.unmatchableSetters];\n\n\t\tif (typeof key === 'string') {\n\t\t\tif (propertiesForExactMatchByKey[key]) {\n\t\t\t\tconst properties = relevantPropertiesByKey[key];\n\t\t\t\tif (properties) {\n\t\t\t\t\tfor (const property of properties) {\n\t\t\t\t\t\tproperty.deoptimizeThisOnInteractionAtPath(interaction, subPath, recursionTracker);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!this.immutable) {\n\t\t\t\t\tthis.thisParametersToBeDeoptimized.add(interaction.thisArg);\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tfor (const property of relevantUnmatchableProperties) {\n\t\t\t\tproperty.deoptimizeThisOnInteractionAtPath(interaction, subPath, recursionTracker);\n\t\t\t}\n\t\t\tif (INTEGER_REG_EXP.test(key)) {\n\t\t\t\tfor (const property of this.unknownIntegerProps) {\n\t\t\t\t\tproperty.deoptimizeThisOnInteractionAtPath(interaction, subPath, recursionTracker);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tfor (const properties of Object.values(relevantPropertiesByKey).concat([\n\t\t\t\trelevantUnmatchableProperties\n\t\t\t])) {\n\t\t\t\tfor (const property of properties) {\n\t\t\t\t\tproperty.deoptimizeThisOnInteractionAtPath(interaction, subPath, recursionTracker);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (const property of this.unknownIntegerProps) {\n\t\t\t\tproperty.deoptimizeThisOnInteractionAtPath(interaction, subPath, recursionTracker);\n\t\t\t}\n\t\t}\n\t\tif (!this.immutable) {\n\t\t\tthis.thisParametersToBeDeoptimized.add(interaction.thisArg);\n\t\t}\n\t\tthis.prototypeExpression?.deoptimizeThisOnInteractionAtPath(\n\t\t\tinteraction,\n\t\t\tpath,\n\t\t\trecursionTracker\n\t\t);\n\t}\n\n\tgetLiteralValueAtPath(\n\t\tpath: ObjectPath,\n\t\trecursionTracker: PathTracker,\n\t\torigin: DeoptimizableEntity\n\t): LiteralValueOrUnknown {\n\t\tif (path.length === 0) {\n\t\t\treturn UnknownTruthyValue;\n\t\t}\n\t\tconst key = path[0];\n\t\tconst expressionAtPath = this.getMemberExpressionAndTrackDeopt(key, origin);\n\t\tif (expressionAtPath) {\n\t\t\treturn expressionAtPath.getLiteralValueAtPath(path.slice(1), recursionTracker, origin);\n\t\t}\n\t\tif (this.prototypeExpression) {\n\t\t\treturn this.prototypeExpression.getLiteralValueAtPath(path, recursionTracker, origin);\n\t\t}\n\t\tif (path.length === 1) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn UnknownValue;\n\t}\n\n\tgetReturnExpressionWhenCalledAtPath(\n\t\tpath: ObjectPath,\n\t\tinteraction: NodeInteractionCalled,\n\t\trecursionTracker: PathTracker,\n\t\torigin: DeoptimizableEntity\n\t): ExpressionEntity {\n\t\tif (path.length === 0) {\n\t\t\treturn UNKNOWN_EXPRESSION;\n\t\t}\n\t\tconst [key, ...subPath] = path;\n\t\tconst expressionAtPath = this.getMemberExpressionAndTrackDeopt(key, origin);\n\t\tif (expressionAtPath) {\n\t\t\treturn expressionAtPath.getReturnExpressionWhenCalledAtPath(\n\t\t\t\tsubPath,\n\t\t\t\tinteraction,\n\t\t\t\trecursionTracker,\n\t\t\t\torigin\n\t\t\t);\n\t\t}\n\t\tif (this.prototypeExpression) {\n\t\t\treturn this.prototypeExpression.getReturnExpressionWhenCalledAtPath(\n\t\t\t\tpath,\n\t\t\t\tinteraction,\n\t\t\t\trecursionTracker,\n\t\t\t\torigin\n\t\t\t);\n\t\t}\n\t\treturn UNKNOWN_EXPRESSION;\n\t}\n\n\thasEffectsOnInteractionAtPath(\n\t\tpath: ObjectPath,\n\t\tinteraction: NodeInteraction,\n\t\tcontext: HasEffectsContext\n\t): boolean {\n\t\tconst [key, ...subPath] = path;\n\t\tif (subPath.length || interaction.type === INTERACTION_CALLED) {\n\t\t\tconst expressionAtPath = this.getMemberExpression(key);\n\t\t\tif (expressionAtPath) {\n\t\t\t\treturn expressionAtPath.hasEffectsOnInteractionAtPath(subPath, interaction, context);\n\t\t\t}\n\t\t\tif (this.prototypeExpression) {\n\t\t\t\treturn this.prototypeExpression.hasEffectsOnInteractionAtPath(path, interaction, context);\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\tif (key === UnknownNonAccessorKey) return false;\n\t\tif (this.hasLostTrack) return true;\n\t\tconst [propertiesAndAccessorsByKey, accessorsByKey, unmatchableAccessors] =\n\t\t\tinteraction.type === INTERACTION_ACCESSED\n\t\t\t\t? [this.propertiesAndGettersByKey, this.gettersByKey, this.unmatchableGetters]\n\t\t\t\t: [this.propertiesAndSettersByKey, this.settersByKey, this.unmatchableSetters];\n\t\tif (typeof key === 'string') {\n\t\t\tif (propertiesAndAccessorsByKey[key]) {\n\t\t\t\tconst accessors = accessorsByKey[key];\n\t\t\t\tif (accessors) {\n\t\t\t\t\tfor (const accessor of accessors) {\n\t\t\t\t\t\tif (accessor.hasEffectsOnInteractionAtPath(subPath, interaction, context)) return true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tfor (const accessor of unmatchableAccessors) {\n\t\t\t\tif (accessor.hasEffectsOnInteractionAtPath(subPath, interaction, context)) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tfor (const accessors of Object.values(accessorsByKey).concat([unmatchableAccessors])) {\n\t\t\t\tfor (const accessor of accessors) {\n\t\t\t\t\tif (accessor.hasEffectsOnInteractionAtPath(subPath, interaction, context)) return true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (this.prototypeExpression) {\n\t\t\treturn this.prototypeExpression.hasEffectsOnInteractionAtPath(path, interaction, context);\n\t\t}\n\t\treturn false;\n\t}\n\n\tprivate buildPropertyMaps(properties: readonly ObjectProperty[]): void {\n\t\tconst {\n\t\t\tallProperties,\n\t\t\tpropertiesAndGettersByKey,\n\t\t\tpropertiesAndSettersByKey,\n\t\t\tsettersByKey,\n\t\t\tgettersByKey,\n\t\t\tunknownIntegerProps,\n\t\t\tunmatchablePropertiesAndGetters,\n\t\t\tunmatchableGetters,\n\t\t\tunmatchableSetters\n\t\t} = this;\n\t\tconst unmatchablePropertiesAndSetters: ExpressionEntity[] = [];\n\t\tfor (let index = properties.length - 1; index >= 0; index--) {\n\t\t\tconst { key, kind, property } = properties[index];\n\t\t\tallProperties.push(property);\n\t\t\tif (typeof key !== 'string') {\n\t\t\t\tif (key === UnknownInteger) {\n\t\t\t\t\tunknownIntegerProps.push(property);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (kind === 'set') unmatchableSetters.push(property);\n\t\t\t\tif (kind === 'get') unmatchableGetters.push(property);\n\t\t\t\tif (kind !== 'get') unmatchablePropertiesAndSetters.push(property);\n\t\t\t\tif (kind !== 'set') unmatchablePropertiesAndGetters.push(property);\n\t\t\t} else {\n\t\t\t\tif (kind === 'set') {\n\t\t\t\t\tif (!propertiesAndSettersByKey[key]) {\n\t\t\t\t\t\tpropertiesAndSettersByKey[key] = [property, ...unmatchablePropertiesAndSetters];\n\t\t\t\t\t\tsettersByKey[key] = [property, ...unmatchableSetters];\n\t\t\t\t\t}\n\t\t\t\t} else if (kind === 'get') {\n\t\t\t\t\tif (!propertiesAndGettersByKey[key]) {\n\t\t\t\t\t\tpropertiesAndGettersByKey[key] = [property, ...unmatchablePropertiesAndGetters];\n\t\t\t\t\t\tgettersByKey[key] = [property, ...unmatchableGetters];\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (!propertiesAndSettersByKey[key]) {\n\t\t\t\t\t\tpropertiesAndSettersByKey[key] = [property, ...unmatchablePropertiesAndSetters];\n\t\t\t\t\t}\n\t\t\t\t\tif (!propertiesAndGettersByKey[key]) {\n\t\t\t\t\t\tpropertiesAndGettersByKey[key] = [property, ...unmatchablePropertiesAndGetters];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate deoptimizeCachedEntities() {\n\t\tfor (const expressionsToBeDeoptimized of Object.values(this.expressionsToBeDeoptimizedByKey)) {\n\t\t\tfor (const expression of expressionsToBeDeoptimized) {\n\t\t\t\texpression.deoptimizeCache();\n\t\t\t}\n\t\t}\n\t\tfor (const expression of this.thisParametersToBeDeoptimized) {\n\t\t\texpression.deoptimizePath(UNKNOWN_PATH);\n\t\t}\n\t}\n\n\tprivate deoptimizeCachedIntegerEntities() {\n\t\tfor (const [key, expressionsToBeDeoptimized] of Object.entries(\n\t\t\tthis.expressionsToBeDeoptimizedByKey\n\t\t)) {\n\t\t\tif (INTEGER_REG_EXP.test(key)) {\n\t\t\t\tfor (const expression of expressionsToBeDeoptimized) {\n\t\t\t\t\texpression.deoptimizeCache();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor (const expression of this.thisParametersToBeDeoptimized) {\n\t\t\texpression.deoptimizePath(UNKNOWN_INTEGER_PATH);\n\t\t}\n\t}\n\n\tprivate getMemberExpression(key: ObjectPathKey): ExpressionEntity | null {\n\t\tif (\n\t\t\tthis.hasLostTrack ||\n\t\t\tthis.hasUnknownDeoptimizedProperty ||\n\t\t\ttypeof key !== 'string' ||\n\t\t\t(this.hasUnknownDeoptimizedInteger && INTEGER_REG_EXP.test(key)) ||\n\t\t\tthis.deoptimizedPaths[key]\n\t\t) {\n\t\t\treturn UNKNOWN_EXPRESSION;\n\t\t}\n\t\tconst properties = this.propertiesAndGettersByKey[key];\n\t\tif (properties?.length === 1) {\n\t\t\treturn properties[0];\n\t\t}\n\t\tif (\n\t\t\tproperties ||\n\t\t\tthis.unmatchablePropertiesAndGetters.length > 0 ||\n\t\t\t(this.unknownIntegerProps.length && INTEGER_REG_EXP.test(key))\n\t\t) {\n\t\t\treturn UNKNOWN_EXPRESSION;\n\t\t}\n\t\treturn null;\n\t}\n\n\tprivate getMemberExpressionAndTrackDeopt(\n\t\tkey: ObjectPathKey,\n\t\torigin: DeoptimizableEntity\n\t): ExpressionEntity | null {\n\t\tif (typeof key !== 'string') {\n\t\t\treturn UNKNOWN_EXPRESSION;\n\t\t}\n\t\tconst expression = this.getMemberExpression(key);\n\t\tif (!(expression === UNKNOWN_EXPRESSION || this.immutable)) {\n\t\t\tconst expressionsToBeDeoptimized = (this.expressionsToBeDeoptimizedByKey[key] =\n\t\t\t\tthis.expressionsToBeDeoptimizedByKey[key] || []);\n\t\t\texpressionsToBeDeoptimized.push(origin);\n\t\t}\n\t\treturn expression;\n\t}\n}\n","import {\n\tINTERACTION_CALLED,\n\tNodeInteraction,\n\tNodeInteractionWithThisArg\n} from '../../NodeInteractions';\nimport { ObjectPath, ObjectPathKey, UNKNOWN_PATH } from '../../utils/PathTracker';\nimport { ExpressionEntity, LiteralValueOrUnknown, UnknownValue } from './Expression';\nimport {\n\tMETHOD_RETURNS_BOOLEAN,\n\tMETHOD_RETURNS_STRING,\n\tMETHOD_RETURNS_UNKNOWN\n} from './MethodTypes';\nimport { ObjectEntity, type PropertyMap } from './ObjectEntity';\n\nconst isInteger = (prop: ObjectPathKey): boolean => typeof prop === 'string' && /^\\d+$/.test(prop);\n\n// This makes sure unknown properties are not handled as \"undefined\" but as\n// \"unknown\" but without access side effects. An exception is done for numeric\n// properties as we do not expect new builtin properties to be numbers, this\n// will improve tree-shaking for out-of-bounds array properties\nconst OBJECT_PROTOTYPE_FALLBACK: ExpressionEntity =\n\tnew (class ObjectPrototypeFallbackExpression extends ExpressionEntity {\n\t\tdeoptimizeThisOnInteractionAtPath(\n\t\t\t{ type, thisArg }: NodeInteractionWithThisArg,\n\t\t\tpath: ObjectPath\n\t\t): void {\n\t\t\tif (type === INTERACTION_CALLED && path.length === 1 && !isInteger(path[0])) {\n\t\t\t\tthisArg.deoptimizePath(UNKNOWN_PATH);\n\t\t\t}\n\t\t}\n\n\t\tgetLiteralValueAtPath(path: ObjectPath): LiteralValueOrUnknown {\n\t\t\t// We ignore number properties as we do not expect new properties to be\n\t\t\t// numbers and also want to keep handling out-of-bound array elements as\n\t\t\t// \"undefined\"\n\t\t\treturn path.length === 1 && isInteger(path[0]) ? undefined : UnknownValue;\n\t\t}\n\n\t\thasEffectsOnInteractionAtPath(path: ObjectPath, { type }: NodeInteraction): boolean {\n\t\t\treturn path.length > 1 || type === INTERACTION_CALLED;\n\t\t}\n\t})();\n\nexport const OBJECT_PROTOTYPE = new ObjectEntity(\n\t{\n\t\t__proto__: null,\n\t\thasOwnProperty: METHOD_RETURNS_BOOLEAN,\n\t\tisPrototypeOf: METHOD_RETURNS_BOOLEAN,\n\t\tpropertyIsEnumerable: METHOD_RETURNS_BOOLEAN,\n\t\ttoLocaleString: METHOD_RETURNS_STRING,\n\t\ttoString: METHOD_RETURNS_STRING,\n\t\tvalueOf: METHOD_RETURNS_UNKNOWN\n\t} as unknown as PropertyMap,\n\tOBJECT_PROTOTYPE_FALLBACK,\n\ttrue\n);\n","import { UnknownInteger } from '../../utils/PathTracker';\nimport { UNKNOWN_LITERAL_BOOLEAN, UNKNOWN_LITERAL_NUMBER } from '../../values';\nimport { type ExpressionEntity, UNKNOWN_EXPRESSION } from './Expression';\nimport {\n\tMethod,\n\tMETHOD_RETURNS_BOOLEAN,\n\tMETHOD_RETURNS_NUMBER,\n\tMETHOD_RETURNS_STRING,\n\tMETHOD_RETURNS_UNKNOWN\n} from './MethodTypes';\nimport { ObjectEntity, type ObjectProperty, type PropertyMap } from './ObjectEntity';\nimport { OBJECT_PROTOTYPE } from './ObjectPrototype';\n\nconst NEW_ARRAY_PROPERTIES: ObjectProperty[] = [\n\t{ key: UnknownInteger, kind: 'init', property: UNKNOWN_EXPRESSION },\n\t{ key: 'length', kind: 'init', property: UNKNOWN_LITERAL_NUMBER }\n];\n\nconst METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_BOOLEAN: [ExpressionEntity] = [\n\tnew Method({\n\t\tcallsArgs: [0],\n\t\tmutatesSelfAsArray: 'deopt-only',\n\t\treturns: null,\n\t\treturnsPrimitive: UNKNOWN_LITERAL_BOOLEAN\n\t})\n];\n\nconst METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_NUMBER: [ExpressionEntity] = [\n\tnew Method({\n\t\tcallsArgs: [0],\n\t\tmutatesSelfAsArray: 'deopt-only',\n\t\treturns: null,\n\t\treturnsPrimitive: UNKNOWN_LITERAL_NUMBER\n\t})\n];\n\nconst METHOD_MUTATES_SELF_RETURNS_NEW_ARRAY: [ExpressionEntity] = [\n\tnew Method({\n\t\tcallsArgs: null,\n\t\tmutatesSelfAsArray: true,\n\t\treturns: () => new ObjectEntity(NEW_ARRAY_PROPERTIES, ARRAY_PROTOTYPE),\n\t\treturnsPrimitive: null\n\t})\n];\n\nconst METHOD_DEOPTS_SELF_RETURNS_NEW_ARRAY: [ExpressionEntity] = [\n\tnew Method({\n\t\tcallsArgs: null,\n\t\tmutatesSelfAsArray: 'deopt-only',\n\t\treturns: () => new ObjectEntity(NEW_ARRAY_PROPERTIES, ARRAY_PROTOTYPE),\n\t\treturnsPrimitive: null\n\t})\n];\n\nconst METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_NEW_ARRAY: [ExpressionEntity] = [\n\tnew Method({\n\t\tcallsArgs: [0],\n\t\tmutatesSelfAsArray: 'deopt-only',\n\t\treturns: () => new ObjectEntity(NEW_ARRAY_PROPERTIES, ARRAY_PROTOTYPE),\n\t\treturnsPrimitive: null\n\t})\n];\n\nconst METHOD_MUTATES_SELF_RETURNS_NUMBER: [ExpressionEntity] = [\n\tnew Method({\n\t\tcallsArgs: null,\n\t\tmutatesSelfAsArray: true,\n\t\treturns: null,\n\t\treturnsPrimitive: UNKNOWN_LITERAL_NUMBER\n\t})\n];\n\nconst METHOD_MUTATES_SELF_RETURNS_UNKNOWN: [ExpressionEntity] = [\n\tnew Method({\n\t\tcallsArgs: null,\n\t\tmutatesSelfAsArray: true,\n\t\treturns: null,\n\t\treturnsPrimitive: UNKNOWN_EXPRESSION\n\t})\n];\n\nconst METHOD_DEOPTS_SELF_RETURNS_UNKNOWN: [ExpressionEntity] = [\n\tnew Method({\n\t\tcallsArgs: null,\n\t\tmutatesSelfAsArray: 'deopt-only',\n\t\treturns: null,\n\t\treturnsPrimitive: UNKNOWN_EXPRESSION\n\t})\n];\n\nconst METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_UNKNOWN: [ExpressionEntity] = [\n\tnew Method({\n\t\tcallsArgs: [0],\n\t\tmutatesSelfAsArray: 'deopt-only',\n\t\treturns: null,\n\t\treturnsPrimitive: UNKNOWN_EXPRESSION\n\t})\n];\n\nconst METHOD_MUTATES_SELF_RETURNS_SELF: [ExpressionEntity] = [\n\tnew Method({\n\t\tcallsArgs: null,\n\t\tmutatesSelfAsArray: true,\n\t\treturns: 'self',\n\t\treturnsPrimitive: null\n\t})\n];\n\nconst METHOD_CALLS_ARG_MUTATES_SELF_RETURNS_SELF: [ExpressionEntity] = [\n\tnew Method({\n\t\tcallsArgs: [0],\n\t\tmutatesSelfAsArray: true,\n\t\treturns: 'self',\n\t\treturnsPrimitive: null\n\t})\n];\n\nexport const ARRAY_PROTOTYPE = new ObjectEntity(\n\t{\n\t\t__proto__: null,\n\t\t// We assume that accessors have effects as we do not track the accessed value afterwards\n\t\tat: METHOD_DEOPTS_SELF_RETURNS_UNKNOWN,\n\t\tconcat: METHOD_DEOPTS_SELF_RETURNS_NEW_ARRAY,\n\t\tcopyWithin: METHOD_MUTATES_SELF_RETURNS_SELF,\n\t\tentries: METHOD_DEOPTS_SELF_RETURNS_NEW_ARRAY,\n\t\tevery: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_BOOLEAN,\n\t\tfill: METHOD_MUTATES_SELF_RETURNS_SELF,\n\t\tfilter: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_NEW_ARRAY,\n\t\tfind: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_UNKNOWN,\n\t\tfindIndex: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_NUMBER,\n\t\tfindLast: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_UNKNOWN,\n\t\tfindLastIndex: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_NUMBER,\n\t\tflat: METHOD_DEOPTS_SELF_RETURNS_NEW_ARRAY,\n\t\tflatMap: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_NEW_ARRAY,\n\t\tforEach: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_UNKNOWN,\n\t\tgroup: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_UNKNOWN,\n\t\tgroupToMap: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_UNKNOWN,\n\t\tincludes: METHOD_RETURNS_BOOLEAN,\n\t\tindexOf: METHOD_RETURNS_NUMBER,\n\t\tjoin: METHOD_RETURNS_STRING,\n\t\tkeys: METHOD_RETURNS_UNKNOWN,\n\t\tlastIndexOf: METHOD_RETURNS_NUMBER,\n\t\tmap: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_NEW_ARRAY,\n\t\tpop: METHOD_MUTATES_SELF_RETURNS_UNKNOWN,\n\t\tpush: METHOD_MUTATES_SELF_RETURNS_NUMBER,\n\t\treduce: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_UNKNOWN,\n\t\treduceRight: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_UNKNOWN,\n\t\treverse: METHOD_MUTATES_SELF_RETURNS_SELF,\n\t\tshift: METHOD_MUTATES_SELF_RETURNS_UNKNOWN,\n\t\tslice: METHOD_DEOPTS_SELF_RETURNS_NEW_ARRAY,\n\t\tsome: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_BOOLEAN,\n\t\tsort: METHOD_CALLS_ARG_MUTATES_SELF_RETURNS_SELF,\n\t\tsplice: METHOD_MUTATES_SELF_RETURNS_NEW_ARRAY,\n\t\ttoLocaleString: METHOD_RETURNS_STRING,\n\t\ttoString: METHOD_RETURNS_STRING,\n\t\tunshift: METHOD_MUTATES_SELF_RETURNS_NUMBER,\n\t\tvalues: METHOD_DEOPTS_SELF_RETURNS_UNKNOWN\n\t} as unknown as PropertyMap,\n\tOBJECT_PROTOTYPE,\n\ttrue\n);\n","import Module, { AstContext } from '../../Module';\nimport type { DeoptimizableEntity } from '../DeoptimizableEntity';\nimport { createInclusionContext, HasEffectsContext, InclusionContext } from '../ExecutionContext';\nimport type { NodeInteractionCalled, NodeInteractionWithThisArg } from '../NodeInteractions';\nimport {\n\tINTERACTION_ACCESSED,\n\tINTERACTION_ASSIGNED,\n\tINTERACTION_CALLED,\n\tNodeInteraction\n} from '../NodeInteractions';\nimport type ExportDefaultDeclaration from '../nodes/ExportDefaultDeclaration';\nimport type Identifier from '../nodes/Identifier';\nimport * as NodeType from '../nodes/NodeType';\nimport type SpreadElement from '../nodes/SpreadElement';\nimport {\n\ttype ExpressionEntity,\n\ttype LiteralValueOrUnknown,\n\tUNKNOWN_EXPRESSION,\n\tUnknownValue\n} from '../nodes/shared/Expression';\nimport type { Node } from '../nodes/shared/Node';\nimport { type ObjectPath, type PathTracker, UNKNOWN_PATH } from '../utils/PathTracker';\nimport Variable from './Variable';\n\nexport default class LocalVariable extends Variable {\n\tcalledFromTryStatement = false;\n\treadonly declarations: (Identifier | ExportDefaultDeclaration)[];\n\tinit: ExpressionEntity | null;\n\treadonly module: Module;\n\n\t// Caching and deoptimization:\n\t// We track deoptimization when we do not return something unknown\n\tprotected deoptimizationTracker: PathTracker;\n\tprivate additionalInitializers: ExpressionEntity[] | null = null;\n\tprivate expressionsToBeDeoptimized: DeoptimizableEntity[] = [];\n\n\tconstructor(\n\t\tname: string,\n\t\tdeclarator: Identifier | ExportDefaultDeclaration | null,\n\t\tinit: ExpressionEntity | null,\n\t\tcontext: AstContext\n\t) {\n\t\tsuper(name);\n\t\tthis.declarations = declarator ? [declarator] : [];\n\t\tthis.init = init;\n\t\tthis.deoptimizationTracker = context.deoptimizationTracker;\n\t\tthis.module = context.module;\n\t}\n\n\taddDeclaration(identifier: Identifier, init: ExpressionEntity | null): void {\n\t\tthis.declarations.push(identifier);\n\t\tconst additionalInitializers = this.markInitializersForDeoptimization();\n\t\tif (init !== null) {\n\t\t\tadditionalInitializers.push(init);\n\t\t}\n\t}\n\n\tconsolidateInitializers(): void {\n\t\tif (this.additionalInitializers !== null) {\n\t\t\tfor (const initializer of this.additionalInitializers) {\n\t\t\t\tinitializer.deoptimizePath(UNKNOWN_PATH);\n\t\t\t}\n\t\t\tthis.additionalInitializers = null;\n\t\t}\n\t}\n\n\tdeoptimizePath(path: ObjectPath): void {\n\t\tif (\n\t\t\tthis.isReassigned ||\n\t\t\tthis.deoptimizationTracker.trackEntityAtPathAndGetIfTracked(path, this)\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t\tif (path.length === 0) {\n\t\t\tif (!this.isReassigned) {\n\t\t\t\tthis.isReassigned = true;\n\t\t\t\tconst expressionsToBeDeoptimized = this.expressionsToBeDeoptimized;\n\t\t\t\tthis.expressionsToBeDeoptimized = [];\n\t\t\t\tfor (const expression of expressionsToBeDeoptimized) {\n\t\t\t\t\texpression.deoptimizeCache();\n\t\t\t\t}\n\t\t\t\tthis.init?.deoptimizePath(UNKNOWN_PATH);\n\t\t\t}\n\t\t} else {\n\t\t\tthis.init?.deoptimizePath(path);\n\t\t}\n\t}\n\n\tdeoptimizeThisOnInteractionAtPath(\n\t\tinteraction: NodeInteractionWithThisArg,\n\t\tpath: ObjectPath,\n\t\trecursionTracker: PathTracker\n\t): void {\n\t\tif (this.isReassigned || !this.init) {\n\t\t\treturn interaction.thisArg.deoptimizePath(UNKNOWN_PATH);\n\t\t}\n\t\trecursionTracker.withTrackedEntityAtPath(\n\t\t\tpath,\n\t\t\tthis.init,\n\t\t\t() => this.init!.deoptimizeThisOnInteractionAtPath(interaction, path, recursionTracker),\n\t\t\tundefined\n\t\t);\n\t}\n\n\tgetLiteralValueAtPath(\n\t\tpath: ObjectPath,\n\t\trecursionTracker: PathTracker,\n\t\torigin: DeoptimizableEntity\n\t): LiteralValueOrUnknown {\n\t\tif (this.isReassigned || !this.init) {\n\t\t\treturn UnknownValue;\n\t\t}\n\t\treturn recursionTracker.withTrackedEntityAtPath(\n\t\t\tpath,\n\t\t\tthis.init,\n\t\t\t() => {\n\t\t\t\tthis.expressionsToBeDeoptimized.push(origin);\n\t\t\t\treturn this.init!.getLiteralValueAtPath(path, recursionTracker, origin);\n\t\t\t},\n\t\t\tUnknownValue\n\t\t);\n\t}\n\n\tgetReturnExpressionWhenCalledAtPath(\n\t\tpath: ObjectPath,\n\t\tinteraction: NodeInteractionCalled,\n\t\trecursionTracker: PathTracker,\n\t\torigin: DeoptimizableEntity\n\t): ExpressionEntity {\n\t\tif (this.isReassigned || !this.init) {\n\t\t\treturn UNKNOWN_EXPRESSION;\n\t\t}\n\t\treturn recursionTracker.withTrackedEntityAtPath(\n\t\t\tpath,\n\t\t\tthis.init,\n\t\t\t() => {\n\t\t\t\tthis.expressionsToBeDeoptimized.push(origin);\n\t\t\t\treturn this.init!.getReturnExpressionWhenCalledAtPath(\n\t\t\t\t\tpath,\n\t\t\t\t\tinteraction,\n\t\t\t\t\trecursionTracker,\n\t\t\t\t\torigin\n\t\t\t\t);\n\t\t\t},\n\t\t\tUNKNOWN_EXPRESSION\n\t\t);\n\t}\n\n\thasEffectsOnInteractionAtPath(\n\t\tpath: ObjectPath,\n\t\tinteraction: NodeInteraction,\n\t\tcontext: HasEffectsContext\n\t): boolean {\n\t\tswitch (interaction.type) {\n\t\t\tcase INTERACTION_ACCESSED:\n\t\t\t\tif (this.isReassigned) return true;\n\t\t\t\treturn (this.init &&\n\t\t\t\t\t!context.accessed.trackEntityAtPathAndGetIfTracked(path, this) &&\n\t\t\t\t\tthis.init.hasEffectsOnInteractionAtPath(path, interaction, context))!;\n\t\t\tcase INTERACTION_ASSIGNED:\n\t\t\t\tif (this.included) return true;\n\t\t\t\tif (path.length === 0) return false;\n\t\t\t\tif (this.isReassigned) return true;\n\t\t\t\treturn (this.init &&\n\t\t\t\t\t!context.assigned.trackEntityAtPathAndGetIfTracked(path, this) &&\n\t\t\t\t\tthis.init.hasEffectsOnInteractionAtPath(path, interaction, context))!;\n\t\t\tcase INTERACTION_CALLED:\n\t\t\t\tif (this.isReassigned) return true;\n\t\t\t\treturn (this.init &&\n\t\t\t\t\t!(\n\t\t\t\t\t\tinteraction.withNew ? context.instantiated : context.called\n\t\t\t\t\t).trackEntityAtPathAndGetIfTracked(path, interaction.args, this) &&\n\t\t\t\t\tthis.init.hasEffectsOnInteractionAtPath(path, interaction, context))!;\n\t\t}\n\t}\n\n\tinclude(): void {\n\t\tif (!this.included) {\n\t\t\tthis.included = true;\n\t\t\tfor (const declaration of this.declarations) {\n\t\t\t\t// If node is a default export, it can save a tree-shaking run to include the full declaration now\n\t\t\t\tif (!declaration.included) declaration.include(createInclusionContext(), false);\n\t\t\t\tlet node = declaration.parent as Node;\n\t\t\t\twhile (!node.included) {\n\t\t\t\t\t// We do not want to properly include parents in case they are part of a dead branch\n\t\t\t\t\t// in which case .include() might pull in more dead code\n\t\t\t\t\tnode.included = true;\n\t\t\t\t\tif (node.type === NodeType.Program) break;\n\t\t\t\t\tnode = node.parent as Node;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tincludeCallArguments(\n\t\tcontext: InclusionContext,\n\t\targs: readonly (ExpressionEntity | SpreadElement)[]\n\t): void {\n\t\tif (this.isReassigned || (this.init && context.includedCallArguments.has(this.init))) {\n\t\t\tfor (const arg of args) {\n\t\t\t\targ.include(context, false);\n\t\t\t}\n\t\t} else if (this.init) {\n\t\t\tcontext.includedCallArguments.add(this.init);\n\t\t\tthis.init.includeCallArguments(context, args);\n\t\t\tcontext.includedCallArguments.delete(this.init);\n\t\t}\n\t}\n\n\tmarkCalledFromTryStatement(): void {\n\t\tthis.calledFromTryStatement = true;\n\t}\n\n\tmarkInitializersForDeoptimization(): ExpressionEntity[] {\n\t\tif (this.additionalInitializers === null) {\n\t\t\tthis.additionalInitializers = this.init === null ? [] : [this.init];\n\t\t\tthis.init = UNKNOWN_EXPRESSION;\n\t\t\tthis.isReassigned = true;\n\t\t}\n\t\treturn this.additionalInitializers;\n\t}\n}\n","const chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_$';\nconst base = 64;\n\nexport function toBase64(num: number): string {\n\tlet outStr = '';\n\tdo {\n\t\tconst curDigit = num % base;\n\t\tnum = Math.floor(num / base);\n\t\toutStr = chars[curDigit] + outStr;\n\t} while (num !== 0);\n\treturn outStr;\n}\n","import RESERVED_NAMES from './RESERVED_NAMES';\nimport { toBase64 } from './base64';\n\nexport function getSafeName(baseName: string, usedNames: Set): string {\n\tlet safeName = baseName;\n\tlet count = 1;\n\twhile (usedNames.has(safeName) || RESERVED_NAMES.has(safeName)) {\n\t\tsafeName = `${baseName}$${toBase64(count++)}`;\n\t}\n\tusedNames.add(safeName);\n\treturn safeName;\n}\n","import type { AstContext } from '../../Module';\nimport type Identifier from '../nodes/Identifier';\nimport type { ExpressionEntity } from '../nodes/shared/Expression';\nimport { UNDEFINED_EXPRESSION } from '../values';\nimport LocalVariable from '../variables/LocalVariable';\nimport type Variable from '../variables/Variable';\nimport type ChildScope from './ChildScope';\n\nexport default class Scope {\n\tchildren: ChildScope[] = [];\n\tvariables = new Map();\n\n\taddDeclaration(\n\t\tidentifier: Identifier,\n\t\tcontext: AstContext,\n\t\tinit: ExpressionEntity | null,\n\t\t_isHoisted: boolean\n\t): LocalVariable {\n\t\tconst name = identifier.name;\n\t\tlet variable = this.variables.get(name) as LocalVariable;\n\t\tif (variable) {\n\t\t\tvariable.addDeclaration(identifier, init);\n\t\t} else {\n\t\t\tvariable = new LocalVariable(\n\t\t\t\tidentifier.name,\n\t\t\t\tidentifier,\n\t\t\t\tinit || UNDEFINED_EXPRESSION,\n\t\t\t\tcontext\n\t\t\t);\n\t\t\tthis.variables.set(name, variable);\n\t\t}\n\t\treturn variable;\n\t}\n\n\tcontains(name: string): boolean {\n\t\treturn this.variables.has(name);\n\t}\n\n\tfindVariable(_name: string): Variable {\n\t\tthrow new Error('Internal Error: findVariable needs to be implemented by a subclass');\n\t}\n}\n","import type { InternalModuleFormat } from '../../rollup/types';\nimport { getSafeName } from '../../utils/safeName';\nimport type ImportExpression from '../nodes/ImportExpression';\nimport type { ExpressionEntity } from '../nodes/shared/Expression';\nimport type Variable from '../variables/Variable';\nimport Scope from './Scope';\n\nexport default class ChildScope extends Scope {\n\treadonly accessedOutsideVariables = new Map();\n\tparent: Scope;\n\tprivate declare accessedDynamicImports?: Set;\n\n\tconstructor(parent: Scope) {\n\t\tsuper();\n\t\tthis.parent = parent;\n\t\tparent.children.push(this);\n\t}\n\n\taddAccessedDynamicImport(importExpression: ImportExpression): void {\n\t\t(this.accessedDynamicImports || (this.accessedDynamicImports = new Set())).add(\n\t\t\timportExpression\n\t\t);\n\t\tif (this.parent instanceof ChildScope) {\n\t\t\tthis.parent.addAccessedDynamicImport(importExpression);\n\t\t}\n\t}\n\n\taddAccessedGlobals(\n\t\tglobals: readonly string[],\n\t\taccessedGlobalsByScope: Map>\n\t): void {\n\t\tconst accessedGlobals = accessedGlobalsByScope.get(this) || new Set();\n\t\tfor (const name of globals) {\n\t\t\taccessedGlobals.add(name);\n\t\t}\n\t\taccessedGlobalsByScope.set(this, accessedGlobals);\n\t\tif (this.parent instanceof ChildScope) {\n\t\t\tthis.parent.addAccessedGlobals(globals, accessedGlobalsByScope);\n\t\t}\n\t}\n\n\taddNamespaceMemberAccess(name: string, variable: Variable): void {\n\t\tthis.accessedOutsideVariables.set(name, variable);\n\t\t(this.parent as ChildScope).addNamespaceMemberAccess(name, variable);\n\t}\n\n\taddReturnExpression(expression: ExpressionEntity): void {\n\t\tthis.parent instanceof ChildScope && this.parent.addReturnExpression(expression);\n\t}\n\n\taddUsedOutsideNames(\n\t\tusedNames: Set,\n\t\tformat: InternalModuleFormat,\n\t\texportNamesByVariable: ReadonlyMap,\n\t\taccessedGlobalsByScope: ReadonlyMap>\n\t): void {\n\t\tfor (const variable of this.accessedOutsideVariables.values()) {\n\t\t\tif (variable.included) {\n\t\t\t\tusedNames.add(variable.getBaseVariableName());\n\t\t\t\tif (format === 'system' && exportNamesByVariable.has(variable)) {\n\t\t\t\t\tusedNames.add('exports');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tconst accessedGlobals = accessedGlobalsByScope.get(this);\n\t\tif (accessedGlobals) {\n\t\t\tfor (const name of accessedGlobals) {\n\t\t\t\tusedNames.add(name);\n\t\t\t}\n\t\t}\n\t}\n\n\tcontains(name: string): boolean {\n\t\treturn this.variables.has(name) || this.parent.contains(name);\n\t}\n\n\tdeconflict(\n\t\tformat: InternalModuleFormat,\n\t\texportNamesByVariable: ReadonlyMap,\n\t\taccessedGlobalsByScope: ReadonlyMap>\n\t): void {\n\t\tconst usedNames = new Set();\n\t\tthis.addUsedOutsideNames(usedNames, format, exportNamesByVariable, accessedGlobalsByScope);\n\t\tif (this.accessedDynamicImports) {\n\t\t\tfor (const importExpression of this.accessedDynamicImports) {\n\t\t\t\tif (importExpression.inlineNamespace) {\n\t\t\t\t\tusedNames.add(importExpression.inlineNamespace.getBaseVariableName());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor (const [name, variable] of this.variables) {\n\t\t\tif (variable.included || variable.alwaysRendered) {\n\t\t\t\tvariable.setRenderNames(null, getSafeName(name, usedNames));\n\t\t\t}\n\t\t}\n\t\tfor (const scope of this.children) {\n\t\t\tscope.deconflict(format, exportNamesByVariable, accessedGlobalsByScope);\n\t\t}\n\t}\n\n\tfindLexicalBoundary(): ChildScope {\n\t\treturn (this.parent as ChildScope).findLexicalBoundary();\n\t}\n\n\tfindVariable(name: string): Variable {\n\t\tconst knownVariable = this.variables.get(name) || this.accessedOutsideVariables.get(name);\n\t\tif (knownVariable) {\n\t\t\treturn knownVariable;\n\t\t}\n\t\tconst variable = this.parent.findVariable(name);\n\t\tthis.accessedOutsideVariables.set(name, variable);\n\t\treturn variable;\n\t}\n}\n","import type { AstContext } from '../../Module';\nimport type { InclusionContext } from '../ExecutionContext';\nimport type Identifier from '../nodes/Identifier';\nimport SpreadElement from '../nodes/SpreadElement';\nimport { ExpressionEntity, UNKNOWN_EXPRESSION } from '../nodes/shared/Expression';\nimport LocalVariable from '../variables/LocalVariable';\nimport ChildScope from './ChildScope';\nimport type Scope from './Scope';\n\nexport default class ParameterScope extends ChildScope {\n\treadonly hoistedBodyVarScope: ChildScope;\n\n\tprotected parameters: readonly LocalVariable[][] = [];\n\tprivate context: AstContext;\n\tprivate hasRest = false;\n\n\tconstructor(parent: Scope, context: AstContext) {\n\t\tsuper(parent);\n\t\tthis.context = context;\n\t\tthis.hoistedBodyVarScope = new ChildScope(this);\n\t}\n\n\t/**\n\t * Adds a parameter to this scope. Parameters must be added in the correct\n\t * order, e.g. from left to right.\n\t */\n\taddParameterDeclaration(identifier: Identifier): LocalVariable {\n\t\tconst name = identifier.name;\n\t\tlet variable = this.hoistedBodyVarScope.variables.get(name) as LocalVariable;\n\t\tif (variable) {\n\t\t\tvariable.addDeclaration(identifier, null);\n\t\t} else {\n\t\t\tvariable = new LocalVariable(name, identifier, UNKNOWN_EXPRESSION, this.context);\n\t\t}\n\t\tthis.variables.set(name, variable);\n\t\treturn variable;\n\t}\n\n\taddParameterVariables(parameters: LocalVariable[][], hasRest: boolean): void {\n\t\tthis.parameters = parameters;\n\t\tfor (const parameterList of parameters) {\n\t\t\tfor (const parameter of parameterList) {\n\t\t\t\tparameter.alwaysRendered = true;\n\t\t\t}\n\t\t}\n\t\tthis.hasRest = hasRest;\n\t}\n\n\tincludeCallArguments(\n\t\tcontext: InclusionContext,\n\t\targs: readonly (ExpressionEntity | SpreadElement)[]\n\t): void {\n\t\tlet calledFromTryStatement = false;\n\t\tlet argIncluded = false;\n\t\tconst restParam = this.hasRest && this.parameters[this.parameters.length - 1];\n\t\tfor (const checkedArg of args) {\n\t\t\tif (checkedArg instanceof SpreadElement) {\n\t\t\t\tfor (const arg of args) {\n\t\t\t\t\targ.include(context, false);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tfor (let index = args.length - 1; index >= 0; index--) {\n\t\t\tconst paramVars = this.parameters[index] || restParam;\n\t\t\tconst arg = args[index];\n\t\t\tif (paramVars) {\n\t\t\t\tcalledFromTryStatement = false;\n\t\t\t\tif (paramVars.length === 0) {\n\t\t\t\t\t// handle empty destructuring\n\t\t\t\t\targIncluded = true;\n\t\t\t\t} else {\n\t\t\t\t\tfor (const variable of paramVars) {\n\t\t\t\t\t\tif (variable.included) {\n\t\t\t\t\t\t\targIncluded = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (variable.calledFromTryStatement) {\n\t\t\t\t\t\t\tcalledFromTryStatement = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!argIncluded && arg.shouldBeIncluded(context)) {\n\t\t\t\targIncluded = true;\n\t\t\t}\n\t\t\tif (argIncluded) {\n\t\t\t\targ.include(context, calledFromTryStatement);\n\t\t\t}\n\t\t}\n\t}\n}\n","import { type ExpressionEntity, UNKNOWN_EXPRESSION } from '../nodes/shared/Expression';\nimport { UNKNOWN_PATH } from '../utils/PathTracker';\nimport ParameterScope from './ParameterScope';\n\nexport default class ReturnValueScope extends ParameterScope {\n\tprivate returnExpression: ExpressionEntity | null = null;\n\tprivate returnExpressions: ExpressionEntity[] = [];\n\n\taddReturnExpression(expression: ExpressionEntity): void {\n\t\tthis.returnExpressions.push(expression);\n\t}\n\n\tgetReturnExpression(): ExpressionEntity {\n\t\tif (this.returnExpression === null) this.updateReturnExpression();\n\t\treturn this.returnExpression!;\n\t}\n\n\tprivate updateReturnExpression() {\n\t\tif (this.returnExpressions.length === 1) {\n\t\t\tthis.returnExpression = this.returnExpressions[0];\n\t\t} else {\n\t\t\tthis.returnExpression = UNKNOWN_EXPRESSION;\n\t\t\tfor (const expression of this.returnExpressions) {\n\t\t\t\texpression.deoptimizePath(UNKNOWN_PATH);\n\t\t\t}\n\t\t}\n\t}\n}\n","//@ts-check\n/** @typedef { import('estree').Node} Node */\n/** @typedef {Node | {\n * type: 'PropertyDefinition';\n * computed: boolean;\n * value: Node\n * }} NodeWithPropertyDefinition */\n\n/**\n *\n * @param {NodeWithPropertyDefinition} node\n * @param {NodeWithPropertyDefinition} parent\n * @returns boolean\n */\nexport default function is_reference (node, parent) {\n\tif (node.type === 'MemberExpression') {\n\t\treturn !node.computed && is_reference(node.object, node);\n\t}\n\n\tif (node.type === 'Identifier') {\n\t\tif (!parent) return true;\n\n\t\tswitch (parent.type) {\n\t\t\t// disregard `bar` in `foo.bar`\n\t\t\tcase 'MemberExpression': return parent.computed || node === parent.object;\n\n\t\t\t// disregard the `foo` in `class {foo(){}}` but keep it in `class {[foo](){}}`\n\t\t\tcase 'MethodDefinition': return parent.computed;\n\n\t\t\t// disregard the `foo` in `class {foo=bar}` but keep it in `class {[foo]=bar}` and `class {bar=foo}`\n\t\t\tcase 'PropertyDefinition': return parent.computed || node === parent.value;\n\n\t\t\t// disregard the `bar` in `{ bar: foo }`, but keep it in `{ [bar]: foo }`\n\t\t\tcase 'Property': return parent.computed || node === parent.value;\n\n\t\t\t// disregard the `bar` in `export { foo as bar }` or\n\t\t\t// the foo in `import { foo as bar }`\n\t\t\tcase 'ExportSpecifier':\n\t\t\tcase 'ImportSpecifier': return node === parent.local;\n\n\t\t\t// disregard the `foo` in `foo: while (...) { ... break foo; ... continue foo;}`\n\t\t\tcase 'LabeledStatement':\n\t\t\tcase 'BreakStatement':\n\t\t\tcase 'ContinueStatement': return false;\n\t\t\tdefault: return true;\n\t\t}\n\t}\n\n\treturn false;\n}\n","/* eslint sort-keys: \"off\" */\n\nimport { HasEffectsContext } from '../../ExecutionContext';\nimport { NODE_INTERACTION_UNKNOWN_ASSIGNMENT, NodeInteractionCalled } from '../../NodeInteractions';\nimport type { ObjectPath } from '../../utils/PathTracker';\nimport { UNKNOWN_NON_ACCESSOR_PATH } from '../../utils/PathTracker';\n\nconst ValueProperties = Symbol('Value Properties');\n\ninterface ValueDescription {\n\thasEffectsWhenCalled(interaction: NodeInteractionCalled, context: HasEffectsContext): boolean;\n}\n\ninterface GlobalDescription {\n\t[pathKey: string]: GlobalDescription | null;\n\t[ValueProperties]: ValueDescription;\n\t__proto__: null;\n}\n\nconst PURE: ValueDescription = {\n\thasEffectsWhenCalled() {\n\t\treturn false;\n\t}\n};\n\nconst IMPURE: ValueDescription = {\n\thasEffectsWhenCalled() {\n\t\treturn true;\n\t}\n};\n\n// We use shortened variables to reduce file size here\n/* OBJECT */\nconst O: GlobalDescription = {\n\t__proto__: null,\n\t[ValueProperties]: IMPURE\n};\n\n/* PURE FUNCTION */\nconst PF: GlobalDescription = {\n\t__proto__: null,\n\t[ValueProperties]: PURE\n};\n\n/* FUNCTION THAT MUTATES FIRST ARG WITHOUT TRIGGERING ACCESSORS */\nconst MUTATES_ARG_WITHOUT_ACCESSOR: GlobalDescription = {\n\t__proto__: null,\n\t[ValueProperties]: {\n\t\thasEffectsWhenCalled({ args }, context) {\n\t\t\treturn (\n\t\t\t\t!args.length ||\n\t\t\t\targs[0].hasEffectsOnInteractionAtPath(\n\t\t\t\t\tUNKNOWN_NON_ACCESSOR_PATH,\n\t\t\t\t\tNODE_INTERACTION_UNKNOWN_ASSIGNMENT,\n\t\t\t\t\tcontext\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t}\n};\n\n/* CONSTRUCTOR */\nconst C: GlobalDescription = {\n\t__proto__: null,\n\t[ValueProperties]: IMPURE,\n\tprototype: O\n};\n\n/* PURE CONSTRUCTOR */\nconst PC: GlobalDescription = {\n\t__proto__: null,\n\t[ValueProperties]: PURE,\n\tprototype: O\n};\n\nconst ARRAY_TYPE: GlobalDescription = {\n\t__proto__: null,\n\t[ValueProperties]: PURE,\n\tfrom: PF,\n\tof: PF,\n\tprototype: O\n};\n\nconst INTL_MEMBER: GlobalDescription = {\n\t__proto__: null,\n\t[ValueProperties]: PURE,\n\tsupportedLocalesOf: PC\n};\n\nconst knownGlobals: GlobalDescription = {\n\t// Placeholders for global objects to avoid shape mutations\n\tglobal: O,\n\tglobalThis: O,\n\tself: O,\n\twindow: O,\n\n\t// Common globals\n\t__proto__: null,\n\t[ValueProperties]: IMPURE,\n\tArray: {\n\t\t__proto__: null,\n\t\t[ValueProperties]: IMPURE,\n\t\tfrom: O,\n\t\tisArray: PF,\n\t\tof: PF,\n\t\tprototype: O\n\t},\n\tArrayBuffer: {\n\t\t__proto__: null,\n\t\t[ValueProperties]: PURE,\n\t\tisView: PF,\n\t\tprototype: O\n\t},\n\tAtomics: O,\n\tBigInt: C,\n\tBigInt64Array: C,\n\tBigUint64Array: C,\n\tBoolean: PC,\n\tconstructor: C,\n\tDataView: PC,\n\tDate: {\n\t\t__proto__: null,\n\t\t[ValueProperties]: PURE,\n\t\tnow: PF,\n\t\tparse: PF,\n\t\tprototype: O,\n\t\tUTC: PF\n\t},\n\tdecodeURI: PF,\n\tdecodeURIComponent: PF,\n\tencodeURI: PF,\n\tencodeURIComponent: PF,\n\tError: PC,\n\tescape: PF,\n\teval: O,\n\tEvalError: PC,\n\tFloat32Array: ARRAY_TYPE,\n\tFloat64Array: ARRAY_TYPE,\n\tFunction: C,\n\thasOwnProperty: O,\n\tInfinity: O,\n\tInt16Array: ARRAY_TYPE,\n\tInt32Array: ARRAY_TYPE,\n\tInt8Array: ARRAY_TYPE,\n\tisFinite: PF,\n\tisNaN: PF,\n\tisPrototypeOf: O,\n\tJSON: O,\n\tMap: PC,\n\tMath: {\n\t\t__proto__: null,\n\t\t[ValueProperties]: IMPURE,\n\t\tabs: PF,\n\t\tacos: PF,\n\t\tacosh: PF,\n\t\tasin: PF,\n\t\tasinh: PF,\n\t\tatan: PF,\n\t\tatan2: PF,\n\t\tatanh: PF,\n\t\tcbrt: PF,\n\t\tceil: PF,\n\t\tclz32: PF,\n\t\tcos: PF,\n\t\tcosh: PF,\n\t\texp: PF,\n\t\texpm1: PF,\n\t\tfloor: PF,\n\t\tfround: PF,\n\t\thypot: PF,\n\t\timul: PF,\n\t\tlog: PF,\n\t\tlog10: PF,\n\t\tlog1p: PF,\n\t\tlog2: PF,\n\t\tmax: PF,\n\t\tmin: PF,\n\t\tpow: PF,\n\t\trandom: PF,\n\t\tround: PF,\n\t\tsign: PF,\n\t\tsin: PF,\n\t\tsinh: PF,\n\t\tsqrt: PF,\n\t\ttan: PF,\n\t\ttanh: PF,\n\t\ttrunc: PF\n\t},\n\tNaN: O,\n\tNumber: {\n\t\t__proto__: null,\n\t\t[ValueProperties]: PURE,\n\t\tisFinite: PF,\n\t\tisInteger: PF,\n\t\tisNaN: PF,\n\t\tisSafeInteger: PF,\n\t\tparseFloat: PF,\n\t\tparseInt: PF,\n\t\tprototype: O\n\t},\n\tObject: {\n\t\t__proto__: null,\n\t\t[ValueProperties]: PURE,\n\t\tcreate: PF,\n\t\t// Technically those can throw in certain situations, but we ignore this as\n\t\t// code that relies on this will hopefully wrap this in a try-catch, which\n\t\t// deoptimizes everything anyway\n\t\tdefineProperty: MUTATES_ARG_WITHOUT_ACCESSOR,\n\t\tdefineProperties: MUTATES_ARG_WITHOUT_ACCESSOR,\n\t\tgetOwnPropertyDescriptor: PF,\n\t\tgetOwnPropertyNames: PF,\n\t\tgetOwnPropertySymbols: PF,\n\t\tgetPrototypeOf: PF,\n\t\thasOwn: PF,\n\t\tis: PF,\n\t\tisExtensible: PF,\n\t\tisFrozen: PF,\n\t\tisSealed: PF,\n\t\tkeys: PF,\n\t\tfromEntries: PF,\n\t\tentries: PF,\n\t\tprototype: O\n\t},\n\tparseFloat: PF,\n\tparseInt: PF,\n\tPromise: {\n\t\t__proto__: null,\n\t\t[ValueProperties]: IMPURE,\n\t\tall: O,\n\t\tprototype: O,\n\t\trace: O,\n\t\treject: O,\n\t\tresolve: O\n\t},\n\tpropertyIsEnumerable: O,\n\tProxy: O,\n\tRangeError: PC,\n\tReferenceError: PC,\n\tReflect: O,\n\tRegExp: PC,\n\tSet: PC,\n\tSharedArrayBuffer: C,\n\tString: {\n\t\t__proto__: null,\n\t\t[ValueProperties]: PURE,\n\t\tfromCharCode: PF,\n\t\tfromCodePoint: PF,\n\t\tprototype: O,\n\t\traw: PF\n\t},\n\tSymbol: {\n\t\t__proto__: null,\n\t\t[ValueProperties]: PURE,\n\t\tfor: PF,\n\t\tkeyFor: PF,\n\t\tprototype: O\n\t},\n\tSyntaxError: PC,\n\ttoLocaleString: O,\n\ttoString: O,\n\tTypeError: PC,\n\tUint16Array: ARRAY_TYPE,\n\tUint32Array: ARRAY_TYPE,\n\tUint8Array: ARRAY_TYPE,\n\tUint8ClampedArray: ARRAY_TYPE,\n\t// Technically, this is a global, but it needs special handling\n\t// undefined: ?,\n\tunescape: PF,\n\tURIError: PC,\n\tvalueOf: O,\n\tWeakMap: PC,\n\tWeakSet: PC,\n\n\t// Additional globals shared by Node and Browser that are not strictly part of the language\n\tclearInterval: C,\n\tclearTimeout: C,\n\tconsole: O,\n\tIntl: {\n\t\t__proto__: null,\n\t\t[ValueProperties]: IMPURE,\n\t\tCollator: INTL_MEMBER,\n\t\tDateTimeFormat: INTL_MEMBER,\n\t\tListFormat: INTL_MEMBER,\n\t\tNumberFormat: INTL_MEMBER,\n\t\tPluralRules: INTL_MEMBER,\n\t\tRelativeTimeFormat: INTL_MEMBER\n\t},\n\tsetInterval: C,\n\tsetTimeout: C,\n\tTextDecoder: C,\n\tTextEncoder: C,\n\tURL: C,\n\tURLSearchParams: C,\n\n\t// Browser specific globals\n\tAbortController: C,\n\tAbortSignal: C,\n\taddEventListener: O,\n\talert: O,\n\tAnalyserNode: C,\n\tAnimation: C,\n\tAnimationEvent: C,\n\tapplicationCache: O,\n\tApplicationCache: C,\n\tApplicationCacheErrorEvent: C,\n\tatob: O,\n\tAttr: C,\n\tAudio: C,\n\tAudioBuffer: C,\n\tAudioBufferSourceNode: C,\n\tAudioContext: C,\n\tAudioDestinationNode: C,\n\tAudioListener: C,\n\tAudioNode: C,\n\tAudioParam: C,\n\tAudioProcessingEvent: C,\n\tAudioScheduledSourceNode: C,\n\tAudioWorkletNode: C,\n\tBarProp: C,\n\tBaseAudioContext: C,\n\tBatteryManager: C,\n\tBeforeUnloadEvent: C,\n\tBiquadFilterNode: C,\n\tBlob: C,\n\tBlobEvent: C,\n\tblur: O,\n\tBroadcastChannel: C,\n\tbtoa: O,\n\tByteLengthQueuingStrategy: C,\n\tCache: C,\n\tcaches: O,\n\tCacheStorage: C,\n\tcancelAnimationFrame: O,\n\tcancelIdleCallback: O,\n\tCanvasCaptureMediaStreamTrack: C,\n\tCanvasGradient: C,\n\tCanvasPattern: C,\n\tCanvasRenderingContext2D: C,\n\tChannelMergerNode: C,\n\tChannelSplitterNode: C,\n\tCharacterData: C,\n\tclientInformation: O,\n\tClipboardEvent: C,\n\tclose: O,\n\tclosed: O,\n\tCloseEvent: C,\n\tComment: C,\n\tCompositionEvent: C,\n\tconfirm: O,\n\tConstantSourceNode: C,\n\tConvolverNode: C,\n\tCountQueuingStrategy: C,\n\tcreateImageBitmap: O,\n\tCredential: C,\n\tCredentialsContainer: C,\n\tcrypto: O,\n\tCrypto: C,\n\tCryptoKey: C,\n\tCSS: C,\n\tCSSConditionRule: C,\n\tCSSFontFaceRule: C,\n\tCSSGroupingRule: C,\n\tCSSImportRule: C,\n\tCSSKeyframeRule: C,\n\tCSSKeyframesRule: C,\n\tCSSMediaRule: C,\n\tCSSNamespaceRule: C,\n\tCSSPageRule: C,\n\tCSSRule: C,\n\tCSSRuleList: C,\n\tCSSStyleDeclaration: C,\n\tCSSStyleRule: C,\n\tCSSStyleSheet: C,\n\tCSSSupportsRule: C,\n\tCustomElementRegistry: C,\n\tcustomElements: O,\n\tCustomEvent: C,\n\tDataTransfer: C,\n\tDataTransferItem: C,\n\tDataTransferItemList: C,\n\tdefaultstatus: O,\n\tdefaultStatus: O,\n\tDelayNode: C,\n\tDeviceMotionEvent: C,\n\tDeviceOrientationEvent: C,\n\tdevicePixelRatio: O,\n\tdispatchEvent: O,\n\tdocument: O,\n\tDocument: C,\n\tDocumentFragment: C,\n\tDocumentType: C,\n\tDOMError: C,\n\tDOMException: C,\n\tDOMImplementation: C,\n\tDOMMatrix: C,\n\tDOMMatrixReadOnly: C,\n\tDOMParser: C,\n\tDOMPoint: C,\n\tDOMPointReadOnly: C,\n\tDOMQuad: C,\n\tDOMRect: C,\n\tDOMRectReadOnly: C,\n\tDOMStringList: C,\n\tDOMStringMap: C,\n\tDOMTokenList: C,\n\tDragEvent: C,\n\tDynamicsCompressorNode: C,\n\tElement: C,\n\tErrorEvent: C,\n\tEvent: C,\n\tEventSource: C,\n\tEventTarget: C,\n\texternal: O,\n\tfetch: O,\n\tFile: C,\n\tFileList: C,\n\tFileReader: C,\n\tfind: O,\n\tfocus: O,\n\tFocusEvent: C,\n\tFontFace: C,\n\tFontFaceSetLoadEvent: C,\n\tFormData: C,\n\tframes: O,\n\tGainNode: C,\n\tGamepad: C,\n\tGamepadButton: C,\n\tGamepadEvent: C,\n\tgetComputedStyle: O,\n\tgetSelection: O,\n\tHashChangeEvent: C,\n\tHeaders: C,\n\thistory: O,\n\tHistory: C,\n\tHTMLAllCollection: C,\n\tHTMLAnchorElement: C,\n\tHTMLAreaElement: C,\n\tHTMLAudioElement: C,\n\tHTMLBaseElement: C,\n\tHTMLBodyElement: C,\n\tHTMLBRElement: C,\n\tHTMLButtonElement: C,\n\tHTMLCanvasElement: C,\n\tHTMLCollection: C,\n\tHTMLContentElement: C,\n\tHTMLDataElement: C,\n\tHTMLDataListElement: C,\n\tHTMLDetailsElement: C,\n\tHTMLDialogElement: C,\n\tHTMLDirectoryElement: C,\n\tHTMLDivElement: C,\n\tHTMLDListElement: C,\n\tHTMLDocument: C,\n\tHTMLElement: C,\n\tHTMLEmbedElement: C,\n\tHTMLFieldSetElement: C,\n\tHTMLFontElement: C,\n\tHTMLFormControlsCollection: C,\n\tHTMLFormElement: C,\n\tHTMLFrameElement: C,\n\tHTMLFrameSetElement: C,\n\tHTMLHeadElement: C,\n\tHTMLHeadingElement: C,\n\tHTMLHRElement: C,\n\tHTMLHtmlElement: C,\n\tHTMLIFrameElement: C,\n\tHTMLImageElement: C,\n\tHTMLInputElement: C,\n\tHTMLLabelElement: C,\n\tHTMLLegendElement: C,\n\tHTMLLIElement: C,\n\tHTMLLinkElement: C,\n\tHTMLMapElement: C,\n\tHTMLMarqueeElement: C,\n\tHTMLMediaElement: C,\n\tHTMLMenuElement: C,\n\tHTMLMetaElement: C,\n\tHTMLMeterElement: C,\n\tHTMLModElement: C,\n\tHTMLObjectElement: C,\n\tHTMLOListElement: C,\n\tHTMLOptGroupElement: C,\n\tHTMLOptionElement: C,\n\tHTMLOptionsCollection: C,\n\tHTMLOutputElement: C,\n\tHTMLParagraphElement: C,\n\tHTMLParamElement: C,\n\tHTMLPictureElement: C,\n\tHTMLPreElement: C,\n\tHTMLProgressElement: C,\n\tHTMLQuoteElement: C,\n\tHTMLScriptElement: C,\n\tHTMLSelectElement: C,\n\tHTMLShadowElement: C,\n\tHTMLSlotElement: C,\n\tHTMLSourceElement: C,\n\tHTMLSpanElement: C,\n\tHTMLStyleElement: C,\n\tHTMLTableCaptionElement: C,\n\tHTMLTableCellElement: C,\n\tHTMLTableColElement: C,\n\tHTMLTableElement: C,\n\tHTMLTableRowElement: C,\n\tHTMLTableSectionElement: C,\n\tHTMLTemplateElement: C,\n\tHTMLTextAreaElement: C,\n\tHTMLTimeElement: C,\n\tHTMLTitleElement: C,\n\tHTMLTrackElement: C,\n\tHTMLUListElement: C,\n\tHTMLUnknownElement: C,\n\tHTMLVideoElement: C,\n\tIDBCursor: C,\n\tIDBCursorWithValue: C,\n\tIDBDatabase: C,\n\tIDBFactory: C,\n\tIDBIndex: C,\n\tIDBKeyRange: C,\n\tIDBObjectStore: C,\n\tIDBOpenDBRequest: C,\n\tIDBRequest: C,\n\tIDBTransaction: C,\n\tIDBVersionChangeEvent: C,\n\tIdleDeadline: C,\n\tIIRFilterNode: C,\n\tImage: C,\n\tImageBitmap: C,\n\tImageBitmapRenderingContext: C,\n\tImageCapture: C,\n\tImageData: C,\n\tindexedDB: O,\n\tinnerHeight: O,\n\tinnerWidth: O,\n\tInputEvent: C,\n\tIntersectionObserver: C,\n\tIntersectionObserverEntry: C,\n\tisSecureContext: O,\n\tKeyboardEvent: C,\n\tKeyframeEffect: C,\n\tlength: O,\n\tlocalStorage: O,\n\tlocation: O,\n\tLocation: C,\n\tlocationbar: O,\n\tmatchMedia: O,\n\tMediaDeviceInfo: C,\n\tMediaDevices: C,\n\tMediaElementAudioSourceNode: C,\n\tMediaEncryptedEvent: C,\n\tMediaError: C,\n\tMediaKeyMessageEvent: C,\n\tMediaKeySession: C,\n\tMediaKeyStatusMap: C,\n\tMediaKeySystemAccess: C,\n\tMediaList: C,\n\tMediaQueryList: C,\n\tMediaQueryListEvent: C,\n\tMediaRecorder: C,\n\tMediaSettingsRange: C,\n\tMediaSource: C,\n\tMediaStream: C,\n\tMediaStreamAudioDestinationNode: C,\n\tMediaStreamAudioSourceNode: C,\n\tMediaStreamEvent: C,\n\tMediaStreamTrack: C,\n\tMediaStreamTrackEvent: C,\n\tmenubar: O,\n\tMessageChannel: C,\n\tMessageEvent: C,\n\tMessagePort: C,\n\tMIDIAccess: C,\n\tMIDIConnectionEvent: C,\n\tMIDIInput: C,\n\tMIDIInputMap: C,\n\tMIDIMessageEvent: C,\n\tMIDIOutput: C,\n\tMIDIOutputMap: C,\n\tMIDIPort: C,\n\tMimeType: C,\n\tMimeTypeArray: C,\n\tMouseEvent: C,\n\tmoveBy: O,\n\tmoveTo: O,\n\tMutationEvent: C,\n\tMutationObserver: C,\n\tMutationRecord: C,\n\tname: O,\n\tNamedNodeMap: C,\n\tNavigationPreloadManager: C,\n\tnavigator: O,\n\tNavigator: C,\n\tNetworkInformation: C,\n\tNode: C,\n\tNodeFilter: O,\n\tNodeIterator: C,\n\tNodeList: C,\n\tNotification: C,\n\tOfflineAudioCompletionEvent: C,\n\tOfflineAudioContext: C,\n\toffscreenBuffering: O,\n\tOffscreenCanvas: C,\n\topen: O,\n\topenDatabase: O,\n\tOption: C,\n\torigin: O,\n\tOscillatorNode: C,\n\touterHeight: O,\n\touterWidth: O,\n\tPageTransitionEvent: C,\n\tpageXOffset: O,\n\tpageYOffset: O,\n\tPannerNode: C,\n\tparent: O,\n\tPath2D: C,\n\tPaymentAddress: C,\n\tPaymentRequest: C,\n\tPaymentRequestUpdateEvent: C,\n\tPaymentResponse: C,\n\tperformance: O,\n\tPerformance: C,\n\tPerformanceEntry: C,\n\tPerformanceLongTaskTiming: C,\n\tPerformanceMark: C,\n\tPerformanceMeasure: C,\n\tPerformanceNavigation: C,\n\tPerformanceNavigationTiming: C,\n\tPerformanceObserver: C,\n\tPerformanceObserverEntryList: C,\n\tPerformancePaintTiming: C,\n\tPerformanceResourceTiming: C,\n\tPerformanceTiming: C,\n\tPeriodicWave: C,\n\tPermissions: C,\n\tPermissionStatus: C,\n\tpersonalbar: O,\n\tPhotoCapabilities: C,\n\tPlugin: C,\n\tPluginArray: C,\n\tPointerEvent: C,\n\tPopStateEvent: C,\n\tpostMessage: O,\n\tPresentation: C,\n\tPresentationAvailability: C,\n\tPresentationConnection: C,\n\tPresentationConnectionAvailableEvent: C,\n\tPresentationConnectionCloseEvent: C,\n\tPresentationConnectionList: C,\n\tPresentationReceiver: C,\n\tPresentationRequest: C,\n\tprint: O,\n\tProcessingInstruction: C,\n\tProgressEvent: C,\n\tPromiseRejectionEvent: C,\n\tprompt: O,\n\tPushManager: C,\n\tPushSubscription: C,\n\tPushSubscriptionOptions: C,\n\tqueueMicrotask: O,\n\tRadioNodeList: C,\n\tRange: C,\n\tReadableStream: C,\n\tRemotePlayback: C,\n\tremoveEventListener: O,\n\tRequest: C,\n\trequestAnimationFrame: O,\n\trequestIdleCallback: O,\n\tresizeBy: O,\n\tResizeObserver: C,\n\tResizeObserverEntry: C,\n\tresizeTo: O,\n\tResponse: C,\n\tRTCCertificate: C,\n\tRTCDataChannel: C,\n\tRTCDataChannelEvent: C,\n\tRTCDtlsTransport: C,\n\tRTCIceCandidate: C,\n\tRTCIceTransport: C,\n\tRTCPeerConnection: C,\n\tRTCPeerConnectionIceEvent: C,\n\tRTCRtpReceiver: C,\n\tRTCRtpSender: C,\n\tRTCSctpTransport: C,\n\tRTCSessionDescription: C,\n\tRTCStatsReport: C,\n\tRTCTrackEvent: C,\n\tscreen: O,\n\tScreen: C,\n\tscreenLeft: O,\n\tScreenOrientation: C,\n\tscreenTop: O,\n\tscreenX: O,\n\tscreenY: O,\n\tScriptProcessorNode: C,\n\tscroll: O,\n\tscrollbars: O,\n\tscrollBy: O,\n\tscrollTo: O,\n\tscrollX: O,\n\tscrollY: O,\n\tSecurityPolicyViolationEvent: C,\n\tSelection: C,\n\tServiceWorker: C,\n\tServiceWorkerContainer: C,\n\tServiceWorkerRegistration: C,\n\tsessionStorage: O,\n\tShadowRoot: C,\n\tSharedWorker: C,\n\tSourceBuffer: C,\n\tSourceBufferList: C,\n\tspeechSynthesis: O,\n\tSpeechSynthesisEvent: C,\n\tSpeechSynthesisUtterance: C,\n\tStaticRange: C,\n\tstatus: O,\n\tstatusbar: O,\n\tStereoPannerNode: C,\n\tstop: O,\n\tStorage: C,\n\tStorageEvent: C,\n\tStorageManager: C,\n\tstyleMedia: O,\n\tStyleSheet: C,\n\tStyleSheetList: C,\n\tSubtleCrypto: C,\n\tSVGAElement: C,\n\tSVGAngle: C,\n\tSVGAnimatedAngle: C,\n\tSVGAnimatedBoolean: C,\n\tSVGAnimatedEnumeration: C,\n\tSVGAnimatedInteger: C,\n\tSVGAnimatedLength: C,\n\tSVGAnimatedLengthList: C,\n\tSVGAnimatedNumber: C,\n\tSVGAnimatedNumberList: C,\n\tSVGAnimatedPreserveAspectRatio: C,\n\tSVGAnimatedRect: C,\n\tSVGAnimatedString: C,\n\tSVGAnimatedTransformList: C,\n\tSVGAnimateElement: C,\n\tSVGAnimateMotionElement: C,\n\tSVGAnimateTransformElement: C,\n\tSVGAnimationElement: C,\n\tSVGCircleElement: C,\n\tSVGClipPathElement: C,\n\tSVGComponentTransferFunctionElement: C,\n\tSVGDefsElement: C,\n\tSVGDescElement: C,\n\tSVGDiscardElement: C,\n\tSVGElement: C,\n\tSVGEllipseElement: C,\n\tSVGFEBlendElement: C,\n\tSVGFEColorMatrixElement: C,\n\tSVGFEComponentTransferElement: C,\n\tSVGFECompositeElement: C,\n\tSVGFEConvolveMatrixElement: C,\n\tSVGFEDiffuseLightingElement: C,\n\tSVGFEDisplacementMapElement: C,\n\tSVGFEDistantLightElement: C,\n\tSVGFEDropShadowElement: C,\n\tSVGFEFloodElement: C,\n\tSVGFEFuncAElement: C,\n\tSVGFEFuncBElement: C,\n\tSVGFEFuncGElement: C,\n\tSVGFEFuncRElement: C,\n\tSVGFEGaussianBlurElement: C,\n\tSVGFEImageElement: C,\n\tSVGFEMergeElement: C,\n\tSVGFEMergeNodeElement: C,\n\tSVGFEMorphologyElement: C,\n\tSVGFEOffsetElement: C,\n\tSVGFEPointLightElement: C,\n\tSVGFESpecularLightingElement: C,\n\tSVGFESpotLightElement: C,\n\tSVGFETileElement: C,\n\tSVGFETurbulenceElement: C,\n\tSVGFilterElement: C,\n\tSVGForeignObjectElement: C,\n\tSVGGElement: C,\n\tSVGGeometryElement: C,\n\tSVGGradientElement: C,\n\tSVGGraphicsElement: C,\n\tSVGImageElement: C,\n\tSVGLength: C,\n\tSVGLengthList: C,\n\tSVGLinearGradientElement: C,\n\tSVGLineElement: C,\n\tSVGMarkerElement: C,\n\tSVGMaskElement: C,\n\tSVGMatrix: C,\n\tSVGMetadataElement: C,\n\tSVGMPathElement: C,\n\tSVGNumber: C,\n\tSVGNumberList: C,\n\tSVGPathElement: C,\n\tSVGPatternElement: C,\n\tSVGPoint: C,\n\tSVGPointList: C,\n\tSVGPolygonElement: C,\n\tSVGPolylineElement: C,\n\tSVGPreserveAspectRatio: C,\n\tSVGRadialGradientElement: C,\n\tSVGRect: C,\n\tSVGRectElement: C,\n\tSVGScriptElement: C,\n\tSVGSetElement: C,\n\tSVGStopElement: C,\n\tSVGStringList: C,\n\tSVGStyleElement: C,\n\tSVGSVGElement: C,\n\tSVGSwitchElement: C,\n\tSVGSymbolElement: C,\n\tSVGTextContentElement: C,\n\tSVGTextElement: C,\n\tSVGTextPathElement: C,\n\tSVGTextPositioningElement: C,\n\tSVGTitleElement: C,\n\tSVGTransform: C,\n\tSVGTransformList: C,\n\tSVGTSpanElement: C,\n\tSVGUnitTypes: C,\n\tSVGUseElement: C,\n\tSVGViewElement: C,\n\tTaskAttributionTiming: C,\n\tText: C,\n\tTextEvent: C,\n\tTextMetrics: C,\n\tTextTrack: C,\n\tTextTrackCue: C,\n\tTextTrackCueList: C,\n\tTextTrackList: C,\n\tTimeRanges: C,\n\ttoolbar: O,\n\ttop: O,\n\tTouch: C,\n\tTouchEvent: C,\n\tTouchList: C,\n\tTrackEvent: C,\n\tTransitionEvent: C,\n\tTreeWalker: C,\n\tUIEvent: C,\n\tValidityState: C,\n\tvisualViewport: O,\n\tVisualViewport: C,\n\tVTTCue: C,\n\tWaveShaperNode: C,\n\tWebAssembly: O,\n\tWebGL2RenderingContext: C,\n\tWebGLActiveInfo: C,\n\tWebGLBuffer: C,\n\tWebGLContextEvent: C,\n\tWebGLFramebuffer: C,\n\tWebGLProgram: C,\n\tWebGLQuery: C,\n\tWebGLRenderbuffer: C,\n\tWebGLRenderingContext: C,\n\tWebGLSampler: C,\n\tWebGLShader: C,\n\tWebGLShaderPrecisionFormat: C,\n\tWebGLSync: C,\n\tWebGLTexture: C,\n\tWebGLTransformFeedback: C,\n\tWebGLUniformLocation: C,\n\tWebGLVertexArrayObject: C,\n\tWebSocket: C,\n\tWheelEvent: C,\n\tWindow: C,\n\tWorker: C,\n\tWritableStream: C,\n\tXMLDocument: C,\n\tXMLHttpRequest: C,\n\tXMLHttpRequestEventTarget: C,\n\tXMLHttpRequestUpload: C,\n\tXMLSerializer: C,\n\tXPathEvaluator: C,\n\tXPathExpression: C,\n\tXPathResult: C,\n\tXSLTProcessor: C\n};\n\nfor (const global of ['window', 'global', 'self', 'globalThis']) {\n\tknownGlobals[global] = knownGlobals;\n}\n\nexport function getGlobalAtPath(path: ObjectPath): ValueDescription | null {\n\tlet currentGlobal: GlobalDescription | null = knownGlobals;\n\tfor (const pathSegment of path) {\n\t\tif (typeof pathSegment !== 'string') {\n\t\t\treturn null;\n\t\t}\n\t\tcurrentGlobal = currentGlobal[pathSegment];\n\t\tif (!currentGlobal) {\n\t\t\treturn null;\n\t\t}\n\t}\n\treturn currentGlobal[ValueProperties];\n}\n","import { DeoptimizableEntity } from '../DeoptimizableEntity';\nimport { HasEffectsContext } from '../ExecutionContext';\nimport {\n\tINTERACTION_ACCESSED,\n\tINTERACTION_ASSIGNED,\n\tINTERACTION_CALLED,\n\tNodeInteraction\n} from '../NodeInteractions';\nimport {\n\tLiteralValueOrUnknown,\n\tUnknownTruthyValue,\n\tUnknownValue\n} from '../nodes/shared/Expression';\nimport { getGlobalAtPath } from '../nodes/shared/knownGlobals';\nimport type { ObjectPath } from '../utils/PathTracker';\nimport { PathTracker } from '../utils/PathTracker';\nimport Variable from './Variable';\n\nexport default class GlobalVariable extends Variable {\n\t// Ensure we use live-bindings for globals as we do not know if they have\n\t// been reassigned\n\tisReassigned = true;\n\n\tgetLiteralValueAtPath(\n\t\tpath: ObjectPath,\n\t\t_recursionTracker: PathTracker,\n\t\t_origin: DeoptimizableEntity\n\t): LiteralValueOrUnknown {\n\t\treturn getGlobalAtPath([this.name, ...path]) ? UnknownTruthyValue : UnknownValue;\n\t}\n\n\thasEffectsOnInteractionAtPath(\n\t\tpath: ObjectPath,\n\t\tinteraction: NodeInteraction,\n\t\tcontext: HasEffectsContext\n\t): boolean {\n\t\tswitch (interaction.type) {\n\t\t\tcase INTERACTION_ACCESSED:\n\t\t\t\tif (path.length === 0) {\n\t\t\t\t\t// Technically, \"undefined\" is a global variable of sorts\n\t\t\t\t\treturn this.name !== 'undefined' && !getGlobalAtPath([this.name]);\n\t\t\t\t}\n\t\t\t\treturn !getGlobalAtPath([this.name, ...path].slice(0, -1));\n\t\t\tcase INTERACTION_ASSIGNED:\n\t\t\t\treturn true;\n\t\t\tcase INTERACTION_CALLED: {\n\t\t\t\tconst globalAtPath = getGlobalAtPath([this.name, ...path]);\n\t\t\t\treturn !globalAtPath || globalAtPath.hasEffectsWhenCalled(interaction, context);\n\t\t\t}\n\t\t}\n\t}\n}\n","import isReference, { type NodeWithFieldDefinition } from 'is-reference';\nimport type MagicString from 'magic-string';\nimport type { NormalizedTreeshakingOptions } from '../../rollup/types';\nimport { BLANK } from '../../utils/blank';\nimport type { NodeRenderOptions, RenderOptions } from '../../utils/renderHelpers';\nimport type { DeoptimizableEntity } from '../DeoptimizableEntity';\nimport type { HasEffectsContext, InclusionContext } from '../ExecutionContext';\nimport type { NodeInteractionWithThisArg } from '../NodeInteractions';\nimport {\n\tINTERACTION_ACCESSED,\n\tINTERACTION_ASSIGNED,\n\tINTERACTION_CALLED,\n\tNODE_INTERACTION_UNKNOWN_ACCESS,\n\tNodeInteraction,\n\tNodeInteractionCalled\n} from '../NodeInteractions';\nimport type FunctionScope from '../scopes/FunctionScope';\nimport { EMPTY_PATH, type ObjectPath, type PathTracker } from '../utils/PathTracker';\nimport GlobalVariable from '../variables/GlobalVariable';\nimport LocalVariable from '../variables/LocalVariable';\nimport type Variable from '../variables/Variable';\nimport * as NodeType from './NodeType';\nimport type SpreadElement from './SpreadElement';\nimport {\n\ttype ExpressionEntity,\n\ttype LiteralValueOrUnknown,\n\tUNKNOWN_EXPRESSION\n} from './shared/Expression';\nimport { NodeBase } from './shared/Node';\nimport type { PatternNode } from './shared/Pattern';\n\nexport type IdentifierWithVariable = Identifier & { variable: Variable };\n\nconst tdzVariableKinds = {\n\t__proto__: null,\n\tclass: true,\n\tconst: true,\n\tlet: true,\n\tvar: true\n};\n\nexport default class Identifier extends NodeBase implements PatternNode {\n\tdeclare name: string;\n\tdeclare type: NodeType.tIdentifier;\n\tvariable: Variable | null = null;\n\tprivate isTDZAccess: boolean | null = null;\n\n\taddExportedVariables(\n\t\tvariables: Variable[],\n\t\texportNamesByVariable: ReadonlyMap\n\t): void {\n\t\tif (exportNamesByVariable.has(this.variable!)) {\n\t\t\tvariables.push(this.variable!);\n\t\t}\n\t}\n\n\tbind(): void {\n\t\tif (!this.variable && isReference(this, this.parent as NodeWithFieldDefinition)) {\n\t\t\tthis.variable = this.scope.findVariable(this.name);\n\t\t\tthis.variable.addReference(this);\n\t\t}\n\t}\n\n\tdeclare(kind: string, init: ExpressionEntity): LocalVariable[] {\n\t\tlet variable: LocalVariable;\n\t\tconst { treeshake } = this.context.options;\n\t\tswitch (kind) {\n\t\t\tcase 'var':\n\t\t\t\tvariable = this.scope.addDeclaration(this, this.context, init, true);\n\t\t\t\tif (treeshake && treeshake.correctVarValueBeforeDeclaration) {\n\t\t\t\t\t// Necessary to make sure the init is deoptimized. We cannot call deoptimizePath here.\n\t\t\t\t\tvariable.markInitializersForDeoptimization();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'function':\n\t\t\t\t// in strict mode, functions are only hoisted within a scope but not across block scopes\n\t\t\t\tvariable = this.scope.addDeclaration(this, this.context, init, false);\n\t\t\t\tbreak;\n\t\t\tcase 'let':\n\t\t\tcase 'const':\n\t\t\tcase 'class':\n\t\t\t\tvariable = this.scope.addDeclaration(this, this.context, init, false);\n\t\t\t\tbreak;\n\t\t\tcase 'parameter':\n\t\t\t\tvariable = (this.scope as FunctionScope).addParameterDeclaration(this);\n\t\t\t\tbreak;\n\t\t\t/* istanbul ignore next */\n\t\t\tdefault:\n\t\t\t\t/* istanbul ignore next */\n\t\t\t\tthrow new Error(`Internal Error: Unexpected identifier kind ${kind}.`);\n\t\t}\n\t\tvariable.kind = kind;\n\t\treturn [(this.variable = variable)];\n\t}\n\n\tdeoptimizePath(path: ObjectPath): void {\n\t\tif (path.length === 0 && !this.scope.contains(this.name)) {\n\t\t\tthis.disallowImportReassignment();\n\t\t}\n\t\t// We keep conditional chaining because an unknown Node could have an\n\t\t// Identifier as property that might be deoptimized by default\n\t\tthis.variable?.deoptimizePath(path);\n\t}\n\n\tdeoptimizeThisOnInteractionAtPath(\n\t\tinteraction: NodeInteractionWithThisArg,\n\t\tpath: ObjectPath,\n\t\trecursionTracker: PathTracker\n\t): void {\n\t\tthis.variable!.deoptimizeThisOnInteractionAtPath(interaction, path, recursionTracker);\n\t}\n\n\tgetLiteralValueAtPath(\n\t\tpath: ObjectPath,\n\t\trecursionTracker: PathTracker,\n\t\torigin: DeoptimizableEntity\n\t): LiteralValueOrUnknown {\n\t\treturn this.getVariableRespectingTDZ()!.getLiteralValueAtPath(path, recursionTracker, origin);\n\t}\n\n\tgetReturnExpressionWhenCalledAtPath(\n\t\tpath: ObjectPath,\n\t\tinteraction: NodeInteractionCalled,\n\t\trecursionTracker: PathTracker,\n\t\torigin: DeoptimizableEntity\n\t): ExpressionEntity {\n\t\treturn this.getVariableRespectingTDZ()!.getReturnExpressionWhenCalledAtPath(\n\t\t\tpath,\n\t\t\tinteraction,\n\t\t\trecursionTracker,\n\t\t\torigin\n\t\t);\n\t}\n\n\thasEffects(context: HasEffectsContext): boolean {\n\t\tif (!this.deoptimized) this.applyDeoptimizations();\n\t\tif (this.isPossibleTDZ() && this.variable!.kind !== 'var') {\n\t\t\treturn true;\n\t\t}\n\t\treturn (\n\t\t\t(this.context.options.treeshake as NormalizedTreeshakingOptions).unknownGlobalSideEffects &&\n\t\t\tthis.variable instanceof GlobalVariable &&\n\t\t\tthis.variable.hasEffectsOnInteractionAtPath(\n\t\t\t\tEMPTY_PATH,\n\t\t\t\tNODE_INTERACTION_UNKNOWN_ACCESS,\n\t\t\t\tcontext\n\t\t\t)\n\t\t);\n\t}\n\n\thasEffectsOnInteractionAtPath(\n\t\tpath: ObjectPath,\n\t\tinteraction: NodeInteraction,\n\t\tcontext: HasEffectsContext\n\t): boolean {\n\t\tswitch (interaction.type) {\n\t\t\tcase INTERACTION_ACCESSED:\n\t\t\t\treturn (\n\t\t\t\t\tthis.variable !== null &&\n\t\t\t\t\tthis.getVariableRespectingTDZ()!.hasEffectsOnInteractionAtPath(path, interaction, context)\n\t\t\t\t);\n\t\t\tcase INTERACTION_ASSIGNED:\n\t\t\t\treturn (\n\t\t\t\t\tpath.length > 0 ? this.getVariableRespectingTDZ() : this.variable\n\t\t\t\t)!.hasEffectsOnInteractionAtPath(path, interaction, context);\n\t\t\tcase INTERACTION_CALLED:\n\t\t\t\treturn this.getVariableRespectingTDZ()!.hasEffectsOnInteractionAtPath(\n\t\t\t\t\tpath,\n\t\t\t\t\tinteraction,\n\t\t\t\t\tcontext\n\t\t\t\t);\n\t\t}\n\t}\n\n\tinclude(): void {\n\t\tif (!this.deoptimized) this.applyDeoptimizations();\n\t\tif (!this.included) {\n\t\t\tthis.included = true;\n\t\t\tif (this.variable !== null) {\n\t\t\t\tthis.context.includeVariableInModule(this.variable);\n\t\t\t}\n\t\t}\n\t}\n\n\tincludeCallArguments(\n\t\tcontext: InclusionContext,\n\t\targs: readonly (ExpressionEntity | SpreadElement)[]\n\t): void {\n\t\tthis.variable!.includeCallArguments(context, args);\n\t}\n\n\tisPossibleTDZ(): boolean {\n\t\t// return cached value to avoid issues with the next tree-shaking pass\n\t\tif (this.isTDZAccess !== null) return this.isTDZAccess;\n\n\t\tif (\n\t\t\t!(this.variable instanceof LocalVariable) ||\n\t\t\t!this.variable.kind ||\n\t\t\t!(this.variable.kind in tdzVariableKinds)\n\t\t) {\n\t\t\treturn (this.isTDZAccess = false);\n\t\t}\n\n\t\tlet decl_id;\n\t\tif (\n\t\t\tthis.variable.declarations &&\n\t\t\tthis.variable.declarations.length === 1 &&\n\t\t\t(decl_id = this.variable.declarations[0] as any) &&\n\t\t\tthis.start < decl_id.start &&\n\t\t\tclosestParentFunctionOrProgram(this) === closestParentFunctionOrProgram(decl_id)\n\t\t) {\n\t\t\t// a variable accessed before its declaration\n\t\t\t// in the same function or at top level of module\n\t\t\treturn (this.isTDZAccess = true);\n\t\t}\n\n\t\tif (!this.variable.initReached) {\n\t\t\t// Either a const/let TDZ violation or\n\t\t\t// var use before declaration was encountered.\n\t\t\treturn (this.isTDZAccess = true);\n\t\t}\n\n\t\treturn (this.isTDZAccess = false);\n\t}\n\n\tmarkDeclarationReached(): void {\n\t\tthis.variable!.initReached = true;\n\t}\n\n\trender(\n\t\tcode: MagicString,\n\t\t{ snippets: { getPropertyAccess } }: RenderOptions,\n\t\t{ renderedParentType, isCalleeOfRenderedParent, isShorthandProperty }: NodeRenderOptions = BLANK\n\t): void {\n\t\tif (this.variable) {\n\t\t\tconst name = this.variable.getName(getPropertyAccess);\n\n\t\t\tif (name !== this.name) {\n\t\t\t\tcode.overwrite(this.start, this.end, name, {\n\t\t\t\t\tcontentOnly: true,\n\t\t\t\t\tstoreName: true\n\t\t\t\t});\n\t\t\t\tif (isShorthandProperty) {\n\t\t\t\t\tcode.prependRight(this.start, `${this.name}: `);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// In strict mode, any variable named \"eval\" must be the actual \"eval\" function\n\t\t\tif (\n\t\t\t\tname === 'eval' &&\n\t\t\t\trenderedParentType === NodeType.CallExpression &&\n\t\t\t\tisCalleeOfRenderedParent\n\t\t\t) {\n\t\t\t\tcode.appendRight(this.start, '0, ');\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected applyDeoptimizations(): void {\n\t\tthis.deoptimized = true;\n\t\tif (this.variable instanceof LocalVariable) {\n\t\t\tthis.variable.consolidateInitializers();\n\t\t\tthis.context.requestTreeshakingPass();\n\t\t}\n\t}\n\n\tprivate disallowImportReassignment(): never {\n\t\treturn this.context.error(\n\t\t\t{\n\t\t\t\tcode: 'ILLEGAL_REASSIGNMENT',\n\t\t\t\tmessage: `Illegal reassignment to import '${this.name}'`\n\t\t\t},\n\t\t\tthis.start\n\t\t);\n\t}\n\n\tprivate getVariableRespectingTDZ(): ExpressionEntity | null {\n\t\tif (this.isPossibleTDZ()) {\n\t\t\treturn UNKNOWN_EXPRESSION;\n\t\t}\n\t\treturn this.variable;\n\t}\n}\n\nfunction closestParentFunctionOrProgram(node: any): any {\n\twhile (node && !/^Program|Function/.test(node.type)) {\n\t\tnode = node.parent;\n\t}\n\t// one of: ArrowFunctionExpression, FunctionDeclaration, FunctionExpression or Program\n\treturn node;\n}\n","import type MagicString from 'magic-string';\nimport * as NodeType from '../ast/nodes/NodeType';\nimport type { Node } from '../ast/nodes/shared/Node';\n\nexport function treeshakeNode(node: Node, code: MagicString, start: number, end: number): void {\n\tcode.remove(start, end);\n\tif (node.annotations) {\n\t\tfor (const annotation of node.annotations) {\n\t\t\tif (annotation.start < start) {\n\t\t\t\tcode.remove(annotation.start, annotation.end);\n\t\t\t} else {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport function removeAnnotations(node: Node, code: MagicString): void {\n\tif (!node.annotations && node.parent.type === NodeType.ExpressionStatement) {\n\t\tnode = node.parent as Node;\n\t}\n\tif (node.annotations) {\n\t\tfor (const annotation of node.annotations) {\n\t\t\tcode.remove(annotation.start, annotation.end);\n\t\t}\n\t}\n}\n","import type MagicString from 'magic-string';\nimport type { Node, StatementNode } from '../ast/nodes/shared/Node';\nimport type Variable from '../ast/variables/Variable';\nimport type { InternalModuleFormat } from '../rollup/types';\nimport type { PluginDriver } from './PluginDriver';\nimport type { GenerateCodeSnippets } from './generateCodeSnippets';\nimport { treeshakeNode } from './treeshakeNode';\n\nexport interface RenderOptions {\n\tdynamicImportFunction: string | undefined;\n\texportNamesByVariable: Map;\n\tformat: InternalModuleFormat;\n\tfreeze: boolean;\n\tindent: string;\n\tnamespaceToStringTag: boolean;\n\toutputPluginDriver: PluginDriver;\n\tsnippets: GenerateCodeSnippets;\n}\n\nexport interface NodeRenderOptions {\n\tend?: number;\n\tisCalleeOfRenderedParent?: boolean;\n\tisNoStatement?: boolean;\n\tisShorthandProperty?: boolean;\n\tpreventASI?: boolean;\n\t/* Indicates if the direct parent of an element changed.\n\tNecessary for determining the \"this\" context of callees. */\n\trenderedParentType?: string;\n\t/* Indicates if the parent or ancestor surrounding an element has changed and what it changed to.\n\tNecessary for adding parentheses. */\n\trenderedSurroundingElement?: string;\n\tstart?: number;\n}\n\nexport const NO_SEMICOLON: NodeRenderOptions = { isNoStatement: true };\n\n// This assumes there are only white-space and comments between start and the string we are looking for\nexport function findFirstOccurrenceOutsideComment(\n\tcode: string,\n\tsearchString: string,\n\tstart = 0\n): number {\n\tlet searchPos: number, charCodeAfterSlash: number;\n\tsearchPos = code.indexOf(searchString, start);\n\twhile (true) {\n\t\tstart = code.indexOf('/', start);\n\t\tif (start === -1 || start >= searchPos) return searchPos;\n\t\tcharCodeAfterSlash = code.charCodeAt(++start);\n\t\t++start;\n\n\t\t// With our assumption, '/' always starts a comment. Determine comment type:\n\t\tstart =\n\t\t\tcharCodeAfterSlash === 47 /*\"/\"*/\n\t\t\t\t? code.indexOf('\\n', start) + 1\n\t\t\t\t: code.indexOf('*/', start) + 2;\n\t\tif (start > searchPos) {\n\t\t\tsearchPos = code.indexOf(searchString, start);\n\t\t}\n\t}\n}\n\nconst NON_WHITESPACE = /\\S/g;\n\nexport function findNonWhiteSpace(code: string, index: number): number {\n\tNON_WHITESPACE.lastIndex = index;\n\tconst result = NON_WHITESPACE.exec(code)!;\n\treturn result.index;\n}\n\n// This assumes \"code\" only contains white-space and comments\n// Returns position of line-comment if applicable\nfunction findFirstLineBreakOutsideComment(code: string): [number, number] {\n\tlet lineBreakPos,\n\t\tcharCodeAfterSlash,\n\t\tstart = 0;\n\tlineBreakPos = code.indexOf('\\n', start);\n\twhile (true) {\n\t\tstart = code.indexOf('/', start);\n\t\tif (start === -1 || start > lineBreakPos) return [lineBreakPos, lineBreakPos + 1];\n\n\t\t// With our assumption, '/' always starts a comment. Determine comment type:\n\t\tcharCodeAfterSlash = code.charCodeAt(start + 1);\n\t\tif (charCodeAfterSlash === 47 /*\"/\"*/) return [start, lineBreakPos + 1];\n\t\tstart = code.indexOf('*/', start + 3) + 2;\n\t\tif (start > lineBreakPos) {\n\t\t\tlineBreakPos = code.indexOf('\\n', start);\n\t\t}\n\t}\n}\n\nexport function renderStatementList(\n\tstatements: readonly StatementNode[],\n\tcode: MagicString,\n\tstart: number,\n\tend: number,\n\toptions: RenderOptions\n): void {\n\tlet currentNode, currentNodeStart, currentNodeNeedsBoundaries, nextNodeStart;\n\tlet nextNode = statements[0];\n\tlet nextNodeNeedsBoundaries = !nextNode.included || nextNode.needsBoundaries;\n\tif (nextNodeNeedsBoundaries) {\n\t\tnextNodeStart =\n\t\t\tstart + findFirstLineBreakOutsideComment(code.original.slice(start, nextNode.start))[1];\n\t}\n\n\tfor (let nextIndex = 1; nextIndex <= statements.length; nextIndex++) {\n\t\tcurrentNode = nextNode;\n\t\tcurrentNodeStart = nextNodeStart;\n\t\tcurrentNodeNeedsBoundaries = nextNodeNeedsBoundaries;\n\t\tnextNode = statements[nextIndex];\n\t\tnextNodeNeedsBoundaries =\n\t\t\tnextNode === undefined ? false : !nextNode.included || nextNode.needsBoundaries;\n\t\tif (currentNodeNeedsBoundaries || nextNodeNeedsBoundaries) {\n\t\t\tnextNodeStart =\n\t\t\t\tcurrentNode.end +\n\t\t\t\tfindFirstLineBreakOutsideComment(\n\t\t\t\t\tcode.original.slice(currentNode.end, nextNode === undefined ? end : nextNode.start)\n\t\t\t\t)[1];\n\t\t\tif (currentNode.included) {\n\t\t\t\tcurrentNodeNeedsBoundaries\n\t\t\t\t\t? currentNode.render(code, options, {\n\t\t\t\t\t\t\tend: nextNodeStart,\n\t\t\t\t\t\t\tstart: currentNodeStart\n\t\t\t\t\t })\n\t\t\t\t\t: currentNode.render(code, options);\n\t\t\t} else {\n\t\t\t\ttreeshakeNode(currentNode, code, currentNodeStart!, nextNodeStart);\n\t\t\t}\n\t\t} else {\n\t\t\tcurrentNode.render(code, options);\n\t\t}\n\t}\n}\n\n// This assumes that the first character is not part of the first node\nexport function getCommaSeparatedNodesWithBoundaries(\n\tnodes: readonly N[],\n\tcode: MagicString,\n\tstart: number,\n\tend: number\n): {\n\tcontentEnd: number;\n\tend: number;\n\tnode: N;\n\tseparator: number | null;\n\tstart: number;\n}[] {\n\tconst splitUpNodes = [];\n\tlet node, nextNode, nextNodeStart, contentEnd, char;\n\tlet separator = start - 1;\n\n\tfor (let nextIndex = 0; nextIndex < nodes.length; nextIndex++) {\n\t\tnextNode = nodes[nextIndex];\n\t\tif (node !== undefined) {\n\t\t\tseparator =\n\t\t\t\tnode.end +\n\t\t\t\tfindFirstOccurrenceOutsideComment(code.original.slice(node.end, nextNode.start), ',');\n\t\t}\n\t\tnextNodeStart = contentEnd =\n\t\t\tseparator +\n\t\t\t1 +\n\t\t\tfindFirstLineBreakOutsideComment(code.original.slice(separator + 1, nextNode.start))[1];\n\t\twhile (\n\t\t\t((char = code.original.charCodeAt(nextNodeStart)),\n\t\t\tchar === 32 /*\" \"*/ || char === 9 /*\"\\t\"*/ || char === 10 /*\"\\n\"*/ || char === 13) /*\"\\r\"*/\n\t\t)\n\t\t\tnextNodeStart++;\n\t\tif (node !== undefined) {\n\t\t\tsplitUpNodes.push({\n\t\t\t\tcontentEnd,\n\t\t\t\tend: nextNodeStart,\n\t\t\t\tnode,\n\t\t\t\tseparator,\n\t\t\t\tstart\n\t\t\t});\n\t\t}\n\t\tnode = nextNode;\n\t\tstart = nextNodeStart;\n\t}\n\tsplitUpNodes.push({\n\t\tcontentEnd: end,\n\t\tend,\n\t\tnode: node as N,\n\t\tseparator: null,\n\t\tstart\n\t});\n\treturn splitUpNodes;\n}\n\n// This assumes there are only white-space and comments between start and end\nexport function removeLineBreaks(code: MagicString, start: number, end: number): void {\n\twhile (true) {\n\t\tconst [removeStart, removeEnd] = findFirstLineBreakOutsideComment(\n\t\t\tcode.original.slice(start, end)\n\t\t);\n\t\tif (removeStart === -1) {\n\t\t\tbreak;\n\t\t}\n\t\tcode.remove(start + removeStart, (start += removeEnd));\n\t}\n}\n","import type { AstContext } from '../../Module';\nimport type Identifier from '../nodes/Identifier';\nimport type { ExpressionEntity } from '../nodes/shared/Expression';\nimport type LocalVariable from '../variables/LocalVariable';\nimport ChildScope from './ChildScope';\n\nexport default class BlockScope extends ChildScope {\n\taddDeclaration(\n\t\tidentifier: Identifier,\n\t\tcontext: AstContext,\n\t\tinit: ExpressionEntity | null,\n\t\tisHoisted: boolean\n\t): LocalVariable {\n\t\tif (isHoisted) {\n\t\t\tconst variable = this.parent.addDeclaration(identifier, context, init, isHoisted);\n\t\t\t// Necessary to make sure the init is deoptimized for conditional declarations.\n\t\t\t// We cannot call deoptimizePath here.\n\t\t\tvariable.markInitializersForDeoptimization();\n\t\t\treturn variable;\n\t\t} else {\n\t\t\treturn super.addDeclaration(identifier, context, init, false);\n\t\t}\n\t}\n}\n","import type MagicString from 'magic-string';\nimport type { RenderOptions } from '../../utils/renderHelpers';\nimport type { InclusionContext } from '../ExecutionContext';\nimport * as NodeType from './NodeType';\nimport { type ExpressionNode, StatementBase } from './shared/Node';\n\nexport default class ExpressionStatement extends StatementBase {\n\tdeclare directive?: string;\n\tdeclare expression: ExpressionNode;\n\n\tinitialise(): void {\n\t\tif (\n\t\t\tthis.directive &&\n\t\t\tthis.directive !== 'use strict' &&\n\t\t\tthis.parent.type === NodeType.Program\n\t\t) {\n\t\t\tthis.context.warn(\n\t\t\t\t// This is necessary, because either way (deleting or not) can lead to errors.\n\t\t\t\t{\n\t\t\t\t\tcode: 'MODULE_LEVEL_DIRECTIVE',\n\t\t\t\t\tmessage: `Module level directives cause errors when bundled, '${this.directive}' was ignored.`\n\t\t\t\t},\n\t\t\t\tthis.start\n\t\t\t);\n\t\t}\n\t}\n\n\trender(code: MagicString, options: RenderOptions): void {\n\t\tsuper.render(code, options);\n\t\tif (this.included) this.insertSemicolon(code);\n\t}\n\n\tshouldBeIncluded(context: InclusionContext): boolean {\n\t\tif (this.directive && this.directive !== 'use strict')\n\t\t\treturn this.parent.type !== NodeType.Program;\n\n\t\treturn super.shouldBeIncluded(context);\n\t}\n\n\tprotected applyDeoptimizations() {}\n}\n","import type MagicString from 'magic-string';\nimport { type RenderOptions, renderStatementList } from '../../utils/renderHelpers';\nimport type { HasEffectsContext, InclusionContext } from '../ExecutionContext';\nimport BlockScope from '../scopes/BlockScope';\nimport type ChildScope from '../scopes/ChildScope';\nimport type Scope from '../scopes/Scope';\nimport ExpressionStatement from './ExpressionStatement';\nimport * as NodeType from './NodeType';\nimport { UNKNOWN_EXPRESSION } from './shared/Expression';\nimport { type IncludeChildren, type Node, StatementBase, type StatementNode } from './shared/Node';\n\nexport default class BlockStatement extends StatementBase {\n\tdeclare body: readonly StatementNode[];\n\tdeclare type: NodeType.tBlockStatement;\n\n\tprivate declare deoptimizeBody: boolean;\n\tprivate directlyIncluded = false;\n\n\taddImplicitReturnExpressionToScope(): void {\n\t\tconst lastStatement = this.body[this.body.length - 1];\n\t\tif (!lastStatement || lastStatement.type !== NodeType.ReturnStatement) {\n\t\t\tthis.scope.addReturnExpression(UNKNOWN_EXPRESSION);\n\t\t}\n\t}\n\n\tcreateScope(parentScope: Scope): void {\n\t\tthis.scope = (this.parent as Node).preventChildBlockScope\n\t\t\t? (parentScope as ChildScope)\n\t\t\t: new BlockScope(parentScope);\n\t}\n\n\thasEffects(context: HasEffectsContext): boolean {\n\t\tif (this.deoptimizeBody) return true;\n\t\tfor (const node of this.body) {\n\t\t\tif (context.brokenFlow) break;\n\t\t\tif (node.hasEffects(context)) return true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tinclude(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void {\n\t\tif (!(this.deoptimizeBody && this.directlyIncluded)) {\n\t\t\tthis.included = true;\n\t\t\tthis.directlyIncluded = true;\n\t\t\tif (this.deoptimizeBody) includeChildrenRecursively = true;\n\t\t\tfor (const node of this.body) {\n\t\t\t\tif (includeChildrenRecursively || node.shouldBeIncluded(context))\n\t\t\t\t\tnode.include(context, includeChildrenRecursively);\n\t\t\t}\n\t\t}\n\t}\n\n\tinitialise(): void {\n\t\tconst firstBodyStatement = this.body[0];\n\t\tthis.deoptimizeBody =\n\t\t\tfirstBodyStatement instanceof ExpressionStatement &&\n\t\t\tfirstBodyStatement.directive === 'use asm';\n\t}\n\n\trender(code: MagicString, options: RenderOptions): void {\n\t\tif (this.body.length) {\n\t\t\trenderStatementList(this.body, code, this.start + 1, this.end - 1, options);\n\t\t} else {\n\t\t\tsuper.render(code, options);\n\t\t}\n\t}\n}\n","import type { HasEffectsContext } from '../ExecutionContext';\nimport { NodeInteractionAssigned } from '../NodeInteractions';\nimport { EMPTY_PATH, type ObjectPath, UnknownKey } from '../utils/PathTracker';\nimport type LocalVariable from '../variables/LocalVariable';\nimport type Variable from '../variables/Variable';\nimport type * as NodeType from './NodeType';\nimport { type ExpressionEntity, UNKNOWN_EXPRESSION } from './shared/Expression';\nimport { NodeBase } from './shared/Node';\nimport type { PatternNode } from './shared/Pattern';\n\nexport default class RestElement extends NodeBase implements PatternNode {\n\tdeclare argument: PatternNode;\n\tdeclare type: NodeType.tRestElement;\n\tprivate declarationInit: ExpressionEntity | null = null;\n\n\taddExportedVariables(\n\t\tvariables: readonly Variable[],\n\t\texportNamesByVariable: ReadonlyMap\n\t): void {\n\t\tthis.argument.addExportedVariables(variables, exportNamesByVariable);\n\t}\n\n\tdeclare(kind: string, init: ExpressionEntity): LocalVariable[] {\n\t\tthis.declarationInit = init;\n\t\treturn this.argument.declare(kind, UNKNOWN_EXPRESSION);\n\t}\n\n\tdeoptimizePath(path: ObjectPath): void {\n\t\tpath.length === 0 && this.argument.deoptimizePath(EMPTY_PATH);\n\t}\n\n\thasEffectsOnInteractionAtPath(\n\t\tpath: ObjectPath,\n\t\tinteraction: NodeInteractionAssigned,\n\t\tcontext: HasEffectsContext\n\t): boolean {\n\t\treturn (\n\t\t\tpath.length > 0 ||\n\t\t\tthis.argument.hasEffectsOnInteractionAtPath(EMPTY_PATH, interaction, context)\n\t\t);\n\t}\n\n\tmarkDeclarationReached(): void {\n\t\tthis.argument.markDeclarationReached();\n\t}\n\n\tprotected applyDeoptimizations(): void {\n\t\tthis.deoptimized = true;\n\t\tif (this.declarationInit !== null) {\n\t\t\tthis.declarationInit.deoptimizePath([UnknownKey, UnknownKey]);\n\t\t\tthis.context.requestTreeshakingPass();\n\t\t}\n\t}\n}\n","import type { NormalizedTreeshakingOptions } from '../../../rollup/types';\nimport { DeoptimizableEntity } from '../../DeoptimizableEntity';\nimport {\n\tBROKEN_FLOW_NONE,\n\ttype HasEffectsContext,\n\ttype InclusionContext\n} from '../../ExecutionContext';\nimport {\n\tINTERACTION_CALLED,\n\tNODE_INTERACTION_UNKNOWN_ACCESS,\n\tNODE_INTERACTION_UNKNOWN_CALL,\n\tNodeInteraction,\n\tNodeInteractionCalled,\n\tNodeInteractionWithThisArg\n} from '../../NodeInteractions';\nimport ReturnValueScope from '../../scopes/ReturnValueScope';\nimport { type ObjectPath, PathTracker, UNKNOWN_PATH, UnknownKey } from '../../utils/PathTracker';\nimport BlockStatement from '../BlockStatement';\nimport * as NodeType from '../NodeType';\nimport RestElement from '../RestElement';\nimport type SpreadElement from '../SpreadElement';\nimport { type ExpressionEntity, LiteralValueOrUnknown, UNKNOWN_EXPRESSION } from './Expression';\nimport {\n\ttype ExpressionNode,\n\ttype GenericEsTreeNode,\n\ttype IncludeChildren,\n\tNodeBase\n} from './Node';\nimport { ObjectEntity } from './ObjectEntity';\nimport type { PatternNode } from './Pattern';\n\nexport default abstract class FunctionBase extends NodeBase {\n\tdeclare async: boolean;\n\tdeclare body: BlockStatement | ExpressionNode;\n\tdeclare params: readonly PatternNode[];\n\tdeclare preventChildBlockScope: true;\n\tdeclare scope: ReturnValueScope;\n\tprotected objectEntity: ObjectEntity | null = null;\n\tprivate deoptimizedReturn = false;\n\n\tdeoptimizePath(path: ObjectPath): void {\n\t\tthis.getObjectEntity().deoptimizePath(path);\n\t\tif (path.length === 1 && path[0] === UnknownKey) {\n\t\t\t// A reassignment of UNKNOWN_PATH is considered equivalent to having lost track\n\t\t\t// which means the return expression needs to be reassigned\n\t\t\tthis.scope.getReturnExpression().deoptimizePath(UNKNOWN_PATH);\n\t\t}\n\t}\n\n\tdeoptimizeThisOnInteractionAtPath(\n\t\tinteraction: NodeInteractionWithThisArg,\n\t\tpath: ObjectPath,\n\t\trecursionTracker: PathTracker\n\t): void {\n\t\tif (path.length > 0) {\n\t\t\tthis.getObjectEntity().deoptimizeThisOnInteractionAtPath(interaction, path, recursionTracker);\n\t\t}\n\t}\n\n\tgetLiteralValueAtPath(\n\t\tpath: ObjectPath,\n\t\trecursionTracker: PathTracker,\n\t\torigin: DeoptimizableEntity\n\t): LiteralValueOrUnknown {\n\t\treturn this.getObjectEntity().getLiteralValueAtPath(path, recursionTracker, origin);\n\t}\n\n\tgetReturnExpressionWhenCalledAtPath(\n\t\tpath: ObjectPath,\n\t\tinteraction: NodeInteractionCalled,\n\t\trecursionTracker: PathTracker,\n\t\torigin: DeoptimizableEntity\n\t): ExpressionEntity {\n\t\tif (path.length > 0) {\n\t\t\treturn this.getObjectEntity().getReturnExpressionWhenCalledAtPath(\n\t\t\t\tpath,\n\t\t\t\tinteraction,\n\t\t\t\trecursionTracker,\n\t\t\t\torigin\n\t\t\t);\n\t\t}\n\t\tif (this.async) {\n\t\t\tif (!this.deoptimizedReturn) {\n\t\t\t\tthis.deoptimizedReturn = true;\n\t\t\t\tthis.scope.getReturnExpression().deoptimizePath(UNKNOWN_PATH);\n\t\t\t\tthis.context.requestTreeshakingPass();\n\t\t\t}\n\t\t\treturn UNKNOWN_EXPRESSION;\n\t\t}\n\t\treturn this.scope.getReturnExpression();\n\t}\n\n\thasEffectsOnInteractionAtPath(\n\t\tpath: ObjectPath,\n\t\tinteraction: NodeInteraction,\n\t\tcontext: HasEffectsContext\n\t): boolean {\n\t\tif (path.length > 0 || interaction.type !== INTERACTION_CALLED) {\n\t\t\treturn this.getObjectEntity().hasEffectsOnInteractionAtPath(path, interaction, context);\n\t\t}\n\t\tif (this.async) {\n\t\t\tconst { propertyReadSideEffects } = this.context.options\n\t\t\t\t.treeshake as NormalizedTreeshakingOptions;\n\t\t\tconst returnExpression = this.scope.getReturnExpression();\n\t\t\tif (\n\t\t\t\treturnExpression.hasEffectsOnInteractionAtPath(\n\t\t\t\t\t['then'],\n\t\t\t\t\tNODE_INTERACTION_UNKNOWN_CALL,\n\t\t\t\t\tcontext\n\t\t\t\t) ||\n\t\t\t\t(propertyReadSideEffects &&\n\t\t\t\t\t(propertyReadSideEffects === 'always' ||\n\t\t\t\t\t\treturnExpression.hasEffectsOnInteractionAtPath(\n\t\t\t\t\t\t\t['then'],\n\t\t\t\t\t\t\tNODE_INTERACTION_UNKNOWN_ACCESS,\n\t\t\t\t\t\t\tcontext\n\t\t\t\t\t\t)))\n\t\t\t) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\tfor (const param of this.params) {\n\t\t\tif (param.hasEffects(context)) return true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tinclude(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void {\n\t\tif (!this.deoptimized) this.applyDeoptimizations();\n\t\tthis.included = true;\n\t\tconst { brokenFlow } = context;\n\t\tcontext.brokenFlow = BROKEN_FLOW_NONE;\n\t\tthis.body.include(context, includeChildrenRecursively);\n\t\tcontext.brokenFlow = brokenFlow;\n\t}\n\n\tincludeCallArguments(\n\t\tcontext: InclusionContext,\n\t\targs: readonly (ExpressionEntity | SpreadElement)[]\n\t): void {\n\t\tthis.scope.includeCallArguments(context, args);\n\t}\n\n\tinitialise(): void {\n\t\tthis.scope.addParameterVariables(\n\t\t\tthis.params.map(param => param.declare('parameter', UNKNOWN_EXPRESSION)),\n\t\t\tthis.params[this.params.length - 1] instanceof RestElement\n\t\t);\n\t\tif (this.body instanceof BlockStatement) {\n\t\t\tthis.body.addImplicitReturnExpressionToScope();\n\t\t} else {\n\t\t\tthis.scope.addReturnExpression(this.body);\n\t\t}\n\t}\n\n\tparseNode(esTreeNode: GenericEsTreeNode): void {\n\t\tif (esTreeNode.body.type === NodeType.BlockStatement) {\n\t\t\tthis.body = new BlockStatement(esTreeNode.body, this, this.scope.hoistedBodyVarScope);\n\t\t}\n\t\tsuper.parseNode(esTreeNode);\n\t}\n\n\tprotected applyDeoptimizations() {}\n\n\tprotected abstract getObjectEntity(): ObjectEntity;\n}\n\nFunctionBase.prototype.preventChildBlockScope = true;\n","import { type HasEffectsContext, InclusionContext } from '../ExecutionContext';\nimport { INTERACTION_CALLED, NodeInteraction } from '../NodeInteractions';\nimport ReturnValueScope from '../scopes/ReturnValueScope';\nimport type Scope from '../scopes/Scope';\nimport { type ObjectPath } from '../utils/PathTracker';\nimport BlockStatement from './BlockStatement';\nimport Identifier from './Identifier';\nimport * as NodeType from './NodeType';\nimport FunctionBase from './shared/FunctionBase';\nimport { type ExpressionNode, IncludeChildren } from './shared/Node';\nimport { ObjectEntity } from './shared/ObjectEntity';\nimport { OBJECT_PROTOTYPE } from './shared/ObjectPrototype';\nimport type { PatternNode } from './shared/Pattern';\n\nexport default class ArrowFunctionExpression extends FunctionBase {\n\tdeclare async: boolean;\n\tdeclare body: BlockStatement | ExpressionNode;\n\tdeclare params: readonly PatternNode[];\n\tdeclare preventChildBlockScope: true;\n\tdeclare scope: ReturnValueScope;\n\tdeclare type: NodeType.tArrowFunctionExpression;\n\tprotected objectEntity: ObjectEntity | null = null;\n\n\tcreateScope(parentScope: Scope): void {\n\t\tthis.scope = new ReturnValueScope(parentScope, this.context);\n\t}\n\n\thasEffects(): boolean {\n\t\tif (!this.deoptimized) this.applyDeoptimizations();\n\t\treturn false;\n\t}\n\n\thasEffectsOnInteractionAtPath(\n\t\tpath: ObjectPath,\n\t\tinteraction: NodeInteraction,\n\t\tcontext: HasEffectsContext\n\t): boolean {\n\t\tif (super.hasEffectsOnInteractionAtPath(path, interaction, context)) return true;\n\t\tif (interaction.type === INTERACTION_CALLED) {\n\t\t\tconst { ignore, brokenFlow } = context;\n\t\t\tcontext.ignore = {\n\t\t\t\tbreaks: false,\n\t\t\t\tcontinues: false,\n\t\t\t\tlabels: new Set(),\n\t\t\t\treturnYield: true\n\t\t\t};\n\t\t\tif (this.body.hasEffects(context)) return true;\n\t\t\tcontext.ignore = ignore;\n\t\t\tcontext.brokenFlow = brokenFlow;\n\t\t}\n\t\treturn false;\n\t}\n\n\tinclude(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void {\n\t\tsuper.include(context, includeChildrenRecursively);\n\t\tfor (const param of this.params) {\n\t\t\tif (!(param instanceof Identifier)) {\n\t\t\t\tparam.include(context, includeChildrenRecursively);\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected getObjectEntity(): ObjectEntity {\n\t\tif (this.objectEntity !== null) {\n\t\t\treturn this.objectEntity;\n\t\t}\n\t\treturn (this.objectEntity = new ObjectEntity([], OBJECT_PROTOTYPE));\n\t}\n}\n","import type MagicString from 'magic-string';\nimport type Variable from '../ast/variables/Variable';\nimport type { RenderOptions } from './renderHelpers';\n\nexport function getSystemExportStatement(\n\texportedVariables: readonly Variable[],\n\t{ exportNamesByVariable, snippets: { _, getObject, getPropertyAccess } }: RenderOptions,\n\tmodifier = ''\n): string {\n\tif (\n\t\texportedVariables.length === 1 &&\n\t\texportNamesByVariable.get(exportedVariables[0])!.length === 1\n\t) {\n\t\tconst variable = exportedVariables[0];\n\t\treturn `exports('${exportNamesByVariable.get(variable)}',${_}${variable.getName(\n\t\t\tgetPropertyAccess\n\t\t)}${modifier})`;\n\t} else {\n\t\tconst fields: [key: string, value: string][] = [];\n\t\tfor (const variable of exportedVariables) {\n\t\t\tfor (const exportName of exportNamesByVariable.get(variable)!) {\n\t\t\t\tfields.push([exportName, variable.getName(getPropertyAccess) + modifier]);\n\t\t\t}\n\t\t}\n\t\treturn `exports(${getObject(fields, { lineBreakIndent: null })})`;\n\t}\n}\n\nexport function renderSystemExportExpression(\n\texportedVariable: Variable,\n\texpressionStart: number,\n\texpressionEnd: number,\n\tcode: MagicString,\n\t{ exportNamesByVariable, snippets: { _ } }: RenderOptions\n): void {\n\tcode.prependRight(\n\t\texpressionStart,\n\t\t`exports('${exportNamesByVariable.get(exportedVariable)}',${_}`\n\t);\n\tcode.appendLeft(expressionEnd, ')');\n}\n\nexport function renderSystemExportFunction(\n\texportedVariables: readonly Variable[],\n\texpressionStart: number,\n\texpressionEnd: number,\n\tneedsParens: boolean | undefined,\n\tcode: MagicString,\n\toptions: RenderOptions\n): void {\n\tconst { _, getDirectReturnIifeLeft } = options.snippets;\n\tcode.prependRight(\n\t\texpressionStart,\n\t\tgetDirectReturnIifeLeft(\n\t\t\t['v'],\n\t\t\t`${getSystemExportStatement(exportedVariables, options)},${_}v`,\n\t\t\t{ needsArrowReturnParens: true, needsWrappedFunction: needsParens }\n\t\t)\n\t);\n\tcode.appendLeft(expressionEnd, ')');\n}\n\nexport function renderSystemExportSequenceAfterExpression(\n\texportedVariable: Variable,\n\texpressionStart: number,\n\texpressionEnd: number,\n\tneedsParens: boolean | undefined,\n\tcode: MagicString,\n\toptions: RenderOptions\n): void {\n\tconst { _, getPropertyAccess } = options.snippets;\n\tcode.appendLeft(\n\t\texpressionEnd,\n\t\t`,${_}${getSystemExportStatement([exportedVariable], options)},${_}${exportedVariable.getName(\n\t\t\tgetPropertyAccess\n\t\t)}`\n\t);\n\tif (needsParens) {\n\t\tcode.prependRight(expressionStart, '(');\n\t\tcode.appendLeft(expressionEnd, ')');\n\t}\n}\n\nexport function renderSystemExportSequenceBeforeExpression(\n\texportedVariable: Variable,\n\texpressionStart: number,\n\texpressionEnd: number,\n\tneedsParens: boolean | undefined,\n\tcode: MagicString,\n\toptions: RenderOptions,\n\tmodifier: string\n): void {\n\tconst { _ } = options.snippets;\n\tcode.prependRight(\n\t\texpressionStart,\n\t\t`${getSystemExportStatement([exportedVariable], options, modifier)},${_}`\n\t);\n\tif (needsParens) {\n\t\tcode.prependRight(expressionStart, '(');\n\t\tcode.appendLeft(expressionEnd, ')');\n\t}\n}\n","import type { HasEffectsContext } from '../ExecutionContext';\nimport { NodeInteractionAssigned } from '../NodeInteractions';\nimport { EMPTY_PATH, type ObjectPath } from '../utils/PathTracker';\nimport type LocalVariable from '../variables/LocalVariable';\nimport type Variable from '../variables/Variable';\nimport * as NodeType from './NodeType';\nimport type Property from './Property';\nimport type RestElement from './RestElement';\nimport type { ExpressionEntity } from './shared/Expression';\nimport { NodeBase } from './shared/Node';\nimport type { PatternNode } from './shared/Pattern';\n\nexport default class ObjectPattern extends NodeBase implements PatternNode {\n\tdeclare properties: readonly (Property | RestElement)[];\n\tdeclare type: NodeType.tObjectPattern;\n\n\taddExportedVariables(\n\t\tvariables: readonly Variable[],\n\t\texportNamesByVariable: ReadonlyMap\n\t): void {\n\t\tfor (const property of this.properties) {\n\t\t\tif (property.type === NodeType.Property) {\n\t\t\t\t(property.value as unknown as PatternNode).addExportedVariables(\n\t\t\t\t\tvariables,\n\t\t\t\t\texportNamesByVariable\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tproperty.argument.addExportedVariables(variables, exportNamesByVariable);\n\t\t\t}\n\t\t}\n\t}\n\n\tdeclare(kind: string, init: ExpressionEntity): LocalVariable[] {\n\t\tconst variables: LocalVariable[] = [];\n\t\tfor (const property of this.properties) {\n\t\t\tvariables.push(...property.declare(kind, init));\n\t\t}\n\t\treturn variables;\n\t}\n\n\tdeoptimizePath(path: ObjectPath): void {\n\t\tif (path.length === 0) {\n\t\t\tfor (const property of this.properties) {\n\t\t\t\tproperty.deoptimizePath(path);\n\t\t\t}\n\t\t}\n\t}\n\n\thasEffectsOnInteractionAtPath(\n\t\t// At the moment, this is only triggered for assignment left-hand sides,\n\t\t// where the path is empty\n\t\t_path: ObjectPath,\n\t\tinteraction: NodeInteractionAssigned,\n\t\tcontext: HasEffectsContext\n\t): boolean {\n\t\tfor (const property of this.properties) {\n\t\t\tif (property.hasEffectsOnInteractionAtPath(EMPTY_PATH, interaction, context)) return true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tmarkDeclarationReached(): void {\n\t\tfor (const property of this.properties) {\n\t\t\tproperty.markDeclarationReached();\n\t\t}\n\t}\n}\n","import type { AstContext } from '../../Module';\nimport { INTERACTION_ACCESSED, NodeInteraction } from '../NodeInteractions';\nimport { UNKNOWN_EXPRESSION } from '../nodes/shared/Expression';\nimport { ObjectPath } from '../utils/PathTracker';\nimport LocalVariable from './LocalVariable';\n\nexport default class ArgumentsVariable extends LocalVariable {\n\tconstructor(context: AstContext) {\n\t\tsuper('arguments', null, UNKNOWN_EXPRESSION, context);\n\t}\n\n\thasEffectsOnInteractionAtPath(path: ObjectPath, { type }: NodeInteraction): boolean {\n\t\treturn type !== INTERACTION_ACCESSED || path.length > 1;\n\t}\n}\n","import type { AstContext } from '../../Module';\nimport type { HasEffectsContext } from '../ExecutionContext';\nimport type { NodeInteraction, NodeInteractionWithThisArg } from '../NodeInteractions';\nimport { type ExpressionEntity, UNKNOWN_EXPRESSION } from '../nodes/shared/Expression';\nimport {\n\tDiscriminatedPathTracker,\n\ttype ObjectPath,\n\tSHARED_RECURSION_TRACKER\n} from '../utils/PathTracker';\nimport LocalVariable from './LocalVariable';\n\ninterface ThisDeoptimizationInteraction {\n\tinteraction: NodeInteractionWithThisArg;\n\tpath: ObjectPath;\n}\n\nexport default class ThisVariable extends LocalVariable {\n\tprivate readonly deoptimizedPaths: ObjectPath[] = [];\n\tprivate readonly entitiesToBeDeoptimized = new Set();\n\tprivate readonly thisDeoptimizationList: ThisDeoptimizationInteraction[] = [];\n\tprivate readonly thisDeoptimizations = new DiscriminatedPathTracker();\n\n\tconstructor(context: AstContext) {\n\t\tsuper('this', null, null, context);\n\t}\n\n\taddEntityToBeDeoptimized(entity: ExpressionEntity): void {\n\t\tfor (const path of this.deoptimizedPaths) {\n\t\t\tentity.deoptimizePath(path);\n\t\t}\n\t\tfor (const { interaction, path } of this.thisDeoptimizationList) {\n\t\t\tentity.deoptimizeThisOnInteractionAtPath(interaction, path, SHARED_RECURSION_TRACKER);\n\t\t}\n\t\tthis.entitiesToBeDeoptimized.add(entity);\n\t}\n\n\tdeoptimizePath(path: ObjectPath): void {\n\t\tif (\n\t\t\tpath.length === 0 ||\n\t\t\tthis.deoptimizationTracker.trackEntityAtPathAndGetIfTracked(path, this)\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t\tthis.deoptimizedPaths.push(path);\n\t\tfor (const entity of this.entitiesToBeDeoptimized) {\n\t\t\tentity.deoptimizePath(path);\n\t\t}\n\t}\n\n\tdeoptimizeThisOnInteractionAtPath(\n\t\tinteraction: NodeInteractionWithThisArg,\n\t\tpath: ObjectPath\n\t): void {\n\t\tconst thisDeoptimization: ThisDeoptimizationInteraction = {\n\t\t\tinteraction,\n\t\t\tpath\n\t\t};\n\t\tif (\n\t\t\t!this.thisDeoptimizations.trackEntityAtPathAndGetIfTracked(\n\t\t\t\tpath,\n\t\t\t\tinteraction.type,\n\t\t\t\tinteraction.thisArg\n\t\t\t)\n\t\t) {\n\t\t\tfor (const entity of this.entitiesToBeDeoptimized) {\n\t\t\t\tentity.deoptimizeThisOnInteractionAtPath(interaction, path, SHARED_RECURSION_TRACKER);\n\t\t\t}\n\t\t\tthis.thisDeoptimizationList.push(thisDeoptimization);\n\t\t}\n\t}\n\n\thasEffectsOnInteractionAtPath(\n\t\tpath: ObjectPath,\n\t\tinteraction: NodeInteraction,\n\t\tcontext: HasEffectsContext\n\t): boolean {\n\t\treturn (\n\t\t\tthis.getInit(context).hasEffectsOnInteractionAtPath(path, interaction, context) ||\n\t\t\tsuper.hasEffectsOnInteractionAtPath(path, interaction, context)\n\t\t);\n\t}\n\n\tprivate getInit(context: HasEffectsContext): ExpressionEntity {\n\t\treturn context.replacedVariableInits.get(this) || UNKNOWN_EXPRESSION;\n\t}\n}\n","import type { AstContext } from '../../Module';\nimport type { InclusionContext } from '../ExecutionContext';\nimport type SpreadElement from '../nodes/SpreadElement';\nimport { ExpressionEntity } from '../nodes/shared/Expression';\nimport ArgumentsVariable from '../variables/ArgumentsVariable';\nimport ThisVariable from '../variables/ThisVariable';\nimport type ChildScope from './ChildScope';\nimport ReturnValueScope from './ReturnValueScope';\n\nexport default class FunctionScope extends ReturnValueScope {\n\treadonly argumentsVariable: ArgumentsVariable;\n\treadonly thisVariable: ThisVariable;\n\n\tconstructor(parent: ChildScope, context: AstContext) {\n\t\tsuper(parent, context);\n\t\tthis.variables.set('arguments', (this.argumentsVariable = new ArgumentsVariable(context)));\n\t\tthis.variables.set('this', (this.thisVariable = new ThisVariable(context)));\n\t}\n\n\tfindLexicalBoundary(): ChildScope {\n\t\treturn this;\n\t}\n\n\tincludeCallArguments(\n\t\tcontext: InclusionContext,\n\t\targs: readonly (ExpressionEntity | SpreadElement)[]\n\t): void {\n\t\tsuper.includeCallArguments(context, args);\n\t\tif (this.argumentsVariable.included) {\n\t\t\tfor (const arg of args) {\n\t\t\t\tif (!arg.included) {\n\t\t\t\t\targ.include(context, false);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n","import { type HasEffectsContext, type InclusionContext } from '../../ExecutionContext';\nimport {\n\tINTERACTION_CALLED,\n\tNodeInteraction,\n\tNodeInteractionWithThisArg\n} from '../../NodeInteractions';\nimport FunctionScope from '../../scopes/FunctionScope';\nimport { type ObjectPath, PathTracker } from '../../utils/PathTracker';\nimport BlockStatement from '../BlockStatement';\nimport Identifier, { type IdentifierWithVariable } from '../Identifier';\nimport { UNKNOWN_EXPRESSION } from './Expression';\nimport FunctionBase from './FunctionBase';\nimport { type IncludeChildren } from './Node';\nimport { ObjectEntity } from './ObjectEntity';\nimport { OBJECT_PROTOTYPE } from './ObjectPrototype';\nimport type { PatternNode } from './Pattern';\n\nexport default class FunctionNode extends FunctionBase {\n\tdeclare async: boolean;\n\tdeclare body: BlockStatement;\n\tdeclare id: IdentifierWithVariable | null;\n\tdeclare params: readonly PatternNode[];\n\tdeclare preventChildBlockScope: true;\n\tdeclare scope: FunctionScope;\n\tprotected objectEntity: ObjectEntity | null = null;\n\n\tcreateScope(parentScope: FunctionScope): void {\n\t\tthis.scope = new FunctionScope(parentScope, this.context);\n\t}\n\n\tdeoptimizeThisOnInteractionAtPath(\n\t\tinteraction: NodeInteractionWithThisArg,\n\t\tpath: ObjectPath,\n\t\trecursionTracker: PathTracker\n\t): void {\n\t\tsuper.deoptimizeThisOnInteractionAtPath(interaction, path, recursionTracker);\n\t\tif (interaction.type === INTERACTION_CALLED && path.length === 0) {\n\t\t\tthis.scope.thisVariable.addEntityToBeDeoptimized(interaction.thisArg);\n\t\t}\n\t}\n\n\thasEffects(context: HasEffectsContext): boolean {\n\t\tif (!this.deoptimized) this.applyDeoptimizations();\n\t\treturn !!this.id?.hasEffects(context);\n\t}\n\n\thasEffectsOnInteractionAtPath(\n\t\tpath: ObjectPath,\n\t\tinteraction: NodeInteraction,\n\t\tcontext: HasEffectsContext\n\t): boolean {\n\t\tif (super.hasEffectsOnInteractionAtPath(path, interaction, context)) return true;\n\t\tif (interaction.type === INTERACTION_CALLED) {\n\t\t\tconst thisInit = context.replacedVariableInits.get(this.scope.thisVariable);\n\t\t\tcontext.replacedVariableInits.set(\n\t\t\t\tthis.scope.thisVariable,\n\t\t\t\tinteraction.withNew\n\t\t\t\t\t? new ObjectEntity(Object.create(null), OBJECT_PROTOTYPE)\n\t\t\t\t\t: UNKNOWN_EXPRESSION\n\t\t\t);\n\t\t\tconst { brokenFlow, ignore } = context;\n\t\t\tcontext.ignore = {\n\t\t\t\tbreaks: false,\n\t\t\t\tcontinues: false,\n\t\t\t\tlabels: new Set(),\n\t\t\t\treturnYield: true\n\t\t\t};\n\t\t\tif (this.body.hasEffects(context)) return true;\n\t\t\tcontext.brokenFlow = brokenFlow;\n\t\t\tif (thisInit) {\n\t\t\t\tcontext.replacedVariableInits.set(this.scope.thisVariable, thisInit);\n\t\t\t} else {\n\t\t\t\tcontext.replacedVariableInits.delete(this.scope.thisVariable);\n\t\t\t}\n\t\t\tcontext.ignore = ignore;\n\t\t}\n\t\treturn false;\n\t}\n\n\tinclude(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void {\n\t\tsuper.include(context, includeChildrenRecursively);\n\t\tthis.id?.include();\n\t\tconst hasArguments = this.scope.argumentsVariable.included;\n\t\tfor (const param of this.params) {\n\t\t\tif (!(param instanceof Identifier) || hasArguments) {\n\t\t\t\tparam.include(context, includeChildrenRecursively);\n\t\t\t}\n\t\t}\n\t}\n\n\tinitialise(): void {\n\t\tsuper.initialise();\n\t\tthis.id?.declare('function', this);\n\t}\n\n\tprotected getObjectEntity(): ObjectEntity {\n\t\tif (this.objectEntity !== null) {\n\t\t\treturn this.objectEntity;\n\t\t}\n\t\treturn (this.objectEntity = new ObjectEntity(\n\t\t\t[\n\t\t\t\t{\n\t\t\t\t\tkey: 'prototype',\n\t\t\t\t\tkind: 'init',\n\t\t\t\t\tproperty: new ObjectEntity([], OBJECT_PROTOTYPE)\n\t\t\t\t}\n\t\t\t],\n\t\t\tOBJECT_PROTOTYPE\n\t\t));\n\t}\n}\n","import type MagicString from 'magic-string';\nimport { BLANK } from '../../utils/blank';\nimport type { NodeRenderOptions, RenderOptions } from '../../utils/renderHelpers';\nimport type { DeoptimizableEntity } from '../DeoptimizableEntity';\nimport type { HasEffectsContext } from '../ExecutionContext';\nimport { INTERACTION_ACCESSED, NodeInteraction } from '../NodeInteractions';\nimport {\n\tEMPTY_PATH,\n\ttype ObjectPath,\n\ttype PathTracker,\n\tSHARED_RECURSION_TRACKER\n} from '../utils/PathTracker';\nimport ExpressionStatement from './ExpressionStatement';\nimport type { LiteralValue } from './Literal';\nimport type * as NodeType from './NodeType';\nimport { type LiteralValueOrUnknown, UnknownValue } from './shared/Expression';\nimport { type ExpressionNode, NodeBase } from './shared/Node';\n\ntype Operator =\n\t| '!='\n\t| '!=='\n\t| '%'\n\t| '&'\n\t| '*'\n\t| '**'\n\t| '+'\n\t| '-'\n\t| '/'\n\t| '<'\n\t| '<<'\n\t| '<='\n\t| '=='\n\t| '==='\n\t| '>'\n\t| '>='\n\t| '>>'\n\t| '>>>'\n\t| '^'\n\t| '|'\n\t| 'in'\n\t| 'instanceof';\n\nconst binaryOperators: {\n\t[operator in Operator]?: (left: LiteralValue, right: LiteralValue) => LiteralValueOrUnknown;\n} = {\n\t'!=': (left, right) => left != right,\n\t'!==': (left, right) => left !== right,\n\t'%': (left: any, right: any) => left % right,\n\t'&': (left: any, right: any) => left & right,\n\t'*': (left: any, right: any) => left * right,\n\t// At the moment, \"**\" will be transpiled to Math.pow\n\t'**': (left: any, right: any) => left ** right,\n\t'+': (left: any, right: any) => left + right,\n\t'-': (left: any, right: any) => left - right,\n\t'/': (left: any, right: any) => left / right,\n\t'<': (left, right) => left! < right!,\n\t'<<': (left: any, right: any) => left << right,\n\t'<=': (left, right) => left! <= right!,\n\t'==': (left, right) => left == right,\n\t'===': (left, right) => left === right,\n\t'>': (left, right) => left! > right!,\n\t'>=': (left, right) => left! >= right!,\n\t'>>': (left: any, right: any) => left >> right,\n\t'>>>': (left: any, right: any) => left >>> right,\n\t'^': (left: any, right: any) => left ^ right,\n\t'|': (left: any, right: any) => left | right\n\t// We use the fallback for cases where we return something unknown\n\t// in: () => UnknownValue,\n\t// instanceof: () => UnknownValue,\n};\n\nexport default class BinaryExpression extends NodeBase implements DeoptimizableEntity {\n\tdeclare left: ExpressionNode;\n\tdeclare operator: keyof typeof binaryOperators;\n\tdeclare right: ExpressionNode;\n\tdeclare type: NodeType.tBinaryExpression;\n\n\tdeoptimizeCache(): void {}\n\n\tgetLiteralValueAtPath(\n\t\tpath: ObjectPath,\n\t\trecursionTracker: PathTracker,\n\t\torigin: DeoptimizableEntity\n\t): LiteralValueOrUnknown {\n\t\tif (path.length > 0) return UnknownValue;\n\t\tconst leftValue = this.left.getLiteralValueAtPath(EMPTY_PATH, recursionTracker, origin);\n\t\tif (typeof leftValue === 'symbol') return UnknownValue;\n\n\t\tconst rightValue = this.right.getLiteralValueAtPath(EMPTY_PATH, recursionTracker, origin);\n\t\tif (typeof rightValue === 'symbol') return UnknownValue;\n\n\t\tconst operatorFn = binaryOperators[this.operator];\n\t\tif (!operatorFn) return UnknownValue;\n\n\t\treturn operatorFn(leftValue, rightValue);\n\t}\n\n\thasEffects(context: HasEffectsContext): boolean {\n\t\t// support some implicit type coercion runtime errors\n\t\tif (\n\t\t\tthis.operator === '+' &&\n\t\t\tthis.parent instanceof ExpressionStatement &&\n\t\t\tthis.left.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, this) === ''\n\t\t) {\n\t\t\treturn true;\n\t\t}\n\t\treturn super.hasEffects(context);\n\t}\n\n\thasEffectsOnInteractionAtPath(path: ObjectPath, { type }: NodeInteraction): boolean {\n\t\treturn type !== INTERACTION_ACCESSED || path.length > 1;\n\t}\n\n\trender(\n\t\tcode: MagicString,\n\t\toptions: RenderOptions,\n\t\t{ renderedSurroundingElement }: NodeRenderOptions = BLANK\n\t): void {\n\t\tthis.left.render(code, options, { renderedSurroundingElement });\n\t\tthis.right.render(code, options);\n\t}\n}\n","import MagicString from 'magic-string';\nimport CallExpression from '../ast/nodes/CallExpression';\nimport NewExpression from '../ast/nodes/NewExpression';\nimport { findFirstOccurrenceOutsideComment, RenderOptions } from './renderHelpers';\n\nexport function renderCallArguments(\n\tcode: MagicString,\n\toptions: RenderOptions,\n\tnode: CallExpression | NewExpression\n): void {\n\tif (node.arguments.length > 0) {\n\t\tif (node.arguments[node.arguments.length - 1].included) {\n\t\t\tfor (const arg of node.arguments) {\n\t\t\t\targ.render(code, options);\n\t\t\t}\n\t\t} else {\n\t\t\tlet lastIncludedIndex = node.arguments.length - 2;\n\t\t\twhile (lastIncludedIndex >= 0 && !node.arguments[lastIncludedIndex].included) {\n\t\t\t\tlastIncludedIndex--;\n\t\t\t}\n\t\t\tif (lastIncludedIndex >= 0) {\n\t\t\t\tfor (let index = 0; index <= lastIncludedIndex; index++) {\n\t\t\t\t\tnode.arguments[index].render(code, options);\n\t\t\t\t}\n\t\t\t\tcode.remove(\n\t\t\t\t\tfindFirstOccurrenceOutsideComment(\n\t\t\t\t\t\tcode.original,\n\t\t\t\t\t\t',',\n\t\t\t\t\t\tnode.arguments[lastIncludedIndex].end\n\t\t\t\t\t),\n\t\t\t\t\tnode.end - 1\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tcode.remove(\n\t\t\t\t\tfindFirstOccurrenceOutsideComment(code.original, '(', node.callee.end) + 1,\n\t\t\t\t\tnode.end - 1\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n}\n","import type MagicString from 'magic-string';\nimport type { HasEffectsContext } from '../ExecutionContext';\nimport {\n\tINTERACTION_ACCESSED,\n\tINTERACTION_ASSIGNED,\n\tINTERACTION_CALLED,\n\tNodeInteraction\n} from '../NodeInteractions';\nimport type { ObjectPath } from '../utils/PathTracker';\nimport {\n\tgetLiteralMembersForValue,\n\tgetMemberReturnExpressionWhenCalled,\n\thasMemberEffectWhenCalled,\n\ttype MemberDescription\n} from '../values';\nimport type * as NodeType from './NodeType';\nimport {\n\ttype ExpressionEntity,\n\ttype LiteralValueOrUnknown,\n\tUNKNOWN_EXPRESSION,\n\tUnknownValue\n} from './shared/Expression';\nimport { type GenericEsTreeNode, NodeBase } from './shared/Node';\n\nexport type LiteralValue = string | boolean | null | number | RegExp | undefined;\n\nexport default class Literal extends NodeBase {\n\tdeclare regex?: {\n\t\tflags: string;\n\t\tpattern: string;\n\t};\n\tdeclare type: NodeType.tLiteral;\n\tdeclare value: T;\n\n\tprivate declare members: { [key: string]: MemberDescription };\n\n\tdeoptimizeThisOnInteractionAtPath(): void {}\n\n\tgetLiteralValueAtPath(path: ObjectPath): LiteralValueOrUnknown {\n\t\tif (\n\t\t\tpath.length > 0 ||\n\t\t\t// unknown literals can also be null but do not start with an \"n\"\n\t\t\t(this.value === null && this.context.code.charCodeAt(this.start) !== 110) ||\n\t\t\ttypeof this.value === 'bigint' ||\n\t\t\t// to support shims for regular expressions\n\t\t\tthis.context.code.charCodeAt(this.start) === 47\n\t\t) {\n\t\t\treturn UnknownValue;\n\t\t}\n\t\treturn this.value;\n\t}\n\n\tgetReturnExpressionWhenCalledAtPath(path: ObjectPath): ExpressionEntity {\n\t\tif (path.length !== 1) return UNKNOWN_EXPRESSION;\n\t\treturn getMemberReturnExpressionWhenCalled(this.members, path[0]);\n\t}\n\n\thasEffectsOnInteractionAtPath(\n\t\tpath: ObjectPath,\n\t\tinteraction: NodeInteraction,\n\t\tcontext: HasEffectsContext\n\t): boolean {\n\t\tswitch (interaction.type) {\n\t\t\tcase INTERACTION_ACCESSED:\n\t\t\t\treturn path.length > (this.value === null ? 0 : 1);\n\t\t\tcase INTERACTION_ASSIGNED:\n\t\t\t\treturn true;\n\t\t\tcase INTERACTION_CALLED:\n\t\t\t\treturn (\n\t\t\t\t\tpath.length !== 1 ||\n\t\t\t\t\thasMemberEffectWhenCalled(this.members, path[0], interaction, context)\n\t\t\t\t);\n\t\t}\n\t}\n\n\tinitialise(): void {\n\t\tthis.members = getLiteralMembersForValue(this.value);\n\t}\n\n\tparseNode(esTreeNode: GenericEsTreeNode): void {\n\t\tthis.value = esTreeNode.value;\n\t\tthis.regex = esTreeNode.regex;\n\t\tsuper.parseNode(esTreeNode);\n\t}\n\n\trender(code: MagicString): void {\n\t\tif (typeof this.value === 'string') {\n\t\t\t(code.indentExclusionRanges as [number, number][]).push([this.start + 1, this.end - 1]);\n\t\t}\n\t}\n}\n","import type MagicString from 'magic-string';\nimport { AstContext } from '../../Module';\nimport type { NormalizedTreeshakingOptions } from '../../rollup/types';\nimport { BLANK } from '../../utils/blank';\nimport relativeId from '../../utils/relativeId';\nimport type { NodeRenderOptions, RenderOptions } from '../../utils/renderHelpers';\nimport type { DeoptimizableEntity } from '../DeoptimizableEntity';\nimport type { HasEffectsContext, InclusionContext } from '../ExecutionContext';\nimport {\n\tINTERACTION_ACCESSED,\n\tINTERACTION_ASSIGNED,\n\tNodeInteraction,\n\tNodeInteractionAccessed,\n\tNodeInteractionAssigned,\n\tNodeInteractionCalled,\n\tNodeInteractionWithThisArg\n} from '../NodeInteractions';\nimport {\n\tEMPTY_PATH,\n\ttype ObjectPath,\n\ttype ObjectPathKey,\n\ttype PathTracker,\n\tSHARED_RECURSION_TRACKER,\n\tUNKNOWN_PATH,\n\tUnknownKey,\n\tUnknownNonAccessorKey\n} from '../utils/PathTracker';\nimport ExternalVariable from '../variables/ExternalVariable';\nimport type NamespaceVariable from '../variables/NamespaceVariable';\nimport type Variable from '../variables/Variable';\nimport Identifier from './Identifier';\nimport Literal from './Literal';\nimport type * as NodeType from './NodeType';\nimport type PrivateIdentifier from './PrivateIdentifier';\nimport type SpreadElement from './SpreadElement';\nimport type Super from './Super';\nimport {\n\ttype ExpressionEntity,\n\ttype LiteralValueOrUnknown,\n\tUNKNOWN_EXPRESSION,\n\tUnknownValue\n} from './shared/Expression';\nimport { type ExpressionNode, type IncludeChildren, NodeBase } from './shared/Node';\n\n// To avoid infinite recursions\nconst MAX_PATH_DEPTH = 7;\n\nfunction getResolvablePropertyKey(memberExpression: MemberExpression): string | null {\n\treturn memberExpression.computed\n\t\t? getResolvableComputedPropertyKey(memberExpression.property)\n\t\t: (memberExpression.property as Identifier).name;\n}\n\nfunction getResolvableComputedPropertyKey(propertyKey: ExpressionNode): string | null {\n\tif (propertyKey instanceof Literal) {\n\t\treturn String(propertyKey.value);\n\t}\n\treturn null;\n}\n\ntype PathWithPositions = { key: string; pos: number }[];\n\nfunction getPathIfNotComputed(memberExpression: MemberExpression): PathWithPositions | null {\n\tconst nextPathKey = memberExpression.propertyKey;\n\tconst object = memberExpression.object;\n\tif (typeof nextPathKey === 'string') {\n\t\tif (object instanceof Identifier) {\n\t\t\treturn [\n\t\t\t\t{ key: object.name, pos: object.start },\n\t\t\t\t{ key: nextPathKey, pos: memberExpression.property.start }\n\t\t\t];\n\t\t}\n\t\tif (object instanceof MemberExpression) {\n\t\t\tconst parentPath = getPathIfNotComputed(object);\n\t\t\treturn (\n\t\t\t\tparentPath && [...parentPath, { key: nextPathKey, pos: memberExpression.property.start }]\n\t\t\t);\n\t\t}\n\t}\n\treturn null;\n}\n\nfunction getStringFromPath(path: PathWithPositions): string {\n\tlet pathString = path[0].key;\n\tfor (let index = 1; index < path.length; index++) {\n\t\tpathString += '.' + path[index].key;\n\t}\n\treturn pathString;\n}\n\nexport default class MemberExpression extends NodeBase implements DeoptimizableEntity {\n\tdeclare computed: boolean;\n\tdeclare object: ExpressionNode | Super;\n\tdeclare optional: boolean;\n\tdeclare property: ExpressionNode | PrivateIdentifier;\n\tdeclare propertyKey: ObjectPathKey | null;\n\tdeclare type: NodeType.tMemberExpression;\n\tvariable: Variable | null = null;\n\tprotected declare assignmentInteraction: NodeInteractionAssigned & { thisArg: ExpressionEntity };\n\tprivate declare accessInteraction: NodeInteractionAccessed & { thisArg: ExpressionEntity };\n\tprivate assignmentDeoptimized = false;\n\tprivate bound = false;\n\tprivate expressionsToBeDeoptimized: DeoptimizableEntity[] = [];\n\tprivate replacement: string | null = null;\n\n\tbind(): void {\n\t\tthis.bound = true;\n\t\tconst path = getPathIfNotComputed(this);\n\t\tconst baseVariable = path && this.scope.findVariable(path[0].key);\n\t\tif (baseVariable && baseVariable.isNamespace) {\n\t\t\tconst resolvedVariable = resolveNamespaceVariables(\n\t\t\t\tbaseVariable,\n\t\t\t\tpath!.slice(1),\n\t\t\t\tthis.context\n\t\t\t);\n\t\t\tif (!resolvedVariable) {\n\t\t\t\tsuper.bind();\n\t\t\t} else if (typeof resolvedVariable === 'string') {\n\t\t\t\tthis.replacement = resolvedVariable;\n\t\t\t} else {\n\t\t\t\tthis.variable = resolvedVariable;\n\t\t\t\tthis.scope.addNamespaceMemberAccess(getStringFromPath(path!), resolvedVariable);\n\t\t\t}\n\t\t} else {\n\t\t\tsuper.bind();\n\t\t}\n\t}\n\n\tdeoptimizeCache(): void {\n\t\tconst expressionsToBeDeoptimized = this.expressionsToBeDeoptimized;\n\t\tthis.expressionsToBeDeoptimized = [];\n\t\tthis.propertyKey = UnknownKey;\n\t\tthis.object.deoptimizePath(UNKNOWN_PATH);\n\t\tfor (const expression of expressionsToBeDeoptimized) {\n\t\t\texpression.deoptimizeCache();\n\t\t}\n\t}\n\n\tdeoptimizePath(path: ObjectPath): void {\n\t\tif (path.length === 0) this.disallowNamespaceReassignment();\n\t\tif (this.variable) {\n\t\t\tthis.variable.deoptimizePath(path);\n\t\t} else if (!this.replacement) {\n\t\t\tif (path.length < MAX_PATH_DEPTH) {\n\t\t\t\tconst propertyKey = this.getPropertyKey();\n\t\t\t\tthis.object.deoptimizePath([\n\t\t\t\t\tpropertyKey === UnknownKey ? UnknownNonAccessorKey : propertyKey,\n\t\t\t\t\t...path\n\t\t\t\t]);\n\t\t\t}\n\t\t}\n\t}\n\n\tdeoptimizeThisOnInteractionAtPath(\n\t\tinteraction: NodeInteractionWithThisArg,\n\t\tpath: ObjectPath,\n\t\trecursionTracker: PathTracker\n\t): void {\n\t\tif (this.variable) {\n\t\t\tthis.variable.deoptimizeThisOnInteractionAtPath(interaction, path, recursionTracker);\n\t\t} else if (!this.replacement) {\n\t\t\tif (path.length < MAX_PATH_DEPTH) {\n\t\t\t\tthis.object.deoptimizeThisOnInteractionAtPath(\n\t\t\t\t\tinteraction,\n\t\t\t\t\t[this.getPropertyKey(), ...path],\n\t\t\t\t\trecursionTracker\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tinteraction.thisArg.deoptimizePath(UNKNOWN_PATH);\n\t\t\t}\n\t\t}\n\t}\n\n\tgetLiteralValueAtPath(\n\t\tpath: ObjectPath,\n\t\trecursionTracker: PathTracker,\n\t\torigin: DeoptimizableEntity\n\t): LiteralValueOrUnknown {\n\t\tif (this.variable) {\n\t\t\treturn this.variable.getLiteralValueAtPath(path, recursionTracker, origin);\n\t\t}\n\t\tif (this.replacement) {\n\t\t\treturn UnknownValue;\n\t\t}\n\t\tthis.expressionsToBeDeoptimized.push(origin);\n\t\tif (path.length < MAX_PATH_DEPTH) {\n\t\t\treturn this.object.getLiteralValueAtPath(\n\t\t\t\t[this.getPropertyKey(), ...path],\n\t\t\t\trecursionTracker,\n\t\t\t\torigin\n\t\t\t);\n\t\t}\n\t\treturn UnknownValue;\n\t}\n\n\tgetReturnExpressionWhenCalledAtPath(\n\t\tpath: ObjectPath,\n\t\tinteraction: NodeInteractionCalled,\n\t\trecursionTracker: PathTracker,\n\t\torigin: DeoptimizableEntity\n\t): ExpressionEntity {\n\t\tif (this.variable) {\n\t\t\treturn this.variable.getReturnExpressionWhenCalledAtPath(\n\t\t\t\tpath,\n\t\t\t\tinteraction,\n\t\t\t\trecursionTracker,\n\t\t\t\torigin\n\t\t\t);\n\t\t}\n\t\tif (this.replacement) {\n\t\t\treturn UNKNOWN_EXPRESSION;\n\t\t}\n\t\tthis.expressionsToBeDeoptimized.push(origin);\n\t\tif (path.length < MAX_PATH_DEPTH) {\n\t\t\treturn this.object.getReturnExpressionWhenCalledAtPath(\n\t\t\t\t[this.getPropertyKey(), ...path],\n\t\t\t\tinteraction,\n\t\t\t\trecursionTracker,\n\t\t\t\torigin\n\t\t\t);\n\t\t}\n\t\treturn UNKNOWN_EXPRESSION;\n\t}\n\n\thasEffects(context: HasEffectsContext): boolean {\n\t\tif (!this.deoptimized) this.applyDeoptimizations();\n\t\treturn (\n\t\t\tthis.property.hasEffects(context) ||\n\t\t\tthis.object.hasEffects(context) ||\n\t\t\tthis.hasAccessEffect(context)\n\t\t);\n\t}\n\n\thasEffectsAsAssignmentTarget(context: HasEffectsContext, checkAccess: boolean): boolean {\n\t\tif (checkAccess && !this.deoptimized) this.applyDeoptimizations();\n\t\tif (!this.assignmentDeoptimized) this.applyAssignmentDeoptimization();\n\t\treturn (\n\t\t\tthis.property.hasEffects(context) ||\n\t\t\tthis.object.hasEffects(context) ||\n\t\t\t(checkAccess && this.hasAccessEffect(context)) ||\n\t\t\tthis.hasEffectsOnInteractionAtPath(EMPTY_PATH, this.assignmentInteraction, context)\n\t\t);\n\t}\n\n\thasEffectsOnInteractionAtPath(\n\t\tpath: ObjectPath,\n\t\tinteraction: NodeInteraction,\n\t\tcontext: HasEffectsContext\n\t): boolean {\n\t\tif (this.variable) {\n\t\t\treturn this.variable.hasEffectsOnInteractionAtPath(path, interaction, context);\n\t\t}\n\t\tif (this.replacement) {\n\t\t\treturn true;\n\t\t}\n\t\tif (path.length < MAX_PATH_DEPTH) {\n\t\t\treturn this.object.hasEffectsOnInteractionAtPath(\n\t\t\t\t[this.getPropertyKey(), ...path],\n\t\t\t\tinteraction,\n\t\t\t\tcontext\n\t\t\t);\n\t\t}\n\t\treturn true;\n\t}\n\n\tinclude(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void {\n\t\tif (!this.deoptimized) this.applyDeoptimizations();\n\t\tthis.includeProperties(context, includeChildrenRecursively);\n\t}\n\n\tincludeAsAssignmentTarget(\n\t\tcontext: InclusionContext,\n\t\tincludeChildrenRecursively: IncludeChildren,\n\t\tdeoptimizeAccess: boolean\n\t): void {\n\t\tif (!this.assignmentDeoptimized) this.applyAssignmentDeoptimization();\n\t\tif (deoptimizeAccess) {\n\t\t\tthis.include(context, includeChildrenRecursively);\n\t\t} else {\n\t\t\tthis.includeProperties(context, includeChildrenRecursively);\n\t\t}\n\t}\n\n\tincludeCallArguments(\n\t\tcontext: InclusionContext,\n\t\targs: readonly (ExpressionEntity | SpreadElement)[]\n\t): void {\n\t\tif (this.variable) {\n\t\t\tthis.variable.includeCallArguments(context, args);\n\t\t} else {\n\t\t\tsuper.includeCallArguments(context, args);\n\t\t}\n\t}\n\n\tinitialise(): void {\n\t\tthis.propertyKey = getResolvablePropertyKey(this);\n\t\tthis.accessInteraction = { thisArg: this.object, type: INTERACTION_ACCESSED };\n\t}\n\n\trender(\n\t\tcode: MagicString,\n\t\toptions: RenderOptions,\n\t\t{\n\t\t\trenderedParentType,\n\t\t\tisCalleeOfRenderedParent,\n\t\t\trenderedSurroundingElement\n\t\t}: NodeRenderOptions = BLANK\n\t): void {\n\t\tif (this.variable || this.replacement) {\n\t\t\tconst {\n\t\t\t\tsnippets: { getPropertyAccess }\n\t\t\t} = options;\n\t\t\tlet replacement = this.variable ? this.variable.getName(getPropertyAccess) : this.replacement;\n\t\t\tif (renderedParentType && isCalleeOfRenderedParent) replacement = '0, ' + replacement;\n\t\t\tcode.overwrite(this.start, this.end, replacement!, {\n\t\t\t\tcontentOnly: true,\n\t\t\t\tstoreName: true\n\t\t\t});\n\t\t} else {\n\t\t\tif (renderedParentType && isCalleeOfRenderedParent) {\n\t\t\t\tcode.appendRight(this.start, '0, ');\n\t\t\t}\n\t\t\tthis.object.render(code, options, { renderedSurroundingElement });\n\t\t\tthis.property.render(code, options);\n\t\t}\n\t}\n\n\tsetAssignedValue(value: ExpressionEntity) {\n\t\tthis.assignmentInteraction = {\n\t\t\targs: [value],\n\t\t\tthisArg: this.object,\n\t\t\ttype: INTERACTION_ASSIGNED\n\t\t};\n\t}\n\n\tprotected applyDeoptimizations(): void {\n\t\tthis.deoptimized = true;\n\t\tconst { propertyReadSideEffects } = this.context.options\n\t\t\t.treeshake as NormalizedTreeshakingOptions;\n\t\tif (\n\t\t\t// Namespaces are not bound and should not be deoptimized\n\t\t\tthis.bound &&\n\t\t\tpropertyReadSideEffects &&\n\t\t\t!(this.variable || this.replacement)\n\t\t) {\n\t\t\tconst propertyKey = this.getPropertyKey();\n\t\t\tthis.object.deoptimizeThisOnInteractionAtPath(\n\t\t\t\tthis.accessInteraction,\n\t\t\t\t[propertyKey],\n\t\t\t\tSHARED_RECURSION_TRACKER\n\t\t\t);\n\t\t\tthis.context.requestTreeshakingPass();\n\t\t}\n\t}\n\n\tprivate applyAssignmentDeoptimization(): void {\n\t\tthis.assignmentDeoptimized = true;\n\t\tconst { propertyReadSideEffects } = this.context.options\n\t\t\t.treeshake as NormalizedTreeshakingOptions;\n\t\tif (\n\t\t\t// Namespaces are not bound and should not be deoptimized\n\t\t\tthis.bound &&\n\t\t\tpropertyReadSideEffects &&\n\t\t\t!(this.variable || this.replacement)\n\t\t) {\n\t\t\tthis.object.deoptimizeThisOnInteractionAtPath(\n\t\t\t\tthis.assignmentInteraction,\n\t\t\t\t[this.getPropertyKey()],\n\t\t\t\tSHARED_RECURSION_TRACKER\n\t\t\t);\n\t\t\tthis.context.requestTreeshakingPass();\n\t\t}\n\t}\n\n\tprivate disallowNamespaceReassignment() {\n\t\tif (this.object instanceof Identifier) {\n\t\t\tconst variable = this.scope.findVariable(this.object.name);\n\t\t\tif (variable.isNamespace) {\n\t\t\t\tif (this.variable) {\n\t\t\t\t\tthis.context.includeVariableInModule(this.variable);\n\t\t\t\t}\n\t\t\t\tthis.context.warn(\n\t\t\t\t\t{\n\t\t\t\t\t\tcode: 'ILLEGAL_NAMESPACE_REASSIGNMENT',\n\t\t\t\t\t\tmessage: `Illegal reassignment to import '${this.object.name}'`\n\t\t\t\t\t},\n\t\t\t\t\tthis.start\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate getPropertyKey(): ObjectPathKey {\n\t\tif (this.propertyKey === null) {\n\t\t\tthis.propertyKey = UnknownKey;\n\t\t\tconst value = this.property.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, this);\n\t\t\treturn (this.propertyKey = typeof value === 'symbol' ? UnknownKey : String(value));\n\t\t}\n\t\treturn this.propertyKey;\n\t}\n\n\tprivate hasAccessEffect(context: HasEffectsContext) {\n\t\tconst { propertyReadSideEffects } = this.context.options\n\t\t\t.treeshake as NormalizedTreeshakingOptions;\n\t\treturn (\n\t\t\t!(this.variable || this.replacement) &&\n\t\t\tpropertyReadSideEffects &&\n\t\t\t(propertyReadSideEffects === 'always' ||\n\t\t\t\tthis.object.hasEffectsOnInteractionAtPath(\n\t\t\t\t\t[this.getPropertyKey()],\n\t\t\t\t\tthis.accessInteraction,\n\t\t\t\t\tcontext\n\t\t\t\t))\n\t\t);\n\t}\n\n\tprivate includeProperties(\n\t\tcontext: InclusionContext,\n\t\tincludeChildrenRecursively: IncludeChildren\n\t) {\n\t\tif (!this.included) {\n\t\t\tthis.included = true;\n\t\t\tif (this.variable) {\n\t\t\t\tthis.context.includeVariableInModule(this.variable);\n\t\t\t}\n\t\t}\n\t\tthis.object.include(context, includeChildrenRecursively);\n\t\tthis.property.include(context, includeChildrenRecursively);\n\t}\n}\n\nfunction resolveNamespaceVariables(\n\tbaseVariable: Variable,\n\tpath: PathWithPositions,\n\tastContext: AstContext\n): Variable | string | null {\n\tif (path.length === 0) return baseVariable;\n\tif (!baseVariable.isNamespace || baseVariable instanceof ExternalVariable) return null;\n\tconst exportName = path[0].key;\n\tconst variable = (baseVariable as NamespaceVariable).context.traceExport(exportName);\n\tif (!variable) {\n\t\tconst fileName = (baseVariable as NamespaceVariable).context.fileName;\n\t\tastContext.warn(\n\t\t\t{\n\t\t\t\tcode: 'MISSING_EXPORT',\n\t\t\t\texporter: relativeId(fileName),\n\t\t\t\timporter: relativeId(astContext.fileName),\n\t\t\t\tmessage: `'${exportName}' is not exported by '${relativeId(fileName)}'`,\n\t\t\t\tmissing: exportName,\n\t\t\t\turl: `https://rollupjs.org/guide/en/#error-name-is-not-exported-by-module`\n\t\t\t},\n\t\t\tpath[0].pos\n\t\t);\n\t\treturn 'undefined';\n\t}\n\treturn resolveNamespaceVariables(variable, path.slice(1), astContext);\n}\n","import type { DeoptimizableEntity } from '../../DeoptimizableEntity';\nimport type { HasEffectsContext } from '../../ExecutionContext';\nimport {\n\tINTERACTION_ASSIGNED,\n\tINTERACTION_CALLED,\n\tNodeInteraction,\n\tNodeInteractionCalled,\n\tNodeInteractionWithThisArg\n} from '../../NodeInteractions';\nimport { type ObjectPath, type PathTracker, UNKNOWN_PATH } from '../../utils/PathTracker';\nimport {\n\ttype ExpressionEntity,\n\ttype LiteralValueOrUnknown,\n\tUNKNOWN_EXPRESSION,\n\tUnknownValue\n} from './Expression';\nimport { NodeBase } from './Node';\n\nexport default abstract class CallExpressionBase extends NodeBase implements DeoptimizableEntity {\n\tprotected declare interaction: NodeInteractionCalled;\n\tprotected returnExpression: ExpressionEntity | null = null;\n\tprivate readonly deoptimizableDependentExpressions: DeoptimizableEntity[] = [];\n\tprivate readonly expressionsToBeDeoptimized = new Set();\n\n\tdeoptimizeCache(): void {\n\t\tif (this.returnExpression !== UNKNOWN_EXPRESSION) {\n\t\t\tthis.returnExpression = UNKNOWN_EXPRESSION;\n\t\t\tfor (const expression of this.deoptimizableDependentExpressions) {\n\t\t\t\texpression.deoptimizeCache();\n\t\t\t}\n\t\t\tfor (const expression of this.expressionsToBeDeoptimized) {\n\t\t\t\texpression.deoptimizePath(UNKNOWN_PATH);\n\t\t\t}\n\t\t}\n\t}\n\n\tdeoptimizePath(path: ObjectPath): void {\n\t\tif (\n\t\t\tpath.length === 0 ||\n\t\t\tthis.context.deoptimizationTracker.trackEntityAtPathAndGetIfTracked(path, this)\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t\tconst returnExpression = this.getReturnExpression();\n\t\tif (returnExpression !== UNKNOWN_EXPRESSION) {\n\t\t\treturnExpression.deoptimizePath(path);\n\t\t}\n\t}\n\n\tdeoptimizeThisOnInteractionAtPath(\n\t\tinteraction: NodeInteractionWithThisArg,\n\t\tpath: ObjectPath,\n\t\trecursionTracker: PathTracker\n\t): void {\n\t\tconst returnExpression = this.getReturnExpression(recursionTracker);\n\t\tif (returnExpression === UNKNOWN_EXPRESSION) {\n\t\t\tinteraction.thisArg.deoptimizePath(UNKNOWN_PATH);\n\t\t} else {\n\t\t\trecursionTracker.withTrackedEntityAtPath(\n\t\t\t\tpath,\n\t\t\t\treturnExpression,\n\t\t\t\t() => {\n\t\t\t\t\tthis.expressionsToBeDeoptimized.add(interaction.thisArg);\n\t\t\t\t\treturnExpression.deoptimizeThisOnInteractionAtPath(interaction, path, recursionTracker);\n\t\t\t\t},\n\t\t\t\tundefined\n\t\t\t);\n\t\t}\n\t}\n\n\tgetLiteralValueAtPath(\n\t\tpath: ObjectPath,\n\t\trecursionTracker: PathTracker,\n\t\torigin: DeoptimizableEntity\n\t): LiteralValueOrUnknown {\n\t\tconst returnExpression = this.getReturnExpression(recursionTracker);\n\t\tif (returnExpression === UNKNOWN_EXPRESSION) {\n\t\t\treturn UnknownValue;\n\t\t}\n\t\treturn recursionTracker.withTrackedEntityAtPath(\n\t\t\tpath,\n\t\t\treturnExpression,\n\t\t\t() => {\n\t\t\t\tthis.deoptimizableDependentExpressions.push(origin);\n\t\t\t\treturn returnExpression.getLiteralValueAtPath(path, recursionTracker, origin);\n\t\t\t},\n\t\t\tUnknownValue\n\t\t);\n\t}\n\n\tgetReturnExpressionWhenCalledAtPath(\n\t\tpath: ObjectPath,\n\t\tinteraction: NodeInteractionCalled,\n\t\trecursionTracker: PathTracker,\n\t\torigin: DeoptimizableEntity\n\t): ExpressionEntity {\n\t\tconst returnExpression = this.getReturnExpression(recursionTracker);\n\t\tif (this.returnExpression === UNKNOWN_EXPRESSION) {\n\t\t\treturn UNKNOWN_EXPRESSION;\n\t\t}\n\t\treturn recursionTracker.withTrackedEntityAtPath(\n\t\t\tpath,\n\t\t\treturnExpression,\n\t\t\t() => {\n\t\t\t\tthis.deoptimizableDependentExpressions.push(origin);\n\t\t\t\treturn returnExpression.getReturnExpressionWhenCalledAtPath(\n\t\t\t\t\tpath,\n\t\t\t\t\tinteraction,\n\t\t\t\t\trecursionTracker,\n\t\t\t\t\torigin\n\t\t\t\t);\n\t\t\t},\n\t\t\tUNKNOWN_EXPRESSION\n\t\t);\n\t}\n\n\thasEffectsOnInteractionAtPath(\n\t\tpath: ObjectPath,\n\t\tinteraction: NodeInteraction,\n\t\tcontext: HasEffectsContext\n\t): boolean {\n\t\tconst { type } = interaction;\n\t\tif (type === INTERACTION_CALLED) {\n\t\t\tif (\n\t\t\t\t(interaction.withNew\n\t\t\t\t\t? context.instantiated\n\t\t\t\t\t: context.called\n\t\t\t\t).trackEntityAtPathAndGetIfTracked(path, interaction.args, this)\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else if (\n\t\t\t(type === INTERACTION_ASSIGNED\n\t\t\t\t? context.assigned\n\t\t\t\t: context.accessed\n\t\t\t).trackEntityAtPathAndGetIfTracked(path, this)\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\t\treturn this.getReturnExpression().hasEffectsOnInteractionAtPath(path, interaction, context);\n\t}\n\n\tprotected abstract getReturnExpression(recursionTracker?: PathTracker): ExpressionEntity;\n}\n","import type { AstContext } from '../../Module';\nimport type Identifier from '../nodes/Identifier';\nimport type { ExpressionEntity } from '../nodes/shared/Expression';\nimport { UNDEFINED_EXPRESSION } from '../values';\nimport type LocalVariable from '../variables/LocalVariable';\nimport ParameterScope from './ParameterScope';\n\nexport default class CatchScope extends ParameterScope {\n\taddDeclaration(\n\t\tidentifier: Identifier,\n\t\tcontext: AstContext,\n\t\tinit: ExpressionEntity | null,\n\t\tisHoisted: boolean\n\t): LocalVariable {\n\t\tconst existingParameter = this.variables.get(identifier.name) as LocalVariable;\n\t\tif (existingParameter) {\n\t\t\t// While we still create a hoisted declaration, the initializer goes to\n\t\t\t// the parameter. Note that technically, the declaration now belongs to\n\t\t\t// two variables, which is not correct but should not cause issues.\n\t\t\tthis.parent.addDeclaration(identifier, context, UNDEFINED_EXPRESSION, isHoisted);\n\t\t\texistingParameter.addDeclaration(identifier, init);\n\t\t\treturn existingParameter;\n\t\t}\n\t\treturn this.parent.addDeclaration(identifier, context, init, isHoisted);\n\t}\n}\n","import type { AstContext } from '../../Module';\nimport ClassNode from '../nodes/shared/ClassNode';\nimport LocalVariable from '../variables/LocalVariable';\nimport ThisVariable from '../variables/ThisVariable';\nimport ChildScope from './ChildScope';\nimport type Scope from './Scope';\n\nexport default class ClassBodyScope extends ChildScope {\n\tinstanceScope: ChildScope;\n\tthisVariable: LocalVariable;\n\n\tconstructor(parent: Scope, classNode: ClassNode, context: AstContext) {\n\t\tsuper(parent);\n\t\tthis.variables.set(\n\t\t\t'this',\n\t\t\t(this.thisVariable = new LocalVariable('this', null, classNode, context))\n\t\t);\n\t\tthis.instanceScope = new ChildScope(this);\n\t\tthis.instanceScope.variables.set('this', new ThisVariable(context));\n\t}\n\n\tfindLexicalBoundary(): ChildScope {\n\t\treturn this;\n\t}\n}\n","import type { DeoptimizableEntity } from '../../DeoptimizableEntity';\nimport type { HasEffectsContext } from '../../ExecutionContext';\nimport {\n\tINTERACTION_ACCESSED,\n\tINTERACTION_ASSIGNED,\n\tINTERACTION_CALLED,\n\tNO_ARGS,\n\tNODE_INTERACTION_UNKNOWN_CALL,\n\tNodeInteraction,\n\tNodeInteractionCalled,\n\tNodeInteractionWithThisArg\n} from '../../NodeInteractions';\nimport {\n\tEMPTY_PATH,\n\ttype ObjectPath,\n\ttype PathTracker,\n\tSHARED_RECURSION_TRACKER\n} from '../../utils/PathTracker';\nimport type PrivateIdentifier from '../PrivateIdentifier';\nimport {\n\ttype ExpressionEntity,\n\ttype LiteralValueOrUnknown,\n\tUNKNOWN_EXPRESSION\n} from './Expression';\nimport { type ExpressionNode, NodeBase } from './Node';\nimport type { PatternNode } from './Pattern';\n\nexport default class MethodBase extends NodeBase implements DeoptimizableEntity {\n\tdeclare computed: boolean;\n\tdeclare key: ExpressionNode | PrivateIdentifier;\n\tdeclare kind: 'constructor' | 'method' | 'init' | 'get' | 'set';\n\tdeclare value: ExpressionNode | (ExpressionNode & PatternNode);\n\n\tprivate accessedValue: ExpressionEntity | null = null;\n\n\t// As getter properties directly receive their values from fixed function\n\t// expressions, there is no known situation where a getter is deoptimized.\n\tdeoptimizeCache(): void {}\n\n\tdeoptimizePath(path: ObjectPath): void {\n\t\tthis.getAccessedValue().deoptimizePath(path);\n\t}\n\n\tdeoptimizeThisOnInteractionAtPath(\n\t\tinteraction: NodeInteractionWithThisArg,\n\t\tpath: ObjectPath,\n\t\trecursionTracker: PathTracker\n\t): void {\n\t\tif (interaction.type === INTERACTION_ACCESSED && this.kind === 'get' && path.length === 0) {\n\t\t\treturn this.value.deoptimizeThisOnInteractionAtPath(\n\t\t\t\t{\n\t\t\t\t\targs: NO_ARGS,\n\t\t\t\t\tthisArg: interaction.thisArg,\n\t\t\t\t\ttype: INTERACTION_CALLED,\n\t\t\t\t\twithNew: false\n\t\t\t\t},\n\t\t\t\tEMPTY_PATH,\n\t\t\t\trecursionTracker\n\t\t\t);\n\t\t}\n\t\tif (interaction.type === INTERACTION_ASSIGNED && this.kind === 'set' && path.length === 0) {\n\t\t\treturn this.value.deoptimizeThisOnInteractionAtPath(\n\t\t\t\t{\n\t\t\t\t\targs: interaction.args,\n\t\t\t\t\tthisArg: interaction.thisArg,\n\t\t\t\t\ttype: INTERACTION_CALLED,\n\t\t\t\t\twithNew: false\n\t\t\t\t},\n\t\t\t\tEMPTY_PATH,\n\t\t\t\trecursionTracker\n\t\t\t);\n\t\t}\n\t\tthis.getAccessedValue().deoptimizeThisOnInteractionAtPath(interaction, path, recursionTracker);\n\t}\n\n\tgetLiteralValueAtPath(\n\t\tpath: ObjectPath,\n\t\trecursionTracker: PathTracker,\n\t\torigin: DeoptimizableEntity\n\t): LiteralValueOrUnknown {\n\t\treturn this.getAccessedValue().getLiteralValueAtPath(path, recursionTracker, origin);\n\t}\n\n\tgetReturnExpressionWhenCalledAtPath(\n\t\tpath: ObjectPath,\n\t\tinteraction: NodeInteractionCalled,\n\t\trecursionTracker: PathTracker,\n\t\torigin: DeoptimizableEntity\n\t): ExpressionEntity {\n\t\treturn this.getAccessedValue().getReturnExpressionWhenCalledAtPath(\n\t\t\tpath,\n\t\t\tinteraction,\n\t\t\trecursionTracker,\n\t\t\torigin\n\t\t);\n\t}\n\n\thasEffects(context: HasEffectsContext): boolean {\n\t\treturn this.key.hasEffects(context);\n\t}\n\n\thasEffectsOnInteractionAtPath(\n\t\tpath: ObjectPath,\n\t\tinteraction: NodeInteraction,\n\t\tcontext: HasEffectsContext\n\t): boolean {\n\t\tif (this.kind === 'get' && interaction.type === INTERACTION_ACCESSED && path.length === 0) {\n\t\t\treturn this.value.hasEffectsOnInteractionAtPath(\n\t\t\t\tEMPTY_PATH,\n\t\t\t\t{\n\t\t\t\t\targs: NO_ARGS,\n\t\t\t\t\tthisArg: interaction.thisArg,\n\t\t\t\t\ttype: INTERACTION_CALLED,\n\t\t\t\t\twithNew: false\n\t\t\t\t},\n\t\t\t\tcontext\n\t\t\t);\n\t\t}\n\t\t// setters are only called for empty paths\n\t\tif (this.kind === 'set' && interaction.type === INTERACTION_ASSIGNED) {\n\t\t\treturn this.value.hasEffectsOnInteractionAtPath(\n\t\t\t\tEMPTY_PATH,\n\t\t\t\t{\n\t\t\t\t\targs: interaction.args,\n\t\t\t\t\tthisArg: interaction.thisArg,\n\t\t\t\t\ttype: INTERACTION_CALLED,\n\t\t\t\t\twithNew: false\n\t\t\t\t},\n\t\t\t\tcontext\n\t\t\t);\n\t\t}\n\t\treturn this.getAccessedValue().hasEffectsOnInteractionAtPath(path, interaction, context);\n\t}\n\n\tprotected applyDeoptimizations() {}\n\n\tprotected getAccessedValue(): ExpressionEntity {\n\t\tif (this.accessedValue === null) {\n\t\t\tif (this.kind === 'get') {\n\t\t\t\tthis.accessedValue = UNKNOWN_EXPRESSION;\n\t\t\t\treturn (this.accessedValue = this.value.getReturnExpressionWhenCalledAtPath(\n\t\t\t\t\tEMPTY_PATH,\n\t\t\t\t\tNODE_INTERACTION_UNKNOWN_CALL,\n\t\t\t\t\tSHARED_RECURSION_TRACKER,\n\t\t\t\t\tthis\n\t\t\t\t));\n\t\t\t} else {\n\t\t\t\treturn (this.accessedValue = this.value);\n\t\t\t}\n\t\t}\n\t\treturn this.accessedValue;\n\t}\n}\n","import type FunctionExpression from './FunctionExpression';\nimport type * as NodeType from './NodeType';\nimport type PrivateIdentifier from './PrivateIdentifier';\nimport MethodBase from './shared/MethodBase';\nimport type { ExpressionNode } from './shared/Node';\n\nexport default class MethodDefinition extends MethodBase {\n\tdeclare key: ExpressionNode | PrivateIdentifier;\n\tdeclare kind: 'constructor' | 'method' | 'get' | 'set';\n\tdeclare static: boolean;\n\tdeclare type: NodeType.tMethodDefinition;\n\tdeclare value: FunctionExpression;\n\n\tprotected applyDeoptimizations() {}\n}\n","import type { DeoptimizableEntity } from '../../DeoptimizableEntity';\nimport type { HasEffectsContext } from '../../ExecutionContext';\nimport type { NodeInteractionWithThisArg } from '../../NodeInteractions';\nimport { NodeInteraction, NodeInteractionCalled } from '../../NodeInteractions';\nimport type { ObjectPath, PathTracker } from '../../utils/PathTracker';\nimport { ExpressionEntity, type LiteralValueOrUnknown } from './Expression';\n\nexport class ObjectMember extends ExpressionEntity {\n\tconstructor(private readonly object: ExpressionEntity, private readonly key: string) {\n\t\tsuper();\n\t}\n\n\tdeoptimizePath(path: ObjectPath): void {\n\t\tthis.object.deoptimizePath([this.key, ...path]);\n\t}\n\n\tdeoptimizeThisOnInteractionAtPath(\n\t\tinteraction: NodeInteractionWithThisArg,\n\t\tpath: ObjectPath,\n\t\trecursionTracker: PathTracker\n\t): void {\n\t\tthis.object.deoptimizeThisOnInteractionAtPath(\n\t\t\tinteraction,\n\t\t\t[this.key, ...path],\n\t\t\trecursionTracker\n\t\t);\n\t}\n\n\tgetLiteralValueAtPath(\n\t\tpath: ObjectPath,\n\t\trecursionTracker: PathTracker,\n\t\torigin: DeoptimizableEntity\n\t): LiteralValueOrUnknown {\n\t\treturn this.object.getLiteralValueAtPath([this.key, ...path], recursionTracker, origin);\n\t}\n\n\tgetReturnExpressionWhenCalledAtPath(\n\t\tpath: ObjectPath,\n\t\tinteraction: NodeInteractionCalled,\n\t\trecursionTracker: PathTracker,\n\t\torigin: DeoptimizableEntity\n\t): ExpressionEntity {\n\t\treturn this.object.getReturnExpressionWhenCalledAtPath(\n\t\t\t[this.key, ...path],\n\t\t\tinteraction,\n\t\t\trecursionTracker,\n\t\t\torigin\n\t\t);\n\t}\n\n\thasEffectsOnInteractionAtPath(\n\t\tpath: ObjectPath,\n\t\tinteraction: NodeInteraction,\n\t\tcontext: HasEffectsContext\n\t): boolean {\n\t\treturn this.object.hasEffectsOnInteractionAtPath([this.key, ...path], interaction, context);\n\t}\n}\n","import type { DeoptimizableEntity } from '../../DeoptimizableEntity';\nimport type { HasEffectsContext, InclusionContext } from '../../ExecutionContext';\nimport {\n\tINTERACTION_CALLED,\n\tNodeInteraction,\n\tNodeInteractionCalled,\n\tNodeInteractionWithThisArg\n} from '../../NodeInteractions';\nimport ChildScope from '../../scopes/ChildScope';\nimport type Scope from '../../scopes/Scope';\nimport {\n\tEMPTY_PATH,\n\ttype ObjectPath,\n\ttype PathTracker,\n\tSHARED_RECURSION_TRACKER,\n\tUNKNOWN_PATH,\n\tUnknownKey\n} from '../../utils/PathTracker';\nimport type ClassBody from '../ClassBody';\nimport Identifier from '../Identifier';\nimport type Literal from '../Literal';\nimport MethodDefinition from '../MethodDefinition';\nimport { type ExpressionEntity, type LiteralValueOrUnknown } from './Expression';\nimport { type ExpressionNode, type IncludeChildren, NodeBase } from './Node';\nimport { ObjectEntity, type ObjectProperty } from './ObjectEntity';\nimport { ObjectMember } from './ObjectMember';\nimport { OBJECT_PROTOTYPE } from './ObjectPrototype';\n\nexport default class ClassNode extends NodeBase implements DeoptimizableEntity {\n\tdeclare body: ClassBody;\n\tdeclare id: Identifier | null;\n\tdeclare superClass: ExpressionNode | null;\n\tprivate declare classConstructor: MethodDefinition | null;\n\tprivate objectEntity: ObjectEntity | null = null;\n\n\tcreateScope(parentScope: Scope): void {\n\t\tthis.scope = new ChildScope(parentScope);\n\t}\n\n\tdeoptimizeCache(): void {\n\t\tthis.getObjectEntity().deoptimizeAllProperties();\n\t}\n\n\tdeoptimizePath(path: ObjectPath): void {\n\t\tthis.getObjectEntity().deoptimizePath(path);\n\t}\n\n\tdeoptimizeThisOnInteractionAtPath(\n\t\tinteraction: NodeInteractionWithThisArg,\n\t\tpath: ObjectPath,\n\t\trecursionTracker: PathTracker\n\t): void {\n\t\tthis.getObjectEntity().deoptimizeThisOnInteractionAtPath(interaction, path, recursionTracker);\n\t}\n\n\tgetLiteralValueAtPath(\n\t\tpath: ObjectPath,\n\t\trecursionTracker: PathTracker,\n\t\torigin: DeoptimizableEntity\n\t): LiteralValueOrUnknown {\n\t\treturn this.getObjectEntity().getLiteralValueAtPath(path, recursionTracker, origin);\n\t}\n\n\tgetReturnExpressionWhenCalledAtPath(\n\t\tpath: ObjectPath,\n\t\tinteraction: NodeInteractionCalled,\n\t\trecursionTracker: PathTracker,\n\t\torigin: DeoptimizableEntity\n\t): ExpressionEntity {\n\t\treturn this.getObjectEntity().getReturnExpressionWhenCalledAtPath(\n\t\t\tpath,\n\t\t\tinteraction,\n\t\t\trecursionTracker,\n\t\t\torigin\n\t\t);\n\t}\n\n\thasEffects(context: HasEffectsContext): boolean {\n\t\tif (!this.deoptimized) this.applyDeoptimizations();\n\t\tconst initEffect = this.superClass?.hasEffects(context) || this.body.hasEffects(context);\n\t\tthis.id?.markDeclarationReached();\n\t\treturn initEffect || super.hasEffects(context);\n\t}\n\n\thasEffectsOnInteractionAtPath(\n\t\tpath: ObjectPath,\n\t\tinteraction: NodeInteraction,\n\t\tcontext: HasEffectsContext\n\t): boolean {\n\t\tif (interaction.type === INTERACTION_CALLED && path.length === 0) {\n\t\t\treturn (\n\t\t\t\t!interaction.withNew ||\n\t\t\t\t(this.classConstructor !== null\n\t\t\t\t\t? this.classConstructor.hasEffectsOnInteractionAtPath(path, interaction, context)\n\t\t\t\t\t: this.superClass?.hasEffectsOnInteractionAtPath(path, interaction, context)) ||\n\t\t\t\tfalse\n\t\t\t);\n\t\t} else {\n\t\t\treturn this.getObjectEntity().hasEffectsOnInteractionAtPath(path, interaction, context);\n\t\t}\n\t}\n\n\tinclude(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void {\n\t\tif (!this.deoptimized) this.applyDeoptimizations();\n\t\tthis.included = true;\n\t\tthis.superClass?.include(context, includeChildrenRecursively);\n\t\tthis.body.include(context, includeChildrenRecursively);\n\t\tif (this.id) {\n\t\t\tthis.id.markDeclarationReached();\n\t\t\tthis.id.include();\n\t\t}\n\t}\n\n\tinitialise(): void {\n\t\tthis.id?.declare('class', this);\n\t\tfor (const method of this.body.body) {\n\t\t\tif (method instanceof MethodDefinition && method.kind === 'constructor') {\n\t\t\t\tthis.classConstructor = method;\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tthis.classConstructor = null;\n\t}\n\n\tprotected applyDeoptimizations(): void {\n\t\tthis.deoptimized = true;\n\t\tfor (const definition of this.body.body) {\n\t\t\tif (\n\t\t\t\t!(\n\t\t\t\t\tdefinition.static ||\n\t\t\t\t\t(definition instanceof MethodDefinition && definition.kind === 'constructor')\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\t// Calls to methods are not tracked, ensure that the return value is deoptimized\n\t\t\t\tdefinition.deoptimizePath(UNKNOWN_PATH);\n\t\t\t}\n\t\t}\n\t\tthis.context.requestTreeshakingPass();\n\t}\n\n\tprivate getObjectEntity(): ObjectEntity {\n\t\tif (this.objectEntity !== null) {\n\t\t\treturn this.objectEntity;\n\t\t}\n\t\tconst staticProperties: ObjectProperty[] = [];\n\t\tconst dynamicMethods: ObjectProperty[] = [];\n\t\tfor (const definition of this.body.body) {\n\t\t\tconst properties = definition.static ? staticProperties : dynamicMethods;\n\t\t\tconst definitionKind = (definition as MethodDefinition | { kind: undefined }).kind;\n\t\t\t// Note that class fields do not end up on the prototype\n\t\t\tif (properties === dynamicMethods && !definitionKind) continue;\n\t\t\tconst kind = definitionKind === 'set' || definitionKind === 'get' ? definitionKind : 'init';\n\t\t\tlet key: string;\n\t\t\tif (definition.computed) {\n\t\t\t\tconst keyValue = definition.key.getLiteralValueAtPath(\n\t\t\t\t\tEMPTY_PATH,\n\t\t\t\t\tSHARED_RECURSION_TRACKER,\n\t\t\t\t\tthis\n\t\t\t\t);\n\t\t\t\tif (typeof keyValue === 'symbol') {\n\t\t\t\t\tproperties.push({ key: UnknownKey, kind, property: definition });\n\t\t\t\t\tcontinue;\n\t\t\t\t} else {\n\t\t\t\t\tkey = String(keyValue);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tkey =\n\t\t\t\t\tdefinition.key instanceof Identifier\n\t\t\t\t\t\t? definition.key.name\n\t\t\t\t\t\t: String((definition.key as Literal).value);\n\t\t\t}\n\t\t\tproperties.push({ key, kind, property: definition });\n\t\t}\n\t\tstaticProperties.unshift({\n\t\t\tkey: 'prototype',\n\t\t\tkind: 'init',\n\t\t\tproperty: new ObjectEntity(\n\t\t\t\tdynamicMethods,\n\t\t\t\tthis.superClass ? new ObjectMember(this.superClass, 'prototype') : OBJECT_PROTOTYPE\n\t\t\t)\n\t\t});\n\t\treturn (this.objectEntity = new ObjectEntity(\n\t\t\tstaticProperties,\n\t\t\tthis.superClass || OBJECT_PROTOTYPE\n\t\t));\n\t}\n}\n","import type MagicString from 'magic-string';\nimport type { RenderOptions } from '../../utils/renderHelpers';\nimport { getSystemExportStatement } from '../../utils/systemJsRendering';\nimport type ChildScope from '../scopes/ChildScope';\nimport Identifier, { type IdentifierWithVariable } from './Identifier';\nimport type * as NodeType from './NodeType';\nimport ClassNode from './shared/ClassNode';\nimport type { GenericEsTreeNode } from './shared/Node';\n\nexport default class ClassDeclaration extends ClassNode {\n\tdeclare id: IdentifierWithVariable | null;\n\tdeclare type: NodeType.tClassDeclaration;\n\n\tinitialise(): void {\n\t\tsuper.initialise();\n\t\tif (this.id !== null) {\n\t\t\tthis.id.variable.isId = true;\n\t\t}\n\t}\n\n\tparseNode(esTreeNode: GenericEsTreeNode): void {\n\t\tif (esTreeNode.id !== null) {\n\t\t\tthis.id = new Identifier(\n\t\t\t\tesTreeNode.id,\n\t\t\t\tthis,\n\t\t\t\tthis.scope.parent as ChildScope\n\t\t\t) as IdentifierWithVariable;\n\t\t}\n\t\tsuper.parseNode(esTreeNode);\n\t}\n\n\trender(code: MagicString, options: RenderOptions): void {\n\t\tconst {\n\t\t\texportNamesByVariable,\n\t\t\tformat,\n\t\t\tsnippets: { _ }\n\t\t} = options;\n\t\tif (format === 'system' && this.id && exportNamesByVariable.has(this.id.variable)) {\n\t\t\tcode.appendLeft(this.end, `${_}${getSystemExportStatement([this.id.variable], options)};`);\n\t\t}\n\t\tsuper.render(code, options);\n\t}\n}\n","import type { DeoptimizableEntity } from '../../DeoptimizableEntity';\nimport type { HasEffectsContext } from '../../ExecutionContext';\nimport { NodeInteraction, NodeInteractionCalled } from '../../NodeInteractions';\nimport type { ObjectPath, PathTracker } from '../../utils/PathTracker';\nimport { ExpressionEntity } from './Expression';\n\nexport class MultiExpression extends ExpressionEntity {\n\tincluded = false;\n\n\tconstructor(private expressions: readonly ExpressionEntity[]) {\n\t\tsuper();\n\t}\n\n\tdeoptimizePath(path: ObjectPath): void {\n\t\tfor (const expression of this.expressions) {\n\t\t\texpression.deoptimizePath(path);\n\t\t}\n\t}\n\n\tgetReturnExpressionWhenCalledAtPath(\n\t\tpath: ObjectPath,\n\t\tinteraction: NodeInteractionCalled,\n\t\trecursionTracker: PathTracker,\n\t\torigin: DeoptimizableEntity\n\t): ExpressionEntity {\n\t\treturn new MultiExpression(\n\t\t\tthis.expressions.map(expression =>\n\t\t\t\texpression.getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin)\n\t\t\t)\n\t\t);\n\t}\n\n\thasEffectsOnInteractionAtPath(\n\t\tpath: ObjectPath,\n\t\tinteraction: NodeInteraction,\n\t\tcontext: HasEffectsContext\n\t): boolean {\n\t\tfor (const expression of this.expressions) {\n\t\t\tif (expression.hasEffectsOnInteractionAtPath(path, interaction, context)) return true;\n\t\t}\n\t\treturn false;\n\t}\n}\n","import type MagicString from 'magic-string';\nimport type { NodeRenderOptions, RenderOptions } from '../../utils/renderHelpers';\nimport type Identifier from './Identifier';\nimport type Literal from './Literal';\nimport type * as NodeType from './NodeType';\nimport { NodeBase } from './shared/Node';\n\nexport default class ExportAllDeclaration extends NodeBase {\n\tdeclare exported: Identifier | null;\n\tdeclare needsBoundaries: true;\n\tdeclare source: Literal;\n\tdeclare type: NodeType.tExportAllDeclaration;\n\n\thasEffects(): boolean {\n\t\treturn false;\n\t}\n\n\tinitialise(): void {\n\t\tthis.context.addExport(this);\n\t}\n\n\trender(code: MagicString, _options: RenderOptions, nodeRenderOptions?: NodeRenderOptions): void {\n\t\tcode.remove(nodeRenderOptions!.start!, nodeRenderOptions!.end!);\n\t}\n\n\tprotected applyDeoptimizations() {}\n}\n\nExportAllDeclaration.prototype.needsBoundaries = true;\n","import type ChildScope from '../scopes/ChildScope';\nimport Identifier, { type IdentifierWithVariable } from './Identifier';\nimport type * as NodeType from './NodeType';\nimport FunctionNode from './shared/FunctionNode';\nimport type { GenericEsTreeNode } from './shared/Node';\n\nexport default class FunctionDeclaration extends FunctionNode {\n\tdeclare type: NodeType.tFunctionDeclaration;\n\n\tinitialise(): void {\n\t\tsuper.initialise();\n\t\tif (this.id !== null) {\n\t\t\tthis.id.variable.isId = true;\n\t\t}\n\t}\n\n\tparseNode(esTreeNode: GenericEsTreeNode): void {\n\t\tif (esTreeNode.id !== null) {\n\t\t\tthis.id = new Identifier(\n\t\t\t\tesTreeNode.id,\n\t\t\t\tthis,\n\t\t\t\tthis.scope.parent as ChildScope\n\t\t\t) as IdentifierWithVariable;\n\t\t}\n\t\tsuper.parseNode(esTreeNode);\n\t}\n}\n","import type MagicString from 'magic-string';\nimport {\n\tfindFirstOccurrenceOutsideComment,\n\tfindNonWhiteSpace,\n\ttype NodeRenderOptions,\n\ttype RenderOptions\n} from '../../utils/renderHelpers';\nimport { getSystemExportStatement } from '../../utils/systemJsRendering';\nimport { treeshakeNode } from '../../utils/treeshakeNode';\nimport { InclusionContext } from '../ExecutionContext';\nimport type ModuleScope from '../scopes/ModuleScope';\nimport type ExportDefaultVariable from '../variables/ExportDefaultVariable';\nimport ClassDeclaration from './ClassDeclaration';\nimport FunctionDeclaration from './FunctionDeclaration';\nimport type Identifier from './Identifier';\nimport * as NodeType from './NodeType';\nimport { type ExpressionNode, type IncludeChildren, NodeBase } from './shared/Node';\n\n// The header ends at the first non-white-space after \"default\"\nfunction getDeclarationStart(code: string, start: number): number {\n\treturn findNonWhiteSpace(code, findFirstOccurrenceOutsideComment(code, 'default', start) + 7);\n}\n\nfunction getIdInsertPosition(\n\tcode: string,\n\tdeclarationKeyword: string,\n\tendMarker: string,\n\tstart: number\n): number {\n\tconst declarationEnd =\n\t\tfindFirstOccurrenceOutsideComment(code, declarationKeyword, start) + declarationKeyword.length;\n\tcode = code.slice(\n\t\tdeclarationEnd,\n\t\tfindFirstOccurrenceOutsideComment(code, endMarker, declarationEnd)\n\t);\n\tconst generatorStarPos = findFirstOccurrenceOutsideComment(code, '*');\n\tif (generatorStarPos === -1) {\n\t\treturn declarationEnd;\n\t}\n\treturn declarationEnd + generatorStarPos + 1;\n}\n\nexport default class ExportDefaultDeclaration extends NodeBase {\n\tdeclare declaration: FunctionDeclaration | ClassDeclaration | ExpressionNode;\n\tdeclare needsBoundaries: true;\n\tdeclare scope: ModuleScope;\n\tdeclare type: NodeType.tExportDefaultDeclaration;\n\tdeclare variable: ExportDefaultVariable;\n\n\tprivate declare declarationName: string | undefined;\n\n\tinclude(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void {\n\t\tsuper.include(context, includeChildrenRecursively);\n\t\tif (includeChildrenRecursively) {\n\t\t\tthis.context.includeVariableInModule(this.variable);\n\t\t}\n\t}\n\n\tinitialise(): void {\n\t\tconst declaration = this.declaration as FunctionDeclaration | ClassDeclaration;\n\t\tthis.declarationName =\n\t\t\t(declaration.id && declaration.id.name) || (this.declaration as Identifier).name;\n\t\tthis.variable = this.scope.addExportDefaultDeclaration(\n\t\t\tthis.declarationName || this.context.getModuleName(),\n\t\t\tthis,\n\t\t\tthis.context\n\t\t);\n\t\tthis.context.addExport(this);\n\t}\n\n\trender(code: MagicString, options: RenderOptions, nodeRenderOptions?: NodeRenderOptions): void {\n\t\tconst { start, end } = nodeRenderOptions as { end: number; start: number };\n\t\tconst declarationStart = getDeclarationStart(code.original, this.start);\n\n\t\tif (this.declaration instanceof FunctionDeclaration) {\n\t\t\tthis.renderNamedDeclaration(\n\t\t\t\tcode,\n\t\t\t\tdeclarationStart,\n\t\t\t\t'function',\n\t\t\t\t'(',\n\t\t\t\tthis.declaration.id === null,\n\t\t\t\toptions\n\t\t\t);\n\t\t} else if (this.declaration instanceof ClassDeclaration) {\n\t\t\tthis.renderNamedDeclaration(\n\t\t\t\tcode,\n\t\t\t\tdeclarationStart,\n\t\t\t\t'class',\n\t\t\t\t'{',\n\t\t\t\tthis.declaration.id === null,\n\t\t\t\toptions\n\t\t\t);\n\t\t} else if (this.variable.getOriginalVariable() !== this.variable) {\n\t\t\t// Remove altogether to prevent re-declaring the same variable\n\t\t\ttreeshakeNode(this, code, start, end);\n\t\t\treturn;\n\t\t} else if (this.variable.included) {\n\t\t\tthis.renderVariableDeclaration(code, declarationStart, options);\n\t\t} else {\n\t\t\tcode.remove(this.start, declarationStart);\n\t\t\tthis.declaration.render(code, options, {\n\t\t\t\trenderedSurroundingElement: NodeType.ExpressionStatement\n\t\t\t});\n\t\t\tif (code.original[this.end - 1] !== ';') {\n\t\t\t\tcode.appendLeft(this.end, ';');\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tthis.declaration.render(code, options);\n\t}\n\n\tprotected applyDeoptimizations() {}\n\n\tprivate renderNamedDeclaration(\n\t\tcode: MagicString,\n\t\tdeclarationStart: number,\n\t\tdeclarationKeyword: string,\n\t\tendMarker: string,\n\t\tneedsId: boolean,\n\t\toptions: RenderOptions\n\t): void {\n\t\tconst {\n\t\t\texportNamesByVariable,\n\t\t\tformat,\n\t\t\tsnippets: { getPropertyAccess }\n\t\t} = options;\n\t\tconst name = this.variable.getName(getPropertyAccess);\n\t\t// Remove `export default`\n\t\tcode.remove(this.start, declarationStart);\n\n\t\tif (needsId) {\n\t\t\tcode.appendLeft(\n\t\t\t\tgetIdInsertPosition(code.original, declarationKeyword, endMarker, declarationStart),\n\t\t\t\t` ${name}`\n\t\t\t);\n\t\t}\n\t\tif (\n\t\t\tformat === 'system' &&\n\t\t\tthis.declaration instanceof ClassDeclaration &&\n\t\t\texportNamesByVariable.has(this.variable)\n\t\t) {\n\t\t\tcode.appendLeft(this.end, ` ${getSystemExportStatement([this.variable], options)};`);\n\t\t}\n\t}\n\n\tprivate renderVariableDeclaration(\n\t\tcode: MagicString,\n\t\tdeclarationStart: number,\n\t\t{ format, exportNamesByVariable, snippets: { cnst, getPropertyAccess } }: RenderOptions\n\t): void {\n\t\tconst hasTrailingSemicolon = code.original.charCodeAt(this.end - 1) === 59; /*\";\"*/\n\t\tconst systemExportNames = format === 'system' && exportNamesByVariable.get(this.variable);\n\n\t\tif (systemExportNames) {\n\t\t\tcode.overwrite(\n\t\t\t\tthis.start,\n\t\t\t\tdeclarationStart,\n\t\t\t\t`${cnst} ${this.variable.getName(getPropertyAccess)} = exports('${systemExportNames[0]}', `\n\t\t\t);\n\t\t\tcode.appendRight(\n\t\t\t\thasTrailingSemicolon ? this.end - 1 : this.end,\n\t\t\t\t')' + (hasTrailingSemicolon ? '' : ';')\n\t\t\t);\n\t\t} else {\n\t\t\tcode.overwrite(\n\t\t\t\tthis.start,\n\t\t\t\tdeclarationStart,\n\t\t\t\t`${cnst} ${this.variable.getName(getPropertyAccess)} = `\n\t\t\t);\n\t\t\tif (!hasTrailingSemicolon) {\n\t\t\t\tcode.appendLeft(this.end, ';');\n\t\t\t}\n\t\t}\n\t}\n}\n\nExportDefaultDeclaration.prototype.needsBoundaries = true;\n","import type MagicString from 'magic-string';\nimport type { NodeRenderOptions, RenderOptions } from '../../utils/renderHelpers';\nimport type { HasEffectsContext } from '../ExecutionContext';\nimport type ClassDeclaration from './ClassDeclaration';\nimport type ExportSpecifier from './ExportSpecifier';\nimport type FunctionDeclaration from './FunctionDeclaration';\nimport type Literal from './Literal';\nimport type * as NodeType from './NodeType';\nimport type VariableDeclaration from './VariableDeclaration';\nimport { type Node, NodeBase } from './shared/Node';\n\nexport default class ExportNamedDeclaration extends NodeBase {\n\tdeclare declaration: FunctionDeclaration | ClassDeclaration | VariableDeclaration | null;\n\tdeclare needsBoundaries: true;\n\tdeclare source: Literal | null;\n\tdeclare specifiers: readonly ExportSpecifier[];\n\tdeclare type: NodeType.tExportNamedDeclaration;\n\n\tbind(): void {\n\t\t// Do not bind specifiers\n\t\tthis.declaration?.bind();\n\t}\n\n\thasEffects(context: HasEffectsContext): boolean {\n\t\treturn !!this.declaration?.hasEffects(context);\n\t}\n\n\tinitialise(): void {\n\t\tthis.context.addExport(this);\n\t}\n\n\trender(code: MagicString, options: RenderOptions, nodeRenderOptions?: NodeRenderOptions): void {\n\t\tconst { start, end } = nodeRenderOptions as { end: number; start: number };\n\t\tif (this.declaration === null) {\n\t\t\tcode.remove(start, end);\n\t\t} else {\n\t\t\tcode.remove(this.start, this.declaration.start);\n\t\t\t(this.declaration as Node).render(code, options, { end, start });\n\t\t}\n\t}\n\n\tprotected applyDeoptimizations() {}\n}\n\nExportNamedDeclaration.prototype.needsBoundaries = true;\n","import type { AstContext } from '../../Module';\nimport type Identifier from '../nodes/Identifier';\nimport type { ExpressionEntity } from '../nodes/shared/Expression';\nimport type LocalVariable from '../variables/LocalVariable';\nimport BlockScope from './BlockScope';\n\nexport default class TrackingScope extends BlockScope {\n\thoistedDeclarations: Identifier[] = [];\n\n\taddDeclaration(\n\t\tidentifier: Identifier,\n\t\tcontext: AstContext,\n\t\tinit: ExpressionEntity | null,\n\t\tisHoisted: boolean\n\t): LocalVariable {\n\t\tthis.hoistedDeclarations.push(identifier);\n\t\treturn super.addDeclaration(identifier, context, init, isHoisted);\n\t}\n}\n","import type MagicString from 'magic-string';\nimport type { RenderOptions } from '../../utils/renderHelpers';\nimport type { DeoptimizableEntity } from '../DeoptimizableEntity';\nimport {\n\tBROKEN_FLOW_NONE,\n\ttype HasEffectsContext,\n\ttype InclusionContext\n} from '../ExecutionContext';\nimport TrackingScope from '../scopes/TrackingScope';\nimport { EMPTY_PATH, SHARED_RECURSION_TRACKER } from '../utils/PathTracker';\nimport BlockStatement from './BlockStatement';\nimport type Identifier from './Identifier';\nimport * as NodeType from './NodeType';\nimport { type LiteralValueOrUnknown, UnknownValue } from './shared/Expression';\nimport {\n\ttype ExpressionNode,\n\ttype GenericEsTreeNode,\n\ttype IncludeChildren,\n\tStatementBase,\n\ttype StatementNode\n} from './shared/Node';\n\nconst unset = Symbol('unset');\n\nexport default class IfStatement extends StatementBase implements DeoptimizableEntity {\n\tdeclare alternate: StatementNode | null;\n\tdeclare consequent: StatementNode;\n\tdeclare test: ExpressionNode;\n\tdeclare type: NodeType.tIfStatement;\n\n\tprivate declare alternateScope?: TrackingScope;\n\tprivate declare consequentScope: TrackingScope;\n\tprivate testValue: LiteralValueOrUnknown | typeof unset = unset;\n\n\tdeoptimizeCache(): void {\n\t\tthis.testValue = UnknownValue;\n\t}\n\n\thasEffects(context: HasEffectsContext): boolean {\n\t\tif (this.test.hasEffects(context)) {\n\t\t\treturn true;\n\t\t}\n\t\tconst testValue = this.getTestValue();\n\t\tif (typeof testValue === 'symbol') {\n\t\t\tconst { brokenFlow } = context;\n\t\t\tif (this.consequent.hasEffects(context)) return true;\n\t\t\tconst consequentBrokenFlow = context.brokenFlow;\n\t\t\tcontext.brokenFlow = brokenFlow;\n\t\t\tif (this.alternate === null) return false;\n\t\t\tif (this.alternate.hasEffects(context)) return true;\n\t\t\tcontext.brokenFlow =\n\t\t\t\tcontext.brokenFlow < consequentBrokenFlow ? context.brokenFlow : consequentBrokenFlow;\n\t\t\treturn false;\n\t\t}\n\t\treturn testValue ? this.consequent.hasEffects(context) : !!this.alternate?.hasEffects(context);\n\t}\n\n\tinclude(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void {\n\t\tthis.included = true;\n\t\tif (includeChildrenRecursively) {\n\t\t\tthis.includeRecursively(includeChildrenRecursively, context);\n\t\t} else {\n\t\t\tconst testValue = this.getTestValue();\n\t\t\tif (typeof testValue === 'symbol') {\n\t\t\t\tthis.includeUnknownTest(context);\n\t\t\t} else {\n\t\t\t\tthis.includeKnownTest(context, testValue);\n\t\t\t}\n\t\t}\n\t}\n\n\tparseNode(esTreeNode: GenericEsTreeNode): void {\n\t\tthis.consequentScope = new TrackingScope(this.scope);\n\t\tthis.consequent = new (this.context.getNodeConstructor(esTreeNode.consequent.type))(\n\t\t\tesTreeNode.consequent,\n\t\t\tthis,\n\t\t\tthis.consequentScope\n\t\t);\n\t\tif (esTreeNode.alternate) {\n\t\t\tthis.alternateScope = new TrackingScope(this.scope);\n\t\t\tthis.alternate = new (this.context.getNodeConstructor(esTreeNode.alternate.type))(\n\t\t\t\tesTreeNode.alternate,\n\t\t\t\tthis,\n\t\t\t\tthis.alternateScope\n\t\t\t);\n\t\t}\n\t\tsuper.parseNode(esTreeNode);\n\t}\n\n\trender(code: MagicString, options: RenderOptions): void {\n\t\tconst {\n\t\t\tsnippets: { getPropertyAccess }\n\t\t} = options;\n\t\t// Note that unknown test values are always included\n\t\tconst testValue = this.getTestValue();\n\t\tconst hoistedDeclarations: Identifier[] = [];\n\t\tconst includesIfElse = this.test.included;\n\t\tconst noTreeshake = !this.context.options.treeshake;\n\t\tif (includesIfElse) {\n\t\t\tthis.test.render(code, options);\n\t\t} else {\n\t\t\tcode.remove(this.start, this.consequent.start);\n\t\t}\n\t\tif (this.consequent.included && (noTreeshake || typeof testValue === 'symbol' || testValue)) {\n\t\t\tthis.consequent.render(code, options);\n\t\t} else {\n\t\t\tcode.overwrite(this.consequent.start, this.consequent.end, includesIfElse ? ';' : '');\n\t\t\thoistedDeclarations.push(...this.consequentScope.hoistedDeclarations);\n\t\t}\n\t\tif (this.alternate) {\n\t\t\tif (this.alternate.included && (noTreeshake || typeof testValue === 'symbol' || !testValue)) {\n\t\t\t\tif (includesIfElse) {\n\t\t\t\t\tif (code.original.charCodeAt(this.alternate.start - 1) === 101) {\n\t\t\t\t\t\tcode.prependLeft(this.alternate.start, ' ');\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tcode.remove(this.consequent.end, this.alternate.start);\n\t\t\t\t}\n\t\t\t\tthis.alternate.render(code, options);\n\t\t\t} else {\n\t\t\t\tif (includesIfElse && this.shouldKeepAlternateBranch()) {\n\t\t\t\t\tcode.overwrite(this.alternate.start, this.end, ';');\n\t\t\t\t} else {\n\t\t\t\t\tcode.remove(this.consequent.end, this.end);\n\t\t\t\t}\n\t\t\t\thoistedDeclarations.push(...this.alternateScope!.hoistedDeclarations);\n\t\t\t}\n\t\t}\n\t\tthis.renderHoistedDeclarations(hoistedDeclarations, code, getPropertyAccess);\n\t}\n\n\tprotected applyDeoptimizations() {}\n\n\tprivate getTestValue(): LiteralValueOrUnknown {\n\t\tif (this.testValue === unset) {\n\t\t\treturn (this.testValue = this.test.getLiteralValueAtPath(\n\t\t\t\tEMPTY_PATH,\n\t\t\t\tSHARED_RECURSION_TRACKER,\n\t\t\t\tthis\n\t\t\t));\n\t\t}\n\t\treturn this.testValue;\n\t}\n\n\tprivate includeKnownTest(context: InclusionContext, testValue: LiteralValueOrUnknown) {\n\t\tif (this.test.shouldBeIncluded(context)) {\n\t\t\tthis.test.include(context, false);\n\t\t}\n\t\tif (testValue && this.consequent.shouldBeIncluded(context)) {\n\t\t\tthis.consequent.include(context, false, { asSingleStatement: true });\n\t\t}\n\t\tif (!testValue && this.alternate?.shouldBeIncluded(context)) {\n\t\t\tthis.alternate.include(context, false, { asSingleStatement: true });\n\t\t}\n\t}\n\n\tprivate includeRecursively(\n\t\tincludeChildrenRecursively: true | 'variables',\n\t\tcontext: InclusionContext\n\t) {\n\t\tthis.test.include(context, includeChildrenRecursively);\n\t\tthis.consequent.include(context, includeChildrenRecursively);\n\t\tthis.alternate?.include(context, includeChildrenRecursively);\n\t}\n\n\tprivate includeUnknownTest(context: InclusionContext) {\n\t\tthis.test.include(context, false);\n\t\tconst { brokenFlow } = context;\n\t\tlet consequentBrokenFlow = BROKEN_FLOW_NONE;\n\t\tif (this.consequent.shouldBeIncluded(context)) {\n\t\t\tthis.consequent.include(context, false, { asSingleStatement: true });\n\t\t\tconsequentBrokenFlow = context.brokenFlow;\n\t\t\tcontext.brokenFlow = brokenFlow;\n\t\t}\n\t\tif (this.alternate?.shouldBeIncluded(context)) {\n\t\t\tthis.alternate.include(context, false, { asSingleStatement: true });\n\t\t\tcontext.brokenFlow =\n\t\t\t\tcontext.brokenFlow < consequentBrokenFlow ? context.brokenFlow : consequentBrokenFlow;\n\t\t}\n\t}\n\n\tprivate renderHoistedDeclarations(\n\t\thoistedDeclarations: readonly Identifier[],\n\t\tcode: MagicString,\n\t\tgetPropertyAccess: (name: string) => string\n\t) {\n\t\tconst hoistedVars = [\n\t\t\t...new Set(\n\t\t\t\thoistedDeclarations.map(identifier => {\n\t\t\t\t\tconst variable = identifier.variable!;\n\t\t\t\t\treturn variable.included ? variable.getName(getPropertyAccess) : '';\n\t\t\t\t})\n\t\t\t)\n\t\t]\n\t\t\t.filter(Boolean)\n\t\t\t.join(', ');\n\t\tif (hoistedVars) {\n\t\t\tconst parentType = this.parent.type;\n\t\t\tconst needsBraces = parentType !== NodeType.Program && parentType !== NodeType.BlockStatement;\n\t\t\tcode.prependRight(this.start, `${needsBraces ? '{ ' : ''}var ${hoistedVars}; `);\n\t\t\tif (needsBraces) {\n\t\t\t\tcode.appendLeft(this.end, ` }`);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate shouldKeepAlternateBranch() {\n\t\tlet currentParent = this.parent;\n\t\tdo {\n\t\t\tif (currentParent instanceof IfStatement && currentParent.alternate) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tif (currentParent instanceof BlockStatement) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tcurrentParent = (currentParent as any).parent;\n\t\t} while (currentParent);\n\t\treturn false;\n\t}\n}\n","import type MagicString from 'magic-string';\nimport type { NodeRenderOptions, RenderOptions } from '../../utils/renderHelpers';\nimport type ImportDefaultSpecifier from './ImportDefaultSpecifier';\nimport type ImportNamespaceSpecifier from './ImportNamespaceSpecifier';\nimport type ImportSpecifier from './ImportSpecifier';\nimport type Literal from './Literal';\nimport type * as NodeType from './NodeType';\nimport { NodeBase } from './shared/Node';\n\nexport default class ImportDeclaration extends NodeBase {\n\tdeclare needsBoundaries: true;\n\tdeclare source: Literal;\n\tdeclare specifiers: (ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier)[];\n\tdeclare type: NodeType.tImportDeclaration;\n\n\t// Do not bind specifiers\n\tbind(): void {}\n\n\thasEffects(): boolean {\n\t\treturn false;\n\t}\n\n\tinitialise(): void {\n\t\tthis.context.addImport(this);\n\t}\n\n\trender(code: MagicString, _options: RenderOptions, nodeRenderOptions?: NodeRenderOptions): void {\n\t\tcode.remove(nodeRenderOptions!.start!, nodeRenderOptions!.end!);\n\t}\n\n\tprotected applyDeoptimizations() {}\n}\n\nImportDeclaration.prototype.needsBoundaries = true;\n","import { GenerateCodeSnippets } from './generateCodeSnippets';\n\nconst INTEROP_DEFAULT_VARIABLE = '_interopDefault';\nconst INTEROP_DEFAULT_LEGACY_VARIABLE = '_interopDefaultLegacy';\nconst INTEROP_NAMESPACE_VARIABLE = '_interopNamespace';\nconst INTEROP_NAMESPACE_DEFAULT_VARIABLE = '_interopNamespaceDefault';\nexport const INTEROP_NAMESPACE_DEFAULT_ONLY_VARIABLE = '_interopNamespaceDefaultOnly';\nexport const MERGE_NAMESPACES_VARIABLE = '_mergeNamespaces';\n\nexport const defaultInteropHelpersByInteropType: { [interopType: string]: string | null } = {\n\tauto: INTEROP_DEFAULT_VARIABLE,\n\tdefault: null,\n\tdefaultOnly: null,\n\tesModule: null,\n\tfalse: null,\n\ttrue: INTEROP_DEFAULT_LEGACY_VARIABLE\n};\n\nexport const isDefaultAProperty = (interopType: string, externalLiveBindings: boolean): boolean =>\n\tinteropType === 'esModule' ||\n\t(externalLiveBindings && (interopType === 'auto' || interopType === 'true'));\n\nexport const namespaceInteropHelpersByInteropType: { [interopType: string]: string | null } = {\n\tauto: INTEROP_NAMESPACE_VARIABLE,\n\tdefault: INTEROP_NAMESPACE_DEFAULT_VARIABLE,\n\tdefaultOnly: INTEROP_NAMESPACE_DEFAULT_ONLY_VARIABLE,\n\tesModule: null,\n\tfalse: null,\n\ttrue: INTEROP_NAMESPACE_VARIABLE\n};\n\nexport const canDefaultBeTakenFromNamespace = (\n\tinteropType: string,\n\texternalLiveBindings: boolean\n): boolean =>\n\tisDefaultAProperty(interopType, externalLiveBindings) &&\n\tdefaultInteropHelpersByInteropType[interopType] === INTEROP_DEFAULT_VARIABLE;\n\nexport const getHelpersBlock = (\n\tadditionalHelpers: ReadonlySet | null,\n\taccessedGlobals: ReadonlySet,\n\tindent: string,\n\tsnippets: GenerateCodeSnippets,\n\tliveBindings: boolean,\n\tfreeze: boolean,\n\tnamespaceToStringTag: boolean\n): string => {\n\tconst usedHelpers = new Set(additionalHelpers);\n\tfor (const variable of HELPER_NAMES) {\n\t\tif (accessedGlobals.has(variable)) {\n\t\t\tusedHelpers.add(variable);\n\t\t}\n\t}\n\treturn HELPER_NAMES.map(variable =>\n\t\tusedHelpers.has(variable)\n\t\t\t? HELPER_GENERATORS[variable](\n\t\t\t\t\tindent,\n\t\t\t\t\tsnippets,\n\t\t\t\t\tliveBindings,\n\t\t\t\t\tfreeze,\n\t\t\t\t\tnamespaceToStringTag,\n\t\t\t\t\tusedHelpers\n\t\t\t )\n\t\t\t: ''\n\t).join('');\n};\n\nconst HELPER_GENERATORS: {\n\t[variable: string]: (\n\t\tindent: string,\n\t\tsnippets: GenerateCodeSnippets,\n\t\tliveBindings: boolean,\n\t\tfreeze: boolean,\n\t\tnamespaceToStringTag: boolean,\n\t\tusedHelpers: ReadonlySet\n\t) => string;\n} = {\n\t[INTEROP_DEFAULT_LEGACY_VARIABLE](_t, snippets, liveBindings) {\n\t\tconst { _, getDirectReturnFunction, n } = snippets;\n\t\tconst [left, right] = getDirectReturnFunction(['e'], {\n\t\t\tfunctionReturn: true,\n\t\t\tlineBreakIndent: null,\n\t\t\tname: INTEROP_DEFAULT_LEGACY_VARIABLE\n\t\t});\n\t\treturn (\n\t\t\t`${left}e${_}&&${_}typeof e${_}===${_}'object'${_}&&${_}'default'${_}in e${_}?${_}` +\n\t\t\t`${\n\t\t\t\tliveBindings ? getDefaultLiveBinding(snippets) : getDefaultStatic(snippets)\n\t\t\t}${right}${n}${n}`\n\t\t);\n\t},\n\t[INTEROP_DEFAULT_VARIABLE](_t, snippets, liveBindings) {\n\t\tconst { _, getDirectReturnFunction, n } = snippets;\n\t\tconst [left, right] = getDirectReturnFunction(['e'], {\n\t\t\tfunctionReturn: true,\n\t\t\tlineBreakIndent: null,\n\t\t\tname: INTEROP_DEFAULT_VARIABLE\n\t\t});\n\t\treturn (\n\t\t\t`${left}e${_}&&${_}e.__esModule${_}?${_}` +\n\t\t\t`${\n\t\t\t\tliveBindings ? getDefaultLiveBinding(snippets) : getDefaultStatic(snippets)\n\t\t\t}${right}${n}${n}`\n\t\t);\n\t},\n\t[INTEROP_NAMESPACE_DEFAULT_ONLY_VARIABLE](\n\t\t_t,\n\t\tsnippets,\n\t\t_liveBindings: boolean,\n\t\tfreeze: boolean,\n\t\tnamespaceToStringTag: boolean\n\t) {\n\t\tconst { getDirectReturnFunction, getObject, n } = snippets;\n\t\tconst [left, right] = getDirectReturnFunction(['e'], {\n\t\t\tfunctionReturn: true,\n\t\t\tlineBreakIndent: null,\n\t\t\tname: INTEROP_NAMESPACE_DEFAULT_ONLY_VARIABLE\n\t\t});\n\t\treturn `${left}${getFrozen(\n\t\t\tfreeze,\n\t\t\tgetWithToStringTag(\n\t\t\t\tnamespaceToStringTag,\n\t\t\t\tgetObject(\n\t\t\t\t\t[\n\t\t\t\t\t\t['__proto__', 'null'],\n\t\t\t\t\t\t['default', 'e']\n\t\t\t\t\t],\n\t\t\t\t\t{ lineBreakIndent: null }\n\t\t\t\t),\n\t\t\t\tsnippets\n\t\t\t)\n\t\t)}${right}${n}${n}`;\n\t},\n\t[INTEROP_NAMESPACE_DEFAULT_VARIABLE](t, snippets, liveBindings, freeze, namespaceToStringTag) {\n\t\tconst { _, n } = snippets;\n\t\treturn (\n\t\t\t`function ${INTEROP_NAMESPACE_DEFAULT_VARIABLE}(e)${_}{${n}` +\n\t\t\tcreateNamespaceObject(t, t, snippets, liveBindings, freeze, namespaceToStringTag) +\n\t\t\t`}${n}${n}`\n\t\t);\n\t},\n\t[INTEROP_NAMESPACE_VARIABLE](\n\t\tt,\n\t\tsnippets,\n\t\tliveBindings,\n\t\tfreeze,\n\t\tnamespaceToStringTag,\n\t\tusedHelpers\n\t) {\n\t\tconst { _, getDirectReturnFunction, n } = snippets;\n\t\tif (usedHelpers.has(INTEROP_NAMESPACE_DEFAULT_VARIABLE)) {\n\t\t\tconst [left, right] = getDirectReturnFunction(['e'], {\n\t\t\t\tfunctionReturn: true,\n\t\t\t\tlineBreakIndent: null,\n\t\t\t\tname: INTEROP_NAMESPACE_VARIABLE\n\t\t\t});\n\t\t\treturn `${left}e${_}&&${_}e.__esModule${_}?${_}e${_}:${_}${INTEROP_NAMESPACE_DEFAULT_VARIABLE}(e)${right}${n}${n}`;\n\t\t}\n\t\treturn (\n\t\t\t`function ${INTEROP_NAMESPACE_VARIABLE}(e)${_}{${n}` +\n\t\t\t`${t}if${_}(e${_}&&${_}e.__esModule)${_}return e;${n}` +\n\t\t\tcreateNamespaceObject(t, t, snippets, liveBindings, freeze, namespaceToStringTag) +\n\t\t\t`}${n}${n}`\n\t\t);\n\t},\n\t[MERGE_NAMESPACES_VARIABLE](t, snippets, liveBindings, freeze, namespaceToStringTag) {\n\t\tconst { _, cnst, n } = snippets;\n\t\tconst useForEach = cnst === 'var' && liveBindings;\n\t\treturn (\n\t\t\t`function ${MERGE_NAMESPACES_VARIABLE}(n, m)${_}{${n}` +\n\t\t\t`${t}${loopOverNamespaces(\n\t\t\t\t`{${n}` +\n\t\t\t\t\t`${t}${t}${t}if${_}(k${_}!==${_}'default'${_}&&${_}!(k in n))${_}{${n}` +\n\t\t\t\t\t(liveBindings\n\t\t\t\t\t\t? useForEach\n\t\t\t\t\t\t\t? copyOwnPropertyLiveBinding\n\t\t\t\t\t\t\t: copyPropertyLiveBinding\n\t\t\t\t\t\t: copyPropertyStatic)(t, t + t + t + t, snippets) +\n\t\t\t\t\t`${t}${t}${t}}${n}` +\n\t\t\t\t\t`${t}${t}}`,\n\t\t\t\tuseForEach,\n\t\t\t\tt,\n\t\t\t\tsnippets\n\t\t\t)}${n}` +\n\t\t\t`${t}return ${getFrozen(\n\t\t\t\tfreeze,\n\t\t\t\tgetWithToStringTag(namespaceToStringTag, 'n', snippets)\n\t\t\t)};${n}` +\n\t\t\t`}${n}${n}`\n\t\t);\n\t}\n};\n\nconst getDefaultLiveBinding = ({ _, getObject }: GenerateCodeSnippets) =>\n\t`e${_}:${_}${getObject([['default', 'e']], { lineBreakIndent: null })}`;\n\nconst getDefaultStatic = ({ _, getPropertyAccess }: GenerateCodeSnippets) =>\n\t`e${getPropertyAccess('default')}${_}:${_}e`;\n\nconst createNamespaceObject = (\n\tt: string,\n\ti: string,\n\tsnippets: GenerateCodeSnippets,\n\tliveBindings: boolean,\n\tfreeze: boolean,\n\tnamespaceToStringTag: boolean\n) => {\n\tconst { _, cnst, getObject, getPropertyAccess, n, s } = snippets;\n\tconst copyProperty =\n\t\t`{${n}` +\n\t\t(liveBindings ? copyNonDefaultOwnPropertyLiveBinding : copyPropertyStatic)(\n\t\t\tt,\n\t\t\ti + t + t,\n\t\t\tsnippets\n\t\t) +\n\t\t`${i}${t}}`;\n\treturn (\n\t\t`${i}${cnst} n${_}=${_}Object.create(null${\n\t\t\tnamespaceToStringTag\n\t\t\t\t? `,${_}{${_}[Symbol.toStringTag]:${_}${getToStringTagValue(getObject)}${_}}`\n\t\t\t\t: ''\n\t\t});${n}` +\n\t\t`${i}if${_}(e)${_}{${n}` +\n\t\t`${i}${t}${loopOverKeys(copyProperty, !liveBindings, snippets)}${n}` +\n\t\t`${i}}${n}` +\n\t\t`${i}n${getPropertyAccess('default')}${_}=${_}e;${n}` +\n\t\t`${i}return ${getFrozen(freeze, 'n')}${s}${n}`\n\t);\n};\n\nconst loopOverKeys = (\n\tbody: string,\n\tallowVarLoopVariable: boolean,\n\t{ _, cnst, getFunctionIntro, s }: GenerateCodeSnippets\n) =>\n\tcnst !== 'var' || allowVarLoopVariable\n\t\t? `for${_}(${cnst} k in e)${_}${body}`\n\t\t: `Object.keys(e).forEach(${getFunctionIntro(['k'], {\n\t\t\t\tisAsync: false,\n\t\t\t\tname: null\n\t\t })}${body})${s}`;\n\nconst loopOverNamespaces = (\n\tbody: string,\n\tuseForEach: boolean,\n\tt: string,\n\t{ _, cnst, getDirectReturnFunction, getFunctionIntro, n }: GenerateCodeSnippets\n) => {\n\tif (useForEach) {\n\t\tconst [left, right] = getDirectReturnFunction(['e'], {\n\t\t\tfunctionReturn: false,\n\t\t\tlineBreakIndent: { base: t, t },\n\t\t\tname: null\n\t\t});\n\t\treturn (\n\t\t\t`m.forEach(${left}` +\n\t\t\t`e${_}&&${_}typeof e${_}!==${_}'string'${_}&&${_}!Array.isArray(e)${_}&&${_}Object.keys(e).forEach(${getFunctionIntro(\n\t\t\t\t['k'],\n\t\t\t\t{\n\t\t\t\t\tisAsync: false,\n\t\t\t\t\tname: null\n\t\t\t\t}\n\t\t\t)}${body})${right});`\n\t\t);\n\t}\n\treturn (\n\t\t`for${_}(var i${_}=${_}0;${_}i${_}<${_}m.length;${_}i++)${_}{${n}` +\n\t\t`${t}${t}${cnst} e${_}=${_}m[i];${n}` +\n\t\t`${t}${t}if${_}(typeof e${_}!==${_}'string'${_}&&${_}!Array.isArray(e))${_}{${_}for${_}(${cnst} k in e)${_}${body}${_}}${n}${t}}`\n\t);\n};\n\nconst copyNonDefaultOwnPropertyLiveBinding = (\n\tt: string,\n\ti: string,\n\tsnippets: GenerateCodeSnippets\n) => {\n\tconst { _, n } = snippets;\n\treturn (\n\t\t`${i}if${_}(k${_}!==${_}'default')${_}{${n}` +\n\t\tcopyOwnPropertyLiveBinding(t, i + t, snippets) +\n\t\t`${i}}${n}`\n\t);\n};\n\nconst copyOwnPropertyLiveBinding = (\n\tt: string,\n\ti: string,\n\t{ _, cnst, getDirectReturnFunction, n }: GenerateCodeSnippets\n) => {\n\tconst [left, right] = getDirectReturnFunction([], {\n\t\tfunctionReturn: true,\n\t\tlineBreakIndent: null,\n\t\tname: null\n\t});\n\treturn (\n\t\t`${i}${cnst} d${_}=${_}Object.getOwnPropertyDescriptor(e,${_}k);${n}` +\n\t\t`${i}Object.defineProperty(n,${_}k,${_}d.get${_}?${_}d${_}:${_}{${n}` +\n\t\t`${i}${t}enumerable:${_}true,${n}` +\n\t\t`${i}${t}get:${_}${left}e[k]${right}${n}` +\n\t\t`${i}});${n}`\n\t);\n};\n\nconst copyPropertyLiveBinding = (\n\tt: string,\n\ti: string,\n\t{ _, cnst, getDirectReturnFunction, n }: GenerateCodeSnippets\n) => {\n\tconst [left, right] = getDirectReturnFunction([], {\n\t\tfunctionReturn: true,\n\t\tlineBreakIndent: null,\n\t\tname: null\n\t});\n\treturn (\n\t\t`${i}${cnst} d${_}=${_}Object.getOwnPropertyDescriptor(e,${_}k);${n}` +\n\t\t`${i}if${_}(d)${_}{${n}` +\n\t\t`${i}${t}Object.defineProperty(n,${_}k,${_}d.get${_}?${_}d${_}:${_}{${n}` +\n\t\t`${i}${t}${t}enumerable:${_}true,${n}` +\n\t\t`${i}${t}${t}get:${_}${left}e[k]${right}${n}` +\n\t\t`${i}${t}});${n}` +\n\t\t`${i}}${n}`\n\t);\n};\n\nconst copyPropertyStatic = (_t: string, i: string, { _, n }: GenerateCodeSnippets) =>\n\t`${i}n[k]${_}=${_}e[k];${n}`;\n\nconst getFrozen = (freeze: boolean, fragment: string) =>\n\tfreeze ? `Object.freeze(${fragment})` : fragment;\n\nconst getWithToStringTag = (\n\tnamespaceToStringTag: boolean,\n\tfragment: string,\n\t{ _, getObject }: GenerateCodeSnippets\n) =>\n\tnamespaceToStringTag\n\t\t? `Object.defineProperty(${fragment},${_}Symbol.toStringTag,${_}${getToStringTagValue(\n\t\t\t\tgetObject\n\t\t )})`\n\t\t: fragment;\n\nexport const HELPER_NAMES = Object.keys(HELPER_GENERATORS);\n\nexport function getToStringTagValue(getObject: GenerateCodeSnippets['getObject']) {\n\treturn getObject([['value', \"'Module'\"]], {\n\t\tlineBreakIndent: null\n\t});\n}\n","import type MagicString from 'magic-string';\nimport ExternalModule from '../../ExternalModule';\nimport type Module from '../../Module';\nimport type { GetInterop, NormalizedOutputOptions } from '../../rollup/types';\nimport type { PluginDriver } from '../../utils/PluginDriver';\nimport type { GenerateCodeSnippets } from '../../utils/generateCodeSnippets';\nimport {\n\tINTEROP_NAMESPACE_DEFAULT_ONLY_VARIABLE,\n\tnamespaceInteropHelpersByInteropType\n} from '../../utils/interopHelpers';\nimport { findFirstOccurrenceOutsideComment, type RenderOptions } from '../../utils/renderHelpers';\nimport type { InclusionContext } from '../ExecutionContext';\nimport type ChildScope from '../scopes/ChildScope';\nimport type NamespaceVariable from '../variables/NamespaceVariable';\nimport type * as NodeType from './NodeType';\nimport { type ExpressionNode, type IncludeChildren, NodeBase } from './shared/Node';\n\ninterface DynamicImportMechanism {\n\tleft: string;\n\tright: string;\n}\n\nexport default class ImportExpression extends NodeBase {\n\tinlineNamespace: NamespaceVariable | null = null;\n\tdeclare source: ExpressionNode;\n\tdeclare type: NodeType.tImportExpression;\n\n\tprivate mechanism: DynamicImportMechanism | null = null;\n\tprivate resolution: Module | ExternalModule | string | null = null;\n\n\thasEffects(): boolean {\n\t\treturn true;\n\t}\n\n\tinclude(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void {\n\t\tif (!this.included) {\n\t\t\tthis.included = true;\n\t\t\tthis.context.includeDynamicImport(this);\n\t\t\tthis.scope.addAccessedDynamicImport(this);\n\t\t}\n\t\tthis.source.include(context, includeChildrenRecursively);\n\t}\n\n\tinitialise(): void {\n\t\tthis.context.addDynamicImport(this);\n\t}\n\n\trender(code: MagicString, options: RenderOptions): void {\n\t\tif (this.inlineNamespace) {\n\t\t\tconst {\n\t\t\t\tsnippets: { getDirectReturnFunction, getPropertyAccess }\n\t\t\t} = options;\n\t\t\tconst [left, right] = getDirectReturnFunction([], {\n\t\t\t\tfunctionReturn: true,\n\t\t\t\tlineBreakIndent: null,\n\t\t\t\tname: null\n\t\t\t});\n\t\t\tcode.overwrite(\n\t\t\t\tthis.start,\n\t\t\t\tthis.end,\n\t\t\t\t`Promise.resolve().then(${left}${this.inlineNamespace.getName(getPropertyAccess)}${right})`,\n\t\t\t\t{ contentOnly: true }\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.mechanism) {\n\t\t\tcode.overwrite(\n\t\t\t\tthis.start,\n\t\t\t\tfindFirstOccurrenceOutsideComment(code.original, '(', this.start + 6) + 1,\n\t\t\t\tthis.mechanism.left,\n\t\t\t\t{ contentOnly: true }\n\t\t\t);\n\t\t\tcode.overwrite(this.end - 1, this.end, this.mechanism.right, { contentOnly: true });\n\t\t}\n\t\tthis.source.render(code, options);\n\t}\n\n\trenderFinalResolution(\n\t\tcode: MagicString,\n\t\tresolution: string,\n\t\tnamespaceExportName: string | false | undefined,\n\t\t{ getDirectReturnFunction }: GenerateCodeSnippets\n\t): void {\n\t\tcode.overwrite(this.source.start, this.source.end, resolution);\n\t\tif (namespaceExportName) {\n\t\t\tconst [left, right] = getDirectReturnFunction(['n'], {\n\t\t\t\tfunctionReturn: true,\n\t\t\t\tlineBreakIndent: null,\n\t\t\t\tname: null\n\t\t\t});\n\t\t\tcode.prependLeft(this.end, `.then(${left}n.${namespaceExportName}${right})`);\n\t\t}\n\t}\n\n\tsetExternalResolution(\n\t\texportMode: 'none' | 'named' | 'default' | 'external',\n\t\tresolution: Module | ExternalModule | string | null,\n\t\toptions: NormalizedOutputOptions,\n\t\tsnippets: GenerateCodeSnippets,\n\t\tpluginDriver: PluginDriver,\n\t\taccessedGlobalsByScope: Map>\n\t): void {\n\t\tconst { format } = options;\n\t\tthis.inlineNamespace = null;\n\t\tthis.resolution = resolution;\n\t\tconst accessedGlobals = [...(accessedImportGlobals[format] || [])];\n\t\tlet helper: string | null;\n\t\t({ helper, mechanism: this.mechanism } = this.getDynamicImportMechanismAndHelper(\n\t\t\tresolution,\n\t\t\texportMode,\n\t\t\toptions,\n\t\t\tsnippets,\n\t\t\tpluginDriver\n\t\t));\n\t\tif (helper) {\n\t\t\taccessedGlobals.push(helper);\n\t\t}\n\t\tif (accessedGlobals.length > 0) {\n\t\t\tthis.scope.addAccessedGlobals(accessedGlobals, accessedGlobalsByScope);\n\t\t}\n\t}\n\n\tsetInternalResolution(inlineNamespace: NamespaceVariable): void {\n\t\tthis.inlineNamespace = inlineNamespace;\n\t}\n\n\tprotected applyDeoptimizations() {}\n\n\tprivate getDynamicImportMechanismAndHelper(\n\t\tresolution: Module | ExternalModule | string | null,\n\t\texportMode: 'none' | 'named' | 'default' | 'external',\n\t\t{\n\t\t\tcompact,\n\t\t\tdynamicImportFunction,\n\t\t\tformat,\n\t\t\tgeneratedCode: { arrowFunctions },\n\t\t\tinterop\n\t\t}: NormalizedOutputOptions,\n\t\t{ _, getDirectReturnFunction, getDirectReturnIifeLeft }: GenerateCodeSnippets,\n\t\tpluginDriver: PluginDriver\n\t): { helper: string | null; mechanism: DynamicImportMechanism | null } {\n\t\tconst mechanism = pluginDriver.hookFirstSync('renderDynamicImport', [\n\t\t\t{\n\t\t\t\tcustomResolution: typeof this.resolution === 'string' ? this.resolution : null,\n\t\t\t\tformat,\n\t\t\t\tmoduleId: this.context.module.id,\n\t\t\t\ttargetModuleId:\n\t\t\t\t\tthis.resolution && typeof this.resolution !== 'string' ? this.resolution.id : null\n\t\t\t}\n\t\t]);\n\t\tif (mechanism) {\n\t\t\treturn { helper: null, mechanism };\n\t\t}\n\t\tconst hasDynamicTarget = !this.resolution || typeof this.resolution === 'string';\n\t\tswitch (format) {\n\t\t\tcase 'cjs': {\n\t\t\t\tconst helper = getInteropHelper(resolution, exportMode, interop);\n\t\t\t\tlet left = `require(`;\n\t\t\t\tlet right = `)`;\n\t\t\t\tif (helper) {\n\t\t\t\t\tleft = `/*#__PURE__*/${helper}(${left}`;\n\t\t\t\t\tright += ')';\n\t\t\t\t}\n\t\t\t\tconst [functionLeft, functionRight] = getDirectReturnFunction([], {\n\t\t\t\t\tfunctionReturn: true,\n\t\t\t\t\tlineBreakIndent: null,\n\t\t\t\t\tname: null\n\t\t\t\t});\n\t\t\t\tleft = `Promise.resolve().then(${functionLeft}${left}`;\n\t\t\t\tright += `${functionRight})`;\n\t\t\t\tif (!arrowFunctions && hasDynamicTarget) {\n\t\t\t\t\tleft = getDirectReturnIifeLeft(['t'], `${left}t${right}`, {\n\t\t\t\t\t\tneedsArrowReturnParens: false,\n\t\t\t\t\t\tneedsWrappedFunction: true\n\t\t\t\t\t});\n\t\t\t\t\tright = ')';\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\thelper,\n\t\t\t\t\tmechanism: { left, right }\n\t\t\t\t};\n\t\t\t}\n\t\t\tcase 'amd': {\n\t\t\t\tconst resolve = compact ? 'c' : 'resolve';\n\t\t\t\tconst reject = compact ? 'e' : 'reject';\n\t\t\t\tconst helper = getInteropHelper(resolution, exportMode, interop);\n\t\t\t\tconst [resolveLeft, resolveRight] = getDirectReturnFunction(['m'], {\n\t\t\t\t\tfunctionReturn: false,\n\t\t\t\t\tlineBreakIndent: null,\n\t\t\t\t\tname: null\n\t\t\t\t});\n\t\t\t\tconst resolveNamespace = helper\n\t\t\t\t\t? `${resolveLeft}${resolve}(/*#__PURE__*/${helper}(m))${resolveRight}`\n\t\t\t\t\t: resolve;\n\t\t\t\tconst [handlerLeft, handlerRight] = getDirectReturnFunction([resolve, reject], {\n\t\t\t\t\tfunctionReturn: false,\n\t\t\t\t\tlineBreakIndent: null,\n\t\t\t\t\tname: null\n\t\t\t\t});\n\t\t\t\tlet left = `new Promise(${handlerLeft}require([`;\n\t\t\t\tlet right = `],${_}${resolveNamespace},${_}${reject})${handlerRight})`;\n\t\t\t\tif (!arrowFunctions && hasDynamicTarget) {\n\t\t\t\t\tleft = getDirectReturnIifeLeft(['t'], `${left}t${right}`, {\n\t\t\t\t\t\tneedsArrowReturnParens: false,\n\t\t\t\t\t\tneedsWrappedFunction: true\n\t\t\t\t\t});\n\t\t\t\t\tright = ')';\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\thelper,\n\t\t\t\t\tmechanism: { left, right }\n\t\t\t\t};\n\t\t\t}\n\t\t\tcase 'system':\n\t\t\t\treturn {\n\t\t\t\t\thelper: null,\n\t\t\t\t\tmechanism: {\n\t\t\t\t\t\tleft: 'module.import(',\n\t\t\t\t\t\tright: ')'\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\tcase 'es':\n\t\t\t\tif (dynamicImportFunction) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\thelper: null,\n\t\t\t\t\t\tmechanism: {\n\t\t\t\t\t\t\tleft: `${dynamicImportFunction}(`,\n\t\t\t\t\t\t\tright: ')'\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t}\n\t\treturn { helper: null, mechanism: null };\n\t}\n}\n\nfunction getInteropHelper(\n\tresolution: Module | ExternalModule | string | null,\n\texportMode: 'none' | 'named' | 'default' | 'external',\n\tinterop: GetInterop\n): string | null {\n\treturn exportMode === 'external'\n\t\t? namespaceInteropHelpersByInteropType[\n\t\t\t\tString(interop(resolution instanceof ExternalModule ? resolution.id : null))\n\t\t ]\n\t\t: exportMode === 'default'\n\t\t? INTEROP_NAMESPACE_DEFAULT_ONLY_VARIABLE\n\t\t: null;\n}\n\nconst accessedImportGlobals: Record = {\n\tamd: ['require'],\n\tcjs: ['require'],\n\tsystem: ['module']\n};\n","import type MagicString from 'magic-string';\nimport type { InternalModuleFormat } from '../../rollup/types';\nimport type { PluginDriver } from '../../utils/PluginDriver';\nimport { warnDeprecation } from '../../utils/error';\nimport type { GenerateCodeSnippets } from '../../utils/generateCodeSnippets';\nimport { dirname, normalize, relative } from '../../utils/path';\nimport { INTERACTION_ACCESSED, NodeInteraction } from '../NodeInteractions';\nimport type ChildScope from '../scopes/ChildScope';\nimport type { ObjectPath } from '../utils/PathTracker';\nimport type Identifier from './Identifier';\nimport MemberExpression from './MemberExpression';\nimport type * as NodeType from './NodeType';\nimport { NodeBase } from './shared/Node';\n\nconst ASSET_PREFIX = 'ROLLUP_ASSET_URL_';\nconst CHUNK_PREFIX = 'ROLLUP_CHUNK_URL_';\nconst FILE_PREFIX = 'ROLLUP_FILE_URL_';\n\nexport default class MetaProperty extends NodeBase {\n\tdeclare meta: Identifier;\n\tdeclare property: Identifier;\n\tdeclare type: NodeType.tMetaProperty;\n\n\tprivate declare metaProperty?: string | null;\n\n\taddAccessedGlobals(\n\t\tformat: InternalModuleFormat,\n\t\taccessedGlobalsByScope: Map>\n\t): void {\n\t\tconst metaProperty = this.metaProperty;\n\t\tconst accessedGlobals = (\n\t\t\tmetaProperty &&\n\t\t\t(metaProperty.startsWith(FILE_PREFIX) ||\n\t\t\t\tmetaProperty.startsWith(ASSET_PREFIX) ||\n\t\t\t\tmetaProperty.startsWith(CHUNK_PREFIX))\n\t\t\t\t? accessedFileUrlGlobals\n\t\t\t\t: accessedMetaUrlGlobals\n\t\t)[format];\n\t\tif (accessedGlobals.length > 0) {\n\t\t\tthis.scope.addAccessedGlobals(accessedGlobals, accessedGlobalsByScope);\n\t\t}\n\t}\n\n\tgetReferencedFileName(outputPluginDriver: PluginDriver): string | null {\n\t\tconst metaProperty = this.metaProperty as string | null;\n\t\tif (metaProperty && metaProperty.startsWith(FILE_PREFIX)) {\n\t\t\treturn outputPluginDriver.getFileName(metaProperty.substring(FILE_PREFIX.length));\n\t\t}\n\t\treturn null;\n\t}\n\n\thasEffects(): boolean {\n\t\treturn false;\n\t}\n\n\thasEffectsOnInteractionAtPath(path: ObjectPath, { type }: NodeInteraction): boolean {\n\t\treturn path.length > 1 || type !== INTERACTION_ACCESSED;\n\t}\n\n\tinclude(): void {\n\t\tif (!this.included) {\n\t\t\tthis.included = true;\n\t\t\tif (this.meta.name === 'import') {\n\t\t\t\tthis.context.addImportMeta(this);\n\t\t\t\tconst parent = this.parent;\n\t\t\t\tthis.metaProperty =\n\t\t\t\t\tparent instanceof MemberExpression && typeof parent.propertyKey === 'string'\n\t\t\t\t\t\t? parent.propertyKey\n\t\t\t\t\t\t: null;\n\t\t\t}\n\t\t}\n\t}\n\n\trenderFinalMechanism(\n\t\tcode: MagicString,\n\t\tchunkId: string,\n\t\tformat: InternalModuleFormat,\n\t\tsnippets: GenerateCodeSnippets,\n\t\toutputPluginDriver: PluginDriver\n\t): void {\n\t\tconst parent = this.parent;\n\t\tconst metaProperty = this.metaProperty as string | null;\n\n\t\tif (\n\t\t\tmetaProperty &&\n\t\t\t(metaProperty.startsWith(FILE_PREFIX) ||\n\t\t\t\tmetaProperty.startsWith(ASSET_PREFIX) ||\n\t\t\t\tmetaProperty.startsWith(CHUNK_PREFIX))\n\t\t) {\n\t\t\tlet referenceId: string | null = null;\n\t\t\tlet assetReferenceId: string | null = null;\n\t\t\tlet chunkReferenceId: string | null = null;\n\t\t\tlet fileName: string;\n\t\t\tif (metaProperty.startsWith(FILE_PREFIX)) {\n\t\t\t\treferenceId = metaProperty.substring(FILE_PREFIX.length);\n\t\t\t\tfileName = outputPluginDriver.getFileName(referenceId);\n\t\t\t} else if (metaProperty.startsWith(ASSET_PREFIX)) {\n\t\t\t\twarnDeprecation(\n\t\t\t\t\t`Using the \"${ASSET_PREFIX}\" prefix to reference files is deprecated. Use the \"${FILE_PREFIX}\" prefix instead.`,\n\t\t\t\t\ttrue,\n\t\t\t\t\tthis.context.options\n\t\t\t\t);\n\t\t\t\tassetReferenceId = metaProperty.substring(ASSET_PREFIX.length);\n\t\t\t\tfileName = outputPluginDriver.getFileName(assetReferenceId);\n\t\t\t} else {\n\t\t\t\twarnDeprecation(\n\t\t\t\t\t`Using the \"${CHUNK_PREFIX}\" prefix to reference files is deprecated. Use the \"${FILE_PREFIX}\" prefix instead.`,\n\t\t\t\t\ttrue,\n\t\t\t\t\tthis.context.options\n\t\t\t\t);\n\t\t\t\tchunkReferenceId = metaProperty.substring(CHUNK_PREFIX.length);\n\t\t\t\tfileName = outputPluginDriver.getFileName(chunkReferenceId);\n\t\t\t}\n\t\t\tconst relativePath = normalize(relative(dirname(chunkId), fileName));\n\t\t\tlet replacement;\n\t\t\tif (assetReferenceId !== null) {\n\t\t\t\treplacement = outputPluginDriver.hookFirstSync('resolveAssetUrl', [\n\t\t\t\t\t{\n\t\t\t\t\t\tassetFileName: fileName,\n\t\t\t\t\t\tchunkId,\n\t\t\t\t\t\tformat,\n\t\t\t\t\t\tmoduleId: this.context.module.id,\n\t\t\t\t\t\trelativeAssetPath: relativePath\n\t\t\t\t\t}\n\t\t\t\t]);\n\t\t\t}\n\t\t\tif (!replacement) {\n\t\t\t\treplacement =\n\t\t\t\t\toutputPluginDriver.hookFirstSync('resolveFileUrl', [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tassetReferenceId,\n\t\t\t\t\t\t\tchunkId,\n\t\t\t\t\t\t\tchunkReferenceId,\n\t\t\t\t\t\t\tfileName,\n\t\t\t\t\t\t\tformat,\n\t\t\t\t\t\t\tmoduleId: this.context.module.id,\n\t\t\t\t\t\t\treferenceId: referenceId || assetReferenceId || chunkReferenceId!,\n\t\t\t\t\t\t\trelativePath\n\t\t\t\t\t\t}\n\t\t\t\t\t]) || relativeUrlMechanisms[format](relativePath);\n\t\t\t}\n\n\t\t\tcode.overwrite(\n\t\t\t\t(parent as MemberExpression).start,\n\t\t\t\t(parent as MemberExpression).end,\n\t\t\t\treplacement,\n\t\t\t\t{ contentOnly: true }\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\tconst replacement =\n\t\t\toutputPluginDriver.hookFirstSync('resolveImportMeta', [\n\t\t\t\tmetaProperty,\n\t\t\t\t{\n\t\t\t\t\tchunkId,\n\t\t\t\t\tformat,\n\t\t\t\t\tmoduleId: this.context.module.id\n\t\t\t\t}\n\t\t\t]) || importMetaMechanisms[format]?.(metaProperty, { chunkId, snippets });\n\t\tif (typeof replacement === 'string') {\n\t\t\tif (parent instanceof MemberExpression) {\n\t\t\t\tcode.overwrite(parent.start, parent.end, replacement, { contentOnly: true });\n\t\t\t} else {\n\t\t\t\tcode.overwrite(this.start, this.end, replacement, { contentOnly: true });\n\t\t\t}\n\t\t}\n\t}\n}\n\nconst accessedMetaUrlGlobals = {\n\tamd: ['document', 'module', 'URL'],\n\tcjs: ['document', 'require', 'URL'],\n\tes: [],\n\tiife: ['document', 'URL'],\n\tsystem: ['module'],\n\tumd: ['document', 'require', 'URL']\n};\n\nconst accessedFileUrlGlobals = {\n\tamd: ['document', 'require', 'URL'],\n\tcjs: ['document', 'require', 'URL'],\n\tes: [],\n\tiife: ['document', 'URL'],\n\tsystem: ['module', 'URL'],\n\tumd: ['document', 'require', 'URL']\n};\n\nconst getResolveUrl = (path: string, URL = 'URL') => `new ${URL}(${path}).href`;\n\nconst getRelativeUrlFromDocument = (relativePath: string, umd = false) =>\n\tgetResolveUrl(\n\t\t`'${relativePath}', ${\n\t\t\tumd ? `typeof document === 'undefined' ? location.href : ` : ''\n\t\t}document.currentScript && document.currentScript.src || document.baseURI`\n\t);\n\nconst getGenericImportMetaMechanism =\n\t(getUrl: (chunkId: string) => string) =>\n\t(prop: string | null, { chunkId }: { chunkId: string }) => {\n\t\tconst urlMechanism = getUrl(chunkId);\n\t\treturn prop === null\n\t\t\t? `({ url: ${urlMechanism} })`\n\t\t\t: prop === 'url'\n\t\t\t? urlMechanism\n\t\t\t: 'undefined';\n\t};\n\nconst getUrlFromDocument = (chunkId: string, umd = false) =>\n\t`${\n\t\tumd ? `typeof document === 'undefined' ? location.href : ` : ''\n\t}(document.currentScript && document.currentScript.src || new URL('${chunkId}', document.baseURI).href)`;\n\nconst relativeUrlMechanisms: Record string> = {\n\tamd: relativePath => {\n\t\tif (relativePath[0] !== '.') relativePath = './' + relativePath;\n\t\treturn getResolveUrl(`require.toUrl('${relativePath}'), document.baseURI`);\n\t},\n\tcjs: relativePath =>\n\t\t`(typeof document === 'undefined' ? ${getResolveUrl(\n\t\t\t`'file:' + __dirname + '/${relativePath}'`,\n\t\t\t`(require('u' + 'rl').URL)`\n\t\t)} : ${getRelativeUrlFromDocument(relativePath)})`,\n\tes: relativePath => getResolveUrl(`'${relativePath}', import.meta.url`),\n\tiife: relativePath => getRelativeUrlFromDocument(relativePath),\n\tsystem: relativePath => getResolveUrl(`'${relativePath}', module.meta.url`),\n\tumd: relativePath =>\n\t\t`(typeof document === 'undefined' && typeof location === 'undefined' ? ${getResolveUrl(\n\t\t\t`'file:' + __dirname + '/${relativePath}'`,\n\t\t\t`(require('u' + 'rl').URL)`\n\t\t)} : ${getRelativeUrlFromDocument(relativePath, true)})`\n};\n\nconst importMetaMechanisms: Record<\n\tstring,\n\t(prop: string | null, options: { chunkId: string; snippets: GenerateCodeSnippets }) => string\n> = {\n\tamd: getGenericImportMetaMechanism(() => getResolveUrl(`module.uri, document.baseURI`)),\n\tcjs: getGenericImportMetaMechanism(\n\t\tchunkId =>\n\t\t\t`(typeof document === 'undefined' ? ${getResolveUrl(\n\t\t\t\t`'file:' + __filename`,\n\t\t\t\t`(require('u' + 'rl').URL)`\n\t\t\t)} : ${getUrlFromDocument(chunkId)})`\n\t),\n\tiife: getGenericImportMetaMechanism(chunkId => getUrlFromDocument(chunkId)),\n\tsystem: (prop, { snippets: { getPropertyAccess } }) =>\n\t\tprop === null ? `module.meta` : `module.meta${getPropertyAccess(prop)}`,\n\tumd: getGenericImportMetaMechanism(\n\t\tchunkId =>\n\t\t\t`(typeof document === 'undefined' && typeof location === 'undefined' ? ${getResolveUrl(\n\t\t\t\t`'file:' + __filename`,\n\t\t\t\t`(require('u' + 'rl').URL)`\n\t\t\t)} : ${getUrlFromDocument(chunkId, true)})`\n\t)\n};\n","import type MagicString from 'magic-string';\nimport { type RenderOptions, renderStatementList } from '../../utils/renderHelpers';\nimport type { HasEffectsContext, InclusionContext } from '../ExecutionContext';\nimport type * as NodeType from './NodeType';\nimport { type IncludeChildren, NodeBase, type StatementNode } from './shared/Node';\n\nexport default class Program extends NodeBase {\n\tdeclare body: readonly StatementNode[];\n\tdeclare sourceType: 'module';\n\tdeclare type: NodeType.tProgram;\n\n\tprivate hasCachedEffect = false;\n\n\thasEffects(context: HasEffectsContext): boolean {\n\t\t// We are caching here to later more efficiently identify side-effect-free modules\n\t\tif (this.hasCachedEffect) return true;\n\t\tfor (const node of this.body) {\n\t\t\tif (node.hasEffects(context)) {\n\t\t\t\treturn (this.hasCachedEffect = true);\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\tinclude(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void {\n\t\tthis.included = true;\n\t\tfor (const node of this.body) {\n\t\t\tif (includeChildrenRecursively || node.shouldBeIncluded(context)) {\n\t\t\t\tnode.include(context, includeChildrenRecursively);\n\t\t\t}\n\t\t}\n\t}\n\n\trender(code: MagicString, options: RenderOptions): void {\n\t\tif (this.body.length) {\n\t\t\trenderStatementList(this.body, code, this.start, this.end, options);\n\t\t} else {\n\t\t\tsuper.render(code, options);\n\t\t}\n\t}\n\n\tprotected applyDeoptimizations() {}\n}\n","import type MagicString from 'magic-string';\nimport {\n\tfindFirstOccurrenceOutsideComment,\n\ttype NodeRenderOptions,\n\ttype RenderOptions,\n\trenderStatementList\n} from '../../utils/renderHelpers';\nimport type { HasEffectsContext, InclusionContext } from '../ExecutionContext';\nimport type * as NodeType from './NodeType';\nimport {\n\ttype ExpressionNode,\n\ttype IncludeChildren,\n\tNodeBase,\n\ttype StatementNode\n} from './shared/Node';\n\nexport default class SwitchCase extends NodeBase {\n\tdeclare consequent: readonly StatementNode[];\n\tdeclare needsBoundaries: true;\n\tdeclare test: ExpressionNode | null;\n\tdeclare type: NodeType.tSwitchCase;\n\n\thasEffects(context: HasEffectsContext): boolean {\n\t\tif (this.test?.hasEffects(context)) return true;\n\t\tfor (const node of this.consequent) {\n\t\t\tif (context.brokenFlow) break;\n\t\t\tif (node.hasEffects(context)) return true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tinclude(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void {\n\t\tthis.included = true;\n\t\tthis.test?.include(context, includeChildrenRecursively);\n\t\tfor (const node of this.consequent) {\n\t\t\tif (includeChildrenRecursively || node.shouldBeIncluded(context))\n\t\t\t\tnode.include(context, includeChildrenRecursively);\n\t\t}\n\t}\n\n\trender(code: MagicString, options: RenderOptions, nodeRenderOptions?: NodeRenderOptions): void {\n\t\tif (this.consequent.length) {\n\t\t\tthis.test && this.test.render(code, options);\n\t\t\tconst testEnd = this.test\n\t\t\t\t? this.test.end\n\t\t\t\t: findFirstOccurrenceOutsideComment(code.original, 'default', this.start) + 7;\n\t\t\tconst consequentStart = findFirstOccurrenceOutsideComment(code.original, ':', testEnd) + 1;\n\t\t\trenderStatementList(this.consequent, code, consequentStart, nodeRenderOptions!.end!, options);\n\t\t} else {\n\t\t\tsuper.render(code, options);\n\t\t}\n\t}\n}\n\nSwitchCase.prototype.needsBoundaries = true;\n","import type MagicString from 'magic-string';\nimport type { RenderOptions } from '../../utils/renderHelpers';\nimport { HasEffectsContext } from '../ExecutionContext';\nimport { INTERACTION_ACCESSED, INTERACTION_CALLED, NodeInteraction } from '../NodeInteractions';\nimport type { ObjectPath } from '../utils/PathTracker';\nimport {\n\tgetMemberReturnExpressionWhenCalled,\n\thasMemberEffectWhenCalled,\n\tliteralStringMembers\n} from '../values';\nimport type * as NodeType from './NodeType';\nimport type TemplateElement from './TemplateElement';\nimport {\n\tExpressionEntity,\n\ttype LiteralValueOrUnknown,\n\tUNKNOWN_EXPRESSION,\n\tUnknownValue\n} from './shared/Expression';\nimport { type ExpressionNode, NodeBase } from './shared/Node';\n\nexport default class TemplateLiteral extends NodeBase {\n\tdeclare expressions: ExpressionNode[];\n\tdeclare quasis: TemplateElement[];\n\tdeclare type: NodeType.tTemplateLiteral;\n\n\tdeoptimizeThisOnInteractionAtPath(): void {}\n\n\tgetLiteralValueAtPath(path: ObjectPath): LiteralValueOrUnknown {\n\t\tif (path.length > 0 || this.quasis.length !== 1) {\n\t\t\treturn UnknownValue;\n\t\t}\n\t\treturn this.quasis[0].value.cooked;\n\t}\n\n\tgetReturnExpressionWhenCalledAtPath(path: ObjectPath): ExpressionEntity {\n\t\tif (path.length !== 1) {\n\t\t\treturn UNKNOWN_EXPRESSION;\n\t\t}\n\t\treturn getMemberReturnExpressionWhenCalled(literalStringMembers, path[0]);\n\t}\n\n\thasEffectsOnInteractionAtPath(\n\t\tpath: ObjectPath,\n\t\tinteraction: NodeInteraction,\n\t\tcontext: HasEffectsContext\n\t): boolean {\n\t\tif (interaction.type === INTERACTION_ACCESSED) {\n\t\t\treturn path.length > 1;\n\t\t}\n\t\tif (interaction.type === INTERACTION_CALLED && path.length === 1) {\n\t\t\treturn hasMemberEffectWhenCalled(literalStringMembers, path[0], interaction, context);\n\t\t}\n\t\treturn true;\n\t}\n\n\trender(code: MagicString, options: RenderOptions): void {\n\t\t(code.indentExclusionRanges as [number, number][]).push([this.start, this.end]);\n\t\tsuper.render(code, options);\n\t}\n}\n","import type { LiteralValueOrUnknown } from '../nodes/shared/Expression';\nimport Variable from './Variable';\n\nexport default class UndefinedVariable extends Variable {\n\tconstructor() {\n\t\tsuper('undefined');\n\t}\n\n\tgetLiteralValueAtPath(): LiteralValueOrUnknown {\n\t\treturn undefined;\n\t}\n}\n","import type { AstContext } from '../../Module';\nimport ClassDeclaration from '../nodes/ClassDeclaration';\nimport type ExportDefaultDeclaration from '../nodes/ExportDefaultDeclaration';\nimport FunctionDeclaration from '../nodes/FunctionDeclaration';\nimport Identifier, { type IdentifierWithVariable } from '../nodes/Identifier';\nimport LocalVariable from './LocalVariable';\nimport UndefinedVariable from './UndefinedVariable';\nimport type Variable from './Variable';\n\nexport default class ExportDefaultVariable extends LocalVariable {\n\thasId = false;\n\n\tprivate originalId: IdentifierWithVariable | null = null;\n\tprivate originalVariable: Variable | null = null;\n\n\tconstructor(\n\t\tname: string,\n\t\texportDefaultDeclaration: ExportDefaultDeclaration,\n\t\tcontext: AstContext\n\t) {\n\t\tsuper(name, exportDefaultDeclaration, exportDefaultDeclaration.declaration, context);\n\t\tconst declaration = exportDefaultDeclaration.declaration;\n\t\tif (\n\t\t\t(declaration instanceof FunctionDeclaration || declaration instanceof ClassDeclaration) &&\n\t\t\tdeclaration.id\n\t\t) {\n\t\t\tthis.hasId = true;\n\t\t\tthis.originalId = declaration.id;\n\t\t} else if (declaration instanceof Identifier) {\n\t\t\tthis.originalId = declaration as IdentifierWithVariable;\n\t\t}\n\t}\n\n\taddReference(identifier: Identifier): void {\n\t\tif (!this.hasId) {\n\t\t\tthis.name = identifier.name;\n\t\t}\n\t}\n\n\tgetAssignedVariableName(): string | null {\n\t\treturn (this.originalId && this.originalId.name) || null;\n\t}\n\n\tgetBaseVariableName(): string {\n\t\tconst original = this.getOriginalVariable();\n\t\tif (original === this) {\n\t\t\treturn super.getBaseVariableName();\n\t\t} else {\n\t\t\treturn original.getBaseVariableName();\n\t\t}\n\t}\n\n\tgetDirectOriginalVariable(): Variable | null {\n\t\treturn this.originalId &&\n\t\t\t(this.hasId ||\n\t\t\t\t!(\n\t\t\t\t\tthis.originalId.isPossibleTDZ() ||\n\t\t\t\t\tthis.originalId.variable.isReassigned ||\n\t\t\t\t\tthis.originalId.variable instanceof UndefinedVariable ||\n\t\t\t\t\t// this avoids a circular dependency\n\t\t\t\t\t'syntheticNamespace' in this.originalId.variable\n\t\t\t\t))\n\t\t\t? this.originalId.variable\n\t\t\t: null;\n\t}\n\n\tgetName(getPropertyAccess: (name: string) => string): string {\n\t\tconst original = this.getOriginalVariable();\n\t\tif (original === this) {\n\t\t\treturn super.getName(getPropertyAccess);\n\t\t} else {\n\t\t\treturn original.getName(getPropertyAccess);\n\t\t}\n\t}\n\n\tgetOriginalVariable(): Variable {\n\t\tif (this.originalVariable) return this.originalVariable;\n\t\t// eslint-disable-next-line @typescript-eslint/no-this-alias\n\t\tlet original: Variable | null = this;\n\t\tlet currentVariable: Variable;\n\t\tconst checkedVariables = new Set();\n\t\tdo {\n\t\t\tcheckedVariables.add(original);\n\t\t\tcurrentVariable = original;\n\t\t\toriginal = (currentVariable as ExportDefaultVariable).getDirectOriginalVariable();\n\t\t} while (original instanceof ExportDefaultVariable && !checkedVariables.has(original));\n\t\treturn (this.originalVariable = original || currentVariable);\n\t}\n}\n","import type { AstContext } from '../../Module';\nimport type { InternalModuleFormat } from '../../rollup/types';\nimport type ExportDefaultDeclaration from '../nodes/ExportDefaultDeclaration';\nimport { UNDEFINED_EXPRESSION } from '../values';\nimport ExportDefaultVariable from '../variables/ExportDefaultVariable';\nimport GlobalVariable from '../variables/GlobalVariable';\nimport LocalVariable from '../variables/LocalVariable';\nimport type Variable from '../variables/Variable';\nimport ChildScope from './ChildScope';\nimport type GlobalScope from './GlobalScope';\n\nexport default class ModuleScope extends ChildScope {\n\tcontext: AstContext;\n\tdeclare parent: GlobalScope;\n\n\tconstructor(parent: GlobalScope, context: AstContext) {\n\t\tsuper(parent);\n\t\tthis.context = context;\n\t\tthis.variables.set('this', new LocalVariable('this', null, UNDEFINED_EXPRESSION, context));\n\t}\n\n\taddExportDefaultDeclaration(\n\t\tname: string,\n\t\texportDefaultDeclaration: ExportDefaultDeclaration,\n\t\tcontext: AstContext\n\t): ExportDefaultVariable {\n\t\tconst variable = new ExportDefaultVariable(name, exportDefaultDeclaration, context);\n\t\tthis.variables.set('default', variable);\n\t\treturn variable;\n\t}\n\n\taddNamespaceMemberAccess(): void {}\n\n\tdeconflict(\n\t\tformat: InternalModuleFormat,\n\t\texportNamesByVariable: ReadonlyMap,\n\t\taccessedGlobalsByScope: ReadonlyMap>\n\t): void {\n\t\t// all module level variables are already deconflicted when deconflicting the chunk\n\t\tfor (const scope of this.children)\n\t\t\tscope.deconflict(format, exportNamesByVariable, accessedGlobalsByScope);\n\t}\n\n\tfindLexicalBoundary(): this {\n\t\treturn this;\n\t}\n\n\tfindVariable(name: string): Variable {\n\t\tconst knownVariable = this.variables.get(name) || this.accessedOutsideVariables.get(name);\n\t\tif (knownVariable) {\n\t\t\treturn knownVariable;\n\t\t}\n\t\tconst variable = this.context.traceVariable(name) || this.parent.findVariable(name);\n\t\tif (variable instanceof GlobalVariable) {\n\t\t\tthis.accessedOutsideVariables.set(name, variable);\n\t\t}\n\t\treturn variable;\n\t}\n}\n","import type { DeoptimizableEntity } from '../DeoptimizableEntity';\nimport type { HasEffectsContext } from '../ExecutionContext';\nimport {\n\tINTERACTION_ACCESSED,\n\tNODE_INTERACTION_UNKNOWN_ASSIGNMENT,\n\tNodeInteraction\n} from '../NodeInteractions';\nimport { EMPTY_PATH, type ObjectPath, type PathTracker } from '../utils/PathTracker';\nimport Identifier from './Identifier';\nimport type { LiteralValue } from './Literal';\nimport type * as NodeType from './NodeType';\nimport { type LiteralValueOrUnknown, UnknownValue } from './shared/Expression';\nimport { type ExpressionNode, NodeBase } from './shared/Node';\n\nconst unaryOperators: {\n\t[operator: string]: (value: LiteralValue) => LiteralValueOrUnknown;\n} = {\n\t'!': value => !value,\n\t'+': value => +(value as NonNullable),\n\t'-': value => -(value as NonNullable),\n\tdelete: () => UnknownValue,\n\ttypeof: value => typeof value,\n\tvoid: () => undefined,\n\t'~': value => ~(value as NonNullable)\n};\n\nexport default class UnaryExpression extends NodeBase {\n\tdeclare argument: ExpressionNode;\n\tdeclare operator: '!' | '+' | '-' | 'delete' | 'typeof' | 'void' | '~';\n\tdeclare prefix: boolean;\n\tdeclare type: NodeType.tUnaryExpression;\n\n\tgetLiteralValueAtPath(\n\t\tpath: ObjectPath,\n\t\trecursionTracker: PathTracker,\n\t\torigin: DeoptimizableEntity\n\t): LiteralValueOrUnknown {\n\t\tif (path.length > 0) return UnknownValue;\n\t\tconst argumentValue = this.argument.getLiteralValueAtPath(EMPTY_PATH, recursionTracker, origin);\n\t\tif (typeof argumentValue === 'symbol') return UnknownValue;\n\n\t\treturn unaryOperators[this.operator](argumentValue);\n\t}\n\n\thasEffects(context: HasEffectsContext): boolean {\n\t\tif (!this.deoptimized) this.applyDeoptimizations();\n\t\tif (this.operator === 'typeof' && this.argument instanceof Identifier) return false;\n\t\treturn (\n\t\t\tthis.argument.hasEffects(context) ||\n\t\t\t(this.operator === 'delete' &&\n\t\t\t\tthis.argument.hasEffectsOnInteractionAtPath(\n\t\t\t\t\tEMPTY_PATH,\n\t\t\t\t\tNODE_INTERACTION_UNKNOWN_ASSIGNMENT,\n\t\t\t\t\tcontext\n\t\t\t\t))\n\t\t);\n\t}\n\n\thasEffectsOnInteractionAtPath(path: ObjectPath, { type }: NodeInteraction): boolean {\n\t\treturn type !== INTERACTION_ACCESSED || path.length > (this.operator === 'void' ? 0 : 1);\n\t}\n\n\tprotected applyDeoptimizations(): void {\n\t\tthis.deoptimized = true;\n\t\tif (this.operator === 'delete') {\n\t\t\tthis.argument.deoptimizePath(EMPTY_PATH);\n\t\t\tthis.context.requestTreeshakingPass();\n\t\t}\n\t}\n}\n","import type Variable from '../ast/variables/Variable';\n\nexport function isReassignedExportsMember(\n\tvariable: Variable,\n\texportNamesByVariable: ReadonlyMap\n): boolean {\n\treturn (\n\t\tvariable.renderBaseName !== null && exportNamesByVariable.has(variable) && variable.isReassigned\n\t);\n}\n","import type MagicString from 'magic-string';\nimport { BLANK } from '../../utils/blank';\nimport { isReassignedExportsMember } from '../../utils/reassignedExportsMember';\nimport {\n\tfindFirstOccurrenceOutsideComment,\n\tfindNonWhiteSpace,\n\tgetCommaSeparatedNodesWithBoundaries,\n\ttype NodeRenderOptions,\n\ttype RenderOptions\n} from '../../utils/renderHelpers';\nimport {\n\tgetSystemExportStatement,\n\trenderSystemExportExpression\n} from '../../utils/systemJsRendering';\nimport type { InclusionContext } from '../ExecutionContext';\nimport { EMPTY_PATH } from '../utils/PathTracker';\nimport type Variable from '../variables/Variable';\nimport Identifier, { type IdentifierWithVariable } from './Identifier';\nimport * as NodeType from './NodeType';\nimport type VariableDeclarator from './VariableDeclarator';\nimport { InclusionOptions } from './shared/Expression';\nimport { type IncludeChildren, NodeBase } from './shared/Node';\n\nfunction areAllDeclarationsIncludedAndNotExported(\n\tdeclarations: readonly VariableDeclarator[],\n\texportNamesByVariable: ReadonlyMap\n): boolean {\n\tfor (const declarator of declarations) {\n\t\tif (!declarator.id.included) return false;\n\t\tif (declarator.id.type === NodeType.Identifier) {\n\t\t\tif (exportNamesByVariable.has(declarator.id.variable!)) return false;\n\t\t} else {\n\t\t\tconst exportedVariables: Variable[] = [];\n\t\t\tdeclarator.id.addExportedVariables(exportedVariables, exportNamesByVariable);\n\t\t\tif (exportedVariables.length > 0) return false;\n\t\t}\n\t}\n\treturn true;\n}\n\nexport default class VariableDeclaration extends NodeBase {\n\tdeclare declarations: readonly VariableDeclarator[];\n\tdeclare kind: 'var' | 'let' | 'const';\n\tdeclare type: NodeType.tVariableDeclaration;\n\n\tdeoptimizePath(): void {\n\t\tfor (const declarator of this.declarations) {\n\t\t\tdeclarator.deoptimizePath(EMPTY_PATH);\n\t\t}\n\t}\n\n\thasEffectsOnInteractionAtPath(): boolean {\n\t\treturn false;\n\t}\n\n\tinclude(\n\t\tcontext: InclusionContext,\n\t\tincludeChildrenRecursively: IncludeChildren,\n\t\t{ asSingleStatement }: InclusionOptions = BLANK\n\t): void {\n\t\tthis.included = true;\n\t\tfor (const declarator of this.declarations) {\n\t\t\tif (includeChildrenRecursively || declarator.shouldBeIncluded(context))\n\t\t\t\tdeclarator.include(context, includeChildrenRecursively);\n\t\t\tif (asSingleStatement) {\n\t\t\t\tdeclarator.id.include(context, includeChildrenRecursively);\n\t\t\t}\n\t\t}\n\t}\n\n\tinitialise(): void {\n\t\tfor (const declarator of this.declarations) {\n\t\t\tdeclarator.declareDeclarator(this.kind);\n\t\t}\n\t}\n\n\trender(\n\t\tcode: MagicString,\n\t\toptions: RenderOptions,\n\t\tnodeRenderOptions: NodeRenderOptions = BLANK\n\t): void {\n\t\tif (\n\t\t\tareAllDeclarationsIncludedAndNotExported(this.declarations, options.exportNamesByVariable)\n\t\t) {\n\t\t\tfor (const declarator of this.declarations) {\n\t\t\t\tdeclarator.render(code, options);\n\t\t\t}\n\t\t\tif (\n\t\t\t\t!nodeRenderOptions.isNoStatement &&\n\t\t\t\tcode.original.charCodeAt(this.end - 1) !== 59 /*\";\"*/\n\t\t\t) {\n\t\t\t\tcode.appendLeft(this.end, ';');\n\t\t\t}\n\t\t} else {\n\t\t\tthis.renderReplacedDeclarations(code, options);\n\t\t}\n\t}\n\n\tprotected applyDeoptimizations() {}\n\n\tprivate renderDeclarationEnd(\n\t\tcode: MagicString,\n\t\tseparatorString: string,\n\t\tlastSeparatorPos: number | null,\n\t\tactualContentEnd: number,\n\t\trenderedContentEnd: number,\n\t\tsystemPatternExports: readonly Variable[],\n\t\toptions: RenderOptions\n\t): void {\n\t\tif (code.original.charCodeAt(this.end - 1) === 59 /*\";\"*/) {\n\t\t\tcode.remove(this.end - 1, this.end);\n\t\t}\n\t\tseparatorString += ';';\n\t\tif (lastSeparatorPos !== null) {\n\t\t\tif (\n\t\t\t\tcode.original.charCodeAt(actualContentEnd - 1) === 10 /*\"\\n\"*/ &&\n\t\t\t\t(code.original.charCodeAt(this.end) === 10 /*\"\\n\"*/ ||\n\t\t\t\t\tcode.original.charCodeAt(this.end) === 13) /*\"\\r\"*/\n\t\t\t) {\n\t\t\t\tactualContentEnd--;\n\t\t\t\tif (code.original.charCodeAt(actualContentEnd) === 13 /*\"\\r\"*/) {\n\t\t\t\t\tactualContentEnd--;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (actualContentEnd === lastSeparatorPos + 1) {\n\t\t\t\tcode.overwrite(lastSeparatorPos, renderedContentEnd, separatorString);\n\t\t\t} else {\n\t\t\t\tcode.overwrite(lastSeparatorPos, lastSeparatorPos + 1, separatorString);\n\t\t\t\tcode.remove(actualContentEnd, renderedContentEnd);\n\t\t\t}\n\t\t} else {\n\t\t\tcode.appendLeft(renderedContentEnd, separatorString);\n\t\t}\n\t\tif (systemPatternExports.length > 0) {\n\t\t\tcode.appendLeft(\n\t\t\t\trenderedContentEnd,\n\t\t\t\t` ${getSystemExportStatement(systemPatternExports, options)};`\n\t\t\t);\n\t\t}\n\t}\n\n\tprivate renderReplacedDeclarations(code: MagicString, options: RenderOptions): void {\n\t\tconst separatedNodes = getCommaSeparatedNodesWithBoundaries(\n\t\t\tthis.declarations,\n\t\t\tcode,\n\t\t\tthis.start + this.kind.length,\n\t\t\tthis.end - (code.original.charCodeAt(this.end - 1) === 59 /*\";\"*/ ? 1 : 0)\n\t\t);\n\t\tlet actualContentEnd: number | undefined, renderedContentEnd: number;\n\t\trenderedContentEnd = findNonWhiteSpace(code.original, this.start + this.kind.length);\n\t\tlet lastSeparatorPos = renderedContentEnd - 1;\n\t\tcode.remove(this.start, lastSeparatorPos);\n\t\tlet isInDeclaration = false;\n\t\tlet hasRenderedContent = false;\n\t\tlet separatorString = '',\n\t\t\tleadingString,\n\t\t\tnextSeparatorString;\n\t\tconst aggregatedSystemExports: Variable[] = [];\n\t\tconst singleSystemExport = gatherSystemExportsAndGetSingleExport(\n\t\t\tseparatedNodes,\n\t\t\toptions,\n\t\t\taggregatedSystemExports\n\t\t);\n\t\tfor (const { node, start, separator, contentEnd, end } of separatedNodes) {\n\t\t\tif (!node.included) {\n\t\t\t\tcode.remove(start, end);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tnode.render(code, options);\n\t\t\tleadingString = '';\n\t\t\tnextSeparatorString = '';\n\t\t\tif (\n\t\t\t\t!node.id.included ||\n\t\t\t\t(node.id instanceof Identifier &&\n\t\t\t\t\tisReassignedExportsMember(\n\t\t\t\t\t\t(node.id as IdentifierWithVariable).variable,\n\t\t\t\t\t\toptions.exportNamesByVariable\n\t\t\t\t\t))\n\t\t\t) {\n\t\t\t\tif (hasRenderedContent) {\n\t\t\t\t\tseparatorString += ';';\n\t\t\t\t}\n\t\t\t\tisInDeclaration = false;\n\t\t\t} else {\n\t\t\t\tif (singleSystemExport && singleSystemExport === node.id.variable) {\n\t\t\t\t\tconst operatorPos = findFirstOccurrenceOutsideComment(code.original, '=', node.id.end);\n\t\t\t\t\trenderSystemExportExpression(\n\t\t\t\t\t\tsingleSystemExport,\n\t\t\t\t\t\tfindNonWhiteSpace(code.original, operatorPos + 1),\n\t\t\t\t\t\tseparator === null ? contentEnd : separator,\n\t\t\t\t\t\tcode,\n\t\t\t\t\t\toptions\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tif (isInDeclaration) {\n\t\t\t\t\tseparatorString += ',';\n\t\t\t\t} else {\n\t\t\t\t\tif (hasRenderedContent) {\n\t\t\t\t\t\tseparatorString += ';';\n\t\t\t\t\t}\n\t\t\t\t\tleadingString += `${this.kind} `;\n\t\t\t\t\tisInDeclaration = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (renderedContentEnd === lastSeparatorPos + 1) {\n\t\t\t\tcode.overwrite(lastSeparatorPos, renderedContentEnd, separatorString + leadingString);\n\t\t\t} else {\n\t\t\t\tcode.overwrite(lastSeparatorPos, lastSeparatorPos + 1, separatorString);\n\t\t\t\tcode.appendLeft(renderedContentEnd, leadingString);\n\t\t\t}\n\t\t\tactualContentEnd = contentEnd;\n\t\t\trenderedContentEnd = end;\n\t\t\thasRenderedContent = true;\n\t\t\tlastSeparatorPos = separator!;\n\t\t\tseparatorString = nextSeparatorString;\n\t\t}\n\t\tthis.renderDeclarationEnd(\n\t\t\tcode,\n\t\t\tseparatorString,\n\t\t\tlastSeparatorPos,\n\t\t\tactualContentEnd!,\n\t\t\trenderedContentEnd,\n\t\t\taggregatedSystemExports,\n\t\t\toptions\n\t\t);\n\t}\n}\n\nfunction gatherSystemExportsAndGetSingleExport(\n\tseparatedNodes: readonly {\n\t\tnode: VariableDeclarator;\n\t}[],\n\toptions: RenderOptions,\n\taggregatedSystemExports: Variable[]\n): Variable | null {\n\tlet singleSystemExport: Variable | null = null;\n\tif (options.format === 'system') {\n\t\tfor (const { node } of separatedNodes) {\n\t\t\tif (\n\t\t\t\tnode.id instanceof Identifier &&\n\t\t\t\tnode.init &&\n\t\t\t\taggregatedSystemExports.length === 0 &&\n\t\t\t\toptions.exportNamesByVariable.get(node.id.variable!)?.length === 1\n\t\t\t) {\n\t\t\t\tsingleSystemExport = node.id.variable!;\n\t\t\t\taggregatedSystemExports.push(singleSystemExport);\n\t\t\t} else {\n\t\t\t\tnode.id.addExportedVariables(aggregatedSystemExports, options.exportNamesByVariable);\n\t\t\t}\n\t\t}\n\t\tif (aggregatedSystemExports.length > 1) {\n\t\t\tsingleSystemExport = null;\n\t\t} else if (singleSystemExport) {\n\t\t\taggregatedSystemExports.length = 0;\n\t\t}\n\t}\n\treturn singleSystemExport;\n}\n","import ArrayExpression from './ArrayExpression';\nimport ArrayPattern from './ArrayPattern';\nimport ArrowFunctionExpression from './ArrowFunctionExpression';\nimport AssignmentExpression from './AssignmentExpression';\nimport AssignmentPattern from './AssignmentPattern';\nimport AwaitExpression from './AwaitExpression';\nimport BinaryExpression from './BinaryExpression';\nimport BlockStatement from './BlockStatement';\nimport BreakStatement from './BreakStatement';\nimport CallExpression from './CallExpression';\nimport CatchClause from './CatchClause';\nimport ChainExpression from './ChainExpression';\nimport ClassBody from './ClassBody';\nimport ClassDeclaration from './ClassDeclaration';\nimport ClassExpression from './ClassExpression';\nimport ConditionalExpression from './ConditionalExpression';\nimport ContinueStatement from './ContinueStatement';\nimport DoWhileStatement from './DoWhileStatement';\nimport EmptyStatement from './EmptyStatement';\nimport ExportAllDeclaration from './ExportAllDeclaration';\nimport ExportDefaultDeclaration from './ExportDefaultDeclaration';\nimport ExportNamedDeclaration from './ExportNamedDeclaration';\nimport ExportSpecifier from './ExportSpecifier';\nimport ExpressionStatement from './ExpressionStatement';\nimport ForInStatement from './ForInStatement';\nimport ForOfStatement from './ForOfStatement';\nimport ForStatement from './ForStatement';\nimport FunctionDeclaration from './FunctionDeclaration';\nimport FunctionExpression from './FunctionExpression';\nimport Identifier from './Identifier';\nimport IfStatement from './IfStatement';\nimport ImportDeclaration from './ImportDeclaration';\nimport ImportDefaultSpecifier from './ImportDefaultSpecifier';\nimport ImportExpression from './ImportExpression';\nimport ImportNamespaceSpecifier from './ImportNamespaceSpecifier';\nimport ImportSpecifier from './ImportSpecifier';\nimport LabeledStatement from './LabeledStatement';\nimport Literal from './Literal';\nimport LogicalExpression from './LogicalExpression';\nimport MemberExpression from './MemberExpression';\nimport MetaProperty from './MetaProperty';\nimport MethodDefinition from './MethodDefinition';\nimport NewExpression from './NewExpression';\nimport ObjectExpression from './ObjectExpression';\nimport ObjectPattern from './ObjectPattern';\nimport PrivateIdentifier from './PrivateIdentifier';\nimport Program from './Program';\nimport Property from './Property';\nimport PropertyDefinition from './PropertyDefinition';\nimport RestElement from './RestElement';\nimport ReturnStatement from './ReturnStatement';\nimport SequenceExpression from './SequenceExpression';\nimport SpreadElement from './SpreadElement';\nimport StaticBlock from './StaticBlock';\nimport Super from './Super';\nimport SwitchCase from './SwitchCase';\nimport SwitchStatement from './SwitchStatement';\nimport TaggedTemplateExpression from './TaggedTemplateExpression';\nimport TemplateElement from './TemplateElement';\nimport TemplateLiteral from './TemplateLiteral';\nimport ThisExpression from './ThisExpression';\nimport ThrowStatement from './ThrowStatement';\nimport TryStatement from './TryStatement';\nimport UnaryExpression from './UnaryExpression';\nimport UnknownNode from './UnknownNode';\nimport UpdateExpression from './UpdateExpression';\nimport VariableDeclaration from './VariableDeclaration';\nimport VariableDeclarator from './VariableDeclarator';\nimport WhileStatement from './WhileStatement';\nimport YieldExpression from './YieldExpression';\nimport { NodeBase } from './shared/Node';\n\nexport const nodeConstructors: {\n\t[name: string]: typeof NodeBase;\n} = {\n\tArrayExpression,\n\tArrayPattern,\n\tArrowFunctionExpression,\n\tAssignmentExpression,\n\tAssignmentPattern,\n\tAwaitExpression,\n\tBinaryExpression,\n\tBlockStatement,\n\tBreakStatement,\n\tCallExpression,\n\tCatchClause,\n\tChainExpression,\n\tClassBody,\n\tClassDeclaration,\n\tClassExpression,\n\tConditionalExpression,\n\tContinueStatement,\n\tDoWhileStatement,\n\tEmptyStatement,\n\tExportAllDeclaration,\n\tExportDefaultDeclaration,\n\tExportNamedDeclaration,\n\tExportSpecifier,\n\tExpressionStatement,\n\tForInStatement,\n\tForOfStatement,\n\tForStatement,\n\tFunctionDeclaration,\n\tFunctionExpression,\n\tIdentifier,\n\tIfStatement,\n\tImportDeclaration,\n\tImportDefaultSpecifier,\n\tImportExpression,\n\tImportNamespaceSpecifier,\n\tImportSpecifier,\n\tLabeledStatement,\n\tLiteral,\n\tLogicalExpression,\n\tMemberExpression,\n\tMetaProperty,\n\tMethodDefinition,\n\tNewExpression,\n\tObjectExpression,\n\tObjectPattern,\n\tPrivateIdentifier,\n\tProgram,\n\tProperty,\n\tPropertyDefinition,\n\tRestElement,\n\tReturnStatement,\n\tSequenceExpression,\n\tSpreadElement,\n\tStaticBlock,\n\tSuper,\n\tSwitchCase,\n\tSwitchStatement,\n\tTaggedTemplateExpression,\n\tTemplateElement,\n\tTemplateLiteral,\n\tThisExpression,\n\tThrowStatement,\n\tTryStatement,\n\tUnaryExpression,\n\tUnknownNode,\n\tUpdateExpression,\n\tVariableDeclaration,\n\tVariableDeclarator,\n\tWhileStatement,\n\tYieldExpression\n};\n","import type { DeoptimizableEntity } from '../DeoptimizableEntity';\nimport type { HasEffectsContext } from '../ExecutionContext';\nimport type { NodeInteractionCalled, NodeInteractionWithThisArg } from '../NodeInteractions';\nimport { NodeInteraction } from '../NodeInteractions';\nimport {\n\ttype ObjectPath,\n\ttype PathTracker,\n\tUNKNOWN_PATH,\n\tUnknownInteger\n} from '../utils/PathTracker';\nimport { UNDEFINED_EXPRESSION, UNKNOWN_LITERAL_NUMBER } from '../values';\nimport type * as NodeType from './NodeType';\nimport SpreadElement from './SpreadElement';\nimport { ARRAY_PROTOTYPE } from './shared/ArrayPrototype';\nimport type { ExpressionEntity, LiteralValueOrUnknown } from './shared/Expression';\nimport { type ExpressionNode, NodeBase } from './shared/Node';\nimport { ObjectEntity, type ObjectProperty } from './shared/ObjectEntity';\n\nexport default class ArrayExpression extends NodeBase {\n\tdeclare elements: readonly (ExpressionNode | SpreadElement | null)[];\n\tdeclare type: NodeType.tArrayExpression;\n\tprivate objectEntity: ObjectEntity | null = null;\n\n\tdeoptimizePath(path: ObjectPath): void {\n\t\tthis.getObjectEntity().deoptimizePath(path);\n\t}\n\n\tdeoptimizeThisOnInteractionAtPath(\n\t\tinteraction: NodeInteractionWithThisArg,\n\t\tpath: ObjectPath,\n\t\trecursionTracker: PathTracker\n\t): void {\n\t\tthis.getObjectEntity().deoptimizeThisOnInteractionAtPath(interaction, path, recursionTracker);\n\t}\n\n\tgetLiteralValueAtPath(\n\t\tpath: ObjectPath,\n\t\trecursionTracker: PathTracker,\n\t\torigin: DeoptimizableEntity\n\t): LiteralValueOrUnknown {\n\t\treturn this.getObjectEntity().getLiteralValueAtPath(path, recursionTracker, origin);\n\t}\n\n\tgetReturnExpressionWhenCalledAtPath(\n\t\tpath: ObjectPath,\n\t\tinteraction: NodeInteractionCalled,\n\t\trecursionTracker: PathTracker,\n\t\torigin: DeoptimizableEntity\n\t): ExpressionEntity {\n\t\treturn this.getObjectEntity().getReturnExpressionWhenCalledAtPath(\n\t\t\tpath,\n\t\t\tinteraction,\n\t\t\trecursionTracker,\n\t\t\torigin\n\t\t);\n\t}\n\n\thasEffectsOnInteractionAtPath(\n\t\tpath: ObjectPath,\n\t\tinteraction: NodeInteraction,\n\t\tcontext: HasEffectsContext\n\t): boolean {\n\t\treturn this.getObjectEntity().hasEffectsOnInteractionAtPath(path, interaction, context);\n\t}\n\n\tprotected applyDeoptimizations(): void {\n\t\tthis.deoptimized = true;\n\t\tlet hasSpread = false;\n\t\tfor (let index = 0; index < this.elements.length; index++) {\n\t\t\tconst element = this.elements[index];\n\t\t\tif (element) {\n\t\t\t\tif (hasSpread || element instanceof SpreadElement) {\n\t\t\t\t\thasSpread = true;\n\t\t\t\t\telement.deoptimizePath(UNKNOWN_PATH);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tthis.context.requestTreeshakingPass();\n\t}\n\n\tprivate getObjectEntity(): ObjectEntity {\n\t\tif (this.objectEntity !== null) {\n\t\t\treturn this.objectEntity;\n\t\t}\n\t\tconst properties: ObjectProperty[] = [\n\t\t\t{ key: 'length', kind: 'init', property: UNKNOWN_LITERAL_NUMBER }\n\t\t];\n\t\tlet hasSpread = false;\n\t\tfor (let index = 0; index < this.elements.length; index++) {\n\t\t\tconst element = this.elements[index];\n\t\t\tif (hasSpread || element instanceof SpreadElement) {\n\t\t\t\tif (element) {\n\t\t\t\t\thasSpread = true;\n\t\t\t\t\tproperties.unshift({ key: UnknownInteger, kind: 'init', property: element });\n\t\t\t\t}\n\t\t\t} else if (!element) {\n\t\t\t\tproperties.push({ key: String(index), kind: 'init', property: UNDEFINED_EXPRESSION });\n\t\t\t} else {\n\t\t\t\tproperties.push({ key: String(index), kind: 'init', property: element });\n\t\t\t}\n\t\t}\n\t\treturn (this.objectEntity = new ObjectEntity(properties, ARRAY_PROTOTYPE));\n\t}\n}\n","import type { HasEffectsContext } from '../ExecutionContext';\nimport { NodeInteractionAssigned } from '../NodeInteractions';\nimport { EMPTY_PATH, type ObjectPath } from '../utils/PathTracker';\nimport type LocalVariable from '../variables/LocalVariable';\nimport type Variable from '../variables/Variable';\nimport type * as NodeType from './NodeType';\nimport { UNKNOWN_EXPRESSION } from './shared/Expression';\nimport { NodeBase } from './shared/Node';\nimport type { PatternNode } from './shared/Pattern';\n\nexport default class ArrayPattern extends NodeBase implements PatternNode {\n\tdeclare elements: (PatternNode | null)[];\n\tdeclare type: NodeType.tArrayPattern;\n\n\taddExportedVariables(\n\t\tvariables: readonly Variable[],\n\t\texportNamesByVariable: ReadonlyMap\n\t): void {\n\t\tfor (const element of this.elements) {\n\t\t\telement?.addExportedVariables(variables, exportNamesByVariable);\n\t\t}\n\t}\n\n\tdeclare(kind: string): LocalVariable[] {\n\t\tconst variables: LocalVariable[] = [];\n\t\tfor (const element of this.elements) {\n\t\t\tif (element !== null) {\n\t\t\t\tvariables.push(...element.declare(kind, UNKNOWN_EXPRESSION));\n\t\t\t}\n\t\t}\n\t\treturn variables;\n\t}\n\n\t// Patterns can only be deoptimized at the empty path at the moment\n\tdeoptimizePath(): void {\n\t\tfor (const element of this.elements) {\n\t\t\telement?.deoptimizePath(EMPTY_PATH);\n\t\t}\n\t}\n\n\t// Patterns are only checked at the emtpy path at the moment\n\thasEffectsOnInteractionAtPath(\n\t\t_path: ObjectPath,\n\t\tinteraction: NodeInteractionAssigned,\n\t\tcontext: HasEffectsContext\n\t): boolean {\n\t\tfor (const element of this.elements) {\n\t\t\tif (element?.hasEffectsOnInteractionAtPath(EMPTY_PATH, interaction, context)) return true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tmarkDeclarationReached(): void {\n\t\tfor (const element of this.elements) {\n\t\t\telement?.markDeclarationReached();\n\t\t}\n\t}\n}\n","import type MagicString from 'magic-string';\nimport { BLANK } from '../../utils/blank';\nimport {\n\tfindFirstOccurrenceOutsideComment,\n\tfindNonWhiteSpace,\n\ttype NodeRenderOptions,\n\tremoveLineBreaks,\n\ttype RenderOptions\n} from '../../utils/renderHelpers';\nimport {\n\trenderSystemExportExpression,\n\trenderSystemExportFunction,\n\trenderSystemExportSequenceAfterExpression\n} from '../../utils/systemJsRendering';\nimport {\n\tcreateHasEffectsContext,\n\ttype HasEffectsContext,\n\ttype InclusionContext\n} from '../ExecutionContext';\nimport { NodeInteraction } from '../NodeInteractions';\nimport { EMPTY_PATH, type ObjectPath, UNKNOWN_PATH } from '../utils/PathTracker';\nimport type Variable from '../variables/Variable';\nimport Identifier from './Identifier';\nimport * as NodeType from './NodeType';\nimport ObjectPattern from './ObjectPattern';\nimport { type ExpressionNode, type IncludeChildren, NodeBase } from './shared/Node';\nimport type { PatternNode } from './shared/Pattern';\n\nexport default class AssignmentExpression extends NodeBase {\n\tdeclare left: ExpressionNode | PatternNode;\n\tdeclare operator:\n\t\t| '='\n\t\t| '+='\n\t\t| '-='\n\t\t| '*='\n\t\t| '/='\n\t\t| '%='\n\t\t| '<<='\n\t\t| '>>='\n\t\t| '>>>='\n\t\t| '|='\n\t\t| '^='\n\t\t| '&='\n\t\t| '**=';\n\tdeclare right: ExpressionNode;\n\tdeclare type: NodeType.tAssignmentExpression;\n\n\thasEffects(context: HasEffectsContext): boolean {\n\t\tconst { deoptimized, left, right } = this;\n\t\tif (!deoptimized) this.applyDeoptimizations();\n\t\t// MemberExpressions do not access the property before assignments if the\n\t\t// operator is '='.\n\t\treturn (\n\t\t\tright.hasEffects(context) || left.hasEffectsAsAssignmentTarget(context, this.operator !== '=')\n\t\t);\n\t}\n\n\thasEffectsOnInteractionAtPath(\n\t\tpath: ObjectPath,\n\t\tinteraction: NodeInteraction,\n\t\tcontext: HasEffectsContext\n\t): boolean {\n\t\treturn this.right.hasEffectsOnInteractionAtPath(path, interaction, context);\n\t}\n\n\tinclude(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void {\n\t\tconst { deoptimized, left, right, operator } = this;\n\t\tif (!deoptimized) this.applyDeoptimizations();\n\t\tthis.included = true;\n\t\tif (\n\t\t\tincludeChildrenRecursively ||\n\t\t\toperator !== '=' ||\n\t\t\tleft.included ||\n\t\t\tleft.hasEffectsAsAssignmentTarget(createHasEffectsContext(), false)\n\t\t) {\n\t\t\tleft.includeAsAssignmentTarget(context, includeChildrenRecursively, operator !== '=');\n\t\t}\n\t\tright.include(context, includeChildrenRecursively);\n\t}\n\n\tinitialise(): void {\n\t\tthis.left.setAssignedValue(this.right);\n\t}\n\n\trender(\n\t\tcode: MagicString,\n\t\toptions: RenderOptions,\n\t\t{ preventASI, renderedParentType, renderedSurroundingElement }: NodeRenderOptions = BLANK\n\t): void {\n\t\tconst { left, right, start, end, parent } = this;\n\t\tif (left.included) {\n\t\t\tleft.render(code, options);\n\t\t\tright.render(code, options);\n\t\t} else {\n\t\t\tconst inclusionStart = findNonWhiteSpace(\n\t\t\t\tcode.original,\n\t\t\t\tfindFirstOccurrenceOutsideComment(code.original, '=', left.end) + 1\n\t\t\t);\n\t\t\tcode.remove(start, inclusionStart);\n\t\t\tif (preventASI) {\n\t\t\t\tremoveLineBreaks(code, inclusionStart, right.start);\n\t\t\t}\n\t\t\tright.render(code, options, {\n\t\t\t\trenderedParentType: renderedParentType || parent.type,\n\t\t\t\trenderedSurroundingElement: renderedSurroundingElement || parent.type\n\t\t\t});\n\t\t}\n\t\tif (options.format === 'system') {\n\t\t\tif (left instanceof Identifier) {\n\t\t\t\tconst variable = left.variable!;\n\t\t\t\tconst exportNames = options.exportNamesByVariable.get(variable);\n\t\t\t\tif (exportNames) {\n\t\t\t\t\tif (exportNames.length === 1) {\n\t\t\t\t\t\trenderSystemExportExpression(variable, start, end, code, options);\n\t\t\t\t\t} else {\n\t\t\t\t\t\trenderSystemExportSequenceAfterExpression(\n\t\t\t\t\t\t\tvariable,\n\t\t\t\t\t\t\tstart,\n\t\t\t\t\t\t\tend,\n\t\t\t\t\t\t\tparent.type !== NodeType.ExpressionStatement,\n\t\t\t\t\t\t\tcode,\n\t\t\t\t\t\t\toptions\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconst systemPatternExports: Variable[] = [];\n\t\t\t\tleft.addExportedVariables(systemPatternExports, options.exportNamesByVariable);\n\t\t\t\tif (systemPatternExports.length > 0) {\n\t\t\t\t\trenderSystemExportFunction(\n\t\t\t\t\t\tsystemPatternExports,\n\t\t\t\t\t\tstart,\n\t\t\t\t\t\tend,\n\t\t\t\t\t\trenderedSurroundingElement === NodeType.ExpressionStatement,\n\t\t\t\t\t\tcode,\n\t\t\t\t\t\toptions\n\t\t\t\t\t);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (\n\t\t\tleft.included &&\n\t\t\tleft instanceof ObjectPattern &&\n\t\t\t(renderedSurroundingElement === NodeType.ExpressionStatement ||\n\t\t\t\trenderedSurroundingElement === NodeType.ArrowFunctionExpression)\n\t\t) {\n\t\t\tcode.appendRight(start, '(');\n\t\t\tcode.prependLeft(end, ')');\n\t\t}\n\t}\n\n\tprotected applyDeoptimizations(): void {\n\t\tthis.deoptimized = true;\n\t\tthis.left.deoptimizePath(EMPTY_PATH);\n\t\tthis.right.deoptimizePath(UNKNOWN_PATH);\n\t\tthis.context.requestTreeshakingPass();\n\t}\n}\n","import type MagicString from 'magic-string';\nimport { BLANK } from '../../utils/blank';\nimport type { NodeRenderOptions, RenderOptions } from '../../utils/renderHelpers';\nimport type { HasEffectsContext } from '../ExecutionContext';\nimport { NodeInteractionAssigned } from '../NodeInteractions';\nimport { EMPTY_PATH, type ObjectPath, UNKNOWN_PATH } from '../utils/PathTracker';\nimport type LocalVariable from '../variables/LocalVariable';\nimport type Variable from '../variables/Variable';\nimport type * as NodeType from './NodeType';\nimport type { ExpressionEntity } from './shared/Expression';\nimport { type ExpressionNode, NodeBase } from './shared/Node';\nimport type { PatternNode } from './shared/Pattern';\n\nexport default class AssignmentPattern extends NodeBase implements PatternNode {\n\tdeclare left: PatternNode;\n\tdeclare right: ExpressionNode;\n\tdeclare type: NodeType.tAssignmentPattern;\n\n\taddExportedVariables(\n\t\tvariables: readonly Variable[],\n\t\texportNamesByVariable: ReadonlyMap\n\t): void {\n\t\tthis.left.addExportedVariables(variables, exportNamesByVariable);\n\t}\n\n\tdeclare(kind: string, init: ExpressionEntity): LocalVariable[] {\n\t\treturn this.left.declare(kind, init);\n\t}\n\n\tdeoptimizePath(path: ObjectPath): void {\n\t\tpath.length === 0 && this.left.deoptimizePath(path);\n\t}\n\n\thasEffectsOnInteractionAtPath(\n\t\tpath: ObjectPath,\n\t\tinteraction: NodeInteractionAssigned,\n\t\tcontext: HasEffectsContext\n\t): boolean {\n\t\treturn (\n\t\t\tpath.length > 0 || this.left.hasEffectsOnInteractionAtPath(EMPTY_PATH, interaction, context)\n\t\t);\n\t}\n\n\tmarkDeclarationReached(): void {\n\t\tthis.left.markDeclarationReached();\n\t}\n\n\trender(\n\t\tcode: MagicString,\n\t\toptions: RenderOptions,\n\t\t{ isShorthandProperty }: NodeRenderOptions = BLANK\n\t): void {\n\t\tthis.left.render(code, options, { isShorthandProperty });\n\t\tthis.right.render(code, options);\n\t}\n\n\tprotected applyDeoptimizations(): void {\n\t\tthis.deoptimized = true;\n\t\tthis.left.deoptimizePath(EMPTY_PATH);\n\t\tthis.right.deoptimizePath(UNKNOWN_PATH);\n\t\tthis.context.requestTreeshakingPass();\n\t}\n}\n","import type { InclusionContext } from '../ExecutionContext';\nimport ArrowFunctionExpression from './ArrowFunctionExpression';\nimport type * as NodeType from './NodeType';\nimport FunctionNode from './shared/FunctionNode';\nimport { type ExpressionNode, type IncludeChildren, type Node, NodeBase } from './shared/Node';\n\nexport default class AwaitExpression extends NodeBase {\n\tdeclare argument: ExpressionNode;\n\tdeclare type: NodeType.tAwaitExpression;\n\n\thasEffects(): boolean {\n\t\tif (!this.deoptimized) this.applyDeoptimizations();\n\t\treturn true;\n\t}\n\n\tinclude(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void {\n\t\tif (!this.deoptimized) this.applyDeoptimizations();\n\t\tif (!this.included) {\n\t\t\tthis.included = true;\n\t\t\tcheckTopLevelAwait: if (!this.context.usesTopLevelAwait) {\n\t\t\t\tlet parent = this.parent;\n\t\t\t\tdo {\n\t\t\t\t\tif (parent instanceof FunctionNode || parent instanceof ArrowFunctionExpression)\n\t\t\t\t\t\tbreak checkTopLevelAwait;\n\t\t\t\t} while ((parent = (parent as Node).parent as Node));\n\t\t\t\tthis.context.usesTopLevelAwait = true;\n\t\t\t}\n\t\t}\n\t\tthis.argument.include(context, includeChildrenRecursively);\n\t}\n}\n","import {\n\tBROKEN_FLOW_BREAK_CONTINUE,\n\tBROKEN_FLOW_ERROR_RETURN_LABEL,\n\ttype HasEffectsContext,\n\ttype InclusionContext\n} from '../ExecutionContext';\nimport type Identifier from './Identifier';\nimport type * as NodeType from './NodeType';\nimport { StatementBase } from './shared/Node';\n\nexport default class BreakStatement extends StatementBase {\n\tdeclare label: Identifier | null;\n\tdeclare type: NodeType.tBreakStatement;\n\n\thasEffects(context: HasEffectsContext): boolean {\n\t\tif (this.label) {\n\t\t\tif (!context.ignore.labels.has(this.label.name)) return true;\n\t\t\tcontext.includedLabels.add(this.label.name);\n\t\t\tcontext.brokenFlow = BROKEN_FLOW_ERROR_RETURN_LABEL;\n\t\t} else {\n\t\t\tif (!context.ignore.breaks) return true;\n\t\t\tcontext.brokenFlow = BROKEN_FLOW_BREAK_CONTINUE;\n\t\t}\n\t\treturn false;\n\t}\n\n\tinclude(context: InclusionContext): void {\n\t\tthis.included = true;\n\t\tif (this.label) {\n\t\t\tthis.label.include();\n\t\t\tcontext.includedLabels.add(this.label.name);\n\t\t}\n\t\tcontext.brokenFlow = this.label ? BROKEN_FLOW_ERROR_RETURN_LABEL : BROKEN_FLOW_BREAK_CONTINUE;\n\t}\n}\n","import type MagicString from 'magic-string';\nimport type { NormalizedTreeshakingOptions } from '../../rollup/types';\nimport { BLANK } from '../../utils/blank';\nimport { renderCallArguments } from '../../utils/renderCallArguments';\nimport { type NodeRenderOptions, type RenderOptions } from '../../utils/renderHelpers';\nimport type { DeoptimizableEntity } from '../DeoptimizableEntity';\nimport type { HasEffectsContext, InclusionContext } from '../ExecutionContext';\nimport { INTERACTION_CALLED, NodeInteractionWithThisArg } from '../NodeInteractions';\nimport {\n\tEMPTY_PATH,\n\ttype PathTracker,\n\tSHARED_RECURSION_TRACKER,\n\tUNKNOWN_PATH\n} from '../utils/PathTracker';\nimport Identifier from './Identifier';\nimport MemberExpression from './MemberExpression';\nimport type * as NodeType from './NodeType';\nimport type SpreadElement from './SpreadElement';\nimport type Super from './Super';\nimport CallExpressionBase from './shared/CallExpressionBase';\nimport { type ExpressionEntity, UNKNOWN_EXPRESSION } from './shared/Expression';\nimport { type ExpressionNode, INCLUDE_PARAMETERS, type IncludeChildren } from './shared/Node';\n\nexport default class CallExpression extends CallExpressionBase implements DeoptimizableEntity {\n\tdeclare arguments: (ExpressionNode | SpreadElement)[];\n\tdeclare callee: ExpressionNode | Super;\n\tdeclare optional: boolean;\n\tdeclare type: NodeType.tCallExpression;\n\n\tbind(): void {\n\t\tsuper.bind();\n\t\tif (this.callee instanceof Identifier) {\n\t\t\tconst variable = this.scope.findVariable(this.callee.name);\n\n\t\t\tif (variable.isNamespace) {\n\t\t\t\tthis.context.warn(\n\t\t\t\t\t{\n\t\t\t\t\t\tcode: 'CANNOT_CALL_NAMESPACE',\n\t\t\t\t\t\tmessage: `Cannot call a namespace ('${this.callee.name}')`\n\t\t\t\t\t},\n\t\t\t\t\tthis.start\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (this.callee.name === 'eval') {\n\t\t\t\tthis.context.warn(\n\t\t\t\t\t{\n\t\t\t\t\t\tcode: 'EVAL',\n\t\t\t\t\t\tmessage: `Use of eval is strongly discouraged, as it poses security risks and may cause issues with minification`,\n\t\t\t\t\t\turl: 'https://rollupjs.org/guide/en/#avoiding-eval'\n\t\t\t\t\t},\n\t\t\t\t\tthis.start\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tthis.interaction = {\n\t\t\targs: this.arguments,\n\t\t\tthisArg:\n\t\t\t\tthis.callee instanceof MemberExpression && !this.callee.variable\n\t\t\t\t\t? this.callee.object\n\t\t\t\t\t: null,\n\t\t\ttype: INTERACTION_CALLED,\n\t\t\twithNew: false\n\t\t};\n\t}\n\n\thasEffects(context: HasEffectsContext): boolean {\n\t\ttry {\n\t\t\tfor (const argument of this.arguments) {\n\t\t\t\tif (argument.hasEffects(context)) return true;\n\t\t\t}\n\t\t\tif (\n\t\t\t\t(this.context.options.treeshake as NormalizedTreeshakingOptions).annotations &&\n\t\t\t\tthis.annotations\n\t\t\t)\n\t\t\t\treturn false;\n\t\t\treturn (\n\t\t\t\tthis.callee.hasEffects(context) ||\n\t\t\t\tthis.callee.hasEffectsOnInteractionAtPath(EMPTY_PATH, this.interaction, context)\n\t\t\t);\n\t\t} finally {\n\t\t\tif (!this.deoptimized) this.applyDeoptimizations();\n\t\t}\n\t}\n\n\tinclude(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void {\n\t\tif (!this.deoptimized) this.applyDeoptimizations();\n\t\tif (includeChildrenRecursively) {\n\t\t\tsuper.include(context, includeChildrenRecursively);\n\t\t\tif (\n\t\t\t\tincludeChildrenRecursively === INCLUDE_PARAMETERS &&\n\t\t\t\tthis.callee instanceof Identifier &&\n\t\t\t\tthis.callee.variable\n\t\t\t) {\n\t\t\t\tthis.callee.variable.markCalledFromTryStatement();\n\t\t\t}\n\t\t} else {\n\t\t\tthis.included = true;\n\t\t\tthis.callee.include(context, false);\n\t\t}\n\t\tthis.callee.includeCallArguments(context, this.arguments);\n\t}\n\n\trender(\n\t\tcode: MagicString,\n\t\toptions: RenderOptions,\n\t\t{ renderedSurroundingElement }: NodeRenderOptions = BLANK\n\t): void {\n\t\tthis.callee.render(code, options, {\n\t\t\tisCalleeOfRenderedParent: true,\n\t\t\trenderedSurroundingElement\n\t\t});\n\t\trenderCallArguments(code, options, this);\n\t}\n\n\tprotected applyDeoptimizations(): void {\n\t\tthis.deoptimized = true;\n\t\tif (this.interaction.thisArg) {\n\t\t\tthis.callee.deoptimizeThisOnInteractionAtPath(\n\t\t\t\tthis.interaction as NodeInteractionWithThisArg,\n\t\t\t\tEMPTY_PATH,\n\t\t\t\tSHARED_RECURSION_TRACKER\n\t\t\t);\n\t\t}\n\t\tfor (const argument of this.arguments) {\n\t\t\t// This will make sure all properties of parameters behave as \"unknown\"\n\t\t\targument.deoptimizePath(UNKNOWN_PATH);\n\t\t}\n\t\tthis.context.requestTreeshakingPass();\n\t}\n\n\tprotected getReturnExpression(\n\t\trecursionTracker: PathTracker = SHARED_RECURSION_TRACKER\n\t): ExpressionEntity {\n\t\tif (this.returnExpression === null) {\n\t\t\tthis.returnExpression = UNKNOWN_EXPRESSION;\n\t\t\treturn (this.returnExpression = this.callee.getReturnExpressionWhenCalledAtPath(\n\t\t\t\tEMPTY_PATH,\n\t\t\t\tthis.interaction,\n\t\t\t\trecursionTracker,\n\t\t\t\tthis\n\t\t\t));\n\t\t}\n\t\treturn this.returnExpression;\n\t}\n}\n","import CatchScope from '../scopes/CatchScope';\nimport type Scope from '../scopes/Scope';\nimport type BlockStatement from './BlockStatement';\nimport type * as NodeType from './NodeType';\nimport { UNKNOWN_EXPRESSION } from './shared/Expression';\nimport { type GenericEsTreeNode, NodeBase } from './shared/Node';\nimport type { PatternNode } from './shared/Pattern';\n\nexport default class CatchClause extends NodeBase {\n\tdeclare body: BlockStatement;\n\tdeclare param: PatternNode | null;\n\tdeclare preventChildBlockScope: true;\n\tdeclare scope: CatchScope;\n\tdeclare type: NodeType.tCatchClause;\n\n\tcreateScope(parentScope: Scope): void {\n\t\tthis.scope = new CatchScope(parentScope, this.context);\n\t}\n\n\tparseNode(esTreeNode: GenericEsTreeNode): void {\n\t\t// Parameters need to be declared first as the logic is that initializers\n\t\t// of hoisted body variables are associated with parameters of the same\n\t\t// name instead of the variable\n\t\tconst { param } = esTreeNode;\n\t\tif (param) {\n\t\t\t(this.param as GenericEsTreeNode) = new (this.context.getNodeConstructor(param.type))(\n\t\t\t\tparam,\n\t\t\t\tthis,\n\t\t\t\tthis.scope\n\t\t\t);\n\t\t\tthis.param!.declare('parameter', UNKNOWN_EXPRESSION);\n\t\t}\n\t\tsuper.parseNode(esTreeNode);\n\t}\n}\n","import type CallExpression from './CallExpression';\nimport type MemberExpression from './MemberExpression';\nimport type * as NodeType from './NodeType';\nimport { NodeBase } from './shared/Node';\n\nexport default class ChainExpression extends NodeBase {\n\tdeclare expression: CallExpression | MemberExpression;\n\tdeclare type: NodeType.tChainExpression;\n}\n","import type { InclusionContext } from '../ExecutionContext';\nimport ClassBodyScope from '../scopes/ClassBodyScope';\nimport type Scope from '../scopes/Scope';\nimport type MethodDefinition from './MethodDefinition';\nimport type * as NodeType from './NodeType';\nimport type PropertyDefinition from './PropertyDefinition';\nimport type ClassNode from './shared/ClassNode';\nimport { type GenericEsTreeNode, type IncludeChildren, NodeBase } from './shared/Node';\n\nexport default class ClassBody extends NodeBase {\n\tdeclare body: (MethodDefinition | PropertyDefinition)[];\n\tdeclare scope: ClassBodyScope;\n\tdeclare type: NodeType.tClassBody;\n\n\tcreateScope(parentScope: Scope): void {\n\t\tthis.scope = new ClassBodyScope(parentScope, this.parent as ClassNode, this.context);\n\t}\n\n\tinclude(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void {\n\t\tthis.included = true;\n\t\tthis.context.includeVariableInModule(this.scope.thisVariable);\n\t\tfor (const definition of this.body) {\n\t\t\tdefinition.include(context, includeChildrenRecursively);\n\t\t}\n\t}\n\n\tparseNode(esTreeNode: GenericEsTreeNode): void {\n\t\tconst body: NodeBase[] = (this.body = []);\n\t\tfor (const definition of esTreeNode.body) {\n\t\t\tbody.push(\n\t\t\t\tnew (this.context.getNodeConstructor(definition.type))(\n\t\t\t\t\tdefinition,\n\t\t\t\t\tthis,\n\t\t\t\t\tdefinition.static ? this.scope : this.scope.instanceScope\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\tsuper.parseNode(esTreeNode);\n\t}\n\n\tprotected applyDeoptimizations() {}\n}\n","import type MagicString from 'magic-string';\nimport { BLANK } from '../../utils/blank';\nimport type { NodeRenderOptions, RenderOptions } from '../../utils/renderHelpers';\nimport * as NodeType from './NodeType';\nimport ClassNode from './shared/ClassNode';\n\nexport default class ClassExpression extends ClassNode {\n\tdeclare type: NodeType.tClassExpression;\n\n\trender(\n\t\tcode: MagicString,\n\t\toptions: RenderOptions,\n\t\t{ renderedSurroundingElement }: NodeRenderOptions = BLANK\n\t): void {\n\t\tsuper.render(code, options);\n\t\tif (renderedSurroundingElement === NodeType.ExpressionStatement) {\n\t\t\tcode.appendRight(this.start, '(');\n\t\t\tcode.prependLeft(this.end, ')');\n\t\t}\n\t}\n}\n","import MagicString from 'magic-string';\nimport { BLANK } from '../../utils/blank';\nimport {\n\tfindFirstOccurrenceOutsideComment,\n\tfindNonWhiteSpace,\n\tNodeRenderOptions,\n\tremoveLineBreaks,\n\tRenderOptions\n} from '../../utils/renderHelpers';\nimport { removeAnnotations } from '../../utils/treeshakeNode';\nimport { DeoptimizableEntity } from '../DeoptimizableEntity';\nimport { HasEffectsContext, InclusionContext } from '../ExecutionContext';\nimport {\n\tNodeInteraction,\n\tNodeInteractionCalled,\n\tNodeInteractionWithThisArg\n} from '../NodeInteractions';\nimport {\n\tEMPTY_PATH,\n\tObjectPath,\n\tPathTracker,\n\tSHARED_RECURSION_TRACKER,\n\tUNKNOWN_PATH\n} from '../utils/PathTracker';\nimport type * as NodeType from './NodeType';\nimport SpreadElement from './SpreadElement';\nimport { ExpressionEntity, LiteralValueOrUnknown, UnknownValue } from './shared/Expression';\nimport { MultiExpression } from './shared/MultiExpression';\nimport { ExpressionNode, IncludeChildren, NodeBase } from './shared/Node';\n\nexport default class ConditionalExpression extends NodeBase implements DeoptimizableEntity {\n\tdeclare alternate: ExpressionNode;\n\tdeclare consequent: ExpressionNode;\n\tdeclare test: ExpressionNode;\n\tdeclare type: NodeType.tConditionalExpression;\n\n\tprivate expressionsToBeDeoptimized: DeoptimizableEntity[] = [];\n\tprivate isBranchResolutionAnalysed = false;\n\tprivate usedBranch: ExpressionNode | null = null;\n\n\tdeoptimizeCache(): void {\n\t\tif (this.usedBranch !== null) {\n\t\t\tconst unusedBranch = this.usedBranch === this.consequent ? this.alternate : this.consequent;\n\t\t\tthis.usedBranch = null;\n\t\t\tunusedBranch.deoptimizePath(UNKNOWN_PATH);\n\t\t\tfor (const expression of this.expressionsToBeDeoptimized) {\n\t\t\t\texpression.deoptimizeCache();\n\t\t\t}\n\t\t}\n\t}\n\n\tdeoptimizePath(path: ObjectPath): void {\n\t\tconst usedBranch = this.getUsedBranch();\n\t\tif (!usedBranch) {\n\t\t\tthis.consequent.deoptimizePath(path);\n\t\t\tthis.alternate.deoptimizePath(path);\n\t\t} else {\n\t\t\tusedBranch.deoptimizePath(path);\n\t\t}\n\t}\n\n\tdeoptimizeThisOnInteractionAtPath(\n\t\tinteraction: NodeInteractionWithThisArg,\n\t\tpath: ObjectPath,\n\t\trecursionTracker: PathTracker\n\t): void {\n\t\tthis.consequent.deoptimizeThisOnInteractionAtPath(interaction, path, recursionTracker);\n\t\tthis.alternate.deoptimizeThisOnInteractionAtPath(interaction, path, recursionTracker);\n\t}\n\n\tgetLiteralValueAtPath(\n\t\tpath: ObjectPath,\n\t\trecursionTracker: PathTracker,\n\t\torigin: DeoptimizableEntity\n\t): LiteralValueOrUnknown {\n\t\tconst usedBranch = this.getUsedBranch();\n\t\tif (!usedBranch) return UnknownValue;\n\t\tthis.expressionsToBeDeoptimized.push(origin);\n\t\treturn usedBranch.getLiteralValueAtPath(path, recursionTracker, origin);\n\t}\n\n\tgetReturnExpressionWhenCalledAtPath(\n\t\tpath: ObjectPath,\n\t\tinteraction: NodeInteractionCalled,\n\t\trecursionTracker: PathTracker,\n\t\torigin: DeoptimizableEntity\n\t): ExpressionEntity {\n\t\tconst usedBranch = this.getUsedBranch();\n\t\tif (!usedBranch)\n\t\t\treturn new MultiExpression([\n\t\t\t\tthis.consequent.getReturnExpressionWhenCalledAtPath(\n\t\t\t\t\tpath,\n\t\t\t\t\tinteraction,\n\t\t\t\t\trecursionTracker,\n\t\t\t\t\torigin\n\t\t\t\t),\n\t\t\t\tthis.alternate.getReturnExpressionWhenCalledAtPath(\n\t\t\t\t\tpath,\n\t\t\t\t\tinteraction,\n\t\t\t\t\trecursionTracker,\n\t\t\t\t\torigin\n\t\t\t\t)\n\t\t\t]);\n\t\tthis.expressionsToBeDeoptimized.push(origin);\n\t\treturn usedBranch.getReturnExpressionWhenCalledAtPath(\n\t\t\tpath,\n\t\t\tinteraction,\n\t\t\trecursionTracker,\n\t\t\torigin\n\t\t);\n\t}\n\n\thasEffects(context: HasEffectsContext): boolean {\n\t\tif (this.test.hasEffects(context)) return true;\n\t\tconst usedBranch = this.getUsedBranch();\n\t\tif (!usedBranch) {\n\t\t\treturn this.consequent.hasEffects(context) || this.alternate.hasEffects(context);\n\t\t}\n\t\treturn usedBranch.hasEffects(context);\n\t}\n\n\thasEffectsOnInteractionAtPath(\n\t\tpath: ObjectPath,\n\t\tinteraction: NodeInteraction,\n\t\tcontext: HasEffectsContext\n\t): boolean {\n\t\tconst usedBranch = this.getUsedBranch();\n\t\tif (!usedBranch) {\n\t\t\treturn (\n\t\t\t\tthis.consequent.hasEffectsOnInteractionAtPath(path, interaction, context) ||\n\t\t\t\tthis.alternate.hasEffectsOnInteractionAtPath(path, interaction, context)\n\t\t\t);\n\t\t}\n\t\treturn usedBranch.hasEffectsOnInteractionAtPath(path, interaction, context);\n\t}\n\n\tinclude(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void {\n\t\tthis.included = true;\n\t\tconst usedBranch = this.getUsedBranch();\n\t\tif (includeChildrenRecursively || this.test.shouldBeIncluded(context) || usedBranch === null) {\n\t\t\tthis.test.include(context, includeChildrenRecursively);\n\t\t\tthis.consequent.include(context, includeChildrenRecursively);\n\t\t\tthis.alternate.include(context, includeChildrenRecursively);\n\t\t} else {\n\t\t\tusedBranch.include(context, includeChildrenRecursively);\n\t\t}\n\t}\n\n\tincludeCallArguments(\n\t\tcontext: InclusionContext,\n\t\targs: readonly (ExpressionEntity | SpreadElement)[]\n\t): void {\n\t\tconst usedBranch = this.getUsedBranch();\n\t\tif (!usedBranch) {\n\t\t\tthis.consequent.includeCallArguments(context, args);\n\t\t\tthis.alternate.includeCallArguments(context, args);\n\t\t} else {\n\t\t\tusedBranch.includeCallArguments(context, args);\n\t\t}\n\t}\n\n\trender(\n\t\tcode: MagicString,\n\t\toptions: RenderOptions,\n\t\t{\n\t\t\tisCalleeOfRenderedParent,\n\t\t\tpreventASI,\n\t\t\trenderedParentType,\n\t\t\trenderedSurroundingElement\n\t\t}: NodeRenderOptions = BLANK\n\t): void {\n\t\tconst usedBranch = this.getUsedBranch();\n\t\tif (!this.test.included) {\n\t\t\tconst colonPos = findFirstOccurrenceOutsideComment(code.original, ':', this.consequent.end);\n\t\t\tconst inclusionStart = findNonWhiteSpace(\n\t\t\t\tcode.original,\n\t\t\t\t(this.consequent.included\n\t\t\t\t\t? findFirstOccurrenceOutsideComment(code.original, '?', this.test.end)\n\t\t\t\t\t: colonPos) + 1\n\t\t\t);\n\t\t\tif (preventASI) {\n\t\t\t\tremoveLineBreaks(code, inclusionStart, usedBranch!.start);\n\t\t\t}\n\t\t\tcode.remove(this.start, inclusionStart);\n\t\t\tif (this.consequent.included) {\n\t\t\t\tcode.remove(colonPos, this.end);\n\t\t\t}\n\t\t\tremoveAnnotations(this, code);\n\t\t\tusedBranch!.render(code, options, {\n\t\t\t\tisCalleeOfRenderedParent,\n\t\t\t\tpreventASI: true,\n\t\t\t\trenderedParentType: renderedParentType || this.parent.type,\n\t\t\t\trenderedSurroundingElement: renderedSurroundingElement || this.parent.type\n\t\t\t});\n\t\t} else {\n\t\t\tthis.test.render(code, options, { renderedSurroundingElement });\n\t\t\tthis.consequent.render(code, options);\n\t\t\tthis.alternate.render(code, options);\n\t\t}\n\t}\n\n\tprivate getUsedBranch() {\n\t\tif (this.isBranchResolutionAnalysed) {\n\t\t\treturn this.usedBranch;\n\t\t}\n\t\tthis.isBranchResolutionAnalysed = true;\n\t\tconst testValue = this.test.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, this);\n\t\treturn typeof testValue === 'symbol'\n\t\t\t? null\n\t\t\t: (this.usedBranch = testValue ? this.consequent : this.alternate);\n\t}\n}\n","import {\n\tBROKEN_FLOW_BREAK_CONTINUE,\n\tBROKEN_FLOW_ERROR_RETURN_LABEL,\n\ttype HasEffectsContext,\n\ttype InclusionContext\n} from '../ExecutionContext';\nimport type Identifier from './Identifier';\nimport type * as NodeType from './NodeType';\nimport { StatementBase } from './shared/Node';\n\nexport default class ContinueStatement extends StatementBase {\n\tdeclare label: Identifier | null;\n\tdeclare type: NodeType.tContinueStatement;\n\n\thasEffects(context: HasEffectsContext): boolean {\n\t\tif (this.label) {\n\t\t\tif (!context.ignore.labels.has(this.label.name)) return true;\n\t\t\tcontext.includedLabels.add(this.label.name);\n\t\t\tcontext.brokenFlow = BROKEN_FLOW_ERROR_RETURN_LABEL;\n\t\t} else {\n\t\t\tif (!context.ignore.continues) return true;\n\t\t\tcontext.brokenFlow = BROKEN_FLOW_BREAK_CONTINUE;\n\t\t}\n\t\treturn false;\n\t}\n\n\tinclude(context: InclusionContext): void {\n\t\tthis.included = true;\n\t\tif (this.label) {\n\t\t\tthis.label.include();\n\t\t\tcontext.includedLabels.add(this.label.name);\n\t\t}\n\t\tcontext.brokenFlow = this.label ? BROKEN_FLOW_ERROR_RETURN_LABEL : BROKEN_FLOW_BREAK_CONTINUE;\n\t}\n}\n","import type { HasEffectsContext, InclusionContext } from '../ExecutionContext';\nimport type * as NodeType from './NodeType';\nimport {\n\ttype ExpressionNode,\n\ttype IncludeChildren,\n\tStatementBase,\n\ttype StatementNode\n} from './shared/Node';\n\nexport default class DoWhileStatement extends StatementBase {\n\tdeclare body: StatementNode;\n\tdeclare test: ExpressionNode;\n\tdeclare type: NodeType.tDoWhileStatement;\n\n\thasEffects(context: HasEffectsContext): boolean {\n\t\tif (this.test.hasEffects(context)) return true;\n\t\tconst {\n\t\t\tbrokenFlow,\n\t\t\tignore: { breaks, continues }\n\t\t} = context;\n\t\tcontext.ignore.breaks = true;\n\t\tcontext.ignore.continues = true;\n\t\tif (this.body.hasEffects(context)) return true;\n\t\tcontext.ignore.breaks = breaks;\n\t\tcontext.ignore.continues = continues;\n\t\tcontext.brokenFlow = brokenFlow;\n\t\treturn false;\n\t}\n\n\tinclude(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void {\n\t\tthis.included = true;\n\t\tthis.test.include(context, includeChildrenRecursively);\n\t\tconst { brokenFlow } = context;\n\t\tthis.body.include(context, includeChildrenRecursively, { asSingleStatement: true });\n\t\tcontext.brokenFlow = brokenFlow;\n\t}\n}\n","import type * as NodeType from './NodeType';\nimport { StatementBase } from './shared/Node';\n\nexport default class EmptyStatement extends StatementBase {\n\tdeclare type: NodeType.tEmptyStatement;\n\n\thasEffects(): boolean {\n\t\treturn false;\n\t}\n}\n","import type Identifier from './Identifier';\nimport type * as NodeType from './NodeType';\nimport { NodeBase } from './shared/Node';\n\nexport default class ExportSpecifier extends NodeBase {\n\tdeclare exported: Identifier;\n\tdeclare local: Identifier;\n\tdeclare type: NodeType.tExportSpecifier;\n\n\tprotected applyDeoptimizations() {}\n}\n","import type MagicString from 'magic-string';\nimport { NO_SEMICOLON, type RenderOptions } from '../../utils/renderHelpers';\nimport type { HasEffectsContext, InclusionContext } from '../ExecutionContext';\nimport BlockScope from '../scopes/BlockScope';\nimport type Scope from '../scopes/Scope';\nimport { EMPTY_PATH } from '../utils/PathTracker';\nimport MemberExpression from './MemberExpression';\nimport type * as NodeType from './NodeType';\nimport type VariableDeclaration from './VariableDeclaration';\nimport { UNKNOWN_EXPRESSION } from './shared/Expression';\nimport {\n\ttype ExpressionNode,\n\ttype IncludeChildren,\n\tStatementBase,\n\ttype StatementNode\n} from './shared/Node';\nimport type { PatternNode } from './shared/Pattern';\n\nexport default class ForInStatement extends StatementBase {\n\tdeclare body: StatementNode;\n\tdeclare left: VariableDeclaration | PatternNode | MemberExpression;\n\tdeclare right: ExpressionNode;\n\tdeclare type: NodeType.tForInStatement;\n\n\tcreateScope(parentScope: Scope): void {\n\t\tthis.scope = new BlockScope(parentScope);\n\t}\n\n\thasEffects(context: HasEffectsContext): boolean {\n\t\tconst { deoptimized, left, right } = this;\n\t\tif (!deoptimized) this.applyDeoptimizations();\n\t\tif (left.hasEffectsAsAssignmentTarget(context, false) || right.hasEffects(context)) return true;\n\t\tconst {\n\t\t\tbrokenFlow,\n\t\t\tignore: { breaks, continues }\n\t\t} = context;\n\t\tcontext.ignore.breaks = true;\n\t\tcontext.ignore.continues = true;\n\t\tif (this.body.hasEffects(context)) return true;\n\t\tcontext.ignore.breaks = breaks;\n\t\tcontext.ignore.continues = continues;\n\t\tcontext.brokenFlow = brokenFlow;\n\t\treturn false;\n\t}\n\n\tinclude(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void {\n\t\tconst { body, deoptimized, left, right } = this;\n\t\tif (!deoptimized) this.applyDeoptimizations();\n\t\tthis.included = true;\n\t\tleft.includeAsAssignmentTarget(context, includeChildrenRecursively || true, false);\n\t\tright.include(context, includeChildrenRecursively);\n\t\tconst { brokenFlow } = context;\n\t\tbody.include(context, includeChildrenRecursively, { asSingleStatement: true });\n\t\tcontext.brokenFlow = brokenFlow;\n\t}\n\n\tinitialise() {\n\t\tthis.left.setAssignedValue(UNKNOWN_EXPRESSION);\n\t}\n\n\trender(code: MagicString, options: RenderOptions): void {\n\t\tthis.left.render(code, options, NO_SEMICOLON);\n\t\tthis.right.render(code, options, NO_SEMICOLON);\n\t\t// handle no space between \"in\" and the right side\n\t\tif (code.original.charCodeAt(this.right.start - 1) === 110 /* n */) {\n\t\t\tcode.prependLeft(this.right.start, ' ');\n\t\t}\n\t\tthis.body.render(code, options);\n\t}\n\n\tprotected applyDeoptimizations(): void {\n\t\tthis.deoptimized = true;\n\t\tthis.left.deoptimizePath(EMPTY_PATH);\n\t\tthis.context.requestTreeshakingPass();\n\t}\n}\n","import type MagicString from 'magic-string';\nimport { NO_SEMICOLON, type RenderOptions } from '../../utils/renderHelpers';\nimport type { InclusionContext } from '../ExecutionContext';\nimport BlockScope from '../scopes/BlockScope';\nimport type Scope from '../scopes/Scope';\nimport { EMPTY_PATH } from '../utils/PathTracker';\nimport MemberExpression from './MemberExpression';\nimport type * as NodeType from './NodeType';\nimport type VariableDeclaration from './VariableDeclaration';\nimport { UNKNOWN_EXPRESSION } from './shared/Expression';\nimport {\n\ttype ExpressionNode,\n\ttype IncludeChildren,\n\tStatementBase,\n\ttype StatementNode\n} from './shared/Node';\nimport type { PatternNode } from './shared/Pattern';\n\nexport default class ForOfStatement extends StatementBase {\n\tdeclare await: boolean;\n\tdeclare body: StatementNode;\n\tdeclare left: VariableDeclaration | PatternNode | MemberExpression;\n\tdeclare right: ExpressionNode;\n\tdeclare type: NodeType.tForOfStatement;\n\n\tcreateScope(parentScope: Scope): void {\n\t\tthis.scope = new BlockScope(parentScope);\n\t}\n\n\thasEffects(): boolean {\n\t\tif (!this.deoptimized) this.applyDeoptimizations();\n\t\t// Placeholder until proper Symbol.Iterator support\n\t\treturn true;\n\t}\n\n\tinclude(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void {\n\t\tconst { body, deoptimized, left, right } = this;\n\t\tif (!deoptimized) this.applyDeoptimizations();\n\t\tthis.included = true;\n\t\tleft.includeAsAssignmentTarget(context, includeChildrenRecursively || true, false);\n\t\tright.include(context, includeChildrenRecursively);\n\t\tconst { brokenFlow } = context;\n\t\tbody.include(context, includeChildrenRecursively, { asSingleStatement: true });\n\t\tcontext.brokenFlow = brokenFlow;\n\t}\n\n\tinitialise() {\n\t\tthis.left.setAssignedValue(UNKNOWN_EXPRESSION);\n\t}\n\n\trender(code: MagicString, options: RenderOptions): void {\n\t\tthis.left.render(code, options, NO_SEMICOLON);\n\t\tthis.right.render(code, options, NO_SEMICOLON);\n\t\t// handle no space between \"of\" and the right side\n\t\tif (code.original.charCodeAt(this.right.start - 1) === 102 /* f */) {\n\t\t\tcode.prependLeft(this.right.start, ' ');\n\t\t}\n\t\tthis.body.render(code, options);\n\t}\n\n\tprotected applyDeoptimizations(): void {\n\t\tthis.deoptimized = true;\n\t\tthis.left.deoptimizePath(EMPTY_PATH);\n\t\tthis.context.requestTreeshakingPass();\n\t}\n}\n","import type MagicString from 'magic-string';\nimport { NO_SEMICOLON, type RenderOptions } from '../../utils/renderHelpers';\nimport type { HasEffectsContext, InclusionContext } from '../ExecutionContext';\nimport BlockScope from '../scopes/BlockScope';\nimport type Scope from '../scopes/Scope';\nimport type * as NodeType from './NodeType';\nimport type VariableDeclaration from './VariableDeclaration';\nimport {\n\ttype ExpressionNode,\n\ttype IncludeChildren,\n\tStatementBase,\n\ttype StatementNode\n} from './shared/Node';\n\nexport default class ForStatement extends StatementBase {\n\tdeclare body: StatementNode;\n\tdeclare init: VariableDeclaration | ExpressionNode | null;\n\tdeclare test: ExpressionNode | null;\n\tdeclare type: NodeType.tForStatement;\n\tdeclare update: ExpressionNode | null;\n\n\tcreateScope(parentScope: Scope): void {\n\t\tthis.scope = new BlockScope(parentScope);\n\t}\n\n\thasEffects(context: HasEffectsContext): boolean {\n\t\tif (\n\t\t\tthis.init?.hasEffects(context) ||\n\t\t\tthis.test?.hasEffects(context) ||\n\t\t\tthis.update?.hasEffects(context)\n\t\t)\n\t\t\treturn true;\n\t\tconst {\n\t\t\tbrokenFlow,\n\t\t\tignore: { breaks, continues }\n\t\t} = context;\n\t\tcontext.ignore.breaks = true;\n\t\tcontext.ignore.continues = true;\n\t\tif (this.body.hasEffects(context)) return true;\n\t\tcontext.ignore.breaks = breaks;\n\t\tcontext.ignore.continues = continues;\n\t\tcontext.brokenFlow = brokenFlow;\n\t\treturn false;\n\t}\n\n\tinclude(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void {\n\t\tthis.included = true;\n\t\tthis.init?.include(context, includeChildrenRecursively, { asSingleStatement: true });\n\t\tthis.test?.include(context, includeChildrenRecursively);\n\t\tconst { brokenFlow } = context;\n\t\tthis.update?.include(context, includeChildrenRecursively);\n\t\tthis.body.include(context, includeChildrenRecursively, { asSingleStatement: true });\n\t\tcontext.brokenFlow = brokenFlow;\n\t}\n\n\trender(code: MagicString, options: RenderOptions): void {\n\t\tthis.init?.render(code, options, NO_SEMICOLON);\n\t\tthis.test?.render(code, options, NO_SEMICOLON);\n\t\tthis.update?.render(code, options, NO_SEMICOLON);\n\t\tthis.body.render(code, options);\n\t}\n}\n","import type MagicString from 'magic-string';\nimport { BLANK } from '../../utils/blank';\nimport type { NodeRenderOptions, RenderOptions } from '../../utils/renderHelpers';\nimport * as NodeType from './NodeType';\nimport FunctionNode from './shared/FunctionNode';\n\nexport default class FunctionExpression extends FunctionNode {\n\tdeclare type: NodeType.tFunctionExpression;\n\n\trender(\n\t\tcode: MagicString,\n\t\toptions: RenderOptions,\n\t\t{ renderedSurroundingElement }: NodeRenderOptions = BLANK\n\t): void {\n\t\tsuper.render(code, options);\n\t\tif (renderedSurroundingElement === NodeType.ExpressionStatement) {\n\t\t\tcode.appendRight(this.start, '(');\n\t\t\tcode.prependLeft(this.end, ')');\n\t\t}\n\t}\n}\n","import type Identifier from './Identifier';\nimport type * as NodeType from './NodeType';\nimport { NodeBase } from './shared/Node';\n\nexport default class ImportDefaultSpecifier extends NodeBase {\n\tdeclare local: Identifier;\n\tdeclare type: NodeType.tImportDefaultSpecifier;\n\n\tprotected applyDeoptimizations() {}\n}\n","import type Identifier from './Identifier';\nimport type * as NodeType from './NodeType';\nimport { NodeBase } from './shared/Node';\n\nexport default class ImportNamespaceSpecifier extends NodeBase {\n\tdeclare local: Identifier;\n\tdeclare type: NodeType.tImportNamespaceSpecifier;\n\n\tprotected applyDeoptimizations() {}\n}\n","import type Identifier from './Identifier';\nimport type * as NodeType from './NodeType';\nimport { NodeBase } from './shared/Node';\n\nexport default class ImportSpecifier extends NodeBase {\n\tdeclare imported: Identifier;\n\tdeclare local: Identifier;\n\tdeclare type: NodeType.tImportSpecifier;\n\n\tprotected applyDeoptimizations() {}\n}\n","import type MagicString from 'magic-string';\nimport {\n\tfindFirstOccurrenceOutsideComment,\n\tfindNonWhiteSpace,\n\ttype RenderOptions\n} from '../../utils/renderHelpers';\nimport type { HasEffectsContext, InclusionContext } from '../ExecutionContext';\nimport type Identifier from './Identifier';\nimport type * as NodeType from './NodeType';\nimport { type IncludeChildren, StatementBase, type StatementNode } from './shared/Node';\n\nexport default class LabeledStatement extends StatementBase {\n\tdeclare body: StatementNode;\n\tdeclare label: Identifier;\n\tdeclare type: NodeType.tLabeledStatement;\n\n\thasEffects(context: HasEffectsContext): boolean {\n\t\tconst brokenFlow = context.brokenFlow;\n\t\tcontext.ignore.labels.add(this.label.name);\n\t\tif (this.body.hasEffects(context)) return true;\n\t\tcontext.ignore.labels.delete(this.label.name);\n\t\tif (context.includedLabels.has(this.label.name)) {\n\t\t\tcontext.includedLabels.delete(this.label.name);\n\t\t\tcontext.brokenFlow = brokenFlow;\n\t\t}\n\t\treturn false;\n\t}\n\n\tinclude(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void {\n\t\tthis.included = true;\n\t\tconst brokenFlow = context.brokenFlow;\n\t\tthis.body.include(context, includeChildrenRecursively);\n\t\tif (includeChildrenRecursively || context.includedLabels.has(this.label.name)) {\n\t\t\tthis.label.include();\n\t\t\tcontext.includedLabels.delete(this.label.name);\n\t\t\tcontext.brokenFlow = brokenFlow;\n\t\t}\n\t}\n\n\trender(code: MagicString, options: RenderOptions): void {\n\t\tif (this.label.included) {\n\t\t\tthis.label.render(code, options);\n\t\t} else {\n\t\t\tcode.remove(\n\t\t\t\tthis.start,\n\t\t\t\tfindNonWhiteSpace(\n\t\t\t\t\tcode.original,\n\t\t\t\t\tfindFirstOccurrenceOutsideComment(code.original, ':', this.label.end) + 1\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\tthis.body.render(code, options);\n\t}\n}\n","import type MagicString from 'magic-string';\nimport { BLANK } from '../../utils/blank';\nimport {\n\tfindFirstOccurrenceOutsideComment,\n\tfindNonWhiteSpace,\n\ttype NodeRenderOptions,\n\tremoveLineBreaks,\n\ttype RenderOptions\n} from '../../utils/renderHelpers';\nimport { removeAnnotations } from '../../utils/treeshakeNode';\nimport type { DeoptimizableEntity } from '../DeoptimizableEntity';\nimport type { HasEffectsContext, InclusionContext } from '../ExecutionContext';\nimport type { NodeInteractionWithThisArg } from '../NodeInteractions';\nimport { NodeInteraction, NodeInteractionCalled } from '../NodeInteractions';\nimport {\n\tEMPTY_PATH,\n\ttype ObjectPath,\n\ttype PathTracker,\n\tSHARED_RECURSION_TRACKER,\n\tUNKNOWN_PATH\n} from '../utils/PathTracker';\nimport type * as NodeType from './NodeType';\nimport {\n\ttype ExpressionEntity,\n\ttype LiteralValueOrUnknown,\n\tUnknownValue\n} from './shared/Expression';\nimport { MultiExpression } from './shared/MultiExpression';\nimport { type ExpressionNode, type IncludeChildren, NodeBase } from './shared/Node';\n\nexport type LogicalOperator = '||' | '&&' | '??';\n\nexport default class LogicalExpression extends NodeBase implements DeoptimizableEntity {\n\tdeclare left: ExpressionNode;\n\tdeclare operator: LogicalOperator;\n\tdeclare right: ExpressionNode;\n\tdeclare type: NodeType.tLogicalExpression;\n\n\t// We collect deoptimization information if usedBranch !== null\n\tprivate expressionsToBeDeoptimized: DeoptimizableEntity[] = [];\n\tprivate isBranchResolutionAnalysed = false;\n\tprivate usedBranch: ExpressionNode | null = null;\n\n\tdeoptimizeCache(): void {\n\t\tif (this.usedBranch) {\n\t\t\tconst unusedBranch = this.usedBranch === this.left ? this.right : this.left;\n\t\t\tthis.usedBranch = null;\n\t\t\tunusedBranch.deoptimizePath(UNKNOWN_PATH);\n\t\t\tfor (const expression of this.expressionsToBeDeoptimized) {\n\t\t\t\texpression.deoptimizeCache();\n\t\t\t}\n\t\t\t// Request another pass because we need to ensure \"include\" runs again if\n\t\t\t// it is rendered\n\t\t\tthis.context.requestTreeshakingPass();\n\t\t}\n\t}\n\n\tdeoptimizePath(path: ObjectPath): void {\n\t\tconst usedBranch = this.getUsedBranch();\n\t\tif (!usedBranch) {\n\t\t\tthis.left.deoptimizePath(path);\n\t\t\tthis.right.deoptimizePath(path);\n\t\t} else {\n\t\t\tusedBranch.deoptimizePath(path);\n\t\t}\n\t}\n\n\tdeoptimizeThisOnInteractionAtPath(\n\t\tinteraction: NodeInteractionWithThisArg,\n\t\tpath: ObjectPath,\n\t\trecursionTracker: PathTracker\n\t): void {\n\t\tthis.left.deoptimizeThisOnInteractionAtPath(interaction, path, recursionTracker);\n\t\tthis.right.deoptimizeThisOnInteractionAtPath(interaction, path, recursionTracker);\n\t}\n\n\tgetLiteralValueAtPath(\n\t\tpath: ObjectPath,\n\t\trecursionTracker: PathTracker,\n\t\torigin: DeoptimizableEntity\n\t): LiteralValueOrUnknown {\n\t\tconst usedBranch = this.getUsedBranch();\n\t\tif (!usedBranch) return UnknownValue;\n\t\tthis.expressionsToBeDeoptimized.push(origin);\n\t\treturn usedBranch.getLiteralValueAtPath(path, recursionTracker, origin);\n\t}\n\n\tgetReturnExpressionWhenCalledAtPath(\n\t\tpath: ObjectPath,\n\t\tinteraction: NodeInteractionCalled,\n\t\trecursionTracker: PathTracker,\n\t\torigin: DeoptimizableEntity\n\t): ExpressionEntity {\n\t\tconst usedBranch = this.getUsedBranch();\n\t\tif (!usedBranch)\n\t\t\treturn new MultiExpression([\n\t\t\t\tthis.left.getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin),\n\t\t\t\tthis.right.getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin)\n\t\t\t]);\n\t\tthis.expressionsToBeDeoptimized.push(origin);\n\t\treturn usedBranch.getReturnExpressionWhenCalledAtPath(\n\t\t\tpath,\n\t\t\tinteraction,\n\t\t\trecursionTracker,\n\t\t\torigin\n\t\t);\n\t}\n\n\thasEffects(context: HasEffectsContext): boolean {\n\t\tif (this.left.hasEffects(context)) {\n\t\t\treturn true;\n\t\t}\n\t\tif (this.getUsedBranch() !== this.left) {\n\t\t\treturn this.right.hasEffects(context);\n\t\t}\n\t\treturn false;\n\t}\n\n\thasEffectsOnInteractionAtPath(\n\t\tpath: ObjectPath,\n\t\tinteraction: NodeInteraction,\n\t\tcontext: HasEffectsContext\n\t): boolean {\n\t\tconst usedBranch = this.getUsedBranch();\n\t\tif (!usedBranch) {\n\t\t\treturn (\n\t\t\t\tthis.left.hasEffectsOnInteractionAtPath(path, interaction, context) ||\n\t\t\t\tthis.right.hasEffectsOnInteractionAtPath(path, interaction, context)\n\t\t\t);\n\t\t}\n\t\treturn usedBranch.hasEffectsOnInteractionAtPath(path, interaction, context);\n\t}\n\n\tinclude(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void {\n\t\tthis.included = true;\n\t\tconst usedBranch = this.getUsedBranch();\n\t\tif (\n\t\t\tincludeChildrenRecursively ||\n\t\t\t(usedBranch === this.right && this.left.shouldBeIncluded(context)) ||\n\t\t\t!usedBranch\n\t\t) {\n\t\t\tthis.left.include(context, includeChildrenRecursively);\n\t\t\tthis.right.include(context, includeChildrenRecursively);\n\t\t} else {\n\t\t\tusedBranch.include(context, includeChildrenRecursively);\n\t\t}\n\t}\n\n\trender(\n\t\tcode: MagicString,\n\t\toptions: RenderOptions,\n\t\t{\n\t\t\tisCalleeOfRenderedParent,\n\t\t\tpreventASI,\n\t\t\trenderedParentType,\n\t\t\trenderedSurroundingElement\n\t\t}: NodeRenderOptions = BLANK\n\t): void {\n\t\tif (!this.left.included || !this.right.included) {\n\t\t\tconst operatorPos = findFirstOccurrenceOutsideComment(\n\t\t\t\tcode.original,\n\t\t\t\tthis.operator,\n\t\t\t\tthis.left.end\n\t\t\t);\n\t\t\tif (this.right.included) {\n\t\t\t\tconst removePos = findNonWhiteSpace(code.original, operatorPos + 2);\n\t\t\t\tcode.remove(this.start, removePos);\n\t\t\t\tif (preventASI) {\n\t\t\t\t\tremoveLineBreaks(code, removePos, this.right.start);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcode.remove(operatorPos, this.end);\n\t\t\t}\n\t\t\tremoveAnnotations(this, code);\n\t\t\tthis.getUsedBranch()!.render(code, options, {\n\t\t\t\tisCalleeOfRenderedParent,\n\t\t\t\tpreventASI,\n\t\t\t\trenderedParentType: renderedParentType || this.parent.type,\n\t\t\t\trenderedSurroundingElement: renderedSurroundingElement || this.parent.type\n\t\t\t});\n\t\t} else {\n\t\t\tthis.left.render(code, options, {\n\t\t\t\tpreventASI,\n\t\t\t\trenderedSurroundingElement\n\t\t\t});\n\t\t\tthis.right.render(code, options);\n\t\t}\n\t}\n\n\tprivate getUsedBranch() {\n\t\tif (!this.isBranchResolutionAnalysed) {\n\t\t\tthis.isBranchResolutionAnalysed = true;\n\t\t\tconst leftValue = this.left.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, this);\n\t\t\tif (typeof leftValue === 'symbol') {\n\t\t\t\treturn null;\n\t\t\t} else {\n\t\t\t\tthis.usedBranch =\n\t\t\t\t\t(this.operator === '||' && leftValue) ||\n\t\t\t\t\t(this.operator === '&&' && !leftValue) ||\n\t\t\t\t\t(this.operator === '??' && leftValue != null)\n\t\t\t\t\t\t? this.left\n\t\t\t\t\t\t: this.right;\n\t\t\t}\n\t\t}\n\t\treturn this.usedBranch;\n\t}\n}\n","import MagicString from 'magic-string';\nimport type { NormalizedTreeshakingOptions } from '../../rollup/types';\nimport { renderCallArguments } from '../../utils/renderCallArguments';\nimport { RenderOptions } from '../../utils/renderHelpers';\nimport type { HasEffectsContext } from '../ExecutionContext';\nimport { InclusionContext } from '../ExecutionContext';\nimport {\n\tINTERACTION_ACCESSED,\n\tINTERACTION_CALLED,\n\tNodeInteraction,\n\tNodeInteractionCalled\n} from '../NodeInteractions';\nimport { EMPTY_PATH, type ObjectPath, UNKNOWN_PATH } from '../utils/PathTracker';\nimport type * as NodeType from './NodeType';\nimport { type ExpressionNode, IncludeChildren, NodeBase } from './shared/Node';\n\nexport default class NewExpression extends NodeBase {\n\tdeclare arguments: ExpressionNode[];\n\tdeclare callee: ExpressionNode;\n\tdeclare type: NodeType.tNewExpression;\n\tprivate declare interaction: NodeInteractionCalled;\n\n\thasEffects(context: HasEffectsContext): boolean {\n\t\ttry {\n\t\t\tfor (const argument of this.arguments) {\n\t\t\t\tif (argument.hasEffects(context)) return true;\n\t\t\t}\n\t\t\tif (\n\t\t\t\t(this.context.options.treeshake as NormalizedTreeshakingOptions).annotations &&\n\t\t\t\tthis.annotations\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn (\n\t\t\t\tthis.callee.hasEffects(context) ||\n\t\t\t\tthis.callee.hasEffectsOnInteractionAtPath(EMPTY_PATH, this.interaction, context)\n\t\t\t);\n\t\t} finally {\n\t\t\tif (!this.deoptimized) this.applyDeoptimizations();\n\t\t}\n\t}\n\n\thasEffectsOnInteractionAtPath(path: ObjectPath, { type }: NodeInteraction): boolean {\n\t\treturn path.length > 0 || type !== INTERACTION_ACCESSED;\n\t}\n\n\tinclude(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void {\n\t\tif (!this.deoptimized) this.applyDeoptimizations();\n\t\tif (includeChildrenRecursively) {\n\t\t\tsuper.include(context, includeChildrenRecursively);\n\t\t} else {\n\t\t\tthis.included = true;\n\t\t\tthis.callee.include(context, false);\n\t\t}\n\t\tthis.callee.includeCallArguments(context, this.arguments);\n\t}\n\n\tinitialise(): void {\n\t\tthis.interaction = {\n\t\t\targs: this.arguments,\n\t\t\tthisArg: null,\n\t\t\ttype: INTERACTION_CALLED,\n\t\t\twithNew: true\n\t\t};\n\t}\n\n\trender(code: MagicString, options: RenderOptions) {\n\t\tthis.callee.render(code, options);\n\t\trenderCallArguments(code, options, this);\n\t}\n\n\tprotected applyDeoptimizations(): void {\n\t\tthis.deoptimized = true;\n\t\tfor (const argument of this.arguments) {\n\t\t\t// This will make sure all properties of parameters behave as \"unknown\"\n\t\t\targument.deoptimizePath(UNKNOWN_PATH);\n\t\t}\n\t\tthis.context.requestTreeshakingPass();\n\t}\n}\n","import type MagicString from 'magic-string';\nimport { BLANK } from '../../utils/blank';\nimport type { NodeRenderOptions, RenderOptions } from '../../utils/renderHelpers';\nimport type { DeoptimizableEntity } from '../DeoptimizableEntity';\nimport type { HasEffectsContext } from '../ExecutionContext';\nimport type { NodeInteractionWithThisArg } from '../NodeInteractions';\nimport { NodeInteraction, NodeInteractionCalled } from '../NodeInteractions';\nimport {\n\tEMPTY_PATH,\n\ttype ObjectPath,\n\ttype PathTracker,\n\tSHARED_RECURSION_TRACKER,\n\tUnknownKey\n} from '../utils/PathTracker';\nimport Identifier from './Identifier';\nimport Literal from './Literal';\nimport * as NodeType from './NodeType';\nimport Property from './Property';\nimport SpreadElement from './SpreadElement';\nimport { type ExpressionEntity, type LiteralValueOrUnknown } from './shared/Expression';\nimport { NodeBase } from './shared/Node';\nimport { ObjectEntity, type ObjectProperty } from './shared/ObjectEntity';\nimport { OBJECT_PROTOTYPE } from './shared/ObjectPrototype';\n\nexport default class ObjectExpression extends NodeBase implements DeoptimizableEntity {\n\tdeclare properties: readonly (Property | SpreadElement)[];\n\tdeclare type: NodeType.tObjectExpression;\n\tprivate objectEntity: ObjectEntity | null = null;\n\n\tdeoptimizeCache(): void {\n\t\tthis.getObjectEntity().deoptimizeAllProperties();\n\t}\n\n\tdeoptimizePath(path: ObjectPath): void {\n\t\tthis.getObjectEntity().deoptimizePath(path);\n\t}\n\n\tdeoptimizeThisOnInteractionAtPath(\n\t\tinteraction: NodeInteractionWithThisArg,\n\t\tpath: ObjectPath,\n\t\trecursionTracker: PathTracker\n\t): void {\n\t\tthis.getObjectEntity().deoptimizeThisOnInteractionAtPath(interaction, path, recursionTracker);\n\t}\n\n\tgetLiteralValueAtPath(\n\t\tpath: ObjectPath,\n\t\trecursionTracker: PathTracker,\n\t\torigin: DeoptimizableEntity\n\t): LiteralValueOrUnknown {\n\t\treturn this.getObjectEntity().getLiteralValueAtPath(path, recursionTracker, origin);\n\t}\n\n\tgetReturnExpressionWhenCalledAtPath(\n\t\tpath: ObjectPath,\n\t\tinteraction: NodeInteractionCalled,\n\t\trecursionTracker: PathTracker,\n\t\torigin: DeoptimizableEntity\n\t): ExpressionEntity {\n\t\treturn this.getObjectEntity().getReturnExpressionWhenCalledAtPath(\n\t\t\tpath,\n\t\t\tinteraction,\n\t\t\trecursionTracker,\n\t\t\torigin\n\t\t);\n\t}\n\n\thasEffectsOnInteractionAtPath(\n\t\tpath: ObjectPath,\n\t\tinteraction: NodeInteraction,\n\t\tcontext: HasEffectsContext\n\t): boolean {\n\t\treturn this.getObjectEntity().hasEffectsOnInteractionAtPath(path, interaction, context);\n\t}\n\n\trender(\n\t\tcode: MagicString,\n\t\toptions: RenderOptions,\n\t\t{ renderedSurroundingElement }: NodeRenderOptions = BLANK\n\t): void {\n\t\tsuper.render(code, options);\n\t\tif (\n\t\t\trenderedSurroundingElement === NodeType.ExpressionStatement ||\n\t\t\trenderedSurroundingElement === NodeType.ArrowFunctionExpression\n\t\t) {\n\t\t\tcode.appendRight(this.start, '(');\n\t\t\tcode.prependLeft(this.end, ')');\n\t\t}\n\t}\n\n\tprotected applyDeoptimizations() {}\n\n\tprivate getObjectEntity(): ObjectEntity {\n\t\tif (this.objectEntity !== null) {\n\t\t\treturn this.objectEntity;\n\t\t}\n\t\tlet prototype: ExpressionEntity | null = OBJECT_PROTOTYPE;\n\t\tconst properties: ObjectProperty[] = [];\n\t\tfor (const property of this.properties) {\n\t\t\tif (property instanceof SpreadElement) {\n\t\t\t\tproperties.push({ key: UnknownKey, kind: 'init', property });\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tlet key: string;\n\t\t\tif (property.computed) {\n\t\t\t\tconst keyValue = property.key.getLiteralValueAtPath(\n\t\t\t\t\tEMPTY_PATH,\n\t\t\t\t\tSHARED_RECURSION_TRACKER,\n\t\t\t\t\tthis\n\t\t\t\t);\n\t\t\t\tif (typeof keyValue === 'symbol') {\n\t\t\t\t\tproperties.push({ key: UnknownKey, kind: property.kind, property });\n\t\t\t\t\tcontinue;\n\t\t\t\t} else {\n\t\t\t\t\tkey = String(keyValue);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tkey =\n\t\t\t\t\tproperty.key instanceof Identifier\n\t\t\t\t\t\t? property.key.name\n\t\t\t\t\t\t: String((property.key as Literal).value);\n\t\t\t\tif (key === '__proto__' && property.kind === 'init') {\n\t\t\t\t\tprototype =\n\t\t\t\t\t\tproperty.value instanceof Literal && property.value.value === null\n\t\t\t\t\t\t\t? null\n\t\t\t\t\t\t\t: property.value;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\tproperties.push({ key, kind: property.kind, property });\n\t\t}\n\t\treturn (this.objectEntity = new ObjectEntity(properties, prototype));\n\t}\n}\n","import type * as NodeType from './NodeType';\nimport { NodeBase } from './shared/Node';\n\nexport default class PrivateIdentifier extends NodeBase {\n\tdeclare name: string;\n\tdeclare type: NodeType.tPrivateIdentifier;\n}\n","import type MagicString from 'magic-string';\nimport type { NormalizedTreeshakingOptions } from '../../rollup/types';\nimport type { RenderOptions } from '../../utils/renderHelpers';\nimport type { HasEffectsContext } from '../ExecutionContext';\nimport { UnknownKey } from '../utils/PathTracker';\nimport type LocalVariable from '../variables/LocalVariable';\nimport type * as NodeType from './NodeType';\nimport { type ExpressionEntity, UNKNOWN_EXPRESSION } from './shared/Expression';\nimport MethodBase from './shared/MethodBase';\nimport type { ExpressionNode } from './shared/Node';\nimport type { PatternNode } from './shared/Pattern';\n\nexport default class Property extends MethodBase implements PatternNode {\n\tdeclare key: ExpressionNode;\n\tdeclare kind: 'init' | 'get' | 'set';\n\tdeclare method: boolean;\n\tdeclare shorthand: boolean;\n\tdeclare type: NodeType.tProperty;\n\tprivate declarationInit: ExpressionEntity | null = null;\n\n\tdeclare(kind: string, init: ExpressionEntity): LocalVariable[] {\n\t\tthis.declarationInit = init;\n\t\treturn (this.value as PatternNode).declare(kind, UNKNOWN_EXPRESSION);\n\t}\n\n\thasEffects(context: HasEffectsContext): boolean {\n\t\tif (!this.deoptimized) this.applyDeoptimizations();\n\t\tconst propertyReadSideEffects = (this.context.options.treeshake as NormalizedTreeshakingOptions)\n\t\t\t.propertyReadSideEffects;\n\t\treturn (\n\t\t\t(this.parent.type === 'ObjectPattern' && propertyReadSideEffects === 'always') ||\n\t\t\tthis.key.hasEffects(context) ||\n\t\t\tthis.value.hasEffects(context)\n\t\t);\n\t}\n\n\tmarkDeclarationReached(): void {\n\t\t(this.value as PatternNode).markDeclarationReached();\n\t}\n\n\trender(code: MagicString, options: RenderOptions): void {\n\t\tif (!this.shorthand) {\n\t\t\tthis.key.render(code, options);\n\t\t}\n\t\tthis.value.render(code, options, { isShorthandProperty: this.shorthand });\n\t}\n\n\tprotected applyDeoptimizations(): void {\n\t\tthis.deoptimized = true;\n\t\tif (this.declarationInit !== null) {\n\t\t\tthis.declarationInit.deoptimizePath([UnknownKey, UnknownKey]);\n\t\t\tthis.context.requestTreeshakingPass();\n\t\t}\n\t}\n}\n","import type { DeoptimizableEntity } from '../DeoptimizableEntity';\nimport type { HasEffectsContext } from '../ExecutionContext';\nimport type { NodeInteractionWithThisArg } from '../NodeInteractions';\nimport { NodeInteraction, NodeInteractionCalled } from '../NodeInteractions';\nimport type { ObjectPath, PathTracker } from '../utils/PathTracker';\nimport type * as NodeType from './NodeType';\nimport type PrivateIdentifier from './PrivateIdentifier';\nimport {\n\ttype ExpressionEntity,\n\ttype LiteralValueOrUnknown,\n\tUNKNOWN_EXPRESSION,\n\tUnknownValue\n} from './shared/Expression';\nimport { type ExpressionNode, NodeBase } from './shared/Node';\n\nexport default class PropertyDefinition extends NodeBase {\n\tdeclare computed: boolean;\n\tdeclare key: ExpressionNode | PrivateIdentifier;\n\tdeclare static: boolean;\n\tdeclare type: NodeType.tPropertyDefinition;\n\tdeclare value: ExpressionNode | null;\n\n\tdeoptimizePath(path: ObjectPath): void {\n\t\tthis.value?.deoptimizePath(path);\n\t}\n\n\tdeoptimizeThisOnInteractionAtPath(\n\t\tinteraction: NodeInteractionWithThisArg,\n\t\tpath: ObjectPath,\n\t\trecursionTracker: PathTracker\n\t): void {\n\t\tthis.value?.deoptimizeThisOnInteractionAtPath(interaction, path, recursionTracker);\n\t}\n\n\tgetLiteralValueAtPath(\n\t\tpath: ObjectPath,\n\t\trecursionTracker: PathTracker,\n\t\torigin: DeoptimizableEntity\n\t): LiteralValueOrUnknown {\n\t\treturn this.value\n\t\t\t? this.value.getLiteralValueAtPath(path, recursionTracker, origin)\n\t\t\t: UnknownValue;\n\t}\n\n\tgetReturnExpressionWhenCalledAtPath(\n\t\tpath: ObjectPath,\n\t\tinteraction: NodeInteractionCalled,\n\t\trecursionTracker: PathTracker,\n\t\torigin: DeoptimizableEntity\n\t): ExpressionEntity {\n\t\treturn this.value\n\t\t\t? this.value.getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin)\n\t\t\t: UNKNOWN_EXPRESSION;\n\t}\n\n\thasEffects(context: HasEffectsContext): boolean {\n\t\treturn this.key.hasEffects(context) || (this.static && !!this.value?.hasEffects(context));\n\t}\n\n\thasEffectsOnInteractionAtPath(\n\t\tpath: ObjectPath,\n\t\tinteraction: NodeInteraction,\n\t\tcontext: HasEffectsContext\n\t): boolean {\n\t\treturn !this.value || this.value.hasEffectsOnInteractionAtPath(path, interaction, context);\n\t}\n\n\tprotected applyDeoptimizations() {}\n}\n","import type MagicString from 'magic-string';\nimport type { RenderOptions } from '../../utils/renderHelpers';\nimport {\n\tBROKEN_FLOW_ERROR_RETURN_LABEL,\n\ttype HasEffectsContext,\n\ttype InclusionContext\n} from '../ExecutionContext';\nimport type * as NodeType from './NodeType';\nimport { UNKNOWN_EXPRESSION } from './shared/Expression';\nimport { type ExpressionNode, type IncludeChildren, StatementBase } from './shared/Node';\n\nexport default class ReturnStatement extends StatementBase {\n\tdeclare argument: ExpressionNode | null;\n\tdeclare type: NodeType.tReturnStatement;\n\n\thasEffects(context: HasEffectsContext): boolean {\n\t\tif (!context.ignore.returnYield || this.argument?.hasEffects(context)) return true;\n\t\tcontext.brokenFlow = BROKEN_FLOW_ERROR_RETURN_LABEL;\n\t\treturn false;\n\t}\n\n\tinclude(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void {\n\t\tthis.included = true;\n\t\tthis.argument?.include(context, includeChildrenRecursively);\n\t\tcontext.brokenFlow = BROKEN_FLOW_ERROR_RETURN_LABEL;\n\t}\n\n\tinitialise(): void {\n\t\tthis.scope.addReturnExpression(this.argument || UNKNOWN_EXPRESSION);\n\t}\n\n\trender(code: MagicString, options: RenderOptions): void {\n\t\tif (this.argument) {\n\t\t\tthis.argument.render(code, options, { preventASI: true });\n\t\t\tif (this.argument.start === this.start + 6 /* 'return'.length */) {\n\t\t\t\tcode.prependLeft(this.start + 6, ' ');\n\t\t\t}\n\t\t}\n\t}\n}\n","import type MagicString from 'magic-string';\nimport { BLANK } from '../../utils/blank';\nimport {\n\tgetCommaSeparatedNodesWithBoundaries,\n\ttype NodeRenderOptions,\n\tremoveLineBreaks,\n\ttype RenderOptions\n} from '../../utils/renderHelpers';\nimport { treeshakeNode } from '../../utils/treeshakeNode';\nimport type { DeoptimizableEntity } from '../DeoptimizableEntity';\nimport type { HasEffectsContext, InclusionContext } from '../ExecutionContext';\nimport type { NodeInteractionWithThisArg } from '../NodeInteractions';\nimport { NodeInteraction } from '../NodeInteractions';\nimport type { ObjectPath, PathTracker } from '../utils/PathTracker';\nimport ExpressionStatement from './ExpressionStatement';\nimport type * as NodeType from './NodeType';\nimport type { LiteralValueOrUnknown } from './shared/Expression';\nimport { type ExpressionNode, type IncludeChildren, NodeBase } from './shared/Node';\n\nexport default class SequenceExpression extends NodeBase {\n\tdeclare expressions: ExpressionNode[];\n\tdeclare type: NodeType.tSequenceExpression;\n\n\tdeoptimizePath(path: ObjectPath): void {\n\t\tthis.expressions[this.expressions.length - 1].deoptimizePath(path);\n\t}\n\n\tdeoptimizeThisOnInteractionAtPath(\n\t\tinteraction: NodeInteractionWithThisArg,\n\t\tpath: ObjectPath,\n\t\trecursionTracker: PathTracker\n\t): void {\n\t\tthis.expressions[this.expressions.length - 1].deoptimizeThisOnInteractionAtPath(\n\t\t\tinteraction,\n\t\t\tpath,\n\t\t\trecursionTracker\n\t\t);\n\t}\n\n\tgetLiteralValueAtPath(\n\t\tpath: ObjectPath,\n\t\trecursionTracker: PathTracker,\n\t\torigin: DeoptimizableEntity\n\t): LiteralValueOrUnknown {\n\t\treturn this.expressions[this.expressions.length - 1].getLiteralValueAtPath(\n\t\t\tpath,\n\t\t\trecursionTracker,\n\t\t\torigin\n\t\t);\n\t}\n\n\thasEffects(context: HasEffectsContext): boolean {\n\t\tfor (const expression of this.expressions) {\n\t\t\tif (expression.hasEffects(context)) return true;\n\t\t}\n\t\treturn false;\n\t}\n\n\thasEffectsOnInteractionAtPath(\n\t\tpath: ObjectPath,\n\t\tinteraction: NodeInteraction,\n\t\tcontext: HasEffectsContext\n\t): boolean {\n\t\treturn this.expressions[this.expressions.length - 1].hasEffectsOnInteractionAtPath(\n\t\t\tpath,\n\t\t\tinteraction,\n\t\t\tcontext\n\t\t);\n\t}\n\n\tinclude(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void {\n\t\tthis.included = true;\n\t\tconst lastExpression = this.expressions[this.expressions.length - 1];\n\t\tfor (const expression of this.expressions) {\n\t\t\tif (\n\t\t\t\tincludeChildrenRecursively ||\n\t\t\t\t(expression === lastExpression && !(this.parent instanceof ExpressionStatement)) ||\n\t\t\t\texpression.shouldBeIncluded(context)\n\t\t\t)\n\t\t\t\texpression.include(context, includeChildrenRecursively);\n\t\t}\n\t}\n\n\trender(\n\t\tcode: MagicString,\n\t\toptions: RenderOptions,\n\t\t{ renderedParentType, isCalleeOfRenderedParent, preventASI }: NodeRenderOptions = BLANK\n\t): void {\n\t\tlet includedNodes = 0;\n\t\tlet lastSeparatorPos: number | null = null;\n\t\tconst lastNode = this.expressions[this.expressions.length - 1];\n\t\tfor (const { node, separator, start, end } of getCommaSeparatedNodesWithBoundaries(\n\t\t\tthis.expressions,\n\t\t\tcode,\n\t\t\tthis.start,\n\t\t\tthis.end\n\t\t)) {\n\t\t\tif (!node.included) {\n\t\t\t\ttreeshakeNode(node, code, start, end);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tincludedNodes++;\n\t\t\tlastSeparatorPos = separator;\n\t\t\tif (includedNodes === 1 && preventASI) {\n\t\t\t\tremoveLineBreaks(code, start, node.start);\n\t\t\t}\n\t\t\tif (includedNodes === 1) {\n\t\t\t\tconst parentType = renderedParentType || this.parent.type;\n\t\t\t\tnode.render(code, options, {\n\t\t\t\t\tisCalleeOfRenderedParent: isCalleeOfRenderedParent && node === lastNode,\n\t\t\t\t\trenderedParentType: parentType,\n\t\t\t\t\trenderedSurroundingElement: parentType\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tnode.render(code, options);\n\t\t\t}\n\t\t}\n\t\tif (lastSeparatorPos) {\n\t\t\tcode.remove(lastSeparatorPos, this.end);\n\t\t}\n\t}\n}\n","import type MagicString from 'magic-string';\nimport { type RenderOptions, renderStatementList } from '../../utils/renderHelpers';\nimport type { HasEffectsContext, InclusionContext } from '../ExecutionContext';\nimport BlockScope from '../scopes/BlockScope';\nimport type Scope from '../scopes/Scope';\nimport type * as NodeType from './NodeType';\nimport { type IncludeChildren, StatementBase, type StatementNode } from './shared/Node';\n\nexport default class StaticBlock extends StatementBase {\n\tdeclare body: readonly StatementNode[];\n\tdeclare type: NodeType.tStaticBlock;\n\n\tcreateScope(parentScope: Scope): void {\n\t\tthis.scope = new BlockScope(parentScope);\n\t}\n\n\thasEffects(context: HasEffectsContext): boolean {\n\t\tfor (const node of this.body) {\n\t\t\tif (node.hasEffects(context)) return true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tinclude(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void {\n\t\tthis.included = true;\n\t\tfor (const node of this.body) {\n\t\t\tif (includeChildrenRecursively || node.shouldBeIncluded(context))\n\t\t\t\tnode.include(context, includeChildrenRecursively);\n\t\t}\n\t}\n\n\trender(code: MagicString, options: RenderOptions): void {\n\t\tif (this.body.length) {\n\t\t\trenderStatementList(this.body, code, this.start + 1, this.end - 1, options);\n\t\t} else {\n\t\t\tsuper.render(code, options);\n\t\t}\n\t}\n}\n","import { NodeInteractionWithThisArg } from '../NodeInteractions';\nimport type { ObjectPath } from '../utils/PathTracker';\nimport { PathTracker } from '../utils/PathTracker';\nimport Variable from '../variables/Variable';\nimport type * as NodeType from './NodeType';\nimport { NodeBase } from './shared/Node';\n\nexport default class Super extends NodeBase {\n\tdeclare type: NodeType.tSuper;\n\tdeclare variable: Variable;\n\n\tbind(): void {\n\t\tthis.variable = this.scope.findVariable('this');\n\t}\n\n\tdeoptimizePath(path: ObjectPath): void {\n\t\tthis.variable.deoptimizePath(path);\n\t}\n\n\tdeoptimizeThisOnInteractionAtPath(\n\t\tinteraction: NodeInteractionWithThisArg,\n\t\tpath: ObjectPath,\n\t\trecursionTracker: PathTracker\n\t) {\n\t\tthis.variable.deoptimizeThisOnInteractionAtPath(interaction, path, recursionTracker);\n\t}\n\n\tinclude(): void {\n\t\tif (!this.included) {\n\t\t\tthis.included = true;\n\t\t\tthis.context.includeVariableInModule(this.variable);\n\t\t}\n\t}\n}\n","import type MagicString from 'magic-string';\nimport { type RenderOptions, renderStatementList } from '../../utils/renderHelpers';\nimport {\n\tBROKEN_FLOW_BREAK_CONTINUE,\n\tcreateHasEffectsContext,\n\ttype HasEffectsContext,\n\ttype InclusionContext\n} from '../ExecutionContext';\nimport BlockScope from '../scopes/BlockScope';\nimport type Scope from '../scopes/Scope';\nimport type * as NodeType from './NodeType';\nimport type SwitchCase from './SwitchCase';\nimport { type ExpressionNode, type IncludeChildren, StatementBase } from './shared/Node';\n\nexport default class SwitchStatement extends StatementBase {\n\tdeclare cases: readonly SwitchCase[];\n\tdeclare discriminant: ExpressionNode;\n\tdeclare type: NodeType.tSwitchStatement;\n\n\tprivate declare defaultCase: number | null;\n\n\tcreateScope(parentScope: Scope): void {\n\t\tthis.scope = new BlockScope(parentScope);\n\t}\n\n\thasEffects(context: HasEffectsContext): boolean {\n\t\tif (this.discriminant.hasEffects(context)) return true;\n\t\tconst {\n\t\t\tbrokenFlow,\n\t\t\tignore: { breaks }\n\t\t} = context;\n\t\tlet minBrokenFlow = Infinity;\n\t\tcontext.ignore.breaks = true;\n\t\tfor (const switchCase of this.cases) {\n\t\t\tif (switchCase.hasEffects(context)) return true;\n\t\t\tminBrokenFlow = context.brokenFlow < minBrokenFlow ? context.brokenFlow : minBrokenFlow;\n\t\t\tcontext.brokenFlow = brokenFlow;\n\t\t}\n\t\tif (this.defaultCase !== null && !(minBrokenFlow === BROKEN_FLOW_BREAK_CONTINUE)) {\n\t\t\tcontext.brokenFlow = minBrokenFlow;\n\t\t}\n\t\tcontext.ignore.breaks = breaks;\n\t\treturn false;\n\t}\n\n\tinclude(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void {\n\t\tthis.included = true;\n\t\tthis.discriminant.include(context, includeChildrenRecursively);\n\t\tconst { brokenFlow } = context;\n\t\tlet minBrokenFlow = Infinity;\n\t\tlet isCaseIncluded =\n\t\t\tincludeChildrenRecursively ||\n\t\t\t(this.defaultCase !== null && this.defaultCase < this.cases.length - 1);\n\t\tfor (let caseIndex = this.cases.length - 1; caseIndex >= 0; caseIndex--) {\n\t\t\tconst switchCase = this.cases[caseIndex];\n\t\t\tif (switchCase.included) {\n\t\t\t\tisCaseIncluded = true;\n\t\t\t}\n\t\t\tif (!isCaseIncluded) {\n\t\t\t\tconst hasEffectsContext = createHasEffectsContext();\n\t\t\t\thasEffectsContext.ignore.breaks = true;\n\t\t\t\tisCaseIncluded = switchCase.hasEffects(hasEffectsContext);\n\t\t\t}\n\t\t\tif (isCaseIncluded) {\n\t\t\t\tswitchCase.include(context, includeChildrenRecursively);\n\t\t\t\tminBrokenFlow = minBrokenFlow < context.brokenFlow ? minBrokenFlow : context.brokenFlow;\n\t\t\t\tcontext.brokenFlow = brokenFlow;\n\t\t\t} else {\n\t\t\t\tminBrokenFlow = brokenFlow;\n\t\t\t}\n\t\t}\n\t\tif (\n\t\t\tisCaseIncluded &&\n\t\t\tthis.defaultCase !== null &&\n\t\t\t!(minBrokenFlow === BROKEN_FLOW_BREAK_CONTINUE)\n\t\t) {\n\t\t\tcontext.brokenFlow = minBrokenFlow;\n\t\t}\n\t}\n\n\tinitialise(): void {\n\t\tfor (let caseIndex = 0; caseIndex < this.cases.length; caseIndex++) {\n\t\t\tif (this.cases[caseIndex].test === null) {\n\t\t\t\tthis.defaultCase = caseIndex;\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tthis.defaultCase = null;\n\t}\n\n\trender(code: MagicString, options: RenderOptions): void {\n\t\tthis.discriminant.render(code, options);\n\t\tif (this.cases.length > 0) {\n\t\t\trenderStatementList(this.cases, code, this.cases[0].start, this.end - 1, options);\n\t\t}\n\t}\n}\n","import type MagicString from 'magic-string';\nimport { type RenderOptions } from '../../utils/renderHelpers';\nimport type { HasEffectsContext } from '../ExecutionContext';\nimport { InclusionContext } from '../ExecutionContext';\nimport { INTERACTION_CALLED, NodeInteractionWithThisArg } from '../NodeInteractions';\nimport {\n\tEMPTY_PATH,\n\tPathTracker,\n\tSHARED_RECURSION_TRACKER,\n\tUNKNOWN_PATH\n} from '../utils/PathTracker';\nimport Identifier from './Identifier';\nimport MemberExpression from './MemberExpression';\nimport * as NodeType from './NodeType';\nimport type TemplateLiteral from './TemplateLiteral';\nimport CallExpressionBase from './shared/CallExpressionBase';\nimport { ExpressionEntity, UNKNOWN_EXPRESSION } from './shared/Expression';\nimport { type ExpressionNode, IncludeChildren } from './shared/Node';\n\nexport default class TaggedTemplateExpression extends CallExpressionBase {\n\tdeclare quasi: TemplateLiteral;\n\tdeclare tag: ExpressionNode;\n\tdeclare type: NodeType.tTaggedTemplateExpression;\n\n\tbind(): void {\n\t\tsuper.bind();\n\t\tif (this.tag.type === NodeType.Identifier) {\n\t\t\tconst name = (this.tag as Identifier).name;\n\t\t\tconst variable = this.scope.findVariable(name);\n\n\t\t\tif (variable.isNamespace) {\n\t\t\t\tthis.context.warn(\n\t\t\t\t\t{\n\t\t\t\t\t\tcode: 'CANNOT_CALL_NAMESPACE',\n\t\t\t\t\t\tmessage: `Cannot call a namespace ('${name}')`\n\t\t\t\t\t},\n\t\t\t\t\tthis.start\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\thasEffects(context: HasEffectsContext): boolean {\n\t\ttry {\n\t\t\tfor (const argument of this.quasi.expressions) {\n\t\t\t\tif (argument.hasEffects(context)) return true;\n\t\t\t}\n\t\t\treturn (\n\t\t\t\tthis.tag.hasEffects(context) ||\n\t\t\t\tthis.tag.hasEffectsOnInteractionAtPath(EMPTY_PATH, this.interaction, context)\n\t\t\t);\n\t\t} finally {\n\t\t\tif (!this.deoptimized) this.applyDeoptimizations();\n\t\t}\n\t}\n\n\tinclude(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void {\n\t\tif (!this.deoptimized) this.applyDeoptimizations();\n\t\tif (includeChildrenRecursively) {\n\t\t\tsuper.include(context, includeChildrenRecursively);\n\t\t} else {\n\t\t\tthis.included = true;\n\t\t\tthis.tag.include(context, includeChildrenRecursively);\n\t\t\tthis.quasi.include(context, includeChildrenRecursively);\n\t\t}\n\t\tthis.tag.includeCallArguments(context, this.interaction.args);\n\t\tconst returnExpression = this.getReturnExpression();\n\t\tif (!returnExpression.included) {\n\t\t\treturnExpression.include(context, false);\n\t\t}\n\t}\n\n\tinitialise(): void {\n\t\tthis.interaction = {\n\t\t\targs: [UNKNOWN_EXPRESSION, ...this.quasi.expressions],\n\t\t\tthisArg: this.tag instanceof MemberExpression && !this.tag.variable ? this.tag.object : null,\n\t\t\ttype: INTERACTION_CALLED,\n\t\t\twithNew: false\n\t\t};\n\t}\n\n\trender(code: MagicString, options: RenderOptions): void {\n\t\tthis.tag.render(code, options, { isCalleeOfRenderedParent: true });\n\t\tthis.quasi.render(code, options);\n\t}\n\n\tprotected applyDeoptimizations(): void {\n\t\tthis.deoptimized = true;\n\t\tif (this.interaction.thisArg) {\n\t\t\tthis.tag.deoptimizeThisOnInteractionAtPath(\n\t\t\t\tthis.interaction as NodeInteractionWithThisArg,\n\t\t\t\tEMPTY_PATH,\n\t\t\t\tSHARED_RECURSION_TRACKER\n\t\t\t);\n\t\t}\n\t\tfor (const argument of this.quasi.expressions) {\n\t\t\t// This will make sure all properties of parameters behave as \"unknown\"\n\t\t\targument.deoptimizePath(UNKNOWN_PATH);\n\t\t}\n\t\tthis.context.requestTreeshakingPass();\n\t}\n\n\tprotected getReturnExpression(\n\t\trecursionTracker: PathTracker = SHARED_RECURSION_TRACKER\n\t): ExpressionEntity {\n\t\tif (this.returnExpression === null) {\n\t\t\tthis.returnExpression = UNKNOWN_EXPRESSION;\n\t\t\treturn (this.returnExpression = this.tag.getReturnExpressionWhenCalledAtPath(\n\t\t\t\tEMPTY_PATH,\n\t\t\t\tthis.interaction,\n\t\t\t\trecursionTracker,\n\t\t\t\tthis\n\t\t\t));\n\t\t}\n\t\treturn this.returnExpression;\n\t}\n}\n","import type * as NodeType from './NodeType';\nimport { type GenericEsTreeNode, NodeBase } from './shared/Node';\n\nexport default class TemplateElement extends NodeBase {\n\tdeclare tail: boolean;\n\tdeclare type: NodeType.tTemplateElement;\n\tdeclare value: {\n\t\tcooked: string | null;\n\t\traw: string;\n\t};\n\n\t// Do not try to bind value\n\tbind(): void {}\n\n\thasEffects(): boolean {\n\t\treturn false;\n\t}\n\n\tinclude(): void {\n\t\tthis.included = true;\n\t}\n\n\tparseNode(esTreeNode: GenericEsTreeNode): void {\n\t\tthis.value = esTreeNode.value;\n\t\tsuper.parseNode(esTreeNode);\n\t}\n\n\trender(): void {}\n}\n","import type MagicString from 'magic-string';\nimport type { HasEffectsContext } from '../ExecutionContext';\nimport type { NodeInteraction, NodeInteractionWithThisArg } from '../NodeInteractions';\nimport { INTERACTION_ACCESSED } from '../NodeInteractions';\nimport ModuleScope from '../scopes/ModuleScope';\nimport type { ObjectPath, PathTracker } from '../utils/PathTracker';\nimport type Variable from '../variables/Variable';\nimport type * as NodeType from './NodeType';\nimport { NodeBase } from './shared/Node';\n\nexport default class ThisExpression extends NodeBase {\n\tdeclare type: NodeType.tThisExpression;\n\tdeclare variable: Variable;\n\tprivate declare alias: string | null;\n\n\tbind(): void {\n\t\tthis.variable = this.scope.findVariable('this');\n\t}\n\n\tdeoptimizePath(path: ObjectPath): void {\n\t\tthis.variable.deoptimizePath(path);\n\t}\n\n\tdeoptimizeThisOnInteractionAtPath(\n\t\tinteraction: NodeInteractionWithThisArg,\n\t\tpath: ObjectPath,\n\t\trecursionTracker: PathTracker\n\t): void {\n\t\t// We rewrite the parameter so that a ThisVariable can detect self-mutations\n\t\tthis.variable.deoptimizeThisOnInteractionAtPath(\n\t\t\tinteraction.thisArg === this ? { ...interaction, thisArg: this.variable } : interaction,\n\t\t\tpath,\n\t\t\trecursionTracker\n\t\t);\n\t}\n\n\thasEffectsOnInteractionAtPath(\n\t\tpath: ObjectPath,\n\t\tinteraction: NodeInteraction,\n\t\tcontext: HasEffectsContext\n\t): boolean {\n\t\tif (path.length === 0) {\n\t\t\treturn interaction.type !== INTERACTION_ACCESSED;\n\t\t}\n\t\treturn this.variable.hasEffectsOnInteractionAtPath(path, interaction, context);\n\t}\n\n\tinclude(): void {\n\t\tif (!this.included) {\n\t\t\tthis.included = true;\n\t\t\tthis.context.includeVariableInModule(this.variable);\n\t\t}\n\t}\n\n\tinitialise(): void {\n\t\tthis.alias =\n\t\t\tthis.scope.findLexicalBoundary() instanceof ModuleScope ? this.context.moduleContext : null;\n\t\tif (this.alias === 'undefined') {\n\t\t\tthis.context.warn(\n\t\t\t\t{\n\t\t\t\t\tcode: 'THIS_IS_UNDEFINED',\n\t\t\t\t\tmessage: `The 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten`,\n\t\t\t\t\turl: `https://rollupjs.org/guide/en/#error-this-is-undefined`\n\t\t\t\t},\n\t\t\t\tthis.start\n\t\t\t);\n\t\t}\n\t}\n\n\trender(code: MagicString): void {\n\t\tif (this.alias !== null) {\n\t\t\tcode.overwrite(this.start, this.end, this.alias, {\n\t\t\t\tcontentOnly: false,\n\t\t\t\tstoreName: true\n\t\t\t});\n\t\t}\n\t}\n}\n","import type MagicString from 'magic-string';\nimport type { RenderOptions } from '../../utils/renderHelpers';\nimport { BROKEN_FLOW_ERROR_RETURN_LABEL, type InclusionContext } from '../ExecutionContext';\nimport type * as NodeType from './NodeType';\nimport { type ExpressionNode, type IncludeChildren, StatementBase } from './shared/Node';\n\nexport default class ThrowStatement extends StatementBase {\n\tdeclare argument: ExpressionNode;\n\tdeclare type: NodeType.tThrowStatement;\n\n\thasEffects(): boolean {\n\t\treturn true;\n\t}\n\n\tinclude(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void {\n\t\tthis.included = true;\n\t\tthis.argument.include(context, includeChildrenRecursively);\n\t\tcontext.brokenFlow = BROKEN_FLOW_ERROR_RETURN_LABEL;\n\t}\n\n\trender(code: MagicString, options: RenderOptions): void {\n\t\tthis.argument.render(code, options, { preventASI: true });\n\t\tif (this.argument.start === this.start + 5 /* 'throw'.length */) {\n\t\t\tcode.prependLeft(this.start + 5, ' ');\n\t\t}\n\t}\n}\n","import type { NormalizedTreeshakingOptions } from '../../rollup/types';\nimport type { HasEffectsContext, InclusionContext } from '../ExecutionContext';\nimport type BlockStatement from './BlockStatement';\nimport type CatchClause from './CatchClause';\nimport type * as NodeType from './NodeType';\nimport { INCLUDE_PARAMETERS, type IncludeChildren, StatementBase } from './shared/Node';\n\nexport default class TryStatement extends StatementBase {\n\tdeclare block: BlockStatement;\n\tdeclare finalizer: BlockStatement | null;\n\tdeclare handler: CatchClause | null;\n\tdeclare type: NodeType.tTryStatement;\n\n\tprivate directlyIncluded = false;\n\tprivate includedLabelsAfterBlock: string[] | null = null;\n\n\thasEffects(context: HasEffectsContext): boolean {\n\t\treturn (\n\t\t\t((this.context.options.treeshake as NormalizedTreeshakingOptions).tryCatchDeoptimization\n\t\t\t\t? this.block.body.length > 0\n\t\t\t\t: this.block.hasEffects(context)) || !!this.finalizer?.hasEffects(context)\n\t\t);\n\t}\n\n\tinclude(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void {\n\t\tconst tryCatchDeoptimization = (this.context.options.treeshake as NormalizedTreeshakingOptions)\n\t\t\t?.tryCatchDeoptimization;\n\t\tconst { brokenFlow } = context;\n\t\tif (!this.directlyIncluded || !tryCatchDeoptimization) {\n\t\t\tthis.included = true;\n\t\t\tthis.directlyIncluded = true;\n\t\t\tthis.block.include(\n\t\t\t\tcontext,\n\t\t\t\ttryCatchDeoptimization ? INCLUDE_PARAMETERS : includeChildrenRecursively\n\t\t\t);\n\t\t\tif (context.includedLabels.size > 0) {\n\t\t\t\tthis.includedLabelsAfterBlock = [...context.includedLabels];\n\t\t\t}\n\t\t\tcontext.brokenFlow = brokenFlow;\n\t\t} else if (this.includedLabelsAfterBlock) {\n\t\t\tfor (const label of this.includedLabelsAfterBlock) {\n\t\t\t\tcontext.includedLabels.add(label);\n\t\t\t}\n\t\t}\n\t\tif (this.handler !== null) {\n\t\t\tthis.handler.include(context, includeChildrenRecursively);\n\t\t\tcontext.brokenFlow = brokenFlow;\n\t\t}\n\t\tthis.finalizer?.include(context, includeChildrenRecursively);\n\t}\n}\n","import type { InclusionContext } from '../ExecutionContext';\nimport { NodeBase } from './shared/Node';\n\nexport default class UnknownNode extends NodeBase {\n\thasEffects(): boolean {\n\t\treturn true;\n\t}\n\n\tinclude(context: InclusionContext): void {\n\t\tsuper.include(context, true);\n\t}\n}\n","import type MagicString from 'magic-string';\nimport type { RenderOptions } from '../../utils/renderHelpers';\nimport {\n\trenderSystemExportExpression,\n\trenderSystemExportSequenceAfterExpression,\n\trenderSystemExportSequenceBeforeExpression\n} from '../../utils/systemJsRendering';\nimport type { HasEffectsContext, InclusionContext } from '../ExecutionContext';\nimport {\n\tINTERACTION_ACCESSED,\n\tNodeInteraction,\n\tNodeInteractionAssigned\n} from '../NodeInteractions';\nimport { EMPTY_PATH, type ObjectPath } from '../utils/PathTracker';\nimport Identifier from './Identifier';\nimport * as NodeType from './NodeType';\nimport { UNKNOWN_EXPRESSION } from './shared/Expression';\nimport { type ExpressionNode, IncludeChildren, NodeBase } from './shared/Node';\n\nexport default class UpdateExpression extends NodeBase {\n\tdeclare argument: ExpressionNode;\n\tdeclare operator: '++' | '--';\n\tdeclare prefix: boolean;\n\tdeclare type: NodeType.tUpdateExpression;\n\tprivate declare interaction: NodeInteractionAssigned;\n\n\thasEffects(context: HasEffectsContext): boolean {\n\t\tif (!this.deoptimized) this.applyDeoptimizations();\n\t\treturn this.argument.hasEffectsAsAssignmentTarget(context, true);\n\t}\n\n\thasEffectsOnInteractionAtPath(path: ObjectPath, { type }: NodeInteraction): boolean {\n\t\treturn path.length > 1 || type !== INTERACTION_ACCESSED;\n\t}\n\n\tinclude(context: InclusionContext, includeChildrenRecursively: IncludeChildren) {\n\t\tif (!this.deoptimized) this.applyDeoptimizations();\n\t\tthis.included = true;\n\t\tthis.argument.includeAsAssignmentTarget(context, includeChildrenRecursively, true);\n\t}\n\n\tinitialise() {\n\t\tthis.argument.setAssignedValue(UNKNOWN_EXPRESSION);\n\t}\n\n\trender(code: MagicString, options: RenderOptions): void {\n\t\tconst {\n\t\t\texportNamesByVariable,\n\t\t\tformat,\n\t\t\tsnippets: { _ }\n\t\t} = options;\n\t\tthis.argument.render(code, options);\n\t\tif (format === 'system') {\n\t\t\tconst variable = this.argument.variable!;\n\t\t\tconst exportNames = exportNamesByVariable.get(variable);\n\t\t\tif (exportNames) {\n\t\t\t\tif (this.prefix) {\n\t\t\t\t\tif (exportNames.length === 1) {\n\t\t\t\t\t\trenderSystemExportExpression(variable, this.start, this.end, code, options);\n\t\t\t\t\t} else {\n\t\t\t\t\t\trenderSystemExportSequenceAfterExpression(\n\t\t\t\t\t\t\tvariable,\n\t\t\t\t\t\t\tthis.start,\n\t\t\t\t\t\t\tthis.end,\n\t\t\t\t\t\t\tthis.parent.type !== NodeType.ExpressionStatement,\n\t\t\t\t\t\t\tcode,\n\t\t\t\t\t\t\toptions\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tconst operator = this.operator[0];\n\t\t\t\t\trenderSystemExportSequenceBeforeExpression(\n\t\t\t\t\t\tvariable,\n\t\t\t\t\t\tthis.start,\n\t\t\t\t\t\tthis.end,\n\t\t\t\t\t\tthis.parent.type !== NodeType.ExpressionStatement,\n\t\t\t\t\t\tcode,\n\t\t\t\t\t\toptions,\n\t\t\t\t\t\t`${_}${operator}${_}1`\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected applyDeoptimizations(): void {\n\t\tthis.deoptimized = true;\n\t\tthis.argument.deoptimizePath(EMPTY_PATH);\n\t\tif (this.argument instanceof Identifier) {\n\t\t\tconst variable = this.scope.findVariable(this.argument.name);\n\t\t\tvariable.isReassigned = true;\n\t\t}\n\t\tthis.context.requestTreeshakingPass();\n\t}\n}\n","import type MagicString from 'magic-string';\nimport { BLANK } from '../../utils/blank';\nimport { isReassignedExportsMember } from '../../utils/reassignedExportsMember';\nimport {\n\tfindFirstOccurrenceOutsideComment,\n\tfindNonWhiteSpace,\n\ttype RenderOptions\n} from '../../utils/renderHelpers';\nimport type { HasEffectsContext, InclusionContext } from '../ExecutionContext';\nimport type { ObjectPath } from '../utils/PathTracker';\nimport { UNDEFINED_EXPRESSION } from '../values';\nimport Identifier from './Identifier';\nimport * as NodeType from './NodeType';\nimport { type ExpressionNode, type IncludeChildren, NodeBase } from './shared/Node';\nimport type { PatternNode } from './shared/Pattern';\n\nexport default class VariableDeclarator extends NodeBase {\n\tdeclare id: PatternNode;\n\tdeclare init: ExpressionNode | null;\n\tdeclare type: NodeType.tVariableDeclarator;\n\n\tdeclareDeclarator(kind: string): void {\n\t\tthis.id.declare(kind, this.init || UNDEFINED_EXPRESSION);\n\t}\n\n\tdeoptimizePath(path: ObjectPath): void {\n\t\tthis.id.deoptimizePath(path);\n\t}\n\n\thasEffects(context: HasEffectsContext): boolean {\n\t\tconst initEffect = this.init?.hasEffects(context);\n\t\tthis.id.markDeclarationReached();\n\t\treturn initEffect || this.id.hasEffects(context);\n\t}\n\n\tinclude(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void {\n\t\tthis.included = true;\n\t\tthis.init?.include(context, includeChildrenRecursively);\n\t\tthis.id.markDeclarationReached();\n\t\tif (includeChildrenRecursively || this.id.shouldBeIncluded(context)) {\n\t\t\tthis.id.include(context, includeChildrenRecursively);\n\t\t}\n\t}\n\n\trender(code: MagicString, options: RenderOptions): void {\n\t\tconst {\n\t\t\texportNamesByVariable,\n\t\t\tsnippets: { _ }\n\t\t} = options;\n\t\tconst renderId = this.id.included;\n\t\tif (renderId) {\n\t\t\tthis.id.render(code, options);\n\t\t} else {\n\t\t\tconst operatorPos = findFirstOccurrenceOutsideComment(code.original, '=', this.id.end);\n\t\t\tcode.remove(this.start, findNonWhiteSpace(code.original, operatorPos + 1));\n\t\t}\n\t\tif (this.init) {\n\t\t\tthis.init.render(\n\t\t\t\tcode,\n\t\t\t\toptions,\n\t\t\t\trenderId ? BLANK : { renderedSurroundingElement: NodeType.ExpressionStatement }\n\t\t\t);\n\t\t} else if (\n\t\t\tthis.id instanceof Identifier &&\n\t\t\tisReassignedExportsMember(this.id.variable!, exportNamesByVariable)\n\t\t) {\n\t\t\tcode.appendLeft(this.end, `${_}=${_}void 0`);\n\t\t}\n\t}\n\n\tprotected applyDeoptimizations() {}\n}\n","import type { HasEffectsContext, InclusionContext } from '../ExecutionContext';\nimport type * as NodeType from './NodeType';\nimport {\n\ttype ExpressionNode,\n\ttype IncludeChildren,\n\tStatementBase,\n\ttype StatementNode\n} from './shared/Node';\n\nexport default class WhileStatement extends StatementBase {\n\tdeclare body: StatementNode;\n\tdeclare test: ExpressionNode;\n\tdeclare type: NodeType.tWhileStatement;\n\n\thasEffects(context: HasEffectsContext): boolean {\n\t\tif (this.test.hasEffects(context)) return true;\n\t\tconst {\n\t\t\tbrokenFlow,\n\t\t\tignore: { breaks, continues }\n\t\t} = context;\n\t\tcontext.ignore.breaks = true;\n\t\tcontext.ignore.continues = true;\n\t\tif (this.body.hasEffects(context)) return true;\n\t\tcontext.ignore.breaks = breaks;\n\t\tcontext.ignore.continues = continues;\n\t\tcontext.brokenFlow = brokenFlow;\n\t\treturn false;\n\t}\n\n\tinclude(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void {\n\t\tthis.included = true;\n\t\tthis.test.include(context, includeChildrenRecursively);\n\t\tconst { brokenFlow } = context;\n\t\tthis.body.include(context, includeChildrenRecursively, { asSingleStatement: true });\n\t\tcontext.brokenFlow = brokenFlow;\n\t}\n}\n","import type MagicString from 'magic-string';\nimport type { RenderOptions } from '../../utils/renderHelpers';\nimport type { HasEffectsContext } from '../ExecutionContext';\nimport type * as NodeType from './NodeType';\nimport { type ExpressionNode, NodeBase } from './shared/Node';\n\nexport default class YieldExpression extends NodeBase {\n\tdeclare argument: ExpressionNode | null;\n\tdeclare delegate: boolean;\n\tdeclare type: NodeType.tYieldExpression;\n\n\thasEffects(context: HasEffectsContext): boolean {\n\t\tif (!this.deoptimized) this.applyDeoptimizations();\n\t\treturn !(context.ignore.returnYield && !this.argument?.hasEffects(context));\n\t}\n\n\trender(code: MagicString, options: RenderOptions): void {\n\t\tif (this.argument) {\n\t\t\tthis.argument.render(code, options, { preventASI: true });\n\t\t\tif (this.argument.start === this.start + 5 /* 'yield'.length */) {\n\t\t\t\tcode.prependLeft(this.start + 5, ' ');\n\t\t\t}\n\t\t}\n\t}\n}\n","export const MISSING_EXPORT_SHIM_VARIABLE = '_missingExportShim';\n","import type Module from '../../Module';\nimport { MISSING_EXPORT_SHIM_VARIABLE } from '../../utils/variableNames';\nimport Variable from './Variable';\n\nexport default class ExportShimVariable extends Variable {\n\tmodule: Module;\n\n\tconstructor(module: Module) {\n\t\tsuper(MISSING_EXPORT_SHIM_VARIABLE);\n\t\tthis.module = module;\n\t}\n\n\tinclude(): void {\n\t\tsuper.include();\n\t\tthis.module.needsExportShim = true;\n\t}\n}\n","import type Module from '../../Module';\nimport type { AstContext } from '../../Module';\nimport { getToStringTagValue, MERGE_NAMESPACES_VARIABLE } from '../../utils/interopHelpers';\nimport type { RenderOptions } from '../../utils/renderHelpers';\nimport { getSystemExportStatement } from '../../utils/systemJsRendering';\nimport type Identifier from '../nodes/Identifier';\nimport type ChildScope from '../scopes/ChildScope';\nimport Variable from './Variable';\n\nexport default class NamespaceVariable extends Variable {\n\tcontext: AstContext;\n\tdeclare isNamespace: true;\n\tmodule: Module;\n\n\tprivate memberVariables: { [name: string]: Variable } | null = null;\n\tprivate mergedNamespaces: readonly Variable[] = [];\n\tprivate referencedEarly = false;\n\tprivate references: Identifier[] = [];\n\n\tconstructor(context: AstContext) {\n\t\tsuper(context.getModuleName());\n\t\tthis.context = context;\n\t\tthis.module = context.module;\n\t}\n\n\taddReference(identifier: Identifier): void {\n\t\tthis.references.push(identifier);\n\t\tthis.name = identifier.name;\n\t}\n\n\tgetMemberVariables(): { [name: string]: Variable } {\n\t\tif (this.memberVariables) {\n\t\t\treturn this.memberVariables;\n\t\t}\n\t\tconst memberVariables: { [name: string]: Variable } = Object.create(null);\n\t\tfor (const name of this.context.getExports().concat(this.context.getReexports())) {\n\t\t\tif (name[0] !== '*' && name !== this.module.info.syntheticNamedExports) {\n\t\t\t\tconst exportedVariable = this.context.traceExport(name);\n\t\t\t\tif (exportedVariable) {\n\t\t\t\t\tmemberVariables[name] = exportedVariable;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn (this.memberVariables = memberVariables);\n\t}\n\n\tinclude(): void {\n\t\tthis.included = true;\n\t\tthis.context.includeAllExports();\n\t}\n\n\tprepare(accessedGlobalsByScope: Map>): void {\n\t\tif (this.mergedNamespaces.length > 0) {\n\t\t\tthis.module.scope.addAccessedGlobals([MERGE_NAMESPACES_VARIABLE], accessedGlobalsByScope);\n\t\t}\n\t}\n\n\trenderBlock(options: RenderOptions): string {\n\t\tconst {\n\t\t\texportNamesByVariable,\n\t\t\tformat,\n\t\t\tfreeze,\n\t\t\tindent: t,\n\t\t\tnamespaceToStringTag,\n\t\t\tsnippets: { _, cnst, getObject, getPropertyAccess, n, s }\n\t\t} = options;\n\t\tconst memberVariables = this.getMemberVariables();\n\t\tconst members: [key: string | null, value: string][] = Object.entries(memberVariables).map(\n\t\t\t([name, original]) => {\n\t\t\t\tif (this.referencedEarly || original.isReassigned) {\n\t\t\t\t\treturn [\n\t\t\t\t\t\tnull,\n\t\t\t\t\t\t`get ${name}${_}()${_}{${_}return ${original.getName(getPropertyAccess)}${s}${_}}`\n\t\t\t\t\t];\n\t\t\t\t}\n\n\t\t\t\treturn [name, original.getName(getPropertyAccess)];\n\t\t\t}\n\t\t);\n\t\tmembers.unshift([null, `__proto__:${_}null`]);\n\n\t\tlet output = getObject(members, { lineBreakIndent: { base: '', t } });\n\t\tif (this.mergedNamespaces.length > 0) {\n\t\t\tconst assignmentArgs = this.mergedNamespaces.map(variable =>\n\t\t\t\tvariable.getName(getPropertyAccess)\n\t\t\t);\n\t\t\toutput = `/*#__PURE__*/${MERGE_NAMESPACES_VARIABLE}(${output},${_}[${assignmentArgs.join(\n\t\t\t\t`,${_}`\n\t\t\t)}])`;\n\t\t} else {\n\t\t\t// The helper to merge namespaces will also take care of freezing and toStringTag\n\t\t\tif (namespaceToStringTag) {\n\t\t\t\toutput = `/*#__PURE__*/Object.defineProperty(${output},${_}Symbol.toStringTag,${_}${getToStringTagValue(\n\t\t\t\t\tgetObject\n\t\t\t\t)})`;\n\t\t\t}\n\t\t\tif (freeze) {\n\t\t\t\toutput = `/*#__PURE__*/Object.freeze(${output})`;\n\t\t\t}\n\t\t}\n\n\t\tconst name = this.getName(getPropertyAccess);\n\t\toutput = `${cnst} ${name}${_}=${_}${output};`;\n\n\t\tif (format === 'system' && exportNamesByVariable.has(this)) {\n\t\t\toutput += `${n}${getSystemExportStatement([this], options)};`;\n\t\t}\n\n\t\treturn output;\n\t}\n\n\trenderFirst(): boolean {\n\t\treturn this.referencedEarly;\n\t}\n\n\tsetMergedNamespaces(mergedNamespaces: readonly Variable[]): void {\n\t\tthis.mergedNamespaces = mergedNamespaces;\n\t\tconst moduleExecIndex = this.context.getModuleExecIndex();\n\t\tfor (const identifier of this.references) {\n\t\t\tif (identifier.context.getModuleExecIndex() <= moduleExecIndex) {\n\t\t\t\tthis.referencedEarly = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n}\n\nNamespaceVariable.prototype.isNamespace = true;\n","import type Module from '../../Module';\nimport type { AstContext } from '../../Module';\nimport ExportDefaultVariable from './ExportDefaultVariable';\nimport Variable from './Variable';\n\nexport default class SyntheticNamedExportVariable extends Variable {\n\tcontext: AstContext;\n\tmodule: Module;\n\tsyntheticNamespace: Variable;\n\n\tprivate baseVariable: Variable | null = null;\n\n\tconstructor(context: AstContext, name: string, syntheticNamespace: Variable) {\n\t\tsuper(name);\n\t\tthis.context = context;\n\t\tthis.module = context.module;\n\t\tthis.syntheticNamespace = syntheticNamespace;\n\t}\n\n\tgetBaseVariable(): Variable {\n\t\tif (this.baseVariable) return this.baseVariable;\n\t\tlet baseVariable = this.syntheticNamespace;\n\t\twhile (\n\t\t\tbaseVariable instanceof ExportDefaultVariable ||\n\t\t\tbaseVariable instanceof SyntheticNamedExportVariable\n\t\t) {\n\t\t\tif (baseVariable instanceof ExportDefaultVariable) {\n\t\t\t\tconst original = baseVariable.getOriginalVariable();\n\t\t\t\tif (original === baseVariable) break;\n\t\t\t\tbaseVariable = original;\n\t\t\t}\n\t\t\tif (baseVariable instanceof SyntheticNamedExportVariable) {\n\t\t\t\tbaseVariable = baseVariable.syntheticNamespace;\n\t\t\t}\n\t\t}\n\t\treturn (this.baseVariable = baseVariable);\n\t}\n\n\tgetBaseVariableName(): string {\n\t\treturn this.syntheticNamespace.getBaseVariableName();\n\t}\n\n\tgetName(getPropertyAccess: (name: string) => string): string {\n\t\treturn `${this.syntheticNamespace.getName(getPropertyAccess)}${getPropertyAccess(this.name)}`;\n\t}\n\n\tinclude(): void {\n\t\tthis.included = true;\n\t\tthis.context.includeVariableInModule(this.syntheticNamespace);\n\t}\n\n\tsetRenderNames(baseName: string | null, name: string | null): void {\n\t\tsuper.setRenderNames(baseName, name);\n\t}\n}\n","export enum BuildPhase {\n\tLOAD_AND_PARSE = 0,\n\tANALYSE,\n\tGENERATE\n}\n","export function getId(m: { id: string | null }): string {\n\treturn m.id!;\n}\n","const global =\n\ttypeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : {};\n\nexport default 'performance' in global\n\t? performance\n\t: {\n\t\t\tnow(): 0 {\n\t\t\t\treturn 0;\n\t\t\t}\n\t };\n","interface MemoryUsage {\n\theapUsed: 0;\n}\n\nexport default {\n\tmemoryUsage(): MemoryUsage {\n\t\treturn {\n\t\t\theapUsed: 0\n\t\t};\n\t}\n};\n","import type { InputOptions, Plugin, SerializedTimings } from '../rollup/types';\nimport performance from './performance';\nimport process from './process';\n\ninterface Timer {\n\tmemory: number;\n\tstartMemory: number;\n\tstartTime: number;\n\ttime: number;\n\ttotalMemory: number;\n}\n\nconst NOOP = (): void => {};\n\nlet timers = new Map();\n\nfunction getPersistedLabel(label: string, level: number): string {\n\tswitch (level) {\n\t\tcase 1:\n\t\t\treturn `# ${label}`;\n\t\tcase 2:\n\t\t\treturn `## ${label}`;\n\t\tcase 3:\n\t\t\treturn label;\n\t\tdefault:\n\t\t\treturn `${' '.repeat(level - 4)}- ${label}`;\n\t}\n}\n\nfunction timeStartImpl(label: string, level = 3): void {\n\tlabel = getPersistedLabel(label, level);\n\n\tconst startMemory = process.memoryUsage().heapUsed;\n\tconst startTime = performance.now();\n\n\tconst timer = timers.get(label);\n\n\tif (timer === undefined) {\n\t\ttimers.set(label, {\n\t\t\tmemory: 0,\n\t\t\tstartMemory,\n\t\t\tstartTime,\n\t\t\ttime: 0,\n\t\t\ttotalMemory: 0\n\t\t});\n\t} else {\n\t\ttimer.startMemory = startMemory;\n\t\ttimer.startTime = startTime;\n\t}\n}\n\nfunction timeEndImpl(label: string, level = 3): void {\n\tlabel = getPersistedLabel(label, level);\n\n\tconst timer = timers.get(label);\n\n\tif (timer !== undefined) {\n\t\tconst currentMemory = process.memoryUsage().heapUsed;\n\t\ttimer.memory += currentMemory - timer.startMemory;\n\t\ttimer.time += performance.now() - timer.startTime;\n\t\ttimer.totalMemory = Math.max(timer.totalMemory, currentMemory);\n\t}\n}\n\nexport function getTimings(): SerializedTimings {\n\tconst newTimings: SerializedTimings = {};\n\n\tfor (const [label, { memory, time, totalMemory }] of timers) {\n\t\tnewTimings[label] = [time, memory, totalMemory];\n\t}\n\treturn newTimings;\n}\n\nexport let timeStart: (label: string, level?: number) => void = NOOP;\nexport let timeEnd: (label: string, level?: number) => void = NOOP;\n\nconst TIMED_PLUGIN_HOOKS = ['load', 'resolveDynamicImport', 'resolveId', 'transform'] as const;\n\nfunction getPluginWithTimers(plugin: any, index: number): Plugin {\n\tfor (const hook of TIMED_PLUGIN_HOOKS) {\n\t\tif (hook in plugin) {\n\t\t\tlet timerLabel = `plugin ${index}`;\n\t\t\tif (plugin.name) {\n\t\t\t\ttimerLabel += ` (${plugin.name})`;\n\t\t\t}\n\t\t\ttimerLabel += ` - ${hook}`;\n\n\t\t\tconst func = plugin[hook];\n\n\t\t\tplugin[hook] = function (...args: readonly unknown[]) {\n\t\t\t\ttimeStart(timerLabel, 4);\n\t\t\t\tconst result = func.apply(this, args);\n\t\t\t\ttimeEnd(timerLabel, 4);\n\t\t\t\tif (result && typeof result.then === 'function') {\n\t\t\t\t\ttimeStart(`${timerLabel} (async)`, 4);\n\t\t\t\t\treturn result.then((hookResult: unknown) => {\n\t\t\t\t\t\ttimeEnd(`${timerLabel} (async)`, 4);\n\t\t\t\t\t\treturn hookResult;\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t};\n\t\t}\n\t}\n\treturn plugin;\n}\n\nexport function initialiseTimers(inputOptions: InputOptions): void {\n\tif (inputOptions.perf) {\n\t\ttimers = new Map();\n\t\ttimeStart = timeStartImpl;\n\t\ttimeEnd = timeEndImpl;\n\t\tinputOptions.plugins = inputOptions.plugins!.map(getPluginWithTimers);\n\t} else {\n\t\ttimeStart = NOOP;\n\t\ttimeEnd = NOOP;\n\t}\n}\n","import ExternalModule from '../ExternalModule';\nimport type Module from '../Module';\n\nexport function markModuleAndImpureDependenciesAsExecuted(baseModule: Module): void {\n\tbaseModule.isExecuted = true;\n\tconst modules = [baseModule];\n\tconst visitedModules = new Set();\n\tfor (const module of modules) {\n\t\tfor (const dependency of [...module.dependencies, ...module.implicitlyLoadedBefore]) {\n\t\t\tif (\n\t\t\t\t!(dependency instanceof ExternalModule) &&\n\t\t\t\t!dependency.isExecuted &&\n\t\t\t\t(dependency.info.moduleSideEffects || module.implicitlyLoadedBefore.has(dependency)) &&\n\t\t\t\t!visitedModules.has(dependency.id)\n\t\t\t) {\n\t\t\t\tdependency.isExecuted = true;\n\t\t\t\tvisitedModules.add(dependency.id);\n\t\t\t\tmodules.push(dependency);\n\t\t\t}\n\t\t}\n\t}\n}\n","import { extractAssignedNames } from '@rollup/pluginutils';\nimport * as acorn from 'acorn';\nimport { locate } from 'locate-character';\nimport MagicString from 'magic-string';\nimport ExternalModule from './ExternalModule';\nimport type Graph from './Graph';\nimport { createHasEffectsContext, createInclusionContext } from './ast/ExecutionContext';\nimport { nodeConstructors } from './ast/nodes';\nimport ExportAllDeclaration from './ast/nodes/ExportAllDeclaration';\nimport ExportDefaultDeclaration from './ast/nodes/ExportDefaultDeclaration';\nimport type ExportNamedDeclaration from './ast/nodes/ExportNamedDeclaration';\nimport type Identifier from './ast/nodes/Identifier';\nimport type ImportDeclaration from './ast/nodes/ImportDeclaration';\nimport type ImportExpression from './ast/nodes/ImportExpression';\nimport Literal from './ast/nodes/Literal';\nimport type MetaProperty from './ast/nodes/MetaProperty';\nimport * as NodeType from './ast/nodes/NodeType';\nimport Program from './ast/nodes/Program';\nimport TemplateLiteral from './ast/nodes/TemplateLiteral';\nimport VariableDeclaration from './ast/nodes/VariableDeclaration';\nimport type { ExpressionNode, NodeBase } from './ast/nodes/shared/Node';\nimport ModuleScope from './ast/scopes/ModuleScope';\nimport { type PathTracker, UNKNOWN_PATH } from './ast/utils/PathTracker';\nimport ExportDefaultVariable from './ast/variables/ExportDefaultVariable';\nimport ExportShimVariable from './ast/variables/ExportShimVariable';\nimport ExternalVariable from './ast/variables/ExternalVariable';\nimport NamespaceVariable from './ast/variables/NamespaceVariable';\nimport SyntheticNamedExportVariable from './ast/variables/SyntheticNamedExportVariable';\nimport type Variable from './ast/variables/Variable';\nimport type {\n\tCustomPluginOptions,\n\tDecodedSourceMapOrMissing,\n\tEmittedFile,\n\tExistingDecodedSourceMap,\n\tModuleInfo,\n\tModuleJSON,\n\tModuleOptions,\n\tNormalizedInputOptions,\n\tPartialNull,\n\tPreserveEntrySignaturesOption,\n\tResolvedId,\n\tResolvedIdMap,\n\tRollupError,\n\tRollupLogProps,\n\tRollupWarning,\n\tTransformModuleJSON\n} from './rollup/types';\nimport { EMPTY_OBJECT } from './utils/blank';\nimport { BuildPhase } from './utils/buildPhase';\nimport {\n\taugmentCodeLocation,\n\terrAmbiguousExternalNamespaces,\n\terrCircularReexport,\n\terrMissingExport,\n\terrNamespaceConflict,\n\terror,\n\terrSyntheticNamedExportsNeedNamespaceExport,\n\twarnDeprecation\n} from './utils/error';\nimport { getId } from './utils/getId';\nimport { getOrCreate } from './utils/getOrCreate';\nimport { getOriginalLocation } from './utils/getOriginalLocation';\nimport { makeLegal } from './utils/identifierHelpers';\nimport { basename, extname } from './utils/path';\nimport relativeId from './utils/relativeId';\nimport type { RenderOptions } from './utils/renderHelpers';\nimport { timeEnd, timeStart } from './utils/timers';\nimport { markModuleAndImpureDependenciesAsExecuted } from './utils/traverseStaticDependencies';\nimport { MISSING_EXPORT_SHIM_VARIABLE } from './utils/variableNames';\n\ninterface ImportDescription {\n\tmodule: Module | ExternalModule;\n\tname: string;\n\tsource: string;\n\tstart: number;\n}\n\ninterface ExportDescription {\n\tidentifier: string | null;\n\tlocalName: string;\n}\n\ninterface ReexportDescription {\n\tlocalName: string;\n\tmodule: Module | ExternalModule;\n\tsource: string;\n\tstart: number;\n}\n\nexport interface AstContext {\n\taddDynamicImport: (node: ImportExpression) => void;\n\taddExport: (\n\t\tnode: ExportAllDeclaration | ExportNamedDeclaration | ExportDefaultDeclaration\n\t) => void;\n\taddImport: (node: ImportDeclaration) => void;\n\taddImportMeta: (node: MetaProperty) => void;\n\tcode: string;\n\tdeoptimizationTracker: PathTracker;\n\terror: (props: RollupError, pos: number) => never;\n\tfileName: string;\n\tgetExports: () => string[];\n\tgetModuleExecIndex: () => number;\n\tgetModuleName: () => string;\n\tgetNodeConstructor: (name: string) => typeof NodeBase;\n\tgetReexports: () => string[];\n\timportDescriptions: Map;\n\tincludeAllExports: () => void;\n\tincludeDynamicImport: (node: ImportExpression) => void;\n\tincludeVariableInModule: (variable: Variable) => void;\n\tmagicString: MagicString;\n\tmodule: Module; // not to be used for tree-shaking\n\tmoduleContext: string;\n\toptions: NormalizedInputOptions;\n\trequestTreeshakingPass: () => void;\n\ttraceExport: (name: string) => Variable | null;\n\ttraceVariable: (name: string) => Variable | null;\n\tusesTopLevelAwait: boolean;\n\twarn: (warning: RollupWarning, pos: number) => void;\n}\n\nexport interface DynamicImport {\n\targument: string | ExpressionNode;\n\tid: string | null;\n\tnode: ImportExpression;\n\tresolution: Module | ExternalModule | string | null;\n}\n\nconst MISSING_EXPORT_SHIM_DESCRIPTION: ExportDescription = {\n\tidentifier: null,\n\tlocalName: MISSING_EXPORT_SHIM_VARIABLE\n};\n\nfunction getVariableForExportNameRecursive(\n\ttarget: Module | ExternalModule,\n\tname: string,\n\timporterForSideEffects: Module | undefined,\n\tisExportAllSearch: boolean | undefined,\n\tsearchedNamesAndModules = new Map>()\n): [variable: Variable | null, indirectExternal?: boolean] {\n\tconst searchedModules = searchedNamesAndModules.get(name);\n\tif (searchedModules) {\n\t\tif (searchedModules.has(target)) {\n\t\t\treturn isExportAllSearch ? [null] : error(errCircularReexport(name, target.id));\n\t\t}\n\t\tsearchedModules.add(target);\n\t} else {\n\t\tsearchedNamesAndModules.set(name, new Set([target]));\n\t}\n\treturn target.getVariableForExportName(name, {\n\t\timporterForSideEffects,\n\t\tisExportAllSearch,\n\t\tsearchedNamesAndModules\n\t});\n}\n\nfunction getAndExtendSideEffectModules(variable: Variable, module: Module): Set {\n\tconst sideEffectModules = getOrCreate(\n\t\tmodule.sideEffectDependenciesByVariable,\n\t\tvariable,\n\t\t() => new Set()\n\t);\n\tlet currentVariable: Variable | null = variable;\n\tconst referencedVariables = new Set([currentVariable]);\n\twhile (true) {\n\t\tconst importingModule = currentVariable.module! as Module;\n\t\tcurrentVariable =\n\t\t\tcurrentVariable instanceof ExportDefaultVariable\n\t\t\t\t? currentVariable.getDirectOriginalVariable()\n\t\t\t\t: currentVariable instanceof SyntheticNamedExportVariable\n\t\t\t\t? currentVariable.syntheticNamespace\n\t\t\t\t: null;\n\t\tif (!currentVariable || referencedVariables.has(currentVariable)) {\n\t\t\tbreak;\n\t\t}\n\t\treferencedVariables.add(currentVariable);\n\t\tsideEffectModules.add(importingModule);\n\t\tconst originalSideEffects =\n\t\t\timportingModule.sideEffectDependenciesByVariable.get(currentVariable);\n\t\tif (originalSideEffects) {\n\t\t\tfor (const module of originalSideEffects) {\n\t\t\t\tsideEffectModules.add(module);\n\t\t\t}\n\t\t}\n\t}\n\treturn sideEffectModules;\n}\n\nexport default class Module {\n\treadonly alternativeReexportModules = new Map();\n\treadonly chunkFileNames = new Set();\n\tchunkNames: {\n\t\tisUserDefined: boolean;\n\t\tname: string;\n\t\tpriority: number;\n\t}[] = [];\n\treadonly cycles = new Set();\n\treadonly dependencies = new Set();\n\treadonly dynamicDependencies = new Set();\n\treadonly dynamicImporters: string[] = [];\n\treadonly dynamicImports: DynamicImport[] = [];\n\texcludeFromSourcemap: boolean;\n\texecIndex = Infinity;\n\treadonly implicitlyLoadedAfter = new Set();\n\treadonly implicitlyLoadedBefore = new Set();\n\treadonly importDescriptions = new Map();\n\treadonly importMetas: MetaProperty[] = [];\n\timportedFromNotTreeshaken = false;\n\treadonly importers: string[] = [];\n\treadonly includedDynamicImporters: Module[] = [];\n\treadonly includedImports = new Set();\n\treadonly info: ModuleInfo;\n\tisExecuted = false;\n\tisUserDefinedEntryPoint = false;\n\tdeclare namespace: NamespaceVariable;\n\tneedsExportShim = false;\n\tdeclare originalCode: string;\n\tdeclare originalSourcemap: ExistingDecodedSourceMap | null;\n\tpreserveSignature: PreserveEntrySignaturesOption;\n\tdeclare resolvedIds: ResolvedIdMap;\n\tdeclare scope: ModuleScope;\n\treadonly sideEffectDependenciesByVariable = new Map>();\n\tdeclare sourcemapChain: DecodedSourceMapOrMissing[];\n\treadonly sources = new Set();\n\tdeclare transformFiles?: EmittedFile[];\n\tusesTopLevelAwait = false;\n\n\tprivate allExportNames: Set | null = null;\n\tprivate ast: Program | null = null;\n\tprivate declare astContext: AstContext;\n\tprivate readonly context: string;\n\tprivate declare customTransformCache: boolean;\n\tprivate readonly exportAllModules: (Module | ExternalModule)[] = [];\n\tprivate readonly exportAllSources = new Set();\n\tprivate exportNamesByVariable: Map | null = null;\n\tprivate readonly exportShimVariable = new ExportShimVariable(this);\n\tprivate readonly exports = new Map();\n\tprivate declare magicString: MagicString;\n\tprivate readonly namespaceReexportsByName = new Map<\n\t\tstring,\n\t\t[variable: Variable | null, indirectExternal?: boolean]\n\t>();\n\tprivate readonly reexportDescriptions = new Map();\n\tprivate relevantDependencies: Set | null = null;\n\tprivate readonly syntheticExports = new Map();\n\tprivate syntheticNamespace: Variable | null | undefined = null;\n\tprivate transformDependencies: string[] = [];\n\tprivate transitiveReexports: string[] | null = null;\n\n\tconstructor(\n\t\tprivate readonly graph: Graph,\n\t\tpublic readonly id: string,\n\t\tprivate readonly options: NormalizedInputOptions,\n\t\tisEntry: boolean,\n\t\tmoduleSideEffects: boolean | 'no-treeshake',\n\t\tsyntheticNamedExports: boolean | string,\n\t\tmeta: CustomPluginOptions\n\t) {\n\t\tthis.excludeFromSourcemap = /\\0/.test(id);\n\t\tthis.context = options.moduleContext(id);\n\t\tthis.preserveSignature = this.options.preserveEntrySignatures;\n\n\t\t// eslint-disable-next-line @typescript-eslint/no-this-alias\n\t\tconst module = this;\n\t\tconst {\n\t\t\tdynamicImports,\n\t\t\tdynamicImporters,\n\t\t\timplicitlyLoadedAfter,\n\t\t\timplicitlyLoadedBefore,\n\t\t\timporters,\n\t\t\treexportDescriptions,\n\t\t\tsources\n\t\t} = this;\n\n\t\tthis.info = {\n\t\t\tast: null,\n\t\t\tcode: null,\n\t\t\tget dynamicallyImportedIdResolutions() {\n\t\t\t\treturn dynamicImports\n\t\t\t\t\t.map(({ argument }) => typeof argument === 'string' && module.resolvedIds[argument])\n\t\t\t\t\t.filter(Boolean) as ResolvedId[];\n\t\t\t},\n\t\t\tget dynamicallyImportedIds() {\n\t\t\t\t// We cannot use this.dynamicDependencies because this is needed before\n\t\t\t\t// dynamicDependencies are populated\n\t\t\t\treturn dynamicImports.map(({ id }) => id).filter((id): id is string => id != null);\n\t\t\t},\n\t\t\tget dynamicImporters() {\n\t\t\t\treturn dynamicImporters.sort();\n\t\t\t},\n\t\t\tget hasDefaultExport() {\n\t\t\t\t// This information is only valid after parsing\n\t\t\t\tif (!module.ast) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\treturn module.exports.has('default') || reexportDescriptions.has('default');\n\t\t\t},\n\t\t\tget hasModuleSideEffects() {\n\t\t\t\twarnDeprecation(\n\t\t\t\t\t'Accessing ModuleInfo.hasModuleSideEffects from plugins is deprecated. Please use ModuleInfo.moduleSideEffects instead.',\n\t\t\t\t\tfalse,\n\t\t\t\t\toptions\n\t\t\t\t);\n\t\t\t\treturn this.moduleSideEffects;\n\t\t\t},\n\t\t\tid,\n\t\t\tget implicitlyLoadedAfterOneOf() {\n\t\t\t\treturn Array.from(implicitlyLoadedAfter, getId).sort();\n\t\t\t},\n\t\t\tget implicitlyLoadedBefore() {\n\t\t\t\treturn Array.from(implicitlyLoadedBefore, getId).sort();\n\t\t\t},\n\t\t\tget importedIdResolutions() {\n\t\t\t\treturn Array.from(sources, source => module.resolvedIds[source]).filter(Boolean);\n\t\t\t},\n\t\t\tget importedIds() {\n\t\t\t\t// We cannot use this.dependencies because this is needed before\n\t\t\t\t// dependencies are populated\n\t\t\t\treturn Array.from(sources, source => module.resolvedIds[source]?.id).filter(Boolean);\n\t\t\t},\n\t\t\tget importers() {\n\t\t\t\treturn importers.sort();\n\t\t\t},\n\t\t\tisEntry,\n\t\t\tisExternal: false,\n\t\t\tget isIncluded() {\n\t\t\t\tif (graph.phase !== BuildPhase.GENERATE) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\treturn module.isIncluded();\n\t\t\t},\n\t\t\tmeta: { ...meta },\n\t\t\tmoduleSideEffects,\n\t\t\tsyntheticNamedExports\n\t\t};\n\t\t// Hide the deprecated key so that it only warns when accessed explicitly\n\t\tObject.defineProperty(this.info, 'hasModuleSideEffects', {\n\t\t\tenumerable: false\n\t\t});\n\t}\n\n\tbasename(): string {\n\t\tconst base = basename(this.id);\n\t\tconst ext = extname(this.id);\n\n\t\treturn makeLegal(ext ? base.slice(0, -ext.length) : base);\n\t}\n\n\tbindReferences(): void {\n\t\tthis.ast!.bind();\n\t}\n\n\terror(props: RollupError, pos: number): never {\n\t\tthis.addLocationToLogProps(props, pos);\n\t\treturn error(props);\n\t}\n\n\tgetAllExportNames(): Set {\n\t\tif (this.allExportNames) {\n\t\t\treturn this.allExportNames;\n\t\t}\n\t\tthis.allExportNames = new Set([...this.exports.keys(), ...this.reexportDescriptions.keys()]);\n\t\tfor (const module of this.exportAllModules) {\n\t\t\tif (module instanceof ExternalModule) {\n\t\t\t\tthis.allExportNames.add(`*${module.id}`);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tfor (const name of module.getAllExportNames()) {\n\t\t\t\tif (name !== 'default') this.allExportNames.add(name);\n\t\t\t}\n\t\t}\n\t\t// We do not count the synthetic namespace as a regular export to hide it\n\t\t// from entry signatures and namespace objects\n\t\tif (typeof this.info.syntheticNamedExports === 'string') {\n\t\t\tthis.allExportNames.delete(this.info.syntheticNamedExports);\n\t\t}\n\t\treturn this.allExportNames;\n\t}\n\n\tgetDependenciesToBeIncluded(): Set {\n\t\tif (this.relevantDependencies) return this.relevantDependencies;\n\n\t\tthis.relevantDependencies = new Set();\n\t\tconst necessaryDependencies = new Set();\n\t\tconst alwaysCheckedDependencies = new Set();\n\t\tconst dependencyVariables = new Set(this.includedImports);\n\n\t\tif (\n\t\t\tthis.info.isEntry ||\n\t\t\tthis.includedDynamicImporters.length > 0 ||\n\t\t\tthis.namespace.included ||\n\t\t\tthis.implicitlyLoadedAfter.size > 0\n\t\t) {\n\t\t\tfor (const exportName of [...this.getReexports(), ...this.getExports()]) {\n\t\t\t\tconst [exportedVariable] = this.getVariableForExportName(exportName);\n\t\t\t\tif (exportedVariable) {\n\t\t\t\t\tdependencyVariables.add(exportedVariable);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor (let variable of dependencyVariables) {\n\t\t\tconst sideEffectDependencies = this.sideEffectDependenciesByVariable.get(variable);\n\t\t\tif (sideEffectDependencies) {\n\t\t\t\tfor (const module of sideEffectDependencies) {\n\t\t\t\t\talwaysCheckedDependencies.add(module);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (variable instanceof SyntheticNamedExportVariable) {\n\t\t\t\tvariable = variable.getBaseVariable();\n\t\t\t} else if (variable instanceof ExportDefaultVariable) {\n\t\t\t\tvariable = variable.getOriginalVariable();\n\t\t\t}\n\t\t\tnecessaryDependencies.add(variable.module!);\n\t\t}\n\t\tif (!this.options.treeshake || this.info.moduleSideEffects === 'no-treeshake') {\n\t\t\tfor (const dependency of this.dependencies) {\n\t\t\t\tthis.relevantDependencies.add(dependency);\n\t\t\t}\n\t\t} else {\n\t\t\tthis.addRelevantSideEffectDependencies(\n\t\t\t\tthis.relevantDependencies,\n\t\t\t\tnecessaryDependencies,\n\t\t\t\talwaysCheckedDependencies\n\t\t\t);\n\t\t}\n\t\tfor (const dependency of necessaryDependencies) {\n\t\t\tthis.relevantDependencies.add(dependency);\n\t\t}\n\t\treturn this.relevantDependencies;\n\t}\n\n\tgetExportNamesByVariable(): Map {\n\t\tif (this.exportNamesByVariable) {\n\t\t\treturn this.exportNamesByVariable;\n\t\t}\n\t\tconst exportNamesByVariable = new Map();\n\t\tfor (const exportName of this.getAllExportNames()) {\n\t\t\tlet [tracedVariable] = this.getVariableForExportName(exportName);\n\t\t\tif (tracedVariable instanceof ExportDefaultVariable) {\n\t\t\t\ttracedVariable = tracedVariable.getOriginalVariable();\n\t\t\t}\n\t\t\tif (\n\t\t\t\t!tracedVariable ||\n\t\t\t\t!(tracedVariable.included || tracedVariable instanceof ExternalVariable)\n\t\t\t) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst existingExportNames = exportNamesByVariable.get(tracedVariable);\n\t\t\tif (existingExportNames) {\n\t\t\t\texistingExportNames.push(exportName);\n\t\t\t} else {\n\t\t\t\texportNamesByVariable.set(tracedVariable, [exportName]);\n\t\t\t}\n\t\t}\n\t\treturn (this.exportNamesByVariable = exportNamesByVariable);\n\t}\n\n\tgetExports(): string[] {\n\t\treturn Array.from(this.exports.keys());\n\t}\n\n\tgetReexports(): string[] {\n\t\tif (this.transitiveReexports) {\n\t\t\treturn this.transitiveReexports;\n\t\t}\n\t\t// to avoid infinite recursion when using circular `export * from X`\n\t\tthis.transitiveReexports = [];\n\n\t\tconst reexports = new Set(this.reexportDescriptions.keys());\n\n\t\tfor (const module of this.exportAllModules) {\n\t\t\tif (module instanceof ExternalModule) {\n\t\t\t\treexports.add(`*${module.id}`);\n\t\t\t} else {\n\t\t\t\tfor (const name of [...module.getReexports(), ...module.getExports()]) {\n\t\t\t\t\tif (name !== 'default') reexports.add(name);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn (this.transitiveReexports = [...reexports]);\n\t}\n\n\tgetRenderedExports(): { removedExports: string[]; renderedExports: string[] } {\n\t\t// only direct exports are counted here, not reexports at all\n\t\tconst renderedExports: string[] = [];\n\t\tconst removedExports: string[] = [];\n\t\tfor (const exportName of this.exports.keys()) {\n\t\t\tconst [variable] = this.getVariableForExportName(exportName);\n\t\t\t(variable && variable.included ? renderedExports : removedExports).push(exportName);\n\t\t}\n\t\treturn { removedExports, renderedExports };\n\t}\n\n\tgetSyntheticNamespace(): Variable {\n\t\tif (this.syntheticNamespace === null) {\n\t\t\tthis.syntheticNamespace = undefined;\n\t\t\t[this.syntheticNamespace] = this.getVariableForExportName(\n\t\t\t\ttypeof this.info.syntheticNamedExports === 'string'\n\t\t\t\t\t? this.info.syntheticNamedExports\n\t\t\t\t\t: 'default',\n\t\t\t\t{ onlyExplicit: true }\n\t\t\t);\n\t\t}\n\t\tif (!this.syntheticNamespace) {\n\t\t\treturn error(\n\t\t\t\terrSyntheticNamedExportsNeedNamespaceExport(this.id, this.info.syntheticNamedExports)\n\t\t\t);\n\t\t}\n\t\treturn this.syntheticNamespace;\n\t}\n\n\tgetVariableForExportName(\n\t\tname: string,\n\t\t{\n\t\t\timporterForSideEffects,\n\t\t\tisExportAllSearch,\n\t\t\tonlyExplicit,\n\t\t\tsearchedNamesAndModules\n\t\t}: {\n\t\t\timporterForSideEffects?: Module;\n\t\t\tisExportAllSearch?: boolean;\n\t\t\tonlyExplicit?: boolean;\n\t\t\tsearchedNamesAndModules?: Map>;\n\t\t} = EMPTY_OBJECT\n\t): [variable: Variable | null, indirectExternal?: boolean] {\n\t\tif (name[0] === '*') {\n\t\t\tif (name.length === 1) {\n\t\t\t\t// export * from './other'\n\t\t\t\treturn [this.namespace];\n\t\t\t}\n\t\t\t// export * from 'external'\n\t\t\tconst module = this.graph.modulesById.get(name.slice(1)) as ExternalModule;\n\t\t\treturn module.getVariableForExportName('*');\n\t\t}\n\n\t\t// export { foo } from './other'\n\t\tconst reexportDeclaration = this.reexportDescriptions.get(name);\n\t\tif (reexportDeclaration) {\n\t\t\tconst [variable] = getVariableForExportNameRecursive(\n\t\t\t\treexportDeclaration.module,\n\t\t\t\treexportDeclaration.localName,\n\t\t\t\timporterForSideEffects,\n\t\t\t\tfalse,\n\t\t\t\tsearchedNamesAndModules\n\t\t\t);\n\t\t\tif (!variable) {\n\t\t\t\treturn this.error(\n\t\t\t\t\terrMissingExport(reexportDeclaration.localName, this.id, reexportDeclaration.module.id),\n\t\t\t\t\treexportDeclaration.start\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (importerForSideEffects) {\n\t\t\t\tsetAlternativeExporterIfCyclic(variable, importerForSideEffects, this);\n\t\t\t}\n\t\t\treturn [variable];\n\t\t}\n\n\t\tconst exportDeclaration = this.exports.get(name);\n\t\tif (exportDeclaration) {\n\t\t\tif (exportDeclaration === MISSING_EXPORT_SHIM_DESCRIPTION) {\n\t\t\t\treturn [this.exportShimVariable];\n\t\t\t}\n\t\t\tconst name = exportDeclaration.localName;\n\t\t\tconst variable = this.traceVariable(name, {\n\t\t\t\timporterForSideEffects,\n\t\t\t\tsearchedNamesAndModules\n\t\t\t})!;\n\t\t\tif (importerForSideEffects) {\n\t\t\t\tgetOrCreate(\n\t\t\t\t\timporterForSideEffects.sideEffectDependenciesByVariable,\n\t\t\t\t\tvariable,\n\t\t\t\t\t() => new Set()\n\t\t\t\t).add(this);\n\t\t\t\tsetAlternativeExporterIfCyclic(variable, importerForSideEffects, this);\n\t\t\t}\n\t\t\treturn [variable];\n\t\t}\n\n\t\tif (onlyExplicit) {\n\t\t\treturn [null];\n\t\t}\n\n\t\tif (name !== 'default') {\n\t\t\tconst foundNamespaceReexport =\n\t\t\t\tthis.namespaceReexportsByName.get(name) ??\n\t\t\t\tthis.getVariableFromNamespaceReexports(\n\t\t\t\t\tname,\n\t\t\t\t\timporterForSideEffects,\n\t\t\t\t\tsearchedNamesAndModules\n\t\t\t\t);\n\t\t\tthis.namespaceReexportsByName.set(name, foundNamespaceReexport);\n\t\t\tif (foundNamespaceReexport[0]) {\n\t\t\t\treturn foundNamespaceReexport;\n\t\t\t}\n\t\t}\n\n\t\tif (this.info.syntheticNamedExports) {\n\t\t\treturn [\n\t\t\t\tgetOrCreate(\n\t\t\t\t\tthis.syntheticExports,\n\t\t\t\t\tname,\n\t\t\t\t\t() =>\n\t\t\t\t\t\tnew SyntheticNamedExportVariable(this.astContext, name, this.getSyntheticNamespace())\n\t\t\t\t)\n\t\t\t];\n\t\t}\n\n\t\t// we don't want to create shims when we are just\n\t\t// probing export * modules for exports\n\t\tif (!isExportAllSearch) {\n\t\t\tif (this.options.shimMissingExports) {\n\t\t\t\tthis.shimMissingExport(name);\n\t\t\t\treturn [this.exportShimVariable];\n\t\t\t}\n\t\t}\n\t\treturn [null];\n\t}\n\n\thasEffects(): boolean {\n\t\treturn (\n\t\t\tthis.info.moduleSideEffects === 'no-treeshake' ||\n\t\t\t(this.ast!.included && this.ast!.hasEffects(createHasEffectsContext()))\n\t\t);\n\t}\n\n\tinclude(): void {\n\t\tconst context = createInclusionContext();\n\t\tif (this.ast!.shouldBeIncluded(context)) this.ast!.include(context, false);\n\t}\n\n\tincludeAllExports(includeNamespaceMembers: boolean): void {\n\t\tif (!this.isExecuted) {\n\t\t\tmarkModuleAndImpureDependenciesAsExecuted(this);\n\t\t\tthis.graph.needsTreeshakingPass = true;\n\t\t}\n\n\t\tfor (const exportName of this.exports.keys()) {\n\t\t\tif (includeNamespaceMembers || exportName !== this.info.syntheticNamedExports) {\n\t\t\t\tconst variable = this.getVariableForExportName(exportName)[0]!;\n\t\t\t\tvariable.deoptimizePath(UNKNOWN_PATH);\n\t\t\t\tif (!variable.included) {\n\t\t\t\t\tthis.includeVariable(variable);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor (const name of this.getReexports()) {\n\t\t\tconst [variable] = this.getVariableForExportName(name);\n\t\t\tif (variable) {\n\t\t\t\tvariable.deoptimizePath(UNKNOWN_PATH);\n\t\t\t\tif (!variable.included) {\n\t\t\t\t\tthis.includeVariable(variable);\n\t\t\t\t}\n\t\t\t\tif (variable instanceof ExternalVariable) {\n\t\t\t\t\tvariable.module.reexported = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (includeNamespaceMembers) {\n\t\t\tthis.namespace.setMergedNamespaces(this.includeAndGetAdditionalMergedNamespaces());\n\t\t}\n\t}\n\n\tincludeAllInBundle(): void {\n\t\tthis.ast!.include(createInclusionContext(), true);\n\t\tthis.includeAllExports(false);\n\t}\n\n\tisIncluded(): boolean {\n\t\treturn this.ast!.included || this.namespace.included || this.importedFromNotTreeshaken;\n\t}\n\n\tlinkImports(): void {\n\t\tthis.addModulesToImportDescriptions(this.importDescriptions);\n\t\tthis.addModulesToImportDescriptions(this.reexportDescriptions);\n\t\tconst externalExportAllModules: ExternalModule[] = [];\n\t\tfor (const source of this.exportAllSources) {\n\t\t\tconst module = this.graph.modulesById.get(this.resolvedIds[source].id)!;\n\t\t\tif (module instanceof ExternalModule) {\n\t\t\t\texternalExportAllModules.push(module);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tthis.exportAllModules.push(module);\n\t\t}\n\t\tthis.exportAllModules.push(...externalExportAllModules);\n\t}\n\n\trender(options: RenderOptions): MagicString {\n\t\tconst magicString = this.magicString.clone();\n\t\tthis.ast!.render(magicString, options);\n\t\tthis.usesTopLevelAwait = this.astContext.usesTopLevelAwait;\n\t\treturn magicString;\n\t}\n\n\tsetSource({\n\t\tast,\n\t\tcode,\n\t\tcustomTransformCache,\n\t\toriginalCode,\n\t\toriginalSourcemap,\n\t\tresolvedIds,\n\t\tsourcemapChain,\n\t\ttransformDependencies,\n\t\ttransformFiles,\n\t\t...moduleOptions\n\t}: TransformModuleJSON & {\n\t\tresolvedIds?: ResolvedIdMap;\n\t\ttransformFiles?: EmittedFile[] | undefined;\n\t}): void {\n\t\tthis.info.code = code;\n\t\tthis.originalCode = originalCode;\n\t\tthis.originalSourcemap = originalSourcemap;\n\t\tthis.sourcemapChain = sourcemapChain;\n\t\tif (transformFiles) {\n\t\t\tthis.transformFiles = transformFiles;\n\t\t}\n\t\tthis.transformDependencies = transformDependencies;\n\t\tthis.customTransformCache = customTransformCache;\n\t\tthis.updateOptions(moduleOptions);\n\n\t\ttimeStart('generate ast', 3);\n\n\t\tif (!ast) {\n\t\t\tast = this.tryParse();\n\t\t}\n\n\t\ttimeEnd('generate ast', 3);\n\n\t\tthis.resolvedIds = resolvedIds || Object.create(null);\n\n\t\t// By default, `id` is the file name. Custom resolvers and loaders\n\t\t// can change that, but it makes sense to use it for the source file name\n\t\tconst fileName = this.id;\n\n\t\tthis.magicString = new MagicString(code, {\n\t\t\tfilename: (this.excludeFromSourcemap ? null : fileName)!, // don't include plugin helpers in sourcemap\n\t\t\tindentExclusionRanges: []\n\t\t});\n\n\t\ttimeStart('analyse ast', 3);\n\n\t\tthis.astContext = {\n\t\t\taddDynamicImport: this.addDynamicImport.bind(this),\n\t\t\taddExport: this.addExport.bind(this),\n\t\t\taddImport: this.addImport.bind(this),\n\t\t\taddImportMeta: this.addImportMeta.bind(this),\n\t\t\tcode, // Only needed for debugging\n\t\t\tdeoptimizationTracker: this.graph.deoptimizationTracker,\n\t\t\terror: this.error.bind(this),\n\t\t\tfileName, // Needed for warnings\n\t\t\tgetExports: this.getExports.bind(this),\n\t\t\tgetModuleExecIndex: () => this.execIndex,\n\t\t\tgetModuleName: this.basename.bind(this),\n\t\t\tgetNodeConstructor: (name: string) => nodeConstructors[name] || nodeConstructors.UnknownNode,\n\t\t\tgetReexports: this.getReexports.bind(this),\n\t\t\timportDescriptions: this.importDescriptions,\n\t\t\tincludeAllExports: () => this.includeAllExports(true),\n\t\t\tincludeDynamicImport: this.includeDynamicImport.bind(this),\n\t\t\tincludeVariableInModule: this.includeVariableInModule.bind(this),\n\t\t\tmagicString: this.magicString,\n\t\t\tmodule: this,\n\t\t\tmoduleContext: this.context,\n\t\t\toptions: this.options,\n\t\t\trequestTreeshakingPass: () => (this.graph.needsTreeshakingPass = true),\n\t\t\ttraceExport: (name: string) => this.getVariableForExportName(name)[0],\n\t\t\ttraceVariable: this.traceVariable.bind(this),\n\t\t\tusesTopLevelAwait: false,\n\t\t\twarn: this.warn.bind(this)\n\t\t};\n\n\t\tthis.scope = new ModuleScope(this.graph.scope, this.astContext);\n\t\tthis.namespace = new NamespaceVariable(this.astContext);\n\t\tthis.ast = new Program(ast, { context: this.astContext, type: 'Module' }, this.scope);\n\t\tthis.info.ast = ast;\n\n\t\ttimeEnd('analyse ast', 3);\n\t}\n\n\ttoJSON(): ModuleJSON {\n\t\treturn {\n\t\t\tast: this.ast!.esTreeNode,\n\t\t\tcode: this.info.code!,\n\t\t\tcustomTransformCache: this.customTransformCache,\n\t\t\tdependencies: Array.from(this.dependencies, getId),\n\t\t\tid: this.id,\n\t\t\tmeta: this.info.meta,\n\t\t\tmoduleSideEffects: this.info.moduleSideEffects,\n\t\t\toriginalCode: this.originalCode,\n\t\t\toriginalSourcemap: this.originalSourcemap,\n\t\t\tresolvedIds: this.resolvedIds,\n\t\t\tsourcemapChain: this.sourcemapChain,\n\t\t\tsyntheticNamedExports: this.info.syntheticNamedExports,\n\t\t\ttransformDependencies: this.transformDependencies,\n\t\t\ttransformFiles: this.transformFiles\n\t\t};\n\t}\n\n\ttraceVariable(\n\t\tname: string,\n\t\t{\n\t\t\timporterForSideEffects,\n\t\t\tisExportAllSearch,\n\t\t\tsearchedNamesAndModules\n\t\t}: {\n\t\t\timporterForSideEffects?: Module;\n\t\t\tisExportAllSearch?: boolean;\n\t\t\tsearchedNamesAndModules?: Map>;\n\t\t} = EMPTY_OBJECT\n\t): Variable | null {\n\t\tconst localVariable = this.scope.variables.get(name);\n\t\tif (localVariable) {\n\t\t\treturn localVariable;\n\t\t}\n\n\t\tconst importDeclaration = this.importDescriptions.get(name);\n\t\tif (importDeclaration) {\n\t\t\tconst otherModule = importDeclaration.module;\n\n\t\t\tif (otherModule instanceof Module && importDeclaration.name === '*') {\n\t\t\t\treturn otherModule.namespace;\n\t\t\t}\n\n\t\t\tconst [declaration] = getVariableForExportNameRecursive(\n\t\t\t\totherModule,\n\t\t\t\timportDeclaration.name,\n\t\t\t\timporterForSideEffects || this,\n\t\t\t\tisExportAllSearch,\n\t\t\t\tsearchedNamesAndModules\n\t\t\t);\n\n\t\t\tif (!declaration) {\n\t\t\t\treturn this.error(\n\t\t\t\t\terrMissingExport(importDeclaration.name, this.id, otherModule.id),\n\t\t\t\t\timportDeclaration.start\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn declaration;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\ttryParse(): acorn.Node {\n\t\ttry {\n\t\t\treturn this.graph.contextParse(this.info.code!);\n\t\t} catch (err: any) {\n\t\t\tlet message = err.message.replace(/ \\(\\d+:\\d+\\)$/, '');\n\t\t\tif (this.id.endsWith('.json')) {\n\t\t\t\tmessage += ' (Note that you need @rollup/plugin-json to import JSON files)';\n\t\t\t} else if (!this.id.endsWith('.js')) {\n\t\t\t\tmessage += ' (Note that you need plugins to import files that are not JavaScript)';\n\t\t\t}\n\t\t\treturn this.error(\n\t\t\t\t{\n\t\t\t\t\tcode: 'PARSE_ERROR',\n\t\t\t\t\tmessage,\n\t\t\t\t\tparserError: err\n\t\t\t\t},\n\t\t\t\terr.pos\n\t\t\t);\n\t\t}\n\t}\n\n\tupdateOptions({\n\t\tmeta,\n\t\tmoduleSideEffects,\n\t\tsyntheticNamedExports\n\t}: Partial>): void {\n\t\tif (moduleSideEffects != null) {\n\t\t\tthis.info.moduleSideEffects = moduleSideEffects;\n\t\t}\n\t\tif (syntheticNamedExports != null) {\n\t\t\tthis.info.syntheticNamedExports = syntheticNamedExports;\n\t\t}\n\t\tif (meta != null) {\n\t\t\tObject.assign(this.info.meta, meta);\n\t\t}\n\t}\n\n\twarn(props: RollupWarning, pos: number): void {\n\t\tthis.addLocationToLogProps(props, pos);\n\t\tthis.options.onwarn(props);\n\t}\n\n\tprivate addDynamicImport(node: ImportExpression) {\n\t\tlet argument: ExpressionNode | string = node.source;\n\t\tif (argument instanceof TemplateLiteral) {\n\t\t\tif (argument.quasis.length === 1 && argument.quasis[0].value.cooked) {\n\t\t\t\targument = argument.quasis[0].value.cooked;\n\t\t\t}\n\t\t} else if (argument instanceof Literal && typeof argument.value === 'string') {\n\t\t\targument = argument.value;\n\t\t}\n\t\tthis.dynamicImports.push({ argument, id: null, node, resolution: null });\n\t}\n\n\tprivate addExport(\n\t\tnode: ExportAllDeclaration | ExportNamedDeclaration | ExportDefaultDeclaration\n\t): void {\n\t\tif (node instanceof ExportDefaultDeclaration) {\n\t\t\t// export default foo;\n\n\t\t\tthis.exports.set('default', {\n\t\t\t\tidentifier: node.variable.getAssignedVariableName(),\n\t\t\t\tlocalName: 'default'\n\t\t\t});\n\t\t} else if (node instanceof ExportAllDeclaration) {\n\t\t\tconst source = node.source.value;\n\t\t\tthis.sources.add(source);\n\t\t\tif (node.exported) {\n\t\t\t\t// export * as name from './other'\n\n\t\t\t\tconst name = node.exported.name;\n\t\t\t\tthis.reexportDescriptions.set(name, {\n\t\t\t\t\tlocalName: '*',\n\t\t\t\t\tmodule: null as never, // filled in later,\n\t\t\t\t\tsource,\n\t\t\t\t\tstart: node.start\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\t// export * from './other'\n\n\t\t\t\tthis.exportAllSources.add(source);\n\t\t\t}\n\t\t} else if (node.source instanceof Literal) {\n\t\t\t// export { name } from './other'\n\n\t\t\tconst source = node.source.value;\n\t\t\tthis.sources.add(source);\n\t\t\tfor (const specifier of node.specifiers) {\n\t\t\t\tconst name = specifier.exported.name;\n\t\t\t\tthis.reexportDescriptions.set(name, {\n\t\t\t\t\tlocalName: specifier.local.name,\n\t\t\t\t\tmodule: null as never, // filled in later,\n\t\t\t\t\tsource,\n\t\t\t\t\tstart: specifier.start\n\t\t\t\t});\n\t\t\t}\n\t\t} else if (node.declaration) {\n\t\t\tconst declaration = node.declaration;\n\t\t\tif (declaration instanceof VariableDeclaration) {\n\t\t\t\t// export var { foo, bar } = ...\n\t\t\t\t// export var foo = 1, bar = 2;\n\n\t\t\t\tfor (const declarator of declaration.declarations) {\n\t\t\t\t\tfor (const localName of extractAssignedNames(declarator.id)) {\n\t\t\t\t\t\tthis.exports.set(localName, { identifier: null, localName });\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// export function foo () {}\n\n\t\t\t\tconst localName = (declaration.id as Identifier).name;\n\t\t\t\tthis.exports.set(localName, { identifier: null, localName });\n\t\t\t}\n\t\t} else {\n\t\t\t// export { foo, bar, baz }\n\n\t\t\tfor (const specifier of node.specifiers) {\n\t\t\t\tconst localName = specifier.local.name;\n\t\t\t\tconst exportedName = specifier.exported.name;\n\t\t\t\tthis.exports.set(exportedName, { identifier: null, localName });\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate addImport(node: ImportDeclaration): void {\n\t\tconst source = node.source.value;\n\t\tthis.sources.add(source);\n\t\tfor (const specifier of node.specifiers) {\n\t\t\tconst isDefault = specifier.type === NodeType.ImportDefaultSpecifier;\n\t\t\tconst isNamespace = specifier.type === NodeType.ImportNamespaceSpecifier;\n\n\t\t\tconst name = isDefault ? 'default' : isNamespace ? '*' : specifier.imported.name;\n\t\t\tthis.importDescriptions.set(specifier.local.name, {\n\t\t\t\tmodule: null as never, // filled in later\n\t\t\t\tname,\n\t\t\t\tsource,\n\t\t\t\tstart: specifier.start\n\t\t\t});\n\t\t}\n\t}\n\n\tprivate addImportMeta(node: MetaProperty): void {\n\t\tthis.importMetas.push(node);\n\t}\n\n\tprivate addLocationToLogProps(props: RollupLogProps, pos: number): void {\n\t\tprops.id = this.id;\n\t\tprops.pos = pos;\n\t\tlet code = this.info.code;\n\t\tconst location = locate(code!, pos, { offsetLine: 1 });\n\t\tif (location) {\n\t\t\tlet { column, line } = location;\n\t\t\ttry {\n\t\t\t\t({ column, line } = getOriginalLocation(this.sourcemapChain, { column, line }));\n\t\t\t\tcode = this.originalCode;\n\t\t\t} catch (err: any) {\n\t\t\t\tthis.options.onwarn({\n\t\t\t\t\tcode: 'SOURCEMAP_ERROR',\n\t\t\t\t\tid: this.id,\n\t\t\t\t\tloc: {\n\t\t\t\t\t\tcolumn,\n\t\t\t\t\t\tfile: this.id,\n\t\t\t\t\t\tline\n\t\t\t\t\t},\n\t\t\t\t\tmessage: `Error when using sourcemap for reporting an error: ${err.message}`,\n\t\t\t\t\tpos\n\t\t\t\t});\n\t\t\t}\n\t\t\taugmentCodeLocation(props, { column, line }, code!, this.id);\n\t\t}\n\t}\n\n\tprivate addModulesToImportDescriptions(\n\t\timportDescription: ReadonlyMap\n\t): void {\n\t\tfor (const specifier of importDescription.values()) {\n\t\t\tconst { id } = this.resolvedIds[specifier.source];\n\t\t\tspecifier.module = this.graph.modulesById.get(id)!;\n\t\t}\n\t}\n\n\tprivate addRelevantSideEffectDependencies(\n\t\trelevantDependencies: Set,\n\t\tnecessaryDependencies: ReadonlySet,\n\t\talwaysCheckedDependencies: ReadonlySet\n\t): void {\n\t\tconst handledDependencies = new Set();\n\n\t\tconst addSideEffectDependencies = (\n\t\t\tpossibleDependencies: ReadonlySet\n\t\t) => {\n\t\t\tfor (const dependency of possibleDependencies) {\n\t\t\t\tif (handledDependencies.has(dependency)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\thandledDependencies.add(dependency);\n\t\t\t\tif (necessaryDependencies.has(dependency)) {\n\t\t\t\t\trelevantDependencies.add(dependency);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (!(dependency.info.moduleSideEffects || alwaysCheckedDependencies.has(dependency))) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (dependency instanceof ExternalModule || dependency.hasEffects()) {\n\t\t\t\t\trelevantDependencies.add(dependency);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\taddSideEffectDependencies(dependency.dependencies);\n\t\t\t}\n\t\t};\n\n\t\taddSideEffectDependencies(this.dependencies);\n\t\taddSideEffectDependencies(alwaysCheckedDependencies);\n\t}\n\n\tprivate getVariableFromNamespaceReexports(\n\t\tname: string,\n\t\timporterForSideEffects?: Module,\n\t\tsearchedNamesAndModules?: Map>\n\t): [variable: Variable | null, indirectExternal?: boolean] {\n\t\tlet foundSyntheticDeclaration: SyntheticNamedExportVariable | null = null;\n\t\tconst foundInternalDeclarations = new Map();\n\t\tconst foundExternalDeclarations = new Set();\n\t\tfor (const module of this.exportAllModules) {\n\t\t\t// Synthetic namespaces should not hide \"regular\" exports of the same name\n\t\t\tif (module.info.syntheticNamedExports === name) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst [variable, indirectExternal] = getVariableForExportNameRecursive(\n\t\t\t\tmodule,\n\t\t\t\tname,\n\t\t\t\timporterForSideEffects,\n\t\t\t\ttrue,\n\t\t\t\t// We are creating a copy to handle the case where the same binding is\n\t\t\t\t// imported through different namespace reexports gracefully\n\t\t\t\tcopyNameToModulesMap(searchedNamesAndModules)\n\t\t\t);\n\n\t\t\tif (module instanceof ExternalModule || indirectExternal) {\n\t\t\t\tfoundExternalDeclarations.add(variable as ExternalVariable);\n\t\t\t} else if (variable instanceof SyntheticNamedExportVariable) {\n\t\t\t\tif (!foundSyntheticDeclaration) {\n\t\t\t\t\tfoundSyntheticDeclaration = variable;\n\t\t\t\t}\n\t\t\t} else if (variable) {\n\t\t\t\tfoundInternalDeclarations.set(variable, module);\n\t\t\t}\n\t\t}\n\t\tif (foundInternalDeclarations.size > 0) {\n\t\t\tconst foundDeclarationList = [...foundInternalDeclarations];\n\t\t\tconst usedDeclaration = foundDeclarationList[0][0];\n\t\t\tif (foundDeclarationList.length === 1) {\n\t\t\t\treturn [usedDeclaration];\n\t\t\t}\n\t\t\tthis.options.onwarn(\n\t\t\t\terrNamespaceConflict(\n\t\t\t\t\tname,\n\t\t\t\t\tthis.id,\n\t\t\t\t\tfoundDeclarationList.map(([, module]) => module.id)\n\t\t\t\t)\n\t\t\t);\n\t\t\t// TODO we are pretending it was not found while it should behave like \"undefined\"\n\t\t\treturn [null];\n\t\t}\n\t\tif (foundExternalDeclarations.size > 0) {\n\t\t\tconst foundDeclarationList = [...foundExternalDeclarations];\n\t\t\tconst usedDeclaration = foundDeclarationList[0];\n\t\t\tif (foundDeclarationList.length > 1) {\n\t\t\t\tthis.options.onwarn(\n\t\t\t\t\terrAmbiguousExternalNamespaces(\n\t\t\t\t\t\tname,\n\t\t\t\t\t\tthis.id,\n\t\t\t\t\t\tusedDeclaration.module.id,\n\t\t\t\t\t\tfoundDeclarationList.map(declaration => declaration.module.id)\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn [usedDeclaration, true];\n\t\t}\n\t\tif (foundSyntheticDeclaration) {\n\t\t\treturn [foundSyntheticDeclaration];\n\t\t}\n\t\treturn [null];\n\t}\n\n\tprivate includeAndGetAdditionalMergedNamespaces(): Variable[] {\n\t\tconst externalNamespaces = new Set();\n\t\tconst syntheticNamespaces = new Set();\n\t\tfor (const module of [this, ...this.exportAllModules]) {\n\t\t\tif (module instanceof ExternalModule) {\n\t\t\t\tconst [externalVariable] = module.getVariableForExportName('*');\n\t\t\t\texternalVariable.include();\n\t\t\t\tthis.includedImports.add(externalVariable);\n\t\t\t\texternalNamespaces.add(externalVariable);\n\t\t\t} else if (module.info.syntheticNamedExports) {\n\t\t\t\tconst syntheticNamespace = module.getSyntheticNamespace();\n\t\t\t\tsyntheticNamespace.include();\n\t\t\t\tthis.includedImports.add(syntheticNamespace);\n\t\t\t\tsyntheticNamespaces.add(syntheticNamespace);\n\t\t\t}\n\t\t}\n\t\treturn [...syntheticNamespaces, ...externalNamespaces];\n\t}\n\n\tprivate includeDynamicImport(node: ImportExpression): void {\n\t\tconst resolution = (\n\t\t\tthis.dynamicImports.find(dynamicImport => dynamicImport.node === node) as {\n\t\t\t\tresolution: string | Module | ExternalModule | undefined;\n\t\t\t}\n\t\t).resolution;\n\t\tif (resolution instanceof Module) {\n\t\t\tresolution.includedDynamicImporters.push(this);\n\t\t\tresolution.includeAllExports(true);\n\t\t}\n\t}\n\n\tprivate includeVariable(variable: Variable): void {\n\t\tif (!variable.included) {\n\t\t\tvariable.include();\n\t\t\tthis.graph.needsTreeshakingPass = true;\n\t\t\tconst variableModule = variable.module;\n\t\t\tif (variableModule instanceof Module) {\n\t\t\t\tif (!variableModule.isExecuted) {\n\t\t\t\t\tmarkModuleAndImpureDependenciesAsExecuted(variableModule);\n\t\t\t\t}\n\t\t\t\tif (variableModule !== this) {\n\t\t\t\t\tconst sideEffectModules = getAndExtendSideEffectModules(variable, this);\n\t\t\t\t\tfor (const module of sideEffectModules) {\n\t\t\t\t\t\tif (!module.isExecuted) {\n\t\t\t\t\t\t\tmarkModuleAndImpureDependenciesAsExecuted(module);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate includeVariableInModule(variable: Variable): void {\n\t\tthis.includeVariable(variable);\n\t\tconst variableModule = variable.module;\n\t\tif (variableModule && variableModule !== this) {\n\t\t\tthis.includedImports.add(variable);\n\t\t}\n\t}\n\n\tprivate shimMissingExport(name: string): void {\n\t\tthis.options.onwarn({\n\t\t\tcode: 'SHIMMED_EXPORT',\n\t\t\texporter: relativeId(this.id),\n\t\t\texportName: name,\n\t\t\tmessage: `Missing export \"${name}\" has been shimmed in module ${relativeId(this.id)}.`\n\t\t});\n\t\tthis.exports.set(name, MISSING_EXPORT_SHIM_DESCRIPTION);\n\t}\n}\n\n// if there is a cyclic import in the reexport chain, we should not\n// import from the original module but from the cyclic module to not\n// mess up execution order.\nfunction setAlternativeExporterIfCyclic(\n\tvariable: Variable,\n\timporter: Module,\n\treexporter: Module\n): void {\n\tif (variable.module instanceof Module && variable.module !== reexporter) {\n\t\tconst exporterCycles = variable.module.cycles;\n\t\tif (exporterCycles.size > 0) {\n\t\t\tconst importerCycles = reexporter.cycles;\n\t\t\tfor (const cycleSymbol of importerCycles) {\n\t\t\t\tif (exporterCycles.has(cycleSymbol)) {\n\t\t\t\t\timporter.alternativeReexportModules.set(variable, reexporter);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nconst copyNameToModulesMap = (\n\tsearchedNamesAndModules?: Map>\n): Map> | undefined =>\n\tsearchedNamesAndModules &&\n\tnew Map(Array.from(searchedNamesAndModules, ([name, modules]) => [name, new Set(modules)]));\n","import type { DecodedSourceMapOrMissing, ExistingDecodedSourceMap } from '../rollup/types';\n\nexport function getOriginalLocation(\n\tsourcemapChain: readonly DecodedSourceMapOrMissing[],\n\tlocation: { column: number; line: number }\n): { column: number; line: number } {\n\tconst filteredSourcemapChain = sourcemapChain.filter(\n\t\t(sourcemap): sourcemap is ExistingDecodedSourceMap => !!sourcemap.mappings\n\t);\n\ttraceSourcemap: while (filteredSourcemapChain.length > 0) {\n\t\tconst sourcemap = filteredSourcemapChain.pop()!;\n\t\tconst line = sourcemap.mappings[location.line - 1];\n\t\tif (line) {\n\t\t\tconst filteredLine = line.filter(\n\t\t\t\t(segment): segment is [number, number, number, number] => segment.length > 1\n\t\t\t);\n\t\t\tconst lastSegment = filteredLine[filteredLine.length - 1];\n\t\t\tfor (const segment of filteredLine) {\n\t\t\t\tif (segment[0] >= location.column || segment === lastSegment) {\n\t\t\t\t\tlocation = {\n\t\t\t\t\t\tcolumn: segment[3],\n\t\t\t\t\t\tline: segment[2] + 1\n\t\t\t\t\t};\n\t\t\t\t\tcontinue traceSourcemap;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tthrow new Error(\"Can't resolve original location of error.\");\n\t}\n\treturn location;\n}\n","export default function removeJsExtension(name: string): string {\n\treturn name.endsWith('.js') ? name.slice(0, -3) : name;\n}\n","import type { NormalizedOutputOptions } from '../../rollup/types';\nimport removeJsExtension from './removeJsExtension';\n\nexport default function getCompleteAmdId(\n\toptions: NormalizedOutputOptions['amd'],\n\tchunkId: string\n): string {\n\tif (options.autoId) {\n\t\treturn `${options.basePath ? options.basePath + '/' : ''}${removeJsExtension(chunkId)}`;\n\t}\n\n\treturn options.id || '';\n}\n","import type { ChunkDependencies, ChunkExports } from '../../Chunk';\nimport type { GetInterop } from '../../rollup/types';\nimport type { GenerateCodeSnippets } from '../../utils/generateCodeSnippets';\nimport {\n\tdefaultInteropHelpersByInteropType,\n\tgetToStringTagValue,\n\tisDefaultAProperty,\n\tnamespaceInteropHelpersByInteropType\n} from '../../utils/interopHelpers';\n\nexport function getExportBlock(\n\texports: ChunkExports,\n\tdependencies: ChunkDependencies,\n\tnamedExportsMode: boolean,\n\tinterop: GetInterop,\n\tsnippets: GenerateCodeSnippets,\n\tt: string,\n\texternalLiveBindings: boolean,\n\tmechanism = 'return '\n): string {\n\tconst { _, cnst, getDirectReturnFunction, getFunctionIntro, getPropertyAccess, n, s } = snippets;\n\tif (!namedExportsMode) {\n\t\treturn `${n}${n}${mechanism}${getSingleDefaultExport(\n\t\t\texports,\n\t\t\tdependencies,\n\t\t\tinterop,\n\t\t\texternalLiveBindings,\n\t\t\tgetPropertyAccess\n\t\t)};`;\n\t}\n\n\tlet exportBlock = '';\n\n\tfor (const {\n\t\tdefaultVariableName,\n\t\tid,\n\t\tisChunk,\n\t\tname,\n\t\tnamedExportsMode: depNamedExportsMode,\n\t\tnamespaceVariableName,\n\t\treexports\n\t} of dependencies) {\n\t\tif (reexports && namedExportsMode) {\n\t\t\tfor (const specifier of reexports) {\n\t\t\t\tif (specifier.reexported !== '*') {\n\t\t\t\t\tconst importName = getReexportedImportName(\n\t\t\t\t\t\tname,\n\t\t\t\t\t\tspecifier.imported,\n\t\t\t\t\t\tdepNamedExportsMode,\n\t\t\t\t\t\tisChunk,\n\t\t\t\t\t\tdefaultVariableName!,\n\t\t\t\t\t\tnamespaceVariableName!,\n\t\t\t\t\t\tinterop,\n\t\t\t\t\t\tid,\n\t\t\t\t\t\texternalLiveBindings,\n\t\t\t\t\t\tgetPropertyAccess\n\t\t\t\t\t);\n\t\t\t\t\tif (exportBlock) exportBlock += n;\n\t\t\t\t\tif (specifier.imported !== '*' && specifier.needsLiveBinding) {\n\t\t\t\t\t\tconst [left, right] = getDirectReturnFunction([], {\n\t\t\t\t\t\t\tfunctionReturn: true,\n\t\t\t\t\t\t\tlineBreakIndent: null,\n\t\t\t\t\t\t\tname: null\n\t\t\t\t\t\t});\n\t\t\t\t\t\texportBlock +=\n\t\t\t\t\t\t\t`Object.defineProperty(exports,${_}'${specifier.reexported}',${_}{${n}` +\n\t\t\t\t\t\t\t`${t}enumerable:${_}true,${n}` +\n\t\t\t\t\t\t\t`${t}get:${_}${left}${importName}${right}${n}});`;\n\t\t\t\t\t} else {\n\t\t\t\t\t\texportBlock += `exports${getPropertyAccess(\n\t\t\t\t\t\t\tspecifier.reexported\n\t\t\t\t\t\t)}${_}=${_}${importName};`;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tfor (const { exported, local } of exports) {\n\t\tconst lhs = `exports${getPropertyAccess(exported)}`;\n\t\tconst rhs = local;\n\t\tif (lhs !== rhs) {\n\t\t\tif (exportBlock) exportBlock += n;\n\t\t\texportBlock += `${lhs}${_}=${_}${rhs};`;\n\t\t}\n\t}\n\n\tfor (const { name, reexports } of dependencies) {\n\t\tif (reexports && namedExportsMode) {\n\t\t\tfor (const specifier of reexports) {\n\t\t\t\tif (specifier.reexported === '*') {\n\t\t\t\t\tif (exportBlock) exportBlock += n;\n\t\t\t\t\tconst copyPropertyIfNecessary = `{${n}${t}if${_}(k${_}!==${_}'default'${_}&&${_}!exports.hasOwnProperty(k))${_}${getDefineProperty(\n\t\t\t\t\t\tname,\n\t\t\t\t\t\tspecifier.needsLiveBinding,\n\t\t\t\t\t\tt,\n\t\t\t\t\t\tsnippets\n\t\t\t\t\t)}${s}${n}}`;\n\t\t\t\t\texportBlock +=\n\t\t\t\t\t\tcnst === 'var' && specifier.needsLiveBinding\n\t\t\t\t\t\t\t? `Object.keys(${name}).forEach(${getFunctionIntro(['k'], {\n\t\t\t\t\t\t\t\t\tisAsync: false,\n\t\t\t\t\t\t\t\t\tname: null\n\t\t\t\t\t\t\t })}${copyPropertyIfNecessary});`\n\t\t\t\t\t\t\t: `for${_}(${cnst} k in ${name})${_}${copyPropertyIfNecessary}`;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif (exportBlock) {\n\t\treturn `${n}${n}${exportBlock}`;\n\t}\n\n\treturn '';\n}\n\nfunction getSingleDefaultExport(\n\texports: ChunkExports,\n\tdependencies: ChunkDependencies,\n\tinterop: GetInterop,\n\texternalLiveBindings: boolean,\n\tgetPropertyAccess: (name: string) => string\n) {\n\tif (exports.length > 0) {\n\t\treturn exports[0].local;\n\t} else {\n\t\tfor (const {\n\t\t\tdefaultVariableName,\n\t\t\tid,\n\t\t\tisChunk,\n\t\t\tname,\n\t\t\tnamedExportsMode: depNamedExportsMode,\n\t\t\tnamespaceVariableName,\n\t\t\treexports\n\t\t} of dependencies) {\n\t\t\tif (reexports) {\n\t\t\t\treturn getReexportedImportName(\n\t\t\t\t\tname,\n\t\t\t\t\treexports[0].imported,\n\t\t\t\t\tdepNamedExportsMode,\n\t\t\t\t\tisChunk,\n\t\t\t\t\tdefaultVariableName!,\n\t\t\t\t\tnamespaceVariableName!,\n\t\t\t\t\tinterop,\n\t\t\t\t\tid,\n\t\t\t\t\texternalLiveBindings,\n\t\t\t\t\tgetPropertyAccess\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction getReexportedImportName(\n\tmoduleVariableName: string,\n\timported: string,\n\tdepNamedExportsMode: boolean,\n\tisChunk: boolean,\n\tdefaultVariableName: string,\n\tnamespaceVariableName: string,\n\tinterop: GetInterop,\n\tmoduleId: string,\n\texternalLiveBindings: boolean,\n\tgetPropertyAccess: (name: string) => string\n) {\n\tif (imported === 'default') {\n\t\tif (!isChunk) {\n\t\t\tconst moduleInterop = String(interop(moduleId));\n\t\t\tconst variableName = defaultInteropHelpersByInteropType[moduleInterop]\n\t\t\t\t? defaultVariableName\n\t\t\t\t: moduleVariableName;\n\t\t\treturn isDefaultAProperty(moduleInterop, externalLiveBindings)\n\t\t\t\t? `${variableName}${getPropertyAccess('default')}`\n\t\t\t\t: variableName;\n\t\t}\n\t\treturn depNamedExportsMode\n\t\t\t? `${moduleVariableName}${getPropertyAccess('default')}`\n\t\t\t: moduleVariableName;\n\t}\n\tif (imported === '*') {\n\t\treturn (\n\t\t\tisChunk\n\t\t\t\t? !depNamedExportsMode\n\t\t\t\t: namespaceInteropHelpersByInteropType[String(interop(moduleId))]\n\t\t)\n\t\t\t? namespaceVariableName\n\t\t\t: moduleVariableName;\n\t}\n\treturn `${moduleVariableName}${getPropertyAccess(imported)}`;\n}\n\nfunction getEsModuleValue(getObject: GenerateCodeSnippets['getObject']) {\n\treturn getObject([['value', 'true']], {\n\t\tlineBreakIndent: null\n\t});\n}\n\nexport function getNamespaceMarkers(\n\thasNamedExports: boolean,\n\taddEsModule: boolean,\n\taddNamespaceToStringTag: boolean,\n\t{ _, getObject }: GenerateCodeSnippets\n): string {\n\tif (hasNamedExports) {\n\t\tif (addEsModule) {\n\t\t\tif (addNamespaceToStringTag) {\n\t\t\t\treturn `Object.defineProperties(exports,${_}${getObject(\n\t\t\t\t\t[\n\t\t\t\t\t\t['__esModule', getEsModuleValue(getObject)],\n\t\t\t\t\t\t[null, `[Symbol.toStringTag]:${_}${getToStringTagValue(getObject)}`]\n\t\t\t\t\t],\n\t\t\t\t\t{\n\t\t\t\t\t\tlineBreakIndent: null\n\t\t\t\t\t}\n\t\t\t\t)});`;\n\t\t\t}\n\t\t\treturn `Object.defineProperty(exports,${_}'__esModule',${_}${getEsModuleValue(getObject)});`;\n\t\t}\n\t\tif (addNamespaceToStringTag) {\n\t\t\treturn `Object.defineProperty(exports,${_}Symbol.toStringTag,${_}${getToStringTagValue(\n\t\t\t\tgetObject\n\t\t\t)});`;\n\t\t}\n\t}\n\treturn '';\n}\n\nconst getDefineProperty = (\n\tname: string,\n\tneedsLiveBinding: boolean,\n\tt: string,\n\t{ _, getDirectReturnFunction, n }: GenerateCodeSnippets\n) => {\n\tif (needsLiveBinding) {\n\t\tconst [left, right] = getDirectReturnFunction([], {\n\t\t\tfunctionReturn: true,\n\t\t\tlineBreakIndent: null,\n\t\t\tname: null\n\t\t});\n\t\treturn (\n\t\t\t`Object.defineProperty(exports,${_}k,${_}{${n}` +\n\t\t\t`${t}${t}enumerable:${_}true,${n}` +\n\t\t\t`${t}${t}get:${_}${left}${name}[k]${right}${n}${t}})`\n\t\t);\n\t}\n\treturn `exports[k]${_}=${_}${name}[k]`;\n};\n","import type { ModuleDeclarationDependency, ReexportSpecifier } from '../../Chunk';\nimport type { GetInterop } from '../../rollup/types';\nimport type { GenerateCodeSnippets } from '../../utils/generateCodeSnippets';\nimport {\n\tdefaultInteropHelpersByInteropType,\n\tgetHelpersBlock,\n\tINTEROP_NAMESPACE_DEFAULT_ONLY_VARIABLE,\n\tnamespaceInteropHelpersByInteropType\n} from '../../utils/interopHelpers';\n\nexport default function getInteropBlock(\n\tdependencies: readonly ModuleDeclarationDependency[],\n\tinterop: GetInterop,\n\texternalLiveBindings: boolean,\n\tfreeze: boolean,\n\tnamespaceToStringTag: boolean,\n\taccessedGlobals: Set,\n\tindent: string,\n\tsnippets: GenerateCodeSnippets\n): string {\n\tconst { _, cnst, n } = snippets;\n\tconst neededInteropHelpers = new Set();\n\tconst interopStatements: string[] = [];\n\tconst addInteropStatement = (\n\t\thelperVariableName: string,\n\t\thelper: string,\n\t\tdependencyVariableName: string\n\t): void => {\n\t\tneededInteropHelpers.add(helper);\n\t\tinteropStatements.push(\n\t\t\t`${cnst} ${helperVariableName}${_}=${_}/*#__PURE__*/${helper}(${dependencyVariableName});`\n\t\t);\n\t};\n\tfor (const {\n\t\tdefaultVariableName,\n\t\timports,\n\t\tid,\n\t\tisChunk,\n\t\tname,\n\t\tnamedExportsMode,\n\t\tnamespaceVariableName,\n\t\treexports\n\t} of dependencies) {\n\t\tif (isChunk) {\n\t\t\tfor (const { imported, reexported } of [\n\t\t\t\t...(imports || []),\n\t\t\t\t...(reexports || [])\n\t\t\t] as ReexportSpecifier[]) {\n\t\t\t\tif (imported === '*' && reexported !== '*') {\n\t\t\t\t\tif (!namedExportsMode) {\n\t\t\t\t\t\taddInteropStatement(\n\t\t\t\t\t\t\tnamespaceVariableName!,\n\t\t\t\t\t\t\tINTEROP_NAMESPACE_DEFAULT_ONLY_VARIABLE,\n\t\t\t\t\t\t\tname\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tconst moduleInterop = String(interop(id));\n\t\t\tlet hasDefault = false;\n\t\t\tlet hasNamespace = false;\n\t\t\tfor (const { imported, reexported } of [\n\t\t\t\t...(imports || []),\n\t\t\t\t...(reexports || [])\n\t\t\t] as ReexportSpecifier[]) {\n\t\t\t\tlet helper: string | undefined | null;\n\t\t\t\tlet variableName: string | undefined;\n\t\t\t\tif (imported === 'default') {\n\t\t\t\t\tif (!hasDefault) {\n\t\t\t\t\t\thasDefault = true;\n\t\t\t\t\t\tif (defaultVariableName !== namespaceVariableName) {\n\t\t\t\t\t\t\tvariableName = defaultVariableName!;\n\t\t\t\t\t\t\thelper = defaultInteropHelpersByInteropType[moduleInterop];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else if (imported === '*' && reexported !== '*') {\n\t\t\t\t\tif (!hasNamespace) {\n\t\t\t\t\t\thasNamespace = true;\n\t\t\t\t\t\thelper = namespaceInteropHelpersByInteropType[moduleInterop];\n\t\t\t\t\t\tvariableName = namespaceVariableName!;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (helper) {\n\t\t\t\t\taddInteropStatement(variableName!, helper, name);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn `${getHelpersBlock(\n\t\tneededInteropHelpers,\n\t\taccessedGlobals,\n\t\tindent,\n\t\tsnippets,\n\t\texternalLiveBindings,\n\t\tfreeze,\n\t\tnamespaceToStringTag\n\t)}${interopStatements.length > 0 ? `${interopStatements.join(n)}${n}${n}` : ''}`;\n}\n","import addJsExtension from './addJsExtension';\nimport removeJsExtension from './removeJsExtension';\n\n// AMD resolution will only respect the AMD baseUrl if the .js extension is omitted.\n// The assumption is that this makes sense for all relative ids:\n// https://requirejs.org/docs/api.html#jsfiles\nexport default function updateExtensionForRelativeAmdId(\n\tid: string,\n\tforceJsExtensionForImports: boolean\n): string {\n\tif (id[0] !== '.') {\n\t\treturn id;\n\t}\n\n\treturn forceJsExtensionForImports ? addJsExtension(id) : removeJsExtension(id);\n}\n","export default function addJsExtension(name: string): string {\n\treturn name.endsWith('.js') ? name : name + '.js';\n}\n","import type { ChunkDependencies } from '../../Chunk';\nimport type { RollupWarning } from '../../rollup/types';\nimport { printQuotedStringList } from '../../utils/printStringList';\n\nconst builtins = {\n\tassert: true,\n\tbuffer: true,\n\tconsole: true,\n\tconstants: true,\n\tdomain: true,\n\tevents: true,\n\thttp: true,\n\thttps: true,\n\tos: true,\n\tpath: true,\n\tprocess: true,\n\tpunycode: true,\n\tquerystring: true,\n\tstream: true,\n\tstring_decoder: true,\n\ttimers: true,\n\ttty: true,\n\turl: true,\n\tutil: true,\n\tvm: true,\n\tzlib: true\n};\n\nexport default function warnOnBuiltins(\n\twarn: (warning: RollupWarning) => void,\n\tdependencies: ChunkDependencies\n): void {\n\tconst externalBuiltins = dependencies.map(({ id }) => id).filter(id => id in builtins);\n\n\tif (!externalBuiltins.length) return;\n\n\twarn({\n\t\tcode: 'MISSING_NODE_BUILTINS',\n\t\tmessage: `Creating a browser bundle that depends on Node.js built-in modules (${printQuotedStringList(\n\t\t\texternalBuiltins\n\t\t)}). You might need to include https://github.com/FredKSchott/rollup-plugin-polyfill-node`,\n\t\tmodules: externalBuiltins\n\t});\n}\n","export const keypath = (keypath: string, getPropertyAccess: (name: string) => string): string =>\n\tkeypath.split('.').map(getPropertyAccess).join('');\n","import type { GlobalsOption } from '../../rollup/types';\nimport type { GenerateCodeSnippets } from '../../utils/generateCodeSnippets';\n\nexport default function setupNamespace(\n\tname: string,\n\troot: string,\n\tglobals: GlobalsOption,\n\t{ _, getPropertyAccess, s }: GenerateCodeSnippets,\n\tcompact: boolean | undefined\n): string {\n\tconst parts = name.split('.');\n\tparts[0] = (typeof globals === 'function' ? globals(parts[0]) : globals[parts[0]]) || parts[0];\n\tparts.pop();\n\n\tlet propertyPath = root;\n\treturn (\n\t\tparts\n\t\t\t.map(part => {\n\t\t\t\tpropertyPath += getPropertyAccess(part);\n\t\t\t\treturn `${propertyPath}${_}=${_}${propertyPath}${_}||${_}{}${s}`;\n\t\t\t})\n\t\t\t.join(compact ? ',' : '\\n') + (compact && parts.length ? ';' : '\\n')\n\t);\n}\n\nexport function assignToDeepVariable(\n\tdeepName: string,\n\troot: string,\n\tglobals: GlobalsOption,\n\tassignment: string,\n\t{ _, getPropertyAccess }: GenerateCodeSnippets\n): string {\n\tconst parts = deepName.split('.');\n\tparts[0] = (typeof globals === 'function' ? globals(parts[0]) : globals[parts[0]]) || parts[0];\n\tconst last = parts.pop()!;\n\n\tlet propertyPath = root;\n\tlet deepAssignment =\n\t\tparts\n\t\t\t.map(part => {\n\t\t\t\tpropertyPath += getPropertyAccess(part);\n\t\t\t\treturn `${propertyPath}${_}=${_}${propertyPath}${_}||${_}{}`;\n\t\t\t})\n\t\t\t.concat(`${propertyPath}${getPropertyAccess(last)}`)\n\t\t\t.join(`,${_}`) + `${_}=${_}${assignment}`;\n\tif (parts.length > 0) {\n\t\tdeepAssignment = `(${deepAssignment})`;\n\t}\n\treturn deepAssignment;\n}\n","import type { ModuleDeclarationDependency } from '../../Chunk';\n\nexport default function trimEmptyImports(\n\tdependencies: readonly ModuleDeclarationDependency[]\n): ModuleDeclarationDependency[] {\n\tlet i = dependencies.length;\n\n\twhile (i--) {\n\t\tconst { imports, reexports } = dependencies[i];\n\t\tif (imports || reexports) {\n\t\t\treturn dependencies.slice(0, i + 1);\n\t\t}\n\t}\n\n\treturn [];\n}\n","import type { Bundle, Bundle as MagicStringBundle } from 'magic-string';\nimport type { ChunkDependencies, ChunkExports, ModuleDeclarations } from '../Chunk';\nimport type { NormalizedOutputOptions } from '../rollup/types';\nimport type { GenerateCodeSnippets } from '../utils/generateCodeSnippets';\nimport { getHelpersBlock } from '../utils/interopHelpers';\nimport { MISSING_EXPORT_SHIM_VARIABLE } from '../utils/variableNames';\nimport type { FinaliserOptions } from './index';\n\nexport default function system(\n\tmagicString: MagicStringBundle,\n\t{\n\t\taccessedGlobals,\n\t\tdependencies,\n\t\texports,\n\t\thasExports,\n\t\tindent: t,\n\t\tintro,\n\t\tsnippets,\n\t\toutro,\n\t\tusesTopLevelAwait\n\t}: FinaliserOptions,\n\t{\n\t\texternalLiveBindings,\n\t\tfreeze,\n\t\tname,\n\t\tnamespaceToStringTag,\n\t\tstrict,\n\t\tsystemNullSetters\n\t}: NormalizedOutputOptions\n): Bundle {\n\tconst { _, getFunctionIntro, getNonArrowFunctionIntro, n, s } = snippets;\n\tconst { importBindings, setters, starExcludes } = analyzeDependencies(\n\t\tdependencies,\n\t\texports,\n\t\tt,\n\t\tsnippets\n\t);\n\tconst registeredName = name ? `'${name}',${_}` : '';\n\tconst wrapperParams = accessedGlobals.has('module')\n\t\t? ['exports', 'module']\n\t\t: hasExports\n\t\t? ['exports']\n\t\t: [];\n\n\t// factory function should be wrapped by parentheses to avoid lazy parsing,\n\t// cf. https://v8.dev/blog/preparser#pife\n\tlet wrapperStart =\n\t\t`System.register(${registeredName}[` +\n\t\tdependencies.map(({ id }) => `'${id}'`).join(`,${_}`) +\n\t\t`],${_}(${getNonArrowFunctionIntro(wrapperParams, { isAsync: false, name: null })}{${n}${t}${\n\t\t\tstrict ? \"'use strict';\" : ''\n\t\t}` +\n\t\tgetStarExcludesBlock(starExcludes, t, snippets) +\n\t\tgetImportBindingsBlock(importBindings, t, snippets) +\n\t\t`${n}${t}return${_}{${\n\t\t\tsetters.length\n\t\t\t\t? `${n}${t}${t}setters:${_}[${setters\n\t\t\t\t\t\t.map(setter =>\n\t\t\t\t\t\t\tsetter\n\t\t\t\t\t\t\t\t? `${getFunctionIntro(['module'], {\n\t\t\t\t\t\t\t\t\t\tisAsync: false,\n\t\t\t\t\t\t\t\t\t\tname: null\n\t\t\t\t\t\t\t\t })}{${n}${t}${t}${t}${setter}${n}${t}${t}}`\n\t\t\t\t\t\t\t\t: systemNullSetters\n\t\t\t\t\t\t\t\t? `null`\n\t\t\t\t\t\t\t\t: `${getFunctionIntro([], { isAsync: false, name: null })}{}`\n\t\t\t\t\t\t)\n\t\t\t\t\t\t.join(`,${_}`)}],`\n\t\t\t\t: ''\n\t\t}${n}`;\n\twrapperStart += `${t}${t}execute:${_}(${getNonArrowFunctionIntro([], {\n\t\tisAsync: usesTopLevelAwait,\n\t\tname: null\n\t})}{${n}${n}`;\n\n\tconst wrapperEnd = `${t}${t}})${n}${t}}${s}${n}}));`;\n\n\tmagicString.prepend(\n\t\tintro +\n\t\t\tgetHelpersBlock(\n\t\t\t\tnull,\n\t\t\t\taccessedGlobals,\n\t\t\t\tt,\n\t\t\t\tsnippets,\n\t\t\t\texternalLiveBindings,\n\t\t\t\tfreeze,\n\t\t\t\tnamespaceToStringTag\n\t\t\t) +\n\t\t\tgetHoistedExportsBlock(exports, t, snippets)\n\t);\n\tmagicString.append(\n\t\t`${outro}${n}${n}` +\n\t\t\tgetSyntheticExportsBlock(exports, t, snippets) +\n\t\t\tgetMissingExportsBlock(exports, t, snippets)\n\t);\n\treturn magicString.indent(`${t}${t}${t}`).append(wrapperEnd).prepend(wrapperStart);\n}\n\nfunction analyzeDependencies(\n\tdependencies: ChunkDependencies,\n\texports: ChunkExports,\n\tt: string,\n\t{ _, cnst, getObject, getPropertyAccess, n }: GenerateCodeSnippets\n): { importBindings: string[]; setters: string[]; starExcludes: Set | null } {\n\tconst importBindings: string[] = [];\n\tconst setters: string[] = [];\n\tlet starExcludes: Set | null = null;\n\n\tfor (const { imports, reexports } of dependencies) {\n\t\tconst setter: string[] = [];\n\t\tif (imports) {\n\t\t\tfor (const specifier of imports) {\n\t\t\t\timportBindings.push(specifier.local);\n\t\t\t\tif (specifier.imported === '*') {\n\t\t\t\t\tsetter.push(`${specifier.local}${_}=${_}module;`);\n\t\t\t\t} else {\n\t\t\t\t\tsetter.push(`${specifier.local}${_}=${_}module${getPropertyAccess(specifier.imported)};`);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (reexports) {\n\t\t\tconst reexportedNames: [key: string | null, value: string][] = [];\n\t\t\tlet hasStarReexport = false;\n\t\t\tfor (const { imported, reexported } of reexports) {\n\t\t\t\tif (reexported === '*') {\n\t\t\t\t\thasStarReexport = true;\n\t\t\t\t} else {\n\t\t\t\t\treexportedNames.push([\n\t\t\t\t\t\treexported,\n\t\t\t\t\t\timported === '*' ? 'module' : `module${getPropertyAccess(imported)}`\n\t\t\t\t\t]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (reexportedNames.length > 1 || hasStarReexport) {\n\t\t\t\tconst exportMapping = getObject(reexportedNames, { lineBreakIndent: null });\n\t\t\t\tif (hasStarReexport) {\n\t\t\t\t\tif (!starExcludes) {\n\t\t\t\t\t\tstarExcludes = getStarExcludes({ dependencies, exports });\n\t\t\t\t\t}\n\t\t\t\t\tsetter.push(\n\t\t\t\t\t\t`${cnst} setter${_}=${_}${exportMapping};`,\n\t\t\t\t\t\t`for${_}(${cnst} name in module)${_}{`,\n\t\t\t\t\t\t`${t}if${_}(!_starExcludes[name])${_}setter[name]${_}=${_}module[name];`,\n\t\t\t\t\t\t'}',\n\t\t\t\t\t\t'exports(setter);'\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\tsetter.push(`exports(${exportMapping});`);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconst [key, value] = reexportedNames[0];\n\t\t\t\tsetter.push(`exports('${key}',${_}${value});`);\n\t\t\t}\n\t\t}\n\t\tsetters.push(setter.join(`${n}${t}${t}${t}`));\n\t}\n\treturn { importBindings, setters, starExcludes };\n}\n\nconst getStarExcludes = ({ dependencies, exports }: ModuleDeclarations): Set => {\n\tconst starExcludes = new Set(exports.map(expt => expt.exported));\n\tstarExcludes.add('default');\n\tfor (const { reexports } of dependencies) {\n\t\tif (reexports) {\n\t\t\tfor (const reexport of reexports) {\n\t\t\t\tif (reexport.reexported !== '*') starExcludes.add(reexport.reexported);\n\t\t\t}\n\t\t}\n\t}\n\treturn starExcludes;\n};\n\nconst getStarExcludesBlock = (\n\tstarExcludes: ReadonlySet | null,\n\tt: string,\n\t{ _, cnst, getObject, n }: GenerateCodeSnippets\n): string =>\n\tstarExcludes\n\t\t? `${n}${t}${cnst} _starExcludes${_}=${_}${getObject(\n\t\t\t\t[...starExcludes].map(prop => [prop, '1']),\n\t\t\t\t{ lineBreakIndent: { base: t, t } }\n\t\t )};`\n\t\t: '';\n\nconst getImportBindingsBlock = (\n\timportBindings: readonly string[],\n\tt: string,\n\t{ _, n }: GenerateCodeSnippets\n): string => (importBindings.length ? `${n}${t}var ${importBindings.join(`,${_}`)};` : '');\n\nconst getHoistedExportsBlock = (\n\texports: ChunkExports,\n\tt: string,\n\tsnippets: GenerateCodeSnippets\n): string =>\n\tgetExportsBlock(\n\t\texports.filter(expt => expt.hoisted).map(expt => ({ name: expt.exported, value: expt.local })),\n\t\tt,\n\t\tsnippets\n\t);\n\nfunction getExportsBlock(\n\texports: readonly { name: string; value: string }[],\n\tt: string,\n\t{ _, n }: GenerateCodeSnippets\n): string {\n\tif (exports.length === 0) {\n\t\treturn '';\n\t}\n\tif (exports.length === 1) {\n\t\treturn `exports('${exports[0].name}',${_}${exports[0].value});${n}${n}`;\n\t}\n\treturn (\n\t\t`exports({${n}` +\n\t\texports.map(({ name, value }) => `${t}${name}:${_}${value}`).join(`,${n}`) +\n\t\t`${n}});${n}${n}`\n\t);\n}\n\nconst getSyntheticExportsBlock = (\n\texports: ChunkExports,\n\tt: string,\n\tsnippets: GenerateCodeSnippets\n): string =>\n\tgetExportsBlock(\n\t\texports\n\t\t\t.filter(expt => expt.expression)\n\t\t\t.map(expt => ({ name: expt.exported, value: expt.local })),\n\t\tt,\n\t\tsnippets\n\t);\n\nconst getMissingExportsBlock = (\n\texports: ChunkExports,\n\tt: string,\n\tsnippets: GenerateCodeSnippets\n): string =>\n\tgetExportsBlock(\n\t\texports\n\t\t\t.filter(expt => expt.local === MISSING_EXPORT_SHIM_VARIABLE)\n\t\t\t.map(expt => ({ name: expt.exported, value: MISSING_EXPORT_SHIM_VARIABLE })),\n\t\tt,\n\t\tsnippets\n\t);\n","import type { Bundle, Bundle as MagicStringBundle } from 'magic-string';\nimport type { NormalizedOutputOptions } from '../rollup/types';\nimport { error } from '../utils/error';\nimport type { GenerateCodeSnippets } from '../utils/generateCodeSnippets';\nimport getCompleteAmdId from './shared/getCompleteAmdId';\nimport { getExportBlock, getNamespaceMarkers } from './shared/getExportBlock';\nimport getInteropBlock from './shared/getInteropBlock';\nimport { keypath } from './shared/sanitize';\nimport { assignToDeepVariable } from './shared/setupNamespace';\nimport trimEmptyImports from './shared/trimEmptyImports';\nimport updateExtensionForRelativeAmdId from './shared/updateExtensionForRelativeAmdId';\nimport warnOnBuiltins from './shared/warnOnBuiltins';\nimport type { FinaliserOptions } from './index';\n\nfunction globalProp(name: string, globalVar: string, getPropertyAccess: (name: string) => string) {\n\tif (!name) return 'null';\n\treturn `${globalVar}${keypath(name, getPropertyAccess)}`;\n}\n\nfunction safeAccess(\n\tname: string,\n\tglobalVar: string,\n\t{ _, getPropertyAccess }: GenerateCodeSnippets\n) {\n\tlet propertyPath = globalVar;\n\treturn name\n\t\t.split('.')\n\t\t.map(part => (propertyPath += getPropertyAccess(part)))\n\t\t.join(`${_}&&${_}`);\n}\n\nexport default function umd(\n\tmagicString: MagicStringBundle,\n\t{\n\t\taccessedGlobals,\n\t\tdependencies,\n\t\texports,\n\t\thasExports,\n\t\tid,\n\t\tindent: t,\n\t\tintro,\n\t\tnamedExportsMode,\n\t\toutro,\n\t\tsnippets,\n\t\twarn\n\t}: FinaliserOptions,\n\t{\n\t\tamd,\n\t\tcompact,\n\t\tesModule,\n\t\textend,\n\t\texternalLiveBindings,\n\t\tfreeze,\n\t\tinterop,\n\t\tname,\n\t\tnamespaceToStringTag,\n\t\tglobals,\n\t\tnoConflict,\n\t\tstrict\n\t}: NormalizedOutputOptions\n): Bundle {\n\tconst { _, cnst, getFunctionIntro, getNonArrowFunctionIntro, getPropertyAccess, n, s } = snippets;\n\tconst factoryVar = compact ? 'f' : 'factory';\n\tconst globalVar = compact ? 'g' : 'global';\n\n\tif (hasExports && !name) {\n\t\treturn error({\n\t\t\tcode: 'MISSING_NAME_OPTION_FOR_IIFE_EXPORT',\n\t\t\tmessage:\n\t\t\t\t'You must supply \"output.name\" for UMD bundles that have exports so that the exports are accessible in environments without a module loader.'\n\t\t});\n\t}\n\n\twarnOnBuiltins(warn, dependencies);\n\n\tconst amdDeps = dependencies.map(\n\t\tm => `'${updateExtensionForRelativeAmdId(m.id, amd.forceJsExtensionForImports)}'`\n\t);\n\tconst cjsDeps = dependencies.map(m => `require('${m.id}')`);\n\n\tconst trimmedImports = trimEmptyImports(dependencies);\n\tconst globalDeps = trimmedImports.map(module =>\n\t\tglobalProp(module.globalName, globalVar, getPropertyAccess)\n\t);\n\tconst factoryParams = trimmedImports.map(m => m.name);\n\n\tif (namedExportsMode && (hasExports || noConflict)) {\n\t\tamdDeps.unshift(`'exports'`);\n\t\tcjsDeps.unshift(`exports`);\n\t\tglobalDeps.unshift(\n\t\t\tassignToDeepVariable(\n\t\t\t\tname!,\n\t\t\t\tglobalVar,\n\t\t\t\tglobals,\n\t\t\t\t`${extend ? `${globalProp(name!, globalVar, getPropertyAccess)}${_}||${_}` : ''}{}`,\n\t\t\t\tsnippets\n\t\t\t)\n\t\t);\n\n\t\tfactoryParams.unshift('exports');\n\t}\n\n\tconst completeAmdId = getCompleteAmdId(amd, id);\n\tconst amdParams =\n\t\t(completeAmdId ? `'${completeAmdId}',${_}` : ``) +\n\t\t(amdDeps.length ? `[${amdDeps.join(`,${_}`)}],${_}` : ``);\n\n\tconst define = amd.define;\n\tconst cjsExport = !namedExportsMode && hasExports ? `module.exports${_}=${_}` : ``;\n\tconst useStrict = strict ? `${_}'use strict';${n}` : ``;\n\n\tlet iifeExport;\n\n\tif (noConflict) {\n\t\tconst noConflictExportsVar = compact ? 'e' : 'exports';\n\t\tlet factory;\n\n\t\tif (!namedExportsMode && hasExports) {\n\t\t\tfactory = `${cnst} ${noConflictExportsVar}${_}=${_}${assignToDeepVariable(\n\t\t\t\tname!,\n\t\t\t\tglobalVar,\n\t\t\t\tglobals,\n\t\t\t\t`${factoryVar}(${globalDeps.join(`,${_}`)})`,\n\t\t\t\tsnippets\n\t\t\t)};`;\n\t\t} else {\n\t\t\tconst module = globalDeps.shift();\n\t\t\tfactory =\n\t\t\t\t`${cnst} ${noConflictExportsVar}${_}=${_}${module};${n}` +\n\t\t\t\t`${t}${t}${factoryVar}(${[noConflictExportsVar].concat(globalDeps).join(`,${_}`)});`;\n\t\t}\n\t\tiifeExport =\n\t\t\t`(${getFunctionIntro([], { isAsync: false, name: null })}{${n}` +\n\t\t\t`${t}${t}${cnst} current${_}=${_}${safeAccess(name!, globalVar, snippets)};${n}` +\n\t\t\t`${t}${t}${factory}${n}` +\n\t\t\t`${t}${t}${noConflictExportsVar}.noConflict${_}=${_}${getFunctionIntro([], {\n\t\t\t\tisAsync: false,\n\t\t\t\tname: null\n\t\t\t})}{${_}` +\n\t\t\t`${globalProp(\n\t\t\t\tname!,\n\t\t\t\tglobalVar,\n\t\t\t\tgetPropertyAccess\n\t\t\t)}${_}=${_}current;${_}return ${noConflictExportsVar}${s}${_}};${n}` +\n\t\t\t`${t}})()`;\n\t} else {\n\t\tiifeExport = `${factoryVar}(${globalDeps.join(`,${_}`)})`;\n\t\tif (!namedExportsMode && hasExports) {\n\t\t\tiifeExport = assignToDeepVariable(name!, globalVar, globals, iifeExport, snippets);\n\t\t}\n\t}\n\n\tconst iifeNeedsGlobal = hasExports || (noConflict && namedExportsMode) || globalDeps.length > 0;\n\tconst wrapperParams: string[] = [factoryVar];\n\tif (iifeNeedsGlobal) {\n\t\twrapperParams.unshift(globalVar);\n\t}\n\tconst globalArg = iifeNeedsGlobal ? `this,${_}` : '';\n\tconst iifeStart = iifeNeedsGlobal\n\t\t? `(${globalVar}${_}=${_}typeof globalThis${_}!==${_}'undefined'${_}?${_}globalThis${_}:${_}${globalVar}${_}||${_}self,${_}`\n\t\t: '';\n\tconst iifeEnd = iifeNeedsGlobal ? ')' : '';\n\tconst cjsIntro = iifeNeedsGlobal\n\t\t? `${t}typeof exports${_}===${_}'object'${_}&&${_}typeof module${_}!==${_}'undefined'${_}?` +\n\t\t `${_}${cjsExport}${factoryVar}(${cjsDeps.join(`,${_}`)})${_}:${n}`\n\t\t: '';\n\n\tconst wrapperIntro =\n\t\t`(${getNonArrowFunctionIntro(wrapperParams, { isAsync: false, name: null })}{${n}` +\n\t\tcjsIntro +\n\t\t`${t}typeof ${define}${_}===${_}'function'${_}&&${_}${define}.amd${_}?${_}${define}(${amdParams}${factoryVar})${_}:${n}` +\n\t\t`${t}${iifeStart}${iifeExport}${iifeEnd};${n}` +\n\t\t// factory function should be wrapped by parentheses to avoid lazy parsing,\n\t\t// cf. https://v8.dev/blog/preparser#pife\n\t\t`})(${globalArg}(${getNonArrowFunctionIntro(factoryParams, {\n\t\t\tisAsync: false,\n\t\t\tname: null\n\t\t})}{${useStrict}${n}`;\n\n\tconst wrapperOutro = n + n + '}));';\n\n\tmagicString.prepend(\n\t\t`${intro}${getInteropBlock(\n\t\t\tdependencies,\n\t\t\tinterop,\n\t\t\texternalLiveBindings,\n\t\t\tfreeze,\n\t\t\tnamespaceToStringTag,\n\t\t\taccessedGlobals,\n\t\t\tt,\n\t\t\tsnippets\n\t\t)}`\n\t);\n\n\tconst exportBlock = getExportBlock(\n\t\texports,\n\t\tdependencies,\n\t\tnamedExportsMode,\n\t\tinterop,\n\t\tsnippets,\n\t\tt,\n\t\texternalLiveBindings\n\t);\n\tlet namespaceMarkers = getNamespaceMarkers(\n\t\tnamedExportsMode && hasExports,\n\t\tesModule,\n\t\tnamespaceToStringTag,\n\t\tsnippets\n\t);\n\tif (namespaceMarkers) {\n\t\tnamespaceMarkers = n + n + namespaceMarkers;\n\t}\n\tmagicString.append(`${exportBlock}${namespaceMarkers}${outro}`);\n\treturn magicString.trim().indent(t).append(wrapperOutro).prepend(wrapperIntro);\n}\n","import type { Bundle as MagicStringBundle } from 'magic-string';\nimport type { ChunkDependencies, ChunkExports } from '../Chunk';\nimport type { NormalizedOutputOptions, RollupWarning } from '../rollup/types';\nimport type { GenerateCodeSnippets } from '../utils/generateCodeSnippets';\nimport amd from './amd';\nimport cjs from './cjs';\nimport es from './es';\nimport iife from './iife';\nimport system from './system';\nimport umd from './umd';\n\nexport interface FinaliserOptions {\n\taccessedGlobals: Set;\n\tdependencies: ChunkDependencies;\n\texports: ChunkExports;\n\thasExports: boolean;\n\tid: string;\n\tindent: string;\n\tintro: string;\n\tisEntryFacade: boolean;\n\tisModuleFacade: boolean;\n\tnamedExportsMode: boolean;\n\toutro: string;\n\tsnippets: GenerateCodeSnippets;\n\tusesTopLevelAwait: boolean;\n\twarn(warning: RollupWarning): void;\n}\n\nexport type Finaliser = (\n\tmagicString: MagicStringBundle,\n\tfinaliserOptions: FinaliserOptions,\n\toptions: NormalizedOutputOptions\n) => MagicStringBundle;\n\nexport default { amd, cjs, es, iife, system, umd } as {\n\t[format: string]: Finaliser;\n};\n","import type { Bundle, Bundle as MagicStringBundle } from 'magic-string';\nimport type { NormalizedOutputOptions } from '../rollup/types';\nimport getCompleteAmdId from './shared/getCompleteAmdId';\nimport { getExportBlock, getNamespaceMarkers } from './shared/getExportBlock';\nimport getInteropBlock from './shared/getInteropBlock';\nimport updateExtensionForRelativeAmdId from './shared/updateExtensionForRelativeAmdId';\nimport warnOnBuiltins from './shared/warnOnBuiltins';\nimport type { FinaliserOptions } from './index';\n\nexport default function amd(\n\tmagicString: MagicStringBundle,\n\t{\n\t\taccessedGlobals,\n\t\tdependencies,\n\t\texports,\n\t\thasExports,\n\t\tid,\n\t\tindent: t,\n\t\tintro,\n\t\tisEntryFacade,\n\t\tisModuleFacade,\n\t\tnamedExportsMode,\n\t\toutro,\n\t\tsnippets,\n\t\twarn\n\t}: FinaliserOptions,\n\t{\n\t\tamd,\n\t\tesModule,\n\t\texternalLiveBindings,\n\t\tfreeze,\n\t\tinterop,\n\t\tnamespaceToStringTag,\n\t\tstrict\n\t}: NormalizedOutputOptions\n): Bundle {\n\twarnOnBuiltins(warn, dependencies);\n\tconst deps = dependencies.map(\n\t\tm => `'${updateExtensionForRelativeAmdId(m.id, amd.forceJsExtensionForImports)}'`\n\t);\n\tconst args = dependencies.map(m => m.name);\n\tconst { n, getNonArrowFunctionIntro, _ } = snippets;\n\n\tif (namedExportsMode && hasExports) {\n\t\targs.unshift(`exports`);\n\t\tdeps.unshift(`'exports'`);\n\t}\n\n\tif (accessedGlobals.has('require')) {\n\t\targs.unshift('require');\n\t\tdeps.unshift(`'require'`);\n\t}\n\n\tif (accessedGlobals.has('module')) {\n\t\targs.unshift('module');\n\t\tdeps.unshift(`'module'`);\n\t}\n\n\tconst completeAmdId = getCompleteAmdId(amd, id);\n\tconst params =\n\t\t(completeAmdId ? `'${completeAmdId}',${_}` : ``) +\n\t\t(deps.length ? `[${deps.join(`,${_}`)}],${_}` : ``);\n\tconst useStrict = strict ? `${_}'use strict';` : '';\n\n\tmagicString.prepend(\n\t\t`${intro}${getInteropBlock(\n\t\t\tdependencies,\n\t\t\tinterop,\n\t\t\texternalLiveBindings,\n\t\t\tfreeze,\n\t\t\tnamespaceToStringTag,\n\t\t\taccessedGlobals,\n\t\t\tt,\n\t\t\tsnippets\n\t\t)}`\n\t);\n\n\tconst exportBlock = getExportBlock(\n\t\texports,\n\t\tdependencies,\n\t\tnamedExportsMode,\n\t\tinterop,\n\t\tsnippets,\n\t\tt,\n\t\texternalLiveBindings\n\t);\n\tlet namespaceMarkers = getNamespaceMarkers(\n\t\tnamedExportsMode && hasExports,\n\t\tisEntryFacade && esModule,\n\t\tisModuleFacade && namespaceToStringTag,\n\t\tsnippets\n\t);\n\tif (namespaceMarkers) {\n\t\tnamespaceMarkers = n + n + namespaceMarkers;\n\t}\n\tmagicString.append(`${exportBlock}${namespaceMarkers}${outro}`);\n\treturn (\n\t\tmagicString\n\t\t\t.indent(t)\n\t\t\t// factory function should be wrapped by parentheses to avoid lazy parsing,\n\t\t\t// cf. https://v8.dev/blog/preparser#pife\n\t\t\t.prepend(\n\t\t\t\t`${amd.define}(${params}(${getNonArrowFunctionIntro(args, {\n\t\t\t\t\tisAsync: false,\n\t\t\t\t\tname: null\n\t\t\t\t})}{${useStrict}${n}${n}`\n\t\t\t)\n\t\t\t.append(`${n}${n}}));`)\n\t);\n}\n","import type { Bundle, Bundle as MagicStringBundle } from 'magic-string';\nimport type { ChunkDependencies } from '../Chunk';\nimport type { NormalizedOutputOptions } from '../rollup/types';\nimport type { GenerateCodeSnippets } from '../utils/generateCodeSnippets';\nimport { getExportBlock, getNamespaceMarkers } from './shared/getExportBlock';\nimport getInteropBlock from './shared/getInteropBlock';\nimport type { FinaliserOptions } from './index';\n\nexport default function cjs(\n\tmagicString: MagicStringBundle,\n\t{\n\t\taccessedGlobals,\n\t\tdependencies,\n\t\texports,\n\t\thasExports,\n\t\tindent: t,\n\t\tintro,\n\t\tisEntryFacade,\n\t\tisModuleFacade,\n\t\tnamedExportsMode,\n\t\toutro,\n\t\tsnippets\n\t}: FinaliserOptions,\n\t{\n\t\tcompact,\n\t\tesModule,\n\t\texternalLiveBindings,\n\t\tfreeze,\n\t\tinterop,\n\t\tnamespaceToStringTag,\n\t\tstrict\n\t}: NormalizedOutputOptions\n): Bundle {\n\tconst { _, n } = snippets;\n\n\tconst useStrict = strict ? `'use strict';${n}${n}` : '';\n\tlet namespaceMarkers = getNamespaceMarkers(\n\t\tnamedExportsMode && hasExports,\n\t\tisEntryFacade && esModule,\n\t\tisModuleFacade && namespaceToStringTag,\n\t\tsnippets\n\t);\n\tif (namespaceMarkers) {\n\t\tnamespaceMarkers += n + n;\n\t}\n\tconst importBlock = getImportBlock(dependencies, snippets, compact);\n\tconst interopBlock = getInteropBlock(\n\t\tdependencies,\n\t\tinterop,\n\t\texternalLiveBindings,\n\t\tfreeze,\n\t\tnamespaceToStringTag,\n\t\taccessedGlobals,\n\t\tt,\n\t\tsnippets\n\t);\n\n\tmagicString.prepend(`${useStrict}${intro}${namespaceMarkers}${importBlock}${interopBlock}`);\n\n\tconst exportBlock = getExportBlock(\n\t\texports,\n\t\tdependencies,\n\t\tnamedExportsMode,\n\t\tinterop,\n\t\tsnippets,\n\t\tt,\n\t\texternalLiveBindings,\n\t\t`module.exports${_}=${_}`\n\t);\n\n\treturn magicString.append(`${exportBlock}${outro}`);\n}\n\nfunction getImportBlock(\n\tdependencies: ChunkDependencies,\n\t{ _, cnst, n }: GenerateCodeSnippets,\n\tcompact: boolean\n): string {\n\tlet importBlock = '';\n\tlet definingVariable = false;\n\tfor (const { id, name, reexports, imports } of dependencies) {\n\t\tif (!reexports && !imports) {\n\t\t\tif (importBlock) {\n\t\t\t\timportBlock += compact && !definingVariable ? ',' : `;${n}`;\n\t\t\t}\n\t\t\tdefiningVariable = false;\n\t\t\timportBlock += `require('${id}')`;\n\t\t} else {\n\t\t\timportBlock += compact && definingVariable ? ',' : `${importBlock ? `;${n}` : ''}${cnst} `;\n\t\t\tdefiningVariable = true;\n\t\t\timportBlock += `${name}${_}=${_}require('${id}')`;\n\t\t}\n\t}\n\tif (importBlock) {\n\t\treturn `${importBlock};${n}${n}`;\n\t}\n\treturn '';\n}\n","import type { Bundle, Bundle as MagicStringBundle } from 'magic-string';\nimport type { ChunkDependencies, ChunkExports, ImportSpecifier, ReexportSpecifier } from '../Chunk';\nimport type { NormalizedOutputOptions } from '../rollup/types';\nimport type { GenerateCodeSnippets } from '../utils/generateCodeSnippets';\nimport { getHelpersBlock } from '../utils/interopHelpers';\nimport type { FinaliserOptions } from './index';\n\nexport default function es(\n\tmagicString: MagicStringBundle,\n\t{ accessedGlobals, indent: t, intro, outro, dependencies, exports, snippets }: FinaliserOptions,\n\t{ externalLiveBindings, freeze, namespaceToStringTag }: NormalizedOutputOptions\n): Bundle {\n\tconst { _, n } = snippets;\n\n\tconst importBlock = getImportBlock(dependencies, _);\n\tif (importBlock.length > 0) intro += importBlock.join(n) + n + n;\n\tintro += getHelpersBlock(\n\t\tnull,\n\t\taccessedGlobals,\n\t\tt,\n\t\tsnippets,\n\t\texternalLiveBindings,\n\t\tfreeze,\n\t\tnamespaceToStringTag\n\t);\n\tif (intro) magicString.prepend(intro);\n\n\tconst exportBlock = getExportBlock(exports, snippets);\n\tif (exportBlock.length) magicString.append(n + n + exportBlock.join(n).trim());\n\tif (outro) magicString.append(outro);\n\n\treturn magicString.trim();\n}\n\nfunction getImportBlock(dependencies: ChunkDependencies, _: string): string[] {\n\tconst importBlock: string[] = [];\n\tfor (const { id, reexports, imports, name } of dependencies) {\n\t\tif (!reexports && !imports) {\n\t\t\timportBlock.push(`import${_}'${id}';`);\n\t\t\tcontinue;\n\t\t}\n\t\tif (imports) {\n\t\t\tlet defaultImport: ImportSpecifier | null = null;\n\t\t\tlet starImport: ImportSpecifier | null = null;\n\t\t\tconst importedNames: ImportSpecifier[] = [];\n\t\t\tfor (const specifier of imports) {\n\t\t\t\tif (specifier.imported === 'default') {\n\t\t\t\t\tdefaultImport = specifier;\n\t\t\t\t} else if (specifier.imported === '*') {\n\t\t\t\t\tstarImport = specifier;\n\t\t\t\t} else {\n\t\t\t\t\timportedNames.push(specifier);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (starImport) {\n\t\t\t\timportBlock.push(`import${_}*${_}as ${starImport.local} from${_}'${id}';`);\n\t\t\t}\n\t\t\tif (defaultImport && importedNames.length === 0) {\n\t\t\t\timportBlock.push(`import ${defaultImport.local} from${_}'${id}';`);\n\t\t\t} else if (importedNames.length > 0) {\n\t\t\t\timportBlock.push(\n\t\t\t\t\t`import ${defaultImport ? `${defaultImport.local},${_}` : ''}{${_}${importedNames\n\t\t\t\t\t\t.map(specifier => {\n\t\t\t\t\t\t\tif (specifier.imported === specifier.local) {\n\t\t\t\t\t\t\t\treturn specifier.imported;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\treturn `${specifier.imported} as ${specifier.local}`;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.join(`,${_}`)}${_}}${_}from${_}'${id}';`\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tif (reexports) {\n\t\t\tlet starExport: ReexportSpecifier | null = null;\n\t\t\tconst namespaceReexports: ReexportSpecifier[] = [];\n\t\t\tconst namedReexports: ReexportSpecifier[] = [];\n\t\t\tfor (const specifier of reexports) {\n\t\t\t\tif (specifier.reexported === '*') {\n\t\t\t\t\tstarExport = specifier;\n\t\t\t\t} else if (specifier.imported === '*') {\n\t\t\t\t\tnamespaceReexports.push(specifier);\n\t\t\t\t} else {\n\t\t\t\t\tnamedReexports.push(specifier);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (starExport) {\n\t\t\t\timportBlock.push(`export${_}*${_}from${_}'${id}';`);\n\t\t\t}\n\t\t\tif (namespaceReexports.length > 0) {\n\t\t\t\tif (\n\t\t\t\t\t!imports ||\n\t\t\t\t\t!imports.some(specifier => specifier.imported === '*' && specifier.local === name)\n\t\t\t\t) {\n\t\t\t\t\timportBlock.push(`import${_}*${_}as ${name} from${_}'${id}';`);\n\t\t\t\t}\n\t\t\t\tfor (const specifier of namespaceReexports) {\n\t\t\t\t\timportBlock.push(\n\t\t\t\t\t\t`export${_}{${_}${\n\t\t\t\t\t\t\tname === specifier.reexported ? name : `${name} as ${specifier.reexported}`\n\t\t\t\t\t\t} };`\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (namedReexports.length > 0) {\n\t\t\t\timportBlock.push(\n\t\t\t\t\t`export${_}{${_}${namedReexports\n\t\t\t\t\t\t.map(specifier => {\n\t\t\t\t\t\t\tif (specifier.imported === specifier.reexported) {\n\t\t\t\t\t\t\t\treturn specifier.imported;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\treturn `${specifier.imported} as ${specifier.reexported}`;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.join(`,${_}`)}${_}}${_}from${_}'${id}';`\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\treturn importBlock;\n}\n\nfunction getExportBlock(exports: ChunkExports, { _, cnst }: GenerateCodeSnippets): string[] {\n\tconst exportBlock: string[] = [];\n\tconst exportDeclaration: string[] = [];\n\tfor (const specifier of exports) {\n\t\tif (specifier.expression) {\n\t\t\texportBlock.push(`${cnst} ${specifier.local}${_}=${_}${specifier.expression};`);\n\t\t}\n\t\texportDeclaration.push(\n\t\t\tspecifier.exported === specifier.local\n\t\t\t\t? specifier.local\n\t\t\t\t: `${specifier.local} as ${specifier.exported}`\n\t\t);\n\t}\n\tif (exportDeclaration.length) {\n\t\texportBlock.push(`export${_}{${_}${exportDeclaration.join(`,${_}`)}${_}};`);\n\t}\n\treturn exportBlock;\n}\n","import type { Bundle, Bundle as MagicStringBundle } from 'magic-string';\nimport type { NormalizedOutputOptions } from '../rollup/types';\nimport { error } from '../utils/error';\nimport { isLegal } from '../utils/identifierHelpers';\nimport { getExportBlock, getNamespaceMarkers } from './shared/getExportBlock';\nimport getInteropBlock from './shared/getInteropBlock';\nimport { keypath } from './shared/sanitize';\nimport setupNamespace from './shared/setupNamespace';\nimport trimEmptyImports from './shared/trimEmptyImports';\nimport warnOnBuiltins from './shared/warnOnBuiltins';\nimport type { FinaliserOptions } from './index';\n\nexport default function iife(\n\tmagicString: MagicStringBundle,\n\t{\n\t\taccessedGlobals,\n\t\tdependencies,\n\t\texports,\n\t\thasExports,\n\t\tindent: t,\n\t\tintro,\n\t\tnamedExportsMode,\n\t\toutro,\n\t\tsnippets,\n\t\twarn\n\t}: FinaliserOptions,\n\t{\n\t\tcompact,\n\t\tesModule,\n\t\textend,\n\t\tfreeze,\n\t\texternalLiveBindings,\n\t\tglobals,\n\t\tinterop,\n\t\tname,\n\t\tnamespaceToStringTag,\n\t\tstrict\n\t}: NormalizedOutputOptions\n): Bundle {\n\tconst { _, getNonArrowFunctionIntro, getPropertyAccess, n } = snippets;\n\tconst isNamespaced = name && name.includes('.');\n\tconst useVariableAssignment = !extend && !isNamespaced;\n\n\tif (name && useVariableAssignment && !isLegal(name)) {\n\t\treturn error({\n\t\t\tcode: 'ILLEGAL_IDENTIFIER_AS_NAME',\n\t\t\tmessage: `Given name \"${name}\" is not a legal JS identifier. If you need this, you can try \"output.extend: true\".`\n\t\t});\n\t}\n\n\twarnOnBuiltins(warn, dependencies);\n\n\tconst external = trimEmptyImports(dependencies);\n\tconst deps = external.map(dep => dep.globalName || 'null');\n\tconst args = external.map(m => m.name);\n\n\tif (hasExports && !name) {\n\t\twarn({\n\t\t\tcode: 'MISSING_NAME_OPTION_FOR_IIFE_EXPORT',\n\t\t\tmessage: `If you do not supply \"output.name\", you may not be able to access the exports of an IIFE bundle.`\n\t\t});\n\t}\n\n\tif (namedExportsMode && hasExports) {\n\t\tif (extend) {\n\t\t\tdeps.unshift(\n\t\t\t\t`this${keypath(name!, getPropertyAccess)}${_}=${_}this${keypath(\n\t\t\t\t\tname!,\n\t\t\t\t\tgetPropertyAccess\n\t\t\t\t)}${_}||${_}{}`\n\t\t\t);\n\t\t\targs.unshift('exports');\n\t\t} else {\n\t\t\tdeps.unshift('{}');\n\t\t\targs.unshift('exports');\n\t\t}\n\t}\n\n\tconst useStrict = strict ? `${t}'use strict';${n}` : '';\n\tconst interopBlock = getInteropBlock(\n\t\tdependencies,\n\t\tinterop,\n\t\texternalLiveBindings,\n\t\tfreeze,\n\t\tnamespaceToStringTag,\n\t\taccessedGlobals,\n\t\tt,\n\t\tsnippets\n\t);\n\tmagicString.prepend(`${intro}${interopBlock}`);\n\n\tlet wrapperIntro = `(${getNonArrowFunctionIntro(args, {\n\t\tisAsync: false,\n\t\tname: null\n\t})}{${n}${useStrict}${n}`;\n\tif (hasExports) {\n\t\tif (name && !(extend && namedExportsMode)) {\n\t\t\twrapperIntro =\n\t\t\t\t(useVariableAssignment ? `var ${name}` : `this${keypath(name, getPropertyAccess)}`) +\n\t\t\t\t`${_}=${_}${wrapperIntro}`;\n\t\t}\n\t\tif (isNamespaced) {\n\t\t\twrapperIntro = setupNamespace(name!, 'this', globals, snippets, compact) + wrapperIntro;\n\t\t}\n\t}\n\n\tlet wrapperOutro = `${n}${n}})(${deps.join(`,${_}`)});`;\n\tif (hasExports && !extend && namedExportsMode) {\n\t\twrapperOutro = `${n}${n}${t}return exports;${wrapperOutro}`;\n\t}\n\n\tconst exportBlock = getExportBlock(\n\t\texports,\n\t\tdependencies,\n\t\tnamedExportsMode,\n\t\tinterop,\n\t\tsnippets,\n\t\tt,\n\t\texternalLiveBindings\n\t);\n\tlet namespaceMarkers = getNamespaceMarkers(\n\t\tnamedExportsMode && hasExports,\n\t\tesModule,\n\t\tnamespaceToStringTag,\n\t\tsnippets\n\t);\n\tif (namespaceMarkers) {\n\t\tnamespaceMarkers = n + n + namespaceMarkers;\n\t}\n\tmagicString.append(`${exportBlock}${namespaceMarkers}${outro}`);\n\treturn magicString.indent(t).prepend(wrapperIntro).append(wrapperOutro);\n}\n","import { type DecodedSourceMap, SourceMap } from 'magic-string';\nimport type Module from '../Module';\nimport type {\n\tDecodedSourceMapOrMissing,\n\tExistingDecodedSourceMap,\n\tSourceMapSegment,\n\tWarningHandler\n} from '../rollup/types';\nimport { error } from './error';\nimport { basename, dirname, relative, resolve } from './path';\n\nclass Source {\n\treadonly content: string;\n\treadonly filename: string;\n\tisOriginal = true;\n\n\tconstructor(filename: string, content: string) {\n\t\tthis.filename = filename;\n\t\tthis.content = content;\n\t}\n\n\ttraceSegment(line: number, column: number, name: string): SourceMapSegmentObject {\n\t\treturn { column, line, name, source: this };\n\t}\n}\n\ninterface SourceMapSegmentObject {\n\tcolumn: number;\n\tline: number;\n\tname: string;\n\tsource: Source;\n}\n\nclass Link {\n\treadonly mappings: readonly SourceMapSegment[][];\n\treadonly names: readonly string[];\n\treadonly sources: (Source | Link)[];\n\n\tconstructor(\n\t\tmap: { mappings: readonly SourceMapSegment[][]; names: readonly string[] },\n\t\tsources: (Source | Link)[]\n\t) {\n\t\tthis.sources = sources;\n\t\tthis.names = map.names;\n\t\tthis.mappings = map.mappings;\n\t}\n\n\ttraceMappings() {\n\t\tconst sources: string[] = [];\n\t\tconst sourceIndexMap = new Map();\n\t\tconst sourcesContent: string[] = [];\n\t\tconst names: string[] = [];\n\t\tconst nameIndexMap = new Map();\n\n\t\tconst mappings = [];\n\n\t\tfor (const line of this.mappings) {\n\t\t\tconst tracedLine: SourceMapSegment[] = [];\n\n\t\t\tfor (const segment of line) {\n\t\t\t\tif (segment.length === 1) continue;\n\t\t\t\tconst source = this.sources[segment[1]];\n\t\t\t\tif (!source) continue;\n\n\t\t\t\tconst traced = source.traceSegment(\n\t\t\t\t\tsegment[2],\n\t\t\t\t\tsegment[3],\n\t\t\t\t\tsegment.length === 5 ? this.names[segment[4]] : ''\n\t\t\t\t);\n\n\t\t\t\tif (traced) {\n\t\t\t\t\tconst {\n\t\t\t\t\t\tcolumn,\n\t\t\t\t\t\tline,\n\t\t\t\t\t\tname,\n\t\t\t\t\t\tsource: { content, filename }\n\t\t\t\t\t} = traced;\n\t\t\t\t\tlet sourceIndex = sourceIndexMap.get(filename);\n\t\t\t\t\tif (sourceIndex === undefined) {\n\t\t\t\t\t\tsourceIndex = sources.length;\n\t\t\t\t\t\tsources.push(filename);\n\t\t\t\t\t\tsourceIndexMap.set(filename, sourceIndex);\n\t\t\t\t\t\tsourcesContent[sourceIndex] = content;\n\t\t\t\t\t} else if (sourcesContent[sourceIndex] == null) {\n\t\t\t\t\t\tsourcesContent[sourceIndex] = content;\n\t\t\t\t\t} else if (content != null && sourcesContent[sourceIndex] !== content) {\n\t\t\t\t\t\treturn error({\n\t\t\t\t\t\t\tmessage: `Multiple conflicting contents for sourcemap source ${filename}`\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\tconst tracedSegment: SourceMapSegment = [segment[0], sourceIndex, line, column];\n\n\t\t\t\t\tif (name) {\n\t\t\t\t\t\tlet nameIndex = nameIndexMap.get(name);\n\t\t\t\t\t\tif (nameIndex === undefined) {\n\t\t\t\t\t\t\tnameIndex = names.length;\n\t\t\t\t\t\t\tnames.push(name);\n\t\t\t\t\t\t\tnameIndexMap.set(name, nameIndex);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t(tracedSegment as SourceMapSegment)[4] = nameIndex;\n\t\t\t\t\t}\n\n\t\t\t\t\ttracedLine.push(tracedSegment);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tmappings.push(tracedLine);\n\t\t}\n\n\t\treturn { mappings, names, sources, sourcesContent };\n\t}\n\n\ttraceSegment(line: number, column: number, name: string): SourceMapSegmentObject | null {\n\t\tconst segments = this.mappings[line];\n\t\tif (!segments) return null;\n\n\t\t// binary search through segments for the given column\n\t\tlet searchStart = 0;\n\t\tlet searchEnd = segments.length - 1;\n\n\t\twhile (searchStart <= searchEnd) {\n\t\t\tconst m = (searchStart + searchEnd) >> 1;\n\t\t\tconst segment = segments[m];\n\n\t\t\t// If a sourcemap does not have sufficient resolution to contain a\n\t\t\t// necessary mapping, e.g. because it only contains line information, we\n\t\t\t// use the best approximation we could find\n\t\t\tif (segment[0] === column || searchStart === searchEnd) {\n\t\t\t\tif (segment.length == 1) return null;\n\t\t\t\tconst source = this.sources[segment[1]];\n\t\t\t\tif (!source) return null;\n\n\t\t\t\treturn source.traceSegment(\n\t\t\t\t\tsegment[2],\n\t\t\t\t\tsegment[3],\n\t\t\t\t\tsegment.length === 5 ? this.names[segment[4]] : name\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (segment[0] > column) {\n\t\t\t\tsearchEnd = m - 1;\n\t\t\t} else {\n\t\t\t\tsearchStart = m + 1;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}\n}\n\nfunction getLinkMap(warn: WarningHandler) {\n\treturn function linkMap(source: Source | Link, map: DecodedSourceMapOrMissing): Link {\n\t\tif (map.mappings) {\n\t\t\treturn new Link(map, [source]);\n\t\t}\n\n\t\twarn({\n\t\t\tcode: 'SOURCEMAP_BROKEN',\n\t\t\tmessage:\n\t\t\t\t`Sourcemap is likely to be incorrect: a plugin (${map.plugin}) was used to transform ` +\n\t\t\t\t\"files, but didn't generate a sourcemap for the transformation. Consult the plugin \" +\n\t\t\t\t'documentation for help',\n\t\t\tplugin: map.plugin,\n\t\t\turl: `https://rollupjs.org/guide/en/#warning-sourcemap-is-likely-to-be-incorrect`\n\t\t});\n\n\t\treturn new Link(\n\t\t\t{\n\t\t\t\tmappings: [],\n\t\t\t\tnames: []\n\t\t\t},\n\t\t\t[source]\n\t\t);\n\t};\n}\n\nfunction getCollapsedSourcemap(\n\tid: string,\n\toriginalCode: string,\n\toriginalSourcemap: ExistingDecodedSourceMap | null,\n\tsourcemapChain: readonly DecodedSourceMapOrMissing[],\n\tlinkMap: (source: Source | Link, map: DecodedSourceMapOrMissing) => Link\n): Source | Link {\n\tlet source: Source | Link;\n\n\tif (!originalSourcemap) {\n\t\tsource = new Source(id, originalCode);\n\t} else {\n\t\tconst sources = originalSourcemap.sources;\n\t\tconst sourcesContent = originalSourcemap.sourcesContent || [];\n\t\tconst directory = dirname(id) || '.';\n\t\tconst sourceRoot = originalSourcemap.sourceRoot || '.';\n\n\t\tconst baseSources = sources.map(\n\t\t\t(source, i) => new Source(resolve(directory, sourceRoot, source), sourcesContent[i])\n\t\t);\n\t\tsource = new Link(originalSourcemap, baseSources);\n\t}\n\treturn sourcemapChain.reduce(linkMap, source);\n}\n\nexport function collapseSourcemaps(\n\tfile: string,\n\tmap: DecodedSourceMap,\n\tmodules: readonly Module[],\n\tbundleSourcemapChain: readonly DecodedSourceMapOrMissing[],\n\texcludeContent: boolean | undefined,\n\twarn: WarningHandler\n): SourceMap {\n\tconst linkMap = getLinkMap(warn);\n\tconst moduleSources = modules\n\t\t.filter(module => !module.excludeFromSourcemap)\n\t\t.map(module =>\n\t\t\tgetCollapsedSourcemap(\n\t\t\t\tmodule.id,\n\t\t\t\tmodule.originalCode,\n\t\t\t\tmodule.originalSourcemap,\n\t\t\t\tmodule.sourcemapChain,\n\t\t\t\tlinkMap\n\t\t\t)\n\t\t);\n\n\tconst link = new Link(map, moduleSources);\n\tconst source = bundleSourcemapChain.reduce(linkMap, link);\n\tlet { sources, sourcesContent, names, mappings } = source.traceMappings();\n\n\tif (file) {\n\t\tconst directory = dirname(file);\n\t\tsources = sources.map((source: string) => relative(directory, source));\n\t\tfile = basename(file);\n\t}\n\n\tsourcesContent = (excludeContent ? null : sourcesContent) as string[];\n\n\treturn new SourceMap({ file, mappings, names, sources, sourcesContent });\n}\n\nexport function collapseSourcemap(\n\tid: string,\n\toriginalCode: string,\n\toriginalSourcemap: ExistingDecodedSourceMap | null,\n\tsourcemapChain: readonly DecodedSourceMapOrMissing[],\n\twarn: WarningHandler\n): ExistingDecodedSourceMap | null {\n\tif (!sourcemapChain.length) {\n\t\treturn originalSourcemap;\n\t}\n\n\tconst source = getCollapsedSourcemap(\n\t\tid,\n\t\toriginalCode,\n\t\toriginalSourcemap,\n\t\tsourcemapChain,\n\t\tgetLinkMap(warn)\n\t) as Link;\n\tconst map = source.traceMappings();\n\treturn { version: 3, ...map };\n}\n","module.exports = assert;\n\nfunction assert(val, msg) {\n if (!val)\n throw new Error(msg || 'Assertion failed');\n}\n\nassert.equal = function assertEqual(l, r, msg) {\n if (l != r)\n throw new Error(msg || ('Assertion failed: ' + l + ' != ' + r));\n};\n","if (typeof Object.create === 'function') {\n // implementation from standard node.js 'util' module\n module.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n })\n }\n };\n} else {\n // old school shim for old browsers\n module.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor\n var TempCtor = function () {}\n TempCtor.prototype = superCtor.prototype\n ctor.prototype = new TempCtor()\n ctor.prototype.constructor = ctor\n }\n }\n}\n","'use strict';\n\nvar assert = require('minimalistic-assert');\nvar inherits = require('inherits');\n\nexports.inherits = inherits;\n\nfunction isSurrogatePair(msg, i) {\n if ((msg.charCodeAt(i) & 0xFC00) !== 0xD800) {\n return false;\n }\n if (i < 0 || i + 1 >= msg.length) {\n return false;\n }\n return (msg.charCodeAt(i + 1) & 0xFC00) === 0xDC00;\n}\n\nfunction toArray(msg, enc) {\n if (Array.isArray(msg))\n return msg.slice();\n if (!msg)\n return [];\n var res = [];\n if (typeof msg === 'string') {\n if (!enc) {\n // Inspired by stringToUtf8ByteArray() in closure-library by Google\n // https://github.com/google/closure-library/blob/8598d87242af59aac233270742c8984e2b2bdbe0/closure/goog/crypt/crypt.js#L117-L143\n // Apache License 2.0\n // https://github.com/google/closure-library/blob/master/LICENSE\n var p = 0;\n for (var i = 0; i < msg.length; i++) {\n var c = msg.charCodeAt(i);\n if (c < 128) {\n res[p++] = c;\n } else if (c < 2048) {\n res[p++] = (c >> 6) | 192;\n res[p++] = (c & 63) | 128;\n } else if (isSurrogatePair(msg, i)) {\n c = 0x10000 + ((c & 0x03FF) << 10) + (msg.charCodeAt(++i) & 0x03FF);\n res[p++] = (c >> 18) | 240;\n res[p++] = ((c >> 12) & 63) | 128;\n res[p++] = ((c >> 6) & 63) | 128;\n res[p++] = (c & 63) | 128;\n } else {\n res[p++] = (c >> 12) | 224;\n res[p++] = ((c >> 6) & 63) | 128;\n res[p++] = (c & 63) | 128;\n }\n }\n } else if (enc === 'hex') {\n msg = msg.replace(/[^a-z0-9]+/ig, '');\n if (msg.length % 2 !== 0)\n msg = '0' + msg;\n for (i = 0; i < msg.length; i += 2)\n res.push(parseInt(msg[i] + msg[i + 1], 16));\n }\n } else {\n for (i = 0; i < msg.length; i++)\n res[i] = msg[i] | 0;\n }\n return res;\n}\nexports.toArray = toArray;\n\nfunction toHex(msg) {\n var res = '';\n for (var i = 0; i < msg.length; i++)\n res += zero2(msg[i].toString(16));\n return res;\n}\nexports.toHex = toHex;\n\nfunction htonl(w) {\n var res = (w >>> 24) |\n ((w >>> 8) & 0xff00) |\n ((w << 8) & 0xff0000) |\n ((w & 0xff) << 24);\n return res >>> 0;\n}\nexports.htonl = htonl;\n\nfunction toHex32(msg, endian) {\n var res = '';\n for (var i = 0; i < msg.length; i++) {\n var w = msg[i];\n if (endian === 'little')\n w = htonl(w);\n res += zero8(w.toString(16));\n }\n return res;\n}\nexports.toHex32 = toHex32;\n\nfunction zero2(word) {\n if (word.length === 1)\n return '0' + word;\n else\n return word;\n}\nexports.zero2 = zero2;\n\nfunction zero8(word) {\n if (word.length === 7)\n return '0' + word;\n else if (word.length === 6)\n return '00' + word;\n else if (word.length === 5)\n return '000' + word;\n else if (word.length === 4)\n return '0000' + word;\n else if (word.length === 3)\n return '00000' + word;\n else if (word.length === 2)\n return '000000' + word;\n else if (word.length === 1)\n return '0000000' + word;\n else\n return word;\n}\nexports.zero8 = zero8;\n\nfunction join32(msg, start, end, endian) {\n var len = end - start;\n assert(len % 4 === 0);\n var res = new Array(len / 4);\n for (var i = 0, k = start; i < res.length; i++, k += 4) {\n var w;\n if (endian === 'big')\n w = (msg[k] << 24) | (msg[k + 1] << 16) | (msg[k + 2] << 8) | msg[k + 3];\n else\n w = (msg[k + 3] << 24) | (msg[k + 2] << 16) | (msg[k + 1] << 8) | msg[k];\n res[i] = w >>> 0;\n }\n return res;\n}\nexports.join32 = join32;\n\nfunction split32(msg, endian) {\n var res = new Array(msg.length * 4);\n for (var i = 0, k = 0; i < msg.length; i++, k += 4) {\n var m = msg[i];\n if (endian === 'big') {\n res[k] = m >>> 24;\n res[k + 1] = (m >>> 16) & 0xff;\n res[k + 2] = (m >>> 8) & 0xff;\n res[k + 3] = m & 0xff;\n } else {\n res[k + 3] = m >>> 24;\n res[k + 2] = (m >>> 16) & 0xff;\n res[k + 1] = (m >>> 8) & 0xff;\n res[k] = m & 0xff;\n }\n }\n return res;\n}\nexports.split32 = split32;\n\nfunction rotr32(w, b) {\n return (w >>> b) | (w << (32 - b));\n}\nexports.rotr32 = rotr32;\n\nfunction rotl32(w, b) {\n return (w << b) | (w >>> (32 - b));\n}\nexports.rotl32 = rotl32;\n\nfunction sum32(a, b) {\n return (a + b) >>> 0;\n}\nexports.sum32 = sum32;\n\nfunction sum32_3(a, b, c) {\n return (a + b + c) >>> 0;\n}\nexports.sum32_3 = sum32_3;\n\nfunction sum32_4(a, b, c, d) {\n return (a + b + c + d) >>> 0;\n}\nexports.sum32_4 = sum32_4;\n\nfunction sum32_5(a, b, c, d, e) {\n return (a + b + c + d + e) >>> 0;\n}\nexports.sum32_5 = sum32_5;\n\nfunction sum64(buf, pos, ah, al) {\n var bh = buf[pos];\n var bl = buf[pos + 1];\n\n var lo = (al + bl) >>> 0;\n var hi = (lo < al ? 1 : 0) + ah + bh;\n buf[pos] = hi >>> 0;\n buf[pos + 1] = lo;\n}\nexports.sum64 = sum64;\n\nfunction sum64_hi(ah, al, bh, bl) {\n var lo = (al + bl) >>> 0;\n var hi = (lo < al ? 1 : 0) + ah + bh;\n return hi >>> 0;\n}\nexports.sum64_hi = sum64_hi;\n\nfunction sum64_lo(ah, al, bh, bl) {\n var lo = al + bl;\n return lo >>> 0;\n}\nexports.sum64_lo = sum64_lo;\n\nfunction sum64_4_hi(ah, al, bh, bl, ch, cl, dh, dl) {\n var carry = 0;\n var lo = al;\n lo = (lo + bl) >>> 0;\n carry += lo < al ? 1 : 0;\n lo = (lo + cl) >>> 0;\n carry += lo < cl ? 1 : 0;\n lo = (lo + dl) >>> 0;\n carry += lo < dl ? 1 : 0;\n\n var hi = ah + bh + ch + dh + carry;\n return hi >>> 0;\n}\nexports.sum64_4_hi = sum64_4_hi;\n\nfunction sum64_4_lo(ah, al, bh, bl, ch, cl, dh, dl) {\n var lo = al + bl + cl + dl;\n return lo >>> 0;\n}\nexports.sum64_4_lo = sum64_4_lo;\n\nfunction sum64_5_hi(ah, al, bh, bl, ch, cl, dh, dl, eh, el) {\n var carry = 0;\n var lo = al;\n lo = (lo + bl) >>> 0;\n carry += lo < al ? 1 : 0;\n lo = (lo + cl) >>> 0;\n carry += lo < cl ? 1 : 0;\n lo = (lo + dl) >>> 0;\n carry += lo < dl ? 1 : 0;\n lo = (lo + el) >>> 0;\n carry += lo < el ? 1 : 0;\n\n var hi = ah + bh + ch + dh + eh + carry;\n return hi >>> 0;\n}\nexports.sum64_5_hi = sum64_5_hi;\n\nfunction sum64_5_lo(ah, al, bh, bl, ch, cl, dh, dl, eh, el) {\n var lo = al + bl + cl + dl + el;\n\n return lo >>> 0;\n}\nexports.sum64_5_lo = sum64_5_lo;\n\nfunction rotr64_hi(ah, al, num) {\n var r = (al << (32 - num)) | (ah >>> num);\n return r >>> 0;\n}\nexports.rotr64_hi = rotr64_hi;\n\nfunction rotr64_lo(ah, al, num) {\n var r = (ah << (32 - num)) | (al >>> num);\n return r >>> 0;\n}\nexports.rotr64_lo = rotr64_lo;\n\nfunction shr64_hi(ah, al, num) {\n return ah >>> num;\n}\nexports.shr64_hi = shr64_hi;\n\nfunction shr64_lo(ah, al, num) {\n var r = (ah << (32 - num)) | (al >>> num);\n return r >>> 0;\n}\nexports.shr64_lo = shr64_lo;\n","'use strict';\n\nvar utils = require('./utils');\nvar assert = require('minimalistic-assert');\n\nfunction BlockHash() {\n this.pending = null;\n this.pendingTotal = 0;\n this.blockSize = this.constructor.blockSize;\n this.outSize = this.constructor.outSize;\n this.hmacStrength = this.constructor.hmacStrength;\n this.padLength = this.constructor.padLength / 8;\n this.endian = 'big';\n\n this._delta8 = this.blockSize / 8;\n this._delta32 = this.blockSize / 32;\n}\nexports.BlockHash = BlockHash;\n\nBlockHash.prototype.update = function update(msg, enc) {\n // Convert message to array, pad it, and join into 32bit blocks\n msg = utils.toArray(msg, enc);\n if (!this.pending)\n this.pending = msg;\n else\n this.pending = this.pending.concat(msg);\n this.pendingTotal += msg.length;\n\n // Enough data, try updating\n if (this.pending.length >= this._delta8) {\n msg = this.pending;\n\n // Process pending data in blocks\n var r = msg.length % this._delta8;\n this.pending = msg.slice(msg.length - r, msg.length);\n if (this.pending.length === 0)\n this.pending = null;\n\n msg = utils.join32(msg, 0, msg.length - r, this.endian);\n for (var i = 0; i < msg.length; i += this._delta32)\n this._update(msg, i, i + this._delta32);\n }\n\n return this;\n};\n\nBlockHash.prototype.digest = function digest(enc) {\n this.update(this._pad());\n assert(this.pending === null);\n\n return this._digest(enc);\n};\n\nBlockHash.prototype._pad = function pad() {\n var len = this.pendingTotal;\n var bytes = this._delta8;\n var k = bytes - ((len + this.padLength) % bytes);\n var res = new Array(k + this.padLength);\n res[0] = 0x80;\n for (var i = 1; i < k; i++)\n res[i] = 0;\n\n // Append length\n len <<= 3;\n if (this.endian === 'big') {\n for (var t = 8; t < this.padLength; t++)\n res[i++] = 0;\n\n res[i++] = 0;\n res[i++] = 0;\n res[i++] = 0;\n res[i++] = 0;\n res[i++] = (len >>> 24) & 0xff;\n res[i++] = (len >>> 16) & 0xff;\n res[i++] = (len >>> 8) & 0xff;\n res[i++] = len & 0xff;\n } else {\n res[i++] = len & 0xff;\n res[i++] = (len >>> 8) & 0xff;\n res[i++] = (len >>> 16) & 0xff;\n res[i++] = (len >>> 24) & 0xff;\n res[i++] = 0;\n res[i++] = 0;\n res[i++] = 0;\n res[i++] = 0;\n\n for (t = 8; t < this.padLength; t++)\n res[i++] = 0;\n }\n\n return res;\n};\n","'use strict';\n\nvar utils = require('../utils');\nvar rotr32 = utils.rotr32;\n\nfunction ft_1(s, x, y, z) {\n if (s === 0)\n return ch32(x, y, z);\n if (s === 1 || s === 3)\n return p32(x, y, z);\n if (s === 2)\n return maj32(x, y, z);\n}\nexports.ft_1 = ft_1;\n\nfunction ch32(x, y, z) {\n return (x & y) ^ ((~x) & z);\n}\nexports.ch32 = ch32;\n\nfunction maj32(x, y, z) {\n return (x & y) ^ (x & z) ^ (y & z);\n}\nexports.maj32 = maj32;\n\nfunction p32(x, y, z) {\n return x ^ y ^ z;\n}\nexports.p32 = p32;\n\nfunction s0_256(x) {\n return rotr32(x, 2) ^ rotr32(x, 13) ^ rotr32(x, 22);\n}\nexports.s0_256 = s0_256;\n\nfunction s1_256(x) {\n return rotr32(x, 6) ^ rotr32(x, 11) ^ rotr32(x, 25);\n}\nexports.s1_256 = s1_256;\n\nfunction g0_256(x) {\n return rotr32(x, 7) ^ rotr32(x, 18) ^ (x >>> 3);\n}\nexports.g0_256 = g0_256;\n\nfunction g1_256(x) {\n return rotr32(x, 17) ^ rotr32(x, 19) ^ (x >>> 10);\n}\nexports.g1_256 = g1_256;\n","'use strict';\n\nvar utils = require('../utils');\nvar common = require('../common');\nvar shaCommon = require('./common');\nvar assert = require('minimalistic-assert');\n\nvar sum32 = utils.sum32;\nvar sum32_4 = utils.sum32_4;\nvar sum32_5 = utils.sum32_5;\nvar ch32 = shaCommon.ch32;\nvar maj32 = shaCommon.maj32;\nvar s0_256 = shaCommon.s0_256;\nvar s1_256 = shaCommon.s1_256;\nvar g0_256 = shaCommon.g0_256;\nvar g1_256 = shaCommon.g1_256;\n\nvar BlockHash = common.BlockHash;\n\nvar sha256_K = [\n 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5,\n 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,\n 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3,\n 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,\n 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc,\n 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,\n 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7,\n 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,\n 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13,\n 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,\n 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3,\n 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,\n 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5,\n 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,\n 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208,\n 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2\n];\n\nfunction SHA256() {\n if (!(this instanceof SHA256))\n return new SHA256();\n\n BlockHash.call(this);\n this.h = [\n 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a,\n 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19\n ];\n this.k = sha256_K;\n this.W = new Array(64);\n}\nutils.inherits(SHA256, BlockHash);\nmodule.exports = SHA256;\n\nSHA256.blockSize = 512;\nSHA256.outSize = 256;\nSHA256.hmacStrength = 192;\nSHA256.padLength = 64;\n\nSHA256.prototype._update = function _update(msg, start) {\n var W = this.W;\n\n for (var i = 0; i < 16; i++)\n W[i] = msg[start + i];\n for (; i < W.length; i++)\n W[i] = sum32_4(g1_256(W[i - 2]), W[i - 7], g0_256(W[i - 15]), W[i - 16]);\n\n var a = this.h[0];\n var b = this.h[1];\n var c = this.h[2];\n var d = this.h[3];\n var e = this.h[4];\n var f = this.h[5];\n var g = this.h[6];\n var h = this.h[7];\n\n assert(this.k.length === W.length);\n for (i = 0; i < W.length; i++) {\n var T1 = sum32_5(h, s1_256(e), ch32(e, f, g), this.k[i], W[i]);\n var T2 = sum32(s0_256(a), maj32(a, b, c));\n h = g;\n g = f;\n f = e;\n e = sum32(d, T1);\n d = c;\n c = b;\n b = a;\n a = sum32(T1, T2);\n }\n\n this.h[0] = sum32(this.h[0], a);\n this.h[1] = sum32(this.h[1], b);\n this.h[2] = sum32(this.h[2], c);\n this.h[3] = sum32(this.h[3], d);\n this.h[4] = sum32(this.h[4], e);\n this.h[5] = sum32(this.h[5], f);\n this.h[6] = sum32(this.h[6], g);\n this.h[7] = sum32(this.h[7], h);\n};\n\nSHA256.prototype._digest = function digest(enc) {\n if (enc === 'hex')\n return utils.toHex32(this.h, 'big');\n else\n return utils.split32(this.h, 'big');\n};\n","import sha256 from 'hash.js/lib/hash/sha/256';\n\nexport const createHash = (): {\n\tdigest: (format: string) => string;\n\tupdate: (data: unknown) => void;\n} => sha256();\n","import type Chunk from '../Chunk';\nimport ExternalModule from '../ExternalModule';\nimport type Module from '../Module';\nimport type ChildScope from '../ast/scopes/ChildScope';\nimport ExportDefaultVariable from '../ast/variables/ExportDefaultVariable';\nimport type SyntheticNamedExportVariable from '../ast/variables/SyntheticNamedExportVariable';\nimport type Variable from '../ast/variables/Variable';\nimport type { GetInterop, InternalModuleFormat } from '../rollup/types';\nimport {\n\tcanDefaultBeTakenFromNamespace,\n\tdefaultInteropHelpersByInteropType,\n\tisDefaultAProperty,\n\tnamespaceInteropHelpersByInteropType\n} from './interopHelpers';\nimport { getSafeName } from './safeName';\n\nexport interface DependenciesToBeDeconflicted {\n\tdeconflictedDefault: ReadonlySet;\n\tdeconflictedNamespace: ReadonlySet;\n\tdependencies: ReadonlySet;\n}\n\nconst DECONFLICT_IMPORTED_VARIABLES_BY_FORMAT: {\n\t[format in InternalModuleFormat]: (\n\t\tusedNames: Set,\n\t\timports: ReadonlySet,\n\t\tdependenciesToBeDeconflicted: DependenciesToBeDeconflicted,\n\t\tinterop: GetInterop,\n\t\tpreserveModules: boolean,\n\t\texternalLiveBindings: boolean,\n\t\tchunkByModule: ReadonlyMap,\n\t\tsyntheticExports: ReadonlySet\n\t) => void;\n} = {\n\tamd: deconflictImportsOther,\n\tcjs: deconflictImportsOther,\n\tes: deconflictImportsEsmOrSystem,\n\tiife: deconflictImportsOther,\n\tsystem: deconflictImportsEsmOrSystem,\n\tumd: deconflictImportsOther\n};\n\nexport function deconflictChunk(\n\tmodules: readonly Module[],\n\tdependenciesToBeDeconflicted: DependenciesToBeDeconflicted,\n\timports: ReadonlySet,\n\tusedNames: Set,\n\tformat: InternalModuleFormat,\n\tinterop: GetInterop,\n\tpreserveModules: boolean,\n\texternalLiveBindings: boolean,\n\tchunkByModule: ReadonlyMap,\n\tsyntheticExports: ReadonlySet,\n\texportNamesByVariable: ReadonlyMap,\n\taccessedGlobalsByScope: ReadonlyMap>,\n\tincludedNamespaces: ReadonlySet\n): void {\n\tconst reversedModules = modules.slice().reverse();\n\tfor (const module of reversedModules) {\n\t\tmodule.scope.addUsedOutsideNames(\n\t\t\tusedNames,\n\t\t\tformat,\n\t\t\texportNamesByVariable,\n\t\t\taccessedGlobalsByScope\n\t\t);\n\t}\n\tdeconflictTopLevelVariables(usedNames, reversedModules, includedNamespaces);\n\tDECONFLICT_IMPORTED_VARIABLES_BY_FORMAT[format](\n\t\tusedNames,\n\t\timports,\n\t\tdependenciesToBeDeconflicted,\n\t\tinterop,\n\t\tpreserveModules,\n\t\texternalLiveBindings,\n\t\tchunkByModule,\n\t\tsyntheticExports\n\t);\n\n\tfor (const module of reversedModules) {\n\t\tmodule.scope.deconflict(format, exportNamesByVariable, accessedGlobalsByScope);\n\t}\n}\n\nfunction deconflictImportsEsmOrSystem(\n\tusedNames: Set,\n\timports: ReadonlySet,\n\tdependenciesToBeDeconflicted: DependenciesToBeDeconflicted,\n\t_interop: GetInterop,\n\tpreserveModules: boolean,\n\t_externalLiveBindings: boolean,\n\tchunkByModule: ReadonlyMap,\n\tsyntheticExports: ReadonlySet\n) {\n\t// This is needed for namespace reexports\n\tfor (const dependency of dependenciesToBeDeconflicted.dependencies) {\n\t\tif (preserveModules || dependency instanceof ExternalModule) {\n\t\t\tdependency.variableName = getSafeName(dependency.suggestedVariableName, usedNames);\n\t\t}\n\t}\n\tfor (const variable of imports) {\n\t\tconst module = variable.module!;\n\t\tconst name = variable.name;\n\t\tif (variable.isNamespace && (preserveModules || module instanceof ExternalModule)) {\n\t\t\tvariable.setRenderNames(\n\t\t\t\tnull,\n\t\t\t\t(module instanceof ExternalModule ? module : chunkByModule.get(module)!).variableName\n\t\t\t);\n\t\t} else if (module instanceof ExternalModule && name === 'default') {\n\t\t\tvariable.setRenderNames(\n\t\t\t\tnull,\n\t\t\t\tgetSafeName(\n\t\t\t\t\t[...module.exportedVariables].some(\n\t\t\t\t\t\t([exportedVariable, exportedName]) => exportedName === '*' && exportedVariable.included\n\t\t\t\t\t)\n\t\t\t\t\t\t? module.suggestedVariableName + '__default'\n\t\t\t\t\t\t: module.suggestedVariableName,\n\t\t\t\t\tusedNames\n\t\t\t\t)\n\t\t\t);\n\t\t} else {\n\t\t\tvariable.setRenderNames(null, getSafeName(name, usedNames));\n\t\t}\n\t}\n\tfor (const variable of syntheticExports) {\n\t\tvariable.setRenderNames(null, getSafeName(variable.name, usedNames));\n\t}\n}\n\nfunction deconflictImportsOther(\n\tusedNames: Set,\n\timports: ReadonlySet,\n\t{ deconflictedDefault, deconflictedNamespace, dependencies }: DependenciesToBeDeconflicted,\n\tinterop: GetInterop,\n\tpreserveModules: boolean,\n\texternalLiveBindings: boolean,\n\tchunkByModule: ReadonlyMap\n): void {\n\tfor (const chunkOrExternalModule of dependencies) {\n\t\tchunkOrExternalModule.variableName = getSafeName(\n\t\t\tchunkOrExternalModule.suggestedVariableName,\n\t\t\tusedNames\n\t\t);\n\t}\n\tfor (const externalModuleOrChunk of deconflictedNamespace) {\n\t\texternalModuleOrChunk.namespaceVariableName = getSafeName(\n\t\t\t`${externalModuleOrChunk.suggestedVariableName}__namespace`,\n\t\t\tusedNames\n\t\t);\n\t}\n\tfor (const externalModule of deconflictedDefault) {\n\t\tif (\n\t\t\tdeconflictedNamespace.has(externalModule) &&\n\t\t\tcanDefaultBeTakenFromNamespace(String(interop(externalModule.id)), externalLiveBindings)\n\t\t) {\n\t\t\texternalModule.defaultVariableName = externalModule.namespaceVariableName;\n\t\t} else {\n\t\t\texternalModule.defaultVariableName = getSafeName(\n\t\t\t\t`${externalModule.suggestedVariableName}__default`,\n\t\t\t\tusedNames\n\t\t\t);\n\t\t}\n\t}\n\tfor (const variable of imports) {\n\t\tconst module = variable.module;\n\t\tif (module instanceof ExternalModule) {\n\t\t\tconst name = variable.name;\n\t\t\tif (name === 'default') {\n\t\t\t\tconst moduleInterop = String(interop(module.id));\n\t\t\t\tconst variableName = defaultInteropHelpersByInteropType[moduleInterop]\n\t\t\t\t\t? module.defaultVariableName\n\t\t\t\t\t: module.variableName;\n\t\t\t\tif (isDefaultAProperty(moduleInterop, externalLiveBindings)) {\n\t\t\t\t\tvariable.setRenderNames(variableName, 'default');\n\t\t\t\t} else {\n\t\t\t\t\tvariable.setRenderNames(null, variableName);\n\t\t\t\t}\n\t\t\t} else if (name === '*') {\n\t\t\t\tvariable.setRenderNames(\n\t\t\t\t\tnull,\n\t\t\t\t\tnamespaceInteropHelpersByInteropType[String(interop(module.id))]\n\t\t\t\t\t\t? module.namespaceVariableName\n\t\t\t\t\t\t: module.variableName\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\t// if the second parameter is `null`, it uses its \"name\" for the property name\n\t\t\t\tvariable.setRenderNames(module.variableName, null);\n\t\t\t}\n\t\t} else {\n\t\t\tconst chunk = chunkByModule.get(module!)!;\n\t\t\tif (preserveModules && variable.isNamespace) {\n\t\t\t\tvariable.setRenderNames(\n\t\t\t\t\tnull,\n\t\t\t\t\tchunk.exportMode === 'default' ? chunk.namespaceVariableName : chunk.variableName\n\t\t\t\t);\n\t\t\t} else if (chunk.exportMode === 'default') {\n\t\t\t\tvariable.setRenderNames(null, chunk.variableName);\n\t\t\t} else {\n\t\t\t\tvariable.setRenderNames(\n\t\t\t\t\tchunk.variableName,\n\t\t\t\t\tchunk.getVariableExportName(variable) as string | null\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction deconflictTopLevelVariables(\n\tusedNames: Set,\n\tmodules: readonly Module[],\n\tincludedNamespaces: ReadonlySet\n): void {\n\tfor (const module of modules) {\n\t\tfor (const variable of module.scope.variables.values()) {\n\t\t\tif (\n\t\t\t\tvariable.included &&\n\t\t\t\t// this will only happen for exports in some formats\n\t\t\t\t!(\n\t\t\t\t\tvariable.renderBaseName ||\n\t\t\t\t\t(variable instanceof ExportDefaultVariable && variable.getOriginalVariable() !== variable)\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\tvariable.setRenderNames(null, getSafeName(variable.name, usedNames));\n\t\t\t}\n\t\t}\n\t\tif (includedNamespaces.has(module)) {\n\t\t\tconst namespace = module.namespace;\n\t\t\tnamespace.setRenderNames(null, getSafeName(namespace.name, usedNames));\n\t\t}\n\t}\n}\n","const needsEscapeRegEx = /[\\\\'\\r\\n\\u2028\\u2029]/;\nconst quoteNewlineRegEx = /(['\\r\\n\\u2028\\u2029])/g;\nconst backSlashRegEx = /\\\\/g;\n\nexport function escapeId(id: string): string {\n\tif (!id.match(needsEscapeRegEx)) return id;\n\treturn id.replace(backSlashRegEx, '\\\\\\\\').replace(quoteNewlineRegEx, '\\\\$1');\n}\n","import type Chunk from '../Chunk';\nimport type { NormalizedOutputOptions, WarningHandler } from '../rollup/types';\nimport {\n\terrIncompatibleExportOptionValue,\n\terrMixedExport,\n\terror,\n\terrPreferNamedExports\n} from './error';\n\nexport default function getExportMode(\n\tchunk: Chunk,\n\t{ exports: exportMode, name, format }: NormalizedOutputOptions,\n\tunsetOptions: ReadonlySet,\n\tfacadeModuleId: string,\n\twarn: WarningHandler\n): 'default' | 'named' | 'none' {\n\tconst exportKeys = chunk.getExportNames();\n\n\tif (exportMode === 'default') {\n\t\tif (exportKeys.length !== 1 || exportKeys[0] !== 'default') {\n\t\t\treturn error(errIncompatibleExportOptionValue('default', exportKeys, facadeModuleId));\n\t\t}\n\t} else if (exportMode === 'none' && exportKeys.length) {\n\t\treturn error(errIncompatibleExportOptionValue('none', exportKeys, facadeModuleId));\n\t}\n\n\tif (exportMode === 'auto') {\n\t\tif (exportKeys.length === 0) {\n\t\t\texportMode = 'none';\n\t\t} else if (exportKeys.length === 1 && exportKeys[0] === 'default') {\n\t\t\tif (format === 'cjs' && unsetOptions.has('exports')) {\n\t\t\t\twarn(errPreferNamedExports(facadeModuleId));\n\t\t\t}\n\t\t\texportMode = 'default';\n\t\t} else {\n\t\t\tif (format !== 'es' && format !== 'system' && exportKeys.includes('default')) {\n\t\t\t\twarn(errMixedExport(facadeModuleId, name));\n\t\t\t}\n\t\t\texportMode = 'named';\n\t\t}\n\t}\n\n\treturn exportMode;\n}\n","import type Module from '../Module';\n\nfunction guessIndentString(code: string): string | null {\n\tconst lines = code.split('\\n');\n\n\tconst tabbed = lines.filter(line => /^\\t+/.test(line));\n\tconst spaced = lines.filter(line => /^ {2,}/.test(line));\n\n\tif (tabbed.length === 0 && spaced.length === 0) {\n\t\treturn null;\n\t}\n\n\t// More lines tabbed than spaced? Assume tabs, and\n\t// default to tabs in the case of a tie (or nothing\n\t// to go on)\n\tif (tabbed.length >= spaced.length) {\n\t\treturn '\\t';\n\t}\n\n\t// Otherwise, we need to guess the multiple\n\tconst min = spaced.reduce((previous, current) => {\n\t\tconst numSpaces = /^ +/.exec(current)![0].length;\n\t\treturn Math.min(numSpaces, previous);\n\t}, Infinity);\n\n\treturn new Array(min + 1).join(' ');\n}\n\nexport default function getIndentString(\n\tmodules: readonly Module[],\n\toptions: { indent: true | string }\n): string {\n\tif (options.indent !== true) return options.indent;\n\tfor (const module of modules) {\n\t\tconst indent = guessIndentString(module.originalCode);\n\t\tif (indent !== null) return indent;\n\t}\n\n\treturn '\\t';\n}\n","import type Chunk from '../Chunk';\nimport ExternalModule from '../ExternalModule';\nimport type Module from '../Module';\n\nexport function getStaticDependencies(\n\tchunk: Chunk,\n\torderedModules: readonly Module[],\n\tchunkByModule: ReadonlyMap\n): Set {\n\tconst staticDependencyBlocks: (Chunk | ExternalModule)[][] = [];\n\tconst handledDependencies = new Set();\n\tfor (let modulePos = orderedModules.length - 1; modulePos >= 0; modulePos--) {\n\t\tconst module = orderedModules[modulePos];\n\t\tif (!handledDependencies.has(module)) {\n\t\t\tconst staticDependencies: (Chunk | ExternalModule)[] = [];\n\t\t\taddStaticDependencies(module, staticDependencies, handledDependencies, chunk, chunkByModule);\n\t\t\tstaticDependencyBlocks.unshift(staticDependencies);\n\t\t}\n\t}\n\tconst dependencies = new Set();\n\tfor (const block of staticDependencyBlocks) {\n\t\tfor (const dependency of block) {\n\t\t\tdependencies.add(dependency);\n\t\t}\n\t}\n\treturn dependencies;\n}\n\nfunction addStaticDependencies(\n\tmodule: Module,\n\tstaticDependencies: (Chunk | ExternalModule)[],\n\thandledModules: Set,\n\tchunk: Chunk,\n\tchunkByModule: ReadonlyMap\n): void {\n\tconst dependencies = module.getDependenciesToBeIncluded();\n\tfor (const dependency of dependencies) {\n\t\tif (dependency instanceof ExternalModule) {\n\t\t\tstaticDependencies.push(dependency);\n\t\t\tcontinue;\n\t\t}\n\t\tconst dependencyChunk = chunkByModule.get(dependency)!;\n\t\tif (dependencyChunk !== chunk) {\n\t\t\tstaticDependencies.push(dependencyChunk);\n\t\t\tcontinue;\n\t\t}\n\t\tif (!handledModules.has(dependency)) {\n\t\t\thandledModules.add(dependency);\n\t\t\taddStaticDependencies(dependency, staticDependencies, handledModules, chunk, chunkByModule);\n\t\t}\n\t}\n}\n","import { decode } from 'sourcemap-codec';\nimport type {\n\tExistingDecodedSourceMap,\n\tExistingRawSourceMap,\n\tSourceMapInput\n} from '../rollup/types';\n\ntype Input = SourceMapInput | ExistingDecodedSourceMap | undefined;\n\nexport function decodedSourcemap(map: Input): ExistingDecodedSourceMap | null {\n\tif (!map) return null;\n\n\tif (typeof map === 'string') {\n\t\tmap = JSON.parse(map) as ExistingRawSourceMap;\n\t}\n\tif (map.mappings === '') {\n\t\treturn {\n\t\t\tmappings: [],\n\t\t\tnames: [],\n\t\t\tsources: [],\n\t\t\tversion: 3\n\t\t};\n\t}\n\n\tconst mappings = typeof map.mappings === 'string' ? decode(map.mappings) : map.mappings;\n\n\treturn { ...(map as ExistingRawSourceMap | ExistingDecodedSourceMap), mappings };\n}\n","import { OutputAsset, OutputBundle, OutputChunk } from '../rollup/types';\n\nexport const lowercaseBundleKeys = Symbol('bundleKeys');\n\nexport const FILE_PLACEHOLDER = {\n\ttype: 'placeholder' as const\n};\n\nexport interface OutputBundleWithPlaceholders {\n\t[fileName: string]: OutputAsset | OutputChunk | typeof FILE_PLACEHOLDER;\n\t[lowercaseBundleKeys]: Set;\n}\n\nexport const getOutputBundle = (outputBundleBase: OutputBundle): OutputBundleWithPlaceholders => {\n\tconst reservedLowercaseBundleKeys = new Set();\n\treturn new Proxy(outputBundleBase, {\n\t\tdeleteProperty(target, key) {\n\t\t\tif (typeof key === 'string') {\n\t\t\t\treservedLowercaseBundleKeys.delete(key.toLowerCase());\n\t\t\t}\n\t\t\treturn Reflect.deleteProperty(target, key);\n\t\t},\n\t\tget(target, key) {\n\t\t\tif (key === lowercaseBundleKeys) {\n\t\t\t\treturn reservedLowercaseBundleKeys;\n\t\t\t}\n\t\t\treturn Reflect.get(target, key);\n\t\t},\n\t\tset(target, key, value) {\n\t\t\tif (typeof key === 'string') {\n\t\t\t\treservedLowercaseBundleKeys.add(key.toLowerCase());\n\t\t\t}\n\t\t\treturn Reflect.set(target, key, value);\n\t\t}\n\t}) as OutputBundleWithPlaceholders;\n};\n","import { errFailedValidation, error } from './error';\nimport { lowercaseBundleKeys, OutputBundleWithPlaceholders } from './outputBundle';\nimport { extname } from './path';\nimport { isPathFragment } from './relativeId';\n\nexport function renderNamePattern(\n\tpattern: string,\n\tpatternName: string,\n\treplacements: { [name: string]: () => string }\n): string {\n\tif (isPathFragment(pattern))\n\t\treturn error(\n\t\t\terrFailedValidation(\n\t\t\t\t`Invalid pattern \"${pattern}\" for \"${patternName}\", patterns can be neither absolute nor relative paths. If you want your files to be stored in a subdirectory, write its name without a leading slash like this: subdirectory/pattern.`\n\t\t\t)\n\t\t);\n\treturn pattern.replace(/\\[(\\w+)\\]/g, (_match, type) => {\n\t\tif (!replacements.hasOwnProperty(type)) {\n\t\t\treturn error(\n\t\t\t\terrFailedValidation(`\"[${type}]\" is not a valid placeholder in \"${patternName}\" pattern.`)\n\t\t\t);\n\t\t}\n\t\tconst replacement = replacements[type]();\n\t\tif (isPathFragment(replacement))\n\t\t\treturn error(\n\t\t\t\terrFailedValidation(\n\t\t\t\t\t`Invalid substitution \"${replacement}\" for placeholder \"[${type}]\" in \"${patternName}\" pattern, can be neither absolute nor relative path.`\n\t\t\t\t)\n\t\t\t);\n\t\treturn replacement;\n\t});\n}\n\nexport function makeUnique(\n\tname: string,\n\t{ [lowercaseBundleKeys]: reservedLowercaseBundleKeys }: OutputBundleWithPlaceholders\n): string {\n\tif (!reservedLowercaseBundleKeys.has(name.toLowerCase())) return name;\n\tconst ext = extname(name);\n\tname = name.substring(0, name.length - ext.length);\n\tlet uniqueName: string,\n\t\tuniqueIndex = 1;\n\twhile (reservedLowercaseBundleKeys.has((uniqueName = name + ++uniqueIndex + ext).toLowerCase()));\n\treturn uniqueName;\n}\n","import MagicString, { Bundle as MagicStringBundle, type SourceMap } from 'magic-string';\nimport { relative } from '../browser/path';\nimport ExternalModule from './ExternalModule';\nimport Module from './Module';\nimport ExportDefaultDeclaration from './ast/nodes/ExportDefaultDeclaration';\nimport FunctionDeclaration from './ast/nodes/FunctionDeclaration';\nimport type ChildScope from './ast/scopes/ChildScope';\nimport ExportDefaultVariable from './ast/variables/ExportDefaultVariable';\nimport LocalVariable from './ast/variables/LocalVariable';\nimport NamespaceVariable from './ast/variables/NamespaceVariable';\nimport SyntheticNamedExportVariable from './ast/variables/SyntheticNamedExportVariable';\nimport type Variable from './ast/variables/Variable';\nimport finalisers from './finalisers/index';\nimport type {\n\tDecodedSourceMapOrMissing,\n\tGetInterop,\n\tGlobalsOption,\n\tInternalModuleFormat,\n\tNormalizedInputOptions,\n\tNormalizedOutputOptions,\n\tPreRenderedChunk,\n\tRenderedChunk,\n\tRenderedModule,\n\tWarningHandler\n} from './rollup/types';\nimport type { PluginDriver } from './utils/PluginDriver';\nimport type { Addons } from './utils/addons';\nimport { collapseSourcemaps } from './utils/collapseSourcemaps';\nimport { createHash } from './utils/crypto';\nimport { deconflictChunk, type DependenciesToBeDeconflicted } from './utils/deconflictChunk';\nimport {\n\terrCyclicCrossChunkReexport,\n\terrFailedValidation,\n\terrInvalidOption,\n\terror,\n\terrUnexpectedNamedImport,\n\terrUnexpectedNamespaceReexport\n} from './utils/error';\nimport { escapeId } from './utils/escapeId';\nimport { assignExportsToMangledNames, assignExportsToNames } from './utils/exportNames';\nimport type { GenerateCodeSnippets } from './utils/generateCodeSnippets';\nimport getExportMode from './utils/getExportMode';\nimport { getId } from './utils/getId';\nimport getIndentString from './utils/getIndentString';\nimport { getOrCreate } from './utils/getOrCreate';\nimport { getStaticDependencies } from './utils/getStaticDependencies';\nimport { makeLegal } from './utils/identifierHelpers';\nimport {\n\tdefaultInteropHelpersByInteropType,\n\tHELPER_NAMES,\n\tisDefaultAProperty,\n\tnamespaceInteropHelpersByInteropType\n} from './utils/interopHelpers';\nimport { OutputBundleWithPlaceholders } from './utils/outputBundle';\nimport { dirname, extname, isAbsolute, normalize, resolve } from './utils/path';\nimport relativeId, { getAliasName, getImportPath } from './utils/relativeId';\nimport renderChunk from './utils/renderChunk';\nimport type { RenderOptions } from './utils/renderHelpers';\nimport { makeUnique, renderNamePattern } from './utils/renderNamePattern';\nimport { timeEnd, timeStart } from './utils/timers';\nimport { MISSING_EXPORT_SHIM_VARIABLE } from './utils/variableNames';\n\nexport interface ModuleDeclarations {\n\tdependencies: ModuleDeclarationDependency[];\n\texports: ChunkExports;\n}\n\nexport interface ModuleDeclarationDependency {\n\tdefaultVariableName: string | undefined;\n\tglobalName: string;\n\tid: string;\n\timports: ImportSpecifier[] | null;\n\tisChunk: boolean;\n\tname: string;\n\tnamedExportsMode: boolean;\n\tnamespaceVariableName: string | undefined;\n\treexports: ReexportSpecifier[] | null;\n}\n\nexport type ChunkDependencies = ModuleDeclarationDependency[];\n\nexport type ChunkExports = {\n\texported: string;\n\texpression: string | null;\n\thoisted: boolean;\n\tlocal: string;\n}[];\n\nexport interface ReexportSpecifier {\n\timported: string;\n\tneedsLiveBinding: boolean;\n\treexported: string;\n}\n\nexport interface ImportSpecifier {\n\timported: string;\n\tlocal: string;\n}\n\ninterface FacadeName {\n\tfileName?: string;\n\tname?: string;\n}\n\nconst NON_ASSET_EXTENSIONS = ['.js', '.jsx', '.ts', '.tsx'];\n\nfunction getGlobalName(\n\tmodule: ExternalModule,\n\tglobals: GlobalsOption,\n\thasExports: boolean,\n\twarn: WarningHandler\n): string | undefined {\n\tconst globalName = typeof globals === 'function' ? globals(module.id) : globals[module.id];\n\tif (globalName) {\n\t\treturn globalName;\n\t}\n\n\tif (hasExports) {\n\t\twarn({\n\t\t\tcode: 'MISSING_GLOBAL_NAME',\n\t\t\tguess: module.variableName,\n\t\t\tmessage: `No name was provided for external module '${module.id}' in output.globals – guessing '${module.variableName}'`,\n\t\t\tsource: module.id\n\t\t});\n\t\treturn module.variableName;\n\t}\n}\n\nexport default class Chunk {\n\treadonly entryModules: Module[] = [];\n\texecIndex: number;\n\texportMode: 'none' | 'named' | 'default' = 'named';\n\tfacadeModule: Module | null = null;\n\tid: string | null = null;\n\tnamespaceVariableName = '';\n\tneedsExportsShim = false;\n\tsuggestedVariableName: string;\n\tvariableName = '';\n\n\tprivate readonly accessedGlobalsByScope = new Map>();\n\tprivate dependencies = new Set();\n\tprivate readonly dynamicDependencies = new Set();\n\tprivate readonly dynamicEntryModules: Module[] = [];\n\tprivate dynamicName: string | null = null;\n\tprivate readonly exportNamesByVariable = new Map();\n\tprivate readonly exports = new Set();\n\tprivate readonly exportsByName = new Map();\n\tprivate fileName: string | null = null;\n\tprivate implicitEntryModules: Module[] = [];\n\tprivate readonly implicitlyLoadedBefore = new Set();\n\tprivate readonly imports = new Set();\n\tprivate readonly includedReexportsByModule = new Map();\n\tprivate indentString: string = undefined as never;\n\t// This may only be updated in the constructor\n\tprivate readonly isEmpty: boolean = true;\n\tprivate name: string | null = null;\n\tprivate renderedDependencies: Map | null =\n\t\tnull;\n\tprivate renderedExports: ChunkExports | null = null;\n\tprivate renderedHash: string | undefined = undefined;\n\tprivate readonly renderedModuleSources = new Map();\n\tprivate readonly renderedModules: {\n\t\t[moduleId: string]: RenderedModule;\n\t} = Object.create(null);\n\tprivate renderedSource: MagicStringBundle | null = null;\n\tprivate sortedExportNames: string[] | null = null;\n\tprivate strictFacade = false;\n\tprivate usedModules: Module[] = undefined as never;\n\n\tconstructor(\n\t\tprivate readonly orderedModules: readonly Module[],\n\t\tprivate readonly inputOptions: NormalizedInputOptions,\n\t\tprivate readonly outputOptions: NormalizedOutputOptions,\n\t\tprivate readonly unsetOptions: ReadonlySet,\n\t\tprivate readonly pluginDriver: PluginDriver,\n\t\tprivate readonly modulesById: ReadonlyMap,\n\t\tprivate readonly chunkByModule: ReadonlyMap,\n\t\tprivate readonly facadeChunkByModule: Map,\n\t\tprivate readonly includedNamespaces: Set,\n\t\tprivate readonly manualChunkAlias: string | null\n\t) {\n\t\tthis.execIndex = orderedModules.length > 0 ? orderedModules[0].execIndex : Infinity;\n\t\tconst chunkModules = new Set(orderedModules);\n\n\t\tfor (const module of orderedModules) {\n\t\t\tif (module.namespace.included) {\n\t\t\t\tincludedNamespaces.add(module);\n\t\t\t}\n\t\t\tif (this.isEmpty && module.isIncluded()) {\n\t\t\t\tthis.isEmpty = false;\n\t\t\t}\n\t\t\tif (module.info.isEntry || outputOptions.preserveModules) {\n\t\t\t\tthis.entryModules.push(module);\n\t\t\t}\n\t\t\tfor (const importer of module.includedDynamicImporters) {\n\t\t\t\tif (!chunkModules.has(importer)) {\n\t\t\t\t\tthis.dynamicEntryModules.push(module);\n\t\t\t\t\t// Modules with synthetic exports need an artificial namespace for dynamic imports\n\t\t\t\t\tif (module.info.syntheticNamedExports && !outputOptions.preserveModules) {\n\t\t\t\t\t\tincludedNamespaces.add(module);\n\t\t\t\t\t\tthis.exports.add(module.namespace);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (module.implicitlyLoadedAfter.size > 0) {\n\t\t\t\tthis.implicitEntryModules.push(module);\n\t\t\t}\n\t\t}\n\t\tthis.suggestedVariableName = makeLegal(this.generateVariableName());\n\t}\n\n\tprivate static generateFacade(\n\t\tinputOptions: NormalizedInputOptions,\n\t\toutputOptions: NormalizedOutputOptions,\n\t\tunsetOptions: ReadonlySet,\n\t\tpluginDriver: PluginDriver,\n\t\tmodulesById: ReadonlyMap,\n\t\tchunkByModule: ReadonlyMap,\n\t\tfacadeChunkByModule: Map,\n\t\tincludedNamespaces: Set,\n\t\tfacadedModule: Module,\n\t\tfacadeName: FacadeName\n\t): Chunk {\n\t\tconst chunk = new Chunk(\n\t\t\t[],\n\t\t\tinputOptions,\n\t\t\toutputOptions,\n\t\t\tunsetOptions,\n\t\t\tpluginDriver,\n\t\t\tmodulesById,\n\t\t\tchunkByModule,\n\t\t\tfacadeChunkByModule,\n\t\t\tincludedNamespaces,\n\t\t\tnull\n\t\t);\n\t\tchunk.assignFacadeName(facadeName, facadedModule);\n\t\tif (!facadeChunkByModule.has(facadedModule)) {\n\t\t\tfacadeChunkByModule.set(facadedModule, chunk);\n\t\t}\n\t\tfor (const dependency of facadedModule.getDependenciesToBeIncluded()) {\n\t\t\tchunk.dependencies.add(\n\t\t\t\tdependency instanceof Module ? chunkByModule.get(dependency)! : dependency\n\t\t\t);\n\t\t}\n\t\tif (\n\t\t\t!chunk.dependencies.has(chunkByModule.get(facadedModule)!) &&\n\t\t\tfacadedModule.info.moduleSideEffects &&\n\t\t\tfacadedModule.hasEffects()\n\t\t) {\n\t\t\tchunk.dependencies.add(chunkByModule.get(facadedModule)!);\n\t\t}\n\t\tchunk.ensureReexportsAreAvailableForModule(facadedModule);\n\t\tchunk.facadeModule = facadedModule;\n\t\tchunk.strictFacade = true;\n\t\treturn chunk;\n\t}\n\n\tcanModuleBeFacade(module: Module, exposedVariables: ReadonlySet): boolean {\n\t\tconst moduleExportNamesByVariable = module.getExportNamesByVariable();\n\t\tfor (const exposedVariable of this.exports) {\n\t\t\tif (!moduleExportNamesByVariable.has(exposedVariable)) {\n\t\t\t\tif (\n\t\t\t\t\tmoduleExportNamesByVariable.size === 0 &&\n\t\t\t\t\tmodule.isUserDefinedEntryPoint &&\n\t\t\t\t\tmodule.preserveSignature === 'strict' &&\n\t\t\t\t\tthis.unsetOptions.has('preserveEntrySignatures')\n\t\t\t\t) {\n\t\t\t\t\tthis.inputOptions.onwarn({\n\t\t\t\t\t\tcode: 'EMPTY_FACADE',\n\t\t\t\t\t\tid: module.id,\n\t\t\t\t\t\tmessage: `To preserve the export signature of the entry module \"${relativeId(\n\t\t\t\t\t\t\tmodule.id\n\t\t\t\t\t\t)}\", an empty facade chunk was created. This often happens when creating a bundle for a web app where chunks are placed in script tags and exports are ignored. In this case it is recommended to set \"preserveEntrySignatures: false\" to avoid this and reduce the number of chunks. Otherwise if this is intentional, set \"preserveEntrySignatures: 'strict'\" explicitly to silence this warning.`,\n\t\t\t\t\t\turl: 'https://rollupjs.org/guide/en/#preserveentrysignatures'\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\tfor (const exposedVariable of exposedVariables) {\n\t\t\tif (\n\t\t\t\t!(moduleExportNamesByVariable.has(exposedVariable) || exposedVariable.module === module)\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\n\tgenerateExports(): void {\n\t\tthis.sortedExportNames = null;\n\t\tconst remainingExports = new Set(this.exports);\n\t\tif (\n\t\t\tthis.facadeModule !== null &&\n\t\t\t(this.facadeModule.preserveSignature !== false || this.strictFacade)\n\t\t) {\n\t\t\tconst exportNamesByVariable = this.facadeModule.getExportNamesByVariable();\n\t\t\tfor (const [variable, exportNames] of exportNamesByVariable) {\n\t\t\t\tthis.exportNamesByVariable.set(variable, [...exportNames]);\n\t\t\t\tfor (const exportName of exportNames) {\n\t\t\t\t\tthis.exportsByName.set(exportName, variable);\n\t\t\t\t}\n\t\t\t\tremainingExports.delete(variable);\n\t\t\t}\n\t\t}\n\t\tif (this.outputOptions.minifyInternalExports) {\n\t\t\tassignExportsToMangledNames(remainingExports, this.exportsByName, this.exportNamesByVariable);\n\t\t} else {\n\t\t\tassignExportsToNames(remainingExports, this.exportsByName, this.exportNamesByVariable);\n\t\t}\n\t\tif (this.outputOptions.preserveModules || (this.facadeModule && this.facadeModule.info.isEntry))\n\t\t\tthis.exportMode = getExportMode(\n\t\t\t\tthis,\n\t\t\t\tthis.outputOptions,\n\t\t\t\tthis.unsetOptions,\n\t\t\t\tthis.facadeModule!.id,\n\t\t\t\tthis.inputOptions.onwarn\n\t\t\t);\n\t}\n\n\tgenerateFacades(): Chunk[] {\n\t\tconst facades: Chunk[] = [];\n\t\tconst entryModules = new Set([...this.entryModules, ...this.implicitEntryModules]);\n\t\tconst exposedVariables = new Set(\n\t\t\tthis.dynamicEntryModules.map(({ namespace }) => namespace)\n\t\t);\n\t\tfor (const module of entryModules) {\n\t\t\tif (module.preserveSignature) {\n\t\t\t\tfor (const exportedVariable of module.getExportNamesByVariable().keys()) {\n\t\t\t\t\texposedVariables.add(exportedVariable);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor (const module of entryModules) {\n\t\t\tconst requiredFacades: FacadeName[] = Array.from(\n\t\t\t\tnew Set(\n\t\t\t\t\tmodule.chunkNames.filter(({ isUserDefined }) => isUserDefined).map(({ name }) => name)\n\t\t\t\t),\n\t\t\t\t// mapping must run after Set 'name' dedupe\n\t\t\t\tname => ({\n\t\t\t\t\tname\n\t\t\t\t})\n\t\t\t);\n\t\t\tif (requiredFacades.length === 0 && module.isUserDefinedEntryPoint) {\n\t\t\t\trequiredFacades.push({});\n\t\t\t}\n\t\t\trequiredFacades.push(...Array.from(module.chunkFileNames, fileName => ({ fileName })));\n\t\t\tif (requiredFacades.length === 0) {\n\t\t\t\trequiredFacades.push({});\n\t\t\t}\n\t\t\tif (!this.facadeModule) {\n\t\t\t\tconst needsStrictFacade =\n\t\t\t\t\tmodule.preserveSignature === 'strict' ||\n\t\t\t\t\t(module.preserveSignature === 'exports-only' &&\n\t\t\t\t\t\tmodule.getExportNamesByVariable().size !== 0);\n\t\t\t\tif (\n\t\t\t\t\t!needsStrictFacade ||\n\t\t\t\t\tthis.outputOptions.preserveModules ||\n\t\t\t\t\tthis.canModuleBeFacade(module, exposedVariables)\n\t\t\t\t) {\n\t\t\t\t\tthis.facadeModule = module;\n\t\t\t\t\tthis.facadeChunkByModule.set(module, this);\n\t\t\t\t\tif (module.preserveSignature) {\n\t\t\t\t\t\tthis.strictFacade = needsStrictFacade;\n\t\t\t\t\t}\n\t\t\t\t\tthis.assignFacadeName(requiredFacades.shift()!, module);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (const facadeName of requiredFacades) {\n\t\t\t\tfacades.push(\n\t\t\t\t\tChunk.generateFacade(\n\t\t\t\t\t\tthis.inputOptions,\n\t\t\t\t\t\tthis.outputOptions,\n\t\t\t\t\t\tthis.unsetOptions,\n\t\t\t\t\t\tthis.pluginDriver,\n\t\t\t\t\t\tthis.modulesById,\n\t\t\t\t\t\tthis.chunkByModule,\n\t\t\t\t\t\tthis.facadeChunkByModule,\n\t\t\t\t\t\tthis.includedNamespaces,\n\t\t\t\t\t\tmodule,\n\t\t\t\t\t\tfacadeName\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tfor (const module of this.dynamicEntryModules) {\n\t\t\tif (module.info.syntheticNamedExports) continue;\n\t\t\tif (!this.facadeModule && this.canModuleBeFacade(module, exposedVariables)) {\n\t\t\t\tthis.facadeModule = module;\n\t\t\t\tthis.facadeChunkByModule.set(module, this);\n\t\t\t\tthis.strictFacade = true;\n\t\t\t\tthis.dynamicName = getChunkNameFromModule(module);\n\t\t\t} else if (\n\t\t\t\tthis.facadeModule === module &&\n\t\t\t\t!this.strictFacade &&\n\t\t\t\tthis.canModuleBeFacade(module, exposedVariables)\n\t\t\t) {\n\t\t\t\tthis.strictFacade = true;\n\t\t\t} else if (!this.facadeChunkByModule.get(module)?.strictFacade) {\n\t\t\t\tthis.includedNamespaces.add(module);\n\t\t\t\tthis.exports.add(module.namespace);\n\t\t\t}\n\t\t}\n\t\tif (!this.outputOptions.preserveModules) {\n\t\t\tthis.addNecessaryImportsForFacades();\n\t\t}\n\t\treturn facades;\n\t}\n\n\tgenerateId(\n\t\taddons: Addons,\n\t\toptions: NormalizedOutputOptions,\n\t\tbundle: OutputBundleWithPlaceholders,\n\t\tincludeHash: boolean\n\t): string {\n\t\tif (this.fileName !== null) {\n\t\t\treturn this.fileName;\n\t\t}\n\t\tconst [pattern, patternName] =\n\t\t\tthis.facadeModule && this.facadeModule.isUserDefinedEntryPoint\n\t\t\t\t? [options.entryFileNames, 'output.entryFileNames']\n\t\t\t\t: [options.chunkFileNames, 'output.chunkFileNames'];\n\t\treturn makeUnique(\n\t\t\trenderNamePattern(\n\t\t\t\ttypeof pattern === 'function' ? pattern(this.getChunkInfo()) : pattern,\n\t\t\t\tpatternName,\n\t\t\t\t{\n\t\t\t\t\tformat: () => options.format,\n\t\t\t\t\thash: () =>\n\t\t\t\t\t\tincludeHash\n\t\t\t\t\t\t\t? this.computeContentHashWithDependencies(addons, options, bundle)\n\t\t\t\t\t\t\t: '[hash]',\n\t\t\t\t\tname: () => this.getChunkName()\n\t\t\t\t}\n\t\t\t),\n\t\t\tbundle\n\t\t);\n\t}\n\n\tgenerateIdPreserveModules(\n\t\tpreserveModulesRelativeDir: string,\n\t\toptions: NormalizedOutputOptions,\n\t\tbundle: OutputBundleWithPlaceholders,\n\t\tunsetOptions: ReadonlySet\n\t): string {\n\t\tconst [{ id }] = this.orderedModules;\n\t\tconst sanitizedId = this.outputOptions.sanitizeFileName(id.split(QUERY_HASH_REGEX, 1)[0]);\n\t\tlet path: string;\n\n\t\tconst patternOpt = unsetOptions.has('entryFileNames')\n\t\t\t? '[name][assetExtname].js'\n\t\t\t: options.entryFileNames;\n\t\tconst pattern = typeof patternOpt === 'function' ? patternOpt(this.getChunkInfo()) : patternOpt;\n\n\t\tif (isAbsolute(sanitizedId)) {\n\t\t\tconst currentDir = dirname(sanitizedId);\n\t\t\tconst extension = extname(sanitizedId);\n\t\t\tconst fileName = renderNamePattern(pattern, 'output.entryFileNames', {\n\t\t\t\tassetExtname: () => (NON_ASSET_EXTENSIONS.includes(extension) ? '' : extension),\n\t\t\t\text: () => extension.substring(1),\n\t\t\t\textname: () => extension,\n\t\t\t\tformat: () => options.format as string,\n\t\t\t\tname: () => this.getChunkName()\n\t\t\t});\n\t\t\tconst currentPath = `${currentDir}/${fileName}`;\n\t\t\tconst { preserveModulesRoot } = options;\n\t\t\tif (preserveModulesRoot && resolve(currentPath).startsWith(preserveModulesRoot)) {\n\t\t\t\tpath = currentPath.slice(preserveModulesRoot.length).replace(/^[\\\\/]/, '');\n\t\t\t} else {\n\t\t\t\tpath = relative(preserveModulesRelativeDir, currentPath);\n\t\t\t}\n\t\t} else {\n\t\t\tconst extension = extname(sanitizedId);\n\t\t\tconst fileName = renderNamePattern(pattern, 'output.entryFileNames', {\n\t\t\t\tassetExtname: () => (NON_ASSET_EXTENSIONS.includes(extension) ? '' : extension),\n\t\t\t\text: () => extension.substring(1),\n\t\t\t\textname: () => extension,\n\t\t\t\tformat: () => options.format as string,\n\t\t\t\tname: () => getAliasName(sanitizedId)\n\t\t\t});\n\t\t\tpath = `_virtual/${fileName}`;\n\t\t}\n\t\treturn makeUnique(normalize(path), bundle);\n\t}\n\n\tgetChunkInfo(): PreRenderedChunk {\n\t\tconst facadeModule = this.facadeModule;\n\t\tconst getChunkName = this.getChunkName.bind(this);\n\t\treturn {\n\t\t\texports: this.getExportNames(),\n\t\t\tfacadeModuleId: facadeModule && facadeModule.id,\n\t\t\tisDynamicEntry: this.dynamicEntryModules.length > 0,\n\t\t\tisEntry: facadeModule !== null && facadeModule.info.isEntry,\n\t\t\tisImplicitEntry: this.implicitEntryModules.length > 0,\n\t\t\tmodules: this.renderedModules,\n\t\t\tget name() {\n\t\t\t\treturn getChunkName();\n\t\t\t},\n\t\t\ttype: 'chunk'\n\t\t};\n\t}\n\n\tgetChunkInfoWithFileNames(): RenderedChunk {\n\t\treturn Object.assign(this.getChunkInfo(), {\n\t\t\tcode: undefined,\n\t\t\tdynamicImports: Array.from(this.dynamicDependencies, getId),\n\t\t\tfileName: this.id!,\n\t\t\timplicitlyLoadedBefore: Array.from(this.implicitlyLoadedBefore, getId),\n\t\t\timportedBindings: this.getImportedBindingsPerDependency(),\n\t\t\timports: Array.from(this.dependencies, getId),\n\t\t\tmap: undefined,\n\t\t\treferencedFiles: this.getReferencedFiles()\n\t\t});\n\t}\n\n\tgetChunkName(): string {\n\t\treturn (this.name ??= this.outputOptions.sanitizeFileName(this.getFallbackChunkName()));\n\t}\n\n\tgetExportNames(): string[] {\n\t\treturn (this.sortedExportNames ??= Array.from(this.exportsByName.keys()).sort());\n\t}\n\n\tgetRenderedHash(): string {\n\t\tif (this.renderedHash) return this.renderedHash;\n\t\tconst hash = createHash();\n\t\tconst hashAugmentation = this.pluginDriver.hookReduceValueSync(\n\t\t\t'augmentChunkHash',\n\t\t\t'',\n\t\t\t[this.getChunkInfo()],\n\t\t\t(augmentation, pluginHash) => {\n\t\t\t\tif (pluginHash) {\n\t\t\t\t\taugmentation += pluginHash;\n\t\t\t\t}\n\t\t\t\treturn augmentation;\n\t\t\t}\n\t\t);\n\t\thash.update(hashAugmentation);\n\t\thash.update(this.renderedSource!.toString());\n\t\thash.update(\n\t\t\tthis.getExportNames()\n\t\t\t\t.map(exportName => {\n\t\t\t\t\tconst variable = this.exportsByName.get(exportName)!;\n\t\t\t\t\treturn `${relativeId((variable.module as Module).id).replace(/\\\\/g, '/')}:${\n\t\t\t\t\t\tvariable.name\n\t\t\t\t\t}:${exportName}`;\n\t\t\t\t})\n\t\t\t\t.join(',')\n\t\t);\n\t\treturn (this.renderedHash = hash.digest('hex'));\n\t}\n\n\tgetVariableExportName(variable: Variable): string {\n\t\tif (this.outputOptions.preserveModules && variable instanceof NamespaceVariable) {\n\t\t\treturn '*';\n\t\t}\n\t\treturn this.exportNamesByVariable.get(variable)![0];\n\t}\n\n\tlink(): void {\n\t\tthis.dependencies = getStaticDependencies(this, this.orderedModules, this.chunkByModule);\n\t\tfor (const module of this.orderedModules) {\n\t\t\tthis.addDependenciesToChunk(module.dynamicDependencies, this.dynamicDependencies);\n\t\t\tthis.addDependenciesToChunk(module.implicitlyLoadedBefore, this.implicitlyLoadedBefore);\n\t\t\tthis.setUpChunkImportsAndExportsForModule(module);\n\t\t}\n\t}\n\n\t// prerender allows chunk hashes and names to be generated before finalizing\n\tpreRender(\n\t\toptions: NormalizedOutputOptions,\n\t\tinputBase: string,\n\t\tsnippets: GenerateCodeSnippets\n\t): void {\n\t\tconst { _, getPropertyAccess, n } = snippets;\n\t\tconst magicString = new MagicStringBundle({ separator: `${n}${n}` });\n\t\tthis.usedModules = [];\n\t\tthis.indentString = getIndentString(this.orderedModules, options);\n\n\t\tconst renderOptions: RenderOptions = {\n\t\t\tdynamicImportFunction: options.dynamicImportFunction,\n\t\t\texportNamesByVariable: this.exportNamesByVariable,\n\t\t\tformat: options.format,\n\t\t\tfreeze: options.freeze,\n\t\t\tindent: this.indentString,\n\t\t\tnamespaceToStringTag: options.namespaceToStringTag,\n\t\t\toutputPluginDriver: this.pluginDriver,\n\t\t\tsnippets\n\t\t};\n\n\t\t// for static and dynamic entry points, inline the execution list to avoid loading latency\n\t\tif (\n\t\t\toptions.hoistTransitiveImports &&\n\t\t\t!this.outputOptions.preserveModules &&\n\t\t\tthis.facadeModule !== null\n\t\t) {\n\t\t\tfor (const dep of this.dependencies) {\n\t\t\t\tif (dep instanceof Chunk) this.inlineChunkDependencies(dep);\n\t\t\t}\n\t\t}\n\n\t\tthis.prepareModulesForRendering(snippets);\n\t\tthis.setIdentifierRenderResolutions(options);\n\n\t\tlet hoistedSource = '';\n\t\tconst renderedModules = this.renderedModules;\n\n\t\tfor (const module of this.orderedModules) {\n\t\t\tlet renderedLength = 0;\n\t\t\tif (module.isIncluded() || this.includedNamespaces.has(module)) {\n\t\t\t\tconst source = module.render(renderOptions).trim();\n\t\t\t\trenderedLength = source.length();\n\t\t\t\tif (renderedLength) {\n\t\t\t\t\tif (options.compact && source.lastLine().includes('//')) source.append('\\n');\n\t\t\t\t\tthis.renderedModuleSources.set(module, source);\n\t\t\t\t\tmagicString.addSource(source);\n\t\t\t\t\tthis.usedModules.push(module);\n\t\t\t\t}\n\t\t\t\tconst namespace = module.namespace;\n\t\t\t\tif (this.includedNamespaces.has(module) && !this.outputOptions.preserveModules) {\n\t\t\t\t\tconst rendered = namespace.renderBlock(renderOptions);\n\t\t\t\t\tif (namespace.renderFirst()) hoistedSource += n + rendered;\n\t\t\t\t\telse magicString.addSource(new MagicString(rendered));\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst { renderedExports, removedExports } = module.getRenderedExports();\n\t\t\tconst { renderedModuleSources } = this;\n\t\t\trenderedModules[module.id] = {\n\t\t\t\tget code() {\n\t\t\t\t\treturn renderedModuleSources.get(module)?.toString() ?? null;\n\t\t\t\t},\n\t\t\t\toriginalLength: module.originalCode.length,\n\t\t\t\tremovedExports,\n\t\t\t\trenderedExports,\n\t\t\t\trenderedLength\n\t\t\t};\n\t\t}\n\n\t\tif (hoistedSource) magicString.prepend(hoistedSource + n + n);\n\n\t\tif (this.needsExportsShim) {\n\t\t\tmagicString.prepend(\n\t\t\t\t`${n}${snippets.cnst} ${MISSING_EXPORT_SHIM_VARIABLE}${_}=${_}void 0;${n}${n}`\n\t\t\t);\n\t\t}\n\t\tif (options.compact) {\n\t\t\tthis.renderedSource = magicString;\n\t\t} else {\n\t\t\tthis.renderedSource = magicString.trim();\n\t\t}\n\n\t\tthis.renderedHash = undefined;\n\n\t\tif (this.isEmpty && this.getExportNames().length === 0 && this.dependencies.size === 0) {\n\t\t\tconst chunkName = this.getChunkName();\n\t\t\tthis.inputOptions.onwarn({\n\t\t\t\tchunkName,\n\t\t\t\tcode: 'EMPTY_BUNDLE',\n\t\t\t\tmessage: `Generated an empty chunk: \"${chunkName}\"`\n\t\t\t});\n\t\t}\n\n\t\tthis.setExternalRenderPaths(options, inputBase);\n\n\t\tthis.renderedDependencies = this.getChunkDependencyDeclarations(options, getPropertyAccess);\n\t\tthis.renderedExports =\n\t\t\tthis.exportMode === 'none'\n\t\t\t\t? []\n\t\t\t\t: this.getChunkExportDeclarations(options.format, getPropertyAccess);\n\t}\n\n\tasync render(\n\t\toptions: NormalizedOutputOptions,\n\t\taddons: Addons,\n\t\toutputChunk: RenderedChunk,\n\t\tsnippets: GenerateCodeSnippets\n\t): Promise<{ code: string; map: SourceMap }> {\n\t\ttimeStart('render format', 2);\n\n\t\tconst format = options.format;\n\t\tconst finalise = finalisers[format];\n\t\tif (options.dynamicImportFunction && format !== 'es') {\n\t\t\tthis.inputOptions.onwarn(\n\t\t\t\terrInvalidOption(\n\t\t\t\t\t'output.dynamicImportFunction',\n\t\t\t\t\t'outputdynamicImportFunction',\n\t\t\t\t\t'this option is ignored for formats other than \"es\"'\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t// populate ids in the rendered declarations only here\n\t\t// as chunk ids known only after prerender\n\t\tfor (const dependency of this.dependencies) {\n\t\t\tconst renderedDependency = this.renderedDependencies!.get(dependency)!;\n\t\t\tif (dependency instanceof ExternalModule) {\n\t\t\t\tconst originalId = dependency.renderPath;\n\t\t\t\trenderedDependency.id = escapeId(\n\t\t\t\t\tdependency.renormalizeRenderPath\n\t\t\t\t\t\t? getImportPath(this.id!, originalId, false, false)\n\t\t\t\t\t\t: originalId\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\trenderedDependency.namedExportsMode = dependency.exportMode !== 'default';\n\t\t\t\trenderedDependency.id = escapeId(getImportPath(this.id!, dependency.id!, false, true));\n\t\t\t}\n\t\t}\n\n\t\tthis.finaliseDynamicImports(options, snippets);\n\t\tthis.finaliseImportMetas(format, snippets);\n\n\t\tconst hasExports =\n\t\t\tthis.renderedExports!.length !== 0 ||\n\t\t\t[...this.renderedDependencies!.values()].some(\n\t\t\t\tdep => (dep.reexports && dep.reexports.length !== 0)!\n\t\t\t);\n\n\t\tlet topLevelAwaitModule: string | null = null;\n\t\tconst accessedGlobals = new Set();\n\t\tfor (const module of this.orderedModules) {\n\t\t\tif (module.usesTopLevelAwait) {\n\t\t\t\ttopLevelAwaitModule = module.id;\n\t\t\t}\n\t\t\tconst accessedGlobalVariables = this.accessedGlobalsByScope.get(module.scope);\n\t\t\tif (accessedGlobalVariables) {\n\t\t\t\tfor (const name of accessedGlobalVariables) {\n\t\t\t\t\taccessedGlobals.add(name);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (topLevelAwaitModule !== null && format !== 'es' && format !== 'system') {\n\t\t\treturn error({\n\t\t\t\tcode: 'INVALID_TLA_FORMAT',\n\t\t\t\tid: topLevelAwaitModule,\n\t\t\t\tmessage: `Module format ${format} does not support top-level await. Use the \"es\" or \"system\" output formats rather.`\n\t\t\t});\n\t\t}\n\n\t\t/* istanbul ignore next */\n\t\tif (!this.id) {\n\t\t\tthrow new Error('Internal Error: expecting chunk id');\n\t\t}\n\n\t\tconst magicString = finalise(\n\t\t\tthis.renderedSource!,\n\t\t\t{\n\t\t\t\taccessedGlobals,\n\t\t\t\tdependencies: [...this.renderedDependencies!.values()],\n\t\t\t\texports: this.renderedExports!,\n\t\t\t\thasExports,\n\t\t\t\tid: this.id,\n\t\t\t\tindent: this.indentString,\n\t\t\t\tintro: addons.intro,\n\t\t\t\tisEntryFacade:\n\t\t\t\t\tthis.outputOptions.preserveModules ||\n\t\t\t\t\t(this.facadeModule !== null && this.facadeModule.info.isEntry),\n\t\t\t\tisModuleFacade: this.facadeModule !== null,\n\t\t\t\tnamedExportsMode: this.exportMode !== 'default',\n\t\t\t\toutro: addons.outro,\n\t\t\t\tsnippets,\n\t\t\t\tusesTopLevelAwait: topLevelAwaitModule !== null,\n\t\t\t\twarn: this.inputOptions.onwarn\n\t\t\t},\n\t\t\toptions\n\t\t);\n\t\tif (addons.banner) magicString.prepend(addons.banner);\n\t\tif (addons.footer) magicString.append(addons.footer);\n\t\tconst prevCode = magicString.toString();\n\n\t\ttimeEnd('render format', 2);\n\n\t\tlet map: SourceMap = null as never;\n\t\tconst chunkSourcemapChain: DecodedSourceMapOrMissing[] = [];\n\n\t\tlet code = await renderChunk({\n\t\t\tcode: prevCode,\n\t\t\toptions,\n\t\t\toutputPluginDriver: this.pluginDriver,\n\t\t\trenderChunk: outputChunk,\n\t\t\tsourcemapChain: chunkSourcemapChain\n\t\t});\n\t\tif (options.sourcemap) {\n\t\t\ttimeStart('sourcemap', 2);\n\n\t\t\tlet file: string;\n\t\t\tif (options.file) file = resolve(options.sourcemapFile || options.file);\n\t\t\telse if (options.dir) file = resolve(options.dir, this.id);\n\t\t\telse file = resolve(this.id);\n\n\t\t\tconst decodedMap = magicString.generateDecodedMap({});\n\t\t\tmap = collapseSourcemaps(\n\t\t\t\tfile,\n\t\t\t\tdecodedMap,\n\t\t\t\tthis.usedModules,\n\t\t\t\tchunkSourcemapChain,\n\t\t\t\toptions.sourcemapExcludeSources,\n\t\t\t\tthis.inputOptions.onwarn\n\t\t\t);\n\t\t\tmap.sources = map.sources\n\t\t\t\t.map(sourcePath => {\n\t\t\t\t\tconst { sourcemapPathTransform } = options;\n\n\t\t\t\t\tif (sourcemapPathTransform) {\n\t\t\t\t\t\tconst newSourcePath = sourcemapPathTransform(sourcePath, `${file}.map`) as unknown;\n\n\t\t\t\t\t\tif (typeof newSourcePath !== 'string') {\n\t\t\t\t\t\t\terror(errFailedValidation(`sourcemapPathTransform function must return a string.`));\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn newSourcePath;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn sourcePath;\n\t\t\t\t})\n\t\t\t\t.map(normalize);\n\n\t\t\ttimeEnd('sourcemap', 2);\n\t\t}\n\t\tif (!options.compact && code[code.length - 1] !== '\\n') code += '\\n';\n\t\treturn { code, map };\n\t}\n\n\tprivate addDependenciesToChunk(\n\t\tmoduleDependencies: ReadonlySet,\n\t\tchunkDependencies: Set\n\t): void {\n\t\tfor (const module of moduleDependencies) {\n\t\t\tif (module instanceof Module) {\n\t\t\t\tconst chunk = this.chunkByModule.get(module);\n\t\t\t\tif (chunk && chunk !== this) {\n\t\t\t\t\tchunkDependencies.add(chunk);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tchunkDependencies.add(module);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate addNecessaryImportsForFacades() {\n\t\tfor (const [module, variables] of this.includedReexportsByModule) {\n\t\t\tif (this.includedNamespaces.has(module)) {\n\t\t\t\tfor (const variable of variables) {\n\t\t\t\t\tthis.imports.add(variable);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate assignFacadeName({ fileName, name }: FacadeName, facadedModule: Module): void {\n\t\tif (fileName) {\n\t\t\tthis.fileName = fileName;\n\t\t} else {\n\t\t\tthis.name = this.outputOptions.sanitizeFileName(\n\t\t\t\tname || getChunkNameFromModule(facadedModule)\n\t\t\t);\n\t\t}\n\t}\n\n\tprivate checkCircularDependencyImport(variable: Variable, importingModule: Module): void {\n\t\tconst variableModule = variable.module;\n\t\tif (variableModule instanceof Module) {\n\t\t\tconst exportChunk = this.chunkByModule.get(variableModule);\n\t\t\tlet alternativeReexportModule;\n\t\t\tdo {\n\t\t\t\talternativeReexportModule = importingModule.alternativeReexportModules.get(variable);\n\t\t\t\tif (alternativeReexportModule) {\n\t\t\t\t\tconst exportingChunk = this.chunkByModule.get(alternativeReexportModule);\n\t\t\t\t\tif (exportingChunk && exportingChunk !== exportChunk) {\n\t\t\t\t\t\tthis.inputOptions.onwarn(\n\t\t\t\t\t\t\terrCyclicCrossChunkReexport(\n\t\t\t\t\t\t\t\tvariableModule.getExportNamesByVariable().get(variable)![0],\n\t\t\t\t\t\t\t\tvariableModule.id,\n\t\t\t\t\t\t\t\talternativeReexportModule.id,\n\t\t\t\t\t\t\t\timportingModule.id\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\timportingModule = alternativeReexportModule;\n\t\t\t\t}\n\t\t\t} while (alternativeReexportModule);\n\t\t}\n\t}\n\n\tprivate computeContentHashWithDependencies(\n\t\taddons: Addons,\n\t\toptions: NormalizedOutputOptions,\n\t\tbundle: OutputBundleWithPlaceholders\n\t): string {\n\t\tconst hash = createHash();\n\t\thash.update([addons.intro, addons.outro, addons.banner, addons.footer].join(':'));\n\t\thash.update(options.format);\n\t\tconst dependenciesForHashing = new Set([this]);\n\t\tfor (const current of dependenciesForHashing) {\n\t\t\tif (current instanceof ExternalModule) {\n\t\t\t\thash.update(`:${current.renderPath}`);\n\t\t\t} else {\n\t\t\t\thash.update(current.getRenderedHash());\n\t\t\t\thash.update(current.generateId(addons, options, bundle, false));\n\t\t\t}\n\t\t\tif (current instanceof ExternalModule) continue;\n\t\t\tfor (const dependency of [...current.dependencies, ...current.dynamicDependencies]) {\n\t\t\t\tdependenciesForHashing.add(dependency);\n\t\t\t}\n\t\t}\n\t\treturn hash.digest('hex').substr(0, 8);\n\t}\n\n\tprivate ensureReexportsAreAvailableForModule(module: Module): void {\n\t\tconst includedReexports: Variable[] = [];\n\t\tconst map = module.getExportNamesByVariable();\n\t\tfor (const exportedVariable of map.keys()) {\n\t\t\tconst isSynthetic = exportedVariable instanceof SyntheticNamedExportVariable;\n\t\t\tconst importedVariable = isSynthetic\n\t\t\t\t? (exportedVariable as SyntheticNamedExportVariable).getBaseVariable()\n\t\t\t\t: exportedVariable;\n\t\t\tif (!(importedVariable instanceof NamespaceVariable && this.outputOptions.preserveModules)) {\n\t\t\t\tthis.checkCircularDependencyImport(importedVariable, module);\n\t\t\t\tconst exportingModule = importedVariable.module;\n\t\t\t\tif (exportingModule instanceof Module) {\n\t\t\t\t\tconst chunk = this.chunkByModule.get(exportingModule);\n\t\t\t\t\tif (chunk && chunk !== this) {\n\t\t\t\t\t\tchunk.exports.add(importedVariable);\n\t\t\t\t\t\tincludedReexports.push(importedVariable);\n\t\t\t\t\t\tif (isSynthetic) {\n\t\t\t\t\t\t\tthis.imports.add(importedVariable);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (includedReexports.length) {\n\t\t\tthis.includedReexportsByModule.set(module, includedReexports);\n\t\t}\n\t}\n\n\tprivate finaliseDynamicImports(\n\t\toptions: NormalizedOutputOptions,\n\t\tsnippets: GenerateCodeSnippets\n\t): void {\n\t\tconst stripKnownJsExtensions =\n\t\t\toptions.format === 'amd' && !options.amd.forceJsExtensionForImports;\n\t\tfor (const [module, code] of this.renderedModuleSources) {\n\t\t\tfor (const { node, resolution } of module.dynamicImports) {\n\t\t\t\tconst chunk = this.chunkByModule.get(resolution as Module);\n\t\t\t\tconst facadeChunk = this.facadeChunkByModule.get(resolution as Module);\n\t\t\t\tif (!resolution || !node.included || chunk === this) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tconst renderedResolution =\n\t\t\t\t\tresolution instanceof Module\n\t\t\t\t\t\t? `'${escapeId(\n\t\t\t\t\t\t\t\tgetImportPath(this.id!, (facadeChunk || chunk!).id!, stripKnownJsExtensions, true)\n\t\t\t\t\t\t )}'`\n\t\t\t\t\t\t: resolution instanceof ExternalModule\n\t\t\t\t\t\t? `'${escapeId(\n\t\t\t\t\t\t\t\tresolution.renormalizeRenderPath\n\t\t\t\t\t\t\t\t\t? getImportPath(this.id!, resolution.renderPath, stripKnownJsExtensions, false)\n\t\t\t\t\t\t\t\t\t: resolution.renderPath\n\t\t\t\t\t\t )}'`\n\t\t\t\t\t\t: resolution;\n\t\t\t\tnode.renderFinalResolution(\n\t\t\t\t\tcode,\n\t\t\t\t\trenderedResolution,\n\t\t\t\t\tresolution instanceof Module &&\n\t\t\t\t\t\t!facadeChunk?.strictFacade &&\n\t\t\t\t\t\tchunk!.exportNamesByVariable.get(resolution.namespace)![0],\n\t\t\t\t\tsnippets\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate finaliseImportMetas(format: InternalModuleFormat, snippets: GenerateCodeSnippets): void {\n\t\tfor (const [module, code] of this.renderedModuleSources) {\n\t\t\tfor (const importMeta of module.importMetas) {\n\t\t\t\timportMeta.renderFinalMechanism(code, this.id!, format, snippets, this.pluginDriver);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate generateVariableName(): string {\n\t\tif (this.manualChunkAlias) {\n\t\t\treturn this.manualChunkAlias;\n\t\t}\n\t\tconst moduleForNaming =\n\t\t\tthis.entryModules[0] ||\n\t\t\tthis.implicitEntryModules[0] ||\n\t\t\tthis.dynamicEntryModules[0] ||\n\t\t\tthis.orderedModules[this.orderedModules.length - 1];\n\t\tif (moduleForNaming) {\n\t\t\treturn getChunkNameFromModule(moduleForNaming);\n\t\t}\n\t\treturn 'chunk';\n\t}\n\n\tprivate getChunkDependencyDeclarations(\n\t\toptions: NormalizedOutputOptions,\n\t\tgetPropertyAccess: (name: string) => string\n\t): Map {\n\t\tconst importSpecifiers = this.getImportSpecifiers(getPropertyAccess);\n\t\tconst reexportSpecifiers = this.getReexportSpecifiers();\n\t\tconst dependencyDeclaration = new Map();\n\t\tfor (const dep of this.dependencies) {\n\t\t\tconst imports = importSpecifiers.get(dep) || null;\n\t\t\tconst reexports = reexportSpecifiers.get(dep) || null;\n\t\t\tconst namedExportsMode = dep instanceof ExternalModule || dep.exportMode !== 'default';\n\n\t\t\tdependencyDeclaration.set(dep, {\n\t\t\t\tdefaultVariableName: (dep as ExternalModule).defaultVariableName,\n\t\t\t\tglobalName: (dep instanceof ExternalModule &&\n\t\t\t\t\t(options.format === 'umd' || options.format === 'iife') &&\n\t\t\t\t\tgetGlobalName(\n\t\t\t\t\t\tdep,\n\t\t\t\t\t\toptions.globals,\n\t\t\t\t\t\t(imports || reexports) !== null,\n\t\t\t\t\t\tthis.inputOptions.onwarn\n\t\t\t\t\t)) as string,\n\t\t\t\tid: undefined as never, // chunk id updated on render\n\t\t\t\timports,\n\t\t\t\tisChunk: dep instanceof Chunk,\n\t\t\t\tname: dep.variableName,\n\t\t\t\tnamedExportsMode,\n\t\t\t\tnamespaceVariableName: (dep as ExternalModule).namespaceVariableName,\n\t\t\t\treexports\n\t\t\t});\n\t\t}\n\n\t\treturn dependencyDeclaration;\n\t}\n\n\tprivate getChunkExportDeclarations(\n\t\tformat: InternalModuleFormat,\n\t\tgetPropertyAccess: (name: string) => string\n\t): ChunkExports {\n\t\tconst exports: ChunkExports = [];\n\t\tfor (const exportName of this.getExportNames()) {\n\t\t\tif (exportName[0] === '*') continue;\n\n\t\t\tconst variable = this.exportsByName.get(exportName)!;\n\t\t\tif (!(variable instanceof SyntheticNamedExportVariable)) {\n\t\t\t\tconst module = variable.module;\n\t\t\t\tif (module && this.chunkByModule.get(module as Module) !== this) continue;\n\t\t\t}\n\t\t\tlet expression = null;\n\t\t\tlet hoisted = false;\n\t\t\tlet local = variable.getName(getPropertyAccess);\n\t\t\tif (variable instanceof LocalVariable) {\n\t\t\t\tfor (const declaration of variable.declarations) {\n\t\t\t\t\tif (\n\t\t\t\t\t\tdeclaration.parent instanceof FunctionDeclaration ||\n\t\t\t\t\t\t(declaration instanceof ExportDefaultDeclaration &&\n\t\t\t\t\t\t\tdeclaration.declaration instanceof FunctionDeclaration)\n\t\t\t\t\t) {\n\t\t\t\t\t\thoisted = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (variable instanceof SyntheticNamedExportVariable) {\n\t\t\t\texpression = local;\n\t\t\t\tif (format === 'es') {\n\t\t\t\t\tlocal = variable.renderName!;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\texports.push({\n\t\t\t\texported: exportName,\n\t\t\t\texpression,\n\t\t\t\thoisted,\n\t\t\t\tlocal\n\t\t\t});\n\t\t}\n\t\treturn exports;\n\t}\n\n\tprivate getDependenciesToBeDeconflicted(\n\t\taddNonNamespacesAndInteropHelpers: boolean,\n\t\taddDependenciesWithoutBindings: boolean,\n\t\tinterop: GetInterop\n\t): DependenciesToBeDeconflicted {\n\t\tconst dependencies = new Set();\n\t\tconst deconflictedDefault = new Set();\n\t\tconst deconflictedNamespace = new Set();\n\t\tfor (const variable of [...this.exportNamesByVariable.keys(), ...this.imports]) {\n\t\t\tif (addNonNamespacesAndInteropHelpers || variable.isNamespace) {\n\t\t\t\tconst module = variable.module!;\n\t\t\t\tif (module instanceof ExternalModule) {\n\t\t\t\t\tdependencies.add(module);\n\t\t\t\t\tif (addNonNamespacesAndInteropHelpers) {\n\t\t\t\t\t\tif (variable.name === 'default') {\n\t\t\t\t\t\t\tif (defaultInteropHelpersByInteropType[String(interop(module.id))]) {\n\t\t\t\t\t\t\t\tdeconflictedDefault.add(module);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (variable.name === '*') {\n\t\t\t\t\t\t\tif (namespaceInteropHelpersByInteropType[String(interop(module.id))]) {\n\t\t\t\t\t\t\t\tdeconflictedNamespace.add(module);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tconst chunk = this.chunkByModule.get(module)!;\n\t\t\t\t\tif (chunk !== this) {\n\t\t\t\t\t\tdependencies.add(chunk);\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\taddNonNamespacesAndInteropHelpers &&\n\t\t\t\t\t\t\tchunk.exportMode === 'default' &&\n\t\t\t\t\t\t\tvariable.isNamespace\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tdeconflictedNamespace.add(chunk);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (addDependenciesWithoutBindings) {\n\t\t\tfor (const dependency of this.dependencies) {\n\t\t\t\tdependencies.add(dependency);\n\t\t\t}\n\t\t}\n\t\treturn { deconflictedDefault, deconflictedNamespace, dependencies };\n\t}\n\n\tprivate getFallbackChunkName(): string {\n\t\tif (this.manualChunkAlias) {\n\t\t\treturn this.manualChunkAlias;\n\t\t}\n\t\tif (this.dynamicName) {\n\t\t\treturn this.dynamicName;\n\t\t}\n\t\tif (this.fileName) {\n\t\t\treturn getAliasName(this.fileName);\n\t\t}\n\t\treturn getAliasName(this.orderedModules[this.orderedModules.length - 1].id);\n\t}\n\n\tprivate getImportSpecifiers(\n\t\tgetPropertyAccess: (name: string) => string\n\t): Map {\n\t\tconst { interop } = this.outputOptions;\n\t\tconst importsByDependency = new Map();\n\t\tfor (const variable of this.imports) {\n\t\t\tconst module = variable.module!;\n\t\t\tlet dependency: Chunk | ExternalModule;\n\t\t\tlet imported: string;\n\t\t\tif (module instanceof ExternalModule) {\n\t\t\t\tdependency = module;\n\t\t\t\timported = variable.name;\n\t\t\t\tif (imported !== 'default' && imported !== '*' && interop(module.id) === 'defaultOnly') {\n\t\t\t\t\treturn error(errUnexpectedNamedImport(module.id, imported, false));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tdependency = this.chunkByModule.get(module)!;\n\t\t\t\timported = dependency.getVariableExportName(variable);\n\t\t\t}\n\t\t\tgetOrCreate(importsByDependency, dependency, () => []).push({\n\t\t\t\timported,\n\t\t\t\tlocal: variable.getName(getPropertyAccess)\n\t\t\t});\n\t\t}\n\t\treturn importsByDependency;\n\t}\n\n\tprivate getImportedBindingsPerDependency(): { [imported: string]: string[] } {\n\t\tconst importSpecifiers: { [imported: string]: string[] } = {};\n\t\tfor (const [dependency, declaration] of this.renderedDependencies!) {\n\t\t\tconst specifiers = new Set();\n\t\t\tif (declaration.imports) {\n\t\t\t\tfor (const { imported } of declaration.imports) {\n\t\t\t\t\tspecifiers.add(imported);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (declaration.reexports) {\n\t\t\t\tfor (const { imported } of declaration.reexports) {\n\t\t\t\t\tspecifiers.add(imported);\n\t\t\t\t}\n\t\t\t}\n\t\t\timportSpecifiers[dependency.id!] = [...specifiers];\n\t\t}\n\t\treturn importSpecifiers;\n\t}\n\n\tprivate getReexportSpecifiers(): Map {\n\t\tconst { externalLiveBindings, interop } = this.outputOptions;\n\t\tconst reexportSpecifiers = new Map();\n\t\tfor (let exportName of this.getExportNames()) {\n\t\t\tlet dependency: Chunk | ExternalModule;\n\t\t\tlet imported: string;\n\t\t\tlet needsLiveBinding = false;\n\t\t\tif (exportName[0] === '*') {\n\t\t\t\tconst id = exportName.substring(1);\n\t\t\t\tif (interop(id) === 'defaultOnly') {\n\t\t\t\t\tthis.inputOptions.onwarn(errUnexpectedNamespaceReexport(id));\n\t\t\t\t}\n\t\t\t\tneedsLiveBinding = externalLiveBindings;\n\t\t\t\tdependency = this.modulesById.get(id) as ExternalModule;\n\t\t\t\timported = exportName = '*';\n\t\t\t} else {\n\t\t\t\tconst variable = this.exportsByName.get(exportName)!;\n\t\t\t\tif (variable instanceof SyntheticNamedExportVariable) continue;\n\t\t\t\tconst module = variable.module!;\n\t\t\t\tif (module instanceof Module) {\n\t\t\t\t\tdependency = this.chunkByModule.get(module)!;\n\t\t\t\t\tif (dependency === this) continue;\n\t\t\t\t\timported = dependency.getVariableExportName(variable);\n\t\t\t\t\tneedsLiveBinding = variable.isReassigned;\n\t\t\t\t} else {\n\t\t\t\t\tdependency = module;\n\t\t\t\t\timported = variable.name;\n\t\t\t\t\tif (imported !== 'default' && imported !== '*' && interop(module.id) === 'defaultOnly') {\n\t\t\t\t\t\treturn error(errUnexpectedNamedImport(module.id, imported, true));\n\t\t\t\t\t}\n\t\t\t\t\tneedsLiveBinding =\n\t\t\t\t\t\texternalLiveBindings &&\n\t\t\t\t\t\t(imported !== 'default' || isDefaultAProperty(String(interop(module.id)), true));\n\t\t\t\t}\n\t\t\t}\n\t\t\tgetOrCreate(reexportSpecifiers, dependency, () => []).push({\n\t\t\t\timported,\n\t\t\t\tneedsLiveBinding,\n\t\t\t\treexported: exportName\n\t\t\t});\n\t\t}\n\t\treturn reexportSpecifiers;\n\t}\n\n\tprivate getReferencedFiles(): string[] {\n\t\tconst referencedFiles: string[] = [];\n\t\tfor (const module of this.orderedModules) {\n\t\t\tfor (const meta of module.importMetas) {\n\t\t\t\tconst fileName = meta.getReferencedFileName(this.pluginDriver);\n\t\t\t\tif (fileName) {\n\t\t\t\t\treferencedFiles.push(fileName);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn referencedFiles;\n\t}\n\n\tprivate inlineChunkDependencies(chunk: Chunk): void {\n\t\tfor (const dep of chunk.dependencies) {\n\t\t\tif (this.dependencies.has(dep)) continue;\n\t\t\tthis.dependencies.add(dep);\n\t\t\tif (dep instanceof Chunk) {\n\t\t\t\tthis.inlineChunkDependencies(dep);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate prepareModulesForRendering(snippets: GenerateCodeSnippets): void {\n\t\tconst accessedGlobalsByScope = this.accessedGlobalsByScope;\n\t\tfor (const module of this.orderedModules) {\n\t\t\tfor (const { node, resolution } of module.dynamicImports) {\n\t\t\t\tif (node.included) {\n\t\t\t\t\tif (resolution instanceof Module) {\n\t\t\t\t\t\tconst chunk = this.chunkByModule.get(resolution);\n\t\t\t\t\t\tif (chunk === this) {\n\t\t\t\t\t\t\tnode.setInternalResolution(resolution.namespace);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tnode.setExternalResolution(\n\t\t\t\t\t\t\t\tthis.facadeChunkByModule.get(resolution)?.exportMode || chunk!.exportMode,\n\t\t\t\t\t\t\t\tresolution,\n\t\t\t\t\t\t\t\tthis.outputOptions,\n\t\t\t\t\t\t\t\tsnippets,\n\t\t\t\t\t\t\t\tthis.pluginDriver,\n\t\t\t\t\t\t\t\taccessedGlobalsByScope\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnode.setExternalResolution(\n\t\t\t\t\t\t\t'external',\n\t\t\t\t\t\t\tresolution,\n\t\t\t\t\t\t\tthis.outputOptions,\n\t\t\t\t\t\t\tsnippets,\n\t\t\t\t\t\t\tthis.pluginDriver,\n\t\t\t\t\t\t\taccessedGlobalsByScope\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (const importMeta of module.importMetas) {\n\t\t\t\timportMeta.addAccessedGlobals(this.outputOptions.format, accessedGlobalsByScope);\n\t\t\t}\n\t\t\tif (this.includedNamespaces.has(module) && !this.outputOptions.preserveModules) {\n\t\t\t\tmodule.namespace.prepare(accessedGlobalsByScope);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate setExternalRenderPaths(options: NormalizedOutputOptions, inputBase: string): void {\n\t\tfor (const dependency of [...this.dependencies, ...this.dynamicDependencies]) {\n\t\t\tif (dependency instanceof ExternalModule) {\n\t\t\t\tdependency.setRenderPath(options, inputBase);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate setIdentifierRenderResolutions({\n\t\tformat,\n\t\tinterop,\n\t\tnamespaceToStringTag\n\t}: NormalizedOutputOptions) {\n\t\tconst syntheticExports = new Set();\n\t\tfor (const exportName of this.getExportNames()) {\n\t\t\tconst exportVariable = this.exportsByName.get(exportName)!;\n\t\t\tif (\n\t\t\t\tformat !== 'es' &&\n\t\t\t\tformat !== 'system' &&\n\t\t\t\texportVariable.isReassigned &&\n\t\t\t\t!exportVariable.isId\n\t\t\t) {\n\t\t\t\texportVariable.setRenderNames('exports', exportName);\n\t\t\t} else if (exportVariable instanceof SyntheticNamedExportVariable) {\n\t\t\t\tsyntheticExports.add(exportVariable);\n\t\t\t} else {\n\t\t\t\texportVariable.setRenderNames(null, null);\n\t\t\t}\n\t\t}\n\t\tfor (const module of this.orderedModules) {\n\t\t\tif (module.needsExportShim) {\n\t\t\t\tthis.needsExportsShim = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tconst usedNames = new Set(['Object', 'Promise']);\n\t\tif (this.needsExportsShim) {\n\t\t\tusedNames.add(MISSING_EXPORT_SHIM_VARIABLE);\n\t\t}\n\t\tif (namespaceToStringTag) {\n\t\t\tusedNames.add('Symbol');\n\t\t}\n\t\tswitch (format) {\n\t\t\tcase 'system':\n\t\t\t\tusedNames.add('module').add('exports');\n\t\t\t\tbreak;\n\t\t\tcase 'es':\n\t\t\t\tbreak;\n\t\t\tcase 'cjs':\n\t\t\t\tusedNames.add('module').add('require').add('__filename').add('__dirname');\n\t\t\t// fallthrough\n\t\t\tdefault:\n\t\t\t\tusedNames.add('exports');\n\t\t\t\tfor (const helper of HELPER_NAMES) {\n\t\t\t\t\tusedNames.add(helper);\n\t\t\t\t}\n\t\t}\n\n\t\tdeconflictChunk(\n\t\t\tthis.orderedModules,\n\t\t\tthis.getDependenciesToBeDeconflicted(\n\t\t\t\tformat !== 'es' && format !== 'system',\n\t\t\t\tformat === 'amd' || format === 'umd' || format === 'iife',\n\t\t\t\tinterop\n\t\t\t),\n\t\t\tthis.imports,\n\t\t\tusedNames,\n\t\t\tformat,\n\t\t\tinterop,\n\t\t\tthis.outputOptions.preserveModules,\n\t\t\tthis.outputOptions.externalLiveBindings,\n\t\t\tthis.chunkByModule,\n\t\t\tsyntheticExports,\n\t\t\tthis.exportNamesByVariable,\n\t\t\tthis.accessedGlobalsByScope,\n\t\t\tthis.includedNamespaces\n\t\t);\n\t}\n\n\tprivate setUpChunkImportsAndExportsForModule(module: Module): void {\n\t\tconst moduleImports = new Set(module.includedImports);\n\t\t// when we are not preserving modules, we need to make all namespace variables available for\n\t\t// rendering the namespace object\n\t\tif (!this.outputOptions.preserveModules) {\n\t\t\tif (this.includedNamespaces.has(module)) {\n\t\t\t\tconst memberVariables = module.namespace.getMemberVariables();\n\t\t\t\tfor (const variable of Object.values(memberVariables)) {\n\t\t\t\t\tmoduleImports.add(variable);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor (let variable of moduleImports) {\n\t\t\tif (variable instanceof ExportDefaultVariable) {\n\t\t\t\tvariable = variable.getOriginalVariable();\n\t\t\t}\n\t\t\tif (variable instanceof SyntheticNamedExportVariable) {\n\t\t\t\tvariable = variable.getBaseVariable();\n\t\t\t}\n\t\t\tconst chunk = this.chunkByModule.get(variable.module as Module);\n\t\t\tif (chunk !== this) {\n\t\t\t\tthis.imports.add(variable);\n\t\t\t\tif (\n\t\t\t\t\t!(variable instanceof NamespaceVariable && this.outputOptions.preserveModules) &&\n\t\t\t\t\tvariable.module instanceof Module\n\t\t\t\t) {\n\t\t\t\t\tchunk!.exports.add(variable);\n\t\t\t\t\tthis.checkCircularDependencyImport(variable, module);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (\n\t\t\tthis.includedNamespaces.has(module) ||\n\t\t\t(module.info.isEntry && module.preserveSignature !== false) ||\n\t\t\tmodule.includedDynamicImporters.some(importer => this.chunkByModule.get(importer) !== this)\n\t\t) {\n\t\t\tthis.ensureReexportsAreAvailableForModule(module);\n\t\t}\n\t\tfor (const { node, resolution } of module.dynamicImports) {\n\t\t\tif (\n\t\t\t\tnode.included &&\n\t\t\t\tresolution instanceof Module &&\n\t\t\t\tthis.chunkByModule.get(resolution) === this &&\n\t\t\t\t!this.includedNamespaces.has(resolution)\n\t\t\t) {\n\t\t\t\tthis.includedNamespaces.add(resolution);\n\t\t\t\tthis.ensureReexportsAreAvailableForModule(resolution);\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction getChunkNameFromModule(module: Module): string {\n\treturn (\n\t\tmodule.chunkNames.find(({ isUserDefined }) => isUserDefined)?.name ??\n\t\tmodule.chunkNames[0]?.name ??\n\t\tgetAliasName(module.id)\n\t);\n}\n\nconst QUERY_HASH_REGEX = /[?#]/;\n","import type Variable from '../ast/variables/Variable';\nimport RESERVED_NAMES from './RESERVED_NAMES';\nimport { toBase64 } from './base64';\n\nexport function assignExportsToMangledNames(\n\texports: ReadonlySet,\n\texportsByName: Map,\n\texportNamesByVariable: Map\n): void {\n\tlet nameIndex = 0;\n\tfor (const variable of exports) {\n\t\tlet [exportName] = variable.name;\n\t\tif (exportsByName.has(exportName)) {\n\t\t\tdo {\n\t\t\t\texportName = toBase64(++nameIndex);\n\t\t\t\t// skip past leading number identifiers\n\t\t\t\tif (exportName.charCodeAt(0) === 49 /* '1' */) {\n\t\t\t\t\tnameIndex += 9 * 64 ** (exportName.length - 1);\n\t\t\t\t\texportName = toBase64(nameIndex);\n\t\t\t\t}\n\t\t\t} while (RESERVED_NAMES.has(exportName) || exportsByName.has(exportName));\n\t\t}\n\t\texportsByName.set(exportName, variable);\n\t\texportNamesByVariable.set(variable, [exportName]);\n\t}\n}\n\nexport function assignExportsToNames(\n\texports: ReadonlySet,\n\texportsByName: Map,\n\texportNamesByVariable: Map\n): void {\n\tfor (const variable of exports) {\n\t\tlet nameIndex = 0;\n\t\tlet exportName = variable.name;\n\t\twhile (exportsByName.has(exportName)) {\n\t\t\texportName = variable.name + '$' + ++nameIndex;\n\t\t}\n\t\texportsByName.set(exportName, variable);\n\t\texportNamesByVariable.set(variable, [exportName]);\n\t}\n}\n","import type {\n\tDecodedSourceMapOrMissing,\n\tNormalizedOutputOptions,\n\tPlugin,\n\tRenderedChunk,\n\tSourceMapInput\n} from '../rollup/types';\nimport type { PluginDriver } from './PluginDriver';\nimport { decodedSourcemap } from './decodedSourcemap';\n\nexport default function renderChunk({\n\tcode,\n\toptions,\n\toutputPluginDriver,\n\trenderChunk,\n\tsourcemapChain\n}: {\n\tcode: string;\n\toptions: NormalizedOutputOptions;\n\toutputPluginDriver: PluginDriver;\n\trenderChunk: RenderedChunk;\n\tsourcemapChain: DecodedSourceMapOrMissing[];\n}): Promise {\n\tconst renderChunkReducer = (\n\t\tcode: string,\n\t\tresult: { code: string; map?: SourceMapInput } | string | null | undefined,\n\t\tplugin: Plugin\n\t): string => {\n\t\tif (result == null) return code;\n\n\t\tif (typeof result === 'string')\n\t\t\tresult = {\n\t\t\t\tcode: result,\n\t\t\t\tmap: undefined\n\t\t\t};\n\n\t\t// strict null check allows 'null' maps to not be pushed to the chain, while 'undefined' gets the missing map warning\n\t\tif (result.map !== null) {\n\t\t\tconst map = decodedSourcemap(result.map);\n\t\t\tsourcemapChain.push(map || { missing: true, plugin: plugin.name });\n\t\t}\n\n\t\treturn result.code;\n\t};\n\n\treturn outputPluginDriver.hookReduceArg0(\n\t\t'renderChunk',\n\t\t[code, renderChunk, options],\n\t\trenderChunkReducer\n\t);\n}\n","import type { NormalizedOutputOptions } from '../rollup/types';\nimport type { PluginDriver } from './PluginDriver';\nimport { error } from './error';\n\nexport interface Addons {\n\tbanner: string;\n\tfooter: string;\n\tintro: string;\n\toutro: string;\n}\n\nconst concatSep = (out: string, next: string) => (next ? `${out}\\n${next}` : out);\nconst concatDblSep = (out: string, next: string) => (next ? `${out}\\n\\n${next}` : out);\n\nexport async function createAddons(\n\toptions: NormalizedOutputOptions,\n\toutputPluginDriver: PluginDriver\n): Promise {\n\ttry {\n\t\tlet [banner, footer, intro, outro] = await Promise.all([\n\t\t\toutputPluginDriver.hookReduceValue('banner', options.banner(), [], concatSep),\n\t\t\toutputPluginDriver.hookReduceValue('footer', options.footer(), [], concatSep),\n\t\t\toutputPluginDriver.hookReduceValue('intro', options.intro(), [], concatDblSep),\n\t\t\toutputPluginDriver.hookReduceValue('outro', options.outro(), [], concatDblSep)\n\t\t]);\n\t\tif (intro) intro += '\\n\\n';\n\t\tif (outro) outro = `\\n\\n${outro}`;\n\t\tif (banner.length) banner += '\\n';\n\t\tif (footer.length) footer = '\\n' + footer;\n\n\t\treturn { banner, footer, intro, outro };\n\t} catch (err: any) {\n\t\treturn error({\n\t\t\tcode: 'ADDON_ERROR',\n\t\t\tmessage: `Could not retrieve ${err.hook}. Check configuration of plugin ${err.plugin}.\n\\tError Message: ${err.message}`\n\t\t});\n\t}\n}\n","import ExternalModule from '../ExternalModule';\nimport Module from '../Module';\nimport { getOrCreate } from './getOrCreate';\n\ntype DependentModuleMap = Map>;\ntype ChunkDefinitions = { alias: string | null; modules: Module[] }[];\n\nexport function getChunkAssignments(\n\tentryModules: readonly Module[],\n\tmanualChunkAliasByEntry: ReadonlyMap\n): ChunkDefinitions {\n\tconst chunkDefinitions: ChunkDefinitions = [];\n\tconst modulesInManualChunks = new Set(manualChunkAliasByEntry.keys());\n\tconst manualChunkModulesByAlias: Record = Object.create(null);\n\tfor (const [entry, alias] of manualChunkAliasByEntry) {\n\t\tconst chunkModules = (manualChunkModulesByAlias[alias] =\n\t\t\tmanualChunkModulesByAlias[alias] || []);\n\t\taddStaticDependenciesToManualChunk(entry, chunkModules, modulesInManualChunks);\n\t}\n\tfor (const [alias, modules] of Object.entries(manualChunkModulesByAlias)) {\n\t\tchunkDefinitions.push({ alias, modules });\n\t}\n\n\tconst assignedEntryPointsByModule: DependentModuleMap = new Map();\n\tconst { dependentEntryPointsByModule, dynamicEntryModules } = analyzeModuleGraph(entryModules);\n\tconst dynamicallyDependentEntryPointsByDynamicEntry: DependentModuleMap =\n\t\tgetDynamicDependentEntryPoints(dependentEntryPointsByModule, dynamicEntryModules);\n\tconst staticEntries = new Set(entryModules);\n\n\tfunction assignEntryToStaticDependencies(\n\t\tentry: Module,\n\t\tdynamicDependentEntryPoints: ReadonlySet | null\n\t) {\n\t\tconst modulesToHandle = new Set([entry]);\n\t\tfor (const module of modulesToHandle) {\n\t\t\tconst assignedEntryPoints = getOrCreate(assignedEntryPointsByModule, module, () => new Set());\n\t\t\tif (\n\t\t\t\tdynamicDependentEntryPoints &&\n\t\t\t\tareEntryPointsContainedOrDynamicallyDependent(\n\t\t\t\t\tdynamicDependentEntryPoints,\n\t\t\t\t\tdependentEntryPointsByModule.get(module)!\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\tcontinue;\n\t\t\t} else {\n\t\t\t\tassignedEntryPoints.add(entry);\n\t\t\t}\n\t\t\tfor (const dependency of module.getDependenciesToBeIncluded()) {\n\t\t\t\tif (!(dependency instanceof ExternalModule || modulesInManualChunks.has(dependency))) {\n\t\t\t\t\tmodulesToHandle.add(dependency);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction areEntryPointsContainedOrDynamicallyDependent(\n\t\tentryPoints: ReadonlySet,\n\t\tcontainedIn: ReadonlySet\n\t): boolean {\n\t\tconst entriesToCheck = new Set(entryPoints);\n\t\tfor (const entry of entriesToCheck) {\n\t\t\tif (!containedIn.has(entry)) {\n\t\t\t\tif (staticEntries.has(entry)) return false;\n\t\t\t\tconst dynamicallyDependentEntryPoints =\n\t\t\t\t\tdynamicallyDependentEntryPointsByDynamicEntry.get(entry)!;\n\t\t\t\tfor (const dependentEntry of dynamicallyDependentEntryPoints) {\n\t\t\t\t\tentriesToCheck.add(dependentEntry);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\n\tfor (const entry of entryModules) {\n\t\tif (!modulesInManualChunks.has(entry)) {\n\t\t\tassignEntryToStaticDependencies(entry, null);\n\t\t}\n\t}\n\n\tfor (const entry of dynamicEntryModules) {\n\t\tif (!modulesInManualChunks.has(entry)) {\n\t\t\tassignEntryToStaticDependencies(\n\t\t\t\tentry,\n\t\t\t\tdynamicallyDependentEntryPointsByDynamicEntry.get(entry)!\n\t\t\t);\n\t\t}\n\t}\n\n\tchunkDefinitions.push(\n\t\t...createChunks([...entryModules, ...dynamicEntryModules], assignedEntryPointsByModule)\n\t);\n\treturn chunkDefinitions;\n}\n\nfunction addStaticDependenciesToManualChunk(\n\tentry: Module,\n\tmanualChunkModules: Module[],\n\tmodulesInManualChunks: Set\n): void {\n\tconst modulesToHandle = new Set([entry]);\n\tfor (const module of modulesToHandle) {\n\t\tmodulesInManualChunks.add(module);\n\t\tmanualChunkModules.push(module);\n\t\tfor (const dependency of module.dependencies) {\n\t\t\tif (!(dependency instanceof ExternalModule || modulesInManualChunks.has(dependency))) {\n\t\t\t\tmodulesToHandle.add(dependency);\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction analyzeModuleGraph(entryModules: readonly Module[]): {\n\tdependentEntryPointsByModule: DependentModuleMap;\n\tdynamicEntryModules: Set;\n} {\n\tconst dynamicEntryModules = new Set();\n\tconst dependentEntryPointsByModule: DependentModuleMap = new Map();\n\tconst entriesToHandle = new Set(entryModules);\n\tfor (const currentEntry of entriesToHandle) {\n\t\tconst modulesToHandle = new Set([currentEntry]);\n\t\tfor (const module of modulesToHandle) {\n\t\t\tgetOrCreate(dependentEntryPointsByModule, module, () => new Set()).add(currentEntry);\n\t\t\tfor (const dependency of module.getDependenciesToBeIncluded()) {\n\t\t\t\tif (!(dependency instanceof ExternalModule)) {\n\t\t\t\t\tmodulesToHandle.add(dependency);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (const { resolution } of module.dynamicImports) {\n\t\t\t\tif (resolution instanceof Module && resolution.includedDynamicImporters.length > 0) {\n\t\t\t\t\tdynamicEntryModules.add(resolution);\n\t\t\t\t\tentriesToHandle.add(resolution);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (const dependency of module.implicitlyLoadedBefore) {\n\t\t\t\tdynamicEntryModules.add(dependency);\n\t\t\t\tentriesToHandle.add(dependency);\n\t\t\t}\n\t\t}\n\t}\n\treturn { dependentEntryPointsByModule, dynamicEntryModules };\n}\n\nfunction getDynamicDependentEntryPoints(\n\tdependentEntryPointsByModule: DependentModuleMap,\n\tdynamicEntryModules: ReadonlySet\n): DependentModuleMap {\n\tconst dynamicallyDependentEntryPointsByDynamicEntry: DependentModuleMap = new Map();\n\tfor (const dynamicEntry of dynamicEntryModules) {\n\t\tconst dynamicDependentEntryPoints = getOrCreate(\n\t\t\tdynamicallyDependentEntryPointsByDynamicEntry,\n\t\t\tdynamicEntry,\n\t\t\t() => new Set()\n\t\t);\n\t\tfor (const importer of [\n\t\t\t...dynamicEntry.includedDynamicImporters,\n\t\t\t...dynamicEntry.implicitlyLoadedAfter\n\t\t]) {\n\t\t\tfor (const entryPoint of dependentEntryPointsByModule.get(importer)!) {\n\t\t\t\tdynamicDependentEntryPoints.add(entryPoint);\n\t\t\t}\n\t\t}\n\t}\n\treturn dynamicallyDependentEntryPointsByDynamicEntry;\n}\n\nfunction createChunks(\n\tallEntryPoints: readonly Module[],\n\tassignedEntryPointsByModule: DependentModuleMap\n): ChunkDefinitions {\n\tconst chunkModules: { [chunkSignature: string]: Module[] } = Object.create(null);\n\tfor (const [module, assignedEntryPoints] of assignedEntryPointsByModule) {\n\t\tlet chunkSignature = '';\n\t\tfor (const entry of allEntryPoints) {\n\t\t\tchunkSignature += assignedEntryPoints.has(entry) ? 'X' : '_';\n\t\t}\n\t\tconst chunk = chunkModules[chunkSignature];\n\t\tif (chunk) {\n\t\t\tchunk.push(module);\n\t\t} else {\n\t\t\tchunkModules[chunkSignature] = [module];\n\t\t}\n\t}\n\treturn Object.values(chunkModules).map(modules => ({\n\t\talias: null,\n\t\tmodules\n\t}));\n}\n","import type ExternalModule from '../ExternalModule';\nimport Module from '../Module';\nimport relativeId from './relativeId';\n\ninterface OrderedExecutionUnit {\n\texecIndex: number;\n}\n\nconst compareExecIndex = (unitA: T, unitB: T) =>\n\tunitA.execIndex > unitB.execIndex ? 1 : -1;\n\nexport function sortByExecutionOrder(units: OrderedExecutionUnit[]): void {\n\tunits.sort(compareExecIndex);\n}\n\nexport function analyseModuleExecution(entryModules: readonly Module[]): {\n\tcyclePaths: string[][];\n\torderedModules: Module[];\n} {\n\tlet nextExecIndex = 0;\n\tconst cyclePaths: string[][] = [];\n\tconst analysedModules = new Set();\n\tconst dynamicImports = new Set();\n\tconst parents = new Map();\n\tconst orderedModules: Module[] = [];\n\n\tconst analyseModule = (module: Module | ExternalModule) => {\n\t\tif (module instanceof Module) {\n\t\t\tfor (const dependency of module.dependencies) {\n\t\t\t\tif (parents.has(dependency)) {\n\t\t\t\t\tif (!analysedModules.has(dependency)) {\n\t\t\t\t\t\tcyclePaths.push(getCyclePath(dependency as Module, module, parents));\n\t\t\t\t\t}\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tparents.set(dependency, module);\n\t\t\t\tanalyseModule(dependency);\n\t\t\t}\n\n\t\t\tfor (const dependency of module.implicitlyLoadedBefore) {\n\t\t\t\tdynamicImports.add(dependency);\n\t\t\t}\n\t\t\tfor (const { resolution } of module.dynamicImports) {\n\t\t\t\tif (resolution instanceof Module) {\n\t\t\t\t\tdynamicImports.add(resolution);\n\t\t\t\t}\n\t\t\t}\n\t\t\torderedModules.push(module);\n\t\t}\n\n\t\tmodule.execIndex = nextExecIndex++;\n\t\tanalysedModules.add(module);\n\t};\n\n\tfor (const curEntry of entryModules) {\n\t\tif (!parents.has(curEntry)) {\n\t\t\tparents.set(curEntry, null);\n\t\t\tanalyseModule(curEntry);\n\t\t}\n\t}\n\tfor (const curEntry of dynamicImports) {\n\t\tif (!parents.has(curEntry)) {\n\t\t\tparents.set(curEntry, null);\n\t\t\tanalyseModule(curEntry);\n\t\t}\n\t}\n\n\treturn { cyclePaths, orderedModules };\n}\n\nfunction getCyclePath(\n\tmodule: Module,\n\tparent: Module,\n\tparents: ReadonlyMap\n): string[] {\n\tconst cycleSymbol = Symbol(module.id);\n\tconst path = [relativeId(module.id)];\n\tlet nextModule = parent;\n\tmodule.cycles.add(cycleSymbol);\n\twhile (nextModule !== module) {\n\t\tnextModule.cycles.add(cycleSymbol);\n\t\tpath.push(relativeId(nextModule.id));\n\t\tnextModule = parents.get(nextModule)!;\n\t}\n\tpath.push(path[0]);\n\tpath.reverse();\n\treturn path;\n}\n","import type { NormalizedOutputOptions } from '../rollup/types';\nimport RESERVED_NAMES from './RESERVED_NAMES';\n\nexport interface GenerateCodeSnippets {\n\t_: string;\n\tcnst: string;\n\tn: string;\n\ts: string;\n\tgetDirectReturnFunction(\n\t\tparams: string[],\n\t\toptions: {\n\t\t\tfunctionReturn: boolean;\n\t\t\tlineBreakIndent: { base: string; t: string } | null;\n\t\t\tname: string | null;\n\t\t}\n\t): [left: string, right: string];\n\tgetDirectReturnIifeLeft(\n\t\tparams: string[],\n\t\treturned: string,\n\t\toptions: {\n\t\t\tneedsArrowReturnParens: boolean | undefined;\n\t\t\tneedsWrappedFunction: boolean | undefined;\n\t\t}\n\t): string;\n\tgetFunctionIntro(params: string[], options: { isAsync: boolean; name: string | null }): string;\n\tgetNonArrowFunctionIntro(\n\t\tparams: string[],\n\t\toptions: { isAsync: boolean; name: string | null }\n\t): string;\n\tgetObject(\n\t\tfields: [key: string | null, value: string][],\n\t\toptions: { lineBreakIndent: { base: string; t: string } | null }\n\t): string;\n\tgetPropertyAccess(name: string): string;\n}\n\nexport function getGenerateCodeSnippets({\n\tcompact,\n\tgeneratedCode: { arrowFunctions, constBindings, objectShorthand, reservedNamesAsProps }\n}: NormalizedOutputOptions): GenerateCodeSnippets {\n\tconst { _, n, s } = compact ? { _: '', n: '', s: '' } : { _: ' ', n: '\\n', s: ';' };\n\tconst cnst = constBindings ? 'const' : 'var';\n\tconst getNonArrowFunctionIntro: GenerateCodeSnippets['getNonArrowFunctionIntro'] = (\n\t\tparams,\n\t\t{ isAsync, name }\n\t) =>\n\t\t`${isAsync ? `async ` : ''}function${name ? ` ${name}` : ''}${_}(${params.join(`,${_}`)})${_}`;\n\n\tconst getFunctionIntro: GenerateCodeSnippets['getFunctionIntro'] = arrowFunctions\n\t\t? (params, { isAsync, name }) => {\n\t\t\t\tconst singleParam = params.length === 1;\n\t\t\t\tconst asyncString = isAsync ? `async${singleParam ? ' ' : _}` : '';\n\t\t\t\treturn `${name ? `${cnst} ${name}${_}=${_}` : ''}${asyncString}${\n\t\t\t\t\tsingleParam ? params[0] : `(${params.join(`,${_}`)})`\n\t\t\t\t}${_}=>${_}`;\n\t\t }\n\t\t: getNonArrowFunctionIntro;\n\n\tconst getDirectReturnFunction: GenerateCodeSnippets['getDirectReturnFunction'] = (\n\t\tparams,\n\t\t{ functionReturn, lineBreakIndent, name }\n\t) => [\n\t\t`${getFunctionIntro(params, {\n\t\t\tisAsync: false,\n\t\t\tname\n\t\t})}${\n\t\t\tarrowFunctions\n\t\t\t\t? lineBreakIndent\n\t\t\t\t\t? `${n}${lineBreakIndent.base}${lineBreakIndent.t}`\n\t\t\t\t\t: ''\n\t\t\t\t: `{${lineBreakIndent ? `${n}${lineBreakIndent.base}${lineBreakIndent.t}` : _}${\n\t\t\t\t\t\tfunctionReturn ? 'return ' : ''\n\t\t\t\t }`\n\t\t}`,\n\t\tarrowFunctions\n\t\t\t? `${name ? ';' : ''}${lineBreakIndent ? `${n}${lineBreakIndent.base}` : ''}`\n\t\t\t: `${s}${lineBreakIndent ? `${n}${lineBreakIndent.base}` : _}}`\n\t];\n\n\tconst isValidPropName = reservedNamesAsProps\n\t\t? (name: string): boolean => validPropName.test(name)\n\t\t: (name: string): boolean => !RESERVED_NAMES.has(name) && validPropName.test(name);\n\n\treturn {\n\t\t_,\n\t\tcnst,\n\t\tgetDirectReturnFunction,\n\t\tgetDirectReturnIifeLeft: (\n\t\t\tparams,\n\t\t\treturned,\n\t\t\t{ needsArrowReturnParens, needsWrappedFunction }\n\t\t) => {\n\t\t\tconst [left, right] = getDirectReturnFunction(params, {\n\t\t\t\tfunctionReturn: true,\n\t\t\t\tlineBreakIndent: null,\n\t\t\t\tname: null\n\t\t\t});\n\t\t\treturn `${wrapIfNeeded(\n\t\t\t\t`${left}${wrapIfNeeded(returned, arrowFunctions && needsArrowReturnParens)}${right}`,\n\t\t\t\tarrowFunctions || needsWrappedFunction\n\t\t\t)}(`;\n\t\t},\n\t\tgetFunctionIntro,\n\t\tgetNonArrowFunctionIntro,\n\t\tgetObject(fields, { lineBreakIndent }) {\n\t\t\tconst prefix = lineBreakIndent ? `${n}${lineBreakIndent.base}${lineBreakIndent.t}` : _;\n\t\t\treturn `{${fields\n\t\t\t\t.map(([key, value]) => {\n\t\t\t\t\tif (key === null) return `${prefix}${value}`;\n\t\t\t\t\tconst needsQuotes = !isValidPropName(key);\n\t\t\t\t\treturn key === value && objectShorthand && !needsQuotes\n\t\t\t\t\t\t? prefix + key\n\t\t\t\t\t\t: `${prefix}${needsQuotes ? `'${key}'` : key}:${_}${value}`;\n\t\t\t\t})\n\t\t\t\t.join(`,`)}${\n\t\t\t\tfields.length === 0 ? '' : lineBreakIndent ? `${n}${lineBreakIndent.base}` : _\n\t\t\t}}`;\n\t\t},\n\t\tgetPropertyAccess: (name: string): string =>\n\t\t\tisValidPropName(name) ? `.${name}` : `[${JSON.stringify(name)}]`,\n\t\tn,\n\t\ts\n\t};\n}\n\nconst wrapIfNeeded = (code: string, needsParens: boolean | undefined): string =>\n\tneedsParens ? `(${code})` : code;\n\nconst validPropName = /^(?!\\d)[\\w$]+$/;\n","import Chunk from './Chunk';\nimport type ExternalModule from './ExternalModule';\nimport type Graph from './Graph';\nimport Module from './Module';\nimport type {\n\tGetManualChunk,\n\tNormalizedInputOptions,\n\tNormalizedOutputOptions,\n\tOutputAsset,\n\tOutputBundle,\n\tOutputChunk,\n\tWarningHandler\n} from './rollup/types';\nimport type { PluginDriver } from './utils/PluginDriver';\nimport { type Addons, createAddons } from './utils/addons';\nimport { getChunkAssignments } from './utils/chunkAssignment';\nimport commondir from './utils/commondir';\nimport {\n\terrCannotAssignModuleToChunk,\n\terrChunkInvalid,\n\terrInvalidOption,\n\terror,\n\twarnDeprecation\n} from './utils/error';\nimport { sortByExecutionOrder } from './utils/executionOrder';\nimport { type GenerateCodeSnippets, getGenerateCodeSnippets } from './utils/generateCodeSnippets';\nimport {\n\tFILE_PLACEHOLDER,\n\tgetOutputBundle,\n\tOutputBundleWithPlaceholders\n} from './utils/outputBundle';\nimport { basename, isAbsolute } from './utils/path';\nimport { timeEnd, timeStart } from './utils/timers';\n\nexport default class Bundle {\n\tprivate readonly facadeChunkByModule = new Map();\n\tprivate readonly includedNamespaces = new Set();\n\n\tconstructor(\n\t\tprivate readonly outputOptions: NormalizedOutputOptions,\n\t\tprivate readonly unsetOptions: ReadonlySet,\n\t\tprivate readonly inputOptions: NormalizedInputOptions,\n\t\tprivate readonly pluginDriver: PluginDriver,\n\t\tprivate readonly graph: Graph\n\t) {}\n\n\tasync generate(isWrite: boolean): Promise {\n\t\ttimeStart('GENERATE', 1);\n\t\tconst outputBundleBase: OutputBundle = Object.create(null);\n\t\tconst outputBundle = getOutputBundle(outputBundleBase);\n\t\tthis.pluginDriver.setOutputBundle(outputBundle, this.outputOptions, this.facadeChunkByModule);\n\t\ttry {\n\t\t\tawait this.pluginDriver.hookParallel('renderStart', [this.outputOptions, this.inputOptions]);\n\n\t\t\ttimeStart('generate chunks', 2);\n\t\t\tconst chunks = await this.generateChunks();\n\t\t\tif (chunks.length > 1) {\n\t\t\t\tvalidateOptionsForMultiChunkOutput(this.outputOptions, this.inputOptions.onwarn);\n\t\t\t}\n\t\t\tconst inputBase = commondir(getAbsoluteEntryModulePaths(chunks));\n\t\t\ttimeEnd('generate chunks', 2);\n\n\t\t\ttimeStart('render modules', 2);\n\n\t\t\t// We need to create addons before prerender because at the moment, there\n\t\t\t// can be no async code between prerender and render due to internal state\n\t\t\tconst addons = await createAddons(this.outputOptions, this.pluginDriver);\n\t\t\tconst snippets = getGenerateCodeSnippets(this.outputOptions);\n\t\t\tthis.prerenderChunks(chunks, inputBase, snippets);\n\t\t\ttimeEnd('render modules', 2);\n\n\t\t\tawait this.addFinalizedChunksToBundle(chunks, inputBase, addons, outputBundle, snippets);\n\t\t} catch (err: any) {\n\t\t\tawait this.pluginDriver.hookParallel('renderError', [err]);\n\t\t\tthrow err;\n\t\t}\n\t\tawait this.pluginDriver.hookSeq('generateBundle', [\n\t\t\tthis.outputOptions,\n\t\t\toutputBundle as OutputBundle,\n\t\t\tisWrite\n\t\t]);\n\t\tthis.finaliseAssets(outputBundle);\n\n\t\ttimeEnd('GENERATE', 1);\n\t\treturn outputBundleBase;\n\t}\n\n\tprivate async addFinalizedChunksToBundle(\n\t\tchunks: readonly Chunk[],\n\t\tinputBase: string,\n\t\taddons: Addons,\n\t\tbundle: OutputBundleWithPlaceholders,\n\t\tsnippets: GenerateCodeSnippets\n\t): Promise {\n\t\tthis.assignChunkIds(chunks, inputBase, addons, bundle);\n\t\tfor (const chunk of chunks) {\n\t\t\tbundle[chunk.id!] = chunk.getChunkInfoWithFileNames() as OutputChunk;\n\t\t}\n\t\tawait Promise.all(\n\t\t\tchunks.map(async chunk => {\n\t\t\t\tconst outputChunk = bundle[chunk.id!] as OutputChunk;\n\t\t\t\tObject.assign(\n\t\t\t\t\toutputChunk,\n\t\t\t\t\tawait chunk.render(this.outputOptions, addons, outputChunk, snippets)\n\t\t\t\t);\n\t\t\t})\n\t\t);\n\t}\n\n\tprivate async addManualChunks(\n\t\tmanualChunks: Record\n\t): Promise> {\n\t\tconst manualChunkAliasByEntry = new Map();\n\t\tconst chunkEntries = await Promise.all(\n\t\t\tObject.entries(manualChunks).map(async ([alias, files]) => ({\n\t\t\t\talias,\n\t\t\t\tentries: await this.graph.moduleLoader.addAdditionalModules(files)\n\t\t\t}))\n\t\t);\n\t\tfor (const { alias, entries } of chunkEntries) {\n\t\t\tfor (const entry of entries) {\n\t\t\t\taddModuleToManualChunk(alias, entry, manualChunkAliasByEntry);\n\t\t\t}\n\t\t}\n\t\treturn manualChunkAliasByEntry;\n\t}\n\n\tprivate assignChunkIds(\n\t\tchunks: readonly Chunk[],\n\t\tinputBase: string,\n\t\taddons: Addons,\n\t\tbundle: OutputBundleWithPlaceholders\n\t): void {\n\t\tconst entryChunks: Chunk[] = [];\n\t\tconst otherChunks: Chunk[] = [];\n\t\tfor (const chunk of chunks) {\n\t\t\t(chunk.facadeModule && chunk.facadeModule.isUserDefinedEntryPoint\n\t\t\t\t? entryChunks\n\t\t\t\t: otherChunks\n\t\t\t).push(chunk);\n\t\t}\n\n\t\t// make sure entry chunk names take precedence with regard to deconflicting\n\t\tconst chunksForNaming = entryChunks.concat(otherChunks);\n\t\tfor (const chunk of chunksForNaming) {\n\t\t\tif (this.outputOptions.file) {\n\t\t\t\tchunk.id = basename(this.outputOptions.file);\n\t\t\t} else if (this.outputOptions.preserveModules) {\n\t\t\t\tchunk.id = chunk.generateIdPreserveModules(\n\t\t\t\t\tinputBase,\n\t\t\t\t\tthis.outputOptions,\n\t\t\t\t\tbundle,\n\t\t\t\t\tthis.unsetOptions\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tchunk.id = chunk.generateId(addons, this.outputOptions, bundle, true);\n\t\t\t}\n\t\t\tbundle[chunk.id] = FILE_PLACEHOLDER;\n\t\t}\n\t}\n\n\tprivate assignManualChunks(getManualChunk: GetManualChunk): Map {\n\t\tconst manualChunkAliasesWithEntry: [alias: string, module: Module][] = [];\n\t\tconst manualChunksApi = {\n\t\t\tgetModuleIds: () => this.graph.modulesById.keys(),\n\t\t\tgetModuleInfo: this.graph.getModuleInfo\n\t\t};\n\t\tfor (const module of this.graph.modulesById.values()) {\n\t\t\tif (module instanceof Module) {\n\t\t\t\tconst manualChunkAlias = getManualChunk(module.id, manualChunksApi);\n\t\t\t\tif (typeof manualChunkAlias === 'string') {\n\t\t\t\t\tmanualChunkAliasesWithEntry.push([manualChunkAlias, module]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tmanualChunkAliasesWithEntry.sort(([aliasA], [aliasB]) =>\n\t\t\taliasA > aliasB ? 1 : aliasA < aliasB ? -1 : 0\n\t\t);\n\t\tconst manualChunkAliasByEntry = new Map();\n\t\tfor (const [alias, module] of manualChunkAliasesWithEntry) {\n\t\t\taddModuleToManualChunk(alias, module, manualChunkAliasByEntry);\n\t\t}\n\t\treturn manualChunkAliasByEntry;\n\t}\n\n\tprivate finaliseAssets(outputBundle: OutputBundleWithPlaceholders): void {\n\t\tfor (const file of Object.values(outputBundle)) {\n\t\t\tif (!file.type) {\n\t\t\t\twarnDeprecation(\n\t\t\t\t\t'A plugin is directly adding properties to the bundle object in the \"generateBundle\" hook. This is deprecated and will be removed in a future Rollup version, please use \"this.emitFile\" instead.',\n\t\t\t\t\ttrue,\n\t\t\t\t\tthis.inputOptions\n\t\t\t\t);\n\t\t\t\t(file as OutputAsset).type = 'asset';\n\t\t\t}\n\t\t\tif (this.outputOptions.validate && 'code' in file) {\n\t\t\t\ttry {\n\t\t\t\t\tthis.graph.contextParse(file.code, {\n\t\t\t\t\t\tallowHashBang: true,\n\t\t\t\t\t\tecmaVersion: 'latest'\n\t\t\t\t\t});\n\t\t\t\t} catch (err: any) {\n\t\t\t\t\tthis.inputOptions.onwarn(errChunkInvalid(file, err));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tthis.pluginDriver.finaliseAssets();\n\t}\n\n\tprivate async generateChunks(): Promise {\n\t\tconst { manualChunks } = this.outputOptions;\n\t\tconst manualChunkAliasByEntry =\n\t\t\ttypeof manualChunks === 'object'\n\t\t\t\t? await this.addManualChunks(manualChunks)\n\t\t\t\t: this.assignManualChunks(manualChunks);\n\t\tconst chunks: Chunk[] = [];\n\t\tconst chunkByModule = new Map();\n\t\tfor (const { alias, modules } of this.outputOptions.inlineDynamicImports\n\t\t\t? [{ alias: null, modules: getIncludedModules(this.graph.modulesById) }]\n\t\t\t: this.outputOptions.preserveModules\n\t\t\t? getIncludedModules(this.graph.modulesById).map(module => ({\n\t\t\t\t\talias: null,\n\t\t\t\t\tmodules: [module]\n\t\t\t }))\n\t\t\t: getChunkAssignments(this.graph.entryModules, manualChunkAliasByEntry)) {\n\t\t\tsortByExecutionOrder(modules);\n\t\t\tconst chunk = new Chunk(\n\t\t\t\tmodules,\n\t\t\t\tthis.inputOptions,\n\t\t\t\tthis.outputOptions,\n\t\t\t\tthis.unsetOptions,\n\t\t\t\tthis.pluginDriver,\n\t\t\t\tthis.graph.modulesById,\n\t\t\t\tchunkByModule,\n\t\t\t\tthis.facadeChunkByModule,\n\t\t\t\tthis.includedNamespaces,\n\t\t\t\talias\n\t\t\t);\n\t\t\tchunks.push(chunk);\n\t\t\tfor (const module of modules) {\n\t\t\t\tchunkByModule.set(module, chunk);\n\t\t\t}\n\t\t}\n\t\tfor (const chunk of chunks) {\n\t\t\tchunk.link();\n\t\t}\n\t\tconst facades: Chunk[] = [];\n\t\tfor (const chunk of chunks) {\n\t\t\tfacades.push(...chunk.generateFacades());\n\t\t}\n\t\treturn [...chunks, ...facades];\n\t}\n\n\tprivate prerenderChunks(\n\t\tchunks: readonly Chunk[],\n\t\tinputBase: string,\n\t\tsnippets: GenerateCodeSnippets\n\t): void {\n\t\tfor (const chunk of chunks) {\n\t\t\tchunk.generateExports();\n\t\t}\n\t\tfor (const chunk of chunks) {\n\t\t\tchunk.preRender(this.outputOptions, inputBase, snippets);\n\t\t}\n\t}\n}\n\nfunction getAbsoluteEntryModulePaths(chunks: readonly Chunk[]): string[] {\n\tconst absoluteEntryModulePaths: string[] = [];\n\tfor (const chunk of chunks) {\n\t\tfor (const entryModule of chunk.entryModules) {\n\t\t\tif (isAbsolute(entryModule.id)) {\n\t\t\t\tabsoluteEntryModulePaths.push(entryModule.id);\n\t\t\t}\n\t\t}\n\t}\n\treturn absoluteEntryModulePaths;\n}\n\nfunction validateOptionsForMultiChunkOutput(\n\toutputOptions: NormalizedOutputOptions,\n\tonWarn: WarningHandler\n) {\n\tif (outputOptions.format === 'umd' || outputOptions.format === 'iife')\n\t\treturn error(\n\t\t\terrInvalidOption(\n\t\t\t\t'output.format',\n\t\t\t\t'outputformat',\n\t\t\t\t'UMD and IIFE output formats are not supported for code-splitting builds',\n\t\t\t\toutputOptions.format\n\t\t\t)\n\t\t);\n\tif (typeof outputOptions.file === 'string')\n\t\treturn error(\n\t\t\terrInvalidOption(\n\t\t\t\t'output.file',\n\t\t\t\t'outputdir',\n\t\t\t\t'when building multiple chunks, the \"output.dir\" option must be used, not \"output.file\". To inline dynamic imports, set the \"inlineDynamicImports\" option'\n\t\t\t)\n\t\t);\n\tif (outputOptions.sourcemapFile)\n\t\treturn error(\n\t\t\terrInvalidOption(\n\t\t\t\t'output.sourcemapFile',\n\t\t\t\t'outputsourcemapfile',\n\t\t\t\t'\"output.sourcemapFile\" is only supported for single-file builds'\n\t\t\t)\n\t\t);\n\tif (!outputOptions.amd.autoId && outputOptions.amd.id)\n\t\tonWarn(\n\t\t\terrInvalidOption(\n\t\t\t\t'output.amd.id',\n\t\t\t\t'outputamd',\n\t\t\t\t'this option is only properly supported for single-file builds. Use \"output.amd.autoId\" and \"output.amd.basePath\" instead'\n\t\t\t)\n\t\t);\n}\n\nfunction getIncludedModules(modulesById: ReadonlyMap): Module[] {\n\treturn [...modulesById.values()].filter(\n\t\t(module): module is Module =>\n\t\t\tmodule instanceof Module &&\n\t\t\t(module.isIncluded() || module.info.isEntry || module.includedDynamicImporters.length > 0)\n\t);\n}\n\nfunction addModuleToManualChunk(\n\talias: string,\n\tmodule: Module,\n\tmanualChunkAliasByEntry: Map\n): void {\n\tconst existingAlias = manualChunkAliasByEntry.get(module);\n\tif (typeof existingAlias === 'string' && existingAlias !== alias) {\n\t\treturn error(errCannotAssignModuleToChunk(module.id, alias, existingAlias));\n\t}\n\tmanualChunkAliasByEntry.set(module, alias);\n}\n","import { dirname } from './path';\n\n// ported from https://github.com/substack/node-commondir\nexport default function commondir(files: readonly string[]): string {\n\tif (files.length === 0) return '/';\n\tif (files.length === 1) return dirname(files[0]);\n\tconst commonSegments = files.slice(1).reduce((commonSegments, file) => {\n\t\tconst pathSegements = file.split(/\\/+|\\\\+/);\n\t\tlet i;\n\t\tfor (\n\t\t\ti = 0;\n\t\t\tcommonSegments[i] === pathSegements[i] &&\n\t\t\ti < Math.min(commonSegments.length, pathSegements.length);\n\t\t\ti++\n\t\t);\n\t\treturn commonSegments.slice(0, i);\n\t}, files[0].split(/\\/+|\\\\+/));\n\n\t// Windows correctly handles paths with forward-slashes\n\treturn commonSegments.length > 1 ? commonSegments.join('/') : '/';\n}\n","// This file was generated. Do not modify manually!\nvar astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 370, 1, 154, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 161, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 193, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 406, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 19306, 9, 87, 9, 39, 4, 60, 6, 26, 9, 1014, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4706, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 262, 6, 10, 9, 357, 0, 62, 13, 1495, 6, 110, 6, 6, 9, 4759, 9, 787719, 239];\n\n// This file was generated. Do not modify manually!\nvar astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 68, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 349, 41, 7, 1, 79, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 85, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 159, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 264, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 190, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1070, 4050, 582, 8634, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 689, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 43, 8, 8936, 3, 2, 6, 2, 1, 2, 290, 46, 2, 18, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 30, 482, 44, 11, 6, 17, 0, 322, 29, 19, 43, 1269, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4152, 8, 221, 3, 5761, 15, 7472, 3104, 541, 1507, 4938];\n\n// This file was generated. Do not modify manually!\nvar nonASCIIidentifierChars = \"\\u200c\\u200d\\xb7\\u0300-\\u036f\\u0387\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u064b-\\u0669\\u0670\\u06d6-\\u06dc\\u06df-\\u06e4\\u06e7\\u06e8\\u06ea-\\u06ed\\u06f0-\\u06f9\\u0711\\u0730-\\u074a\\u07a6-\\u07b0\\u07c0-\\u07c9\\u07eb-\\u07f3\\u07fd\\u0816-\\u0819\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0859-\\u085b\\u0898-\\u089f\\u08ca-\\u08e1\\u08e3-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09cb-\\u09cd\\u09d7\\u09e2\\u09e3\\u09e6-\\u09ef\\u09fe\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2\\u0ae3\\u0ae6-\\u0aef\\u0afa-\\u0aff\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b55-\\u0b57\\u0b62\\u0b63\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c00-\\u0c04\\u0c3c\\u0c3e-\\u0c44\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62\\u0c63\\u0c66-\\u0c6f\\u0c81-\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2\\u0ce3\\u0ce6-\\u0cef\\u0d00-\\u0d03\\u0d3b\\u0d3c\\u0d3e-\\u0d44\\u0d46-\\u0d48\\u0d4a-\\u0d4d\\u0d57\\u0d62\\u0d63\\u0d66-\\u0d6f\\u0d81-\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0de6-\\u0def\\u0df2\\u0df3\\u0e31\\u0e34-\\u0e3a\\u0e47-\\u0e4e\\u0e50-\\u0e59\\u0eb1\\u0eb4-\\u0ebc\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f3e\\u0f3f\\u0f71-\\u0f84\\u0f86\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u102b-\\u103e\\u1040-\\u1049\\u1056-\\u1059\\u105e-\\u1060\\u1062-\\u1064\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u1369-\\u1371\\u1712-\\u1715\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17b4-\\u17d3\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u180f-\\u1819\\u18a9\\u1920-\\u192b\\u1930-\\u193b\\u1946-\\u194f\\u19d0-\\u19da\\u1a17-\\u1a1b\\u1a55-\\u1a5e\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1ab0-\\u1abd\\u1abf-\\u1ace\\u1b00-\\u1b04\\u1b34-\\u1b44\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1b80-\\u1b82\\u1ba1-\\u1bad\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c24-\\u1c37\\u1c40-\\u1c49\\u1c50-\\u1c59\\u1cd0-\\u1cd2\\u1cd4-\\u1ce8\\u1ced\\u1cf4\\u1cf7-\\u1cf9\\u1dc0-\\u1dff\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2cef-\\u2cf1\\u2d7f\\u2de0-\\u2dff\\u302a-\\u302f\\u3099\\u309a\\ua620-\\ua629\\ua66f\\ua674-\\ua67d\\ua69e\\ua69f\\ua6f0\\ua6f1\\ua802\\ua806\\ua80b\\ua823-\\ua827\\ua82c\\ua880\\ua881\\ua8b4-\\ua8c5\\ua8d0-\\ua8d9\\ua8e0-\\ua8f1\\ua8ff-\\ua909\\ua926-\\ua92d\\ua947-\\ua953\\ua980-\\ua983\\ua9b3-\\ua9c0\\ua9d0-\\ua9d9\\ua9e5\\ua9f0-\\ua9f9\\uaa29-\\uaa36\\uaa43\\uaa4c\\uaa4d\\uaa50-\\uaa59\\uaa7b-\\uaa7d\\uaab0\\uaab2-\\uaab4\\uaab7\\uaab8\\uaabe\\uaabf\\uaac1\\uaaeb-\\uaaef\\uaaf5\\uaaf6\\uabe3-\\uabea\\uabec\\uabed\\uabf0-\\uabf9\\ufb1e\\ufe00-\\ufe0f\\ufe20-\\ufe2f\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f\";\n\n// This file was generated. Do not modify manually!\nvar nonASCIIidentifierStartChars = \"\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u037f\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u052f\\u0531-\\u0556\\u0559\\u0560-\\u0588\\u05d0-\\u05ea\\u05ef-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u0860-\\u086a\\u0870-\\u0887\\u0889-\\u088e\\u08a0-\\u08c9\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u09fc\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0af9\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c39\\u0c3d\\u0c58-\\u0c5a\\u0c5d\\u0c60\\u0c61\\u0c80\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cdd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d04-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d54-\\u0d56\\u0d5f-\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e86-\\u0e8a\\u0e8c-\\u0ea3\\u0ea5\\u0ea7-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f5\\u13f8-\\u13fd\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f8\\u1700-\\u1711\\u171f-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1878\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191e\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19b0-\\u19c9\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4c\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1c80-\\u1c88\\u1c90-\\u1cba\\u1cbd-\\u1cbf\\u1ce9-\\u1cec\\u1cee-\\u1cf3\\u1cf5\\u1cf6\\u1cfa\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2118-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309b-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312f\\u3131-\\u318e\\u31a0-\\u31bf\\u31f0-\\u31ff\\u3400-\\u4dbf\\u4e00-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua69d\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua7ca\\ua7d0\\ua7d1\\ua7d3\\ua7d5-\\ua7d9\\ua7f2-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua8fd\\ua8fe\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\ua9e0-\\ua9e4\\ua9e6-\\ua9ef\\ua9fa-\\ua9fe\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa7e-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uab30-\\uab5a\\uab5c-\\uab69\\uab70-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc\";\n\n// These are a run-length and offset encoded representation of the\n\n// Reserved word lists for various dialects of the language\n\nvar reservedWords = {\n 3: \"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile\",\n 5: \"class enum extends super const export import\",\n 6: \"enum\",\n strict: \"implements interface let package private protected public static yield\",\n strictBind: \"eval arguments\"\n};\n\n// And the keywords\n\nvar ecma5AndLessKeywords = \"break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this\";\n\nvar keywords$1 = {\n 5: ecma5AndLessKeywords,\n \"5module\": ecma5AndLessKeywords + \" export import\",\n 6: ecma5AndLessKeywords + \" const class extends export import super\"\n};\n\nvar keywordRelationalOperator = /^in(stanceof)?$/;\n\n// ## Character categories\n\nvar nonASCIIidentifierStart = new RegExp(\"[\" + nonASCIIidentifierStartChars + \"]\");\nvar nonASCIIidentifier = new RegExp(\"[\" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + \"]\");\n\n// This has a complexity linear to the value of the code. The\n// assumption is that looking up astral identifier characters is\n// rare.\nfunction isInAstralSet(code, set) {\n var pos = 0x10000;\n for (var i = 0; i < set.length; i += 2) {\n pos += set[i];\n if (pos > code) { return false }\n pos += set[i + 1];\n if (pos >= code) { return true }\n }\n}\n\n// Test whether a given character code starts an identifier.\n\nfunction isIdentifierStart(code, astral) {\n if (code < 65) { return code === 36 }\n if (code < 91) { return true }\n if (code < 97) { return code === 95 }\n if (code < 123) { return true }\n if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code)) }\n if (astral === false) { return false }\n return isInAstralSet(code, astralIdentifierStartCodes)\n}\n\n// Test whether a given character is part of an identifier.\n\nfunction isIdentifierChar(code, astral) {\n if (code < 48) { return code === 36 }\n if (code < 58) { return true }\n if (code < 65) { return false }\n if (code < 91) { return true }\n if (code < 97) { return code === 95 }\n if (code < 123) { return true }\n if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)) }\n if (astral === false) { return false }\n return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes)\n}\n\n// ## Token types\n\n// The assignment of fine-grained, information-carrying type objects\n// allows the tokenizer to store the information it has about a\n// token in a way that is very cheap for the parser to look up.\n\n// All token type variables start with an underscore, to make them\n// easy to recognize.\n\n// The `beforeExpr` property is used to disambiguate between regular\n// expressions and divisions. It is set on all token types that can\n// be followed by an expression (thus, a slash after them would be a\n// regular expression).\n//\n// The `startsExpr` property is used to check if the token ends a\n// `yield` expression. It is set on all token types that either can\n// directly start an expression (like a quotation mark) or can\n// continue an expression (like the body of a string).\n//\n// `isLoop` marks a keyword as starting a loop, which is important\n// to know when parsing a label, in order to allow or disallow\n// continue jumps to that label.\n\nvar TokenType = function TokenType(label, conf) {\n if ( conf === void 0 ) conf = {};\n\n this.label = label;\n this.keyword = conf.keyword;\n this.beforeExpr = !!conf.beforeExpr;\n this.startsExpr = !!conf.startsExpr;\n this.isLoop = !!conf.isLoop;\n this.isAssign = !!conf.isAssign;\n this.prefix = !!conf.prefix;\n this.postfix = !!conf.postfix;\n this.binop = conf.binop || null;\n this.updateContext = null;\n};\n\nfunction binop(name, prec) {\n return new TokenType(name, {beforeExpr: true, binop: prec})\n}\nvar beforeExpr = {beforeExpr: true}, startsExpr = {startsExpr: true};\n\n// Map keyword names to token types.\n\nvar keywords = {};\n\n// Succinct definitions of keyword token types\nfunction kw(name, options) {\n if ( options === void 0 ) options = {};\n\n options.keyword = name;\n return keywords[name] = new TokenType(name, options)\n}\n\nvar types$1 = {\n num: new TokenType(\"num\", startsExpr),\n regexp: new TokenType(\"regexp\", startsExpr),\n string: new TokenType(\"string\", startsExpr),\n name: new TokenType(\"name\", startsExpr),\n privateId: new TokenType(\"privateId\", startsExpr),\n eof: new TokenType(\"eof\"),\n\n // Punctuation token types.\n bracketL: new TokenType(\"[\", {beforeExpr: true, startsExpr: true}),\n bracketR: new TokenType(\"]\"),\n braceL: new TokenType(\"{\", {beforeExpr: true, startsExpr: true}),\n braceR: new TokenType(\"}\"),\n parenL: new TokenType(\"(\", {beforeExpr: true, startsExpr: true}),\n parenR: new TokenType(\")\"),\n comma: new TokenType(\",\", beforeExpr),\n semi: new TokenType(\";\", beforeExpr),\n colon: new TokenType(\":\", beforeExpr),\n dot: new TokenType(\".\"),\n question: new TokenType(\"?\", beforeExpr),\n questionDot: new TokenType(\"?.\"),\n arrow: new TokenType(\"=>\", beforeExpr),\n template: new TokenType(\"template\"),\n invalidTemplate: new TokenType(\"invalidTemplate\"),\n ellipsis: new TokenType(\"...\", beforeExpr),\n backQuote: new TokenType(\"`\", startsExpr),\n dollarBraceL: new TokenType(\"${\", {beforeExpr: true, startsExpr: true}),\n\n // Operators. These carry several kinds of properties to help the\n // parser use them properly (the presence of these properties is\n // what categorizes them as operators).\n //\n // `binop`, when present, specifies that this operator is a binary\n // operator, and will refer to its precedence.\n //\n // `prefix` and `postfix` mark the operator as a prefix or postfix\n // unary operator.\n //\n // `isAssign` marks all of `=`, `+=`, `-=` etcetera, which act as\n // binary operators with a very low precedence, that should result\n // in AssignmentExpression nodes.\n\n eq: new TokenType(\"=\", {beforeExpr: true, isAssign: true}),\n assign: new TokenType(\"_=\", {beforeExpr: true, isAssign: true}),\n incDec: new TokenType(\"++/--\", {prefix: true, postfix: true, startsExpr: true}),\n prefix: new TokenType(\"!/~\", {beforeExpr: true, prefix: true, startsExpr: true}),\n logicalOR: binop(\"||\", 1),\n logicalAND: binop(\"&&\", 2),\n bitwiseOR: binop(\"|\", 3),\n bitwiseXOR: binop(\"^\", 4),\n bitwiseAND: binop(\"&\", 5),\n equality: binop(\"==/!=/===/!==\", 6),\n relational: binop(\"/<=/>=\", 7),\n bitShift: binop(\"<>/>>>\", 8),\n plusMin: new TokenType(\"+/-\", {beforeExpr: true, binop: 9, prefix: true, startsExpr: true}),\n modulo: binop(\"%\", 10),\n star: binop(\"*\", 10),\n slash: binop(\"/\", 10),\n starstar: new TokenType(\"**\", {beforeExpr: true}),\n coalesce: binop(\"??\", 1),\n\n // Keyword token types.\n _break: kw(\"break\"),\n _case: kw(\"case\", beforeExpr),\n _catch: kw(\"catch\"),\n _continue: kw(\"continue\"),\n _debugger: kw(\"debugger\"),\n _default: kw(\"default\", beforeExpr),\n _do: kw(\"do\", {isLoop: true, beforeExpr: true}),\n _else: kw(\"else\", beforeExpr),\n _finally: kw(\"finally\"),\n _for: kw(\"for\", {isLoop: true}),\n _function: kw(\"function\", startsExpr),\n _if: kw(\"if\"),\n _return: kw(\"return\", beforeExpr),\n _switch: kw(\"switch\"),\n _throw: kw(\"throw\", beforeExpr),\n _try: kw(\"try\"),\n _var: kw(\"var\"),\n _const: kw(\"const\"),\n _while: kw(\"while\", {isLoop: true}),\n _with: kw(\"with\"),\n _new: kw(\"new\", {beforeExpr: true, startsExpr: true}),\n _this: kw(\"this\", startsExpr),\n _super: kw(\"super\", startsExpr),\n _class: kw(\"class\", startsExpr),\n _extends: kw(\"extends\", beforeExpr),\n _export: kw(\"export\"),\n _import: kw(\"import\", startsExpr),\n _null: kw(\"null\", startsExpr),\n _true: kw(\"true\", startsExpr),\n _false: kw(\"false\", startsExpr),\n _in: kw(\"in\", {beforeExpr: true, binop: 7}),\n _instanceof: kw(\"instanceof\", {beforeExpr: true, binop: 7}),\n _typeof: kw(\"typeof\", {beforeExpr: true, prefix: true, startsExpr: true}),\n _void: kw(\"void\", {beforeExpr: true, prefix: true, startsExpr: true}),\n _delete: kw(\"delete\", {beforeExpr: true, prefix: true, startsExpr: true})\n};\n\n// Matches a whole line break (where CRLF is considered a single\n// line break). Used to count lines.\n\nvar lineBreak = /\\r\\n?|\\n|\\u2028|\\u2029/;\nvar lineBreakG = new RegExp(lineBreak.source, \"g\");\n\nfunction isNewLine(code) {\n return code === 10 || code === 13 || code === 0x2028 || code === 0x2029\n}\n\nfunction nextLineBreak(code, from, end) {\n if ( end === void 0 ) end = code.length;\n\n for (var i = from; i < end; i++) {\n var next = code.charCodeAt(i);\n if (isNewLine(next))\n { return i < end - 1 && next === 13 && code.charCodeAt(i + 1) === 10 ? i + 2 : i + 1 }\n }\n return -1\n}\n\nvar nonASCIIwhitespace = /[\\u1680\\u2000-\\u200a\\u202f\\u205f\\u3000\\ufeff]/;\n\nvar skipWhiteSpace = /(?:\\s|\\/\\/.*|\\/\\*[^]*?\\*\\/)*/g;\n\nvar ref = Object.prototype;\nvar hasOwnProperty = ref.hasOwnProperty;\nvar toString = ref.toString;\n\nvar hasOwn = Object.hasOwn || (function (obj, propName) { return (\n hasOwnProperty.call(obj, propName)\n); });\n\nvar isArray = Array.isArray || (function (obj) { return (\n toString.call(obj) === \"[object Array]\"\n); });\n\nfunction wordsRegexp(words) {\n return new RegExp(\"^(?:\" + words.replace(/ /g, \"|\") + \")$\")\n}\n\nfunction codePointToString(code) {\n // UTF-16 Decoding\n if (code <= 0xFFFF) { return String.fromCharCode(code) }\n code -= 0x10000;\n return String.fromCharCode((code >> 10) + 0xD800, (code & 1023) + 0xDC00)\n}\n\nvar loneSurrogate = /(?:[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF])/;\n\n// These are used when `options.locations` is on, for the\n// `startLoc` and `endLoc` properties.\n\nvar Position = function Position(line, col) {\n this.line = line;\n this.column = col;\n};\n\nPosition.prototype.offset = function offset (n) {\n return new Position(this.line, this.column + n)\n};\n\nvar SourceLocation = function SourceLocation(p, start, end) {\n this.start = start;\n this.end = end;\n if (p.sourceFile !== null) { this.source = p.sourceFile; }\n};\n\n// The `getLineInfo` function is mostly useful when the\n// `locations` option is off (for performance reasons) and you\n// want to find the line/column position for a given character\n// offset. `input` should be the code string that the offset refers\n// into.\n\nfunction getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n var nextBreak = nextLineBreak(input, cur, offset);\n if (nextBreak < 0) { return new Position(line, offset - cur) }\n ++line;\n cur = nextBreak;\n }\n}\n\n// A second argument must be given to configure the parser process.\n// These options are recognized (only `ecmaVersion` is required):\n\nvar defaultOptions = {\n // `ecmaVersion` indicates the ECMAScript version to parse. Must be\n // either 3, 5, 6 (or 2015), 7 (2016), 8 (2017), 9 (2018), 10\n // (2019), 11 (2020), 12 (2021), 13 (2022), or `\"latest\"` (the\n // latest version the library supports). This influences support\n // for strict mode, the set of reserved words, and support for\n // new syntax features.\n ecmaVersion: null,\n // `sourceType` indicates the mode the code should be parsed in.\n // Can be either `\"script\"` or `\"module\"`. This influences global\n // strict mode and parsing of `import` and `export` declarations.\n sourceType: \"script\",\n // `onInsertedSemicolon` can be a callback that will be called\n // when a semicolon is automatically inserted. It will be passed\n // the position of the comma as an offset, and if `locations` is\n // enabled, it is given the location as a `{line, column}` object\n // as second argument.\n onInsertedSemicolon: null,\n // `onTrailingComma` is similar to `onInsertedSemicolon`, but for\n // trailing commas.\n onTrailingComma: null,\n // By default, reserved words are only enforced if ecmaVersion >= 5.\n // Set `allowReserved` to a boolean value to explicitly turn this on\n // an off. When this option has the value \"never\", reserved words\n // and keywords can also not be used as property names.\n allowReserved: null,\n // When enabled, a return at the top level is not considered an\n // error.\n allowReturnOutsideFunction: false,\n // When enabled, import/export statements are not constrained to\n // appearing at the top of the program, and an import.meta expression\n // in a script isn't considered an error.\n allowImportExportEverywhere: false,\n // By default, await identifiers are allowed to appear at the top-level scope only if ecmaVersion >= 2022.\n // When enabled, await identifiers are allowed to appear at the top-level scope,\n // but they are still not allowed in non-async functions.\n allowAwaitOutsideFunction: null,\n // When enabled, super identifiers are not constrained to\n // appearing in methods and do not raise an error when they appear elsewhere.\n allowSuperOutsideMethod: null,\n // When enabled, hashbang directive in the beginning of file\n // is allowed and treated as a line comment.\n allowHashBang: false,\n // When `locations` is on, `loc` properties holding objects with\n // `start` and `end` properties in `{line, column}` form (with\n // line being 1-based and column 0-based) will be attached to the\n // nodes.\n locations: false,\n // A function can be passed as `onToken` option, which will\n // cause Acorn to call that function with object in the same\n // format as tokens returned from `tokenizer().getToken()`. Note\n // that you are not allowed to call the parser from the\n // callback—that will corrupt its internal state.\n onToken: null,\n // A function can be passed as `onComment` option, which will\n // cause Acorn to call that function with `(block, text, start,\n // end)` parameters whenever a comment is skipped. `block` is a\n // boolean indicating whether this is a block (`/* */`) comment,\n // `text` is the content of the comment, and `start` and `end` are\n // character offsets that denote the start and end of the comment.\n // When the `locations` option is on, two more parameters are\n // passed, the full `{line, column}` locations of the start and\n // end of the comments. Note that you are not allowed to call the\n // parser from the callback—that will corrupt its internal state.\n onComment: null,\n // Nodes have their start and end characters offsets recorded in\n // `start` and `end` properties (directly on the node, rather than\n // the `loc` object, which holds line/column data. To also add a\n // [semi-standardized][range] `range` property holding a `[start,\n // end]` array with the same numbers, set the `ranges` option to\n // `true`.\n //\n // [range]: https://bugzilla.mozilla.org/show_bug.cgi?id=745678\n ranges: false,\n // It is possible to parse multiple files into a single AST by\n // passing the tree produced by parsing the first file as\n // `program` option in subsequent parses. This will add the\n // toplevel forms of the parsed file to the `Program` (top) node\n // of an existing parse tree.\n program: null,\n // When `locations` is on, you can pass this to record the source\n // file in every node's `loc` object.\n sourceFile: null,\n // This value, if given, is stored in every node, whether\n // `locations` is on or off.\n directSourceFile: null,\n // When enabled, parenthesized expressions are represented by\n // (non-standard) ParenthesizedExpression nodes\n preserveParens: false\n};\n\n// Interpret and default an options object\n\nvar warnedAboutEcmaVersion = false;\n\nfunction getOptions(opts) {\n var options = {};\n\n for (var opt in defaultOptions)\n { options[opt] = opts && hasOwn(opts, opt) ? opts[opt] : defaultOptions[opt]; }\n\n if (options.ecmaVersion === \"latest\") {\n options.ecmaVersion = 1e8;\n } else if (options.ecmaVersion == null) {\n if (!warnedAboutEcmaVersion && typeof console === \"object\" && console.warn) {\n warnedAboutEcmaVersion = true;\n console.warn(\"Since Acorn 8.0.0, options.ecmaVersion is required.\\nDefaulting to 2020, but this will stop working in the future.\");\n }\n options.ecmaVersion = 11;\n } else if (options.ecmaVersion >= 2015) {\n options.ecmaVersion -= 2009;\n }\n\n if (options.allowReserved == null)\n { options.allowReserved = options.ecmaVersion < 5; }\n\n if (isArray(options.onToken)) {\n var tokens = options.onToken;\n options.onToken = function (token) { return tokens.push(token); };\n }\n if (isArray(options.onComment))\n { options.onComment = pushComment(options, options.onComment); }\n\n return options\n}\n\nfunction pushComment(options, array) {\n return function(block, text, start, end, startLoc, endLoc) {\n var comment = {\n type: block ? \"Block\" : \"Line\",\n value: text,\n start: start,\n end: end\n };\n if (options.locations)\n { comment.loc = new SourceLocation(this, startLoc, endLoc); }\n if (options.ranges)\n { comment.range = [start, end]; }\n array.push(comment);\n }\n}\n\n// Each scope gets a bitset that may contain these flags\nvar\n SCOPE_TOP = 1,\n SCOPE_FUNCTION = 2,\n SCOPE_ASYNC = 4,\n SCOPE_GENERATOR = 8,\n SCOPE_ARROW = 16,\n SCOPE_SIMPLE_CATCH = 32,\n SCOPE_SUPER = 64,\n SCOPE_DIRECT_SUPER = 128,\n SCOPE_CLASS_STATIC_BLOCK = 256,\n SCOPE_VAR = SCOPE_TOP | SCOPE_FUNCTION | SCOPE_CLASS_STATIC_BLOCK;\n\nfunction functionFlags(async, generator) {\n return SCOPE_FUNCTION | (async ? SCOPE_ASYNC : 0) | (generator ? SCOPE_GENERATOR : 0)\n}\n\n// Used in checkLVal* and declareName to determine the type of a binding\nvar\n BIND_NONE = 0, // Not a binding\n BIND_VAR = 1, // Var-style binding\n BIND_LEXICAL = 2, // Let- or const-style binding\n BIND_FUNCTION = 3, // Function declaration\n BIND_SIMPLE_CATCH = 4, // Simple (identifier pattern) catch binding\n BIND_OUTSIDE = 5; // Special case for function names as bound inside the function\n\nvar Parser = function Parser(options, input, startPos) {\n this.options = options = getOptions(options);\n this.sourceFile = options.sourceFile;\n this.keywords = wordsRegexp(keywords$1[options.ecmaVersion >= 6 ? 6 : options.sourceType === \"module\" ? \"5module\" : 5]);\n var reserved = \"\";\n if (options.allowReserved !== true) {\n reserved = reservedWords[options.ecmaVersion >= 6 ? 6 : options.ecmaVersion === 5 ? 5 : 3];\n if (options.sourceType === \"module\") { reserved += \" await\"; }\n }\n this.reservedWords = wordsRegexp(reserved);\n var reservedStrict = (reserved ? reserved + \" \" : \"\") + reservedWords.strict;\n this.reservedWordsStrict = wordsRegexp(reservedStrict);\n this.reservedWordsStrictBind = wordsRegexp(reservedStrict + \" \" + reservedWords.strictBind);\n this.input = String(input);\n\n // Used to signal to callers of `readWord1` whether the word\n // contained any escape sequences. This is needed because words with\n // escape sequences must not be interpreted as keywords.\n this.containsEsc = false;\n\n // Set up token state\n\n // The current position of the tokenizer in the input.\n if (startPos) {\n this.pos = startPos;\n this.lineStart = this.input.lastIndexOf(\"\\n\", startPos - 1) + 1;\n this.curLine = this.input.slice(0, this.lineStart).split(lineBreak).length;\n } else {\n this.pos = this.lineStart = 0;\n this.curLine = 1;\n }\n\n // Properties of the current token:\n // Its type\n this.type = types$1.eof;\n // For tokens that include more information than their type, the value\n this.value = null;\n // Its start and end offset\n this.start = this.end = this.pos;\n // And, if locations are used, the {line, column} object\n // corresponding to those offsets\n this.startLoc = this.endLoc = this.curPosition();\n\n // Position information for the previous token\n this.lastTokEndLoc = this.lastTokStartLoc = null;\n this.lastTokStart = this.lastTokEnd = this.pos;\n\n // The context stack is used to superficially track syntactic\n // context to predict whether a regular expression is allowed in a\n // given position.\n this.context = this.initialContext();\n this.exprAllowed = true;\n\n // Figure out if it's a module code.\n this.inModule = options.sourceType === \"module\";\n this.strict = this.inModule || this.strictDirective(this.pos);\n\n // Used to signify the start of a potential arrow function\n this.potentialArrowAt = -1;\n this.potentialArrowInForAwait = false;\n\n // Positions to delayed-check that yield/await does not exist in default parameters.\n this.yieldPos = this.awaitPos = this.awaitIdentPos = 0;\n // Labels in scope.\n this.labels = [];\n // Thus-far undefined exports.\n this.undefinedExports = Object.create(null);\n\n // If enabled, skip leading hashbang line.\n if (this.pos === 0 && options.allowHashBang && this.input.slice(0, 2) === \"#!\")\n { this.skipLineComment(2); }\n\n // Scope tracking for duplicate variable names (see scope.js)\n this.scopeStack = [];\n this.enterScope(SCOPE_TOP);\n\n // For RegExp validation\n this.regexpState = null;\n\n // The stack of private names.\n // Each element has two properties: 'declared' and 'used'.\n // When it exited from the outermost class definition, all used private names must be declared.\n this.privateNameStack = [];\n};\n\nvar prototypeAccessors = { inFunction: { configurable: true },inGenerator: { configurable: true },inAsync: { configurable: true },canAwait: { configurable: true },allowSuper: { configurable: true },allowDirectSuper: { configurable: true },treatFunctionsAsVar: { configurable: true },allowNewDotTarget: { configurable: true },inClassStaticBlock: { configurable: true } };\n\nParser.prototype.parse = function parse () {\n var node = this.options.program || this.startNode();\n this.nextToken();\n return this.parseTopLevel(node)\n};\n\nprototypeAccessors.inFunction.get = function () { return (this.currentVarScope().flags & SCOPE_FUNCTION) > 0 };\n\nprototypeAccessors.inGenerator.get = function () { return (this.currentVarScope().flags & SCOPE_GENERATOR) > 0 && !this.currentVarScope().inClassFieldInit };\n\nprototypeAccessors.inAsync.get = function () { return (this.currentVarScope().flags & SCOPE_ASYNC) > 0 && !this.currentVarScope().inClassFieldInit };\n\nprototypeAccessors.canAwait.get = function () {\n for (var i = this.scopeStack.length - 1; i >= 0; i--) {\n var scope = this.scopeStack[i];\n if (scope.inClassFieldInit || scope.flags & SCOPE_CLASS_STATIC_BLOCK) { return false }\n if (scope.flags & SCOPE_FUNCTION) { return (scope.flags & SCOPE_ASYNC) > 0 }\n }\n return (this.inModule && this.options.ecmaVersion >= 13) || this.options.allowAwaitOutsideFunction\n};\n\nprototypeAccessors.allowSuper.get = function () {\n var ref = this.currentThisScope();\n var flags = ref.flags;\n var inClassFieldInit = ref.inClassFieldInit;\n return (flags & SCOPE_SUPER) > 0 || inClassFieldInit || this.options.allowSuperOutsideMethod\n};\n\nprototypeAccessors.allowDirectSuper.get = function () { return (this.currentThisScope().flags & SCOPE_DIRECT_SUPER) > 0 };\n\nprototypeAccessors.treatFunctionsAsVar.get = function () { return this.treatFunctionsAsVarInScope(this.currentScope()) };\n\nprototypeAccessors.allowNewDotTarget.get = function () {\n var ref = this.currentThisScope();\n var flags = ref.flags;\n var inClassFieldInit = ref.inClassFieldInit;\n return (flags & (SCOPE_FUNCTION | SCOPE_CLASS_STATIC_BLOCK)) > 0 || inClassFieldInit\n};\n\nprototypeAccessors.inClassStaticBlock.get = function () {\n return (this.currentVarScope().flags & SCOPE_CLASS_STATIC_BLOCK) > 0\n};\n\nParser.extend = function extend () {\n var plugins = [], len = arguments.length;\n while ( len-- ) plugins[ len ] = arguments[ len ];\n\n var cls = this;\n for (var i = 0; i < plugins.length; i++) { cls = plugins[i](cls); }\n return cls\n};\n\nParser.parse = function parse (input, options) {\n return new this(options, input).parse()\n};\n\nParser.parseExpressionAt = function parseExpressionAt (input, pos, options) {\n var parser = new this(options, input, pos);\n parser.nextToken();\n return parser.parseExpression()\n};\n\nParser.tokenizer = function tokenizer (input, options) {\n return new this(options, input)\n};\n\nObject.defineProperties( Parser.prototype, prototypeAccessors );\n\nvar pp$9 = Parser.prototype;\n\n// ## Parser utilities\n\nvar literal = /^(?:'((?:\\\\.|[^'\\\\])*?)'|\"((?:\\\\.|[^\"\\\\])*?)\")/;\npp$9.strictDirective = function(start) {\n if (this.options.ecmaVersion < 5) { return false }\n for (;;) {\n // Try to find string literal.\n skipWhiteSpace.lastIndex = start;\n start += skipWhiteSpace.exec(this.input)[0].length;\n var match = literal.exec(this.input.slice(start));\n if (!match) { return false }\n if ((match[1] || match[2]) === \"use strict\") {\n skipWhiteSpace.lastIndex = start + match[0].length;\n var spaceAfter = skipWhiteSpace.exec(this.input), end = spaceAfter.index + spaceAfter[0].length;\n var next = this.input.charAt(end);\n return next === \";\" || next === \"}\" ||\n (lineBreak.test(spaceAfter[0]) &&\n !(/[(`.[+\\-/*%<>=,?^&]/.test(next) || next === \"!\" && this.input.charAt(end + 1) === \"=\"))\n }\n start += match[0].length;\n\n // Skip semicolon, if any.\n skipWhiteSpace.lastIndex = start;\n start += skipWhiteSpace.exec(this.input)[0].length;\n if (this.input[start] === \";\")\n { start++; }\n }\n};\n\n// Predicate that tests whether the next token is of the given\n// type, and if yes, consumes it as a side effect.\n\npp$9.eat = function(type) {\n if (this.type === type) {\n this.next();\n return true\n } else {\n return false\n }\n};\n\n// Tests whether parsed token is a contextual keyword.\n\npp$9.isContextual = function(name) {\n return this.type === types$1.name && this.value === name && !this.containsEsc\n};\n\n// Consumes contextual keyword if possible.\n\npp$9.eatContextual = function(name) {\n if (!this.isContextual(name)) { return false }\n this.next();\n return true\n};\n\n// Asserts that following token is given contextual keyword.\n\npp$9.expectContextual = function(name) {\n if (!this.eatContextual(name)) { this.unexpected(); }\n};\n\n// Test whether a semicolon can be inserted at the current position.\n\npp$9.canInsertSemicolon = function() {\n return this.type === types$1.eof ||\n this.type === types$1.braceR ||\n lineBreak.test(this.input.slice(this.lastTokEnd, this.start))\n};\n\npp$9.insertSemicolon = function() {\n if (this.canInsertSemicolon()) {\n if (this.options.onInsertedSemicolon)\n { this.options.onInsertedSemicolon(this.lastTokEnd, this.lastTokEndLoc); }\n return true\n }\n};\n\n// Consume a semicolon, or, failing that, see if we are allowed to\n// pretend that there is a semicolon at this position.\n\npp$9.semicolon = function() {\n if (!this.eat(types$1.semi) && !this.insertSemicolon()) { this.unexpected(); }\n};\n\npp$9.afterTrailingComma = function(tokType, notNext) {\n if (this.type === tokType) {\n if (this.options.onTrailingComma)\n { this.options.onTrailingComma(this.lastTokStart, this.lastTokStartLoc); }\n if (!notNext)\n { this.next(); }\n return true\n }\n};\n\n// Expect a token of a given type. If found, consume it, otherwise,\n// raise an unexpected token error.\n\npp$9.expect = function(type) {\n this.eat(type) || this.unexpected();\n};\n\n// Raise an unexpected token error.\n\npp$9.unexpected = function(pos) {\n this.raise(pos != null ? pos : this.start, \"Unexpected token\");\n};\n\nvar DestructuringErrors = function DestructuringErrors() {\n this.shorthandAssign =\n this.trailingComma =\n this.parenthesizedAssign =\n this.parenthesizedBind =\n this.doubleProto =\n -1;\n};\n\npp$9.checkPatternErrors = function(refDestructuringErrors, isAssign) {\n if (!refDestructuringErrors) { return }\n if (refDestructuringErrors.trailingComma > -1)\n { this.raiseRecoverable(refDestructuringErrors.trailingComma, \"Comma is not permitted after the rest element\"); }\n var parens = isAssign ? refDestructuringErrors.parenthesizedAssign : refDestructuringErrors.parenthesizedBind;\n if (parens > -1) { this.raiseRecoverable(parens, \"Parenthesized pattern\"); }\n};\n\npp$9.checkExpressionErrors = function(refDestructuringErrors, andThrow) {\n if (!refDestructuringErrors) { return false }\n var shorthandAssign = refDestructuringErrors.shorthandAssign;\n var doubleProto = refDestructuringErrors.doubleProto;\n if (!andThrow) { return shorthandAssign >= 0 || doubleProto >= 0 }\n if (shorthandAssign >= 0)\n { this.raise(shorthandAssign, \"Shorthand property assignments are valid only in destructuring patterns\"); }\n if (doubleProto >= 0)\n { this.raiseRecoverable(doubleProto, \"Redefinition of __proto__ property\"); }\n};\n\npp$9.checkYieldAwaitInDefaultParams = function() {\n if (this.yieldPos && (!this.awaitPos || this.yieldPos < this.awaitPos))\n { this.raise(this.yieldPos, \"Yield expression cannot be a default value\"); }\n if (this.awaitPos)\n { this.raise(this.awaitPos, \"Await expression cannot be a default value\"); }\n};\n\npp$9.isSimpleAssignTarget = function(expr) {\n if (expr.type === \"ParenthesizedExpression\")\n { return this.isSimpleAssignTarget(expr.expression) }\n return expr.type === \"Identifier\" || expr.type === \"MemberExpression\"\n};\n\nvar pp$8 = Parser.prototype;\n\n// ### Statement parsing\n\n// Parse a program. Initializes the parser, reads any number of\n// statements, and wraps them in a Program node. Optionally takes a\n// `program` argument. If present, the statements will be appended\n// to its body instead of creating a new node.\n\npp$8.parseTopLevel = function(node) {\n var exports = Object.create(null);\n if (!node.body) { node.body = []; }\n while (this.type !== types$1.eof) {\n var stmt = this.parseStatement(null, true, exports);\n node.body.push(stmt);\n }\n if (this.inModule)\n { for (var i = 0, list = Object.keys(this.undefinedExports); i < list.length; i += 1)\n {\n var name = list[i];\n\n this.raiseRecoverable(this.undefinedExports[name].start, (\"Export '\" + name + \"' is not defined\"));\n } }\n this.adaptDirectivePrologue(node.body);\n this.next();\n node.sourceType = this.options.sourceType;\n return this.finishNode(node, \"Program\")\n};\n\nvar loopLabel = {kind: \"loop\"}, switchLabel = {kind: \"switch\"};\n\npp$8.isLet = function(context) {\n if (this.options.ecmaVersion < 6 || !this.isContextual(\"let\")) { return false }\n skipWhiteSpace.lastIndex = this.pos;\n var skip = skipWhiteSpace.exec(this.input);\n var next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next);\n // For ambiguous cases, determine if a LexicalDeclaration (or only a\n // Statement) is allowed here. If context is not empty then only a Statement\n // is allowed. However, `let [` is an explicit negative lookahead for\n // ExpressionStatement, so special-case it first.\n if (nextCh === 91 || nextCh === 92 || nextCh > 0xd7ff && nextCh < 0xdc00) { return true } // '[', '/', astral\n if (context) { return false }\n\n if (nextCh === 123) { return true } // '{'\n if (isIdentifierStart(nextCh, true)) {\n var pos = next + 1;\n while (isIdentifierChar(nextCh = this.input.charCodeAt(pos), true)) { ++pos; }\n if (nextCh === 92 || nextCh > 0xd7ff && nextCh < 0xdc00) { return true }\n var ident = this.input.slice(next, pos);\n if (!keywordRelationalOperator.test(ident)) { return true }\n }\n return false\n};\n\n// check 'async [no LineTerminator here] function'\n// - 'async /*foo*/ function' is OK.\n// - 'async /*\\n*/ function' is invalid.\npp$8.isAsyncFunction = function() {\n if (this.options.ecmaVersion < 8 || !this.isContextual(\"async\"))\n { return false }\n\n skipWhiteSpace.lastIndex = this.pos;\n var skip = skipWhiteSpace.exec(this.input);\n var next = this.pos + skip[0].length, after;\n return !lineBreak.test(this.input.slice(this.pos, next)) &&\n this.input.slice(next, next + 8) === \"function\" &&\n (next + 8 === this.input.length ||\n !(isIdentifierChar(after = this.input.charCodeAt(next + 8)) || after > 0xd7ff && after < 0xdc00))\n};\n\n// Parse a single statement.\n//\n// If expecting a statement and finding a slash operator, parse a\n// regular expression literal. This is to handle cases like\n// `if (foo) /blah/.exec(foo)`, where looking at the previous token\n// does not help.\n\npp$8.parseStatement = function(context, topLevel, exports) {\n var starttype = this.type, node = this.startNode(), kind;\n\n if (this.isLet(context)) {\n starttype = types$1._var;\n kind = \"let\";\n }\n\n // Most types of statements are recognized by the keyword they\n // start with. Many are trivial to parse, some require a bit of\n // complexity.\n\n switch (starttype) {\n case types$1._break: case types$1._continue: return this.parseBreakContinueStatement(node, starttype.keyword)\n case types$1._debugger: return this.parseDebuggerStatement(node)\n case types$1._do: return this.parseDoStatement(node)\n case types$1._for: return this.parseForStatement(node)\n case types$1._function:\n // Function as sole body of either an if statement or a labeled statement\n // works, but not when it is part of a labeled statement that is the sole\n // body of an if statement.\n if ((context && (this.strict || context !== \"if\" && context !== \"label\")) && this.options.ecmaVersion >= 6) { this.unexpected(); }\n return this.parseFunctionStatement(node, false, !context)\n case types$1._class:\n if (context) { this.unexpected(); }\n return this.parseClass(node, true)\n case types$1._if: return this.parseIfStatement(node)\n case types$1._return: return this.parseReturnStatement(node)\n case types$1._switch: return this.parseSwitchStatement(node)\n case types$1._throw: return this.parseThrowStatement(node)\n case types$1._try: return this.parseTryStatement(node)\n case types$1._const: case types$1._var:\n kind = kind || this.value;\n if (context && kind !== \"var\") { this.unexpected(); }\n return this.parseVarStatement(node, kind)\n case types$1._while: return this.parseWhileStatement(node)\n case types$1._with: return this.parseWithStatement(node)\n case types$1.braceL: return this.parseBlock(true, node)\n case types$1.semi: return this.parseEmptyStatement(node)\n case types$1._export:\n case types$1._import:\n if (this.options.ecmaVersion > 10 && starttype === types$1._import) {\n skipWhiteSpace.lastIndex = this.pos;\n var skip = skipWhiteSpace.exec(this.input);\n var next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next);\n if (nextCh === 40 || nextCh === 46) // '(' or '.'\n { return this.parseExpressionStatement(node, this.parseExpression()) }\n }\n\n if (!this.options.allowImportExportEverywhere) {\n if (!topLevel)\n { this.raise(this.start, \"'import' and 'export' may only appear at the top level\"); }\n if (!this.inModule)\n { this.raise(this.start, \"'import' and 'export' may appear only with 'sourceType: module'\"); }\n }\n return starttype === types$1._import ? this.parseImport(node) : this.parseExport(node, exports)\n\n // If the statement does not start with a statement keyword or a\n // brace, it's an ExpressionStatement or LabeledStatement. We\n // simply start parsing an expression, and afterwards, if the\n // next token is a colon and the expression was a simple\n // Identifier node, we switch to interpreting it as a label.\n default:\n if (this.isAsyncFunction()) {\n if (context) { this.unexpected(); }\n this.next();\n return this.parseFunctionStatement(node, true, !context)\n }\n\n var maybeName = this.value, expr = this.parseExpression();\n if (starttype === types$1.name && expr.type === \"Identifier\" && this.eat(types$1.colon))\n { return this.parseLabeledStatement(node, maybeName, expr, context) }\n else { return this.parseExpressionStatement(node, expr) }\n }\n};\n\npp$8.parseBreakContinueStatement = function(node, keyword) {\n var isBreak = keyword === \"break\";\n this.next();\n if (this.eat(types$1.semi) || this.insertSemicolon()) { node.label = null; }\n else if (this.type !== types$1.name) { this.unexpected(); }\n else {\n node.label = this.parseIdent();\n this.semicolon();\n }\n\n // Verify that there is an actual destination to break or\n // continue to.\n var i = 0;\n for (; i < this.labels.length; ++i) {\n var lab = this.labels[i];\n if (node.label == null || lab.name === node.label.name) {\n if (lab.kind != null && (isBreak || lab.kind === \"loop\")) { break }\n if (node.label && isBreak) { break }\n }\n }\n if (i === this.labels.length) { this.raise(node.start, \"Unsyntactic \" + keyword); }\n return this.finishNode(node, isBreak ? \"BreakStatement\" : \"ContinueStatement\")\n};\n\npp$8.parseDebuggerStatement = function(node) {\n this.next();\n this.semicolon();\n return this.finishNode(node, \"DebuggerStatement\")\n};\n\npp$8.parseDoStatement = function(node) {\n this.next();\n this.labels.push(loopLabel);\n node.body = this.parseStatement(\"do\");\n this.labels.pop();\n this.expect(types$1._while);\n node.test = this.parseParenExpression();\n if (this.options.ecmaVersion >= 6)\n { this.eat(types$1.semi); }\n else\n { this.semicolon(); }\n return this.finishNode(node, \"DoWhileStatement\")\n};\n\n// Disambiguating between a `for` and a `for`/`in` or `for`/`of`\n// loop is non-trivial. Basically, we have to parse the init `var`\n// statement or expression, disallowing the `in` operator (see\n// the second parameter to `parseExpression`), and then check\n// whether the next token is `in` or `of`. When there is no init\n// part (semicolon immediately after the opening parenthesis), it\n// is a regular `for` loop.\n\npp$8.parseForStatement = function(node) {\n this.next();\n var awaitAt = (this.options.ecmaVersion >= 9 && this.canAwait && this.eatContextual(\"await\")) ? this.lastTokStart : -1;\n this.labels.push(loopLabel);\n this.enterScope(0);\n this.expect(types$1.parenL);\n if (this.type === types$1.semi) {\n if (awaitAt > -1) { this.unexpected(awaitAt); }\n return this.parseFor(node, null)\n }\n var isLet = this.isLet();\n if (this.type === types$1._var || this.type === types$1._const || isLet) {\n var init$1 = this.startNode(), kind = isLet ? \"let\" : this.value;\n this.next();\n this.parseVar(init$1, true, kind);\n this.finishNode(init$1, \"VariableDeclaration\");\n if ((this.type === types$1._in || (this.options.ecmaVersion >= 6 && this.isContextual(\"of\"))) && init$1.declarations.length === 1) {\n if (this.options.ecmaVersion >= 9) {\n if (this.type === types$1._in) {\n if (awaitAt > -1) { this.unexpected(awaitAt); }\n } else { node.await = awaitAt > -1; }\n }\n return this.parseForIn(node, init$1)\n }\n if (awaitAt > -1) { this.unexpected(awaitAt); }\n return this.parseFor(node, init$1)\n }\n var startsWithLet = this.isContextual(\"let\"), isForOf = false;\n var refDestructuringErrors = new DestructuringErrors;\n var init = this.parseExpression(awaitAt > -1 ? \"await\" : true, refDestructuringErrors);\n if (this.type === types$1._in || (isForOf = this.options.ecmaVersion >= 6 && this.isContextual(\"of\"))) {\n if (this.options.ecmaVersion >= 9) {\n if (this.type === types$1._in) {\n if (awaitAt > -1) { this.unexpected(awaitAt); }\n } else { node.await = awaitAt > -1; }\n }\n if (startsWithLet && isForOf) { this.raise(init.start, \"The left-hand side of a for-of loop may not start with 'let'.\"); }\n this.toAssignable(init, false, refDestructuringErrors);\n this.checkLValPattern(init);\n return this.parseForIn(node, init)\n } else {\n this.checkExpressionErrors(refDestructuringErrors, true);\n }\n if (awaitAt > -1) { this.unexpected(awaitAt); }\n return this.parseFor(node, init)\n};\n\npp$8.parseFunctionStatement = function(node, isAsync, declarationPosition) {\n this.next();\n return this.parseFunction(node, FUNC_STATEMENT | (declarationPosition ? 0 : FUNC_HANGING_STATEMENT), false, isAsync)\n};\n\npp$8.parseIfStatement = function(node) {\n this.next();\n node.test = this.parseParenExpression();\n // allow function declarations in branches, but only in non-strict mode\n node.consequent = this.parseStatement(\"if\");\n node.alternate = this.eat(types$1._else) ? this.parseStatement(\"if\") : null;\n return this.finishNode(node, \"IfStatement\")\n};\n\npp$8.parseReturnStatement = function(node) {\n if (!this.inFunction && !this.options.allowReturnOutsideFunction)\n { this.raise(this.start, \"'return' outside of function\"); }\n this.next();\n\n // In `return` (and `break`/`continue`), the keywords with\n // optional arguments, we eagerly look for a semicolon or the\n // possibility to insert one.\n\n if (this.eat(types$1.semi) || this.insertSemicolon()) { node.argument = null; }\n else { node.argument = this.parseExpression(); this.semicolon(); }\n return this.finishNode(node, \"ReturnStatement\")\n};\n\npp$8.parseSwitchStatement = function(node) {\n this.next();\n node.discriminant = this.parseParenExpression();\n node.cases = [];\n this.expect(types$1.braceL);\n this.labels.push(switchLabel);\n this.enterScope(0);\n\n // Statements under must be grouped (by label) in SwitchCase\n // nodes. `cur` is used to keep the node that we are currently\n // adding statements to.\n\n var cur;\n for (var sawDefault = false; this.type !== types$1.braceR;) {\n if (this.type === types$1._case || this.type === types$1._default) {\n var isCase = this.type === types$1._case;\n if (cur) { this.finishNode(cur, \"SwitchCase\"); }\n node.cases.push(cur = this.startNode());\n cur.consequent = [];\n this.next();\n if (isCase) {\n cur.test = this.parseExpression();\n } else {\n if (sawDefault) { this.raiseRecoverable(this.lastTokStart, \"Multiple default clauses\"); }\n sawDefault = true;\n cur.test = null;\n }\n this.expect(types$1.colon);\n } else {\n if (!cur) { this.unexpected(); }\n cur.consequent.push(this.parseStatement(null));\n }\n }\n this.exitScope();\n if (cur) { this.finishNode(cur, \"SwitchCase\"); }\n this.next(); // Closing brace\n this.labels.pop();\n return this.finishNode(node, \"SwitchStatement\")\n};\n\npp$8.parseThrowStatement = function(node) {\n this.next();\n if (lineBreak.test(this.input.slice(this.lastTokEnd, this.start)))\n { this.raise(this.lastTokEnd, \"Illegal newline after throw\"); }\n node.argument = this.parseExpression();\n this.semicolon();\n return this.finishNode(node, \"ThrowStatement\")\n};\n\n// Reused empty array added for node fields that are always empty.\n\nvar empty$1 = [];\n\npp$8.parseTryStatement = function(node) {\n this.next();\n node.block = this.parseBlock();\n node.handler = null;\n if (this.type === types$1._catch) {\n var clause = this.startNode();\n this.next();\n if (this.eat(types$1.parenL)) {\n clause.param = this.parseBindingAtom();\n var simple = clause.param.type === \"Identifier\";\n this.enterScope(simple ? SCOPE_SIMPLE_CATCH : 0);\n this.checkLValPattern(clause.param, simple ? BIND_SIMPLE_CATCH : BIND_LEXICAL);\n this.expect(types$1.parenR);\n } else {\n if (this.options.ecmaVersion < 10) { this.unexpected(); }\n clause.param = null;\n this.enterScope(0);\n }\n clause.body = this.parseBlock(false);\n this.exitScope();\n node.handler = this.finishNode(clause, \"CatchClause\");\n }\n node.finalizer = this.eat(types$1._finally) ? this.parseBlock() : null;\n if (!node.handler && !node.finalizer)\n { this.raise(node.start, \"Missing catch or finally clause\"); }\n return this.finishNode(node, \"TryStatement\")\n};\n\npp$8.parseVarStatement = function(node, kind) {\n this.next();\n this.parseVar(node, false, kind);\n this.semicolon();\n return this.finishNode(node, \"VariableDeclaration\")\n};\n\npp$8.parseWhileStatement = function(node) {\n this.next();\n node.test = this.parseParenExpression();\n this.labels.push(loopLabel);\n node.body = this.parseStatement(\"while\");\n this.labels.pop();\n return this.finishNode(node, \"WhileStatement\")\n};\n\npp$8.parseWithStatement = function(node) {\n if (this.strict) { this.raise(this.start, \"'with' in strict mode\"); }\n this.next();\n node.object = this.parseParenExpression();\n node.body = this.parseStatement(\"with\");\n return this.finishNode(node, \"WithStatement\")\n};\n\npp$8.parseEmptyStatement = function(node) {\n this.next();\n return this.finishNode(node, \"EmptyStatement\")\n};\n\npp$8.parseLabeledStatement = function(node, maybeName, expr, context) {\n for (var i$1 = 0, list = this.labels; i$1 < list.length; i$1 += 1)\n {\n var label = list[i$1];\n\n if (label.name === maybeName)\n { this.raise(expr.start, \"Label '\" + maybeName + \"' is already declared\");\n } }\n var kind = this.type.isLoop ? \"loop\" : this.type === types$1._switch ? \"switch\" : null;\n for (var i = this.labels.length - 1; i >= 0; i--) {\n var label$1 = this.labels[i];\n if (label$1.statementStart === node.start) {\n // Update information about previous labels on this node\n label$1.statementStart = this.start;\n label$1.kind = kind;\n } else { break }\n }\n this.labels.push({name: maybeName, kind: kind, statementStart: this.start});\n node.body = this.parseStatement(context ? context.indexOf(\"label\") === -1 ? context + \"label\" : context : \"label\");\n this.labels.pop();\n node.label = expr;\n return this.finishNode(node, \"LabeledStatement\")\n};\n\npp$8.parseExpressionStatement = function(node, expr) {\n node.expression = expr;\n this.semicolon();\n return this.finishNode(node, \"ExpressionStatement\")\n};\n\n// Parse a semicolon-enclosed block of statements, handling `\"use\n// strict\"` declarations when `allowStrict` is true (used for\n// function bodies).\n\npp$8.parseBlock = function(createNewLexicalScope, node, exitStrict) {\n if ( createNewLexicalScope === void 0 ) createNewLexicalScope = true;\n if ( node === void 0 ) node = this.startNode();\n\n node.body = [];\n this.expect(types$1.braceL);\n if (createNewLexicalScope) { this.enterScope(0); }\n while (this.type !== types$1.braceR) {\n var stmt = this.parseStatement(null);\n node.body.push(stmt);\n }\n if (exitStrict) { this.strict = false; }\n this.next();\n if (createNewLexicalScope) { this.exitScope(); }\n return this.finishNode(node, \"BlockStatement\")\n};\n\n// Parse a regular `for` loop. The disambiguation code in\n// `parseStatement` will already have parsed the init statement or\n// expression.\n\npp$8.parseFor = function(node, init) {\n node.init = init;\n this.expect(types$1.semi);\n node.test = this.type === types$1.semi ? null : this.parseExpression();\n this.expect(types$1.semi);\n node.update = this.type === types$1.parenR ? null : this.parseExpression();\n this.expect(types$1.parenR);\n node.body = this.parseStatement(\"for\");\n this.exitScope();\n this.labels.pop();\n return this.finishNode(node, \"ForStatement\")\n};\n\n// Parse a `for`/`in` and `for`/`of` loop, which are almost\n// same from parser's perspective.\n\npp$8.parseForIn = function(node, init) {\n var isForIn = this.type === types$1._in;\n this.next();\n\n if (\n init.type === \"VariableDeclaration\" &&\n init.declarations[0].init != null &&\n (\n !isForIn ||\n this.options.ecmaVersion < 8 ||\n this.strict ||\n init.kind !== \"var\" ||\n init.declarations[0].id.type !== \"Identifier\"\n )\n ) {\n this.raise(\n init.start,\n ((isForIn ? \"for-in\" : \"for-of\") + \" loop variable declaration may not have an initializer\")\n );\n }\n node.left = init;\n node.right = isForIn ? this.parseExpression() : this.parseMaybeAssign();\n this.expect(types$1.parenR);\n node.body = this.parseStatement(\"for\");\n this.exitScope();\n this.labels.pop();\n return this.finishNode(node, isForIn ? \"ForInStatement\" : \"ForOfStatement\")\n};\n\n// Parse a list of variable declarations.\n\npp$8.parseVar = function(node, isFor, kind) {\n node.declarations = [];\n node.kind = kind;\n for (;;) {\n var decl = this.startNode();\n this.parseVarId(decl, kind);\n if (this.eat(types$1.eq)) {\n decl.init = this.parseMaybeAssign(isFor);\n } else if (kind === \"const\" && !(this.type === types$1._in || (this.options.ecmaVersion >= 6 && this.isContextual(\"of\")))) {\n this.unexpected();\n } else if (decl.id.type !== \"Identifier\" && !(isFor && (this.type === types$1._in || this.isContextual(\"of\")))) {\n this.raise(this.lastTokEnd, \"Complex binding patterns require an initialization value\");\n } else {\n decl.init = null;\n }\n node.declarations.push(this.finishNode(decl, \"VariableDeclarator\"));\n if (!this.eat(types$1.comma)) { break }\n }\n return node\n};\n\npp$8.parseVarId = function(decl, kind) {\n decl.id = this.parseBindingAtom();\n this.checkLValPattern(decl.id, kind === \"var\" ? BIND_VAR : BIND_LEXICAL, false);\n};\n\nvar FUNC_STATEMENT = 1, FUNC_HANGING_STATEMENT = 2, FUNC_NULLABLE_ID = 4;\n\n// Parse a function declaration or literal (depending on the\n// `statement & FUNC_STATEMENT`).\n\n// Remove `allowExpressionBody` for 7.0.0, as it is only called with false\npp$8.parseFunction = function(node, statement, allowExpressionBody, isAsync, forInit) {\n this.initFunction(node);\n if (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !isAsync) {\n if (this.type === types$1.star && (statement & FUNC_HANGING_STATEMENT))\n { this.unexpected(); }\n node.generator = this.eat(types$1.star);\n }\n if (this.options.ecmaVersion >= 8)\n { node.async = !!isAsync; }\n\n if (statement & FUNC_STATEMENT) {\n node.id = (statement & FUNC_NULLABLE_ID) && this.type !== types$1.name ? null : this.parseIdent();\n if (node.id && !(statement & FUNC_HANGING_STATEMENT))\n // If it is a regular function declaration in sloppy mode, then it is\n // subject to Annex B semantics (BIND_FUNCTION). Otherwise, the binding\n // mode depends on properties of the current scope (see\n // treatFunctionsAsVar).\n { this.checkLValSimple(node.id, (this.strict || node.generator || node.async) ? this.treatFunctionsAsVar ? BIND_VAR : BIND_LEXICAL : BIND_FUNCTION); }\n }\n\n var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos;\n this.yieldPos = 0;\n this.awaitPos = 0;\n this.awaitIdentPos = 0;\n this.enterScope(functionFlags(node.async, node.generator));\n\n if (!(statement & FUNC_STATEMENT))\n { node.id = this.type === types$1.name ? this.parseIdent() : null; }\n\n this.parseFunctionParams(node);\n this.parseFunctionBody(node, allowExpressionBody, false, forInit);\n\n this.yieldPos = oldYieldPos;\n this.awaitPos = oldAwaitPos;\n this.awaitIdentPos = oldAwaitIdentPos;\n return this.finishNode(node, (statement & FUNC_STATEMENT) ? \"FunctionDeclaration\" : \"FunctionExpression\")\n};\n\npp$8.parseFunctionParams = function(node) {\n this.expect(types$1.parenL);\n node.params = this.parseBindingList(types$1.parenR, false, this.options.ecmaVersion >= 8);\n this.checkYieldAwaitInDefaultParams();\n};\n\n// Parse a class declaration or literal (depending on the\n// `isStatement` parameter).\n\npp$8.parseClass = function(node, isStatement) {\n this.next();\n\n // ecma-262 14.6 Class Definitions\n // A class definition is always strict mode code.\n var oldStrict = this.strict;\n this.strict = true;\n\n this.parseClassId(node, isStatement);\n this.parseClassSuper(node);\n var privateNameMap = this.enterClassBody();\n var classBody = this.startNode();\n var hadConstructor = false;\n classBody.body = [];\n this.expect(types$1.braceL);\n while (this.type !== types$1.braceR) {\n var element = this.parseClassElement(node.superClass !== null);\n if (element) {\n classBody.body.push(element);\n if (element.type === \"MethodDefinition\" && element.kind === \"constructor\") {\n if (hadConstructor) { this.raise(element.start, \"Duplicate constructor in the same class\"); }\n hadConstructor = true;\n } else if (element.key && element.key.type === \"PrivateIdentifier\" && isPrivateNameConflicted(privateNameMap, element)) {\n this.raiseRecoverable(element.key.start, (\"Identifier '#\" + (element.key.name) + \"' has already been declared\"));\n }\n }\n }\n this.strict = oldStrict;\n this.next();\n node.body = this.finishNode(classBody, \"ClassBody\");\n this.exitClassBody();\n return this.finishNode(node, isStatement ? \"ClassDeclaration\" : \"ClassExpression\")\n};\n\npp$8.parseClassElement = function(constructorAllowsSuper) {\n if (this.eat(types$1.semi)) { return null }\n\n var ecmaVersion = this.options.ecmaVersion;\n var node = this.startNode();\n var keyName = \"\";\n var isGenerator = false;\n var isAsync = false;\n var kind = \"method\";\n var isStatic = false;\n\n if (this.eatContextual(\"static\")) {\n // Parse static init block\n if (ecmaVersion >= 13 && this.eat(types$1.braceL)) {\n this.parseClassStaticBlock(node);\n return node\n }\n if (this.isClassElementNameStart() || this.type === types$1.star) {\n isStatic = true;\n } else {\n keyName = \"static\";\n }\n }\n node.static = isStatic;\n if (!keyName && ecmaVersion >= 8 && this.eatContextual(\"async\")) {\n if ((this.isClassElementNameStart() || this.type === types$1.star) && !this.canInsertSemicolon()) {\n isAsync = true;\n } else {\n keyName = \"async\";\n }\n }\n if (!keyName && (ecmaVersion >= 9 || !isAsync) && this.eat(types$1.star)) {\n isGenerator = true;\n }\n if (!keyName && !isAsync && !isGenerator) {\n var lastValue = this.value;\n if (this.eatContextual(\"get\") || this.eatContextual(\"set\")) {\n if (this.isClassElementNameStart()) {\n kind = lastValue;\n } else {\n keyName = lastValue;\n }\n }\n }\n\n // Parse element name\n if (keyName) {\n // 'async', 'get', 'set', or 'static' were not a keyword contextually.\n // The last token is any of those. Make it the element name.\n node.computed = false;\n node.key = this.startNodeAt(this.lastTokStart, this.lastTokStartLoc);\n node.key.name = keyName;\n this.finishNode(node.key, \"Identifier\");\n } else {\n this.parseClassElementName(node);\n }\n\n // Parse element value\n if (ecmaVersion < 13 || this.type === types$1.parenL || kind !== \"method\" || isGenerator || isAsync) {\n var isConstructor = !node.static && checkKeyName(node, \"constructor\");\n var allowsDirectSuper = isConstructor && constructorAllowsSuper;\n // Couldn't move this check into the 'parseClassMethod' method for backward compatibility.\n if (isConstructor && kind !== \"method\") { this.raise(node.key.start, \"Constructor can't have get/set modifier\"); }\n node.kind = isConstructor ? \"constructor\" : kind;\n this.parseClassMethod(node, isGenerator, isAsync, allowsDirectSuper);\n } else {\n this.parseClassField(node);\n }\n\n return node\n};\n\npp$8.isClassElementNameStart = function() {\n return (\n this.type === types$1.name ||\n this.type === types$1.privateId ||\n this.type === types$1.num ||\n this.type === types$1.string ||\n this.type === types$1.bracketL ||\n this.type.keyword\n )\n};\n\npp$8.parseClassElementName = function(element) {\n if (this.type === types$1.privateId) {\n if (this.value === \"constructor\") {\n this.raise(this.start, \"Classes can't have an element named '#constructor'\");\n }\n element.computed = false;\n element.key = this.parsePrivateIdent();\n } else {\n this.parsePropertyName(element);\n }\n};\n\npp$8.parseClassMethod = function(method, isGenerator, isAsync, allowsDirectSuper) {\n // Check key and flags\n var key = method.key;\n if (method.kind === \"constructor\") {\n if (isGenerator) { this.raise(key.start, \"Constructor can't be a generator\"); }\n if (isAsync) { this.raise(key.start, \"Constructor can't be an async method\"); }\n } else if (method.static && checkKeyName(method, \"prototype\")) {\n this.raise(key.start, \"Classes may not have a static property named prototype\");\n }\n\n // Parse value\n var value = method.value = this.parseMethod(isGenerator, isAsync, allowsDirectSuper);\n\n // Check value\n if (method.kind === \"get\" && value.params.length !== 0)\n { this.raiseRecoverable(value.start, \"getter should have no params\"); }\n if (method.kind === \"set\" && value.params.length !== 1)\n { this.raiseRecoverable(value.start, \"setter should have exactly one param\"); }\n if (method.kind === \"set\" && value.params[0].type === \"RestElement\")\n { this.raiseRecoverable(value.params[0].start, \"Setter cannot use rest params\"); }\n\n return this.finishNode(method, \"MethodDefinition\")\n};\n\npp$8.parseClassField = function(field) {\n if (checkKeyName(field, \"constructor\")) {\n this.raise(field.key.start, \"Classes can't have a field named 'constructor'\");\n } else if (field.static && checkKeyName(field, \"prototype\")) {\n this.raise(field.key.start, \"Classes can't have a static field named 'prototype'\");\n }\n\n if (this.eat(types$1.eq)) {\n // To raise SyntaxError if 'arguments' exists in the initializer.\n var scope = this.currentThisScope();\n var inClassFieldInit = scope.inClassFieldInit;\n scope.inClassFieldInit = true;\n field.value = this.parseMaybeAssign();\n scope.inClassFieldInit = inClassFieldInit;\n } else {\n field.value = null;\n }\n this.semicolon();\n\n return this.finishNode(field, \"PropertyDefinition\")\n};\n\npp$8.parseClassStaticBlock = function(node) {\n node.body = [];\n\n var oldLabels = this.labels;\n this.labels = [];\n this.enterScope(SCOPE_CLASS_STATIC_BLOCK | SCOPE_SUPER);\n while (this.type !== types$1.braceR) {\n var stmt = this.parseStatement(null);\n node.body.push(stmt);\n }\n this.next();\n this.exitScope();\n this.labels = oldLabels;\n\n return this.finishNode(node, \"StaticBlock\")\n};\n\npp$8.parseClassId = function(node, isStatement) {\n if (this.type === types$1.name) {\n node.id = this.parseIdent();\n if (isStatement)\n { this.checkLValSimple(node.id, BIND_LEXICAL, false); }\n } else {\n if (isStatement === true)\n { this.unexpected(); }\n node.id = null;\n }\n};\n\npp$8.parseClassSuper = function(node) {\n node.superClass = this.eat(types$1._extends) ? this.parseExprSubscripts(false) : null;\n};\n\npp$8.enterClassBody = function() {\n var element = {declared: Object.create(null), used: []};\n this.privateNameStack.push(element);\n return element.declared\n};\n\npp$8.exitClassBody = function() {\n var ref = this.privateNameStack.pop();\n var declared = ref.declared;\n var used = ref.used;\n var len = this.privateNameStack.length;\n var parent = len === 0 ? null : this.privateNameStack[len - 1];\n for (var i = 0; i < used.length; ++i) {\n var id = used[i];\n if (!hasOwn(declared, id.name)) {\n if (parent) {\n parent.used.push(id);\n } else {\n this.raiseRecoverable(id.start, (\"Private field '#\" + (id.name) + \"' must be declared in an enclosing class\"));\n }\n }\n }\n};\n\nfunction isPrivateNameConflicted(privateNameMap, element) {\n var name = element.key.name;\n var curr = privateNameMap[name];\n\n var next = \"true\";\n if (element.type === \"MethodDefinition\" && (element.kind === \"get\" || element.kind === \"set\")) {\n next = (element.static ? \"s\" : \"i\") + element.kind;\n }\n\n // `class { get #a(){}; static set #a(_){} }` is also conflict.\n if (\n curr === \"iget\" && next === \"iset\" ||\n curr === \"iset\" && next === \"iget\" ||\n curr === \"sget\" && next === \"sset\" ||\n curr === \"sset\" && next === \"sget\"\n ) {\n privateNameMap[name] = \"true\";\n return false\n } else if (!curr) {\n privateNameMap[name] = next;\n return false\n } else {\n return true\n }\n}\n\nfunction checkKeyName(node, name) {\n var computed = node.computed;\n var key = node.key;\n return !computed && (\n key.type === \"Identifier\" && key.name === name ||\n key.type === \"Literal\" && key.value === name\n )\n}\n\n// Parses module export declaration.\n\npp$8.parseExport = function(node, exports) {\n this.next();\n // export * from '...'\n if (this.eat(types$1.star)) {\n if (this.options.ecmaVersion >= 11) {\n if (this.eatContextual(\"as\")) {\n node.exported = this.parseModuleExportName();\n this.checkExport(exports, node.exported, this.lastTokStart);\n } else {\n node.exported = null;\n }\n }\n this.expectContextual(\"from\");\n if (this.type !== types$1.string) { this.unexpected(); }\n node.source = this.parseExprAtom();\n this.semicolon();\n return this.finishNode(node, \"ExportAllDeclaration\")\n }\n if (this.eat(types$1._default)) { // export default ...\n this.checkExport(exports, \"default\", this.lastTokStart);\n var isAsync;\n if (this.type === types$1._function || (isAsync = this.isAsyncFunction())) {\n var fNode = this.startNode();\n this.next();\n if (isAsync) { this.next(); }\n node.declaration = this.parseFunction(fNode, FUNC_STATEMENT | FUNC_NULLABLE_ID, false, isAsync);\n } else if (this.type === types$1._class) {\n var cNode = this.startNode();\n node.declaration = this.parseClass(cNode, \"nullableID\");\n } else {\n node.declaration = this.parseMaybeAssign();\n this.semicolon();\n }\n return this.finishNode(node, \"ExportDefaultDeclaration\")\n }\n // export var|const|let|function|class ...\n if (this.shouldParseExportStatement()) {\n node.declaration = this.parseStatement(null);\n if (node.declaration.type === \"VariableDeclaration\")\n { this.checkVariableExport(exports, node.declaration.declarations); }\n else\n { this.checkExport(exports, node.declaration.id, node.declaration.id.start); }\n node.specifiers = [];\n node.source = null;\n } else { // export { x, y as z } [from '...']\n node.declaration = null;\n node.specifiers = this.parseExportSpecifiers(exports);\n if (this.eatContextual(\"from\")) {\n if (this.type !== types$1.string) { this.unexpected(); }\n node.source = this.parseExprAtom();\n } else {\n for (var i = 0, list = node.specifiers; i < list.length; i += 1) {\n // check for keywords used as local names\n var spec = list[i];\n\n this.checkUnreserved(spec.local);\n // check if export is defined\n this.checkLocalExport(spec.local);\n\n if (spec.local.type === \"Literal\") {\n this.raise(spec.local.start, \"A string literal cannot be used as an exported binding without `from`.\");\n }\n }\n\n node.source = null;\n }\n this.semicolon();\n }\n return this.finishNode(node, \"ExportNamedDeclaration\")\n};\n\npp$8.checkExport = function(exports, name, pos) {\n if (!exports) { return }\n if (typeof name !== \"string\")\n { name = name.type === \"Identifier\" ? name.name : name.value; }\n if (hasOwn(exports, name))\n { this.raiseRecoverable(pos, \"Duplicate export '\" + name + \"'\"); }\n exports[name] = true;\n};\n\npp$8.checkPatternExport = function(exports, pat) {\n var type = pat.type;\n if (type === \"Identifier\")\n { this.checkExport(exports, pat, pat.start); }\n else if (type === \"ObjectPattern\")\n { for (var i = 0, list = pat.properties; i < list.length; i += 1)\n {\n var prop = list[i];\n\n this.checkPatternExport(exports, prop);\n } }\n else if (type === \"ArrayPattern\")\n { for (var i$1 = 0, list$1 = pat.elements; i$1 < list$1.length; i$1 += 1) {\n var elt = list$1[i$1];\n\n if (elt) { this.checkPatternExport(exports, elt); }\n } }\n else if (type === \"Property\")\n { this.checkPatternExport(exports, pat.value); }\n else if (type === \"AssignmentPattern\")\n { this.checkPatternExport(exports, pat.left); }\n else if (type === \"RestElement\")\n { this.checkPatternExport(exports, pat.argument); }\n else if (type === \"ParenthesizedExpression\")\n { this.checkPatternExport(exports, pat.expression); }\n};\n\npp$8.checkVariableExport = function(exports, decls) {\n if (!exports) { return }\n for (var i = 0, list = decls; i < list.length; i += 1)\n {\n var decl = list[i];\n\n this.checkPatternExport(exports, decl.id);\n }\n};\n\npp$8.shouldParseExportStatement = function() {\n return this.type.keyword === \"var\" ||\n this.type.keyword === \"const\" ||\n this.type.keyword === \"class\" ||\n this.type.keyword === \"function\" ||\n this.isLet() ||\n this.isAsyncFunction()\n};\n\n// Parses a comma-separated list of module exports.\n\npp$8.parseExportSpecifiers = function(exports) {\n var nodes = [], first = true;\n // export { x, y as z } [from '...']\n this.expect(types$1.braceL);\n while (!this.eat(types$1.braceR)) {\n if (!first) {\n this.expect(types$1.comma);\n if (this.afterTrailingComma(types$1.braceR)) { break }\n } else { first = false; }\n\n var node = this.startNode();\n node.local = this.parseModuleExportName();\n node.exported = this.eatContextual(\"as\") ? this.parseModuleExportName() : node.local;\n this.checkExport(\n exports,\n node.exported,\n node.exported.start\n );\n nodes.push(this.finishNode(node, \"ExportSpecifier\"));\n }\n return nodes\n};\n\n// Parses import declaration.\n\npp$8.parseImport = function(node) {\n this.next();\n // import '...'\n if (this.type === types$1.string) {\n node.specifiers = empty$1;\n node.source = this.parseExprAtom();\n } else {\n node.specifiers = this.parseImportSpecifiers();\n this.expectContextual(\"from\");\n node.source = this.type === types$1.string ? this.parseExprAtom() : this.unexpected();\n }\n this.semicolon();\n return this.finishNode(node, \"ImportDeclaration\")\n};\n\n// Parses a comma-separated list of module imports.\n\npp$8.parseImportSpecifiers = function() {\n var nodes = [], first = true;\n if (this.type === types$1.name) {\n // import defaultObj, { x, y as z } from '...'\n var node = this.startNode();\n node.local = this.parseIdent();\n this.checkLValSimple(node.local, BIND_LEXICAL);\n nodes.push(this.finishNode(node, \"ImportDefaultSpecifier\"));\n if (!this.eat(types$1.comma)) { return nodes }\n }\n if (this.type === types$1.star) {\n var node$1 = this.startNode();\n this.next();\n this.expectContextual(\"as\");\n node$1.local = this.parseIdent();\n this.checkLValSimple(node$1.local, BIND_LEXICAL);\n nodes.push(this.finishNode(node$1, \"ImportNamespaceSpecifier\"));\n return nodes\n }\n this.expect(types$1.braceL);\n while (!this.eat(types$1.braceR)) {\n if (!first) {\n this.expect(types$1.comma);\n if (this.afterTrailingComma(types$1.braceR)) { break }\n } else { first = false; }\n\n var node$2 = this.startNode();\n node$2.imported = this.parseModuleExportName();\n if (this.eatContextual(\"as\")) {\n node$2.local = this.parseIdent();\n } else {\n this.checkUnreserved(node$2.imported);\n node$2.local = node$2.imported;\n }\n this.checkLValSimple(node$2.local, BIND_LEXICAL);\n nodes.push(this.finishNode(node$2, \"ImportSpecifier\"));\n }\n return nodes\n};\n\npp$8.parseModuleExportName = function() {\n if (this.options.ecmaVersion >= 13 && this.type === types$1.string) {\n var stringLiteral = this.parseLiteral(this.value);\n if (loneSurrogate.test(stringLiteral.value)) {\n this.raise(stringLiteral.start, \"An export name cannot include a lone surrogate.\");\n }\n return stringLiteral\n }\n return this.parseIdent(true)\n};\n\n// Set `ExpressionStatement#directive` property for directive prologues.\npp$8.adaptDirectivePrologue = function(statements) {\n for (var i = 0; i < statements.length && this.isDirectiveCandidate(statements[i]); ++i) {\n statements[i].directive = statements[i].expression.raw.slice(1, -1);\n }\n};\npp$8.isDirectiveCandidate = function(statement) {\n return (\n statement.type === \"ExpressionStatement\" &&\n statement.expression.type === \"Literal\" &&\n typeof statement.expression.value === \"string\" &&\n // Reject parenthesized strings.\n (this.input[statement.start] === \"\\\"\" || this.input[statement.start] === \"'\")\n )\n};\n\nvar pp$7 = Parser.prototype;\n\n// Convert existing expression atom to assignable pattern\n// if possible.\n\npp$7.toAssignable = function(node, isBinding, refDestructuringErrors) {\n if (this.options.ecmaVersion >= 6 && node) {\n switch (node.type) {\n case \"Identifier\":\n if (this.inAsync && node.name === \"await\")\n { this.raise(node.start, \"Cannot use 'await' as identifier inside an async function\"); }\n break\n\n case \"ObjectPattern\":\n case \"ArrayPattern\":\n case \"AssignmentPattern\":\n case \"RestElement\":\n break\n\n case \"ObjectExpression\":\n node.type = \"ObjectPattern\";\n if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); }\n for (var i = 0, list = node.properties; i < list.length; i += 1) {\n var prop = list[i];\n\n this.toAssignable(prop, isBinding);\n // Early error:\n // AssignmentRestProperty[Yield, Await] :\n // `...` DestructuringAssignmentTarget[Yield, Await]\n //\n // It is a Syntax Error if |DestructuringAssignmentTarget| is an |ArrayLiteral| or an |ObjectLiteral|.\n if (\n prop.type === \"RestElement\" &&\n (prop.argument.type === \"ArrayPattern\" || prop.argument.type === \"ObjectPattern\")\n ) {\n this.raise(prop.argument.start, \"Unexpected token\");\n }\n }\n break\n\n case \"Property\":\n // AssignmentProperty has type === \"Property\"\n if (node.kind !== \"init\") { this.raise(node.key.start, \"Object pattern can't contain getter or setter\"); }\n this.toAssignable(node.value, isBinding);\n break\n\n case \"ArrayExpression\":\n node.type = \"ArrayPattern\";\n if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); }\n this.toAssignableList(node.elements, isBinding);\n break\n\n case \"SpreadElement\":\n node.type = \"RestElement\";\n this.toAssignable(node.argument, isBinding);\n if (node.argument.type === \"AssignmentPattern\")\n { this.raise(node.argument.start, \"Rest elements cannot have a default value\"); }\n break\n\n case \"AssignmentExpression\":\n if (node.operator !== \"=\") { this.raise(node.left.end, \"Only '=' operator can be used for specifying default value.\"); }\n node.type = \"AssignmentPattern\";\n delete node.operator;\n this.toAssignable(node.left, isBinding);\n break\n\n case \"ParenthesizedExpression\":\n this.toAssignable(node.expression, isBinding, refDestructuringErrors);\n break\n\n case \"ChainExpression\":\n this.raiseRecoverable(node.start, \"Optional chaining cannot appear in left-hand side\");\n break\n\n case \"MemberExpression\":\n if (!isBinding) { break }\n\n default:\n this.raise(node.start, \"Assigning to rvalue\");\n }\n } else if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); }\n return node\n};\n\n// Convert list of expression atoms to binding list.\n\npp$7.toAssignableList = function(exprList, isBinding) {\n var end = exprList.length;\n for (var i = 0; i < end; i++) {\n var elt = exprList[i];\n if (elt) { this.toAssignable(elt, isBinding); }\n }\n if (end) {\n var last = exprList[end - 1];\n if (this.options.ecmaVersion === 6 && isBinding && last && last.type === \"RestElement\" && last.argument.type !== \"Identifier\")\n { this.unexpected(last.argument.start); }\n }\n return exprList\n};\n\n// Parses spread element.\n\npp$7.parseSpread = function(refDestructuringErrors) {\n var node = this.startNode();\n this.next();\n node.argument = this.parseMaybeAssign(false, refDestructuringErrors);\n return this.finishNode(node, \"SpreadElement\")\n};\n\npp$7.parseRestBinding = function() {\n var node = this.startNode();\n this.next();\n\n // RestElement inside of a function parameter must be an identifier\n if (this.options.ecmaVersion === 6 && this.type !== types$1.name)\n { this.unexpected(); }\n\n node.argument = this.parseBindingAtom();\n\n return this.finishNode(node, \"RestElement\")\n};\n\n// Parses lvalue (assignable) atom.\n\npp$7.parseBindingAtom = function() {\n if (this.options.ecmaVersion >= 6) {\n switch (this.type) {\n case types$1.bracketL:\n var node = this.startNode();\n this.next();\n node.elements = this.parseBindingList(types$1.bracketR, true, true);\n return this.finishNode(node, \"ArrayPattern\")\n\n case types$1.braceL:\n return this.parseObj(true)\n }\n }\n return this.parseIdent()\n};\n\npp$7.parseBindingList = function(close, allowEmpty, allowTrailingComma) {\n var elts = [], first = true;\n while (!this.eat(close)) {\n if (first) { first = false; }\n else { this.expect(types$1.comma); }\n if (allowEmpty && this.type === types$1.comma) {\n elts.push(null);\n } else if (allowTrailingComma && this.afterTrailingComma(close)) {\n break\n } else if (this.type === types$1.ellipsis) {\n var rest = this.parseRestBinding();\n this.parseBindingListItem(rest);\n elts.push(rest);\n if (this.type === types$1.comma) { this.raise(this.start, \"Comma is not permitted after the rest element\"); }\n this.expect(close);\n break\n } else {\n var elem = this.parseMaybeDefault(this.start, this.startLoc);\n this.parseBindingListItem(elem);\n elts.push(elem);\n }\n }\n return elts\n};\n\npp$7.parseBindingListItem = function(param) {\n return param\n};\n\n// Parses assignment pattern around given atom if possible.\n\npp$7.parseMaybeDefault = function(startPos, startLoc, left) {\n left = left || this.parseBindingAtom();\n if (this.options.ecmaVersion < 6 || !this.eat(types$1.eq)) { return left }\n var node = this.startNodeAt(startPos, startLoc);\n node.left = left;\n node.right = this.parseMaybeAssign();\n return this.finishNode(node, \"AssignmentPattern\")\n};\n\n// The following three functions all verify that a node is an lvalue —\n// something that can be bound, or assigned to. In order to do so, they perform\n// a variety of checks:\n//\n// - Check that none of the bound/assigned-to identifiers are reserved words.\n// - Record name declarations for bindings in the appropriate scope.\n// - Check duplicate argument names, if checkClashes is set.\n//\n// If a complex binding pattern is encountered (e.g., object and array\n// destructuring), the entire pattern is recursively checked.\n//\n// There are three versions of checkLVal*() appropriate for different\n// circumstances:\n//\n// - checkLValSimple() shall be used if the syntactic construct supports\n// nothing other than identifiers and member expressions. Parenthesized\n// expressions are also correctly handled. This is generally appropriate for\n// constructs for which the spec says\n//\n// > It is a Syntax Error if AssignmentTargetType of [the production] is not\n// > simple.\n//\n// It is also appropriate for checking if an identifier is valid and not\n// defined elsewhere, like import declarations or function/class identifiers.\n//\n// Examples where this is used include:\n// a += …;\n// import a from '…';\n// where a is the node to be checked.\n//\n// - checkLValPattern() shall be used if the syntactic construct supports\n// anything checkLValSimple() supports, as well as object and array\n// destructuring patterns. This is generally appropriate for constructs for\n// which the spec says\n//\n// > It is a Syntax Error if [the production] is neither an ObjectLiteral nor\n// > an ArrayLiteral and AssignmentTargetType of [the production] is not\n// > simple.\n//\n// Examples where this is used include:\n// (a = …);\n// const a = …;\n// try { … } catch (a) { … }\n// where a is the node to be checked.\n//\n// - checkLValInnerPattern() shall be used if the syntactic construct supports\n// anything checkLValPattern() supports, as well as default assignment\n// patterns, rest elements, and other constructs that may appear within an\n// object or array destructuring pattern.\n//\n// As a special case, function parameters also use checkLValInnerPattern(),\n// as they also support defaults and rest constructs.\n//\n// These functions deliberately support both assignment and binding constructs,\n// as the logic for both is exceedingly similar. If the node is the target of\n// an assignment, then bindingType should be set to BIND_NONE. Otherwise, it\n// should be set to the appropriate BIND_* constant, like BIND_VAR or\n// BIND_LEXICAL.\n//\n// If the function is called with a non-BIND_NONE bindingType, then\n// additionally a checkClashes object may be specified to allow checking for\n// duplicate argument names. checkClashes is ignored if the provided construct\n// is an assignment (i.e., bindingType is BIND_NONE).\n\npp$7.checkLValSimple = function(expr, bindingType, checkClashes) {\n if ( bindingType === void 0 ) bindingType = BIND_NONE;\n\n var isBind = bindingType !== BIND_NONE;\n\n switch (expr.type) {\n case \"Identifier\":\n if (this.strict && this.reservedWordsStrictBind.test(expr.name))\n { this.raiseRecoverable(expr.start, (isBind ? \"Binding \" : \"Assigning to \") + expr.name + \" in strict mode\"); }\n if (isBind) {\n if (bindingType === BIND_LEXICAL && expr.name === \"let\")\n { this.raiseRecoverable(expr.start, \"let is disallowed as a lexically bound name\"); }\n if (checkClashes) {\n if (hasOwn(checkClashes, expr.name))\n { this.raiseRecoverable(expr.start, \"Argument name clash\"); }\n checkClashes[expr.name] = true;\n }\n if (bindingType !== BIND_OUTSIDE) { this.declareName(expr.name, bindingType, expr.start); }\n }\n break\n\n case \"ChainExpression\":\n this.raiseRecoverable(expr.start, \"Optional chaining cannot appear in left-hand side\");\n break\n\n case \"MemberExpression\":\n if (isBind) { this.raiseRecoverable(expr.start, \"Binding member expression\"); }\n break\n\n case \"ParenthesizedExpression\":\n if (isBind) { this.raiseRecoverable(expr.start, \"Binding parenthesized expression\"); }\n return this.checkLValSimple(expr.expression, bindingType, checkClashes)\n\n default:\n this.raise(expr.start, (isBind ? \"Binding\" : \"Assigning to\") + \" rvalue\");\n }\n};\n\npp$7.checkLValPattern = function(expr, bindingType, checkClashes) {\n if ( bindingType === void 0 ) bindingType = BIND_NONE;\n\n switch (expr.type) {\n case \"ObjectPattern\":\n for (var i = 0, list = expr.properties; i < list.length; i += 1) {\n var prop = list[i];\n\n this.checkLValInnerPattern(prop, bindingType, checkClashes);\n }\n break\n\n case \"ArrayPattern\":\n for (var i$1 = 0, list$1 = expr.elements; i$1 < list$1.length; i$1 += 1) {\n var elem = list$1[i$1];\n\n if (elem) { this.checkLValInnerPattern(elem, bindingType, checkClashes); }\n }\n break\n\n default:\n this.checkLValSimple(expr, bindingType, checkClashes);\n }\n};\n\npp$7.checkLValInnerPattern = function(expr, bindingType, checkClashes) {\n if ( bindingType === void 0 ) bindingType = BIND_NONE;\n\n switch (expr.type) {\n case \"Property\":\n // AssignmentProperty has type === \"Property\"\n this.checkLValInnerPattern(expr.value, bindingType, checkClashes);\n break\n\n case \"AssignmentPattern\":\n this.checkLValPattern(expr.left, bindingType, checkClashes);\n break\n\n case \"RestElement\":\n this.checkLValPattern(expr.argument, bindingType, checkClashes);\n break\n\n default:\n this.checkLValPattern(expr, bindingType, checkClashes);\n }\n};\n\n// The algorithm used to determine whether a regexp can appear at a\n\nvar TokContext = function TokContext(token, isExpr, preserveSpace, override, generator) {\n this.token = token;\n this.isExpr = !!isExpr;\n this.preserveSpace = !!preserveSpace;\n this.override = override;\n this.generator = !!generator;\n};\n\nvar types = {\n b_stat: new TokContext(\"{\", false),\n b_expr: new TokContext(\"{\", true),\n b_tmpl: new TokContext(\"${\", false),\n p_stat: new TokContext(\"(\", false),\n p_expr: new TokContext(\"(\", true),\n q_tmpl: new TokContext(\"`\", true, true, function (p) { return p.tryReadTemplateToken(); }),\n f_stat: new TokContext(\"function\", false),\n f_expr: new TokContext(\"function\", true),\n f_expr_gen: new TokContext(\"function\", true, false, null, true),\n f_gen: new TokContext(\"function\", false, false, null, true)\n};\n\nvar pp$6 = Parser.prototype;\n\npp$6.initialContext = function() {\n return [types.b_stat]\n};\n\npp$6.curContext = function() {\n return this.context[this.context.length - 1]\n};\n\npp$6.braceIsBlock = function(prevType) {\n var parent = this.curContext();\n if (parent === types.f_expr || parent === types.f_stat)\n { return true }\n if (prevType === types$1.colon && (parent === types.b_stat || parent === types.b_expr))\n { return !parent.isExpr }\n\n // The check for `tt.name && exprAllowed` detects whether we are\n // after a `yield` or `of` construct. See the `updateContext` for\n // `tt.name`.\n if (prevType === types$1._return || prevType === types$1.name && this.exprAllowed)\n { return lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) }\n if (prevType === types$1._else || prevType === types$1.semi || prevType === types$1.eof || prevType === types$1.parenR || prevType === types$1.arrow)\n { return true }\n if (prevType === types$1.braceL)\n { return parent === types.b_stat }\n if (prevType === types$1._var || prevType === types$1._const || prevType === types$1.name)\n { return false }\n return !this.exprAllowed\n};\n\npp$6.inGeneratorContext = function() {\n for (var i = this.context.length - 1; i >= 1; i--) {\n var context = this.context[i];\n if (context.token === \"function\")\n { return context.generator }\n }\n return false\n};\n\npp$6.updateContext = function(prevType) {\n var update, type = this.type;\n if (type.keyword && prevType === types$1.dot)\n { this.exprAllowed = false; }\n else if (update = type.updateContext)\n { update.call(this, prevType); }\n else\n { this.exprAllowed = type.beforeExpr; }\n};\n\n// Used to handle egde case when token context could not be inferred correctly in tokenize phase\npp$6.overrideContext = function(tokenCtx) {\n if (this.curContext() !== tokenCtx) {\n this.context[this.context.length - 1] = tokenCtx;\n }\n};\n\n// Token-specific context update code\n\ntypes$1.parenR.updateContext = types$1.braceR.updateContext = function() {\n if (this.context.length === 1) {\n this.exprAllowed = true;\n return\n }\n var out = this.context.pop();\n if (out === types.b_stat && this.curContext().token === \"function\") {\n out = this.context.pop();\n }\n this.exprAllowed = !out.isExpr;\n};\n\ntypes$1.braceL.updateContext = function(prevType) {\n this.context.push(this.braceIsBlock(prevType) ? types.b_stat : types.b_expr);\n this.exprAllowed = true;\n};\n\ntypes$1.dollarBraceL.updateContext = function() {\n this.context.push(types.b_tmpl);\n this.exprAllowed = true;\n};\n\ntypes$1.parenL.updateContext = function(prevType) {\n var statementParens = prevType === types$1._if || prevType === types$1._for || prevType === types$1._with || prevType === types$1._while;\n this.context.push(statementParens ? types.p_stat : types.p_expr);\n this.exprAllowed = true;\n};\n\ntypes$1.incDec.updateContext = function() {\n // tokExprAllowed stays unchanged\n};\n\ntypes$1._function.updateContext = types$1._class.updateContext = function(prevType) {\n if (prevType.beforeExpr && prevType !== types$1._else &&\n !(prevType === types$1.semi && this.curContext() !== types.p_stat) &&\n !(prevType === types$1._return && lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) &&\n !((prevType === types$1.colon || prevType === types$1.braceL) && this.curContext() === types.b_stat))\n { this.context.push(types.f_expr); }\n else\n { this.context.push(types.f_stat); }\n this.exprAllowed = false;\n};\n\ntypes$1.backQuote.updateContext = function() {\n if (this.curContext() === types.q_tmpl)\n { this.context.pop(); }\n else\n { this.context.push(types.q_tmpl); }\n this.exprAllowed = false;\n};\n\ntypes$1.star.updateContext = function(prevType) {\n if (prevType === types$1._function) {\n var index = this.context.length - 1;\n if (this.context[index] === types.f_expr)\n { this.context[index] = types.f_expr_gen; }\n else\n { this.context[index] = types.f_gen; }\n }\n this.exprAllowed = true;\n};\n\ntypes$1.name.updateContext = function(prevType) {\n var allowed = false;\n if (this.options.ecmaVersion >= 6 && prevType !== types$1.dot) {\n if (this.value === \"of\" && !this.exprAllowed ||\n this.value === \"yield\" && this.inGeneratorContext())\n { allowed = true; }\n }\n this.exprAllowed = allowed;\n};\n\n// A recursive descent parser operates by defining functions for all\n\nvar pp$5 = Parser.prototype;\n\n// Check if property name clashes with already added.\n// Object/class getters and setters are not allowed to clash —\n// either with each other or with an init property — and in\n// strict mode, init properties are also not allowed to be repeated.\n\npp$5.checkPropClash = function(prop, propHash, refDestructuringErrors) {\n if (this.options.ecmaVersion >= 9 && prop.type === \"SpreadElement\")\n { return }\n if (this.options.ecmaVersion >= 6 && (prop.computed || prop.method || prop.shorthand))\n { return }\n var key = prop.key;\n var name;\n switch (key.type) {\n case \"Identifier\": name = key.name; break\n case \"Literal\": name = String(key.value); break\n default: return\n }\n var kind = prop.kind;\n if (this.options.ecmaVersion >= 6) {\n if (name === \"__proto__\" && kind === \"init\") {\n if (propHash.proto) {\n if (refDestructuringErrors) {\n if (refDestructuringErrors.doubleProto < 0) {\n refDestructuringErrors.doubleProto = key.start;\n }\n } else {\n this.raiseRecoverable(key.start, \"Redefinition of __proto__ property\");\n }\n }\n propHash.proto = true;\n }\n return\n }\n name = \"$\" + name;\n var other = propHash[name];\n if (other) {\n var redefinition;\n if (kind === \"init\") {\n redefinition = this.strict && other.init || other.get || other.set;\n } else {\n redefinition = other.init || other[kind];\n }\n if (redefinition)\n { this.raiseRecoverable(key.start, \"Redefinition of property\"); }\n } else {\n other = propHash[name] = {\n init: false,\n get: false,\n set: false\n };\n }\n other[kind] = true;\n};\n\n// ### Expression parsing\n\n// These nest, from the most general expression type at the top to\n// 'atomic', nondivisible expression types at the bottom. Most of\n// the functions will simply let the function(s) below them parse,\n// and, *if* the syntactic construct they handle is present, wrap\n// the AST node that the inner parser gave them in another node.\n\n// Parse a full expression. The optional arguments are used to\n// forbid the `in` operator (in for loops initalization expressions)\n// and provide reference for storing '=' operator inside shorthand\n// property assignment in contexts where both object expression\n// and object pattern might appear (so it's possible to raise\n// delayed syntax error at correct position).\n\npp$5.parseExpression = function(forInit, refDestructuringErrors) {\n var startPos = this.start, startLoc = this.startLoc;\n var expr = this.parseMaybeAssign(forInit, refDestructuringErrors);\n if (this.type === types$1.comma) {\n var node = this.startNodeAt(startPos, startLoc);\n node.expressions = [expr];\n while (this.eat(types$1.comma)) { node.expressions.push(this.parseMaybeAssign(forInit, refDestructuringErrors)); }\n return this.finishNode(node, \"SequenceExpression\")\n }\n return expr\n};\n\n// Parse an assignment expression. This includes applications of\n// operators like `+=`.\n\npp$5.parseMaybeAssign = function(forInit, refDestructuringErrors, afterLeftParse) {\n if (this.isContextual(\"yield\")) {\n if (this.inGenerator) { return this.parseYield(forInit) }\n // The tokenizer will assume an expression is allowed after\n // `yield`, but this isn't that kind of yield\n else { this.exprAllowed = false; }\n }\n\n var ownDestructuringErrors = false, oldParenAssign = -1, oldTrailingComma = -1, oldDoubleProto = -1;\n if (refDestructuringErrors) {\n oldParenAssign = refDestructuringErrors.parenthesizedAssign;\n oldTrailingComma = refDestructuringErrors.trailingComma;\n oldDoubleProto = refDestructuringErrors.doubleProto;\n refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = -1;\n } else {\n refDestructuringErrors = new DestructuringErrors;\n ownDestructuringErrors = true;\n }\n\n var startPos = this.start, startLoc = this.startLoc;\n if (this.type === types$1.parenL || this.type === types$1.name) {\n this.potentialArrowAt = this.start;\n this.potentialArrowInForAwait = forInit === \"await\";\n }\n var left = this.parseMaybeConditional(forInit, refDestructuringErrors);\n if (afterLeftParse) { left = afterLeftParse.call(this, left, startPos, startLoc); }\n if (this.type.isAssign) {\n var node = this.startNodeAt(startPos, startLoc);\n node.operator = this.value;\n if (this.type === types$1.eq)\n { left = this.toAssignable(left, false, refDestructuringErrors); }\n if (!ownDestructuringErrors) {\n refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = refDestructuringErrors.doubleProto = -1;\n }\n if (refDestructuringErrors.shorthandAssign >= left.start)\n { refDestructuringErrors.shorthandAssign = -1; } // reset because shorthand default was used correctly\n if (this.type === types$1.eq)\n { this.checkLValPattern(left); }\n else\n { this.checkLValSimple(left); }\n node.left = left;\n this.next();\n node.right = this.parseMaybeAssign(forInit);\n if (oldDoubleProto > -1) { refDestructuringErrors.doubleProto = oldDoubleProto; }\n return this.finishNode(node, \"AssignmentExpression\")\n } else {\n if (ownDestructuringErrors) { this.checkExpressionErrors(refDestructuringErrors, true); }\n }\n if (oldParenAssign > -1) { refDestructuringErrors.parenthesizedAssign = oldParenAssign; }\n if (oldTrailingComma > -1) { refDestructuringErrors.trailingComma = oldTrailingComma; }\n return left\n};\n\n// Parse a ternary conditional (`?:`) operator.\n\npp$5.parseMaybeConditional = function(forInit, refDestructuringErrors) {\n var startPos = this.start, startLoc = this.startLoc;\n var expr = this.parseExprOps(forInit, refDestructuringErrors);\n if (this.checkExpressionErrors(refDestructuringErrors)) { return expr }\n if (this.eat(types$1.question)) {\n var node = this.startNodeAt(startPos, startLoc);\n node.test = expr;\n node.consequent = this.parseMaybeAssign();\n this.expect(types$1.colon);\n node.alternate = this.parseMaybeAssign(forInit);\n return this.finishNode(node, \"ConditionalExpression\")\n }\n return expr\n};\n\n// Start the precedence parser.\n\npp$5.parseExprOps = function(forInit, refDestructuringErrors) {\n var startPos = this.start, startLoc = this.startLoc;\n var expr = this.parseMaybeUnary(refDestructuringErrors, false, false, forInit);\n if (this.checkExpressionErrors(refDestructuringErrors)) { return expr }\n return expr.start === startPos && expr.type === \"ArrowFunctionExpression\" ? expr : this.parseExprOp(expr, startPos, startLoc, -1, forInit)\n};\n\n// Parse binary operators with the operator precedence parsing\n// algorithm. `left` is the left-hand side of the operator.\n// `minPrec` provides context that allows the function to stop and\n// defer further parser to one of its callers when it encounters an\n// operator that has a lower precedence than the set it is parsing.\n\npp$5.parseExprOp = function(left, leftStartPos, leftStartLoc, minPrec, forInit) {\n var prec = this.type.binop;\n if (prec != null && (!forInit || this.type !== types$1._in)) {\n if (prec > minPrec) {\n var logical = this.type === types$1.logicalOR || this.type === types$1.logicalAND;\n var coalesce = this.type === types$1.coalesce;\n if (coalesce) {\n // Handle the precedence of `tt.coalesce` as equal to the range of logical expressions.\n // In other words, `node.right` shouldn't contain logical expressions in order to check the mixed error.\n prec = types$1.logicalAND.binop;\n }\n var op = this.value;\n this.next();\n var startPos = this.start, startLoc = this.startLoc;\n var right = this.parseExprOp(this.parseMaybeUnary(null, false, false, forInit), startPos, startLoc, prec, forInit);\n var node = this.buildBinary(leftStartPos, leftStartLoc, left, right, op, logical || coalesce);\n if ((logical && this.type === types$1.coalesce) || (coalesce && (this.type === types$1.logicalOR || this.type === types$1.logicalAND))) {\n this.raiseRecoverable(this.start, \"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses\");\n }\n return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec, forInit)\n }\n }\n return left\n};\n\npp$5.buildBinary = function(startPos, startLoc, left, right, op, logical) {\n if (right.type === \"PrivateIdentifier\") { this.raise(right.start, \"Private identifier can only be left side of binary expression\"); }\n var node = this.startNodeAt(startPos, startLoc);\n node.left = left;\n node.operator = op;\n node.right = right;\n return this.finishNode(node, logical ? \"LogicalExpression\" : \"BinaryExpression\")\n};\n\n// Parse unary operators, both prefix and postfix.\n\npp$5.parseMaybeUnary = function(refDestructuringErrors, sawUnary, incDec, forInit) {\n var startPos = this.start, startLoc = this.startLoc, expr;\n if (this.isContextual(\"await\") && this.canAwait) {\n expr = this.parseAwait(forInit);\n sawUnary = true;\n } else if (this.type.prefix) {\n var node = this.startNode(), update = this.type === types$1.incDec;\n node.operator = this.value;\n node.prefix = true;\n this.next();\n node.argument = this.parseMaybeUnary(null, true, update, forInit);\n this.checkExpressionErrors(refDestructuringErrors, true);\n if (update) { this.checkLValSimple(node.argument); }\n else if (this.strict && node.operator === \"delete\" &&\n node.argument.type === \"Identifier\")\n { this.raiseRecoverable(node.start, \"Deleting local variable in strict mode\"); }\n else if (node.operator === \"delete\" && isPrivateFieldAccess(node.argument))\n { this.raiseRecoverable(node.start, \"Private fields can not be deleted\"); }\n else { sawUnary = true; }\n expr = this.finishNode(node, update ? \"UpdateExpression\" : \"UnaryExpression\");\n } else if (!sawUnary && this.type === types$1.privateId) {\n if (forInit || this.privateNameStack.length === 0) { this.unexpected(); }\n expr = this.parsePrivateIdent();\n // only could be private fields in 'in', such as #x in obj\n if (this.type !== types$1._in) { this.unexpected(); }\n } else {\n expr = this.parseExprSubscripts(refDestructuringErrors, forInit);\n if (this.checkExpressionErrors(refDestructuringErrors)) { return expr }\n while (this.type.postfix && !this.canInsertSemicolon()) {\n var node$1 = this.startNodeAt(startPos, startLoc);\n node$1.operator = this.value;\n node$1.prefix = false;\n node$1.argument = expr;\n this.checkLValSimple(expr);\n this.next();\n expr = this.finishNode(node$1, \"UpdateExpression\");\n }\n }\n\n if (!incDec && this.eat(types$1.starstar)) {\n if (sawUnary)\n { this.unexpected(this.lastTokStart); }\n else\n { return this.buildBinary(startPos, startLoc, expr, this.parseMaybeUnary(null, false, false, forInit), \"**\", false) }\n } else {\n return expr\n }\n};\n\nfunction isPrivateFieldAccess(node) {\n return (\n node.type === \"MemberExpression\" && node.property.type === \"PrivateIdentifier\" ||\n node.type === \"ChainExpression\" && isPrivateFieldAccess(node.expression)\n )\n}\n\n// Parse call, dot, and `[]`-subscript expressions.\n\npp$5.parseExprSubscripts = function(refDestructuringErrors, forInit) {\n var startPos = this.start, startLoc = this.startLoc;\n var expr = this.parseExprAtom(refDestructuringErrors, forInit);\n if (expr.type === \"ArrowFunctionExpression\" && this.input.slice(this.lastTokStart, this.lastTokEnd) !== \")\")\n { return expr }\n var result = this.parseSubscripts(expr, startPos, startLoc, false, forInit);\n if (refDestructuringErrors && result.type === \"MemberExpression\") {\n if (refDestructuringErrors.parenthesizedAssign >= result.start) { refDestructuringErrors.parenthesizedAssign = -1; }\n if (refDestructuringErrors.parenthesizedBind >= result.start) { refDestructuringErrors.parenthesizedBind = -1; }\n if (refDestructuringErrors.trailingComma >= result.start) { refDestructuringErrors.trailingComma = -1; }\n }\n return result\n};\n\npp$5.parseSubscripts = function(base, startPos, startLoc, noCalls, forInit) {\n var maybeAsyncArrow = this.options.ecmaVersion >= 8 && base.type === \"Identifier\" && base.name === \"async\" &&\n this.lastTokEnd === base.end && !this.canInsertSemicolon() && base.end - base.start === 5 &&\n this.potentialArrowAt === base.start;\n var optionalChained = false;\n\n while (true) {\n var element = this.parseSubscript(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained, forInit);\n\n if (element.optional) { optionalChained = true; }\n if (element === base || element.type === \"ArrowFunctionExpression\") {\n if (optionalChained) {\n var chainNode = this.startNodeAt(startPos, startLoc);\n chainNode.expression = element;\n element = this.finishNode(chainNode, \"ChainExpression\");\n }\n return element\n }\n\n base = element;\n }\n};\n\npp$5.parseSubscript = function(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained, forInit) {\n var optionalSupported = this.options.ecmaVersion >= 11;\n var optional = optionalSupported && this.eat(types$1.questionDot);\n if (noCalls && optional) { this.raise(this.lastTokStart, \"Optional chaining cannot appear in the callee of new expressions\"); }\n\n var computed = this.eat(types$1.bracketL);\n if (computed || (optional && this.type !== types$1.parenL && this.type !== types$1.backQuote) || this.eat(types$1.dot)) {\n var node = this.startNodeAt(startPos, startLoc);\n node.object = base;\n if (computed) {\n node.property = this.parseExpression();\n this.expect(types$1.bracketR);\n } else if (this.type === types$1.privateId && base.type !== \"Super\") {\n node.property = this.parsePrivateIdent();\n } else {\n node.property = this.parseIdent(this.options.allowReserved !== \"never\");\n }\n node.computed = !!computed;\n if (optionalSupported) {\n node.optional = optional;\n }\n base = this.finishNode(node, \"MemberExpression\");\n } else if (!noCalls && this.eat(types$1.parenL)) {\n var refDestructuringErrors = new DestructuringErrors, oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos;\n this.yieldPos = 0;\n this.awaitPos = 0;\n this.awaitIdentPos = 0;\n var exprList = this.parseExprList(types$1.parenR, this.options.ecmaVersion >= 8, false, refDestructuringErrors);\n if (maybeAsyncArrow && !optional && !this.canInsertSemicolon() && this.eat(types$1.arrow)) {\n this.checkPatternErrors(refDestructuringErrors, false);\n this.checkYieldAwaitInDefaultParams();\n if (this.awaitIdentPos > 0)\n { this.raise(this.awaitIdentPos, \"Cannot use 'await' as identifier inside an async function\"); }\n this.yieldPos = oldYieldPos;\n this.awaitPos = oldAwaitPos;\n this.awaitIdentPos = oldAwaitIdentPos;\n return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, true, forInit)\n }\n this.checkExpressionErrors(refDestructuringErrors, true);\n this.yieldPos = oldYieldPos || this.yieldPos;\n this.awaitPos = oldAwaitPos || this.awaitPos;\n this.awaitIdentPos = oldAwaitIdentPos || this.awaitIdentPos;\n var node$1 = this.startNodeAt(startPos, startLoc);\n node$1.callee = base;\n node$1.arguments = exprList;\n if (optionalSupported) {\n node$1.optional = optional;\n }\n base = this.finishNode(node$1, \"CallExpression\");\n } else if (this.type === types$1.backQuote) {\n if (optional || optionalChained) {\n this.raise(this.start, \"Optional chaining cannot appear in the tag of tagged template expressions\");\n }\n var node$2 = this.startNodeAt(startPos, startLoc);\n node$2.tag = base;\n node$2.quasi = this.parseTemplate({isTagged: true});\n base = this.finishNode(node$2, \"TaggedTemplateExpression\");\n }\n return base\n};\n\n// Parse an atomic expression — either a single token that is an\n// expression, an expression started by a keyword like `function` or\n// `new`, or an expression wrapped in punctuation like `()`, `[]`,\n// or `{}`.\n\npp$5.parseExprAtom = function(refDestructuringErrors, forInit) {\n // If a division operator appears in an expression position, the\n // tokenizer got confused, and we force it to read a regexp instead.\n if (this.type === types$1.slash) { this.readRegexp(); }\n\n var node, canBeArrow = this.potentialArrowAt === this.start;\n switch (this.type) {\n case types$1._super:\n if (!this.allowSuper)\n { this.raise(this.start, \"'super' keyword outside a method\"); }\n node = this.startNode();\n this.next();\n if (this.type === types$1.parenL && !this.allowDirectSuper)\n { this.raise(node.start, \"super() call outside constructor of a subclass\"); }\n // The `super` keyword can appear at below:\n // SuperProperty:\n // super [ Expression ]\n // super . IdentifierName\n // SuperCall:\n // super ( Arguments )\n if (this.type !== types$1.dot && this.type !== types$1.bracketL && this.type !== types$1.parenL)\n { this.unexpected(); }\n return this.finishNode(node, \"Super\")\n\n case types$1._this:\n node = this.startNode();\n this.next();\n return this.finishNode(node, \"ThisExpression\")\n\n case types$1.name:\n var startPos = this.start, startLoc = this.startLoc, containsEsc = this.containsEsc;\n var id = this.parseIdent(false);\n if (this.options.ecmaVersion >= 8 && !containsEsc && id.name === \"async\" && !this.canInsertSemicolon() && this.eat(types$1._function)) {\n this.overrideContext(types.f_expr);\n return this.parseFunction(this.startNodeAt(startPos, startLoc), 0, false, true, forInit)\n }\n if (canBeArrow && !this.canInsertSemicolon()) {\n if (this.eat(types$1.arrow))\n { return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], false, forInit) }\n if (this.options.ecmaVersion >= 8 && id.name === \"async\" && this.type === types$1.name && !containsEsc &&\n (!this.potentialArrowInForAwait || this.value !== \"of\" || this.containsEsc)) {\n id = this.parseIdent(false);\n if (this.canInsertSemicolon() || !this.eat(types$1.arrow))\n { this.unexpected(); }\n return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], true, forInit)\n }\n }\n return id\n\n case types$1.regexp:\n var value = this.value;\n node = this.parseLiteral(value.value);\n node.regex = {pattern: value.pattern, flags: value.flags};\n return node\n\n case types$1.num: case types$1.string:\n return this.parseLiteral(this.value)\n\n case types$1._null: case types$1._true: case types$1._false:\n node = this.startNode();\n node.value = this.type === types$1._null ? null : this.type === types$1._true;\n node.raw = this.type.keyword;\n this.next();\n return this.finishNode(node, \"Literal\")\n\n case types$1.parenL:\n var start = this.start, expr = this.parseParenAndDistinguishExpression(canBeArrow, forInit);\n if (refDestructuringErrors) {\n if (refDestructuringErrors.parenthesizedAssign < 0 && !this.isSimpleAssignTarget(expr))\n { refDestructuringErrors.parenthesizedAssign = start; }\n if (refDestructuringErrors.parenthesizedBind < 0)\n { refDestructuringErrors.parenthesizedBind = start; }\n }\n return expr\n\n case types$1.bracketL:\n node = this.startNode();\n this.next();\n node.elements = this.parseExprList(types$1.bracketR, true, true, refDestructuringErrors);\n return this.finishNode(node, \"ArrayExpression\")\n\n case types$1.braceL:\n this.overrideContext(types.b_expr);\n return this.parseObj(false, refDestructuringErrors)\n\n case types$1._function:\n node = this.startNode();\n this.next();\n return this.parseFunction(node, 0)\n\n case types$1._class:\n return this.parseClass(this.startNode(), false)\n\n case types$1._new:\n return this.parseNew()\n\n case types$1.backQuote:\n return this.parseTemplate()\n\n case types$1._import:\n if (this.options.ecmaVersion >= 11) {\n return this.parseExprImport()\n } else {\n return this.unexpected()\n }\n\n default:\n this.unexpected();\n }\n};\n\npp$5.parseExprImport = function() {\n var node = this.startNode();\n\n // Consume `import` as an identifier for `import.meta`.\n // Because `this.parseIdent(true)` doesn't check escape sequences, it needs the check of `this.containsEsc`.\n if (this.containsEsc) { this.raiseRecoverable(this.start, \"Escape sequence in keyword import\"); }\n var meta = this.parseIdent(true);\n\n switch (this.type) {\n case types$1.parenL:\n return this.parseDynamicImport(node)\n case types$1.dot:\n node.meta = meta;\n return this.parseImportMeta(node)\n default:\n this.unexpected();\n }\n};\n\npp$5.parseDynamicImport = function(node) {\n this.next(); // skip `(`\n\n // Parse node.source.\n node.source = this.parseMaybeAssign();\n\n // Verify ending.\n if (!this.eat(types$1.parenR)) {\n var errorPos = this.start;\n if (this.eat(types$1.comma) && this.eat(types$1.parenR)) {\n this.raiseRecoverable(errorPos, \"Trailing comma is not allowed in import()\");\n } else {\n this.unexpected(errorPos);\n }\n }\n\n return this.finishNode(node, \"ImportExpression\")\n};\n\npp$5.parseImportMeta = function(node) {\n this.next(); // skip `.`\n\n var containsEsc = this.containsEsc;\n node.property = this.parseIdent(true);\n\n if (node.property.name !== \"meta\")\n { this.raiseRecoverable(node.property.start, \"The only valid meta property for import is 'import.meta'\"); }\n if (containsEsc)\n { this.raiseRecoverable(node.start, \"'import.meta' must not contain escaped characters\"); }\n if (this.options.sourceType !== \"module\" && !this.options.allowImportExportEverywhere)\n { this.raiseRecoverable(node.start, \"Cannot use 'import.meta' outside a module\"); }\n\n return this.finishNode(node, \"MetaProperty\")\n};\n\npp$5.parseLiteral = function(value) {\n var node = this.startNode();\n node.value = value;\n node.raw = this.input.slice(this.start, this.end);\n if (node.raw.charCodeAt(node.raw.length - 1) === 110) { node.bigint = node.raw.slice(0, -1).replace(/_/g, \"\"); }\n this.next();\n return this.finishNode(node, \"Literal\")\n};\n\npp$5.parseParenExpression = function() {\n this.expect(types$1.parenL);\n var val = this.parseExpression();\n this.expect(types$1.parenR);\n return val\n};\n\npp$5.parseParenAndDistinguishExpression = function(canBeArrow, forInit) {\n var startPos = this.start, startLoc = this.startLoc, val, allowTrailingComma = this.options.ecmaVersion >= 8;\n if (this.options.ecmaVersion >= 6) {\n this.next();\n\n var innerStartPos = this.start, innerStartLoc = this.startLoc;\n var exprList = [], first = true, lastIsComma = false;\n var refDestructuringErrors = new DestructuringErrors, oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, spreadStart;\n this.yieldPos = 0;\n this.awaitPos = 0;\n // Do not save awaitIdentPos to allow checking awaits nested in parameters\n while (this.type !== types$1.parenR) {\n first ? first = false : this.expect(types$1.comma);\n if (allowTrailingComma && this.afterTrailingComma(types$1.parenR, true)) {\n lastIsComma = true;\n break\n } else if (this.type === types$1.ellipsis) {\n spreadStart = this.start;\n exprList.push(this.parseParenItem(this.parseRestBinding()));\n if (this.type === types$1.comma) { this.raise(this.start, \"Comma is not permitted after the rest element\"); }\n break\n } else {\n exprList.push(this.parseMaybeAssign(false, refDestructuringErrors, this.parseParenItem));\n }\n }\n var innerEndPos = this.lastTokEnd, innerEndLoc = this.lastTokEndLoc;\n this.expect(types$1.parenR);\n\n if (canBeArrow && !this.canInsertSemicolon() && this.eat(types$1.arrow)) {\n this.checkPatternErrors(refDestructuringErrors, false);\n this.checkYieldAwaitInDefaultParams();\n this.yieldPos = oldYieldPos;\n this.awaitPos = oldAwaitPos;\n return this.parseParenArrowList(startPos, startLoc, exprList, forInit)\n }\n\n if (!exprList.length || lastIsComma) { this.unexpected(this.lastTokStart); }\n if (spreadStart) { this.unexpected(spreadStart); }\n this.checkExpressionErrors(refDestructuringErrors, true);\n this.yieldPos = oldYieldPos || this.yieldPos;\n this.awaitPos = oldAwaitPos || this.awaitPos;\n\n if (exprList.length > 1) {\n val = this.startNodeAt(innerStartPos, innerStartLoc);\n val.expressions = exprList;\n this.finishNodeAt(val, \"SequenceExpression\", innerEndPos, innerEndLoc);\n } else {\n val = exprList[0];\n }\n } else {\n val = this.parseParenExpression();\n }\n\n if (this.options.preserveParens) {\n var par = this.startNodeAt(startPos, startLoc);\n par.expression = val;\n return this.finishNode(par, \"ParenthesizedExpression\")\n } else {\n return val\n }\n};\n\npp$5.parseParenItem = function(item) {\n return item\n};\n\npp$5.parseParenArrowList = function(startPos, startLoc, exprList, forInit) {\n return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, false, forInit)\n};\n\n// New's precedence is slightly tricky. It must allow its argument to\n// be a `[]` or dot subscript expression, but not a call — at least,\n// not without wrapping it in parentheses. Thus, it uses the noCalls\n// argument to parseSubscripts to prevent it from consuming the\n// argument list.\n\nvar empty = [];\n\npp$5.parseNew = function() {\n if (this.containsEsc) { this.raiseRecoverable(this.start, \"Escape sequence in keyword new\"); }\n var node = this.startNode();\n var meta = this.parseIdent(true);\n if (this.options.ecmaVersion >= 6 && this.eat(types$1.dot)) {\n node.meta = meta;\n var containsEsc = this.containsEsc;\n node.property = this.parseIdent(true);\n if (node.property.name !== \"target\")\n { this.raiseRecoverable(node.property.start, \"The only valid meta property for new is 'new.target'\"); }\n if (containsEsc)\n { this.raiseRecoverable(node.start, \"'new.target' must not contain escaped characters\"); }\n if (!this.allowNewDotTarget)\n { this.raiseRecoverable(node.start, \"'new.target' can only be used in functions and class static block\"); }\n return this.finishNode(node, \"MetaProperty\")\n }\n var startPos = this.start, startLoc = this.startLoc, isImport = this.type === types$1._import;\n node.callee = this.parseSubscripts(this.parseExprAtom(), startPos, startLoc, true, false);\n if (isImport && node.callee.type === \"ImportExpression\") {\n this.raise(startPos, \"Cannot use new with import()\");\n }\n if (this.eat(types$1.parenL)) { node.arguments = this.parseExprList(types$1.parenR, this.options.ecmaVersion >= 8, false); }\n else { node.arguments = empty; }\n return this.finishNode(node, \"NewExpression\")\n};\n\n// Parse template expression.\n\npp$5.parseTemplateElement = function(ref) {\n var isTagged = ref.isTagged;\n\n var elem = this.startNode();\n if (this.type === types$1.invalidTemplate) {\n if (!isTagged) {\n this.raiseRecoverable(this.start, \"Bad escape sequence in untagged template literal\");\n }\n elem.value = {\n raw: this.value,\n cooked: null\n };\n } else {\n elem.value = {\n raw: this.input.slice(this.start, this.end).replace(/\\r\\n?/g, \"\\n\"),\n cooked: this.value\n };\n }\n this.next();\n elem.tail = this.type === types$1.backQuote;\n return this.finishNode(elem, \"TemplateElement\")\n};\n\npp$5.parseTemplate = function(ref) {\n if ( ref === void 0 ) ref = {};\n var isTagged = ref.isTagged; if ( isTagged === void 0 ) isTagged = false;\n\n var node = this.startNode();\n this.next();\n node.expressions = [];\n var curElt = this.parseTemplateElement({isTagged: isTagged});\n node.quasis = [curElt];\n while (!curElt.tail) {\n if (this.type === types$1.eof) { this.raise(this.pos, \"Unterminated template literal\"); }\n this.expect(types$1.dollarBraceL);\n node.expressions.push(this.parseExpression());\n this.expect(types$1.braceR);\n node.quasis.push(curElt = this.parseTemplateElement({isTagged: isTagged}));\n }\n this.next();\n return this.finishNode(node, \"TemplateLiteral\")\n};\n\npp$5.isAsyncProp = function(prop) {\n return !prop.computed && prop.key.type === \"Identifier\" && prop.key.name === \"async\" &&\n (this.type === types$1.name || this.type === types$1.num || this.type === types$1.string || this.type === types$1.bracketL || this.type.keyword || (this.options.ecmaVersion >= 9 && this.type === types$1.star)) &&\n !lineBreak.test(this.input.slice(this.lastTokEnd, this.start))\n};\n\n// Parse an object literal or binding pattern.\n\npp$5.parseObj = function(isPattern, refDestructuringErrors) {\n var node = this.startNode(), first = true, propHash = {};\n node.properties = [];\n this.next();\n while (!this.eat(types$1.braceR)) {\n if (!first) {\n this.expect(types$1.comma);\n if (this.options.ecmaVersion >= 5 && this.afterTrailingComma(types$1.braceR)) { break }\n } else { first = false; }\n\n var prop = this.parseProperty(isPattern, refDestructuringErrors);\n if (!isPattern) { this.checkPropClash(prop, propHash, refDestructuringErrors); }\n node.properties.push(prop);\n }\n return this.finishNode(node, isPattern ? \"ObjectPattern\" : \"ObjectExpression\")\n};\n\npp$5.parseProperty = function(isPattern, refDestructuringErrors) {\n var prop = this.startNode(), isGenerator, isAsync, startPos, startLoc;\n if (this.options.ecmaVersion >= 9 && this.eat(types$1.ellipsis)) {\n if (isPattern) {\n prop.argument = this.parseIdent(false);\n if (this.type === types$1.comma) {\n this.raise(this.start, \"Comma is not permitted after the rest element\");\n }\n return this.finishNode(prop, \"RestElement\")\n }\n // To disallow parenthesized identifier via `this.toAssignable()`.\n if (this.type === types$1.parenL && refDestructuringErrors) {\n if (refDestructuringErrors.parenthesizedAssign < 0) {\n refDestructuringErrors.parenthesizedAssign = this.start;\n }\n if (refDestructuringErrors.parenthesizedBind < 0) {\n refDestructuringErrors.parenthesizedBind = this.start;\n }\n }\n // Parse argument.\n prop.argument = this.parseMaybeAssign(false, refDestructuringErrors);\n // To disallow trailing comma via `this.toAssignable()`.\n if (this.type === types$1.comma && refDestructuringErrors && refDestructuringErrors.trailingComma < 0) {\n refDestructuringErrors.trailingComma = this.start;\n }\n // Finish\n return this.finishNode(prop, \"SpreadElement\")\n }\n if (this.options.ecmaVersion >= 6) {\n prop.method = false;\n prop.shorthand = false;\n if (isPattern || refDestructuringErrors) {\n startPos = this.start;\n startLoc = this.startLoc;\n }\n if (!isPattern)\n { isGenerator = this.eat(types$1.star); }\n }\n var containsEsc = this.containsEsc;\n this.parsePropertyName(prop);\n if (!isPattern && !containsEsc && this.options.ecmaVersion >= 8 && !isGenerator && this.isAsyncProp(prop)) {\n isAsync = true;\n isGenerator = this.options.ecmaVersion >= 9 && this.eat(types$1.star);\n this.parsePropertyName(prop, refDestructuringErrors);\n } else {\n isAsync = false;\n }\n this.parsePropertyValue(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc);\n return this.finishNode(prop, \"Property\")\n};\n\npp$5.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc) {\n if ((isGenerator || isAsync) && this.type === types$1.colon)\n { this.unexpected(); }\n\n if (this.eat(types$1.colon)) {\n prop.value = isPattern ? this.parseMaybeDefault(this.start, this.startLoc) : this.parseMaybeAssign(false, refDestructuringErrors);\n prop.kind = \"init\";\n } else if (this.options.ecmaVersion >= 6 && this.type === types$1.parenL) {\n if (isPattern) { this.unexpected(); }\n prop.kind = \"init\";\n prop.method = true;\n prop.value = this.parseMethod(isGenerator, isAsync);\n } else if (!isPattern && !containsEsc &&\n this.options.ecmaVersion >= 5 && !prop.computed && prop.key.type === \"Identifier\" &&\n (prop.key.name === \"get\" || prop.key.name === \"set\") &&\n (this.type !== types$1.comma && this.type !== types$1.braceR && this.type !== types$1.eq)) {\n if (isGenerator || isAsync) { this.unexpected(); }\n prop.kind = prop.key.name;\n this.parsePropertyName(prop);\n prop.value = this.parseMethod(false);\n var paramCount = prop.kind === \"get\" ? 0 : 1;\n if (prop.value.params.length !== paramCount) {\n var start = prop.value.start;\n if (prop.kind === \"get\")\n { this.raiseRecoverable(start, \"getter should have no params\"); }\n else\n { this.raiseRecoverable(start, \"setter should have exactly one param\"); }\n } else {\n if (prop.kind === \"set\" && prop.value.params[0].type === \"RestElement\")\n { this.raiseRecoverable(prop.value.params[0].start, \"Setter cannot use rest params\"); }\n }\n } else if (this.options.ecmaVersion >= 6 && !prop.computed && prop.key.type === \"Identifier\") {\n if (isGenerator || isAsync) { this.unexpected(); }\n this.checkUnreserved(prop.key);\n if (prop.key.name === \"await\" && !this.awaitIdentPos)\n { this.awaitIdentPos = startPos; }\n prop.kind = \"init\";\n if (isPattern) {\n prop.value = this.parseMaybeDefault(startPos, startLoc, this.copyNode(prop.key));\n } else if (this.type === types$1.eq && refDestructuringErrors) {\n if (refDestructuringErrors.shorthandAssign < 0)\n { refDestructuringErrors.shorthandAssign = this.start; }\n prop.value = this.parseMaybeDefault(startPos, startLoc, this.copyNode(prop.key));\n } else {\n prop.value = this.copyNode(prop.key);\n }\n prop.shorthand = true;\n } else { this.unexpected(); }\n};\n\npp$5.parsePropertyName = function(prop) {\n if (this.options.ecmaVersion >= 6) {\n if (this.eat(types$1.bracketL)) {\n prop.computed = true;\n prop.key = this.parseMaybeAssign();\n this.expect(types$1.bracketR);\n return prop.key\n } else {\n prop.computed = false;\n }\n }\n return prop.key = this.type === types$1.num || this.type === types$1.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== \"never\")\n};\n\n// Initialize empty function node.\n\npp$5.initFunction = function(node) {\n node.id = null;\n if (this.options.ecmaVersion >= 6) { node.generator = node.expression = false; }\n if (this.options.ecmaVersion >= 8) { node.async = false; }\n};\n\n// Parse object or class method.\n\npp$5.parseMethod = function(isGenerator, isAsync, allowDirectSuper) {\n var node = this.startNode(), oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos;\n\n this.initFunction(node);\n if (this.options.ecmaVersion >= 6)\n { node.generator = isGenerator; }\n if (this.options.ecmaVersion >= 8)\n { node.async = !!isAsync; }\n\n this.yieldPos = 0;\n this.awaitPos = 0;\n this.awaitIdentPos = 0;\n this.enterScope(functionFlags(isAsync, node.generator) | SCOPE_SUPER | (allowDirectSuper ? SCOPE_DIRECT_SUPER : 0));\n\n this.expect(types$1.parenL);\n node.params = this.parseBindingList(types$1.parenR, false, this.options.ecmaVersion >= 8);\n this.checkYieldAwaitInDefaultParams();\n this.parseFunctionBody(node, false, true, false);\n\n this.yieldPos = oldYieldPos;\n this.awaitPos = oldAwaitPos;\n this.awaitIdentPos = oldAwaitIdentPos;\n return this.finishNode(node, \"FunctionExpression\")\n};\n\n// Parse arrow function expression with given parameters.\n\npp$5.parseArrowExpression = function(node, params, isAsync, forInit) {\n var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos;\n\n this.enterScope(functionFlags(isAsync, false) | SCOPE_ARROW);\n this.initFunction(node);\n if (this.options.ecmaVersion >= 8) { node.async = !!isAsync; }\n\n this.yieldPos = 0;\n this.awaitPos = 0;\n this.awaitIdentPos = 0;\n\n node.params = this.toAssignableList(params, true);\n this.parseFunctionBody(node, true, false, forInit);\n\n this.yieldPos = oldYieldPos;\n this.awaitPos = oldAwaitPos;\n this.awaitIdentPos = oldAwaitIdentPos;\n return this.finishNode(node, \"ArrowFunctionExpression\")\n};\n\n// Parse function body and check parameters.\n\npp$5.parseFunctionBody = function(node, isArrowFunction, isMethod, forInit) {\n var isExpression = isArrowFunction && this.type !== types$1.braceL;\n var oldStrict = this.strict, useStrict = false;\n\n if (isExpression) {\n node.body = this.parseMaybeAssign(forInit);\n node.expression = true;\n this.checkParams(node, false);\n } else {\n var nonSimple = this.options.ecmaVersion >= 7 && !this.isSimpleParamList(node.params);\n if (!oldStrict || nonSimple) {\n useStrict = this.strictDirective(this.end);\n // If this is a strict mode function, verify that argument names\n // are not repeated, and it does not try to bind the words `eval`\n // or `arguments`.\n if (useStrict && nonSimple)\n { this.raiseRecoverable(node.start, \"Illegal 'use strict' directive in function with non-simple parameter list\"); }\n }\n // Start a new scope with regard to labels and the `inFunction`\n // flag (restore them to their old value afterwards).\n var oldLabels = this.labels;\n this.labels = [];\n if (useStrict) { this.strict = true; }\n\n // Add the params to varDeclaredNames to ensure that an error is thrown\n // if a let/const declaration in the function clashes with one of the params.\n this.checkParams(node, !oldStrict && !useStrict && !isArrowFunction && !isMethod && this.isSimpleParamList(node.params));\n // Ensure the function name isn't a forbidden identifier in strict mode, e.g. 'eval'\n if (this.strict && node.id) { this.checkLValSimple(node.id, BIND_OUTSIDE); }\n node.body = this.parseBlock(false, undefined, useStrict && !oldStrict);\n node.expression = false;\n this.adaptDirectivePrologue(node.body.body);\n this.labels = oldLabels;\n }\n this.exitScope();\n};\n\npp$5.isSimpleParamList = function(params) {\n for (var i = 0, list = params; i < list.length; i += 1)\n {\n var param = list[i];\n\n if (param.type !== \"Identifier\") { return false\n } }\n return true\n};\n\n// Checks function params for various disallowed patterns such as using \"eval\"\n// or \"arguments\" and duplicate parameters.\n\npp$5.checkParams = function(node, allowDuplicates) {\n var nameHash = Object.create(null);\n for (var i = 0, list = node.params; i < list.length; i += 1)\n {\n var param = list[i];\n\n this.checkLValInnerPattern(param, BIND_VAR, allowDuplicates ? null : nameHash);\n }\n};\n\n// Parses a comma-separated list of expressions, and returns them as\n// an array. `close` is the token type that ends the list, and\n// `allowEmpty` can be turned on to allow subsequent commas with\n// nothing in between them to be parsed as `null` (which is needed\n// for array literals).\n\npp$5.parseExprList = function(close, allowTrailingComma, allowEmpty, refDestructuringErrors) {\n var elts = [], first = true;\n while (!this.eat(close)) {\n if (!first) {\n this.expect(types$1.comma);\n if (allowTrailingComma && this.afterTrailingComma(close)) { break }\n } else { first = false; }\n\n var elt = (void 0);\n if (allowEmpty && this.type === types$1.comma)\n { elt = null; }\n else if (this.type === types$1.ellipsis) {\n elt = this.parseSpread(refDestructuringErrors);\n if (refDestructuringErrors && this.type === types$1.comma && refDestructuringErrors.trailingComma < 0)\n { refDestructuringErrors.trailingComma = this.start; }\n } else {\n elt = this.parseMaybeAssign(false, refDestructuringErrors);\n }\n elts.push(elt);\n }\n return elts\n};\n\npp$5.checkUnreserved = function(ref) {\n var start = ref.start;\n var end = ref.end;\n var name = ref.name;\n\n if (this.inGenerator && name === \"yield\")\n { this.raiseRecoverable(start, \"Cannot use 'yield' as identifier inside a generator\"); }\n if (this.inAsync && name === \"await\")\n { this.raiseRecoverable(start, \"Cannot use 'await' as identifier inside an async function\"); }\n if (this.currentThisScope().inClassFieldInit && name === \"arguments\")\n { this.raiseRecoverable(start, \"Cannot use 'arguments' in class field initializer\"); }\n if (this.inClassStaticBlock && (name === \"arguments\" || name === \"await\"))\n { this.raise(start, (\"Cannot use \" + name + \" in class static initialization block\")); }\n if (this.keywords.test(name))\n { this.raise(start, (\"Unexpected keyword '\" + name + \"'\")); }\n if (this.options.ecmaVersion < 6 &&\n this.input.slice(start, end).indexOf(\"\\\\\") !== -1) { return }\n var re = this.strict ? this.reservedWordsStrict : this.reservedWords;\n if (re.test(name)) {\n if (!this.inAsync && name === \"await\")\n { this.raiseRecoverable(start, \"Cannot use keyword 'await' outside an async function\"); }\n this.raiseRecoverable(start, (\"The keyword '\" + name + \"' is reserved\"));\n }\n};\n\n// Parse the next token as an identifier. If `liberal` is true (used\n// when parsing properties), it will also convert keywords into\n// identifiers.\n\npp$5.parseIdent = function(liberal, isBinding) {\n var node = this.startNode();\n if (this.type === types$1.name) {\n node.name = this.value;\n } else if (this.type.keyword) {\n node.name = this.type.keyword;\n\n // To fix https://github.com/acornjs/acorn/issues/575\n // `class` and `function` keywords push new context into this.context.\n // But there is no chance to pop the context if the keyword is consumed as an identifier such as a property name.\n // If the previous token is a dot, this does not apply because the context-managing code already ignored the keyword\n if ((node.name === \"class\" || node.name === \"function\") &&\n (this.lastTokEnd !== this.lastTokStart + 1 || this.input.charCodeAt(this.lastTokStart) !== 46)) {\n this.context.pop();\n }\n } else {\n this.unexpected();\n }\n this.next(!!liberal);\n this.finishNode(node, \"Identifier\");\n if (!liberal) {\n this.checkUnreserved(node);\n if (node.name === \"await\" && !this.awaitIdentPos)\n { this.awaitIdentPos = node.start; }\n }\n return node\n};\n\npp$5.parsePrivateIdent = function() {\n var node = this.startNode();\n if (this.type === types$1.privateId) {\n node.name = this.value;\n } else {\n this.unexpected();\n }\n this.next();\n this.finishNode(node, \"PrivateIdentifier\");\n\n // For validating existence\n if (this.privateNameStack.length === 0) {\n this.raise(node.start, (\"Private field '#\" + (node.name) + \"' must be declared in an enclosing class\"));\n } else {\n this.privateNameStack[this.privateNameStack.length - 1].used.push(node);\n }\n\n return node\n};\n\n// Parses yield expression inside generator.\n\npp$5.parseYield = function(forInit) {\n if (!this.yieldPos) { this.yieldPos = this.start; }\n\n var node = this.startNode();\n this.next();\n if (this.type === types$1.semi || this.canInsertSemicolon() || (this.type !== types$1.star && !this.type.startsExpr)) {\n node.delegate = false;\n node.argument = null;\n } else {\n node.delegate = this.eat(types$1.star);\n node.argument = this.parseMaybeAssign(forInit);\n }\n return this.finishNode(node, \"YieldExpression\")\n};\n\npp$5.parseAwait = function(forInit) {\n if (!this.awaitPos) { this.awaitPos = this.start; }\n\n var node = this.startNode();\n this.next();\n node.argument = this.parseMaybeUnary(null, true, false, forInit);\n return this.finishNode(node, \"AwaitExpression\")\n};\n\nvar pp$4 = Parser.prototype;\n\n// This function is used to raise exceptions on parse errors. It\n// takes an offset integer (into the current `input`) to indicate\n// the location of the error, attaches the position to the end\n// of the error message, and then raises a `SyntaxError` with that\n// message.\n\npp$4.raise = function(pos, message) {\n var loc = getLineInfo(this.input, pos);\n message += \" (\" + loc.line + \":\" + loc.column + \")\";\n var err = new SyntaxError(message);\n err.pos = pos; err.loc = loc; err.raisedAt = this.pos;\n throw err\n};\n\npp$4.raiseRecoverable = pp$4.raise;\n\npp$4.curPosition = function() {\n if (this.options.locations) {\n return new Position(this.curLine, this.pos - this.lineStart)\n }\n};\n\nvar pp$3 = Parser.prototype;\n\nvar Scope = function Scope(flags) {\n this.flags = flags;\n // A list of var-declared names in the current lexical scope\n this.var = [];\n // A list of lexically-declared names in the current lexical scope\n this.lexical = [];\n // A list of lexically-declared FunctionDeclaration names in the current lexical scope\n this.functions = [];\n // A switch to disallow the identifier reference 'arguments'\n this.inClassFieldInit = false;\n};\n\n// The functions in this module keep track of declared variables in the current scope in order to detect duplicate variable names.\n\npp$3.enterScope = function(flags) {\n this.scopeStack.push(new Scope(flags));\n};\n\npp$3.exitScope = function() {\n this.scopeStack.pop();\n};\n\n// The spec says:\n// > At the top level of a function, or script, function declarations are\n// > treated like var declarations rather than like lexical declarations.\npp$3.treatFunctionsAsVarInScope = function(scope) {\n return (scope.flags & SCOPE_FUNCTION) || !this.inModule && (scope.flags & SCOPE_TOP)\n};\n\npp$3.declareName = function(name, bindingType, pos) {\n var redeclared = false;\n if (bindingType === BIND_LEXICAL) {\n var scope = this.currentScope();\n redeclared = scope.lexical.indexOf(name) > -1 || scope.functions.indexOf(name) > -1 || scope.var.indexOf(name) > -1;\n scope.lexical.push(name);\n if (this.inModule && (scope.flags & SCOPE_TOP))\n { delete this.undefinedExports[name]; }\n } else if (bindingType === BIND_SIMPLE_CATCH) {\n var scope$1 = this.currentScope();\n scope$1.lexical.push(name);\n } else if (bindingType === BIND_FUNCTION) {\n var scope$2 = this.currentScope();\n if (this.treatFunctionsAsVar)\n { redeclared = scope$2.lexical.indexOf(name) > -1; }\n else\n { redeclared = scope$2.lexical.indexOf(name) > -1 || scope$2.var.indexOf(name) > -1; }\n scope$2.functions.push(name);\n } else {\n for (var i = this.scopeStack.length - 1; i >= 0; --i) {\n var scope$3 = this.scopeStack[i];\n if (scope$3.lexical.indexOf(name) > -1 && !((scope$3.flags & SCOPE_SIMPLE_CATCH) && scope$3.lexical[0] === name) ||\n !this.treatFunctionsAsVarInScope(scope$3) && scope$3.functions.indexOf(name) > -1) {\n redeclared = true;\n break\n }\n scope$3.var.push(name);\n if (this.inModule && (scope$3.flags & SCOPE_TOP))\n { delete this.undefinedExports[name]; }\n if (scope$3.flags & SCOPE_VAR) { break }\n }\n }\n if (redeclared) { this.raiseRecoverable(pos, (\"Identifier '\" + name + \"' has already been declared\")); }\n};\n\npp$3.checkLocalExport = function(id) {\n // scope.functions must be empty as Module code is always strict.\n if (this.scopeStack[0].lexical.indexOf(id.name) === -1 &&\n this.scopeStack[0].var.indexOf(id.name) === -1) {\n this.undefinedExports[id.name] = id;\n }\n};\n\npp$3.currentScope = function() {\n return this.scopeStack[this.scopeStack.length - 1]\n};\n\npp$3.currentVarScope = function() {\n for (var i = this.scopeStack.length - 1;; i--) {\n var scope = this.scopeStack[i];\n if (scope.flags & SCOPE_VAR) { return scope }\n }\n};\n\n// Could be useful for `this`, `new.target`, `super()`, `super.property`, and `super[property]`.\npp$3.currentThisScope = function() {\n for (var i = this.scopeStack.length - 1;; i--) {\n var scope = this.scopeStack[i];\n if (scope.flags & SCOPE_VAR && !(scope.flags & SCOPE_ARROW)) { return scope }\n }\n};\n\nvar Node = function Node(parser, pos, loc) {\n this.type = \"\";\n this.start = pos;\n this.end = 0;\n if (parser.options.locations)\n { this.loc = new SourceLocation(parser, loc); }\n if (parser.options.directSourceFile)\n { this.sourceFile = parser.options.directSourceFile; }\n if (parser.options.ranges)\n { this.range = [pos, 0]; }\n};\n\n// Start an AST node, attaching a start offset.\n\nvar pp$2 = Parser.prototype;\n\npp$2.startNode = function() {\n return new Node(this, this.start, this.startLoc)\n};\n\npp$2.startNodeAt = function(pos, loc) {\n return new Node(this, pos, loc)\n};\n\n// Finish an AST node, adding `type` and `end` properties.\n\nfunction finishNodeAt(node, type, pos, loc) {\n node.type = type;\n node.end = pos;\n if (this.options.locations)\n { node.loc.end = loc; }\n if (this.options.ranges)\n { node.range[1] = pos; }\n return node\n}\n\npp$2.finishNode = function(node, type) {\n return finishNodeAt.call(this, node, type, this.lastTokEnd, this.lastTokEndLoc)\n};\n\n// Finish node at given position\n\npp$2.finishNodeAt = function(node, type, pos, loc) {\n return finishNodeAt.call(this, node, type, pos, loc)\n};\n\npp$2.copyNode = function(node) {\n var newNode = new Node(this, node.start, this.startLoc);\n for (var prop in node) { newNode[prop] = node[prop]; }\n return newNode\n};\n\n// This file contains Unicode properties extracted from the ECMAScript\n// specification. The lists are extracted like so:\n// $$('#table-binary-unicode-properties > figure > table > tbody > tr > td:nth-child(1) code').map(el => el.innerText)\n\n// #table-binary-unicode-properties\nvar ecma9BinaryProperties = \"ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS\";\nvar ecma10BinaryProperties = ecma9BinaryProperties + \" Extended_Pictographic\";\nvar ecma11BinaryProperties = ecma10BinaryProperties;\nvar ecma12BinaryProperties = ecma11BinaryProperties + \" EBase EComp EMod EPres ExtPict\";\nvar ecma13BinaryProperties = ecma12BinaryProperties;\nvar unicodeBinaryProperties = {\n 9: ecma9BinaryProperties,\n 10: ecma10BinaryProperties,\n 11: ecma11BinaryProperties,\n 12: ecma12BinaryProperties,\n 13: ecma13BinaryProperties\n};\n\n// #table-unicode-general-category-values\nvar unicodeGeneralCategoryValues = \"Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu\";\n\n// #table-unicode-script-values\nvar ecma9ScriptValues = \"Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb\";\nvar ecma10ScriptValues = ecma9ScriptValues + \" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd\";\nvar ecma11ScriptValues = ecma10ScriptValues + \" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho\";\nvar ecma12ScriptValues = ecma11ScriptValues + \" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi\";\nvar ecma13ScriptValues = ecma12ScriptValues + \" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith\";\nvar unicodeScriptValues = {\n 9: ecma9ScriptValues,\n 10: ecma10ScriptValues,\n 11: ecma11ScriptValues,\n 12: ecma12ScriptValues,\n 13: ecma13ScriptValues\n};\n\nvar data = {};\nfunction buildUnicodeData(ecmaVersion) {\n var d = data[ecmaVersion] = {\n binary: wordsRegexp(unicodeBinaryProperties[ecmaVersion] + \" \" + unicodeGeneralCategoryValues),\n nonBinary: {\n General_Category: wordsRegexp(unicodeGeneralCategoryValues),\n Script: wordsRegexp(unicodeScriptValues[ecmaVersion])\n }\n };\n d.nonBinary.Script_Extensions = d.nonBinary.Script;\n\n d.nonBinary.gc = d.nonBinary.General_Category;\n d.nonBinary.sc = d.nonBinary.Script;\n d.nonBinary.scx = d.nonBinary.Script_Extensions;\n}\n\nfor (var i = 0, list = [9, 10, 11, 12, 13]; i < list.length; i += 1) {\n var ecmaVersion = list[i];\n\n buildUnicodeData(ecmaVersion);\n}\n\nvar pp$1 = Parser.prototype;\n\nvar RegExpValidationState = function RegExpValidationState(parser) {\n this.parser = parser;\n this.validFlags = \"gim\" + (parser.options.ecmaVersion >= 6 ? \"uy\" : \"\") + (parser.options.ecmaVersion >= 9 ? \"s\" : \"\") + (parser.options.ecmaVersion >= 13 ? \"d\" : \"\");\n this.unicodeProperties = data[parser.options.ecmaVersion >= 13 ? 13 : parser.options.ecmaVersion];\n this.source = \"\";\n this.flags = \"\";\n this.start = 0;\n this.switchU = false;\n this.switchN = false;\n this.pos = 0;\n this.lastIntValue = 0;\n this.lastStringValue = \"\";\n this.lastAssertionIsQuantifiable = false;\n this.numCapturingParens = 0;\n this.maxBackReference = 0;\n this.groupNames = [];\n this.backReferenceNames = [];\n};\n\nRegExpValidationState.prototype.reset = function reset (start, pattern, flags) {\n var unicode = flags.indexOf(\"u\") !== -1;\n this.start = start | 0;\n this.source = pattern + \"\";\n this.flags = flags;\n this.switchU = unicode && this.parser.options.ecmaVersion >= 6;\n this.switchN = unicode && this.parser.options.ecmaVersion >= 9;\n};\n\nRegExpValidationState.prototype.raise = function raise (message) {\n this.parser.raiseRecoverable(this.start, (\"Invalid regular expression: /\" + (this.source) + \"/: \" + message));\n};\n\n// If u flag is given, this returns the code point at the index (it combines a surrogate pair).\n// Otherwise, this returns the code unit of the index (can be a part of a surrogate pair).\nRegExpValidationState.prototype.at = function at (i, forceU) {\n if ( forceU === void 0 ) forceU = false;\n\n var s = this.source;\n var l = s.length;\n if (i >= l) {\n return -1\n }\n var c = s.charCodeAt(i);\n if (!(forceU || this.switchU) || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l) {\n return c\n }\n var next = s.charCodeAt(i + 1);\n return next >= 0xDC00 && next <= 0xDFFF ? (c << 10) + next - 0x35FDC00 : c\n};\n\nRegExpValidationState.prototype.nextIndex = function nextIndex (i, forceU) {\n if ( forceU === void 0 ) forceU = false;\n\n var s = this.source;\n var l = s.length;\n if (i >= l) {\n return l\n }\n var c = s.charCodeAt(i), next;\n if (!(forceU || this.switchU) || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l ||\n (next = s.charCodeAt(i + 1)) < 0xDC00 || next > 0xDFFF) {\n return i + 1\n }\n return i + 2\n};\n\nRegExpValidationState.prototype.current = function current (forceU) {\n if ( forceU === void 0 ) forceU = false;\n\n return this.at(this.pos, forceU)\n};\n\nRegExpValidationState.prototype.lookahead = function lookahead (forceU) {\n if ( forceU === void 0 ) forceU = false;\n\n return this.at(this.nextIndex(this.pos, forceU), forceU)\n};\n\nRegExpValidationState.prototype.advance = function advance (forceU) {\n if ( forceU === void 0 ) forceU = false;\n\n this.pos = this.nextIndex(this.pos, forceU);\n};\n\nRegExpValidationState.prototype.eat = function eat (ch, forceU) {\n if ( forceU === void 0 ) forceU = false;\n\n if (this.current(forceU) === ch) {\n this.advance(forceU);\n return true\n }\n return false\n};\n\n/**\n * Validate the flags part of a given RegExpLiteral.\n *\n * @param {RegExpValidationState} state The state to validate RegExp.\n * @returns {void}\n */\npp$1.validateRegExpFlags = function(state) {\n var validFlags = state.validFlags;\n var flags = state.flags;\n\n for (var i = 0; i < flags.length; i++) {\n var flag = flags.charAt(i);\n if (validFlags.indexOf(flag) === -1) {\n this.raise(state.start, \"Invalid regular expression flag\");\n }\n if (flags.indexOf(flag, i + 1) > -1) {\n this.raise(state.start, \"Duplicate regular expression flag\");\n }\n }\n};\n\n/**\n * Validate the pattern part of a given RegExpLiteral.\n *\n * @param {RegExpValidationState} state The state to validate RegExp.\n * @returns {void}\n */\npp$1.validateRegExpPattern = function(state) {\n this.regexp_pattern(state);\n\n // The goal symbol for the parse is |Pattern[~U, ~N]|. If the result of\n // parsing contains a |GroupName|, reparse with the goal symbol\n // |Pattern[~U, +N]| and use this result instead. Throw a *SyntaxError*\n // exception if _P_ did not conform to the grammar, if any elements of _P_\n // were not matched by the parse, or if any Early Error conditions exist.\n if (!state.switchN && this.options.ecmaVersion >= 9 && state.groupNames.length > 0) {\n state.switchN = true;\n this.regexp_pattern(state);\n }\n};\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-Pattern\npp$1.regexp_pattern = function(state) {\n state.pos = 0;\n state.lastIntValue = 0;\n state.lastStringValue = \"\";\n state.lastAssertionIsQuantifiable = false;\n state.numCapturingParens = 0;\n state.maxBackReference = 0;\n state.groupNames.length = 0;\n state.backReferenceNames.length = 0;\n\n this.regexp_disjunction(state);\n\n if (state.pos !== state.source.length) {\n // Make the same messages as V8.\n if (state.eat(0x29 /* ) */)) {\n state.raise(\"Unmatched ')'\");\n }\n if (state.eat(0x5D /* ] */) || state.eat(0x7D /* } */)) {\n state.raise(\"Lone quantifier brackets\");\n }\n }\n if (state.maxBackReference > state.numCapturingParens) {\n state.raise(\"Invalid escape\");\n }\n for (var i = 0, list = state.backReferenceNames; i < list.length; i += 1) {\n var name = list[i];\n\n if (state.groupNames.indexOf(name) === -1) {\n state.raise(\"Invalid named capture referenced\");\n }\n }\n};\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-Disjunction\npp$1.regexp_disjunction = function(state) {\n this.regexp_alternative(state);\n while (state.eat(0x7C /* | */)) {\n this.regexp_alternative(state);\n }\n\n // Make the same message as V8.\n if (this.regexp_eatQuantifier(state, true)) {\n state.raise(\"Nothing to repeat\");\n }\n if (state.eat(0x7B /* { */)) {\n state.raise(\"Lone quantifier brackets\");\n }\n};\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-Alternative\npp$1.regexp_alternative = function(state) {\n while (state.pos < state.source.length && this.regexp_eatTerm(state))\n { }\n};\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Term\npp$1.regexp_eatTerm = function(state) {\n if (this.regexp_eatAssertion(state)) {\n // Handle `QuantifiableAssertion Quantifier` alternative.\n // `state.lastAssertionIsQuantifiable` is true if the last eaten Assertion\n // is a QuantifiableAssertion.\n if (state.lastAssertionIsQuantifiable && this.regexp_eatQuantifier(state)) {\n // Make the same message as V8.\n if (state.switchU) {\n state.raise(\"Invalid quantifier\");\n }\n }\n return true\n }\n\n if (state.switchU ? this.regexp_eatAtom(state) : this.regexp_eatExtendedAtom(state)) {\n this.regexp_eatQuantifier(state);\n return true\n }\n\n return false\n};\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Assertion\npp$1.regexp_eatAssertion = function(state) {\n var start = state.pos;\n state.lastAssertionIsQuantifiable = false;\n\n // ^, $\n if (state.eat(0x5E /* ^ */) || state.eat(0x24 /* $ */)) {\n return true\n }\n\n // \\b \\B\n if (state.eat(0x5C /* \\ */)) {\n if (state.eat(0x42 /* B */) || state.eat(0x62 /* b */)) {\n return true\n }\n state.pos = start;\n }\n\n // Lookahead / Lookbehind\n if (state.eat(0x28 /* ( */) && state.eat(0x3F /* ? */)) {\n var lookbehind = false;\n if (this.options.ecmaVersion >= 9) {\n lookbehind = state.eat(0x3C /* < */);\n }\n if (state.eat(0x3D /* = */) || state.eat(0x21 /* ! */)) {\n this.regexp_disjunction(state);\n if (!state.eat(0x29 /* ) */)) {\n state.raise(\"Unterminated group\");\n }\n state.lastAssertionIsQuantifiable = !lookbehind;\n return true\n }\n }\n\n state.pos = start;\n return false\n};\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-Quantifier\npp$1.regexp_eatQuantifier = function(state, noError) {\n if ( noError === void 0 ) noError = false;\n\n if (this.regexp_eatQuantifierPrefix(state, noError)) {\n state.eat(0x3F /* ? */);\n return true\n }\n return false\n};\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-QuantifierPrefix\npp$1.regexp_eatQuantifierPrefix = function(state, noError) {\n return (\n state.eat(0x2A /* * */) ||\n state.eat(0x2B /* + */) ||\n state.eat(0x3F /* ? */) ||\n this.regexp_eatBracedQuantifier(state, noError)\n )\n};\npp$1.regexp_eatBracedQuantifier = function(state, noError) {\n var start = state.pos;\n if (state.eat(0x7B /* { */)) {\n var min = 0, max = -1;\n if (this.regexp_eatDecimalDigits(state)) {\n min = state.lastIntValue;\n if (state.eat(0x2C /* , */) && this.regexp_eatDecimalDigits(state)) {\n max = state.lastIntValue;\n }\n if (state.eat(0x7D /* } */)) {\n // SyntaxError in https://www.ecma-international.org/ecma-262/8.0/#sec-term\n if (max !== -1 && max < min && !noError) {\n state.raise(\"numbers out of order in {} quantifier\");\n }\n return true\n }\n }\n if (state.switchU && !noError) {\n state.raise(\"Incomplete quantifier\");\n }\n state.pos = start;\n }\n return false\n};\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-Atom\npp$1.regexp_eatAtom = function(state) {\n return (\n this.regexp_eatPatternCharacters(state) ||\n state.eat(0x2E /* . */) ||\n this.regexp_eatReverseSolidusAtomEscape(state) ||\n this.regexp_eatCharacterClass(state) ||\n this.regexp_eatUncapturingGroup(state) ||\n this.regexp_eatCapturingGroup(state)\n )\n};\npp$1.regexp_eatReverseSolidusAtomEscape = function(state) {\n var start = state.pos;\n if (state.eat(0x5C /* \\ */)) {\n if (this.regexp_eatAtomEscape(state)) {\n return true\n }\n state.pos = start;\n }\n return false\n};\npp$1.regexp_eatUncapturingGroup = function(state) {\n var start = state.pos;\n if (state.eat(0x28 /* ( */)) {\n if (state.eat(0x3F /* ? */) && state.eat(0x3A /* : */)) {\n this.regexp_disjunction(state);\n if (state.eat(0x29 /* ) */)) {\n return true\n }\n state.raise(\"Unterminated group\");\n }\n state.pos = start;\n }\n return false\n};\npp$1.regexp_eatCapturingGroup = function(state) {\n if (state.eat(0x28 /* ( */)) {\n if (this.options.ecmaVersion >= 9) {\n this.regexp_groupSpecifier(state);\n } else if (state.current() === 0x3F /* ? */) {\n state.raise(\"Invalid group\");\n }\n this.regexp_disjunction(state);\n if (state.eat(0x29 /* ) */)) {\n state.numCapturingParens += 1;\n return true\n }\n state.raise(\"Unterminated group\");\n }\n return false\n};\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedAtom\npp$1.regexp_eatExtendedAtom = function(state) {\n return (\n state.eat(0x2E /* . */) ||\n this.regexp_eatReverseSolidusAtomEscape(state) ||\n this.regexp_eatCharacterClass(state) ||\n this.regexp_eatUncapturingGroup(state) ||\n this.regexp_eatCapturingGroup(state) ||\n this.regexp_eatInvalidBracedQuantifier(state) ||\n this.regexp_eatExtendedPatternCharacter(state)\n )\n};\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-InvalidBracedQuantifier\npp$1.regexp_eatInvalidBracedQuantifier = function(state) {\n if (this.regexp_eatBracedQuantifier(state, true)) {\n state.raise(\"Nothing to repeat\");\n }\n return false\n};\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-SyntaxCharacter\npp$1.regexp_eatSyntaxCharacter = function(state) {\n var ch = state.current();\n if (isSyntaxCharacter(ch)) {\n state.lastIntValue = ch;\n state.advance();\n return true\n }\n return false\n};\nfunction isSyntaxCharacter(ch) {\n return (\n ch === 0x24 /* $ */ ||\n ch >= 0x28 /* ( */ && ch <= 0x2B /* + */ ||\n ch === 0x2E /* . */ ||\n ch === 0x3F /* ? */ ||\n ch >= 0x5B /* [ */ && ch <= 0x5E /* ^ */ ||\n ch >= 0x7B /* { */ && ch <= 0x7D /* } */\n )\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-PatternCharacter\n// But eat eager.\npp$1.regexp_eatPatternCharacters = function(state) {\n var start = state.pos;\n var ch = 0;\n while ((ch = state.current()) !== -1 && !isSyntaxCharacter(ch)) {\n state.advance();\n }\n return state.pos !== start\n};\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedPatternCharacter\npp$1.regexp_eatExtendedPatternCharacter = function(state) {\n var ch = state.current();\n if (\n ch !== -1 &&\n ch !== 0x24 /* $ */ &&\n !(ch >= 0x28 /* ( */ && ch <= 0x2B /* + */) &&\n ch !== 0x2E /* . */ &&\n ch !== 0x3F /* ? */ &&\n ch !== 0x5B /* [ */ &&\n ch !== 0x5E /* ^ */ &&\n ch !== 0x7C /* | */\n ) {\n state.advance();\n return true\n }\n return false\n};\n\n// GroupSpecifier ::\n// [empty]\n// `?` GroupName\npp$1.regexp_groupSpecifier = function(state) {\n if (state.eat(0x3F /* ? */)) {\n if (this.regexp_eatGroupName(state)) {\n if (state.groupNames.indexOf(state.lastStringValue) !== -1) {\n state.raise(\"Duplicate capture group name\");\n }\n state.groupNames.push(state.lastStringValue);\n return\n }\n state.raise(\"Invalid group\");\n }\n};\n\n// GroupName ::\n// `<` RegExpIdentifierName `>`\n// Note: this updates `state.lastStringValue` property with the eaten name.\npp$1.regexp_eatGroupName = function(state) {\n state.lastStringValue = \"\";\n if (state.eat(0x3C /* < */)) {\n if (this.regexp_eatRegExpIdentifierName(state) && state.eat(0x3E /* > */)) {\n return true\n }\n state.raise(\"Invalid capture group name\");\n }\n return false\n};\n\n// RegExpIdentifierName ::\n// RegExpIdentifierStart\n// RegExpIdentifierName RegExpIdentifierPart\n// Note: this updates `state.lastStringValue` property with the eaten name.\npp$1.regexp_eatRegExpIdentifierName = function(state) {\n state.lastStringValue = \"\";\n if (this.regexp_eatRegExpIdentifierStart(state)) {\n state.lastStringValue += codePointToString(state.lastIntValue);\n while (this.regexp_eatRegExpIdentifierPart(state)) {\n state.lastStringValue += codePointToString(state.lastIntValue);\n }\n return true\n }\n return false\n};\n\n// RegExpIdentifierStart ::\n// UnicodeIDStart\n// `$`\n// `_`\n// `\\` RegExpUnicodeEscapeSequence[+U]\npp$1.regexp_eatRegExpIdentifierStart = function(state) {\n var start = state.pos;\n var forceU = this.options.ecmaVersion >= 11;\n var ch = state.current(forceU);\n state.advance(forceU);\n\n if (ch === 0x5C /* \\ */ && this.regexp_eatRegExpUnicodeEscapeSequence(state, forceU)) {\n ch = state.lastIntValue;\n }\n if (isRegExpIdentifierStart(ch)) {\n state.lastIntValue = ch;\n return true\n }\n\n state.pos = start;\n return false\n};\nfunction isRegExpIdentifierStart(ch) {\n return isIdentifierStart(ch, true) || ch === 0x24 /* $ */ || ch === 0x5F /* _ */\n}\n\n// RegExpIdentifierPart ::\n// UnicodeIDContinue\n// `$`\n// `_`\n// `\\` RegExpUnicodeEscapeSequence[+U]\n// \n// \npp$1.regexp_eatRegExpIdentifierPart = function(state) {\n var start = state.pos;\n var forceU = this.options.ecmaVersion >= 11;\n var ch = state.current(forceU);\n state.advance(forceU);\n\n if (ch === 0x5C /* \\ */ && this.regexp_eatRegExpUnicodeEscapeSequence(state, forceU)) {\n ch = state.lastIntValue;\n }\n if (isRegExpIdentifierPart(ch)) {\n state.lastIntValue = ch;\n return true\n }\n\n state.pos = start;\n return false\n};\nfunction isRegExpIdentifierPart(ch) {\n return isIdentifierChar(ch, true) || ch === 0x24 /* $ */ || ch === 0x5F /* _ */ || ch === 0x200C /* */ || ch === 0x200D /* */\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-AtomEscape\npp$1.regexp_eatAtomEscape = function(state) {\n if (\n this.regexp_eatBackReference(state) ||\n this.regexp_eatCharacterClassEscape(state) ||\n this.regexp_eatCharacterEscape(state) ||\n (state.switchN && this.regexp_eatKGroupName(state))\n ) {\n return true\n }\n if (state.switchU) {\n // Make the same message as V8.\n if (state.current() === 0x63 /* c */) {\n state.raise(\"Invalid unicode escape\");\n }\n state.raise(\"Invalid escape\");\n }\n return false\n};\npp$1.regexp_eatBackReference = function(state) {\n var start = state.pos;\n if (this.regexp_eatDecimalEscape(state)) {\n var n = state.lastIntValue;\n if (state.switchU) {\n // For SyntaxError in https://www.ecma-international.org/ecma-262/8.0/#sec-atomescape\n if (n > state.maxBackReference) {\n state.maxBackReference = n;\n }\n return true\n }\n if (n <= state.numCapturingParens) {\n return true\n }\n state.pos = start;\n }\n return false\n};\npp$1.regexp_eatKGroupName = function(state) {\n if (state.eat(0x6B /* k */)) {\n if (this.regexp_eatGroupName(state)) {\n state.backReferenceNames.push(state.lastStringValue);\n return true\n }\n state.raise(\"Invalid named reference\");\n }\n return false\n};\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-CharacterEscape\npp$1.regexp_eatCharacterEscape = function(state) {\n return (\n this.regexp_eatControlEscape(state) ||\n this.regexp_eatCControlLetter(state) ||\n this.regexp_eatZero(state) ||\n this.regexp_eatHexEscapeSequence(state) ||\n this.regexp_eatRegExpUnicodeEscapeSequence(state, false) ||\n (!state.switchU && this.regexp_eatLegacyOctalEscapeSequence(state)) ||\n this.regexp_eatIdentityEscape(state)\n )\n};\npp$1.regexp_eatCControlLetter = function(state) {\n var start = state.pos;\n if (state.eat(0x63 /* c */)) {\n if (this.regexp_eatControlLetter(state)) {\n return true\n }\n state.pos = start;\n }\n return false\n};\npp$1.regexp_eatZero = function(state) {\n if (state.current() === 0x30 /* 0 */ && !isDecimalDigit(state.lookahead())) {\n state.lastIntValue = 0;\n state.advance();\n return true\n }\n return false\n};\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-ControlEscape\npp$1.regexp_eatControlEscape = function(state) {\n var ch = state.current();\n if (ch === 0x74 /* t */) {\n state.lastIntValue = 0x09; /* \\t */\n state.advance();\n return true\n }\n if (ch === 0x6E /* n */) {\n state.lastIntValue = 0x0A; /* \\n */\n state.advance();\n return true\n }\n if (ch === 0x76 /* v */) {\n state.lastIntValue = 0x0B; /* \\v */\n state.advance();\n return true\n }\n if (ch === 0x66 /* f */) {\n state.lastIntValue = 0x0C; /* \\f */\n state.advance();\n return true\n }\n if (ch === 0x72 /* r */) {\n state.lastIntValue = 0x0D; /* \\r */\n state.advance();\n return true\n }\n return false\n};\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-ControlLetter\npp$1.regexp_eatControlLetter = function(state) {\n var ch = state.current();\n if (isControlLetter(ch)) {\n state.lastIntValue = ch % 0x20;\n state.advance();\n return true\n }\n return false\n};\nfunction isControlLetter(ch) {\n return (\n (ch >= 0x41 /* A */ && ch <= 0x5A /* Z */) ||\n (ch >= 0x61 /* a */ && ch <= 0x7A /* z */)\n )\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-RegExpUnicodeEscapeSequence\npp$1.regexp_eatRegExpUnicodeEscapeSequence = function(state, forceU) {\n if ( forceU === void 0 ) forceU = false;\n\n var start = state.pos;\n var switchU = forceU || state.switchU;\n\n if (state.eat(0x75 /* u */)) {\n if (this.regexp_eatFixedHexDigits(state, 4)) {\n var lead = state.lastIntValue;\n if (switchU && lead >= 0xD800 && lead <= 0xDBFF) {\n var leadSurrogateEnd = state.pos;\n if (state.eat(0x5C /* \\ */) && state.eat(0x75 /* u */) && this.regexp_eatFixedHexDigits(state, 4)) {\n var trail = state.lastIntValue;\n if (trail >= 0xDC00 && trail <= 0xDFFF) {\n state.lastIntValue = (lead - 0xD800) * 0x400 + (trail - 0xDC00) + 0x10000;\n return true\n }\n }\n state.pos = leadSurrogateEnd;\n state.lastIntValue = lead;\n }\n return true\n }\n if (\n switchU &&\n state.eat(0x7B /* { */) &&\n this.regexp_eatHexDigits(state) &&\n state.eat(0x7D /* } */) &&\n isValidUnicode(state.lastIntValue)\n ) {\n return true\n }\n if (switchU) {\n state.raise(\"Invalid unicode escape\");\n }\n state.pos = start;\n }\n\n return false\n};\nfunction isValidUnicode(ch) {\n return ch >= 0 && ch <= 0x10FFFF\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-IdentityEscape\npp$1.regexp_eatIdentityEscape = function(state) {\n if (state.switchU) {\n if (this.regexp_eatSyntaxCharacter(state)) {\n return true\n }\n if (state.eat(0x2F /* / */)) {\n state.lastIntValue = 0x2F; /* / */\n return true\n }\n return false\n }\n\n var ch = state.current();\n if (ch !== 0x63 /* c */ && (!state.switchN || ch !== 0x6B /* k */)) {\n state.lastIntValue = ch;\n state.advance();\n return true\n }\n\n return false\n};\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalEscape\npp$1.regexp_eatDecimalEscape = function(state) {\n state.lastIntValue = 0;\n var ch = state.current();\n if (ch >= 0x31 /* 1 */ && ch <= 0x39 /* 9 */) {\n do {\n state.lastIntValue = 10 * state.lastIntValue + (ch - 0x30 /* 0 */);\n state.advance();\n } while ((ch = state.current()) >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */)\n return true\n }\n return false\n};\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClassEscape\npp$1.regexp_eatCharacterClassEscape = function(state) {\n var ch = state.current();\n\n if (isCharacterClassEscape(ch)) {\n state.lastIntValue = -1;\n state.advance();\n return true\n }\n\n if (\n state.switchU &&\n this.options.ecmaVersion >= 9 &&\n (ch === 0x50 /* P */ || ch === 0x70 /* p */)\n ) {\n state.lastIntValue = -1;\n state.advance();\n if (\n state.eat(0x7B /* { */) &&\n this.regexp_eatUnicodePropertyValueExpression(state) &&\n state.eat(0x7D /* } */)\n ) {\n return true\n }\n state.raise(\"Invalid property name\");\n }\n\n return false\n};\nfunction isCharacterClassEscape(ch) {\n return (\n ch === 0x64 /* d */ ||\n ch === 0x44 /* D */ ||\n ch === 0x73 /* s */ ||\n ch === 0x53 /* S */ ||\n ch === 0x77 /* w */ ||\n ch === 0x57 /* W */\n )\n}\n\n// UnicodePropertyValueExpression ::\n// UnicodePropertyName `=` UnicodePropertyValue\n// LoneUnicodePropertyNameOrValue\npp$1.regexp_eatUnicodePropertyValueExpression = function(state) {\n var start = state.pos;\n\n // UnicodePropertyName `=` UnicodePropertyValue\n if (this.regexp_eatUnicodePropertyName(state) && state.eat(0x3D /* = */)) {\n var name = state.lastStringValue;\n if (this.regexp_eatUnicodePropertyValue(state)) {\n var value = state.lastStringValue;\n this.regexp_validateUnicodePropertyNameAndValue(state, name, value);\n return true\n }\n }\n state.pos = start;\n\n // LoneUnicodePropertyNameOrValue\n if (this.regexp_eatLoneUnicodePropertyNameOrValue(state)) {\n var nameOrValue = state.lastStringValue;\n this.regexp_validateUnicodePropertyNameOrValue(state, nameOrValue);\n return true\n }\n return false\n};\npp$1.regexp_validateUnicodePropertyNameAndValue = function(state, name, value) {\n if (!hasOwn(state.unicodeProperties.nonBinary, name))\n { state.raise(\"Invalid property name\"); }\n if (!state.unicodeProperties.nonBinary[name].test(value))\n { state.raise(\"Invalid property value\"); }\n};\npp$1.regexp_validateUnicodePropertyNameOrValue = function(state, nameOrValue) {\n if (!state.unicodeProperties.binary.test(nameOrValue))\n { state.raise(\"Invalid property name\"); }\n};\n\n// UnicodePropertyName ::\n// UnicodePropertyNameCharacters\npp$1.regexp_eatUnicodePropertyName = function(state) {\n var ch = 0;\n state.lastStringValue = \"\";\n while (isUnicodePropertyNameCharacter(ch = state.current())) {\n state.lastStringValue += codePointToString(ch);\n state.advance();\n }\n return state.lastStringValue !== \"\"\n};\nfunction isUnicodePropertyNameCharacter(ch) {\n return isControlLetter(ch) || ch === 0x5F /* _ */\n}\n\n// UnicodePropertyValue ::\n// UnicodePropertyValueCharacters\npp$1.regexp_eatUnicodePropertyValue = function(state) {\n var ch = 0;\n state.lastStringValue = \"\";\n while (isUnicodePropertyValueCharacter(ch = state.current())) {\n state.lastStringValue += codePointToString(ch);\n state.advance();\n }\n return state.lastStringValue !== \"\"\n};\nfunction isUnicodePropertyValueCharacter(ch) {\n return isUnicodePropertyNameCharacter(ch) || isDecimalDigit(ch)\n}\n\n// LoneUnicodePropertyNameOrValue ::\n// UnicodePropertyValueCharacters\npp$1.regexp_eatLoneUnicodePropertyNameOrValue = function(state) {\n return this.regexp_eatUnicodePropertyValue(state)\n};\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClass\npp$1.regexp_eatCharacterClass = function(state) {\n if (state.eat(0x5B /* [ */)) {\n state.eat(0x5E /* ^ */);\n this.regexp_classRanges(state);\n if (state.eat(0x5D /* ] */)) {\n return true\n }\n // Unreachable since it threw \"unterminated regular expression\" error before.\n state.raise(\"Unterminated character class\");\n }\n return false\n};\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-ClassRanges\n// https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRanges\n// https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRangesNoDash\npp$1.regexp_classRanges = function(state) {\n while (this.regexp_eatClassAtom(state)) {\n var left = state.lastIntValue;\n if (state.eat(0x2D /* - */) && this.regexp_eatClassAtom(state)) {\n var right = state.lastIntValue;\n if (state.switchU && (left === -1 || right === -1)) {\n state.raise(\"Invalid character class\");\n }\n if (left !== -1 && right !== -1 && left > right) {\n state.raise(\"Range out of order in character class\");\n }\n }\n }\n};\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-ClassAtom\n// https://www.ecma-international.org/ecma-262/8.0/#prod-ClassAtomNoDash\npp$1.regexp_eatClassAtom = function(state) {\n var start = state.pos;\n\n if (state.eat(0x5C /* \\ */)) {\n if (this.regexp_eatClassEscape(state)) {\n return true\n }\n if (state.switchU) {\n // Make the same message as V8.\n var ch$1 = state.current();\n if (ch$1 === 0x63 /* c */ || isOctalDigit(ch$1)) {\n state.raise(\"Invalid class escape\");\n }\n state.raise(\"Invalid escape\");\n }\n state.pos = start;\n }\n\n var ch = state.current();\n if (ch !== 0x5D /* ] */) {\n state.lastIntValue = ch;\n state.advance();\n return true\n }\n\n return false\n};\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassEscape\npp$1.regexp_eatClassEscape = function(state) {\n var start = state.pos;\n\n if (state.eat(0x62 /* b */)) {\n state.lastIntValue = 0x08; /* */\n return true\n }\n\n if (state.switchU && state.eat(0x2D /* - */)) {\n state.lastIntValue = 0x2D; /* - */\n return true\n }\n\n if (!state.switchU && state.eat(0x63 /* c */)) {\n if (this.regexp_eatClassControlLetter(state)) {\n return true\n }\n state.pos = start;\n }\n\n return (\n this.regexp_eatCharacterClassEscape(state) ||\n this.regexp_eatCharacterEscape(state)\n )\n};\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassControlLetter\npp$1.regexp_eatClassControlLetter = function(state) {\n var ch = state.current();\n if (isDecimalDigit(ch) || ch === 0x5F /* _ */) {\n state.lastIntValue = ch % 0x20;\n state.advance();\n return true\n }\n return false\n};\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-HexEscapeSequence\npp$1.regexp_eatHexEscapeSequence = function(state) {\n var start = state.pos;\n if (state.eat(0x78 /* x */)) {\n if (this.regexp_eatFixedHexDigits(state, 2)) {\n return true\n }\n if (state.switchU) {\n state.raise(\"Invalid escape\");\n }\n state.pos = start;\n }\n return false\n};\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalDigits\npp$1.regexp_eatDecimalDigits = function(state) {\n var start = state.pos;\n var ch = 0;\n state.lastIntValue = 0;\n while (isDecimalDigit(ch = state.current())) {\n state.lastIntValue = 10 * state.lastIntValue + (ch - 0x30 /* 0 */);\n state.advance();\n }\n return state.pos !== start\n};\nfunction isDecimalDigit(ch) {\n return ch >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-HexDigits\npp$1.regexp_eatHexDigits = function(state) {\n var start = state.pos;\n var ch = 0;\n state.lastIntValue = 0;\n while (isHexDigit(ch = state.current())) {\n state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch);\n state.advance();\n }\n return state.pos !== start\n};\nfunction isHexDigit(ch) {\n return (\n (ch >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */) ||\n (ch >= 0x41 /* A */ && ch <= 0x46 /* F */) ||\n (ch >= 0x61 /* a */ && ch <= 0x66 /* f */)\n )\n}\nfunction hexToInt(ch) {\n if (ch >= 0x41 /* A */ && ch <= 0x46 /* F */) {\n return 10 + (ch - 0x41 /* A */)\n }\n if (ch >= 0x61 /* a */ && ch <= 0x66 /* f */) {\n return 10 + (ch - 0x61 /* a */)\n }\n return ch - 0x30 /* 0 */\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-LegacyOctalEscapeSequence\n// Allows only 0-377(octal) i.e. 0-255(decimal).\npp$1.regexp_eatLegacyOctalEscapeSequence = function(state) {\n if (this.regexp_eatOctalDigit(state)) {\n var n1 = state.lastIntValue;\n if (this.regexp_eatOctalDigit(state)) {\n var n2 = state.lastIntValue;\n if (n1 <= 3 && this.regexp_eatOctalDigit(state)) {\n state.lastIntValue = n1 * 64 + n2 * 8 + state.lastIntValue;\n } else {\n state.lastIntValue = n1 * 8 + n2;\n }\n } else {\n state.lastIntValue = n1;\n }\n return true\n }\n return false\n};\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-OctalDigit\npp$1.regexp_eatOctalDigit = function(state) {\n var ch = state.current();\n if (isOctalDigit(ch)) {\n state.lastIntValue = ch - 0x30; /* 0 */\n state.advance();\n return true\n }\n state.lastIntValue = 0;\n return false\n};\nfunction isOctalDigit(ch) {\n return ch >= 0x30 /* 0 */ && ch <= 0x37 /* 7 */\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-Hex4Digits\n// https://www.ecma-international.org/ecma-262/8.0/#prod-HexDigit\n// And HexDigit HexDigit in https://www.ecma-international.org/ecma-262/8.0/#prod-HexEscapeSequence\npp$1.regexp_eatFixedHexDigits = function(state, length) {\n var start = state.pos;\n state.lastIntValue = 0;\n for (var i = 0; i < length; ++i) {\n var ch = state.current();\n if (!isHexDigit(ch)) {\n state.pos = start;\n return false\n }\n state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch);\n state.advance();\n }\n return true\n};\n\n// Object type used to represent tokens. Note that normally, tokens\n// simply exist as properties on the parser object. This is only\n// used for the onToken callback and the external tokenizer.\n\nvar Token = function Token(p) {\n this.type = p.type;\n this.value = p.value;\n this.start = p.start;\n this.end = p.end;\n if (p.options.locations)\n { this.loc = new SourceLocation(p, p.startLoc, p.endLoc); }\n if (p.options.ranges)\n { this.range = [p.start, p.end]; }\n};\n\n// ## Tokenizer\n\nvar pp = Parser.prototype;\n\n// Move to the next token\n\npp.next = function(ignoreEscapeSequenceInKeyword) {\n if (!ignoreEscapeSequenceInKeyword && this.type.keyword && this.containsEsc)\n { this.raiseRecoverable(this.start, \"Escape sequence in keyword \" + this.type.keyword); }\n if (this.options.onToken)\n { this.options.onToken(new Token(this)); }\n\n this.lastTokEnd = this.end;\n this.lastTokStart = this.start;\n this.lastTokEndLoc = this.endLoc;\n this.lastTokStartLoc = this.startLoc;\n this.nextToken();\n};\n\npp.getToken = function() {\n this.next();\n return new Token(this)\n};\n\n// If we're in an ES6 environment, make parsers iterable\nif (typeof Symbol !== \"undefined\")\n { pp[Symbol.iterator] = function() {\n var this$1$1 = this;\n\n return {\n next: function () {\n var token = this$1$1.getToken();\n return {\n done: token.type === types$1.eof,\n value: token\n }\n }\n }\n }; }\n\n// Toggle strict mode. Re-reads the next number or string to please\n// pedantic tests (`\"use strict\"; 010;` should fail).\n\n// Read a single token, updating the parser object's token-related\n// properties.\n\npp.nextToken = function() {\n var curContext = this.curContext();\n if (!curContext || !curContext.preserveSpace) { this.skipSpace(); }\n\n this.start = this.pos;\n if (this.options.locations) { this.startLoc = this.curPosition(); }\n if (this.pos >= this.input.length) { return this.finishToken(types$1.eof) }\n\n if (curContext.override) { return curContext.override(this) }\n else { this.readToken(this.fullCharCodeAtPos()); }\n};\n\npp.readToken = function(code) {\n // Identifier or keyword. '\\uXXXX' sequences are allowed in\n // identifiers, so '\\' also dispatches to that.\n if (isIdentifierStart(code, this.options.ecmaVersion >= 6) || code === 92 /* '\\' */)\n { return this.readWord() }\n\n return this.getTokenFromCode(code)\n};\n\npp.fullCharCodeAtPos = function() {\n var code = this.input.charCodeAt(this.pos);\n if (code <= 0xd7ff || code >= 0xdc00) { return code }\n var next = this.input.charCodeAt(this.pos + 1);\n return next <= 0xdbff || next >= 0xe000 ? code : (code << 10) + next - 0x35fdc00\n};\n\npp.skipBlockComment = function() {\n var startLoc = this.options.onComment && this.curPosition();\n var start = this.pos, end = this.input.indexOf(\"*/\", this.pos += 2);\n if (end === -1) { this.raise(this.pos - 2, \"Unterminated comment\"); }\n this.pos = end + 2;\n if (this.options.locations) {\n for (var nextBreak = (void 0), pos = start; (nextBreak = nextLineBreak(this.input, pos, this.pos)) > -1;) {\n ++this.curLine;\n pos = this.lineStart = nextBreak;\n }\n }\n if (this.options.onComment)\n { this.options.onComment(true, this.input.slice(start + 2, end), start, this.pos,\n startLoc, this.curPosition()); }\n};\n\npp.skipLineComment = function(startSkip) {\n var start = this.pos;\n var startLoc = this.options.onComment && this.curPosition();\n var ch = this.input.charCodeAt(this.pos += startSkip);\n while (this.pos < this.input.length && !isNewLine(ch)) {\n ch = this.input.charCodeAt(++this.pos);\n }\n if (this.options.onComment)\n { this.options.onComment(false, this.input.slice(start + startSkip, this.pos), start, this.pos,\n startLoc, this.curPosition()); }\n};\n\n// Called at the start of the parse and after every token. Skips\n// whitespace and comments, and.\n\npp.skipSpace = function() {\n loop: while (this.pos < this.input.length) {\n var ch = this.input.charCodeAt(this.pos);\n switch (ch) {\n case 32: case 160: // ' '\n ++this.pos;\n break\n case 13:\n if (this.input.charCodeAt(this.pos + 1) === 10) {\n ++this.pos;\n }\n case 10: case 8232: case 8233:\n ++this.pos;\n if (this.options.locations) {\n ++this.curLine;\n this.lineStart = this.pos;\n }\n break\n case 47: // '/'\n switch (this.input.charCodeAt(this.pos + 1)) {\n case 42: // '*'\n this.skipBlockComment();\n break\n case 47:\n this.skipLineComment(2);\n break\n default:\n break loop\n }\n break\n default:\n if (ch > 8 && ch < 14 || ch >= 5760 && nonASCIIwhitespace.test(String.fromCharCode(ch))) {\n ++this.pos;\n } else {\n break loop\n }\n }\n }\n};\n\n// Called at the end of every token. Sets `end`, `val`, and\n// maintains `context` and `exprAllowed`, and skips the space after\n// the token, so that the next one's `start` will point at the\n// right position.\n\npp.finishToken = function(type, val) {\n this.end = this.pos;\n if (this.options.locations) { this.endLoc = this.curPosition(); }\n var prevType = this.type;\n this.type = type;\n this.value = val;\n\n this.updateContext(prevType);\n};\n\n// ### Token reading\n\n// This is the function that is called to fetch the next token. It\n// is somewhat obscure, because it works in character codes rather\n// than characters, and because operator parsing has been inlined\n// into it.\n//\n// All in the name of speed.\n//\npp.readToken_dot = function() {\n var next = this.input.charCodeAt(this.pos + 1);\n if (next >= 48 && next <= 57) { return this.readNumber(true) }\n var next2 = this.input.charCodeAt(this.pos + 2);\n if (this.options.ecmaVersion >= 6 && next === 46 && next2 === 46) { // 46 = dot '.'\n this.pos += 3;\n return this.finishToken(types$1.ellipsis)\n } else {\n ++this.pos;\n return this.finishToken(types$1.dot)\n }\n};\n\npp.readToken_slash = function() { // '/'\n var next = this.input.charCodeAt(this.pos + 1);\n if (this.exprAllowed) { ++this.pos; return this.readRegexp() }\n if (next === 61) { return this.finishOp(types$1.assign, 2) }\n return this.finishOp(types$1.slash, 1)\n};\n\npp.readToken_mult_modulo_exp = function(code) { // '%*'\n var next = this.input.charCodeAt(this.pos + 1);\n var size = 1;\n var tokentype = code === 42 ? types$1.star : types$1.modulo;\n\n // exponentiation operator ** and **=\n if (this.options.ecmaVersion >= 7 && code === 42 && next === 42) {\n ++size;\n tokentype = types$1.starstar;\n next = this.input.charCodeAt(this.pos + 2);\n }\n\n if (next === 61) { return this.finishOp(types$1.assign, size + 1) }\n return this.finishOp(tokentype, size)\n};\n\npp.readToken_pipe_amp = function(code) { // '|&'\n var next = this.input.charCodeAt(this.pos + 1);\n if (next === code) {\n if (this.options.ecmaVersion >= 12) {\n var next2 = this.input.charCodeAt(this.pos + 2);\n if (next2 === 61) { return this.finishOp(types$1.assign, 3) }\n }\n return this.finishOp(code === 124 ? types$1.logicalOR : types$1.logicalAND, 2)\n }\n if (next === 61) { return this.finishOp(types$1.assign, 2) }\n return this.finishOp(code === 124 ? types$1.bitwiseOR : types$1.bitwiseAND, 1)\n};\n\npp.readToken_caret = function() { // '^'\n var next = this.input.charCodeAt(this.pos + 1);\n if (next === 61) { return this.finishOp(types$1.assign, 2) }\n return this.finishOp(types$1.bitwiseXOR, 1)\n};\n\npp.readToken_plus_min = function(code) { // '+-'\n var next = this.input.charCodeAt(this.pos + 1);\n if (next === code) {\n if (next === 45 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 62 &&\n (this.lastTokEnd === 0 || lineBreak.test(this.input.slice(this.lastTokEnd, this.pos)))) {\n // A `-->` line comment\n this.skipLineComment(3);\n this.skipSpace();\n return this.nextToken()\n }\n return this.finishOp(types$1.incDec, 2)\n }\n if (next === 61) { return this.finishOp(types$1.assign, 2) }\n return this.finishOp(types$1.plusMin, 1)\n};\n\npp.readToken_lt_gt = function(code) { // '<>'\n var next = this.input.charCodeAt(this.pos + 1);\n var size = 1;\n if (next === code) {\n size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2;\n if (this.input.charCodeAt(this.pos + size) === 61) { return this.finishOp(types$1.assign, size + 1) }\n return this.finishOp(types$1.bitShift, size)\n }\n if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 &&\n this.input.charCodeAt(this.pos + 3) === 45) {\n // ` - + @@ -72,4 +72,4 @@ - \ No newline at end of file + diff --git a/Modules/TestQuestionPool/templates/default/tpl.prop_multiplechoicewizardinput.html b/Modules/TestQuestionPool/templates/default/tpl.prop_multiplechoicewizardinput.html index 6d72f4f5188b..0c221db71f2e 100644 --- a/Modules/TestQuestionPool/templates/default/tpl.prop_multiplechoicewizardinput.html +++ b/Modules/TestQuestionPool/templates/default/tpl.prop_multiplechoicewizardinput.html @@ -27,7 +27,7 @@ value="{PROPERTY_VALUE}" {DISABLED_SINGLELINE}/> - + @@ -79,4 +79,4 @@
{TXT_MAX_SIZE} {TXT_ALLOWED_SUFFIXES}
- \ No newline at end of file + diff --git a/Modules/TestQuestionPool/templates/default/tpl.prop_singlechoicewizardinput.html b/Modules/TestQuestionPool/templates/default/tpl.prop_singlechoicewizardinput.html index 39480fca6743..635325b17368 100644 --- a/Modules/TestQuestionPool/templates/default/tpl.prop_singlechoicewizardinput.html +++ b/Modules/TestQuestionPool/templates/default/tpl.prop_singlechoicewizardinput.html @@ -18,7 +18,7 @@ value="{PROPERTY_VALUE}" {DISABLED_SINGLELINE}/> - + diff --git a/Services/Form/classes/class.ilTextWizardInputGUI.php b/Services/Form/classes/class.ilTextWizardInputGUI.php index 33b67375ddb9..e4c7acba9f2f 100755 --- a/Services/Form/classes/class.ilTextWizardInputGUI.php +++ b/Services/Form/classes/class.ilTextWizardInputGUI.php @@ -84,6 +84,9 @@ public function checkInput(): bool $this->setAlert($lng->txt("msg_wrong_format")); return false; } + } elseif ($this->getMaxLength() && mb_strlen($value) > $this->getMaxLength()) { + $this->setAlert($lng->txt("msg_input_char_limit_max")); + return false; } } } elseif ($this->getRequired()) { From 518058ddc5aabab001f27a2fb09734fc4891d03d Mon Sep 17 00:00:00 2001 From: Tim Schmitz Date: Wed, 6 Nov 2024 15:14:55 +0100 Subject: [PATCH 161/292] Course: fix typo in timings reminder for R8 (41985) --- Modules/Course/classes/class.ilTimingsCronReminder.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/Course/classes/class.ilTimingsCronReminder.php b/Modules/Course/classes/class.ilTimingsCronReminder.php index 23dbf5e67331..8aefa8cbc731 100644 --- a/Modules/Course/classes/class.ilTimingsCronReminder.php +++ b/Modules/Course/classes/class.ilTimingsCronReminder.php @@ -251,7 +251,7 @@ protected function fillObjectListForMailBody(array $objects, ilTemplate $tpl): b { $has_elements = false; foreach ($objects as $object_id => $object_details) { - if ($object_details['type'] == 'fold') { + if ($object_details['type'] != 'fold') { $tpl->setCurrentBlock('items'); $tpl->setVariable('HREF', $object_details['url']); $tpl->setVariable('ITEM_TITLE', $object_details['title']); From 0b3ac89af94e3c2104d8f0e3f1d81a79a1f50be1 Mon Sep 17 00:00:00 2001 From: Lukas Eichenauer Date: Wed, 30 Oct 2024 15:23:04 +0100 Subject: [PATCH 162/292] fix: update regex in \ilQTIParser::fetchNumericVersionFromVersionDateString to handle different version conventions between version 5-8 --- Services/QTI/classes/class.ilQTIParser.php | 18 ++++++++-------- Services/QTI/test/ilQTIParserTest.php | 24 ++++++++++++++++++++++ 2 files changed, 33 insertions(+), 9 deletions(-) diff --git a/Services/QTI/classes/class.ilQTIParser.php b/Services/QTI/classes/class.ilQTIParser.php index eab18ca96d44..15cb23bc4cb0 100644 --- a/Services/QTI/classes/class.ilQTIParser.php +++ b/Services/QTI/classes/class.ilQTIParser.php @@ -234,12 +234,12 @@ public function getTestObject(): ilObjTest } /** - * set event handler - * should be overwritten by inherited class - * @access private - * - * @param XMLParser|resource $a_xml_parser - */ + * set event handler + * should be overwritten by inherited class + * @access private + * + * @param XMLParser|resource $a_xml_parser + */ public function setHandlers($a_xml_parser): void { xml_set_object($a_xml_parser, $this); @@ -787,7 +787,7 @@ public function handlerParseEndTag($a_xml_parser, string $a_name): void case "material": if ($this->material) { $mat = $this->material->getMaterial(0); - if(!is_array($mat)) { + if (!is_array($mat)) { $this->material = null; break; } @@ -847,7 +847,7 @@ public function handlerParseEndTag($a_xml_parser, string $a_name): void $this->matimage = null; break; - // add support for matbreak element + // add support for matbreak element case "matbreak": $this->mattext = new ilQTIMattext(); $this->mattext->setContent('
'); @@ -1253,7 +1253,7 @@ protected function fetchNumericVersionFromVersionDateString(string $versionDateS { $matches = null; - if (preg_match('/^(\d+\.\d+\.\d+) .*$/', $versionDateString, $matches)) { + if (preg_match('/^(\d+\.\d+(?:\.\d+)?)(?: .*)?$/', $versionDateString, $matches)) { return $matches[1]; } diff --git a/Services/QTI/test/ilQTIParserTest.php b/Services/QTI/test/ilQTIParserTest.php index 56b0dd53a58d..d79cbcdaba81 100644 --- a/Services/QTI/test/ilQTIParserTest.php +++ b/Services/QTI/test/ilQTIParserTest.php @@ -57,4 +57,28 @@ protected function tearDown(): void { unset($GLOBALS['DIC']); } + + public function testSetGetIliasSourceVersionWithoutPatch(): void + { + $this->assertEquals('7.13', $this->fetchNumericVersionFromVersionDateString('7.13 2022-08-31')); + } + + public function testSetGetIliasSourceVersionWithPatch(): void + { + $this->assertEquals('5.4.22', $this->fetchNumericVersionFromVersionDateString('5.4.22 2021-05-14')); + } + + public function testSetGetIliasSourceVersionWithoutDate(): void + { + $this->assertEquals('8.14', $this->fetchNumericVersionFromVersionDateString('8.14')); + } + + protected function fetchNumericVersionFromVersionDateString(string $version): string + { + $instance = new ilQTIParser('dummy xml file'); + $reflection = new ReflectionClass($instance); + $method = $reflection->getMethod('fetchNumericVersionFromVersionDateString'); + $method->setAccessible(true); + return $method->invoke($instance, $version); + } } From acec0dbf6a81c29220fbb79b4fc6fa20eb3e5e73 Mon Sep 17 00:00:00 2001 From: Lukas Eichenauer Date: Wed, 30 Oct 2024 15:29:54 +0100 Subject: [PATCH 163/292] fix: error while parsing version number leads to broken Cloze Question Import (34365) see also 39073 for reference --- .../import/qti12/class.assClozeTestImport.php | 36 +++++++------------ 1 file changed, 12 insertions(+), 24 deletions(-) diff --git a/Modules/TestQuestionPool/classes/import/qti12/class.assClozeTestImport.php b/Modules/TestQuestionPool/classes/import/qti12/class.assClozeTestImport.php index 631fc667f4f2..f18801cd926d 100644 --- a/Modules/TestQuestionPool/classes/import/qti12/class.assClozeTestImport.php +++ b/Modules/TestQuestionPool/classes/import/qti12/class.assClozeTestImport.php @@ -48,43 +48,32 @@ public function fromXML(&$item, $questionpool_id, &$tst_id, &$tst_object, &$ques ilSession::clear('import_mob_xhtml'); $presentation = $item->getPresentation(); - $packageIliasVersion = $item->getIliasSourceVersion('ILIAS_VERSION'); - $seperate_question_field = $item->getMetadataEntry("question"); - - $questiontext = ''; - if (!$packageIliasVersion || version_compare($packageIliasVersion, '5.0.0', '<')) { - $questiontext = ' '; - } elseif ($seperate_question_field) { - $questiontext = $this->processNonAbstractedImageReferences( - $seperate_question_field, - $item->getIliasSourceNic() - ); - } + $questiontext = $this->processNonAbstractedImageReferences( + $item->getMetadataEntry("question") ?? ' ', + $item->getIliasSourceNic() + ); - $clozetext = array(); - $shuffle = 0; - $now = getdate(); - $created = sprintf("%04d%02d%02d%02d%02d%02d", $now['year'], $now['mon'], $now['mday'], $now['hours'], $now['minutes'], $now['seconds']); - $gaps = array(); + $clozetext_array = []; + $gaps = []; foreach ($presentation->order as $entry) { switch ($entry["type"]) { case "material": - $materialString = $this->object->QTIMaterialToString( + $material_string = $this->object->QTIMaterialToString( $presentation->material[$entry["index"]] ); if ($questiontext === ' ') { - $questiontext = $materialString; + $questiontext = $material_string; } else { - array_push($clozetext, $materialString); + array_push($clozetext_array, $material_string); } break; case "response": $response = $presentation->response[$entry["index"]]; $rendertype = $response->getRenderType(); - array_push($clozetext, "<<" . $response->getIdent() . ">>"); + array_push($clozetext_array, "<<" . $response->getIdent() . ">>"); switch (strtolower(get_class($response->getRenderType()))) { case "ilqtirenderfib": @@ -292,7 +281,7 @@ public function fromXML(&$item, $questionpool_id, &$tst_id, &$tst_object, &$ques } $this->object->setQuestion($questiontext); - $clozetext = join("", $clozetext); + $clozetext = join("", $clozetext_array); foreach ($gaptext as $idx => $val) { $clozetext = str_replace("<<" . $idx . ">>", $val, $clozetext); @@ -323,8 +312,7 @@ public function fromXML(&$item, $questionpool_id, &$tst_id, &$tst_object, &$ques $m = $this->object->QTIMaterialToString($material); $feedbacksgeneric[$correctness] = $m; } - $questiontext = $this->object->getQuestion(); - $clozetext = $this->object->getClozeText(); + if (is_array(ilSession::get("import_mob_xhtml"))) { foreach (ilSession::get("import_mob_xhtml") as $mob) { if ($tst_id > 0) { From 7dacdb4edd5b3f610e8a50e29c05893e36e7d9ea Mon Sep 17 00:00:00 2001 From: Stephan Kergomard Date: Wed, 6 Nov 2024 15:45:10 +0100 Subject: [PATCH 164/292] Test: Fix Copyright --- .../classes/import/qti12/class.assClozeTestImport.php | 1 + 1 file changed, 1 insertion(+) diff --git a/Modules/TestQuestionPool/classes/import/qti12/class.assClozeTestImport.php b/Modules/TestQuestionPool/classes/import/qti12/class.assClozeTestImport.php index f18801cd926d..76e1003ebe14 100644 --- a/Modules/TestQuestionPool/classes/import/qti12/class.assClozeTestImport.php +++ b/Modules/TestQuestionPool/classes/import/qti12/class.assClozeTestImport.php @@ -1,4 +1,5 @@ Date: Wed, 6 Nov 2024 16:47:08 +0100 Subject: [PATCH 165/292] AdvMD: be more lenient when filtering text, links (42217) --- ...ss.ilADTExternalLinkSearchBridgeSingle.php | 11 ++++++---- ...ss.ilADTInternalLinkSearchBridgeSingle.php | 11 ++++++---- ...s.ilADTLocalizedTextSearchBridgeSingle.php | 12 +++++------ .../class.ilADTTextSearchBridgeSingle.php | 20 ++++++++++++++++++- 4 files changed, 39 insertions(+), 15 deletions(-) diff --git a/Services/ADT/classes/Types/ExternalLink/class.ilADTExternalLinkSearchBridgeSingle.php b/Services/ADT/classes/Types/ExternalLink/class.ilADTExternalLinkSearchBridgeSingle.php index 8fce412d190f..acb367430afa 100644 --- a/Services/ADT/classes/Types/ExternalLink/class.ilADTExternalLinkSearchBridgeSingle.php +++ b/Services/ADT/classes/Types/ExternalLink/class.ilADTExternalLinkSearchBridgeSingle.php @@ -1,7 +1,5 @@ @@ -146,9 +146,12 @@ public function getSQLCondition(string $a_element_id, int $mode = self::SQL_LIKE public function isInCondition(ilADT $a_adt): bool { if ($this->getADT()->getCopyOfDefinition()->isComparableTo($a_adt)) { + $search_term = strtolower(trim((string) $this->getADT()->getUrl())); + $title = strtolower(trim((string) $a_adt->getTitle())); + $url = strtolower(trim((string) $a_adt->getUrl())); return - strcasecmp(trim($this->getADT()->getUrl()), trim($a_adt->getUrl())) === 0 || - strcasecmp(trim($this->getADT()->getUrl()), trim($a_adt->getTitle())) === 0; + str_contains($title, $search_term) || + str_contains($url, $search_term); } return false; } diff --git a/Services/ADT/classes/Types/InternalLink/class.ilADTInternalLinkSearchBridgeSingle.php b/Services/ADT/classes/Types/InternalLink/class.ilADTInternalLinkSearchBridgeSingle.php index f18ee43e9af9..0a13403f86be 100644 --- a/Services/ADT/classes/Types/InternalLink/class.ilADTInternalLinkSearchBridgeSingle.php +++ b/Services/ADT/classes/Types/InternalLink/class.ilADTInternalLinkSearchBridgeSingle.php @@ -1,7 +1,5 @@ @@ -132,8 +132,11 @@ public function isInCondition(ilADT $a_adt): bool { if ($this->getADT()->getCopyOfDefinition()->isComparableTo($a_adt)) { $ref_id = $a_adt->getTargetRefId(); - $title = ilObject::_lookupTitle((int) ilObject::_lookupObjId((int) $ref_id)); - return strcasecmp($title, $this->getTitleQuery()) === 0; + $title = strtolower(trim( + ilObject::_lookupTitle((int) ilObject::_lookupObjId((int) $ref_id)) + )); + $query = strtolower(trim($this->getTitleQuery())); + return str_contains($title, $query); } return false; } diff --git a/Services/ADT/classes/Types/LocalizedText/class.ilADTLocalizedTextSearchBridgeSingle.php b/Services/ADT/classes/Types/LocalizedText/class.ilADTLocalizedTextSearchBridgeSingle.php index c5da66422800..bfb333dda1bc 100644 --- a/Services/ADT/classes/Types/LocalizedText/class.ilADTLocalizedTextSearchBridgeSingle.php +++ b/Services/ADT/classes/Types/LocalizedText/class.ilADTLocalizedTextSearchBridgeSingle.php @@ -1,7 +1,5 @@ getADT()->getCopyOfDefinition()->isComparableTo($a_adt)) { - foreach ($a_adt->getTranslations() as $language => $txt) { - if (strcasecmp($txt, $this->getADT()->getText()) === 0) { - return true; - } + foreach ($a_adt->getTranslations() as $language => $text) { + $search_term = strtolower(trim((string) $this->getADT()->getText())); + $text = strtolower(trim((string) $text)); + return str_contains($text, $search_term); } } return false; diff --git a/Services/ADT/classes/Types/Text/class.ilADTTextSearchBridgeSingle.php b/Services/ADT/classes/Types/Text/class.ilADTTextSearchBridgeSingle.php index d52ae2d4cf24..2976513d41c8 100644 --- a/Services/ADT/classes/Types/Text/class.ilADTTextSearchBridgeSingle.php +++ b/Services/ADT/classes/Types/Text/class.ilADTTextSearchBridgeSingle.php @@ -1,5 +1,21 @@ getADT()->getCopyOfDefinition()->isComparableTo($a_adt)) { - return $this->getADT()->equals($a_adt); + $search_term = strtolower(trim((string) $this->getADT()->getText())); + $text = strtolower(trim((string) $a_adt->getText())); + return str_contains($text, $search_term); } return false; } From fbc0f7e42c453c155e031273cf939bebc008f270 Mon Sep 17 00:00:00 2001 From: Tim Schmitz Date: Wed, 6 Nov 2024 17:05:44 +0100 Subject: [PATCH 166/292] AdvMD: fix filtering localized text --- .../class.ilADTLocalizedTextSearchBridgeSingle.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Services/ADT/classes/Types/LocalizedText/class.ilADTLocalizedTextSearchBridgeSingle.php b/Services/ADT/classes/Types/LocalizedText/class.ilADTLocalizedTextSearchBridgeSingle.php index bfb333dda1bc..c5518b296150 100644 --- a/Services/ADT/classes/Types/LocalizedText/class.ilADTLocalizedTextSearchBridgeSingle.php +++ b/Services/ADT/classes/Types/LocalizedText/class.ilADTLocalizedTextSearchBridgeSingle.php @@ -124,7 +124,9 @@ public function isInCondition(ilADT $a_adt): bool foreach ($a_adt->getTranslations() as $language => $text) { $search_term = strtolower(trim((string) $this->getADT()->getText())); $text = strtolower(trim((string) $text)); - return str_contains($text, $search_term); + if (str_contains($text, $search_term)) { + return true; + } } } return false; From 237760e274065079ceb694d709949446d63e7036 Mon Sep 17 00:00:00 2001 From: Alex Killing Date: Wed, 6 Nov 2024 17:06:10 +0100 Subject: [PATCH 167/292] 41886: Fehler in Matrixfrage neutrale Antwort --- .../Categories/class.ilCategoryWizardInputGUI.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/SurveyQuestionPool/Categories/class.ilCategoryWizardInputGUI.php b/Modules/SurveyQuestionPool/Categories/class.ilCategoryWizardInputGUI.php index a15828fef311..709b71227489 100644 --- a/Modules/SurveyQuestionPool/Categories/class.ilCategoryWizardInputGUI.php +++ b/Modules/SurveyQuestionPool/Categories/class.ilCategoryWizardInputGUI.php @@ -244,7 +244,7 @@ public function checkInput(): bool // check neutral column scale if ($neutral_scale != "") { - if (is_array($foundvalues['scale'])) { + if (isset($foundvalues['scale'])) { if (in_array($neutral_scale, $foundvalues['scale'])) { $this->setAlert($lng->txt("msg_duplicate_scale")); return false; From 89509017d7b1ff9a9182d9263ff22c764717018b Mon Sep 17 00:00:00 2001 From: Alex Killing Date: Wed, 6 Nov 2024 17:36:45 +0100 Subject: [PATCH 168/292] 31984: Error when downloading submissions with deleted users --- .../class.ilExerciseManagementCollectFilesJob.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Modules/Exercise/classes/BackgroundTasks/class.ilExerciseManagementCollectFilesJob.php b/Modules/Exercise/classes/BackgroundTasks/class.ilExerciseManagementCollectFilesJob.php index e12260c30bd8..13361c3c1e8b 100644 --- a/Modules/Exercise/classes/BackgroundTasks/class.ilExerciseManagementCollectFilesJob.php +++ b/Modules/Exercise/classes/BackgroundTasks/class.ilExerciseManagementCollectFilesJob.php @@ -650,6 +650,9 @@ public function getAssignmentMembersIds(): array " WHERE ass_id = " . $ilDB->quote($this->assignment->getId(), "integer")); while ($rec = $ilDB->fetchAssoc($set)) { + if (!\ilObjUser::userExists([(int) $rec['usr_id']])) { + continue; + } $members[] = $rec['usr_id']; } From 55f9cfd8e9c00b5d925cb554dd014d0e6345c4d9 Mon Sep 17 00:00:00 2001 From: Fabian Helfer <82493694+fhelfer@users.noreply.github.com> Date: Thu, 7 Nov 2024 08:36:38 +0100 Subject: [PATCH 169/292] T&A Bugfix #0029216: Missing Participant Results in Test Export/Import (#7932) * Fix Test Export with participant results * remove duplicate code ilObjTestGUI * reduce TestImport else Code * cs fix ilTestImporter --- Modules/Test/classes/class.ilObjTestGUI.php | 42 +++++++------- Modules/Test/classes/class.ilTestImporter.php | 55 +++++++++++-------- 2 files changed, 50 insertions(+), 47 deletions(-) diff --git a/Modules/Test/classes/class.ilObjTestGUI.php b/Modules/Test/classes/class.ilObjTestGUI.php index 38775cd05165..3668f51a4e1b 100755 --- a/Modules/Test/classes/class.ilObjTestGUI.php +++ b/Modules/Test/classes/class.ilObjTestGUI.php @@ -1336,37 +1336,33 @@ public function importVerifiedFileObject() $questionParentObjId = $_POST["qpl"]; } + $imp = new ilImport($this->testrequest->getRefId()); + $map = $imp->getMapping(); + $map->addMapping('Modules/Test', 'tst', 'new_id', $newObj->getId()); + + $fileName = ilSession::get('tst_import_subdir') . '.zip'; + $fullPath = ilSession::get('tst_import_dir') . '/' . $fileName; + if (is_file(ilSession::get("tst_import_dir") . '/' . ilSession::get("tst_import_subdir") . "/manifest.xml")) { $newObj->saveToDb(); ilSession::set('tst_import_idents', $_POST['ident'] ?? ''); ilSession::set('tst_import_qst_parent', $questionParentObjId); - $fileName = ilSession::get('tst_import_subdir') . '.zip'; - $fullPath = ilSession::get('tst_import_dir') . '/' . $fileName; - $imp = new ilImport($this->testrequest->getRefId()); - $map = $imp->getMapping(); - $map->addMapping('Modules/Test', 'tst', 'new_id', $newObj->getId()); $imp->importObject($newObj, $fullPath, $fileName, 'tst', 'Modules/Test', true); } else { - $qtiParser = new ilQTIParser(ilSession::get("tst_import_qti_file"), ilQTIParser::IL_MO_PARSE_QTI, $questionParentObjId, $_POST["ident"] ?? ''); - if (!file_exists(ilSession::get("tst_import_results_file")) - && (!isset($_POST["ident"]) || !is_array($_POST["ident"]) || !count($_POST["ident"]))) { - $qtiParser->setIgnoreItemsEnabled(true); - } - $qtiParser->setTestObject($newObj); - $qtiParser->startParsing(); - $newObj->saveToDb(); - $questionPageParser = new ilQuestionPageParser($newObj, ilSession::get("tst_import_xml_file"), ilSession::get("tst_import_subdir")); - $questionPageParser->setQuestionMapping($qtiParser->getImportMapping()); - $questionPageParser->startParsing(); - - if (file_exists(ilSession::get("tst_import_results_file"))) { - $results = new ilTestResultsImportParser(ilSession::get("tst_import_results_file"), $newObj); - $results->setQuestionIdMapping($qtiParser->getQuestionIdMapping()); - $results->startParsing(); - } - $newObj->update(); + $test_importer = new ilTestImporter(); + $test_importer->setImport($imp); + $test_importer->setInstallId(IL_INST_ID); + $test_importer->setImportDirectory(ilSession::get("tst_import_dir") . '/' . ilSession::get("tst_import_subdir")); + $test_importer->init(); + + $test_importer->importXmlRepresentation( + '', + 0, + '', + $map, + ); } diff --git a/Modules/Test/classes/class.ilTestImporter.php b/Modules/Test/classes/class.ilTestImporter.php index 3a092c1e7b04..2bc1469605b3 100644 --- a/Modules/Test/classes/class.ilTestImporter.php +++ b/Modules/Test/classes/class.ilTestImporter.php @@ -93,31 +93,9 @@ public function importXmlRepresentation(string $a_entity, string $a_id, string $ $questionPageParser->setQuestionMapping($qtiParser->getImportMapping()); $questionPageParser->startParsing(); - foreach ($qtiParser->getQuestionIdMapping() as $oldQuestionId => $newQuestionId) { - $a_mapping->addMapping( - "Services/Taxonomy", - "tax_item", - "tst:quest:$oldQuestionId", - $newQuestionId - ); - - $a_mapping->addMapping( - "Services/Taxonomy", - "tax_item_obj_id", - "tst:quest:$oldQuestionId", - $newObj->getId() - ); - - $a_mapping->addMapping( - "Modules/Test", - "quest", - $oldQuestionId, - $newQuestionId - ); - } + $a_mapping = $this->addTexonomyAndQuestionsMapping($qtiParser->getQuestionIdMapping(), $newObj->getId(), $a_mapping); if ($newObj->isRandomTest()) { - $newObj->questions = array(); $this->importRandomQuestionSetConfig($newObj, $xml_file, $a_mapping); } @@ -139,6 +117,34 @@ public function importXmlRepresentation(string $a_entity, string $a_id, string $ $a_mapping->addMapping("Modules/Test", "tst", $a_id, $newObj->getId()); } + public function addTexonomyAndQuestionsMapping(array $question_id_mapping, int $new_obj_id, ilImportMapping $mapping): ilImportMapping + { + foreach ($question_id_mapping as $oldQuestionId => $newQuestionId) { + $mapping->addMapping( + "Services/Taxonomy", + "tax_item", + "tst:quest:$oldQuestionId", + $newQuestionId + ); + + $mapping->addMapping( + "Services/Taxonomy", + "tax_item_obj_id", + "tst:quest:$oldQuestionId", + $new_obj_id + ); + + $mapping->addMapping( + "Modules/Test", + "quest", + $oldQuestionId, + $newQuestionId + ); + } + + return $mapping; + } + /** * Final processing * @param ilImportMapping $a_mapping @@ -287,8 +293,9 @@ private function getImportPackageName(): string return $name; } - protected function importRandomQuestionSetConfig(ilObjTest $testOBJ, $xmlFile, $a_mapping) + public function importRandomQuestionSetConfig(ilObjTest $testOBJ, $xmlFile, $a_mapping) { + $testOBJ->questions = []; $parser = new ilObjTestXMLParser($xmlFile); $parser->setTestOBJ($testOBJ); $parser->setImportMapping($a_mapping); From d99e42b1b88a567a391b4004f3999b6c30f3af4b Mon Sep 17 00:00:00 2001 From: Lukas Eichenauer <47783030+lukas-heinrich@users.noreply.github.com> Date: Thu, 7 Nov 2024 09:39:58 +0100 Subject: [PATCH 170/292] T&A 41629: Fix handling of deleted global templates (#8338) * fix: add handling to remove deleted global template by adding default property initialization and showing failure message (41629) * style: fix typo in error message * refactor: use ui factory and renderer instead of html tags * fix: add missing global mocks in ilObjTestSettingsGeneralGUITest * fix: sort langfile ilias_de.lang * fix: update copyright header in class.ilSettingsTemplate.php --------- Co-authored-by: Lukas Eichenauer --- .../class.ilObjTestSettingsGeneralGUI.php | 48 ++++++++++--------- .../test/ilObjTestSettingsGeneralGUITest.php | 6 ++- .../classes/class.ilSettingsTemplate.php | 18 +++++-- lang/ilias_de.lang | 1 + lang/ilias_en.lang | 1 + 5 files changed, 45 insertions(+), 29 deletions(-) diff --git a/Modules/Test/classes/class.ilObjTestSettingsGeneralGUI.php b/Modules/Test/classes/class.ilObjTestSettingsGeneralGUI.php index 6c6fd434ddf6..5a5a350e1b2e 100644 --- a/Modules/Test/classes/class.ilObjTestSettingsGeneralGUI.php +++ b/Modules/Test/classes/class.ilObjTestSettingsGeneralGUI.php @@ -17,6 +17,8 @@ *********************************************************************/ use Psr\Http\Message\RequestInterface; +use ILIAS\UI\Factory as UIFactory; +use ILIAS\UI\Renderer as UIRenderer; /** * GUI class that manages the editing of general test settings/properties @@ -61,6 +63,8 @@ class ilObjTestSettingsGeneralGUI extends ilTestSettingsGUI protected ilObjTestGUI $testGUI; private ilTestQuestionSetConfigFactory $testQuestionSetConfigFactory; private RequestInterface $request; + private UIFactory $ui_factory; + private UIRenderer $ui_renderer; public function __construct( ilCtrlInterface $ctrl, @@ -93,6 +97,8 @@ public function __construct( $testGUI->getTestObject() ); $this->request = $DIC->http()->request(); + $this->ui_factory = $DIC->ui()->factory(); + $this->ui_renderer = $DIC->ui()->renderer(); parent::__construct($testGUI->getTestObject()); } @@ -138,10 +144,8 @@ private function showFormCmd(ilPropertyFormGUI $form = null) $form = $this->buildForm(); } - $formHTML = $this->ctrl->getHTML($form); - $msgHTML = $this->getSettingsTemplateMessageHTML(); - - $this->tpl->setContent($formHTML . $msgHTML); + $this->tpl->setContent($this->ctrl->getHTML($form)); + $this->populateSettingsTemplateMessage(); } private function showConfirmation(ilPropertyFormGUI $form, $oldQuestionSetType, $newQuestionSetType, $hasQuestionsWithoutQuestionpool) @@ -163,32 +167,32 @@ private function showConfirmation(ilPropertyFormGUI $form, $oldQuestionSetType, $this->tpl->setContent($this->ctrl->getHTML($confirmation)); } - protected function getSettingsTemplateMessageHTML(): string + protected function populateSettingsTemplateMessage(): void { - if ($this->settingsTemplate) { - $title = $this->settingsTemplate->getTitle(); + if (!$this->settingsTemplate) { + return; + } + $link = $this->ui_factory->link()->standard( + $this->lng->txt('test_using_template_link'), + $this->ctrl->getLinkTarget($this, self::CMD_SHOW_RESET_TPL_CONFIRM) + ); + if ($this->settingsTemplate->isAvailable()) { + $title = $this->settingsTemplate->getTitle(); if ($this->settingsTemplate->getAutoGenerated()) { $title = $this->lng->txt($title); } - global $DIC; - $tpl = $DIC['tpl']; - - $link = $this->ctrl->getLinkTarget($this, self::CMD_SHOW_RESET_TPL_CONFIRM); - $link = "" . $this->lng->txt("test_using_template_link") . ""; - - $msgHTML = ilUtil::getSystemMessageHTML( - sprintf($this->lng->txt("test_using_template"), $title, $link), - "info" - ); - - $msgHTML = "
$msgHTML
"; + $message = sprintf($this->lng->txt('test_using_template'), $title, $this->ui_renderer->render($link)); } else { - $msgHTML = ''; + $message = sprintf($this->lng->txt('test_using_removed_template'), $this->ui_renderer->render($link)); } - return $msgHTML; + $this->tpl->setOnScreenMessage( + $this->settingsTemplate->isAvailable() ? 'info' : 'failure', + $message, + !$this->settingsTemplate->isAvailable() + ); } private function confirmedSaveFormCmd(): void @@ -975,7 +979,7 @@ private function addTestRunProperties(ilPropertyFormGUI $form) $duration->setShowMinutes(true); $pw_time_array = ["00", "000", "00", "00", "00"]; - if($this->testOBJ->getPassWaiting() !== '') { + if ($this->testOBJ->getPassWaiting() !== '') { $pw_time_array = explode(':', $this->testOBJ->getPassWaiting()); } diff --git a/Modules/Test/test/ilObjTestSettingsGeneralGUITest.php b/Modules/Test/test/ilObjTestSettingsGeneralGUITest.php index 23705ada873f..3b2d2dffd330 100644 --- a/Modules/Test/test/ilObjTestSettingsGeneralGUITest.php +++ b/Modules/Test/test/ilObjTestSettingsGeneralGUITest.php @@ -1,7 +1,5 @@ @@ -38,6 +38,8 @@ protected function setUp(): void $this->addGlobal_tree(); $this->addGlobal_ilAppEventHandler(); $this->addGlobal_objDefinition(); + $this->addGlobal_uiRenderer(); + $this->addGlobal_uiFactory(); $objTestGui_mock = $this->getMockBuilder(ilObjTestGUI::class)->disableOriginalConstructor()->onlyMethods(array('getTestObject'))->getMock(); $objTestGui_mock->method('getTestObject')->willReturn($this->createMock(ilObjTest::class)); diff --git a/Services/Administration/classes/class.ilSettingsTemplate.php b/Services/Administration/classes/class.ilSettingsTemplate.php index 40b2fe562234..ec4cc145ba2d 100644 --- a/Services/Administration/classes/class.ilSettingsTemplate.php +++ b/Services/Administration/classes/class.ilSettingsTemplate.php @@ -1,7 +1,5 @@ */ private array $hidden_tab = []; private bool $auto_generated = false; private ?ilSettingsTemplateConfig $config = null; + private bool $available = true; public function __construct( int $a_id = 0, @@ -103,6 +104,11 @@ public function getDescription(): string return $this->description; } + public function isAvailable(): bool + { + return $this->available; + } + /** * Set setting * @param array|string $a_value @@ -188,6 +194,7 @@ public function read(): void " id = " . $ilDB->quote($this->getId(), "integer") ); if ($ilDB->numRows($set) === 0) { + $this->available = false; return; } @@ -220,6 +227,7 @@ public function read(): void while ($rec = $ilDB->fetchAssoc($set)) { $this->addHiddenTab($rec["tab_id"]); } + $this->available = true; } public function create(): void diff --git a/lang/ilias_de.lang b/lang/ilias_de.lang index 549e70cdc152..ac4de650f0b1 100644 --- a/lang/ilias_de.lang +++ b/lang/ilias_de.lang @@ -1262,6 +1262,7 @@ assessment#:#test_question_set_type_random_info#:#Jedem Teilnehmenden werden unt assessment#:#test_results#:#Bekanntgabe des Testergebnisses assessment#:#test_scoring#:#Bewertung des Tests assessment#:#test_template_reset#:#Die Vorlage wurde entfernt. +assessment#:#test_using_removed_template#:#Dieser Test verwendet eine gelöschte Vorlage. Bitte entfernen Sie die Verknüpfung hier: %s. assessment#:#test_using_template#:#Dieser Test verwendet die Vorlage %s. Wenn Sie keine Vorlage und alle Einstellungen verwenden wollen, klicken Sie bitte hier: %s. assessment#:#test_using_template_link#:#Vorlage nicht mehr verwenden assessment#:#text_correct#:#Korrekter Text diff --git a/lang/ilias_en.lang b/lang/ilias_en.lang index b94bc76ff27f..03fcef0da2cb 100644 --- a/lang/ilias_en.lang +++ b/lang/ilias_en.lang @@ -1262,6 +1262,7 @@ assessment#:#test_question_set_type_random_info#:#Each test participant will see assessment#:#test_results#:#Summary Test Results assessment#:#test_scoring#:#Scoring Options assessment#:#test_template_reset#:#The template has been removed. +assessment#:#test_using_removed_template#:#This test uses a deleted template. Please remove the connection here: %s. assessment#:#test_using_template#:#This test uses the template %s. If you do not want to use a template and have access to all settings, please click here: %s. assessment#:#test_using_template_link#:#Do not use template anymore assessment#:#text_correct#:#Correct Text From a00a7f4281c0e80140f0421e5a312f07cae4b34e Mon Sep 17 00:00:00 2001 From: Christoph Ludolf Date: Thu, 7 Nov 2024 12:48:15 +0100 Subject: [PATCH 171/292] 8 mantis ilias 42091, readds removed cache code in ilCalenderAuthenticationToken --- .../classes/class.ilCalendarAuthenticationToken.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Services/Calendar/classes/class.ilCalendarAuthenticationToken.php b/Services/Calendar/classes/class.ilCalendarAuthenticationToken.php index 8a2c8b21439c..e07457fa39d7 100644 --- a/Services/Calendar/classes/class.ilCalendarAuthenticationToken.php +++ b/Services/Calendar/classes/class.ilCalendarAuthenticationToken.php @@ -143,7 +143,13 @@ public function storeIcal(): void */ public function isIcalExpired(): bool { - return true; + if (!ilCalendarSettings::_getInstance()->isSynchronisationCacheEnabled()) { + return true; + } + if (!ilCalendarSettings::_getInstance()->getSynchronisationCacheMinutes()) { + return true; + } + return time() > ($this->ical_ctime + 60 * ilCalendarSettings::_getInstance()->getSynchronisationCacheMinutes()); } public function add(): string From 154f93c89d1f0c1813eb995b10eaea1e603f8f89 Mon Sep 17 00:00:00 2001 From: Christoph Ludolf Date: Thu, 7 Nov 2024 12:54:36 +0100 Subject: [PATCH 172/292] 8 mantis ilias 42091, copyright fix --- .../Calendar/classes/class.ilCalendarAuthenticationToken.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Services/Calendar/classes/class.ilCalendarAuthenticationToken.php b/Services/Calendar/classes/class.ilCalendarAuthenticationToken.php index e07457fa39d7..c67fc87676ab 100644 --- a/Services/Calendar/classes/class.ilCalendarAuthenticationToken.php +++ b/Services/Calendar/classes/class.ilCalendarAuthenticationToken.php @@ -1,7 +1,5 @@ From a6593905035b117fba6ca75a7956b83527e62d3b Mon Sep 17 00:00:00 2001 From: Tim Schmitz Date: Thu, 7 Nov 2024 16:26:30 +0100 Subject: [PATCH 173/292] Tracking: read out org units for lp tables (42609) --- .../class.ilTrMatrixTableGUI.php | 15 +++++++++++++++ .../class.ilTrObjectUsersPropsTableGUI.php | 16 ++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/Services/Tracking/classes/repository_statistics/class.ilTrMatrixTableGUI.php b/Services/Tracking/classes/repository_statistics/class.ilTrMatrixTableGUI.php index 096c29ebb7b7..fc9527f6e32c 100644 --- a/Services/Tracking/classes/repository_statistics/class.ilTrMatrixTableGUI.php +++ b/Services/Tracking/classes/repository_statistics/class.ilTrMatrixTableGUI.php @@ -481,6 +481,21 @@ public function getItems( } } + /* + * ilTrQuery does not read out any information about org units + * (nor should it), so it needs to be added here. + */ + if (in_array('org_units', $a_user_fields)) { + foreach ($data['set'] as $key => $usr_data) { + if (!isset($usr_data['usr_id'])) { + continue; + } + $usr_id = (int) $usr_data['usr_id']; + $org_units = ilOrgUnitPathStorage::getTextRepresentationOfUsersOrgUnits($usr_id); + $data["set"][$key]['org_units'] = $org_units; + } + } + $this->setMaxCount($data["cnt"] ?? 0); $this->setData($data["set"] ?? []); return $collection["object_ids"] ?? []; diff --git a/Services/Tracking/classes/repository_statistics/class.ilTrObjectUsersPropsTableGUI.php b/Services/Tracking/classes/repository_statistics/class.ilTrObjectUsersPropsTableGUI.php index 3b99324a0485..590ffb6bb609 100644 --- a/Services/Tracking/classes/repository_statistics/class.ilTrObjectUsersPropsTableGUI.php +++ b/Services/Tracking/classes/repository_statistics/class.ilTrObjectUsersPropsTableGUI.php @@ -224,6 +224,22 @@ public function getItems(): void $this->user_fields ); } + + /* + * ilTrQuery does not read out any information about org units + * (nor should it), so it needs to be added here. + */ + if (in_array('org_units', $additional_fields)) { + foreach ($tr_data['set'] as $key => $data) { + if (!isset($data['usr_id'])) { + continue; + } + $usr_id = (int) $data['usr_id']; + $org_units = ilOrgUnitPathStorage::getTextRepresentationOfUsersOrgUnits($usr_id); + $tr_data["set"][$key]['org_units'] = $org_units; + } + } + $this->setMaxCount($tr_data["cnt"]); $this->setData($tr_data["set"]); } From 5b72f11a9b38d21abb8ec79375e7c07baa05b091 Mon Sep 17 00:00:00 2001 From: Tim Schmitz Date: Thu, 7 Nov 2024 16:29:50 +0100 Subject: [PATCH 174/292] Tracking: safer array access --- .../classes/repository_statistics/class.ilTrMatrixTableGUI.php | 2 +- .../class.ilTrObjectUsersPropsTableGUI.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Services/Tracking/classes/repository_statistics/class.ilTrMatrixTableGUI.php b/Services/Tracking/classes/repository_statistics/class.ilTrMatrixTableGUI.php index fc9527f6e32c..942b72cdf481 100644 --- a/Services/Tracking/classes/repository_statistics/class.ilTrMatrixTableGUI.php +++ b/Services/Tracking/classes/repository_statistics/class.ilTrMatrixTableGUI.php @@ -486,7 +486,7 @@ public function getItems( * (nor should it), so it needs to be added here. */ if (in_array('org_units', $a_user_fields)) { - foreach ($data['set'] as $key => $usr_data) { + foreach (($data['set'] ?? []) as $key => $usr_data) { if (!isset($usr_data['usr_id'])) { continue; } diff --git a/Services/Tracking/classes/repository_statistics/class.ilTrObjectUsersPropsTableGUI.php b/Services/Tracking/classes/repository_statistics/class.ilTrObjectUsersPropsTableGUI.php index 590ffb6bb609..2051a5ad75da 100644 --- a/Services/Tracking/classes/repository_statistics/class.ilTrObjectUsersPropsTableGUI.php +++ b/Services/Tracking/classes/repository_statistics/class.ilTrObjectUsersPropsTableGUI.php @@ -230,7 +230,7 @@ public function getItems(): void * (nor should it), so it needs to be added here. */ if (in_array('org_units', $additional_fields)) { - foreach ($tr_data['set'] as $key => $data) { + foreach (($tr_data['set'] ?? []) as $key => $data) { if (!isset($data['usr_id'])) { continue; } From 8f8f030ee71f07afbd393cf6bbedb9959f9e2f36 Mon Sep 17 00:00:00 2001 From: Thomas Famula Date: Thu, 7 Nov 2024 17:09:37 +0100 Subject: [PATCH 175/292] 42589: If Taxonomy is shown in Presentation View an error occurs --- Modules/Glossary/Export/class.ilGlossaryDataSet.php | 6 +++--- Modules/Glossary/classes/class.ilObjGlossary.php | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Modules/Glossary/Export/class.ilGlossaryDataSet.php b/Modules/Glossary/Export/class.ilGlossaryDataSet.php index 2eedc83bf4ac..16ddac5ab764 100644 --- a/Modules/Glossary/Export/class.ilGlossaryDataSet.php +++ b/Modules/Glossary/Export/class.ilGlossaryDataSet.php @@ -255,9 +255,9 @@ public function importRecord( $newObj->setDescription($a_rec["Description"]); $newObj->setVirtualMode($a_rec["Virtual"]); $newObj->setPresentationMode($a_rec["PresMode"]); - $newObj->setSnippetLength($a_rec["SnippetLength"]); - $newObj->setActiveGlossaryMenu($a_rec["GloMenuActive"]); - $newObj->setShowTaxonomy($a_rec["ShowTax"]); + $newObj->setSnippetLength((int) ($a_rec["SnippetLength"] ?? 0)); + $newObj->setActiveGlossaryMenu((bool) ($a_rec["GloMenuActive"] ?? false)); + $newObj->setShowTaxonomy((bool) ($a_rec["ShowTax"] ?? false)); if ($this->getCurrentInstallationId() > 0) { $newObj->setImportId("il_" . $this->getCurrentInstallationId() . "_glo_" . $a_rec["Id"]); } diff --git a/Modules/Glossary/classes/class.ilObjGlossary.php b/Modules/Glossary/classes/class.ilObjGlossary.php index 9d0c334ef309..4c0b1e7eb2e0 100755 --- a/Modules/Glossary/classes/class.ilObjGlossary.php +++ b/Modules/Glossary/classes/class.ilObjGlossary.php @@ -162,11 +162,11 @@ public function setSnippetLength(int $a_val): void $this->snippet_length = $a_val; } - public function getSnippetLength(): ?int + public function getSnippetLength(): int { return ($this->snippet_length > 0) ? $this->snippet_length - : null; + : 200; } public function setOnline(bool $a_online): void From 05b457f4fed01fec981617f5cf0cfd977a4635b1 Mon Sep 17 00:00:00 2001 From: Tim Schmitz Date: Fri, 8 Nov 2024 12:39:35 +0100 Subject: [PATCH 176/292] Course: fix for tile view being selectable for loc (42128) --- Modules/Course/classes/class.ilObjCourseGUI.php | 1 + 1 file changed, 1 insertion(+) diff --git a/Modules/Course/classes/class.ilObjCourseGUI.php b/Modules/Course/classes/class.ilObjCourseGUI.php index 1f0af4247111..9a78f10a7232 100755 --- a/Modules/Course/classes/class.ilObjCourseGUI.php +++ b/Modules/Course/classes/class.ilObjCourseGUI.php @@ -744,6 +744,7 @@ public function updateObject(): void $GLOBALS['DIC']->language()->txt('crs_tile_and_objective_view_not_supported') ); $this->editObject($form); + return; } // Additional checks: both tile and session limitation activated (not supported) From 4fd5dbc100131cfb8dd1df0ae89274225a3c9afc Mon Sep 17 00:00:00 2001 From: Luka Stocker Date: Fri, 8 Nov 2024 15:56:08 +0100 Subject: [PATCH 177/292] LSO: 42456, check child_ref_id before searching for full path in learning sequence event handler to avoid error message during the copy process. https://mantis.ilias.de/view.php?id=42456 --- .../classes/class.ilLSEventHandler.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Modules/LearningSequence/classes/class.ilLSEventHandler.php b/Modules/LearningSequence/classes/class.ilLSEventHandler.php index 67b45a8aca36..3d5771b57987 100644 --- a/Modules/LearningSequence/classes/class.ilLSEventHandler.php +++ b/Modules/LearningSequence/classes/class.ilLSEventHandler.php @@ -1,7 +1,5 @@ getParentLSOInfo($origin_obj->getRefId()) ) { $new_lso = $this->getInstanceByRefId( - (int)$this->getParentLSOInfo($new_obj->getRefId())['ref_id'] + (int) $this->getParentLSOInfo($new_obj->getRefId())['ref_id'] ); $post_condition_db = $new_lso->getDI()['db.postconditions']; $post_condition = current($post_condition_db->select([$origin_obj->getRefId()])) @@ -111,6 +111,10 @@ public function handleClonedObject(ilObject $new_obj, ilObject $origin_obj): voi */ protected function getParentLSOInfo(int $child_ref_id): ?array { + if ($child_ref_id === 0) { + return null; + } + foreach ($this->tree->getPathFull($child_ref_id) as $hop) { if ($hop['type'] === 'lso') { return $hop; From fef211904cdeb82ae08bbff84949ee2c0c8f2654 Mon Sep 17 00:00:00 2001 From: Stephan Kergomard Date: Fri, 8 Nov 2024 16:55:39 +0100 Subject: [PATCH 178/292] RBAC: Fix Title Can Be Null See: https://mantis.ilias.de/view.php?id=42287 --- Services/AccessControl/classes/class.ilRbacReview.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Services/AccessControl/classes/class.ilRbacReview.php b/Services/AccessControl/classes/class.ilRbacReview.php index 6448e0e47350..8afe93a71a5c 100755 --- a/Services/AccessControl/classes/class.ilRbacReview.php +++ b/Services/AccessControl/classes/class.ilRbacReview.php @@ -871,7 +871,8 @@ public function getRolesByFilter(int $a_filter = 0, int $a_user_id = 0, string $ $res = $this->db->query($query); while ($row = $this->db->fetchAssoc($res)) { - $prefix = substr($row["title"], 0, 3) == "il_"; + $row['title'] = $row['title'] ?? ''; + $prefix = substr($row['title'], 0, 3) == "il_"; // all (assignable) internal local roles only if ($a_filter == 4 && !$prefix) { @@ -883,8 +884,7 @@ public function getRolesByFilter(int $a_filter = 0, int $a_user_id = 0, string $ continue; } - $row['title'] = (string) $row['title']; - $row['description'] = (string) $row['description']; + $row['description'] = $row['description'] ?? ''; $row["desc"] = $row["description"]; $row["user_id"] = (int) $row["owner"]; $row['obj_id'] = (int) $row['obj_id']; From df12bf984380a6faceae596f2f3912326f703587 Mon Sep 17 00:00:00 2001 From: Alexander Killing Date: Sat, 9 Nov 2024 12:16:01 +0100 Subject: [PATCH 179/292] =?UTF-8?q?42618:=20Bei=20der=20Aktivierung=20von?= =?UTF-8?q?=20zus=C3=A4tzlichen=20Spalten=20(Personenbezogenen=20Daten)=20?= =?UTF-8?q?erfolgt=20eine=20ODF=20Fehlermeldung.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Reservations/class.ilBookingReservationsTableGUI.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Modules/BookingManager/Reservations/class.ilBookingReservationsTableGUI.php b/Modules/BookingManager/Reservations/class.ilBookingReservationsTableGUI.php index 11123b0c6bb4..f9f0a83663dc 100644 --- a/Modules/BookingManager/Reservations/class.ilBookingReservationsTableGUI.php +++ b/Modules/BookingManager/Reservations/class.ilBookingReservationsTableGUI.php @@ -86,6 +86,8 @@ public function __construct( $this->addColumn("", "", 1); $this->addColumn($this->lng->txt("title"), "title"); + $this->lng->loadLanguageModule("crs"); + $selected = $this->getSelectedColumns(); $cols = $this->getSelectableColumns(); @@ -539,10 +541,11 @@ public function getItems(array $filter): void $user_ids = array_diff($user_ids, ilMemberAgreement::lookupAcceptedAgreements($parent_obj_id)); } $odf_data = ilCourseUserData::_getValuesByObjId($parent_obj_id); - $usr_data = []; foreach ($odf_data as $usr_id => $fields) { - if (in_array($usr_id, $user_ids, true)) { + // this currently does not with strict mode, since + // $user_ids holds strings + if (in_array($usr_id, $user_ids)) { foreach ($fields as $field_id => $value) { if (in_array($field_id, $odf_ids, true)) { $usr_data[$usr_id]['odf_' . $field_id] = $value; @@ -667,7 +670,7 @@ protected function fillRow(array $a_set): void foreach ($this->getSelectedColumns() as $col) { if (isset($user_cols[$col])) { $this->tpl->setCurrentBlock("user_col"); - $this->tpl->setVariable("VALUE_USER_COL", $a_set[$col] . " "); + $this->tpl->setVariable("VALUE_USER_COL", ($a_set[$col] ?? "") . " "); $this->tpl->parseCurrentBlock(); } } From f3dcb77a0f736b1338099a8f9cf76433ec753a16 Mon Sep 17 00:00:00 2001 From: Alexander Killing Date: Sun, 10 Nov 2024 10:55:04 +0100 Subject: [PATCH 180/292] 42614: BookingPool: Cloning of schedules does not work correctly, ID 1 seems to be stored for the booking objectt --- .../Schedule/class.ilBookingSchedule.php | 6 +- .../classes/Setup/class.Agent.php | 7 ++- ...s.ilBookingManager8HotfixDBUpdateSteps.php | 58 +++++++++++++++++++ 3 files changed, 67 insertions(+), 4 deletions(-) create mode 100644 Modules/BookingManager/classes/Setup/class.ilBookingManager8HotfixDBUpdateSteps.php diff --git a/Modules/BookingManager/Schedule/class.ilBookingSchedule.php b/Modules/BookingManager/Schedule/class.ilBookingSchedule.php index bd27fd512d81..9ebb8874d6f2 100644 --- a/Modules/BookingManager/Schedule/class.ilBookingSchedule.php +++ b/Modules/BookingManager/Schedule/class.ilBookingSchedule.php @@ -202,12 +202,12 @@ protected function read(): void } } - public function save(): bool + public function save(): ?int { $ilDB = $this->db; if ($this->id) { - return false; + return null; } $this->id = $ilDB->nextId('booking_schedule'); @@ -264,7 +264,7 @@ public function update(): bool return true; } - public function doClone(int $a_pool_id): bool + public function doClone(int $a_pool_id): int { $new_obj = new self(); $new_obj->setPoolId($a_pool_id); diff --git a/Modules/BookingManager/classes/Setup/class.Agent.php b/Modules/BookingManager/classes/Setup/class.Agent.php index b405ccde70d9..de8229e76480 100644 --- a/Modules/BookingManager/classes/Setup/class.Agent.php +++ b/Modules/BookingManager/classes/Setup/class.Agent.php @@ -29,6 +29,11 @@ class Agent extends Setup\Agent\NullAgent { public function getUpdateObjective(Setup\Config $config = null): Setup\Objective { - return new \ilDatabaseUpdateStepsExecutedObjective(new ilBookingManagerDBUpdateSteps()); + return new Setup\ObjectiveCollection( + 'Booking Manager Update', + true, + new \ilDatabaseUpdateStepsExecutedObjective(new ilBookingManagerDBUpdateSteps()), + new \ilDatabaseUpdateStepsExecutedObjective(new ilBookingManager8HotfixDBUpdateSteps()) + ); } } diff --git a/Modules/BookingManager/classes/Setup/class.ilBookingManager8HotfixDBUpdateSteps.php b/Modules/BookingManager/classes/Setup/class.ilBookingManager8HotfixDBUpdateSteps.php new file mode 100644 index 000000000000..3ff5f2381edd --- /dev/null +++ b/Modules/BookingManager/classes/Setup/class.ilBookingManager8HotfixDBUpdateSteps.php @@ -0,0 +1,58 @@ +db = $db; + } + + public function step_1(): void + { + $db = $this->db; + $set1 = $db->queryF("SELECT * FROM booking_object " . + " WHERE schedule_id = %s ", + ["integer"], + [1] + ); + while ($rec1 = $db->fetchAssoc($set1)) { + $set2 = $db->queryF("SELECT * FROM booking_schedule " . + " WHERE pool_id = %s ORDER BY booking_schedule_id ASC LIMIT 1", + ["integer"], + [$rec1["pool_id"]] + ); + if ($rec2 = $db->fetchAssoc($set2)) { + if ((int) $rec2["booking_schedule_id"] !== 1) { + $db->update("booking_object", [ + "schedule_id" => ["intger", $rec2["booking_schedule_id"]] + ], [ // where + "booking_object_id" => ["integer", $rec1["booking_object_id"]] + ] + ); + } + } + } + } +} From ce7c28f5ff27c73cd750128791c2cb088d75f83e Mon Sep 17 00:00:00 2001 From: Alexander Killing Date: Sun, 10 Nov 2024 18:42:25 +0100 Subject: [PATCH 181/292] 42351: Klicken auf Beitragende Person in der Liste der Beitragende Personen verursacht Fehler --- Modules/Blog/classes/class.ilObjBlogGUI.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/Blog/classes/class.ilObjBlogGUI.php b/Modules/Blog/classes/class.ilObjBlogGUI.php index fba56484e9c3..9bc20045fae6 100644 --- a/Modules/Blog/classes/class.ilObjBlogGUI.php +++ b/Modules/Blog/classes/class.ilObjBlogGUI.php @@ -1347,7 +1347,7 @@ protected function buildPostingList( foreach (ilBlogPosting::getAllPostings($a_obj_id) as $posting) { if ($this->author && ($posting["author"] == $this->author || - (is_array($posting["editors"]) && in_array($this->author, $posting["editors"])))) { + (is_array($posting["editors"] ?? false) && in_array($this->author, $posting["editors"])))) { $author_found = true; } From db4ad54e6ecaa7d8cf6023685a73ec63548c8bf8 Mon Sep 17 00:00:00 2001 From: Alexander Killing Date: Sun, 10 Nov 2024 20:01:33 +0100 Subject: [PATCH 182/292] =?UTF-8?q?42225:=20Gesetzte=20Haken=20und=20ausge?= =?UTF-8?q?f=C3=BClltes=20Textfeld=20werden=20bei=20Export=20/=20Import=20?= =?UTF-8?q?nicht=20=C3=BCbernommen=20-=20Fehlermeldung?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SurveyQuestionPool/Export/class.SurveyImportParser.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Modules/SurveyQuestionPool/Export/class.SurveyImportParser.php b/Modules/SurveyQuestionPool/Export/class.SurveyImportParser.php index 02f5f84e8a14..45c958870d54 100755 --- a/Modules/SurveyQuestionPool/Export/class.SurveyImportParser.php +++ b/Modules/SurveyQuestionPool/Export/class.SurveyImportParser.php @@ -792,7 +792,9 @@ protected function trimAndStripAttribs(array $attribs): array { $ret = []; foreach ($attribs as $k => $v) { - $ret[$k] = $this->trimAndStrip((string) $v); + $ret[$k] = ((string) $v !== "<>") + ? $this->trimAndStrip((string) $v) + : "<>"; } return $ret; } From cde2ce48d3d26895d2886e0663f4e228e9b490a6 Mon Sep 17 00:00:00 2001 From: Alex Killing Date: Mon, 11 Nov 2024 10:16:46 +0100 Subject: [PATCH 183/292] =?UTF-8?q?42588:=20Tabellen-Templates=20lassen=20?= =?UTF-8?q?sich=20nicht=20l=C3=B6schen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Services/Style/Content/classes/class.ilObjStyleSheetGUI.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Services/Style/Content/classes/class.ilObjStyleSheetGUI.php b/Services/Style/Content/classes/class.ilObjStyleSheetGUI.php index d8957c3ab9a5..beba8ed23a55 100755 --- a/Services/Style/Content/classes/class.ilObjStyleSheetGUI.php +++ b/Services/Style/Content/classes/class.ilObjStyleSheetGUI.php @@ -1525,7 +1525,7 @@ public function deleteTemplateConfirmationObject(): void $cl_str = '
' . "
" . $lng->txt("sty_style_class") . "
" . $cl_str . "
"; } - $cgui->addItem("tid[]", $tid, $this->object->lookupTemplateName($tid) . $cl_str); + $cgui->addItem("tid[]", (string) $tid, $this->object->lookupTemplateName($tid) . $cl_str); } $cgui->addButton($lng->txt("sty_del_template_keep_classes"), "deleteTemplateKeepClasses"); From 3240a1acb3548d578761aff0ed27775e8470e8da Mon Sep 17 00:00:00 2001 From: Alex Killing Date: Mon, 11 Nov 2024 11:08:29 +0100 Subject: [PATCH 184/292] 42567: Clicking on the title of some specific Booking Tools provokes error --- .../BookingManager/Objects/class.ilBookingObjectsTableGUI.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/BookingManager/Objects/class.ilBookingObjectsTableGUI.php b/Modules/BookingManager/Objects/class.ilBookingObjectsTableGUI.php index fa546b8ca946..7f8033e9b5f5 100644 --- a/Modules/BookingManager/Objects/class.ilBookingObjectsTableGUI.php +++ b/Modules/BookingManager/Objects/class.ilBookingObjectsTableGUI.php @@ -360,7 +360,7 @@ protected function fillRow(array $a_set): void } if ($has_booking || $this->may_edit) { - if (trim($a_set['post_text']) || $a_set['post_file']) { + if (trim($a_set['post_text'] ?? "") || $a_set['post_file']) { $items[] = $this->ui_factory->button()->shy( $lng->txt('book_post_booking_information'), $ilCtrl->getLinkTargetByClass("ilbookingprocessgui", 'displayPostInfo') From b64809328fc17471f99ab3591a5e38aac328ecd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20D=C3=ADaz?= <62429591+Saaweel@users.noreply.github.com> Date: Mon, 11 Nov 2024 12:09:53 +0100 Subject: [PATCH 185/292] Update class.ilLTIConsumeProviderFormGUI.php --- .../classes/class.ilLTIConsumeProviderFormGUI.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Modules/LTIConsumer/classes/class.ilLTIConsumeProviderFormGUI.php b/Modules/LTIConsumer/classes/class.ilLTIConsumeProviderFormGUI.php index 6fddf98d3c52..0970fd370eed 100755 --- a/Modules/LTIConsumer/classes/class.ilLTIConsumeProviderFormGUI.php +++ b/Modules/LTIConsumer/classes/class.ilLTIConsumeProviderFormGUI.php @@ -1,7 +1,4 @@ Date: Mon, 11 Nov 2024 12:11:02 +0100 Subject: [PATCH 186/292] Update class.ilLTIConsumeProviderFormGUI.php --- .../LTIConsumer/classes/class.ilLTIConsumeProviderFormGUI.php | 1 + 1 file changed, 1 insertion(+) diff --git a/Modules/LTIConsumer/classes/class.ilLTIConsumeProviderFormGUI.php b/Modules/LTIConsumer/classes/class.ilLTIConsumeProviderFormGUI.php index 0970fd370eed..db2cfcf66398 100755 --- a/Modules/LTIConsumer/classes/class.ilLTIConsumeProviderFormGUI.php +++ b/Modules/LTIConsumer/classes/class.ilLTIConsumeProviderFormGUI.php @@ -1,4 +1,5 @@ Date: Mon, 11 Nov 2024 12:15:57 +0100 Subject: [PATCH 187/292] Update class.ilObjLTIConsumerGUI.php --- Modules/LTIConsumer/classes/class.ilObjLTIConsumerGUI.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Modules/LTIConsumer/classes/class.ilObjLTIConsumerGUI.php b/Modules/LTIConsumer/classes/class.ilObjLTIConsumerGUI.php index 254046802f21..8a2d7c0081c7 100755 --- a/Modules/LTIConsumer/classes/class.ilObjLTIConsumerGUI.php +++ b/Modules/LTIConsumer/classes/class.ilObjLTIConsumerGUI.php @@ -1,7 +1,5 @@ From 9209d104489a33c3cc38d4e2df6ef2ce3e1d5453 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20D=C3=ADaz?= <62429591+Saaweel@users.noreply.github.com> Date: Mon, 11 Nov 2024 14:05:33 +0100 Subject: [PATCH 188/292] PHP CS Fixer From 1855547557dfec69cffb944d7ac67c56d7b06e62 Mon Sep 17 00:00:00 2001 From: mjansen Date: Wed, 30 Oct 2024 19:29:43 +0100 Subject: [PATCH 189/292] Auth/OpenIDConnect: Use `id_token` for claims See: https://mantis.ilias.de/view.php?id=39471 (cherry picked from commit 7a444b4d2c422e49411e77ff29a7c67338666dfe) --- .../OpenIdConnect/classes/class.ilAuthProviderOpenIdConnect.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Services/OpenIdConnect/classes/class.ilAuthProviderOpenIdConnect.php b/Services/OpenIdConnect/classes/class.ilAuthProviderOpenIdConnect.php index 71c2cf32edab..0473c8e7c4e3 100644 --- a/Services/OpenIdConnect/classes/class.ilAuthProviderOpenIdConnect.php +++ b/Services/OpenIdConnect/classes/class.ilAuthProviderOpenIdConnect.php @@ -99,7 +99,7 @@ public function doAuthentication(ilAuthStatus $status): bool // user is authenticated, otherwise redirected to authorization endpoint or exception $this->logger->dump($this->body, ilLogLevel::DEBUG); - $claims = $oidc->requestUserInfo(); + $claims = $oidc->getVerifiedClaims(); $this->logger->dump($claims, ilLogLevel::DEBUG); $status = $this->handleUpdate($status, $claims); From 50b610269a983a1344acf76447719897701fc263 Mon Sep 17 00:00:00 2001 From: Richard Klees Date: Mon, 11 Nov 2024 14:57:04 +0100 Subject: [PATCH 190/292] Deps: add ext-mbstring (#42501) * https://mantis.ilias.de/view.php?id=42501#c109282 --- composer.json | 1 + 1 file changed, 1 insertion(+) diff --git a/composer.json b/composer.json index fa94610484e3..a7fcb9e3da80 100644 --- a/composer.json +++ b/composer.json @@ -41,6 +41,7 @@ "ext-json": "*", "ext-simplexml": "*", "ext-libxml": "*", + "ext-mbstring": "*", "cweagans/composer-patches": "^1.7", "filp/whoops": "^2.1.13", "monolog/monolog": "^2.3.5", From a4621f733fcc50691e2f2a9ccd2cdad16fa66cb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20D=C3=ADaz?= <62429591+Saaweel@users.noreply.github.com> Date: Mon, 11 Nov 2024 14:58:34 +0100 Subject: [PATCH 191/292] Update class.ilObjLTIConsumerGUI.php --- Modules/LTIConsumer/classes/class.ilObjLTIConsumerGUI.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Modules/LTIConsumer/classes/class.ilObjLTIConsumerGUI.php b/Modules/LTIConsumer/classes/class.ilObjLTIConsumerGUI.php index 8a2d7c0081c7..20355fd9bf87 100755 --- a/Modules/LTIConsumer/classes/class.ilObjLTIConsumerGUI.php +++ b/Modules/LTIConsumer/classes/class.ilObjLTIConsumerGUI.php @@ -346,7 +346,7 @@ public function showToolConfig(): void $provider_id = $this->getRequestValue("provider_id"); $DIC->ctrl()->setParameter($this, "provider_id", $provider_id); $DIC->language()->loadLanguageModule($new_type); - $form = $this->initShowToolConfig($new_type, (int)$provider_id); + $form = $this->initShowToolConfig($new_type, (int) $provider_id); $DIC->ui()->mainTemplate()->setContent($form->getHTML()); } @@ -363,7 +363,7 @@ public function saveDynReg(): void $DIC->language()->loadLanguageModule($new_type); ilSession::clear('lti_dynamic_registration_client_id'); ilSession::clear('lti_dynamic_registration_custom_params'); - $form = $this->initShowToolConfig($new_type, (int)$provider_id); + $form = $this->initShowToolConfig($new_type, (int) $provider_id); $form->setValuesByPost(); if ($form->checkInput()) { // update only overridable fields $provider = $form->getProvider(); @@ -856,7 +856,7 @@ protected function checkContentSelection(): void $newType = $this->getRequestValue('new_type'); $refId = $this->getRequestValue('ref_id'); if ($providerId !== null && $newType == 'lti' && $refId != null) { - $provider = new ilLTIConsumeProvider((int)$providerId); + $provider = new ilLTIConsumeProvider((int) $providerId); // check if post variables from contentSelectionResponse if ($DIC->http()->wrapper()->post()->has('JWT')) { // ToDo: From 2a21251b48b08e9fcbc243d62d7ecf6799313372 Mon Sep 17 00:00:00 2001 From: Alex Killing Date: Mon, 11 Nov 2024 17:38:52 +0100 Subject: [PATCH 192/292] 41951: Can't delete portfolios from Restored Objects (no checkbox) --- Modules/Portfolio/module.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/Portfolio/module.xml b/Modules/Portfolio/module.xml index c878a97eb347..fa0ea18d98ca 100644 --- a/Modules/Portfolio/module.xml +++ b/Modules/Portfolio/module.xml @@ -11,7 +11,7 @@
cat crs From 333da2ac681ec235b25123afd55b2cf7e3b3e292 Mon Sep 17 00:00:00 2001 From: Stephan Kergomard Date: Mon, 11 Nov 2024 18:06:11 +0100 Subject: [PATCH 193/292] Excel: Error Invalid UTF-8 & Remove Noncharacters See: https://mantis.ilias.de/view.php?id=37379 --- Services/Excel/classes/class.ilExcel.php | 29 +++++++++++++++++++----- 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/Services/Excel/classes/class.ilExcel.php b/Services/Excel/classes/class.ilExcel.php index 6e13f94033a8..f7196a646e0a 100644 --- a/Services/Excel/classes/class.ilExcel.php +++ b/Services/Excel/classes/class.ilExcel.php @@ -37,6 +37,8 @@ class ilExcel public const FORMAT_BIFF = "Xls"; protected string $format; + private string $noncharacters = '[\uFFFE-\uFFFF\uFDD0-\uFDEF]'; + protected ilLanguage $lng; protected Spreadsheet $workbook; protected string $type; @@ -158,15 +160,23 @@ public function getSheetTitle(): string * Prepare value for cell * @param mixed $a_value * @return mixed + * @throws InvalidArgumentException */ protected function prepareValue($a_value) { if (is_bool($a_value)) { - $a_value = $this->prepareBooleanValue($a_value); - } elseif ($a_value instanceof ilDateTime) { - $a_value = $this->prepareDateValue($a_value); - } elseif (is_string($a_value)) { - $a_value = $this->prepareString($a_value); + return $this->prepareBooleanValue($a_value); + } + + if ($a_value instanceof ilDateTime) { + return $this->prepareDateValue($a_value); + } + + if (is_string($a_value)) { + if (!mb_check_encoding($a_value, 'UTF-8')) { + throw new InvalidArgumentException('Invalid UTF-8 passed.'); + } + return $this->prepareString($a_value); } return $a_value; @@ -200,7 +210,9 @@ protected function prepareBooleanValue(bool $a_value): string protected function prepareString(string $a_value): string { - return strip_tags($a_value); // #14542 + return $this->cleanupNonCharachters( + strip_tags($a_value) + ); // #14542 } /** @@ -555,4 +567,9 @@ public function mergeCells(string $coordinatesRange): void { $this->workbook->getActiveSheet()->mergeCells($coordinatesRange); } + + private function cleanupNonCharachters(string $string): string + { + return mb_ereg_replace($this->noncharacters, '', $string); + } } From 4fcfa83e7e3ad362c48eb5477968e437e53cf2be Mon Sep 17 00:00:00 2001 From: Stephan Kergomard Date: Mon, 11 Nov 2024 18:44:25 +0100 Subject: [PATCH 194/292] Excel: Include Noncharacters from Above BOM --- Services/Excel/classes/class.ilExcel.php | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/Services/Excel/classes/class.ilExcel.php b/Services/Excel/classes/class.ilExcel.php index f7196a646e0a..c18ad81c2327 100644 --- a/Services/Excel/classes/class.ilExcel.php +++ b/Services/Excel/classes/class.ilExcel.php @@ -37,7 +37,26 @@ class ilExcel public const FORMAT_BIFF = "Xls"; protected string $format; - private string $noncharacters = '[\uFFFE-\uFFFF\uFDD0-\uFDEF]'; + private array $noncharacters = [ + '\x{FFFE}-\x{FFFF}', + '\x{1FFFE}-\x{1FFFF}', + '\x{2FFFE}-\x{2FFFF}', + '\x{3FFFE}-\x{3FFFF}', + '\x{4FFFE}-\x{4FFFF}', + '\x{5FFFE}-\x{5FFFF}', + '\x{6FFFE}-\x{6FFFF}', + '\x{7FFFE}-\x{7FFFF}', + '\x{8FFFE}-\x{8FFFF}', + '\x{9FFFE}-\x{9FFFF}', + '\x{AFFFE}-\x{AFFFF}', + '\x{BFFFE}-\x{BFFFF}', + '\x{CFFFE}-\x{CFFFF}', + '\x{DFFFE}-\x{DFFFF}', + '\x{EFFFE}-\x{EFFFF}', + '\x{FFFFE}-\x{FFFFF}', + '\x{10FFFE}-\x{10FFFF}', + '\x{FDD0}-\x{FDEF}' + ]; protected ilLanguage $lng; protected Spreadsheet $workbook; @@ -570,6 +589,6 @@ public function mergeCells(string $coordinatesRange): void private function cleanupNonCharachters(string $string): string { - return mb_ereg_replace($this->noncharacters, '', $string); + return mb_ereg_replace('[' . implode('', $this->noncharacters) . ']', '', $string); } } From af3713be12c3d4e2d6c2e34ad259d9387ecdc4eb Mon Sep 17 00:00:00 2001 From: Stephan Kergomard Date: Tue, 12 Nov 2024 08:12:49 +0100 Subject: [PATCH 195/292] RTE: Toolbar Should Not Be Sticky See: --- Services/RTE/templates/default/tpl.tinymce.js | 2 +- Services/RTE/templates/default/tpl.tinymce_frm_post.js | 1 + Services/RTE/templates/default/tpl.usereditor.js | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Services/RTE/templates/default/tpl.tinymce.js b/Services/RTE/templates/default/tpl.tinymce.js index 6a16f0795af7..d4cb83102a79 100644 --- a/Services/RTE/templates/default/tpl.tinymce.js +++ b/Services/RTE/templates/default/tpl.tinymce.js @@ -182,7 +182,7 @@ tinymce.init({ menubar: false, toolbar: "{BUTTONS_1} {BUTTONS_2} {BUTTONS_3}", - toolbar_sticky: true, + toolbar_persist: true, toolbar_mode: 'wrap', valid_elements: "{VALID_ELEMENTS}", image_advtab: false, diff --git a/Services/RTE/templates/default/tpl.tinymce_frm_post.js b/Services/RTE/templates/default/tpl.tinymce_frm_post.js index f0318adf9e23..ed49a29dc712 100644 --- a/Services/RTE/templates/default/tpl.tinymce_frm_post.js +++ b/Services/RTE/templates/default/tpl.tinymce_frm_post.js @@ -154,6 +154,7 @@ tinymce.init({ menubar: false, toolbar: "{BUTTONS_1} {BUTTONS_2} {BUTTONS_3}", toolbar_sticky: true, + toolbar_persist: true, toolbar_mode: 'wrap', image_advtab: true, image_title: true, diff --git a/Services/RTE/templates/default/tpl.usereditor.js b/Services/RTE/templates/default/tpl.usereditor.js index 3b89e12bb7c0..d42155ef982a 100755 --- a/Services/RTE/templates/default/tpl.usereditor.js +++ b/Services/RTE/templates/default/tpl.usereditor.js @@ -13,6 +13,7 @@ tinymce.init({ plugins: "save", fix_list_elements: true, block_formats: "{BLOCKFORMATS}", + toolbar_persist: true, toolbar_location: "top", toolbar_align: "left", path_location: "bottom", From 9fc97b97894d5d479dd0bc5d37f70dd81981647f Mon Sep 17 00:00:00 2001 From: Alexander Killing Date: Tue, 12 Nov 2024 09:09:54 +0100 Subject: [PATCH 196/292] 41937: Anonymous user can activate notifications for wiki - leading to notifications to crash --- Modules/Wiki/Setup/class.Agent.php | 8 +++- .../class.ilWiki8HotfixDBUpdateSteps.php | 42 +++++++++++++++++++ Modules/Wiki/classes/class.ilWikiPageGUI.php | 3 +- 3 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 Modules/Wiki/Setup/class.ilWiki8HotfixDBUpdateSteps.php diff --git a/Modules/Wiki/Setup/class.Agent.php b/Modules/Wiki/Setup/class.Agent.php index 36c05193e79f..cc971d53b0fe 100644 --- a/Modules/Wiki/Setup/class.Agent.php +++ b/Modules/Wiki/Setup/class.Agent.php @@ -29,7 +29,13 @@ class Agent extends Setup\Agent\NullAgent { public function getUpdateObjective(Setup\Config $config = null): Setup\Objective { - return new \ilDatabaseUpdateStepsExecutedObjective(new ilWikiDBUpdateSteps()); + return new Setup\ObjectiveCollection( + 'Wiki Update', + true, + new \ilDatabaseUpdateStepsExecutedObjective(new ilWikiDBUpdateSteps()), + new \ilDatabaseUpdateStepsExecutedObjective(new ilWiki8HotfixDBUpdateSteps()) + ); + } public function getStatusObjective(Metrics\Storage $storage): Objective diff --git a/Modules/Wiki/Setup/class.ilWiki8HotfixDBUpdateSteps.php b/Modules/Wiki/Setup/class.ilWiki8HotfixDBUpdateSteps.php new file mode 100644 index 000000000000..7242db4752da --- /dev/null +++ b/Modules/Wiki/Setup/class.ilWiki8HotfixDBUpdateSteps.php @@ -0,0 +1,42 @@ + + */ +class ilWiki8HotfixDBUpdateSteps implements \ilDatabaseUpdateSteps +{ + protected \ilDBInterface $db; + + public function prepare(\ilDBInterface $db): void + { + $this->db = $db; + } + + public function step_1(): void + { + $db = $this->db; + $db->manipulateF("DELETE FROM notification WHERE " . + " user_id = %s", + ["integer"], + [13] + ); + } +} diff --git a/Modules/Wiki/classes/class.ilWikiPageGUI.php b/Modules/Wiki/classes/class.ilWikiPageGUI.php index bea4d8c9ab10..0474eae658ac 100755 --- a/Modules/Wiki/classes/class.ilWikiPageGUI.php +++ b/Modules/Wiki/classes/class.ilWikiPageGUI.php @@ -185,7 +185,8 @@ public function executeCommand(): string self::initEditingJS($this->tpl); } - if ($this->wiki_request->getNotification() > 0) { + if ($this->wiki_request->getNotification() > 0 + && $ilUser->getId() !== ANONYMOUS_USER_ID) { switch ($this->wiki_request->getNotification()) { case 1: ilNotification::setNotification(ilNotification::TYPE_WIKI, $ilUser->getId(), $this->getPageObject()->getParentId(), false); From 0b31db0e8b9fa3cdca539b65bd1d10efaa7f0816 Mon Sep 17 00:00:00 2001 From: Stephan Kergomard Date: Tue, 12 Nov 2024 09:06:21 +0100 Subject: [PATCH 197/292] Test: Fix Accessing Value on Null in ClozeQuestion See: https://mantis.ilias.de/view.php?id=42506 --- Modules/TestQuestionPool/classes/class.assClozeTest.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Modules/TestQuestionPool/classes/class.assClozeTest.php b/Modules/TestQuestionPool/classes/class.assClozeTest.php index ed2de5d45ed9..a8ffa8639383 100755 --- a/Modules/TestQuestionPool/classes/class.assClozeTest.php +++ b/Modules/TestQuestionPool/classes/class.assClozeTest.php @@ -1837,7 +1837,11 @@ public function calculateCombinationResult($user_result): array break; case CLOZE_SELECT: $answer = $this->gaps[$gap_key]->getItem($gap_answers[$gap_key]); - $answertext = $answer->getAnswertext(); + $answertext = ''; + if ($answer !== null) { + $answertext = $answer->getAnswertext(); + } + if ($answertext != $combination_gap_answer['answer']) { $combination_fulfilled = false; } From 0723454d1be89024d7254d9969f86b9b653cfa34 Mon Sep 17 00:00:00 2001 From: Stephan Kergomard Date: Tue, 12 Nov 2024 13:35:36 +0100 Subject: [PATCH 198/292] Test: Fix Maximum Thumbsize May Exceed DB-Limit See: https://mantis.ilias.de/view.php?id=42158 --- .../classes/class.assKprimChoiceGUI.php | 5 +++-- .../classes/class.assMatchingQuestionGUI.php | 3 ++- .../classes/class.assMultipleChoice.php | 2 +- .../classes/class.assMultipleChoiceGUI.php | 5 +++-- .../classes/class.assOrderingQuestion.php | 12 ++++++------ .../classes/class.assOrderingQuestionGUI.php | 1 + .../classes/class.assQuestion.php | 13 ++++++++++--- .../classes/class.assSingleChoice.php | 2 +- .../classes/class.assSingleChoiceGUI.php | 1 + .../import/qti12/class.assKprimChoiceImport.php | 12 +++++++----- .../qti12/class.assMatchingQuestionImport.php | 6 ++++-- .../qti12/class.assMultipleChoiceImport.php | 7 +++---- .../qti12/class.assOrderingQuestionImport.php | 11 ++++++----- .../import/qti12/class.assQuestionImport.php | 17 +++++++++++++++++ .../qti12/class.assSingleChoiceImport.php | 7 +++---- 15 files changed, 68 insertions(+), 36 deletions(-) diff --git a/Modules/TestQuestionPool/classes/class.assKprimChoiceGUI.php b/Modules/TestQuestionPool/classes/class.assKprimChoiceGUI.php index a88e5b757c12..85ce7fa41158 100644 --- a/Modules/TestQuestionPool/classes/class.assKprimChoiceGUI.php +++ b/Modules/TestQuestionPool/classes/class.assKprimChoiceGUI.php @@ -183,10 +183,11 @@ public function populateQuestionSpecificFormPart(ilPropertyFormGUI $form): ilPro if (!$this->object->getSelfAssessmentEditingMode() && $this->object->isSingleLineAnswerType($this->object->getAnswerType())) { // thumb size $thumb_size = new ilNumberInputGUI($this->lng->txt('thumb_size'), 'thumb_size'); - $thumb_size->setSuffix($this->lng->txt("thumb_size_unit_pixel")); + $thumb_size->setSuffix($this->lng->txt('thumb_size_unit_pixel')); $thumb_size->setInfo($this->lng->txt('thumb_size_info')); $thumb_size->setDecimals(false); - $thumb_size->setMinValue(20); + $thumb_size->setMinValue($this->object->getMinimumThumbSize()); + $thumb_size->setMaxValue($this->object->getMaximumThumbSize()); $thumb_size->setSize(6); $thumb_size->setValue($this->object->getThumbSize()); } else { diff --git a/Modules/TestQuestionPool/classes/class.assMatchingQuestionGUI.php b/Modules/TestQuestionPool/classes/class.assMatchingQuestionGUI.php index f91c081557ff..21f92b833c38 100755 --- a/Modules/TestQuestionPool/classes/class.assMatchingQuestionGUI.php +++ b/Modules/TestQuestionPool/classes/class.assMatchingQuestionGUI.php @@ -422,7 +422,8 @@ public function populateQuestionSpecificFormPart(\ilPropertyFormGUI $form): ilPr $geometry->setValue($this->object->getThumbGeometry()); $geometry->setRequired(true); $geometry->setMaxLength(6); - $geometry->setMinValue(20); + $geometry->setMinValue($this->object->getMinimumThumbSize()); + $geometry->setMaxValue($this->object->getMaximumThumbSize()); $geometry->setSize(6); $geometry->setInfo($this->lng->txt('thumb_size_info')); $form->addItem($geometry); diff --git a/Modules/TestQuestionPool/classes/class.assMultipleChoice.php b/Modules/TestQuestionPool/classes/class.assMultipleChoice.php index 7d3f1bd463dd..46c2f2f1c07a 100755 --- a/Modules/TestQuestionPool/classes/class.assMultipleChoice.php +++ b/Modules/TestQuestionPool/classes/class.assMultipleChoice.php @@ -238,7 +238,7 @@ public function loadFromDb($question_id): void $this->setQuestion(ilRTE::_replaceMediaObjectImageSrc($data["question_text"] ?? '', 1)); $shuffle = (is_null($data['shuffle'])) ? true : $data['shuffle']; $this->setShuffle((bool) $shuffle); - if ($data['thumb_size'] !== null && $data['thumb_size'] >= self::MINIMUM_THUMB_SIZE) { + if ($data['thumb_size'] !== null && $data['thumb_size'] >= $this->getMinimumThumbSize()) { $this->setThumbSize($data['thumb_size']); } $this->isSingleline = $data['allow_images'] === null || $data['allow_images'] === '0'; diff --git a/Modules/TestQuestionPool/classes/class.assMultipleChoiceGUI.php b/Modules/TestQuestionPool/classes/class.assMultipleChoiceGUI.php index 8d7dde091b20..126f47d0cfb7 100755 --- a/Modules/TestQuestionPool/classes/class.assMultipleChoiceGUI.php +++ b/Modules/TestQuestionPool/classes/class.assMultipleChoiceGUI.php @@ -787,9 +787,10 @@ public function populateQuestionSpecificFormPart(\ilPropertyFormGUI $form, bool if ($is_singleline) { // thumb size - $thumb_size = new ilNumberInputGUI($this->lng->txt("thumb_size"), "thumb_size"); - $thumb_size->setSuffix($this->lng->txt("thumb_size_unit_pixel")); + $thumb_size = new ilNumberInputGUI($this->lng->txt('thumb_size'), "thumb_size"); + $thumb_size->setSuffix($this->lng->txt('thumb_size_unit_pixel')); $thumb_size->setMinValue($this->object->getMinimumThumbSize()); + $thumb_size->setMaxValue($this->object->getMaximumThumbSize()); $thumb_size->setDecimals(0); $thumb_size->setSize(6); $thumb_size->setInfo($this->lng->txt('thumb_size_info')); diff --git a/Modules/TestQuestionPool/classes/class.assOrderingQuestion.php b/Modules/TestQuestionPool/classes/class.assOrderingQuestion.php index ff45a0550b3f..3b2ef6e800f8 100755 --- a/Modules/TestQuestionPool/classes/class.assOrderingQuestion.php +++ b/Modules/TestQuestionPool/classes/class.assOrderingQuestion.php @@ -183,8 +183,8 @@ public function loadFromDb($question_id): void $this->setOwner($data["owner"]); include_once("./Services/RTE/classes/class.ilRTE.php"); $this->setQuestion(ilRTE::_replaceMediaObjectImageSrc((string) $data["question_text"], 1)); - $this->ordering_type = strlen($data["ordering_type"]) ? $data["ordering_type"] : OQ_TERMS; - if ($data['thumb_geometry'] !== null && $data['thumb_geometry'] >= self::MINIMUM_THUMB_SIZE) { + $this->ordering_type = $data["ordering_type"] !== null ? (int) $data["ordering_type"] : OQ_TERMS; + if ($data['thumb_geometry'] !== null && $data['thumb_geometry'] >= $this->getMinimumThumbSize()) { $this->setThumbSize($data['thumb_geometry']); } $this->element_height = $data["element_height"] ? (int) $data['element_height'] : null; @@ -825,7 +825,7 @@ public function storeImageFile(string $upload_file, string $upload_name): ?strin $target_filepath = $this->getImagePath() . $target_filename; if (ilFileUtils::moveUploadedFile($upload_file, $target_filename, $target_filepath)) { $thumb_path = $this->getImagePath() . $this->getThumbPrefix() . $target_filename; - ilShellUtil::convertImage($target_filepath, $thumb_path, "JPEG", (string)$this->getThumbSize()); + ilShellUtil::convertImage($target_filepath, $thumb_path, "JPEG", (string) $this->getThumbSize()); return $target_filename; } @@ -841,7 +841,7 @@ public function updateImageFile(string $existing_image_name): ?string if (ilFileUtils::rename($existing_image_path, $target_filepath)) { unlink($this->getImagePath() . $this->getThumbPrefix() . $existing_image_name); $thumb_path = $this->getImagePath() . $this->getThumbPrefix() . $target_filename; - ilShellUtil::convertImage($target_filepath, $thumb_path, "JPEG", (string)$this->getThumbSize()); + ilShellUtil::convertImage($target_filepath, $thumb_path, "JPEG", (string) $this->getThumbSize()); return $target_filename; } @@ -871,7 +871,7 @@ public function validateSolutionSubmit(): bool public function saveWorkingData($active_id, $pass = null, $authorized = true): bool { global $DIC; - if($DIC->testQuestionPool()->internal()->request()->raw('test_answer_changed') === null) { + if ($DIC->testQuestionPool()->internal()->request()->raw('test_answer_changed') === null) { return true; } @@ -1088,7 +1088,7 @@ protected function generateThumbForFile($path, $file): void $ext = 'JPEG'; break; } - ilShellUtil::convertImage($filename, $thumbpath, $ext, (string)$this->getThumbSize()); + ilShellUtil::convertImage($filename, $thumbpath, $ext, (string) $this->getThumbSize()); } } diff --git a/Modules/TestQuestionPool/classes/class.assOrderingQuestionGUI.php b/Modules/TestQuestionPool/classes/class.assOrderingQuestionGUI.php index 7bf7d8efe874..49c1bf324e0e 100755 --- a/Modules/TestQuestionPool/classes/class.assOrderingQuestionGUI.php +++ b/Modules/TestQuestionPool/classes/class.assOrderingQuestionGUI.php @@ -280,6 +280,7 @@ public function populateQuestionSpecificFormPart(\ilPropertyFormGUI $form): ilPr $thumb_size->setRequired(true); $thumb_size->setMaxLength(6); $thumb_size->setMinValue($this->object->getMinimumThumbSize()); + $thumb_size->setMaxValue($this->object->getMaximumThumbSize()); $thumb_size->setSize(6); $thumb_size->setInfo($this->lng->txt('thumb_size_info')); $form->addItem($thumb_size); diff --git a/Modules/TestQuestionPool/classes/class.assQuestion.php b/Modules/TestQuestionPool/classes/class.assQuestion.php index 813158ea074b..e6484bc541d5 100755 --- a/Modules/TestQuestionPool/classes/class.assQuestion.php +++ b/Modules/TestQuestionPool/classes/class.assQuestion.php @@ -58,8 +58,9 @@ abstract class assQuestion self::IMG_MIME_TYPE_GIF => ['binary'] ); - protected const DEFAULT_THUMB_SIZE = 150; - protected const MINIMUM_THUMB_SIZE = 20; + private const DEFAULT_THUMB_SIZE = 150; + private const MINIMUM_THUMB_SIZE = 20; + private const MAXIMUM_THUMB_SIZE = 8192; public const TRIM_PATTERN = '/^[\p{C}\p{Z}]+|[\p{C}\p{Z}]+$/u'; @@ -568,6 +569,12 @@ public function getMinimumThumbSize(): int return self::MINIMUM_THUMB_SIZE; } + public function getMaximumThumbSize(): int + { + return self::MAXIMUM_THUMB_SIZE; + + } + public function getOutputType(): int { return $this->outputType; @@ -3730,7 +3737,7 @@ public function saveCurrentSolution(int $active_id, int $pass, $value1, $value2, "value1" => array("clob", $value1), "value2" => array("clob", $value2), "pass" => array("integer", $pass), - "tstamp" => array("integer", ((int)$tstamp > 0) ? (int)$tstamp : time()), + "tstamp" => array("integer", ((int) $tstamp > 0) ? (int) $tstamp : time()), 'authorized' => array('integer', (int) $authorized) ); diff --git a/Modules/TestQuestionPool/classes/class.assSingleChoice.php b/Modules/TestQuestionPool/classes/class.assSingleChoice.php index 9707533272c0..4021f2ae8807 100755 --- a/Modules/TestQuestionPool/classes/class.assSingleChoice.php +++ b/Modules/TestQuestionPool/classes/class.assSingleChoice.php @@ -223,7 +223,7 @@ public function loadFromDb($question_id): void $this->setQuestion(ilRTE::_replaceMediaObjectImageSrc($data["question_text"] ?? '', 1)); $shuffle = (is_null($data['shuffle'])) ? true : $data['shuffle']; $this->setShuffle((bool) $shuffle); - if ($data['thumb_size'] !== null && $data['thumb_size'] >= self::MINIMUM_THUMB_SIZE) { + if ($data['thumb_size'] !== null && $data['thumb_size'] >= $this->object->getMinimumThumbSize()) { $this->setThumbSize($data['thumb_size']); } $this->isSingleline = $data['allow_images'] === null || $data['allow_images'] === '0'; diff --git a/Modules/TestQuestionPool/classes/class.assSingleChoiceGUI.php b/Modules/TestQuestionPool/classes/class.assSingleChoiceGUI.php index e6be8f7aece9..2270970d4604 100755 --- a/Modules/TestQuestionPool/classes/class.assSingleChoiceGUI.php +++ b/Modules/TestQuestionPool/classes/class.assSingleChoiceGUI.php @@ -611,6 +611,7 @@ public function populateQuestionSpecificFormPart(\ilPropertyFormGUI $form, bool $thumb_size = new ilNumberInputGUI($this->lng->txt("thumb_size"), "thumb_size"); $thumb_size->setSuffix($this->lng->txt("thumb_size_unit_pixel")); $thumb_size->setMinValue($this->object->getMinimumThumbSize()); + $thumb_size->setMaxValue($this->object->getMaximumThumbSize()); $thumb_size->setDecimals(0); $thumb_size->setSize(6); $thumb_size->setInfo($this->lng->txt('thumb_size_info')); diff --git a/Modules/TestQuestionPool/classes/import/qti12/class.assKprimChoiceImport.php b/Modules/TestQuestionPool/classes/import/qti12/class.assKprimChoiceImport.php index bcdfc388bc5c..f3fff5d52bd1 100644 --- a/Modules/TestQuestionPool/classes/import/qti12/class.assKprimChoiceImport.php +++ b/Modules/TestQuestionPool/classes/import/qti12/class.assKprimChoiceImport.php @@ -199,11 +199,13 @@ public function fromXML(&$item, $questionpool_id, &$tst_id, &$tst_object, &$ques $this->object->setQuestion($this->object->QTIMaterialToString($item->getQuestiontext())); $this->object->setObjId($questionpool_id); $this->object->setShuffleAnswersEnabled($shuffle); - $this->object->setAnswerType($item->getMetadataEntry("answer_type")); - $this->object->setOptionLabel($item->getMetadataEntry("option_label_setting")); - $this->object->setCustomTrueOptionLabel($item->getMetadataEntry("custom_true_option_label")); - $this->object->setCustomFalseOptionLabel($item->getMetadataEntry("custom_false_option_label")); - $this->object->setThumbSize((int) $item->getMetadataEntry("thumb_size")); + $this->object->setAnswerType($item->getMetadataEntry('answer_type')); + $this->object->setOptionLabel($item->getMetadataEntry('option_label_setting')); + $this->object->setCustomTrueOptionLabel($item->getMetadataEntry('custom_true_option_label')); + $this->object->setCustomFalseOptionLabel($item->getMetadataEntry('custom_false_option_label')); + $this->object->setThumbSize( + $this->deduceThumbSizeFromImportValue((int) $item->getMetadataEntry('thumb_size')) + ); $this->object->saveToDb(); diff --git a/Modules/TestQuestionPool/classes/import/qti12/class.assMatchingQuestionImport.php b/Modules/TestQuestionPool/classes/import/qti12/class.assMatchingQuestionImport.php index be06bb53080f..72b3cda3e083 100644 --- a/Modules/TestQuestionPool/classes/import/qti12/class.assMatchingQuestionImport.php +++ b/Modules/TestQuestionPool/classes/import/qti12/class.assMatchingQuestionImport.php @@ -193,8 +193,10 @@ public function fromXML(&$item, $questionpool_id, &$tst_id, &$tst_object, &$ques $this->object->setOwner($ilUser->getId()); $this->object->setQuestion($this->object->QTIMaterialToString($item->getQuestiontext())); $this->object->setObjId($questionpool_id); - $extended_shuffle = $item->getMetadataEntry("shuffle"); - $this->object->setThumbGeometry($item->getMetadataEntry("thumb_geometry")); + $extended_shuffle = $item->getMetadataEntry('shuffle'); + $this->object->setThumbGeometry( + $this->deduceThumbSizeFromImportValue((int) $item->getMetadataEntry('thumb_geometry')) + ); if (strlen($item->getMetadataEntry('matching_mode'))) { $this->object->setMatchingMode($item->getMetadataEntry('matching_mode')); diff --git a/Modules/TestQuestionPool/classes/import/qti12/class.assMultipleChoiceImport.php b/Modules/TestQuestionPool/classes/import/qti12/class.assMultipleChoiceImport.php index 0f03b959fbdf..6fce7e209deb 100644 --- a/Modules/TestQuestionPool/classes/import/qti12/class.assMultipleChoiceImport.php +++ b/Modules/TestQuestionPool/classes/import/qti12/class.assMultipleChoiceImport.php @@ -214,10 +214,9 @@ public function fromXML(&$item, $questionpool_id, &$tst_id, &$tst_object, &$ques $this->object->setObjId($questionpool_id); $this->object->setShuffle($shuffle); $this->object->setSelectionLimit($selectionLimit); - $thumb_size = (int) $item->getMetadataEntry("thumb_size"); - if ($thumb_size !== null && $thumb_size >= $this->object->getMinimumThumbSize()) { - $this->object->setThumbSize($thumb_size); - } + $this->object->setThumbSize( + $this->deduceThumbSizeFromImportValue((int) $item->getMetadataEntry('thumb_size')) + ); foreach ($answers as $answer) { if ($item->getMetadataEntry('singleline') || (is_array($answer["imagefile"]) && count($answer["imagefile"]) > 0)) { diff --git a/Modules/TestQuestionPool/classes/import/qti12/class.assOrderingQuestionImport.php b/Modules/TestQuestionPool/classes/import/qti12/class.assOrderingQuestionImport.php index eb42608f4cff..1559b212d63e 100644 --- a/Modules/TestQuestionPool/classes/import/qti12/class.assOrderingQuestionImport.php +++ b/Modules/TestQuestionPool/classes/import/qti12/class.assOrderingQuestionImport.php @@ -205,11 +205,12 @@ public function fromXML(&$item, $questionpool_id, &$tst_id, &$tst_object, &$ques $this->object->setQuestion($this->object->QTIMaterialToString($item->getQuestiontext())); $this->object->setOrderingType($type); $this->object->setObjId($questionpool_id); - $thumb_size = (int) $item->getMetadataEntry("thumb_geometry"); - if ($thumb_size !== null && $thumb_size >= $this->object->getMinimumThumbSize()) { - $this->object->setThumbSize($thumb_size); - } - $this->object->setElementHeight($item->getMetadataEntry("element_height") ? (int) $item->getMetadataEntry("element_height") : null); + $this->object->setThumbSize( + $this->deduceThumbSizeFromImportValue((int) $item->getMetadataEntry('thumb_geometry')) + ); + $this->object->setElementHeight($item->getMetadataEntry('element_height') + ? (int) $item->getMetadataEntry('element_height') + : null); $this->object->setShuffle($shuffle); $this->object->setPoints(0); $this->object->saveQuestionDataToDb(); diff --git a/Modules/TestQuestionPool/classes/import/qti12/class.assQuestionImport.php b/Modules/TestQuestionPool/classes/import/qti12/class.assQuestionImport.php index 2a8c29ac4cef..beaed5751d89 100644 --- a/Modules/TestQuestionPool/classes/import/qti12/class.assQuestionImport.php +++ b/Modules/TestQuestionPool/classes/import/qti12/class.assQuestionImport.php @@ -302,4 +302,21 @@ public function importSuggestedSolution( ->withImportId($value); $repo->update($solution); } + + protected function deduceThumbSizeFromImportValue(?int $size): int + { + if ($size === null) { + return $this->object->getThumbSize(); + } + + if ($size < $this->object->getMaximumThumbSize()) { + return $this->object->getMaximumThumbSize(); + } + + if ($size > $this->object->getMaximumThumbSize()) { + return $this->object->getMaximumThumbSize(); + } + + return $size; + } } diff --git a/Modules/TestQuestionPool/classes/import/qti12/class.assSingleChoiceImport.php b/Modules/TestQuestionPool/classes/import/qti12/class.assSingleChoiceImport.php index e21dfa8e3e45..2a0cc0e23b44 100644 --- a/Modules/TestQuestionPool/classes/import/qti12/class.assSingleChoiceImport.php +++ b/Modules/TestQuestionPool/classes/import/qti12/class.assSingleChoiceImport.php @@ -210,10 +210,9 @@ public function fromXML(&$item, $questionpool_id, &$tst_id, &$tst_object, &$ques $this->object->setQuestion($this->object->QTIMaterialToString($item->getQuestiontext())); $this->object->setObjId($questionpool_id); $this->object->setShuffle($shuffle); - $thumb_size = (int) $item->getMetadataEntry("thumb_size"); - if ($thumb_size !== null && $thumb_size >= $this->object->getMinimumThumbSize()) { - $this->object->setThumbSize($thumb_size); - } + $this->object->setThumbSize( + $this->deduceThumbSizeFromImportValue((int) $item->getMetadataEntry('thumb_size')) + ); foreach ($answers as $answer) { if ($item->getMetadataEntry('singleline') || (is_array($answer["imagefile"]) && count($answer["imagefile"]) > 0)) { $this->object->setIsSingleline(true); From 651539e2c2c4757e0ea3a7fec07ca388d2c97a16 Mon Sep 17 00:00:00 2001 From: Stephan Kergomard Date: Tue, 12 Nov 2024 15:48:54 +0100 Subject: [PATCH 199/292] Test: Fix Wrong Class Method See: https://mantis.ilias.de/view.php?id=42675 --- Modules/TestQuestionPool/classes/class.assSingleChoice.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/TestQuestionPool/classes/class.assSingleChoice.php b/Modules/TestQuestionPool/classes/class.assSingleChoice.php index 4021f2ae8807..a79d8d7e994a 100755 --- a/Modules/TestQuestionPool/classes/class.assSingleChoice.php +++ b/Modules/TestQuestionPool/classes/class.assSingleChoice.php @@ -223,7 +223,7 @@ public function loadFromDb($question_id): void $this->setQuestion(ilRTE::_replaceMediaObjectImageSrc($data["question_text"] ?? '', 1)); $shuffle = (is_null($data['shuffle'])) ? true : $data['shuffle']; $this->setShuffle((bool) $shuffle); - if ($data['thumb_size'] !== null && $data['thumb_size'] >= $this->object->getMinimumThumbSize()) { + if ($data['thumb_size'] !== null && $data['thumb_size'] >= $this->getMinimumThumbSize()) { $this->setThumbSize($data['thumb_size']); } $this->isSingleline = $data['allow_images'] === null || $data['allow_images'] === '0'; From c7b7834aa85b35197b5ef1f9794b04438f844f83 Mon Sep 17 00:00:00 2001 From: Uwe Kohnle Date: Tue, 12 Nov 2024 23:22:21 +0000 Subject: [PATCH 200/292] fix issue for xapi learning progress --- Modules/CmiXapi/classes/class.ilCmiXapiResult.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Modules/CmiXapi/classes/class.ilCmiXapiResult.php b/Modules/CmiXapi/classes/class.ilCmiXapiResult.php index 56cc6e29736e..01718b877028 100644 --- a/Modules/CmiXapi/classes/class.ilCmiXapiResult.php +++ b/Modules/CmiXapi/classes/class.ilCmiXapiResult.php @@ -224,13 +224,12 @@ public static function getResultsForObject(int $objId): array $results = []; - if ($row = $DIC->database()->fetchAssoc($res)) { + while ($row = $DIC->database()->fetchAssoc($res)) { $result = new self(); $result->assignFromDbRow($row); $results[$result->getUsrId()] = $result; } - return $results; } } From 44654775be78cb95261da8907e2b37a600b405d8 Mon Sep 17 00:00:00 2001 From: Stephan Kergomard Date: Wed, 13 Nov 2024 12:09:47 +0100 Subject: [PATCH 201/292] Test: Accept Comma in Tolerance of FormulaQuestion See: https://mantis.ilias.de/view.php?id=42687 --- .../TestQuestionPool/classes/class.assFormulaQuestionGUI.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/TestQuestionPool/classes/class.assFormulaQuestionGUI.php b/Modules/TestQuestionPool/classes/class.assFormulaQuestionGUI.php index 4d2d8daed647..6489558c280b 100755 --- a/Modules/TestQuestionPool/classes/class.assFormulaQuestionGUI.php +++ b/Modules/TestQuestionPool/classes/class.assFormulaQuestionGUI.php @@ -162,7 +162,7 @@ protected function writePostData(bool $always = false): int $result, $_POST["range_min_$result"], $_POST["range_max_$result"], - $_POST["tolerance_$result"], + str_replace(',', '.', $_POST["tolerance_$result"]), $tmp_result_unit, $_POST["formula_$result"], $_POST["points_$result"], From d1ac32a3925a364d46ed590db5bb9bcd61c372cb Mon Sep 17 00:00:00 2001 From: Alexander Killing Date: Thu, 14 Nov 2024 08:52:21 +0100 Subject: [PATCH 202/292] 41548: Copying local Stylesheets does not copy style class titles or outdated-settings as well --- .../class.CharacteristicDBRepo.php | 66 +++++++++++++++-- .../Content/classes/class.ilObjStyleSheet.php | 39 ++++------ .../Style/classes/class.ilStyleDataSet.php | 73 ++++++++++++++++++- .../Style/classes/class.ilStyleExporter.php | 31 +++----- .../Style/classes/class.ilStyleImporter.php | 49 ++----------- 5 files changed, 160 insertions(+), 98 deletions(-) diff --git a/Services/Style/Content/Characteristic/class.CharacteristicDBRepo.php b/Services/Style/Content/Characteristic/class.CharacteristicDBRepo.php index 462088a08b34..c2a483bcbf7c 100644 --- a/Services/Style/Content/Characteristic/class.CharacteristicDBRepo.php +++ b/Services/Style/Content/Characteristic/class.CharacteristicDBRepo.php @@ -207,12 +207,66 @@ public function saveTitles( ); foreach ($titles as $l => $title) { - $db->insert("style_char_title", [ - "style_id" => ["integer", $style_id], - "type" => ["text", $type], - "characteristic" => ["text", $characteristic], - "lang" => ["text", $l], - "title" => ["text", $title] + $this->addTitle( + $style_id, + $type, + $characteristic, + $l, + $title + ); + } + } + + public function addTitle( + int $style_id, + string $type, + string $characteristic, + string $lang, + string $title + ): void { + $db = $this->db; + + $db->insert("style_char_title", [ + "style_id" => ["integer", $style_id], + "type" => ["text", $type], + "characteristic" => ["text", $characteristic], + "lang" => ["text", $lang], + "title" => ["text", $title] + ]); + } + + + public function cloneAllFromStyle( + int $from_style_id, + int $to_style_id + ) : void { + $set = $this->db->queryF("SELECT * FROM style_char " . + " WHERE style_id = %s ", + ["integer"], + [$from_style_id] + ); + while ($rec = $this->db->fetchAssoc($set)) { + $this->db->insert("style_char", [ + "style_id" => ["integer", $to_style_id], + "type" => ["text", $rec["type"]], + "characteristic" => ["text", $rec["characteristic"]], + "hide" => ["integer", (int) ($rec["hide"] ?? 0)], + "outdated" => ["integer", (int) ($rec["outdated"] ?? 0)], + "order_nr" => ["integer", (int) ($rec["order_nr"] ?? 0)] + ]); + } + $set = $this->db->queryF("SELECT * FROM style_char_title " . + " WHERE style_id = %s ", + ["integer"], + [$from_style_id] + ); + while ($rec = $this->db->fetchAssoc($set)) { + $this->db->insert("style_char_title", [ + "style_id" => ["integer", $to_style_id], + "type" => ["text", $rec["type"]], + "characteristic" => ["text", $rec["characteristic"]], + "lang" => ["text", $rec["lang"]], + "title" => ["text", $rec["title"]] ]); } } diff --git a/Services/Style/Content/classes/class.ilObjStyleSheet.php b/Services/Style/Content/classes/class.ilObjStyleSheet.php index 449f22fa3333..a6f56ba59c94 100755 --- a/Services/Style/Content/classes/class.ilObjStyleSheet.php +++ b/Services/Style/Content/classes/class.ilObjStyleSheet.php @@ -25,6 +25,7 @@ */ class ilObjStyleSheet extends ilObject { + protected \ILIAS\Style\Content\InternalRepoService $repo; protected bool $is_3_10_skin = false; protected string $export_sub_dir = ""; protected array $chars_by_type = []; @@ -517,6 +518,7 @@ public function __construct( $this->ilias->raiseError("Can't instantiate style object via reference id.", $this->ilias->error_obj->FATAL); } parent::__construct($a_id, false); + $this->repo = $DIC->contentStyle()->internal()->repo(); } public static function getBasicZipPath(): string @@ -825,14 +827,8 @@ public function create( "type" => $par_rec["type"], "mq_id" => $par_rec["mq_id"], "custom" => $par_rec["custom"]); } - // get style characteristics records - $chars = array(); - $q = "SELECT * FROM style_char WHERE style_id = " . - $ilDB->quote($a_from_style, "integer"); - $par_set = $ilDB->query($q); - while ($par_rec = $ilDB->fetchAssoc($par_set)) { - $chars[] = array("type" => $par_rec["type"], "characteristic" => $par_rec["characteristic"]); - } + $char_repo = $this->repo->characteristic(); + $char_repo->cloneAllFromStyle($a_from_style, $this->getId()); // copy media queries @@ -862,15 +858,6 @@ public function create( $ilDB->manipulate($q); } - // insert style characteristics - foreach ($chars as $char) { - $q = "INSERT INTO style_char (style_id, type, characteristic) VALUES " . - "(" . $ilDB->quote($this->getId(), "integer") . "," . - $ilDB->quote($char["type"], "text") . "," . - $ilDB->quote($char["characteristic"], "text") . ")"; - $ilDB->manipulate($q); - } - // add style_data record $q = "INSERT INTO style_data (id, uptodate, category) VALUES " . "(" . $ilDB->quote($this->getId(), "integer") . ", 0," . @@ -931,17 +918,21 @@ public function characteristicExists( public function addCharacteristic( string $a_type, string $a_char, - bool $a_hidden = false + bool $a_hidden = false, + int $order_nr = 0, + bool $outdated = false ): void { $ilDB = $this->db; // delete characteristic record - $ilDB->manipulateF( - "INSERT INTO style_char (style_id, type, characteristic, hide)" . - " VALUES (%s,%s,%s,%s) ", - array("integer", "text", "text", "integer"), - array($this->getId(), $a_type, $a_char, $a_hidden) - ); + $ilDB->insert("style_char", [ + "style_id" => ["integer", $this->getId()], + "type" => ["text", $a_type], + "characteristic" => ["text", $a_char], + "hide" => ["integer", (int) $a_hidden], + "outdated" => ["integer", (int) $outdated], + "order_nr" => ["integer", $order_nr] + ]); $this->setUpToDate(false); $this->_writeUpToDate($this->getId(), false); diff --git a/Services/Style/classes/class.ilStyleDataSet.php b/Services/Style/classes/class.ilStyleDataSet.php index d99b017d1752..194d1b65f4cc 100644 --- a/Services/Style/classes/class.ilStyleDataSet.php +++ b/Services/Style/classes/class.ilStyleDataSet.php @@ -26,6 +26,7 @@ * - sty: table object_data * - sty_setting: table style_setting * - sty_char: table style classes + * - sty_char_title: table style class titles * - sty_parameter: table style_parameter * - sty_color: table style colors * - sty_template: table style_template @@ -40,6 +41,7 @@ */ class ilStyleDataSet extends ilDataSet { + protected Content\InternalRepoService $repo; /** * @var ilLogger */ @@ -71,6 +73,7 @@ public function __construct() $this->log->debug("constructed"); $this->rbacsystem = $DIC->rbac()->system(); $this->user = $DIC->user(); + $this->repo = $DIC->contentStyle()->internal()->repo(); } @@ -80,7 +83,7 @@ public function __construct() */ public function getSupportedVersions(): array { - return array("5.1.0"); + return array("5.1.0", "8.0"); } /** @@ -104,6 +107,7 @@ protected function getTypes(string $a_entity, string $a_version): array if ($a_entity == "sty") { switch ($a_version) { case "5.1.0": + case "8.0": return array( "Id" => "integer", "Title" => "text", @@ -116,6 +120,7 @@ protected function getTypes(string $a_entity, string $a_version): array if ($a_entity == "object_style") { switch ($a_version) { case "5.1.0": + case "8.0": return array( "ObjectId" => "integer" ); @@ -125,6 +130,7 @@ protected function getTypes(string $a_entity, string $a_version): array if ($a_entity == "sty_setting") { switch ($a_version) { case "5.1.0": + case "8.0": return array( "StyleId" => "integer", "Name" => "test", @@ -142,12 +148,35 @@ protected function getTypes(string $a_entity, string $a_version): array "Characteristic" => "text", "Hide" => "integer" ); + case "8.0": + return array( + "StyleId" => "integer", + "Type" => "text", + "Characteristic" => "text", + "Hide" => "integer", + "OrderNr" => "integer", + "Outdate" => "integer" + ); + } + } + + if ($a_entity == "sty_char_title") { + switch ($a_version) { + case "8.0": + return array( + "StyleId" => "integer", + "Type" => "text", + "Characteristic" => "text", + "Lang" => "text", + "Title" => "text" + ); } } if ($a_entity == "sty_parameter") { switch ($a_version) { case "5.1.0": + case "8.0": return array( "StyleId" => "integer", "Tag" => "text", @@ -164,6 +193,7 @@ protected function getTypes(string $a_entity, string $a_version): array if ($a_entity == "sty_color") { switch ($a_version) { case "5.1.0": + case "8.0": return array( "StyleId" => "integer", "ColorName" => "text", @@ -175,6 +205,7 @@ protected function getTypes(string $a_entity, string $a_version): array if ($a_entity == "sty_media_query") { switch ($a_version) { case "5.1.0": + case "8.0": return array( "Id" => "integer", "StyleId" => "integer", @@ -187,6 +218,7 @@ protected function getTypes(string $a_entity, string $a_version): array if ($a_entity == "sty_template") { switch ($a_version) { case "5.1.0": + case "8.0": return array( "Id" => "integer", "StyleId" => "integer", @@ -200,6 +232,7 @@ protected function getTypes(string $a_entity, string $a_version): array if ($a_entity == "sty_template_class") { switch ($a_version) { case "5.1.0": + case "8.0": return array( "TemplateId" => "integer", "ClassType" => "text", @@ -211,6 +244,7 @@ protected function getTypes(string $a_entity, string $a_version): array if ($a_entity == "sty_usage") { switch ($a_version) { case "5.1.0": + case "8.0": return array( "ObjId" => "integer", "StyleId" => "integer" @@ -250,6 +284,7 @@ public function readData(string $a_entity, string $a_version, array $a_ids): voi if ($a_entity == "object_style") { switch ($a_version) { case "5.1.0": + case "8.0": foreach ($a_ids as $id) { $this->data[] = array("ObjectId" => $id); } @@ -260,6 +295,7 @@ public function readData(string $a_entity, string $a_version, array $a_ids): voi if ($a_entity == "sty") { switch ($a_version) { case "5.1.0": + case "8.0": $this->getDirectDataFromQuery("SELECT o.title, o.description, o.obj_id id" . " FROM object_data o " . " WHERE " . $ilDB->in("o.obj_id", $a_ids, false, "integer")); @@ -270,6 +306,7 @@ public function readData(string $a_entity, string $a_version, array $a_ids): voi if ($a_entity == "sty_setting") { switch ($a_version) { case "5.1.0": + case "8.0": $this->getDirectDataFromQuery("SELECT style_id, name, value" . " FROM style_setting " . " WHERE " . $ilDB->in("style_id", $a_ids, false, "integer")); @@ -280,16 +317,28 @@ public function readData(string $a_entity, string $a_version, array $a_ids): voi if ($a_entity == "sty_char") { switch ($a_version) { case "5.1.0": - $this->getDirectDataFromQuery("SELECT style_id, type, characteristic, hide" . + case "8.0": + $this->getDirectDataFromQuery("SELECT style_id, type, characteristic, hide, order_nr, outdated" . " FROM style_char " . " WHERE " . $ilDB->in("style_id", $a_ids, false, "integer")); break; } } + if ($a_entity == "sty_char_title") { + switch ($a_version) { + case "8.0": + $this->getDirectDataFromQuery("SELECT style_id, type, characteristic, lang, title" . + " FROM style_char_title " . + " WHERE " . $ilDB->in("style_id", $a_ids, false, "integer")); + break; + } + } + if ($a_entity == "sty_parameter") { switch ($a_version) { case "5.1.0": + case "8.0": $this->getDirectDataFromQuery("SELECT style_id, tag, class, parameter, value, type, mq_id, custom" . " FROM style_parameter " . " WHERE " . $ilDB->in("style_id", $a_ids, false, "integer")); @@ -300,6 +349,7 @@ public function readData(string $a_entity, string $a_version, array $a_ids): voi if ($a_entity == "sty_color") { switch ($a_version) { case "5.1.0": + case "8.0": $this->getDirectDataFromQuery("SELECT style_id, color_name, color_code" . " FROM style_color " . " WHERE " . $ilDB->in("style_id", $a_ids, false, "integer")); @@ -310,6 +360,7 @@ public function readData(string $a_entity, string $a_version, array $a_ids): voi if ($a_entity == "sty_media_query") { switch ($a_version) { case "5.1.0": + case "8.0": $this->getDirectDataFromQuery("SELECT id, style_id, order_nr, mquery m_query" . " FROM sty_media_query " . " WHERE " . $ilDB->in("style_id", $a_ids, false, "integer")); @@ -320,6 +371,7 @@ public function readData(string $a_entity, string $a_version, array $a_ids): voi if ($a_entity == "sty_template") { switch ($a_version) { case "5.1.0": + case "8.0": $this->getDirectDataFromQuery("SELECT id, style_id, name, preview, temp_type" . " FROM style_template " . " WHERE " . $ilDB->in("style_id", $a_ids, false, "integer")); @@ -330,6 +382,7 @@ public function readData(string $a_entity, string $a_version, array $a_ids): voi if ($a_entity == "sty_template_class") { switch ($a_version) { case "5.1.0": + case "8.0": $this->getDirectDataFromQuery("SELECT template_id, class_type, class" . " FROM style_template_class " . " WHERE " . $ilDB->in("template_id", $a_ids, false, "integer")); @@ -340,6 +393,7 @@ public function readData(string $a_entity, string $a_version, array $a_ids): voi if ($a_entity == "sty_usage") { switch ($a_version) { case "5.1.0": + case "8.0": $this->getDirectDataFromQuery("SELECT obj_id, style_id" . " FROM style_usage " . " WHERE " . $ilDB->in("style_id", $a_ids, false, "integer")); @@ -376,6 +430,7 @@ protected function getDependencies( "sty_setting" => array("ids" => $a_rec["Id"] ?? null), "sty_media_query" => array("ids" => $a_rec["Id"] ?? null), "sty_char" => array("ids" => $a_rec["Id"] ?? null), + "sty_char_title" => array("ids" => $a_rec["Id"] ?? null), "sty_color" => array("ids" => $a_rec["Id"] ?? null), "sty_parameter" => array("ids" => $a_rec["Id"] ?? null), "sty_template" => array("ids" => $a_rec["Id"] ?? null), @@ -400,7 +455,6 @@ protected function getDependencies( public function importRecord(string $a_entity, array $a_types, array $a_rec, ilImportMapping $a_mapping, string $a_schema_version): void { global $DIC; - $service = $DIC->contentStyle()->internal(); $access_manager = $service->domain()->access( 0, @@ -454,7 +508,18 @@ public function importRecord(string $a_entity, array $a_types, array $a_rec, ilI break; case "sty_char": - $this->current_obj->addCharacteristic($a_rec["Type"], $a_rec["Characteristic"], $a_rec["Hide"]); + $this->current_obj->addCharacteristic($a_rec["Type"], $a_rec["Characteristic"], $a_rec["Hide"], (int) ($a_rec["OrderNr"] ?? 0), (bool) ($a_rec["Outdated"] ?? false)); + break; + + case "sty_char_title": + $char_repo = $this->repo->characteristic(); + $char_repo->addTitle( + $this->current_obj->getId(), + $a_rec["Type"], + $a_rec["Characteristic"], + $a_rec["Lang"], + $a_rec["Title"], + ); break; case "sty_parameter": diff --git a/Services/Style/classes/class.ilStyleExporter.php b/Services/Style/classes/class.ilStyleExporter.php index 1d24659fe843..90291543d95e 100644 --- a/Services/Style/classes/class.ilStyleExporter.php +++ b/Services/Style/classes/class.ilStyleExporter.php @@ -34,33 +34,20 @@ public function init(): void public function getXmlRepresentation(string $a_entity, string $a_schema_version, string $a_id): string { - if ($a_schema_version == "5.1.0") { - ilFileUtils::makeDirParents($this->getAbsoluteExportDirectory()); - $this->ds->setExportDirectories($this->dir_relative, $this->dir_absolute); - return $this->ds->getXmlRepresentation($a_entity, $a_schema_version, [$a_id], "", true, true); - } - if ($a_schema_version == "5.0.0") { - if ($a_entity == "sty") { - $style = new ilObjStyleSheet($a_id, false); - - // images - $target = $this->getAbsoluteExportDirectory(); - if ($target && !is_dir($target)) { - ilFileUtils::makeDirParents($target); - } - ilFileUtils::rCopy($style->getImagesDirectory(), $target); - - return "" . - "" . $this->getRelativeExportDirectory() . "" . - $style->getXML() . - ""; - } - } + ilFileUtils::makeDirParents($this->getAbsoluteExportDirectory()); + $this->ds->setExportDirectories($this->dir_relative, $this->dir_absolute); + return $this->ds->getXmlRepresentation($a_entity, $a_schema_version, [$a_id], "", true, true); } public function getValidSchemaVersions(string $a_entity): array { return array( + "8.0" => array( + "namespace" => "http://www.ilias.de/Services/Style/8", + "xsd_file" => "ilias_style_8.xsd", + "uses_dataset" => true, + "min" => "8.0", + "max" => ""), "5.1.0" => array( "namespace" => "http://www.ilias.de/Services/Style/5_1", "xsd_file" => "ilias_style_5_1.xsd", diff --git a/Services/Style/classes/class.ilStyleImporter.php b/Services/Style/classes/class.ilStyleImporter.php index f7a2cf90956a..63697219819f 100644 --- a/Services/Style/classes/class.ilStyleImporter.php +++ b/Services/Style/classes/class.ilStyleImporter.php @@ -42,47 +42,12 @@ public function init(): void public function importXmlRepresentation(string $a_entity, string $a_id, string $a_xml, ilImportMapping $a_mapping): void { $this->log->debug("import xml " . $a_entity); - - if (true) { - $parser = new ilDataSetImportParser( - $a_entity, - $this->getSchemaVersion(), - $a_xml, - $this->ds, - $a_mapping - ); - return; - } - - // see ilStyleExporter::getXmlRepresentation() - if (preg_match("/(.+)<\/ImagePath>/", $a_xml, $hits)) { - $path = $hits[1]; - $a_xml = str_replace($hits[0], "", $a_xml); - $a_xml = str_replace("", "", $a_xml); - } - - // temp xml-file - $tmp_file = $this->getImportDirectory() . "/sty_" . $a_id . ".xml"; - file_put_contents($tmp_file, $a_xml); - - $style = new ilObjStyleSheet(); - $style->createFromXMLFile($tmp_file); - $new_id = $style->getId(); - - unlink($tmp_file); - - // images - if ($path) { - $source = $this->getImportDirectory() . "/" . $path; - if (is_dir($source)) { - $target = $style->getImagesDirectory(); - if (!is_dir($target)) { - ilFileUtils::makeDirParents($target); - } - ilFileUtils::rCopy($source, $target); - } - } - - $a_mapping->addMapping("Services/Style", "sty", $a_id, $new_id); + $parser = new ilDataSetImportParser( + $a_entity, + $this->getSchemaVersion(), + $a_xml, + $this->ds, + $a_mapping + ); } } From 693e1a87a6e00aea971ac8d98cc21c204bec4e10 Mon Sep 17 00:00:00 2001 From: fneumann Date: Wed, 13 Nov 2024 18:49:00 +0100 Subject: [PATCH 203/292] 42176: Shuffling Answer options does not work ... --- .../classes/class.assMatchingQuestion.php | 31 ++++++++++--------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/Modules/TestQuestionPool/classes/class.assMatchingQuestion.php b/Modules/TestQuestionPool/classes/class.assMatchingQuestion.php index 7a5bc26f9405..fce957278b2a 100755 --- a/Modules/TestQuestionPool/classes/class.assMatchingQuestion.php +++ b/Modules/TestQuestionPool/classes/class.assMatchingQuestion.php @@ -285,20 +285,20 @@ public function loadFromDb($question_id): void if ($result->numRows() == 1) { $data = $ilDB->fetchAssoc($result); - $this->setId((int)$question_id); - $this->setObjId((int)$data["obj_fi"]); + $this->setId((int) $question_id); + $this->setObjId((int) $data["obj_fi"]); $this->setTitle((string) $data["title"]); $this->setComment((string) $data["description"]); - $this->setOriginalId((int)$data["original_id"]); - $this->setNrOfTries((int)$data['nr_of_tries']); + $this->setOriginalId((int) $data["original_id"]); + $this->setNrOfTries((int) $data['nr_of_tries']); $this->setAuthor($data["author"]); - $this->setPoints((float)$data["points"]); - $this->setOwner((int)$data["owner"]); + $this->setPoints((float) $data["points"]); + $this->setOwner((int) $data["owner"]); include_once("./Services/RTE/classes/class.ilRTE.php"); $this->setQuestion(ilRTE::_replaceMediaObjectImageSrc((string) $data["question_text"], 1)); - $this->setThumbGeometry((int)$data["thumb_geometry"]); + $this->setThumbGeometry((int) $data["thumb_geometry"]); $this->setShuffle($data["shuffle"] != '0'); - $this->setShuffleMode((int)$data['shuffle']); + $this->setShuffleMode((int) $data['shuffle']); $this->setMatchingMode($data['matching_mode'] === null ? self::MATCHING_MODE_1_ON_1 : $data['matching_mode']); try { @@ -322,7 +322,7 @@ public function loadFromDb($question_id): void $this->terms = []; if ($result->numRows() > 0) { while ($data = $ilDB->fetchAssoc($result)) { - $term = $this->createMatchingTerm($data['term'] ?? '', $data['picture'] ?? '', (int)$data['ident']); + $term = $this->createMatchingTerm($data['term'] ?? '', $data['picture'] ?? '', (int) $data['ident']); $this->terms[] = $term; $termids[$data['term_id']] = $term; } @@ -338,7 +338,7 @@ public function loadFromDb($question_id): void $this->definitions = array(); if ($result->numRows() > 0) { while ($data = $ilDB->fetchAssoc($result)) { - $definition = $this->createMatchingDefinition($data['definition'] ?? '', $data['picture'] ?? '', (int)$data['ident']); + $definition = $this->createMatchingDefinition($data['definition'] ?? '', $data['picture'] ?? '', (int) $data['ident']); array_push($this->definitions, $definition); $definitionids[$data['def_id']] = $definition; } @@ -355,12 +355,12 @@ public function loadFromDb($question_id): void $pair = $this->createMatchingPair( $termids[$data['term_fi']], $definitionids[$data['definition_fi']], - (float)$data['points'] + (float) $data['points'] ); array_push($this->matchingpairs, $pair); } } - parent::loadFromDb((int)$question_id); + parent::loadFromDb((int) $question_id); } @@ -885,7 +885,7 @@ public function calculateReachedPoints($active_id, $pass = null, $authorizedSolu if (is_null($pass)) { $pass = $this->getSolutionMaxPass($active_id); } - $result = $this->getCurrentSolutionResultSet($active_id, (int)$pass, $authorizedSolution); + $result = $this->getCurrentSolutionResultSet($active_id, (int) $pass, $authorizedSolution); while ($data = $ilDB->fetchAssoc($result)) { if (strcmp($data["value1"], "") != 0) { if (!isset($found_values[$data['value2']])) { @@ -1058,7 +1058,7 @@ public function setImageFile($image_tempfilename, $image_filename, $previous_fil } else { // create thumbnail file $thumbpath = $imagepath . $this->getThumbPrefix() . $savename; - ilShellUtil::convertImage($imagepath . $savename, $thumbpath, "JPEG", (string)$this->getThumbGeometry()); + ilShellUtil::convertImage($imagepath . $savename, $thumbpath, "JPEG", (string) $this->getThumbGeometry()); } if ($result && (strcmp($image_filename, $previous_filename) != 0) && (strlen($previous_filename))) { $this->deleteImagefile($previous_filename); @@ -1387,6 +1387,9 @@ public function toJSON(): string } $result['terms'] = $terms; + // #42176 init shuffler with a new seed, otherwise definitions will be shuffled like the terms + $this->setShuffler($this->randomGroup->shuffleArray(new RandomSeed())); + $definitions = []; foreach ($this->getShuffler()->transform($this->getDefinitions()) as $def) { $definitions[] = [ From f30cbbf3da92205453bb4232909f9d8df6a29d2c Mon Sep 17 00:00:00 2001 From: fneumann Date: Thu, 14 Nov 2024 08:43:45 +0100 Subject: [PATCH 204/292] Remove comment The shuffler has to be initialized again for the definitions. Otherwise they would be shuffled in the same way as the terms before. See https://mantis.ilias.de/view.php?id=42176 --- Modules/TestQuestionPool/classes/class.assMatchingQuestion.php | 1 - 1 file changed, 1 deletion(-) diff --git a/Modules/TestQuestionPool/classes/class.assMatchingQuestion.php b/Modules/TestQuestionPool/classes/class.assMatchingQuestion.php index fce957278b2a..7a2d72e98db1 100755 --- a/Modules/TestQuestionPool/classes/class.assMatchingQuestion.php +++ b/Modules/TestQuestionPool/classes/class.assMatchingQuestion.php @@ -1387,7 +1387,6 @@ public function toJSON(): string } $result['terms'] = $terms; - // #42176 init shuffler with a new seed, otherwise definitions will be shuffled like the terms $this->setShuffler($this->randomGroup->shuffleArray(new RandomSeed())); $definitions = []; From 975497cbdc883f9914e9db6a796f59ff20f27597 Mon Sep 17 00:00:00 2001 From: Stephan Kergomard Date: Thu, 14 Nov 2024 12:05:59 +0100 Subject: [PATCH 205/292] Test: Do Not Strip Tags on Input in ErrorText See: https://mantis.ilias.de/view.php?id=42348 --- Modules/TestQuestionPool/classes/class.assErrorText.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Modules/TestQuestionPool/classes/class.assErrorText.php b/Modules/TestQuestionPool/classes/class.assErrorText.php index ce1373427f8e..26e7ab897bf9 100644 --- a/Modules/TestQuestionPool/classes/class.assErrorText.php +++ b/Modules/TestQuestionPool/classes/class.assErrorText.php @@ -768,7 +768,7 @@ public function getBestSelection($withPositivePointsOnly = true): array $selections[] = $position; if ($position_data['length'] > 1) { - for ($i=1;$i<$position_data['length'];$i++) { + for ($i = 1;$i < $position_data['length'];$i++) { $selections[] = $position + $i; } } @@ -799,7 +799,7 @@ protected function getPointsForSelectedPositions(array $selected_word_positions) } $passage_complete = true; - for ($i=1;$i<$correct_position_data['length'];$i++) { + for ($i = 1;$i < $correct_position_data['length'];$i++) { $selected_passage_element_key = array_search($correct_position + $i, $selected_word_positions); if ($selected_passage_element_key === false) { $passage_complete = false; @@ -864,7 +864,7 @@ public function getErrorText(): string public function setErrorText(?string $text): void { - $this->errortext = $this->getHtmlQuestionContentPurifier()->purify($text ?? ''); + $this->errortext = $text ?? ''; } public function getParsedErrorText(): array From 392475b2202a346d9bc44fc0fd9cadbb6f6f4294 Mon Sep 17 00:00:00 2001 From: Stephan Kergomard Date: Thu, 14 Nov 2024 12:41:32 +0100 Subject: [PATCH 206/292] Test: Fix Unterminated Html-Entities See: https://mantis.ilias.de/view.php?id=42422 --- Modules/TestQuestionPool/classes/class.assTextQuestionGUI.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/TestQuestionPool/classes/class.assTextQuestionGUI.php b/Modules/TestQuestionPool/classes/class.assTextQuestionGUI.php index e8ce94ce8523..e66fce22c2d3 100755 --- a/Modules/TestQuestionPool/classes/class.assTextQuestionGUI.php +++ b/Modules/TestQuestionPool/classes/class.assTextQuestionGUI.php @@ -492,7 +492,7 @@ public function getTestOutput($active_id, $pass = null, $is_postponed = false, $ $user_solution = htmlentities($user_solution); } - $user_solution = str_replace(['{', '}', '\\'], ['{', '}', '\'], $user_solution); + $user_solution = str_replace(['{', '}', '\\'], ['{', '}', '\'], $user_solution); } // generate the question output From 1eeec1674d769d47cafd43177b16138d0e523ef5 Mon Sep 17 00:00:00 2001 From: Stephan Kergomard Date: Thu, 14 Nov 2024 14:02:37 +0100 Subject: [PATCH 207/292] Test: Try to Fix Duplicate Question Migration See: https://mantis.ilias.de/view.php?id=42503 --- ...lFixMissingQuestionDuplicationMigration.php | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/Modules/TestQuestionPool/Setup/class.ilFixMissingQuestionDuplicationMigration.php b/Modules/TestQuestionPool/Setup/class.ilFixMissingQuestionDuplicationMigration.php index 0545ac0832b5..521a1995cb96 100644 --- a/Modules/TestQuestionPool/Setup/class.ilFixMissingQuestionDuplicationMigration.php +++ b/Modules/TestQuestionPool/Setup/class.ilFixMissingQuestionDuplicationMigration.php @@ -18,18 +18,14 @@ declare(strict_types=1); -use ILIAS\Setup; +use ILIAS\Setup\Migration; use ILIAS\Setup\Environment; -use ILIAS\Setup\CLI\IOWrapper; -class ilFixMissingQuestionDuplicationMigration implements Setup\Migration +class ilFixMissingQuestionDuplicationMigration implements Migration { private ilDBInterface $db; - /** - * @var IOWrapper - */ - private mixed $io; + private bool $ilias_is_initialized = false; public function getLabel(): string { @@ -50,14 +46,16 @@ public function getPreconditions(Environment $environment): array public function prepare(Environment $environment): void { - //This is necessary optherwise questions cannot be copied - ilContext::init(ilContext::CONTEXT_CRON); - ilInitialisation::initILIAS(); $this->db = $environment->getResource(Environment::RESOURCE_DATABASE); } public function step(Environment $environment): void { + if (!$this->ilias_is_initialized) { + \ilContext::init(\ilContext::CONTEXT_CRON); + \ilInitialisation::initILIAS(); + $this->ilias_is_initialized = true; + } $query_main = 'SELECT qst.question_id FROM tst_tests AS tst' . ' INNER JOIN tst_test_question AS tst_qst' . ' ON tst.test_id = tst_qst.test_fi' From 20e0808c8e383220c24fc09592c3c2b23341337e Mon Sep 17 00:00:00 2001 From: Alex Killing Date: Fri, 15 Nov 2024 11:56:25 +0100 Subject: [PATCH 208/292] 41913: error when clikcing on access-Codes in survey --- Modules/Survey/classes/class.ilObjSurvey.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Modules/Survey/classes/class.ilObjSurvey.php b/Modules/Survey/classes/class.ilObjSurvey.php index c5147e1f5447..5c2992edd21f 100755 --- a/Modules/Survey/classes/class.ilObjSurvey.php +++ b/Modules/Survey/classes/class.ilObjSurvey.php @@ -3724,9 +3724,9 @@ public function getSurveyCodesTableData( if ($row["externaldata"]) { $ext = unserialize($row["externaldata"], ['allowed_classes' => false]); - $item['email'] = $ext['email']; - $item['last_name'] = $ext['lastname']; - $item['first_name'] = $ext['firstname']; + $item['email'] = $ext['email'] ?? ""; + $item['last_name'] = $ext['lastname'] ?? ""; + $item['first_name'] = $ext['firstname'] ?? ""; } $codes[] = $item; From 49d5d58dcdaff686d568eacaf053ecf02137b8de Mon Sep 17 00:00:00 2001 From: Alex Killing Date: Fri, 15 Nov 2024 15:56:45 +0100 Subject: [PATCH 209/292] 42042: Survey Access Code: Send Reminder leads to error --- Modules/Survey/classes/class.ilObjSurvey.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/Survey/classes/class.ilObjSurvey.php b/Modules/Survey/classes/class.ilObjSurvey.php index 5c2992edd21f..f0e60aaf6c42 100755 --- a/Modules/Survey/classes/class.ilObjSurvey.php +++ b/Modules/Survey/classes/class.ilObjSurvey.php @@ -3914,7 +3914,7 @@ public function isSurveyFinishedByCode(string $a_code): bool $row = $this->db->fetchAssoc($result); - return $row['state']; + return $row['state'] ?? false; } /** From 5232aa58e8e8d51965e1cfb3e7c3b0db0dd88190 Mon Sep 17 00:00:00 2001 From: Alex Killing Date: Fri, 15 Nov 2024 16:58:29 +0100 Subject: [PATCH 210/292] 42082: After changing the text colour, colour can't be changed to another colour --- .../src/components/paragraph/ui/tiny-dom-transform.js | 11 +++++++++++ .../js/src/components/paragraph/ui/tiny-wrapper.js | 1 + 2 files changed, 12 insertions(+) diff --git a/Services/COPage/Editor/js/src/components/paragraph/ui/tiny-dom-transform.js b/Services/COPage/Editor/js/src/components/paragraph/ui/tiny-dom-transform.js index f55119755e9b..5514cecf3af0 100644 --- a/Services/COPage/Editor/js/src/components/paragraph/ui/tiny-dom-transform.js +++ b/Services/COPage/Editor/js/src/components/paragraph/ui/tiny-dom-transform.js @@ -48,6 +48,17 @@ export default class TinyDomTransform { }); } + removeMultiClasses(preferredClass) { + const r = this.tiny.dom.getRoot(); + r.querySelectorAll('span').forEach(function(span) { + if (span.classList.length > 1) { + if (span.classList.contains(preferredClass)) { + span.className = preferredClass; + } + } + }); + } + replaceBoldUnderlineItalic(node) { this.replaceTag(node, 'b', 'span', {'class': 'ilc_text_inline_Strong'}); this.replaceTag(node, 'u', 'span', {'class': 'ilc_text_inline_Important'}); diff --git a/Services/COPage/Editor/js/src/components/paragraph/ui/tiny-wrapper.js b/Services/COPage/Editor/js/src/components/paragraph/ui/tiny-wrapper.js index 64c1f528519f..3cffe150eede 100644 --- a/Services/COPage/Editor/js/src/components/paragraph/ui/tiny-wrapper.js +++ b/Services/COPage/Editor/js/src/components/paragraph/ui/tiny-wrapper.js @@ -970,6 +970,7 @@ export default class TinyWrapper { t = "mycode"; } ed.execCommand('mceToggleFormat', false, t); + this.getTinyDomTransform().removeMultiClasses('ilc_text_inline_' + t); ed.focus(); //ed.selection.collapse(false); // see #33963 this.autoResize(); From 0f5e7cd69da3a102772b5748d1e3659732e19f6f Mon Sep 17 00:00:00 2001 From: Alexander Killing Date: Fri, 15 Nov 2024 18:19:03 +0100 Subject: [PATCH 211/292] 42758: Old, non-migrated MC objects indefinitely stall copying of courses etc. with error --- Modules/MediaCast/classes/class.ilObjMediaCast.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Modules/MediaCast/classes/class.ilObjMediaCast.php b/Modules/MediaCast/classes/class.ilObjMediaCast.php index 8a570a432b7c..63daa09863bc 100755 --- a/Modules/MediaCast/classes/class.ilObjMediaCast.php +++ b/Modules/MediaCast/classes/class.ilObjMediaCast.php @@ -465,10 +465,10 @@ public function copyItems(ilObjMediaCast $a_new_obj): array $mc_item->setContextObjId($a_new_obj->getId()); $mc_item->setContextObjType($a_new_obj->getType()); $mc_item->setUserId($ilUser->getId()); - $mc_item->setPlaytime($item["playtime"]); - $mc_item->setTitle($item["title"]); - $mc_item->setContent($item["content"]); - $mc_item->setVisibility($item["visibility"]); + $mc_item->setPlaytime($item["playtime"] ?? ""); + $mc_item->setTitle($item["title"] ?? ""); + $mc_item->setContent($item["content"] ?? ""); + $mc_item->setVisibility($item["visibility"] ?? "users"); $mc_item->create(); $this->mob_mapping[$mob_id] = $new_mob->getId(); $item_mapping[$item["id"]] = $mc_item->getId(); From 8db14a284547af8ec1e09a29b9afba926dcf0777 Mon Sep 17 00:00:00 2001 From: Alexander Killing Date: Fri, 15 Nov 2024 22:28:18 +0100 Subject: [PATCH 212/292] 41744: Settings - Administering the survey: Access Time not saved correctly --- Modules/Survey/Settings/class.SettingsFormGUI.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Modules/Survey/Settings/class.SettingsFormGUI.php b/Modules/Survey/Settings/class.SettingsFormGUI.php index 7809e02e403a..d9217ef2d7c7 100644 --- a/Modules/Survey/Settings/class.SettingsFormGUI.php +++ b/Modules/Survey/Settings/class.SettingsFormGUI.php @@ -360,7 +360,7 @@ public function withAccess( $startingtime = new \ilDateTimeInputGUI($lng->txt("start_date"), 'start_date'); $startingtime->setShowTime(true); if ($start) { - $startingtime->setDate(new \ilDate($start, IL_CAL_TIMESTAMP)); + $startingtime->setDate(new \ilDatetime($start, IL_CAL_TIMESTAMP)); } $form->addItem($startingtime); @@ -370,7 +370,7 @@ public function withAccess( $endingtime = new \ilDateTimeInputGUI($lng->txt("end_date"), 'end_date'); $endingtime->setShowTime(true); if ($end) { - $endingtime->setDate(new \ilDate($end, IL_CAL_TIMESTAMP)); + $endingtime->setDate(new \ilDatetime($end, IL_CAL_TIMESTAMP)); } $form->addItem($endingtime); From 712b44d1f645d6072c33e98cbb0a99ca6ca50651 Mon Sep 17 00:00:00 2001 From: Alexander Killing Date: Fri, 15 Nov 2024 22:32:19 +0100 Subject: [PATCH 213/292] 41744: Settings - Administering the survey: Access Time not saved correctly --- Modules/Survey/Settings/class.SettingsFormGUI.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Modules/Survey/Settings/class.SettingsFormGUI.php b/Modules/Survey/Settings/class.SettingsFormGUI.php index d9217ef2d7c7..868ccebb331b 100644 --- a/Modules/Survey/Settings/class.SettingsFormGUI.php +++ b/Modules/Survey/Settings/class.SettingsFormGUI.php @@ -360,7 +360,7 @@ public function withAccess( $startingtime = new \ilDateTimeInputGUI($lng->txt("start_date"), 'start_date'); $startingtime->setShowTime(true); if ($start) { - $startingtime->setDate(new \ilDatetime($start, IL_CAL_TIMESTAMP)); + $startingtime->setDate(new \ilDateTime($start, IL_CAL_TIMESTAMP)); } $form->addItem($startingtime); @@ -370,7 +370,7 @@ public function withAccess( $endingtime = new \ilDateTimeInputGUI($lng->txt("end_date"), 'end_date'); $endingtime->setShowTime(true); if ($end) { - $endingtime->setDate(new \ilDatetime($end, IL_CAL_TIMESTAMP)); + $endingtime->setDate(new \ilDateTime($end, IL_CAL_TIMESTAMP)); } $form->addItem($endingtime); From e2d78003af4fb2deb5e9e461ff76f268d15f5bb3 Mon Sep 17 00:00:00 2001 From: Alexander Killing Date: Sat, 16 Nov 2024 11:08:55 +0100 Subject: [PATCH 214/292] 38655: Upload of image file with spaces in the name --- Services/Style/Content/classes/class.ilObjStyleSheet.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Services/Style/Content/classes/class.ilObjStyleSheet.php b/Services/Style/Content/classes/class.ilObjStyleSheet.php index a6f56ba59c94..982cdf4a474a 100755 --- a/Services/Style/Content/classes/class.ilObjStyleSheet.php +++ b/Services/Style/Content/classes/class.ilObjStyleSheet.php @@ -1412,12 +1412,12 @@ public function writeCSSFile( if (in_array($cur_par, array("background-image", "list-style-image"))) { if (is_int(strpos($cur_val, "/"))) { // external - $cur_val = "url(" . $cur_val . ")"; + $cur_val = "url('" . $cur_val . "')"; } else { // internal if ($a_image_dir == "") { - $cur_val = "url(../sty/sty_" . $this->getId() . "/images/" . $cur_val . ")"; + $cur_val = "url('../sty/sty_" . $this->getId() . "/images/" . $cur_val . "')"; } else { - $cur_val = "url(" . $a_image_dir . "/" . $cur_val . ")"; + $cur_val = "url('" . $a_image_dir . "/" . $cur_val . "')"; } } } From 8154d67aa09d42e81233c7f74cf46ca9fa4e7bc3 Mon Sep 17 00:00:00 2001 From: Alexander Killing Date: Sat, 16 Nov 2024 12:15:01 +0100 Subject: [PATCH 215/292] 38620: Download All ZIP Cannot Be Removed From Notifications --- .../class.ilExDownloadSubmissionsZipInteraction.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Modules/Exercise/classes/BackgroundTasks/class.ilExDownloadSubmissionsZipInteraction.php b/Modules/Exercise/classes/BackgroundTasks/class.ilExDownloadSubmissionsZipInteraction.php index d77079d25238..e013c628f353 100644 --- a/Modules/Exercise/classes/BackgroundTasks/class.ilExDownloadSubmissionsZipInteraction.php +++ b/Modules/Exercise/classes/BackgroundTasks/class.ilExDownloadSubmissionsZipInteraction.php @@ -95,9 +95,12 @@ public function interaction( $path = null; } $this->logger->debug("Path: " . $path); - if (!is_null($path) && $filesystem->has($path)) { - $this->logger->debug("Delete dir: " . dirname($path)); - $filesystem->deleteDir(dirname($path)); + try { + if (!is_null($path) && $filesystem->has($path)) { + $this->logger->debug("Delete dir: " . dirname($path)); + $filesystem->deleteDir(dirname($path)); + } + } catch (Exception $e) { } return $download_name; From d324f6279ee0a774609a30d5049e39fc43e1125e Mon Sep 17 00:00:00 2001 From: Alexander Killing Date: Sun, 17 Nov 2024 14:14:36 +0100 Subject: [PATCH 216/292] 35519: Deadline for Preferences can be edited after it passed --- .../classes/class.ilObjBookingPoolGUI.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Modules/BookingManager/classes/class.ilObjBookingPoolGUI.php b/Modules/BookingManager/classes/class.ilObjBookingPoolGUI.php index e6195299352b..bc0a214ed8c0 100644 --- a/Modules/BookingManager/classes/class.ilObjBookingPoolGUI.php +++ b/Modules/BookingManager/classes/class.ilObjBookingPoolGUI.php @@ -26,6 +26,7 @@ */ class ilObjBookingPoolGUI extends ilObjectGUI { + protected \ILIAS\BookingManager\InternalDomainService $domain; protected ilCronManager $cron_manager; protected \ILIAS\BookingManager\StandardGUIRequest $book_request; protected \ILIAS\BookingManager\InternalService $service; @@ -91,6 +92,7 @@ public function __construct( throw new ilException("Booking Object ID does not match Booking Pool."); } $this->cron_manager = $DIC->cron()->manager(); + $this->domain = $DIC->bookingManager()->internal()->domain(); } /** @@ -372,6 +374,12 @@ protected function initEditCustomForm(ilPropertyFormGUI $form): void $pref->setInfo($this->lng->txt("book_schedule_type_none_preference_info")); $type->addOption($pref); + $pref_options_disabled = false; + if ($this->object->getScheduleType() === ilObjBookingPool::TYPE_NO_SCHEDULE_PREFERENCES) { + $pref_manager = $this->domain->preferences($this->object); + $pref_options_disabled = $pref_manager->hasRun(); + } + // number of preferences $pref_nr = new ilNumberInputGUI($this->lng->txt("book_nr_of_preferences"), "preference_nr"); $pref_nr->setSize(4); @@ -379,6 +387,7 @@ protected function initEditCustomForm(ilPropertyFormGUI $form): void $pref_nr->setInfo($this->lng->txt("book_nr_of_preferences_info")); $pref_nr->setSuffix($this->lng->txt("book_nr_preferences")); $pref_nr->setRequired(true); + $pref_nr->setDisabled($pref_options_disabled); $pref->addSubItem($pref_nr); // preference deadline @@ -386,6 +395,7 @@ protected function initEditCustomForm(ilPropertyFormGUI $form): void $pref_deadline->setInfo($this->lng->txt("book_pref_deadline_info")); $pref_deadline->setShowTime(true); $pref_deadline->setRequired(true); + $pref_deadline->setDisabled($pref_options_disabled); $pref->addSubItem($pref_deadline); $public = new ilCheckboxInputGUI($this->lng->txt("book_public_log"), "public"); From d9c86c0abe3802e32e6652ab707a19decfd392d4 Mon Sep 17 00:00:00 2001 From: Alexander Killing Date: Sun, 17 Nov 2024 17:47:50 +0100 Subject: [PATCH 217/292] 41374: Link to Learning Progress doesn't work --- .../LearningModule/classes/class.ilObjLearningModuleListGUI.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/LearningModule/classes/class.ilObjLearningModuleListGUI.php b/Modules/LearningModule/classes/class.ilObjLearningModuleListGUI.php index 060c3893c934..8bc21f270b1d 100644 --- a/Modules/LearningModule/classes/class.ilObjLearningModuleListGUI.php +++ b/Modules/LearningModule/classes/class.ilObjLearningModuleListGUI.php @@ -91,7 +91,7 @@ public function getCommandLink(string $cmd): string $ctrl->setParameterByClass(ilLMPresentationGUI::class, "ref_id", $this->ref_id); $cmd_link = $ctrl->getLinkTargetByClass( [ilLMPresentationGUI::class, ilLearningProgressGUI::class ], - "editManual" + "" ); break; From 395f0971aab2409f7af5956a6ea87c04e47426f7 Mon Sep 17 00:00:00 2001 From: Alexander Killing Date: Sun, 17 Nov 2024 21:57:50 +0100 Subject: [PATCH 218/292] =?UTF-8?q?41506:=20Deaktivieren/L=C3=B6schen=20vo?= =?UTF-8?q?n=20Page=20Componenten=20Plugin=20f=C3=BChrt=20nicht=20zur=20vo?= =?UTF-8?q?llst=C3=A4ndigen=20L=C3=B6schung/Deaktivierung=20im=20Page=20Ed?= =?UTF-8?q?itor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Services/COPage/classes/class.ilPCPlugged.php | 6 ++++++ lang/ilias_de.lang | 1 + lang/ilias_en.lang | 1 + 3 files changed, 8 insertions(+) diff --git a/Services/COPage/classes/class.ilPCPlugged.php b/Services/COPage/classes/class.ilPCPlugged.php index 9faf89e7f5bc..62e2331bac9f 100755 --- a/Services/COPage/classes/class.ilPCPlugged.php +++ b/Services/COPage/classes/class.ilPCPlugged.php @@ -332,6 +332,12 @@ public function modifyPageContentPostXsl( $plugin_obj->setPageObj($this->getPage()); $gui_obj = $plugin_obj->getUIClassInstance(); $plugin_html = $gui_obj->getElementHTML($a_mode, $properties, $plugin_version); + } else { + if ($a_mode === "edit") { + $plugin_html = sprintf($this->lng->txt("copg_plugin_not_avail"), $plugin_name); + } else { + $plugin_html = " "; + } } $a_output = substr($a_output, 0, $start) . diff --git a/lang/ilias_de.lang b/lang/ilias_de.lang index ac4de650f0b1..0b9f0ce0803c 100644 --- a/lang/ilias_de.lang +++ b/lang/ilias_de.lang @@ -7283,6 +7283,7 @@ copg#:#copg_page_element_not_found#:#Unbekanntes Seitenelement. copg#:#copg_page_type_stys#:#Seitenlayout copg#:#copg_par_format_selection#:#Absatzformatauswahl copg#:#copg_pc_mob_does_not_exist#:#Das Medienobjekt wurde nicht gefunden. +copg#:#copg_plugin_not_avail#:#Plugin %s nicht verfügbar. copg#:#copg_questions_not_supported_here#:#In diesem Kontext werden keine Fragen unterstützt. copg#:#copg_reload_page#:#Seite neu laden copg#:#copg_remove_formats#:#Zeichenformate entfernen diff --git a/lang/ilias_en.lang b/lang/ilias_en.lang index 03fcef0da2cb..65df495df379 100644 --- a/lang/ilias_en.lang +++ b/lang/ilias_en.lang @@ -7283,6 +7283,7 @@ copg#:#copg_page_element_not_found#:#Page element not found. copg#:#copg_page_type_stys#:#Layout Page copg#:#copg_par_format_selection#:#Paragraph Format Selection copg#:#copg_pc_mob_does_not_exist#:#This media object does not exist. +copg#:#copg_plugin_not_avail#:#Plugin %s not available. copg#:#copg_questions_not_supported_here#:#Questions are not supported in this context. copg#:#copg_reload_page#:#Reload Page copg#:#copg_remove_formats#:#Remove Formatting From 59a8b6939e34cb578238d3005c20fea4436d5ba8 Mon Sep 17 00:00:00 2001 From: Alexander Killing Date: Sat, 16 Nov 2024 22:46:20 +0100 Subject: [PATCH 219/292] 36955: Different appearance of xln and https:// links --- Services/Link/js/ilExtLink.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Services/Link/js/ilExtLink.js b/Services/Link/js/ilExtLink.js index de24303379ce..0d13fab4ed2f 100644 --- a/Services/Link/js/ilExtLink.js +++ b/Services/Link/js/ilExtLink.js @@ -15,13 +15,9 @@ il.ExtLink = { } }); if (typeof link_class !== "undefined") { - $(selector + " a.linkified").addClass(link_class); + $(selector).find('a.linkified').addClass(link_class); } - if (typeof selector === "string") { - $(selector + " a.linkified[target='_blank']").attr("rel", "noreferrer noopener"); - } else { - $(selector).find("a.linkified[target='_blank']").attr("rel", "noreferrer noopener"); - } + $(selector).find("a.linkified[target='_blank']").attr("rel", "noreferrer noopener"); } } From 00bd79247f88a2855633c4e604e0f0a6341bc497 Mon Sep 17 00:00:00 2001 From: Stephan Kergomard Date: Mon, 18 Nov 2024 11:19:15 +0100 Subject: [PATCH 220/292] Object: Do Not Overwrite DefaultLang on MasterLang See: https://mantis.ilias.de/view.php?id=35950 --- .../Translation/class.ilObjectTranslationGUI.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Services/Object/classes/Translation/class.ilObjectTranslationGUI.php b/Services/Object/classes/Translation/class.ilObjectTranslationGUI.php index d52300667ca7..dce1a8ff8bce 100644 --- a/Services/Object/classes/Translation/class.ilObjectTranslationGUI.php +++ b/Services/Object/classes/Translation/class.ilObjectTranslationGUI.php @@ -439,14 +439,14 @@ public function saveContentTranslationActivation(): void if ($form->checkInput()) { $ml = $form->getInput("master_lang"); $this->obj_trans->setMasterLanguage($ml); - $this->obj_trans->addLanguage( - $ml, - $this->obj->getTitle(), - $this->obj->getDescription(), - true - ); - $this->obj_trans->setDefaultTitle($this->obj->getTitle()); - $this->obj_trans->setDefaultDescription($this->obj->getDescription()); + if (!in_array($ml, $this->obj_trans->getLanguages())) { + $this->obj_trans->addLanguage( + $ml, + $this->obj->getTitle(), + $this->obj->getDescription(), + true + ); + } $this->obj_trans->save(); } From 2553ec8c77a82963005c43b97d594ef0dd66cfc3 Mon Sep 17 00:00:00 2001 From: Stephan Kergomard Date: Mon, 18 Nov 2024 11:36:32 +0100 Subject: [PATCH 221/292] Object: Add Byline to Taxonomy Setting See: https://mantis.ilias.de/view.php?id=35589 --- Services/Object/classes/class.ilObjectServiceSettingsGUI.php | 1 + lang/ilias_de.lang | 1 + lang/ilias_en.lang | 1 + 3 files changed, 3 insertions(+) diff --git a/Services/Object/classes/class.ilObjectServiceSettingsGUI.php b/Services/Object/classes/class.ilObjectServiceSettingsGUI.php index 1f6531181908..5959b86d1d44 100644 --- a/Services/Object/classes/class.ilObjectServiceSettingsGUI.php +++ b/Services/Object/classes/class.ilObjectServiceSettingsGUI.php @@ -206,6 +206,7 @@ public static function initServiceSettingsForm( // taxonomies if (in_array(self::TAXONOMIES, $services)) { $tax = new ilCheckboxInputGUI($lng->txt('obj_tool_setting_taxonomies'), self::TAXONOMIES); + $tax->setInfo($lng->txt('obj_tool_setting_taxonomies_info')); $tax->setValue("1"); $tax->setChecked((bool) ilContainer::_lookupContainerSetting( $obj_id, diff --git a/lang/ilias_de.lang b/lang/ilias_de.lang index 0b9f0ce0803c..f8d4db15da5d 100644 --- a/lang/ilias_de.lang +++ b/lang/ilias_de.lang @@ -12365,6 +12365,7 @@ obj#:#obj_tool_setting_skills_info#:#Die Funktion ermöglicht es Kompetenzen aus obj#:#obj_tool_setting_tag_cloud#:#Tag Cloud obj#:#obj_tool_setting_tag_cloud_info#:#Es wird eine Tag Cloud im Block „Auswahl nach Themen“ im Reiter „Inhalt“ angezeigt. obj#:#obj_tool_setting_taxonomies#:#Taxonomien +obj#:#obj_tool_setting_taxonomies_info#:#Taxonomien erlauben das Filtern von Objekten. Sie werden im Reiter „Metadaten“ angelegt. obj#:#obj_tool_setting_use_news#:#Neuigkeiten obj#:#obj_tool_setting_use_news_info#:#Nutzung des Blocks „Neuigkeiten“ oder der Timeline für Neuigkeiten. Benutzer können Benachrichtigungen für Neuigkeiten aktivieren, sobald der Block oder die Timeline aktiv sind. obj#:#obj_tool_setting_use_news_open_settings#:#Einstellungen für Block und Timeline öffnen diff --git a/lang/ilias_en.lang b/lang/ilias_en.lang index 65df495df379..39c88e4ea6fb 100644 --- a/lang/ilias_en.lang +++ b/lang/ilias_en.lang @@ -12365,6 +12365,7 @@ obj#:#obj_tool_setting_skills_info#:#Activates competence management and compete obj#:#obj_tool_setting_tag_cloud#:#Tag Cloud obj#:#obj_tool_setting_tag_cloud_info#:#The ‘Tag Cloud’ block will be displayed inside the ‘Content’ tab. obj#:#obj_tool_setting_taxonomies#:#Taxonomies +obj#:#obj_tool_setting_taxonomies_info#:#Taxonomies allow the filtering of objects. They are created in the "Metadata" tab. obj#:#obj_tool_setting_use_news#:#News obj#:#obj_tool_setting_use_news_info#:#Use of the news block and/or timeline view. Users can subscribe for notifications if the news block or the timeline are activated. obj#:#obj_tool_setting_use_news_open_settings#:#Open Settings of News Block and Timeline From b6ec3392e08ad4da215d1910da91017dd91ba171 Mon Sep 17 00:00:00 2001 From: Alex Killing Date: Mon, 18 Nov 2024 15:14:58 +0100 Subject: [PATCH 222/292] 41869: Personal and shared resssources -> My ressources -> external and internal web links throw errors or do not behave correctly --- Modules/WebResource/classes/class.ilObjLinkResourceListGUI.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/WebResource/classes/class.ilObjLinkResourceListGUI.php b/Modules/WebResource/classes/class.ilObjLinkResourceListGUI.php index f08fa2e76791..a4b96b88a8d2 100644 --- a/Modules/WebResource/classes/class.ilObjLinkResourceListGUI.php +++ b/Modules/WebResource/classes/class.ilObjLinkResourceListGUI.php @@ -101,7 +101,7 @@ public function getProperties(): array public function getCommandLink(string $cmd): string { $cmd_class = ''; - if ($this->request_wrapper->has('cmd_class')) { + if ($this->request_wrapper->has('cmdClass')) { $cmd_class = $this->request_wrapper->retrieve( 'cmdClass', $this->refinery->kindlyTo()->string() From 395c711df42b0ada3f604f0c317c869a42cf4b56 Mon Sep 17 00:00:00 2001 From: ingoj <120396930+ingoj@users.noreply.github.com> Date: Mon, 18 Nov 2024 15:25:23 +0100 Subject: [PATCH 223/292] Mantis 42805: Release 8 accordion (#8450) * fix inconsistent handling of value parameter tab_nr was handled as int while all other occurences of this parameter are handled as string * change tab_nr from int to string --- Services/Accordion/classes/class.StandardGUIRequest.php | 4 ++-- .../classes/class.ilAccordionPropertiesStorageGUI.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Services/Accordion/classes/class.StandardGUIRequest.php b/Services/Accordion/classes/class.StandardGUIRequest.php index 0c58065dc457..5469a9df40a6 100644 --- a/Services/Accordion/classes/class.StandardGUIRequest.php +++ b/Services/Accordion/classes/class.StandardGUIRequest.php @@ -48,9 +48,9 @@ public function getId(): string return $this->str("accordion_id"); } - public function getTabNr(): int + public function getTabNr(): string { - return $this->int("tab_nr"); + return $this->str("tab_nr"); } public function getUserId(): int diff --git a/Services/Accordion/classes/class.ilAccordionPropertiesStorageGUI.php b/Services/Accordion/classes/class.ilAccordionPropertiesStorageGUI.php index 7a24abd8ab46..bcbc93267e73 100644 --- a/Services/Accordion/classes/class.ilAccordionPropertiesStorageGUI.php +++ b/Services/Accordion/classes/class.ilAccordionPropertiesStorageGUI.php @@ -22,7 +22,7 @@ */ class ilAccordionPropertiesStorageGUI implements ilCtrlBaseClassInterface { - protected int $tab_nr; + protected string $tab_nr; protected string $req_acc_id; protected int $user_id; protected \ILIAS\Accordion\StandardGUIRequest $request; From e4e520daf6a8272ecff7eea6a8232df971daa4c4 Mon Sep 17 00:00:00 2001 From: iszmais <45942348+iszmais@users.noreply.github.com> Date: Mon, 18 Nov 2024 17:09:35 +0100 Subject: [PATCH 224/292] fix dc text field against json input (#8454) --- .../Text/class.ilDclTextRecordFieldModel.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Modules/DataCollection/classes/Fields/Text/class.ilDclTextRecordFieldModel.php b/Modules/DataCollection/classes/Fields/Text/class.ilDclTextRecordFieldModel.php index ec0783a1d661..71fac0feefc2 100644 --- a/Modules/DataCollection/classes/Fields/Text/class.ilDclTextRecordFieldModel.php +++ b/Modules/DataCollection/classes/Fields/Text/class.ilDclTextRecordFieldModel.php @@ -157,4 +157,18 @@ public function parseSortingValue($value, bool $link = true): string return $value; } } + + public function deserializeData($value) + { + $value = (string) $value; + if ($this->getField()->getProperty(ilDclBaseFieldModel::PROP_URL)) { + $deserialize = json_decode($value, true); + return [ + 'title' => $deserialize['title'] ?? '', + 'link' => $deserialize['link'] ?? '', + ]; + } + + return $value; + } } From e4b5036fa76d14d3cc25f9a1cef718ba0b44dfbf Mon Sep 17 00:00:00 2001 From: Nils Haagen Date: Wed, 13 Nov 2024 11:58:10 +0100 Subject: [PATCH 225/292] OrgU: 42682, orgu_ref must be of type int --- .../classes/PathStorage/class.ilOrgUnitPathStorage.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Modules/OrgUnit/classes/PathStorage/class.ilOrgUnitPathStorage.php b/Modules/OrgUnit/classes/PathStorage/class.ilOrgUnitPathStorage.php index f13c015391a9..ae3ec893bcdf 100644 --- a/Modules/OrgUnit/classes/PathStorage/class.ilOrgUnitPathStorage.php +++ b/Modules/OrgUnit/classes/PathStorage/class.ilOrgUnitPathStorage.php @@ -131,9 +131,9 @@ public static function getTextRepresentationOfOrgUnits(bool $sort_by_title = tru return ilOrgUnitPathStorage::getArray('ref_id', 'path'); } - public static function writePathByRefId(string $ref_id): void + public static function writePathByRefId(int $ref_id): void { - $original_ref_id = (int) $ref_id; + $original_ref_id = $ref_id; $names = self::getAllOrguNames(); $root_ref_id = ilObjOrgUnit::getRootOrgRefId(); $tree = ilObjOrgUnitTree::_getInstance(); From 77db71b995e7360adb52f0495232c2b7d1f516bb Mon Sep 17 00:00:00 2001 From: Stephan Kergomard Date: Tue, 19 Nov 2024 09:34:04 +0100 Subject: [PATCH 226/292] Update PHPSpreadSheet --- composer.lock | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/composer.lock b/composer.lock index d8dde49e26f9..6b1484a0c5d9 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "7692b45c2ebadeea524470833b2ce858", + "content-hash": "df0fab678c9b7abd5938115f2b40bc7e", "packages": [ { "name": "cweagans/composer-patches", @@ -1815,16 +1815,16 @@ }, { "name": "phpoffice/phpspreadsheet", - "version": "1.29.2", + "version": "1.29.4", "source": { "type": "git", "url": "https://github.com/PHPOffice/PhpSpreadsheet.git", - "reference": "3a5a818d7d3e4b5bd2e56fb9de44dbded6eae07f" + "reference": "7ca7e325dca3adb6a598385aab81f527b8d6c75d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPOffice/PhpSpreadsheet/zipball/3a5a818d7d3e4b5bd2e56fb9de44dbded6eae07f", - "reference": "3a5a818d7d3e4b5bd2e56fb9de44dbded6eae07f", + "url": "https://api.github.com/repos/PHPOffice/PhpSpreadsheet/zipball/7ca7e325dca3adb6a598385aab81f527b8d6c75d", + "reference": "7ca7e325dca3adb6a598385aab81f527b8d6c75d", "shasum": "" }, "require": { @@ -1914,9 +1914,9 @@ ], "support": { "issues": "https://github.com/PHPOffice/PhpSpreadsheet/issues", - "source": "https://github.com/PHPOffice/PhpSpreadsheet/tree/1.29.2" + "source": "https://github.com/PHPOffice/PhpSpreadsheet/tree/1.29.4" }, - "time": "2024-09-29T07:04:47+00:00" + "time": "2024-11-10T16:26:22+00:00" }, { "name": "phpseclib/phpseclib", @@ -11290,7 +11290,7 @@ ], "aliases": [], "minimum-stability": "stable", - "stability-flags": [], + "stability-flags": {}, "prefer-stable": false, "prefer-lowest": false, "platform": { @@ -11302,8 +11302,9 @@ "ext-json": "*", "ext-simplexml": "*", "ext-libxml": "*", + "ext-mbstring": "*", "ext-xml": "*" }, - "platform-dev": [], + "platform-dev": {}, "plugin-api-version": "2.6.0" } From 1a0e142a0894552634e31732e47d1e383c14b428 Mon Sep 17 00:00:00 2001 From: iszmais <45942348+iszmais@users.noreply.github.com> Date: Tue, 19 Nov 2024 14:24:56 +0100 Subject: [PATCH 227/292] set settings default (#8469) --- .../class.ilObjNotificationAdminGUI.php | 51 +++++++++++-------- 1 file changed, 31 insertions(+), 20 deletions(-) diff --git a/Services/Notifications/classes/class.ilObjNotificationAdminGUI.php b/Services/Notifications/classes/class.ilObjNotificationAdminGUI.php index 2e166c9312f8..1f9e0b7e6710 100644 --- a/Services/Notifications/classes/class.ilObjNotificationAdminGUI.php +++ b/Services/Notifications/classes/class.ilObjNotificationAdminGUI.php @@ -100,16 +100,21 @@ public function saveOSDSettings(): void $form = $this->getForm()->withRequest($this->dic->http()->request()); $data = $form->getData(); if (isset($data['osd']) && is_array($data['osd'])) { - if (isset($data['osd']['enable_osd'])) { + if (!isset($data['osd']['enable_osd'])) { + global $DIC; + $DIC->notifications()->system()->clear('osd'); + $settings->set('enable_osd', '0'); + $settings->delete('osd_interval'); + $settings->delete('osd_vanish'); + $settings->delete('osd_delay'); + $settings->delete('osd_play_sound'); + } else { $settings->set('enable_osd', '1'); $settings->set('osd_interval', ((string) $data['osd']['enable_osd']['osd_interval'])); $settings->set('osd_vanish', ((string) $data['osd']['enable_osd']['osd_vanish'])); $settings->set('osd_delay', ((string) $data['osd']['enable_osd']['osd_delay'])); $settings->set('osd_play_sound', ($data['osd']['enable_osd']['osd_play_sound']) ? '1' : '0'); - } else { - global $DIC; - $DIC->notifications()->system()->clear('osd'); - $settings->set('enable_osd', '0'); + } } $this->showOSDSettings($form); @@ -125,27 +130,33 @@ protected function getForm(array $value = null): Form 'osd_interval' => $this->dic->ui()->factory()->input()->field()->numeric( $this->lng->txt('osd_interval'), $this->lng->txt('osd_interval_desc') - )->withRequired(true) - ->withAdditionalTransformation($this->dic->refinery()->custom()->constraint( - static function ($value) { - return $value >= 3000; - }, - $this->lng->txt('osd_error_refresh_interval_too_small') - )), + ) + ->withRequired(true) + ->withValue(60000) + ->withAdditionalTransformation($this->dic->refinery()->custom()->constraint( + static function ($value) { + return $value >= 3000; + }, + $this->lng->txt('osd_error_refresh_interval_too_small') + )), 'osd_vanish' => $this->dic->ui()->factory()->input()->field()->numeric( $this->lng->txt('osd_vanish'), $this->lng->txt('osd_vanish_desc') - )->withRequired(true) - ->withAdditionalTransformation($this->dic->refinery()->custom()->constraint( - static function ($value) { - return $value >= 1000; - }, - $this->lng->txt('osd_error_presentation_time_too_small') - )), + ) + ->withRequired(true) + ->withValue(5000) + ->withAdditionalTransformation($this->dic->refinery()->custom()->constraint( + static function ($value) { + return $value >= 1000; + }, + $this->lng->txt('osd_error_presentation_time_too_small') + )), 'osd_delay' => $this->dic->ui()->factory()->input()->field()->numeric( $this->lng->txt('osd_delay'), $this->lng->txt('osd_delay_desc') - )->withRequired(true), + ) + ->withRequired(true) + ->withValue(500), 'osd_play_sound' => $this->dic->ui()->factory()->input()->field()->checkbox( $this->lng->txt('osd_play_sound'), $this->lng->txt('osd_play_sound_desc') From 27c769dcdac8c6bd34231e49efecc884e1076a62 Mon Sep 17 00:00:00 2001 From: Fabian Wolf Date: Tue, 19 Nov 2024 16:11:38 +0100 Subject: [PATCH 228/292] Updated japanish language files, thanks to Shiro Tamoto --- lang/ilias_ja.lang | 210 ++++++++++++++++++++++----------------------- 1 file changed, 105 insertions(+), 105 deletions(-) diff --git a/lang/ilias_ja.lang b/lang/ilias_ja.lang index b276fe4d0b1a..f0bb1cd1bf1d 100644 --- a/lang/ilias_ja.lang +++ b/lang/ilias_ja.lang @@ -598,7 +598,7 @@ assessment#:#circle_click_center#:#希望範囲の中心をクリックしてく assessment#:#circle_click_circle#:#希望範囲の円の部分をクリックしてください。 assessment#:#clientip#:#クライアントのIP assessment#:#close_text_hint#:#新しくギャップを追加するには選択の位置にカーソルをセットして"ギャップを挿入"ボタンをクリックします。対応する編集セクションが下に表示されます。ギャップはギャップテキスト内のギャップをクリックして編集することもできます。 -assessment#:#cloze_answer_text_info#:#Spaces preceding or following the answer text will be deleted when the form is saved.###28 11 2023 new variable +assessment#:#cloze_answer_text_info#:#先行スペースまたは回答に続くテキストはフォームが保存される時に削除されます。 assessment#:#cloze_fixed_textlength#:#テキスト欄の長さ assessment#:#cloze_fixed_textlength_description#:#0以上の値を入力すると全てのテキストと数値穴埋めテキストフィールドがこの値の固定長で作成されます。 assessment#:#cloze_gap_size_info#:#0以上を入力するとこのギャップテキストフィールドはこの値の固定長で作成されます。値を入力しない場合はギャップテキストフィールドはグローバル固定長で作成されます。 @@ -872,7 +872,7 @@ assessment#:#log_user_not_entered_values#:#ユーザは値を未入力です assessment#:#log_user_solution_willingly_deleted#:#ユーザは回答を削除しました。 assessment#:#log_wrong_test_password_entered#:#受講者は間違ったテストパスワードを入力しました。入力: '%s' assessment#:#longmenu#:#Longmenu -assessment#:#longmenu_answeroptions_differ#:#This question does not work correctly, as there are not the same amount of gaps in the text as in the correction options.###28 07 2023 new variable +assessment#:#longmenu_answeroptions_differ#:#訂正オプションのテキスト内ギャップ数と同じではないのでこの問題は正しく動作しません。 assessment#:#longmenu_text#:#長いメニューテキスト assessment#:#mailnottype#:#ユーザがテスト終了しても通知を送る assessment#:#mailnottype_desc#:#たとえ テスト試行回数が上限をこえていなくてもテストオーナーへ通知する。 @@ -2169,7 +2169,7 @@ badge#:#badge_backpack_no_groups#:#Mozilla Backpackは空か未公開です。 badge#:#badge_badge#:#バッジ badge#:#badge_course_lp#:#コースLP badge#:#badge_course_lp_invalid#:#次のオブジェクトにはサポートされていないLPモードがあります: %s -badge#:#badge_create_image_processing_failed#:#The badge could not be created, an error occurred while processing the image.###14 05 2024 new variable +badge#:#badge_create_image_processing_failed#:#イメージ処理中にエラーが発生したのでバッジを作成できませんでした。 badge#:#badge_criteria#:#判定基準 badge#:#badge_crs_merit#:#メリット badge#:#badge_deletion_confirmation#:#次のバッジとそれぞれの割当てすべてを本当に削除しますか? @@ -2197,7 +2197,7 @@ badge#:#badge_obi_activate_info#:#ユーザはiliasからバッジをエクス badge#:#badge_obi_contact#:#連絡先メールアドレス badge#:#badge_obi_contact_info#:#このE-mailアドレスはバッジの背面以外は表示されません。 badge#:#badge_obi_organisation#:#組織 -badge#:#badge_obi_organisation_info#:#このエントリーはバッジの発行者として表示されます。 +badge#:#badge_obi_organisation_info#:#このエントリーはバッジの発行者として表示されrます。 badge#:#badge_obi_salt#:#塩 badge#:#badge_obi_salt_info#:#バッジの認証を有効にするためにサードパーティを許可する文字と数字の組合せを入力します。これ以降のエントリー変更はしないでください。 badge#:#badge_object_badges#:#目標のバッジ @@ -2218,8 +2218,8 @@ badge#:#badge_template_types#:#有効なタイプ badge#:#badge_template_types_all#:#All badge#:#badge_template_types_specific#:#特定の badge#:#badge_types#:#タイプ -badge#:#badge_update_image_processing_failed#:#The badge could not be updated, an error occurred while processing the image.###14 05 2024 new variable -badge#:#badge_uploaded_image_file_not_found#:#No uploaded image for the badge could be found.###14 05 2024 new variable +badge#:#badge_update_image_processing_failed#:#イメージ処理中にエラーが発生したためバッジを更新できませんでした。 +badge#:#badge_uploaded_image_file_not_found#:#バッジ用のアップロードされたイメージが見つかりませんでした。 badge#:#badge_user_profile#:#ユーザプロファイル badge#:#badge_valid#:#有効期限 bgtask#:#bgtask_blocked#:#平行ダウンロード @@ -3163,7 +3163,7 @@ cmix#:#conf_user_ident_il_uuid_user_id#:#E-Mailアドレスで書式化された cmix#:#conf_user_ident_il_uuid_user_id_info#:#これはコール毎にユニークですが、ユーザに関して直接結論つけされる事を許容願います。 cmix#:#conf_user_ident_info#:#標準はemailアドレスに準じます。ユニークなILIASプラットフォームIDは: cmix#:#conf_user_ident_real_email#:#E-Mail Address -cmix#:#conf_user_ident_real_email_info#:#IDとしてユーザのメールアドレスを送信 (Warning: E-Mailアドレスは複数のユーザで使用されている可能性があります) +cmix#:#conf_user_ident_real_email_info#:#IDとしてユーザのメールアドレスを送信 (Warning: E-Mailアドレスは複数のユーザで使用されている可能性があります) cmix#:#conf_user_name#:#ユーザ名 cmix#:#conf_user_name_firstname#:#氏名 cmix#:#conf_user_name_firstname_info#:#ILIASからユーザ名の氏名を送信 @@ -4113,7 +4113,7 @@ common#:#fold_wizard_page#:#フォルダをコピー(Step 2/2) common#:#folder#:#フォルダ common#:#folders#:#フォルダ common#:#follow_link_to_read_mails#:#メールを読むには次のリンクをクリック: -common#:#force_accept_usr_agreement#:#利用条件を承諾する必要があります! +common#:#force_accept_usr_agreement#:#利用規約を承諾する必要があります! common#:#forgot_password#:#パスワードを忘れた場合は? common#:#forgot_username#:#ユーザIDを忘れた場合は? common#:#form_input_not_valid#:#データの一部が未入力もしくは間違っています。フォーム入力を訂正してください。 @@ -5127,7 +5127,7 @@ common#:#objs_rtst#:#ECSテスト common#:#objs_rwik#:#ECS Wiki common#:#objs_sahs#:#SCORM/AICCラーニングモジュール common#:#objs_sess#:#セッション -common#:#objs_skee#:#Competence Trees###28 11 2023 new variable +common#:#objs_skee#:#Competenceツリー common#:#objs_spl#:#サーベイ質問集 common#:#objs_st#:#章 common#:#objs_svy#:#サーベイ @@ -5776,10 +5776,10 @@ common#:#upload_files#:#ファイルをアップロード common#:#upload_files_title#:#ファイルをアップロード common#:#upload_pending#:#保留 common#:#upload_settings#:#アップロード設定 -common#:#upload_svg_rejection_message#:#An uploaded SVG file contains possibily malicious code and cannot be processed.###14 05 2024 new variable -common#:#upload_svg_rejection_message_base64#:#The file contains base64 encoded content.###14 05 2024 new variable -common#:#upload_svg_rejection_message_elements#:#The file contains elements or attributes which are not allowed or known.###14 05 2024 new variable -common#:#upload_svg_rejection_message_script#:#The file contains script-Elements.###14 05 2024 new variable +common#:#upload_svg_rejection_message#:#アップロードされたSVGファイルには悪意の可能性のあるコードが含まれていて処理できません。 +common#:#upload_svg_rejection_message_base64#:#ファイルにはbase64でコード化されたコンテンツが含まれます。 +common#:#upload_svg_rejection_message_elements#:#ファイルには許可されないまたは未知の要素または属性が含まれます。 +common#:#upload_svg_rejection_message_script#:#Tファイルにはスクリプト要素が含まれます。 common#:#uploaded_and_checked#:#ファイルはアップロードされてチェックされましたので、これからインポートを開始できます。 common#:#uploading#:#アップロード中… common#:#uri#:#URI @@ -5947,12 +5947,12 @@ common#:#wiki_add#:#Wikiに追加 common#:#wiki_new#:#新規Wiki common#:#with#:#with common#:#withdraw_consent#:#承諾を取り消す -common#:#withdraw_consent_description#:#ここで利用規約承諾を取り消します。 +common#:#withdraw_consent_description#:#ここで利用規約を取り消す common#:#withdraw_consent_description_external#:#ソースインストールの戻り解約プロセスを完了するためにもう一度ログインして下さい。 common#:#withdraw_consent_description_internal#:#解約プロセス完了するためにもう一度ログインしてください。 -common#:#withdraw_consent_header#:#利用規約承諾の取り消し -common#:#withdraw_consent_info#:#利用規約承諾を取消します。 -common#:#withdraw_consent_info_external#:#認証システムの管理者へ通知して利用規約承諾の取消する意向を連絡してください。 +common#:#withdraw_consent_header#:#サービス許諾を解約する。 +common#:#withdraw_consent_info#:#利用規約を解約する。 +common#:#withdraw_consent_info_external#:#認証システムの管理者へ通知して利用規約を解約するための意向について連絡してください。 common#:#withdraw_consent_info_internal#:#ここで確認するとアカウントは削除されます。 common#:#withdraw_usr_agreement#:#取り消し common#:#withdrawal_complete#:#完全に承諾を取り下げます。 @@ -6203,7 +6203,7 @@ content#:#cont_char_style_code#:#コード content#:#cont_char_style_com#:#コメント content#:#cont_char_style_quot#:#引用 content#:#cont_characteristic#:#スタイルクラス -content#:#cont_characteristic_table#:#Style Class###14 05 2024 new variable +content#:#cont_characteristic_table#:#Style Class content#:#cont_check_values#:#SCOの送った値をチェック content#:#cont_check_values_info#:#テストツールはSCOからSCORMスタンダードへ準拠する値を送るかどうかをチェックします。SCORMスタンダードは値の保存に関して非常に多くの要求があります。すべての学習モジュールがスタンダード要件を満たしているものではありません。このオプションはモジュールがスタンダードに準拠するか否かをチェックさせます。ILIASがこのモジュールで動作するかどうかの単なるチェックにこのオプションは使用してはいけません。 content#:#cont_choose_characteristic#:#特徴を選択 @@ -6302,7 +6302,7 @@ content#:#cont_dir_file#:#ディレクトリ/ファイル content#:#cont_dir_renamed#:#ディレクトリは名前変更されました。 content#:#cont_disable_def_feedback#:#質問フィードバックを無効 content#:#cont_disable_def_feedback_info#:#無効にすると回答済み問題は学習者へ何もフィードバック表示されなくなります。問題用にカスタムフィードバップを提供する必要があります。 -content#:#cont_double_click_to_delete#:#Double-click on content elements to select them for (de-)activation or deletion.###14 05 2024 new variable +content#:#cont_double_click_to_delete#:#解除または削除を選択するにはコンテンツ要素をダブルクリック content#:#cont_download#:#ダウンロード content#:#cont_download_no_download#:#ダウンロード機能がオンになっていないのでユーザはダウンロードできません。 content#:#cont_download_no_menu#:#ラーニングモジュールメニューがオンになっていないので、ユーザはダウンロードできません。 @@ -7260,7 +7260,7 @@ copg#:#copg_est_reading_time#:#予測読込み時間 copg#:#copg_history_cleanup_cron#:#ページエディター履歴のクリーンアップ copg#:#copg_history_cleanup_cron_info#:#ページ履歴から過去のエントリーを削除 copg#:#copg_more_character_formats#:#文字用の他のスタイル -copg#:#copg_obj_types#:#Object Types###14 05 2024 new variable +copg#:#copg_obj_types#:#オブジェクトタイプ copg#:#copg_page_element_not_found#:#ページ要素が見つかりません。 copg#:#copg_page_type_stys#:#ページをレイアウト copg#:#copg_par_format_selection#:#図書式選択 @@ -7361,8 +7361,8 @@ crs#:#crs_admission_link_failure_offline#:#登録できません: コースは crs#:#crs_admission_link_failure_registration_period#:#登録不可:コースは登録期限を過ぎています。 crs#:#crs_admission_link_success_registration#:#正しくコース"%s"へ登録されました。 crs#:#crs_agree#:#承諾 -crs#:#crs_agreement_header#:#利用条件 -crs#:#crs_agreement_required#:#このコースへの登録には利用条件への承諾が必要です。 +crs#:#crs_agreement_header#:#利用規約 +crs#:#crs_agreement_required#:#このコースへの登録には利用規約への承諾が必要です。 crs#:#crs_at_least_one_admin#:#最低一人のコース管理者が必要です。 crs#:#crs_auto_notification#:#新メンバ用の通知 crs#:#crs_auto_notification_info#:#新メンバはコースへ追加されるとメール通知されます。 @@ -7400,8 +7400,8 @@ crs#:#crs_course_period_not_valid#:#コース期間設定が有効ではあり crs#:#crs_course_status_of_users#:#ユーザの合格状況 crs#:#crs_create_date#:#作成日 crs#:#crs_custom_user_fields#:#関連ユーザデータのコース -crs#:#crs_custom_user_fields_infobox#:#Create additional data fields for course members to fill in when joining. You can show this information as an additional column in the "Members" tab.###08 04 2024 new variable -crs#:#crs_custom_user_fields_table_title#:#Relevant User Data of This Course###25 06 2024 new variable +crs#:#crs_custom_user_fields_infobox#:#参加する際の記入のためにコースメンバー用の追加データフィールドを作成 +crs#:#crs_custom_user_fields_table_title#:#このコースの関連ユーザデータ crs#:#crs_dates#:#日付 crs#:#crs_deactivate_notification#:#通知をオフ crs#:#crs_delete_objectve_sure#:#本当に選択した学習目標を削除しますか? @@ -8829,8 +8829,8 @@ ecs#:#ecs_cms_tree_synchronized#:#ツリーが同期が完了しました。 ecs#:#ecs_communities#:#受講者 ecs#:#ecs_confirm_delete_tree#:#このキャンパス管理ツリーへの全ての割り当てを本当に削除しますか? ecs#:#ecs_connection_settings#:#コネクション設定 -ecs#:#ecs_consent_modal_title#:#Consent for data transfer###08 04 2024 new variable -ecs#:#ecs_consent_reset_confirm_title#:#Reset user consent for this participant###08 04 2024 new variable +ecs#:#ecs_consent_modal_title#:#データ送信の同意 +ecs#:#ecs_consent_reset_confirm_title#:#この参加ユーザ同意をリセット ecs#:#ecs_cron_task_scheduler#:#ECSタスクスケジューラ ecs#:#ecs_cron_task_scheduler_info#:#ECSタスクはスケジューラー設定に沿って実行されます。ECSサーバ構成時に限り必要です。 ecs#:#ecs_crs_alloc#:#コース割当て @@ -8859,16 +8859,16 @@ ecs#:#ecs_err_missing_value#:#入力:属性値をチェックしてください ecs#:#ecs_error_extract_serial#:#証明書のシリアル番号を読み込む事ができません。クライアント証明書のpathをチェックしてください。 ecs#:#ecs_event_appointment#:#イベントログ ecs#:#ecs_export#:#コースリリース -ecs#:#ecs_export_auth_type#:#Authentication method for users with external user attribute###08 04 2024 new variable -ecs#:#ecs_export_auth_type_ilias#:#User authentication via LDAP###08 04 2024 new variable -ecs#:#ecs_export_auth_type_info#:#Please choose the authentication method for users to authenticate via ECS, for whom an external user attribute was transferred via ECS.###08 04 2024 new variable -ecs#:#ecs_export_auth_type_none#:#Do not allow users with external user attribute###08 04 2024 new variable -ecs#:#ecs_export_auth_type_shib#:#User authentication via Shibboleth###08 04 2024 new variable +ecs#:#ecs_export_auth_type#:#外部ユーザ属性を持つユーザ用認証方法 +ecs#:#ecs_export_auth_type_ilias#:#LDAP経由のユーザ認証 +ecs#:#ecs_export_auth_type_info#:#外部ユーザ属性がECS経由で転送されるECS経由のユーザ認証用に認証モードを選択してください。 +ecs#:#ecs_export_auth_type_none#:#外部ユーザ属性をユーザへ許可しない。 +ecs#:#ecs_export_auth_type_shib#:#Shibboleth経由ユーザ認証 ecs#:#ecs_export_created_body_a#:#新コースがリリースされました ecs#:#ecs_export_disabled#:#このコースをリリースしてはいけません ecs#:#ecs_export_enabled#:#このコースをリリース -ecs#:#ecs_export_local_account#:#Local ILIAS accounts###08 04 2024 new variable -ecs#:#ecs_export_local_account_info#:#If enabled, will allow the creation of local accounts via ECS. ECS users without external user attribute will receive a local user account on your installation.###08 04 2024 new variable +ecs#:#ecs_export_local_account#:#ローカルILIASアカウント +ecs#:#ecs_export_local_account_info#:#有効にすると、ECS経由のローカルアカウント作成が許可されます。外部ユーザ属性なしのECSユーザはシステムのローカルユーザアカウントを受領します。 ecs#:#ecs_export_obj_settings#:#コースリリース設定 ecs#:#ecs_export_types#:#エクスポート可のオブジェクトタイプ ecs#:#ecs_field_begin#:#始める @@ -8891,10 +8891,10 @@ ecs#:#ecs_file_export#:#ファイルをリリース ecs#:#ecs_file_export_disabled#:#このファイルをリリースしない ecs#:#ecs_file_export_enabled#:#このファイルをリリース ecs#:#ecs_file_export_obj_settings#:#ファイルリリース設定 -ecs#:#ecs_firstname#:#First name###08 04 2024 new variable -ecs#:#ecs_form_consent#:#Consent###08 04 2024 new variable -ecs#:#ecs_form_consent_option_title#:#I hereby consent to the transfer of the following data to the above-mentioned target system:###08 04 2024 new variable -ecs#:#ecs_form_target_platform#:#Target system###08 04 2024 new variable +ecs#:#ecs_firstname#:#First name +ecs#:#ecs_form_consent#:#同意する +ecs#:#ecs_form_consent_option_title#:#私は、上記のターゲットシステムに対する以下のデータの転送をここに同意します: +ecs#:#ecs_form_target_platform#:#ターゲットシステム ecs#:#ecs_general_info#:#全般情報 ecs#:#ecs_glo_export#:#索引リリース ecs#:#ecs_glo_export_disabled#:#この索引をリリースしない @@ -8907,27 +8907,27 @@ ecs#:#ecs_grp_export_enabled#:#このグループをリリース ecs#:#ecs_grp_export_obj_settings#:#グループリリース設定 ecs#:#ecs_ignore_field#:#この欄の エクスポート/更新 を無効 ecs#:#ecs_import#:#インポート -ecs#:#ecs_import_auth_mode#:#Allow accounts of authentication method %s for transmission via ECS###08 04 2024 new variable -ecs#:#ecs_import_auth_type_default#:#Allow accounts authentication method "Default" for transmission via ECS###08 04 2024 new variable +ecs#:#ecs_import_auth_mode#:#ECS経由の転送用にアカウト認証方式 %s を許可 +ecs#:#ecs_import_auth_type_default#:#ECS経由の転送用にアカウト認証方式"デフォルト"を許可 ecs#:#ecs_import_cms#:#キャンパス管理 ecs#:#ecs_import_id#:#インポート ID ecs#:#ecs_import_id_info#:#新コースリンクが作成される場所のカテゴリIDを入力してください ecs#:#ecs_import_types#:#インポート可のオブジェクトタイプ -ecs#:#ecs_import_user_credentials_by_auth_mode#:#Configuration of authentication methods for transmission via ECS###08 04 2024 new variable -ecs#:#ecs_import_user_credentials_by_auth_mode_info#:#Enable this option to allow accounts of authentication method "Default" to access participant's resources via ECS.###08 04 2024 new variable +ecs#:#ecs_import_user_credentials_by_auth_mode#:#ECS経由の転送用認証方式の構成 +ecs#:#ecs_import_user_credentials_by_auth_mode_info#:#ECS経由の受験者リソースへアクセスさせるためのアカウント認証方式"デフォルト"を許可するにはこのオプションを有効にします。 ecs#:#ecs_imported_content#:#インポートされたE-コンテンツ ecs#:#ecs_imported_from#:#インポート先 -ecs#:#ecs_institution#:#Institution###08 04 2024 new variable +ecs#:#ecs_institution#:#機関 ecs#:#ecs_invalid_import_type_cms#:#キャンパス管理インポートタイプは一度しか選択できません。 ecs#:#ecs_key_password#:#キーパスワード -ecs#:#ecs_lastname#:#Last name###08 04 2024 new variable +ecs#:#ecs_lastname#:#Last name ecs#:#ecs_lm_export#:#ラーニングモジュールリリース ecs#:#ecs_lm_export_disabled#:#このラーニングモジュールをリリースしない ecs#:#ecs_lm_export_enabled#:#このラーニングモジュールをリリース ecs#:#ecs_lm_export_obj_settings#:#ラーニングモジュールリリース設定 ecs#:#ecs_local_information#:#今後の情報 ecs#:#ecs_local_settings#:#ローカル設定 -ecs#:#ecs_login#:#Username or External user account###08 04 2024 new variable +ecs#:#ecs_login#:#ユーザ名または外部ユーザアカウント ecs#:#ecs_mapping_crs#:#コースのマッピング ecs#:#ecs_mapping_exp_tbl#:#ILIAS拡張メタデータをECSデータへマッピング ecs#:#ecs_mapping_rcrs#:#リモートコースのマッピング @@ -8953,8 +8953,8 @@ ecs#:#ecs_node_mapping_status_3#:#マッピングしない ecs#:#ecs_not_configured#:#未構成 ecs#:#ecs_not_published#:#認定が選択されていません。 ecs#:#ecs_notifications#:#通知 -ecs#:#ecs_outgoing_user_credentials#:#User attribute###08 04 2024 new variable -ecs#:#ecs_outgoing_user_credentials_info#:#Please specify which user attribute should be used for transmission. Possible values [Login], [EXTERNAL_ACCOUNT]. You can modify the specified attribute by prepending or appending any strings. Example: [LOGIN]@example.com###08 04 2024 new variable +ecs#:#ecs_outgoing_user_credentials#:#ユーザ属性 +ecs#:#ecs_outgoing_user_credentials_info#:#転送用に使用するユーザ属性を指定してください。利用可能な値は [Login], [EXTERNAL_ACCOUNT]。ストリングへの前追加あるいは後付加により指定属性の変更ができます。例: [LOGIN]@example.com ecs#:#ecs_part_settings#:#受験者設定: ecs#:#ecs_participants#:#受講者 ecs#:#ecs_participants_infos#:#今後の情報 @@ -9510,7 +9510,7 @@ exp#:#exp_scorm#:#SCORM exp#:#exp_show_print_view#:#印刷View表示 exp#:#exp_xml#:#XML exp#:#export_created#:#新しいエクスポートファイルが作成されました。 -exp#:#export_files_deleted#:#The selected export files have been deleted.###28 05 2024 new variable +exp#:#export_files_deleted#:#選択のエクスポートファイルが削除されました。 export#:#export_create#:#作成 export#:#export_create_new_file#:#新規エクスポート ファイルを作成 export#:#export_existing#:#再利用 @@ -9872,7 +9872,7 @@ grp#:#grp_admission_link_failure_registration_period#:#登録不可: グルー grp#:#grp_admission_link_success_registration#:#グループ"%s"へ新しい予定が作成されました。正しく登録されました。 grp#:#grp_agree#:#承諾 grp#:#grp_agreement_header#:#使用許諾書 -grp#:#grp_agreement_required#:#グループコンテンツにアクセスしたい場合は利用条件への承諾が必要です。 +grp#:#grp_agreement_required#:#グループコンテンツにアクセスしたい場合は利用規約への承諾が必要です。 grp#:#grp_already_assigned#:#既に、このグループのメンバーシップリクエストをしています。 grp#:#grp_at_least_one_admin#:#少なくともグループ管理者が一人は必要です。 grp#:#grp_auto_notification#:#新しいメンバー用のWelcome-Mail @@ -9892,8 +9892,8 @@ grp#:#grp_create_new_grp_in#:#%1'内に新区グループを作成 grp#:#grp_create_or_use_existing#:#既存のグループへユーザを追加するか新規グループを追加希望しますか? grp#:#grp_created_and_user_been_added#:#グループの作成とユーザーを追加しました。 grp#:#grp_custom_user_fields#:#関連ユーザデータのグループ -grp#:#grp_custom_user_fields_infobox#:#Create additional data fields for group members to fill in when they join. You can show this information as an additional column in the "Members" tab.###08 04 2024 new variable -grp#:#grp_custom_user_fields_table_title#:#Relevant User Data of This Group###25 06 2024 new variable +grp#:#grp_custom_user_fields_infobox#:#参加する際の記入用にグループメンバーへ記入する追加データフィールドを作成します。この情報は"メンバー”タブ内の追加列に表示できます。 +grp#:#grp_custom_user_fields_table_title#:#このグループの関連ユーザデータ grp#:#grp_deactivate_notification#:#通知をオフ grp#:#grp_edit_members#:#受講者を編集 grp#:#grp_enable_map#:#グループmapを有効 @@ -10560,7 +10560,7 @@ lti#:#conf_user_ident_il_uuid_ext_account#:#メールアドレスでフォーマ lti#:#conf_user_ident_il_uuid_ext_account_info#:#これはコール毎に識別されますが、ユーザに関して直接結論される事を許容される事があります。 lti#:#conf_user_ident_il_uuid_login#:#メールアドレスでフォーマットされたユニークなILIASプラットフォームIDで結合されたILIAS Login lti#:#conf_user_ident_il_uuid_login_info#:#これはコール毎に識別されますが、ILIASユーザに関して直接結論される事を許容される事があります。 -lti#:#conf_user_ident_il_uuid_user_id#:#メールアドレスでフォーマットされたユニークなILIASプラットフォームIDで結合されたILIASユーザID +lti#:#conf_user_ident_il_uuid_user_id#:#メールアドレスでフォーマットされたユニークなILIASプラットフォームIDで結合されたILIASユーザID lti#:#conf_user_ident_il_uuid_user_id_info#:#これはコール毎に識別されますが、ユーザに関して直接結論される事はありません。 lti#:#conf_user_ident_info#:#標準は通常メールアドレスです。ユニークなILIASプラットフォームIDは: lti#:#conf_user_ident_real_email#:#E-Mail Address @@ -10582,18 +10582,18 @@ lti#:#field_provider_xml_info#:#https://www.imsglobal.org/specs/lti/xml 準拠 lti#:#form_import_provider#:#Global Providerをインポート lti#:#gbl_roles_to_users#:#LTIユーザへ割当るグローバル役割 lti#:#global_provider_subtab#:#全ユーザのGlobal Providers -lti#:#grade_activity_progress_all#:#All Information on Activity Progress###08 04 2024 new variable -lti#:#grade_activity_progress_completed#:#Completed###08 04 2024 new variable -lti#:#grade_activity_progress_initialized#:#Initialized###08 04 2024 new variable -lti#:#grade_activity_progress_inprogress#:#In Progress###08 04 2024 new variable -lti#:#grade_activity_progress_started#:#Started###08 04 2024 new variable -lti#:#grade_activity_progress_submitted#:#Submitted###08 04 2024 new variable -lti#:#grade_grading_progress_all#:#All Information on Grading Progress###08 04 2024 new variable -lti#:#grade_grading_progress_failed#:#The Grading could not complete (Failed)###08 04 2024 new variable -lti#:#grade_grading_progress_fullygraded#:#The Grading Process is completed###08 04 2024 new variable -lti#:#grade_grading_progress_notready#:#No Grading Process is occurring (NotReady)###08 04 2024 new variable -lti#:#grade_grading_progress_pending#:#Final Grade is pending###08 04 2024 new variable -lti#:#grade_grading_progress_pendingmanual#:#Final Grade is pending; requires Human Intervention###08 04 2024 new variable +lti#:#grade_activity_progress_all#:#アクティビティ進捗全情報 +lti#:#grade_activity_progress_completed#:#完了 +lti#:#grade_activity_progress_initialized#:#初期化 +lti#:#grade_activity_progress_inprogress#:#進行中 +lti#:#grade_activity_progress_started#:#開始済 +lti#:#grade_activity_progress_submitted#:#提出済 +lti#:#grade_grading_progress_all#:#評価進行中の全情報 +lti#:#grade_grading_progress_failed#:#評価を完了できませんでした。 (Failed) +lti#:#grade_grading_progress_fullygraded#:#評価を完了しました。 +lti#:#grade_grading_progress_notready#:#評価進行中のものはありません。(NotReady) +lti#:#grade_grading_progress_pending#:#最終評価は保留中です。 +lti#:#grade_grading_progress_pendingmanual#:#最終評価保留中; 人的介在必要 lti#:#highscore_achieved_ts#:#Date lti#:#highscore_achieved_ts_description#:#日付の入った列はランキングに含まれます。 lti#:#highscore_all_tables#:#受講者指針のランクとトップランク @@ -10804,13 +10804,13 @@ lti#:#tab_info#:#Info lti#:#tab_scoring#:#ランキング lti#:#tab_settings#:#設定 lti#:#tab_statements#:#学習履歴 -lti#:#tbl_grade_activity_progress#:#Activity Progress###08 04 2024 new variable +lti#:#tbl_grade_activity_progress#:#アクティビティ進捗 lti#:#tbl_grade_actor#:#User lti#:#tbl_grade_date#:#Date -lti#:#tbl_grade_grading_progress#:#Grading Progress###08 04 2024 new variable +lti#:#tbl_grade_grading_progress#:#評価進捗 lti#:#tbl_grade_period#:#期間 lti#:#tbl_grade_score#:#点数 -lti#:#tbl_grade_stored#:#Transmitted to ILIAS###08 04 2024 new variable +lti#:#tbl_grade_stored#:#ILIASへ転送済 lti#:#tbl_lti_prov_all_categories#:#全カテゴリー lti#:#tbl_lti_prov_availability#:#利用期間 lti#:#tbl_lti_prov_category#:#カテゴリー @@ -11126,8 +11126,8 @@ mathjax#:#mathjax_limiter#:#インライン区切り文字 mathjax#:#mathjax_limiter_info#:#MathJaxを有効にする構成するインライン区切り文字を選択します。 mathjax#:#mathjax_mathjax#:#MathJax mathjax#:#mathjax_polyfill_url#:#多角形のURL -mathjax#:#mathjax_polyfill_url_desc_line1#:#For MathJax 2 and MathJax 3 with current browsers not needed. -mathjax#:#mathjax_polyfill_url_desc_line2#:#Please remove any reference to polyfill.io! See https://sansec.io/research/polyfill-supply-chain-attack +mathjax#:#mathjax_polyfill_url_desc_line1#:#MathJax 2 には不要 +mathjax#:#mathjax_polyfill_url_desc_line2#:#MathJax 3の例 https://polyfill.io/v3/polyfill.min.js?features=es6 mathjax#:#mathjax_script_url#:#MathJax ScriptのURL mathjax#:#mathjax_script_url_desc_line1#:#MathJax 2 の例 %s mathjax#:#mathjax_script_url_desc_line2#:#javascriptのMathJaxコードでXSS攻撃を回避するためのセーフモード有効にして下さい。MathJax 2用はCDN urlへ'セーフ'パラメータを追加する事で有効化できます。MathJax 3用はMathjaxを読込む前に構成するスクリプトをincludeする必要があります。例の使用 %s @@ -11159,7 +11159,7 @@ mcst#:#mcst_automatic_detection#:#自動検出 mcst#:#mcst_autoplay#:#Autoplay mcst#:#mcst_autoplay_active#:#Autoplay (Default on) mcst#:#mcst_autoplay_inactive#:#Autoplay (Default off) -mcst#:#mcst_autoplay_info#:#Starts automatically the next video when reaching the end of the previous one. This feature is not supported by youtube videos.###14 05 2024 new variable +mcst#:#mcst_autoplay_info#:#前のものが終了に近づくと次のビデオを自動的に開始します。この機能はYouTubeビデオではサポートされません。 mcst#:#mcst_clear_purpose_title#:#削除 mcst#:#mcst_converted_file#:#ファイルは変換されました。 mcst#:#mcst_copy#:#メディアキャストをコピー @@ -11401,14 +11401,14 @@ meta#:#md_used#:#利用 meta#:#meta_accessibility_restrictions#:#アクセシビリティー規制 meta#:#meta_active#:#アクティブ meta#:#meta_add#:#追加 -meta#:#meta_advmd_select_delete_option#:#Delete This Entry###08 04 2024 new variable -meta#:#meta_advmd_select_first_position_identifier#:#First###08 04 2024 new variable -meta#:#meta_advmd_select_new_option#:#Add New Entry###08 04 2024 new variable -meta#:#meta_advmd_select_option_position#:#Position###08 04 2024 new variable -meta#:#meta_advmd_select_option_value#:#Value###08 04 2024 new variable +meta#:#meta_advmd_select_delete_option#:#このエントリーを削除 +meta#:#meta_advmd_select_first_position_identifier#:#First +meta#:#meta_advmd_select_new_option#:#新しいエントリーを追加 +meta#:#meta_advmd_select_option_position#:#Position +meta#:#meta_advmd_select_option_value#:#Value meta#:#meta_advmd_select_options#:#エントリー -meta#:#meta_advmd_select_options_edit#:#Edit Entries###08 04 2024 new variable -meta#:#meta_advmd_select_position_identifier#:#After %s###08 04 2024 new variable +meta#:#meta_advmd_select_options_edit#:#エントリを編集 +meta#:#meta_advmd_select_position_identifier#:#After %s meta#:#meta_annotation#:#注釈 meta#:#meta_atomic#:#原子 meta#:#meta_author#:#著者 @@ -12083,7 +12083,7 @@ mme#:#type_separator#:#セパレータ mme#:#type_separator_info#:#このアイテムのタイトルはグレイバナーに表示されます。タイトルを未入力の場合は単線が表示されます。 mme#:#type_top_link_item#:#Link mme#:#type_top_parent_item#:#コンテナ -mme#:#unable_to_render#:#Unable to show '%s' in '%s'.###28 05 2024 new variable +mme#:#unable_to_render#:# '%s' in '%s' 表示不可 mob#:#mob_choose_from_pool#:#メディア集から選択 mob#:#mob_external_url#:#外部URL mob#:#mob_file#:#ファイル @@ -12733,7 +12733,7 @@ prg#:#prg_autoassignment#:#(auto) prg#:#prg_belongs_to#:#所有者 prg#:#prg_can_not_manage_in_repo#:#ユーザ割り当ての理由によりこの学習プログラムを管理することは許可されていません。 prg#:#prg_cancel#:#キャンセル -prg#:#prg_cancel_acknowledge_completed_courses#:#Don't acknowledge any Courses###14 05 2024 new variable +prg#:#prg_cancel_acknowledge_completed_courses#:#どのコースへの承認も認めません。 prg#:#prg_cancel_tree_order#:#ツリー順を解除 prg#:#prg_change_deadline#:#締切を変更 prg#:#prg_change_expire_date#:#期限を変更  @@ -13076,7 +13076,7 @@ ps#:#crs_ps_cdf_info#:#今後のコース別データ ps#:#crs_ps_required_info#:#今後のコース別フィールドはコースコンテンツへのアスセスに必要です。 ps#:#grp_ps_cdf_info#:#今後のグループ別データ ps#:#grp_ps_required_info#:#今後のグループ別フィールドはグループコンテンツへのアスセスに必要です。 -ps#:#ps_agreement_accepted#:#利用条件を許諾しました +ps#:#ps_agreement_accepted#:#利用規約を許諾しました ps#:#ps_auto_https#:#HTTPSを自動検知 ps#:#ps_auto_https_description#:#有効にすると、ILIASは下記に示すヘッダー値を分析してHTTPsステータスを検知しようとします。 ps#:#ps_auto_https_header_name#:#ヘッダー名 @@ -13096,7 +13096,7 @@ ps#:#ps_cdf_required#:#必須項目です ps#:#ps_cdf_select_one#:#一つ選択。 ps#:#ps_cdf_type#:#タイプ ps#:#ps_cdf_value#:#値 -ps#:#ps_cdf_warning_modify#:#注意:ユーザの少なくとも一人は利用条件を承諾する必要があります。コース特定の欄を修正すると、全ての利用条件の承諾はリセットされます。 +ps#:#ps_cdf_warning_modify#:#注意:ユーザの少なくとも一人は利用規約を承諾する必要があります。コース特定の欄を修正すると、全ての利用規約の承諾はリセットされます。 ps#:#ps_crs_user_fields#:#コース-別ユーザフィールド ps#:#ps_error_message_https_header_missing#:#https の自動検出を有効にする場合は、ヘッダー名とヘッダーの値を提供しなければなりません。 ps#:#ps_error_message_invalid_login_max_attempts#:#最大ログイン回数が0未満のことがあります。 @@ -13159,7 +13159,7 @@ ps#:#ps_type_select_long#:#選択ボックス(固定値) ps#:#ps_type_text#:#テキストフィールド ps#:#ps_type_txt_long#:#テキストフィールド(オプション値) ps#:#ps_user_selection#:#参加者の選択 -ps#:#ps_warning_modify#:#注意。少なくとも一人が利用条件を許諾する必要があります。設定を変更すると全ての利用条件の許諾をリセットする事になります。 +ps#:#ps_warning_modify#:#注意。少なくとも一人が利用規約を許諾する必要があります。設定を変更すると全ての利用規約の許諾をリセットする事になります。 ps#:#rbac_log#:#アクセス権限ログ ps#:#rbac_log_age#:#ログエントリーを保持 ps#:#rbac_log_age_info#:#月間ログエントリー最高年齢 @@ -14156,8 +14156,8 @@ registration#:#reg_direct#:#直接登録 registration#:#reg_direct_info#:#有効にすると、すべての新規ユーザ登録リクエストは自動承認となります。 registration#:#reg_disabled#:#登録不可 registration#:#reg_domain#:#ドメイン -registration#:#reg_domain_already_assigned_p#:#ドメイン '%s' は他の役割へすでに入力済です。 -registration#:#reg_domain_already_assigned_s#:#ドメイン '%s' は他の役割へすでに入力済です。 +registration#:#reg_domain_already_assigned_p#:#ドメイン '%s' はすでに別の役割で入力されました。 +registration#:#reg_domain_already_assigned_s#:#ドメイン '%s' はすでに別の役割で入力されました。 registration#:#reg_email#:#自動割当て registration#:#reg_email_domains#:#次のemailアドレスドメインは有効です:%s registration#:#reg_email_domains_code#:#登録コード付きのメールアドレスは有効 @@ -14691,7 +14691,7 @@ search#:#search_choose_object_type#:#オブジェクトタイプを一つ選ん search#:#search_content#:#ページコンテンツ search#:#search_created_after#:#後に作成されたオブジェクト search#:#search_created_before#:#. . .以前に作成されたオブジェクト -search#:#search_created_on#:#. . .に作成されたオブジェクト. . . +search#:#search_created_on#:#. . .に作成されたオブジェクト. . . search#:#search_crs_title#:#コース名 search#:#search_details_info#:#詳細検索。1つまたは複数のリソースの種類を選択してください。 search#:#search_direct#:#ダイレクト検索 @@ -15162,7 +15162,7 @@ style#:#sty_add_color#:#カラーを追加 style#:#sty_add_content_style#:#コンテンツスタイルを追加 style#:#sty_add_image#:#イメージを追加 style#:#sty_add_media_query#:#メディアクエリーを追加 -style#:#sty_add_media_query_info#:#例:ブラウザーウインドウが600px以下または印刷機器の"印刷"が "スクリーンのみで(max-width: 600px)" +style#:#sty_add_media_query_info#:#例:ブラウザーウインドウが600px以下または印刷機器の"印刷"が "スクリーンのみで(max-width: 600px)" style#:#sty_add_pgl#:#ページレイアウトを追加 style#:#sty_add_template#:#テンプレートを追加 style#:#sty_added_characteristic#:#スタイルクラスを追加しました。 @@ -16343,8 +16343,8 @@ tbl#:#tbl_template_deleted#:#保全した表示を削除しました。 tbl#:#tbl_templates#:#表示 tos#:#deleteDocument#:#削除 tos#:#detachCriterionAssignment#:#削除 -tos#:#tos_accept_usr_agreement_anonymous#:#Terms of Service###25 06 2024 new variable -tos#:#tos_accept_usr_agreement_anonymous_intro#:#Before you proceed to ILIAS you accept the following Terms of Service.###25 06 2024 new variable +tos#:#tos_accept_usr_agreement_anonymous#:#利用規約 +tos#:#tos_accept_usr_agreement_anonymous_intro#:#ILIAS利用前に次の利用規約を承諾します。 tos#:#tos_acceptance_history#:#承諾履歴 tos#:#tos_account_reg_not_possible#:#ユーザ許諾が無いので自己登録はできません。詳細に関してはシステム管理者へコンタクトしてください。 tos#:#tos_add_document_btn_label#:#ドキュメントを追加 @@ -16686,22 +16686,22 @@ ui#:#datetime_required#:#Time/Dateは必須 ui#:#duration_default_label_end#:#終了 ui#:#duration_default_label_start#:#開始 ui#:#duration_end_must_not_be_earlier_than_start#:#開始は終了よりも遅くできません。 -ui#:#label_fieldselection#:#Field Selection###14 05 2024 new variable -ui#:#label_fieldselection_refresh#:#Apply###14 05 2024 new variable -ui#:#label_pagination_limit#:#Pagination Number of Rows###14 05 2024 new variable -ui#:#label_pagination_offset#:#Pagination Offset###14 05 2024 new variable -ui#:#label_sortation#:#Sortation###14 05 2024 new variable -ui#:#order_option_alphabetical_ascending#:#A to Z###14 05 2024 new variable -ui#:#order_option_alphabetical_descending#:#Z to A###14 05 2024 new variable -ui#:#order_option_chronological_ascending#:#Earliest first###14 05 2024 new variable -ui#:#order_option_chronological_descending#:#Most Recent first###14 05 2024 new variable -ui#:#order_option_first#:#first###14 05 2024 new variable -ui#:#order_option_generic_ascending#:#ascending###14 05 2024 new variable -ui#:#order_option_generic_descending#:#descending###14 05 2024 new variable -ui#:#order_option_numerical_ascending#:#0 to 9###14 05 2024 new variable -ui#:#order_option_numerical_descending#:#9 to 0###14 05 2024 new variable -ui#:#presentation_table_collapse#:#collapse all###14 05 2024 new variable -ui#:#presentation_table_expand#:#expand all###14 05 2024 new variable +ui#:#label_fieldselection#:#フィールド選択 +ui#:#label_fieldselection_refresh#:#適用 +ui#:#label_pagination_limit#:#列のページ数 +ui#:#label_pagination_offset#:#ページ付けオフセット +ui#:#label_sortation#:#ソート +ui#:#order_option_alphabetical_ascending#:#A to Z +ui#:#order_option_alphabetical_descending#:#Z to A +ui#:#order_option_chronological_ascending#:#若い順 +ui#:#order_option_chronological_descending#:#最新順 +ui#:#order_option_first#:#最初 +ui#:#order_option_generic_ascending#:#昇順 +ui#:#order_option_generic_descending#:#降順 +ui#:#order_option_numerical_ascending#:#0 to 9 +ui#:#order_option_numerical_descending#:#9 to 0 +ui#:#presentation_table_collapse#:#全崩壊 +ui#:#presentation_table_expand#:#全展開 ui#:#ui_chars_max#:#Maximum: ui#:#ui_chars_min#:#Minimum: ui#:#ui_chars_remaining#:#残り文字数: @@ -16739,14 +16739,14 @@ user#:#enable_local_user_administration#:#ローカルユーザ管理を使用 user#:#enable_local_user_administration_info#:#有効にするとローカルユーザアカウントはカテゴリ内で管理できます。 user#:#feedhash#:#ニュースフィードハッシュ user#:#has_role#:#役割 -user#:#info_accessFree_sure#:#本当に次のアカウントから有効となっている日までを削除しますか? +user#:#info_accessFree_sure#:#次のアカウントから有効日付までを本当に削除しますか? user#:#inform_user_mail_info#:#有効にするとユーザへメール送信されます。その内容は管理>ユーザ管理> 設定 > 新規アカウントメールの中で定義できます。 user#:#interests#:#興味 user#:#interests_general#:#一般的な興味 user#:#interests_help_looking#:#ヘルプを探す user#:#interests_help_offered#:#ヘルプを提案 user#:#msg_spoint_not_modified#:#開始点未修整 -user#:#no_deactivate_yourself#:#You cannot deactivate your own user account.###28 07 2023 new variable +user#:#no_deactivate_yourself#:#自身のユーザアカウントはアクティブ解除できません。 user#:#obj_ref_id_not_exist#:#入力のReference-IDが存在しません user#:#restrict_user_access#:#ユーザアカウントへの限定アクセス user#:#restrict_user_access_info#:#有効にするとユーザアカウントへのアクセスが制限されます。アクセス権は"ユーザアカウント"と"カテゴリ"の"ローカルユーザアカウントの読み込み”に依存します。 From 6c70e314ba5d7661168244fe8531501d259720e0 Mon Sep 17 00:00:00 2001 From: Releasemanager Date: Tue, 19 Nov 2024 15:14:33 +0000 Subject: [PATCH 229/292] sync language files --- lang/ilias_ar.lang | 7 +++++++ lang/ilias_bg.lang | 7 +++++++ lang/ilias_cs.lang | 7 +++++++ lang/ilias_da.lang | 7 +++++++ lang/ilias_el.lang | 7 +++++++ lang/ilias_es.lang | 7 +++++++ lang/ilias_et.lang | 7 +++++++ lang/ilias_fa.lang | 7 +++++++ lang/ilias_fr.lang | 7 +++++++ lang/ilias_hr.lang | 7 +++++++ lang/ilias_hu.lang | 7 +++++++ lang/ilias_it.lang | 7 +++++++ lang/ilias_ja.lang | 7 +++++++ lang/ilias_ka.lang | 7 +++++++ lang/ilias_lt.lang | 7 +++++++ lang/ilias_nl.lang | 7 +++++++ lang/ilias_pl.lang | 7 +++++++ lang/ilias_pt.lang | 7 +++++++ lang/ilias_ro.lang | 7 +++++++ lang/ilias_ru.lang | 7 +++++++ lang/ilias_sk.lang | 7 +++++++ lang/ilias_sl.lang | 7 +++++++ lang/ilias_sq.lang | 7 +++++++ lang/ilias_sr.lang | 7 +++++++ lang/ilias_sv.lang | 7 +++++++ lang/ilias_tr.lang | 7 +++++++ lang/ilias_uk.lang | 7 +++++++ lang/ilias_vi.lang | 7 +++++++ lang/ilias_zh.lang | 7 +++++++ 29 files changed, 203 insertions(+) diff --git a/lang/ilias_ar.lang b/lang/ilias_ar.lang index c1d0fed6712e..a4675f662d88 100644 --- a/lang/ilias_ar.lang +++ b/lang/ilias_ar.lang @@ -1247,6 +1247,7 @@ assessment#:#test_question_set_type_random_info#:#Each test participant will see assessment#:#test_results#:#Results Options###24 10 2013 new variable assessment#:#test_scoring#:#Scoring Options###24 10 2013 new variable assessment#:#test_template_reset#:#The template has been removed. +assessment#:#test_using_removed_template#:#This test uses a deleted template. Please remove the connection here: %s.###19 11 2024 new variable assessment#:#test_using_template#:#This test uses the template %s. If you do not want to use a template and have access to all settings, please click here: %s. assessment#:#test_using_template_link#:#Do not use template anymore assessment#:#text_correct#:#Correct Text @@ -1285,6 +1286,8 @@ assessment#:#tst_add_quest_cont_edit_mode_IPE#:#Additional Content Editing with assessment#:#tst_add_quest_cont_edit_mode_IPE_info#:#No formatting of text in question and answers. No use of LaTex either. But feedback and hints can be reused when question is embedded in ILIAS learning module.###30 04 2021 new variable assessment#:#tst_add_quest_cont_edit_mode_RTE#:#Default Editing Mode for Additional Question Content###24 10 2013 new variable assessment#:#tst_add_quest_cont_edit_mode_RTE_info#:#Allows text formatting of questions, answers, feedbacks and hints. But feedback and hints cannot be reused when question is embedded in ILIAS learning module.###30 04 2021 new variable +assessment#:#tst_add_quest_cont_edit_mode_plain#:#Use plain text###19 11 2024 new variable +assessment#:#tst_add_quest_cont_edit_mode_plain_info#:#No formatting of text in question, answers, feedback, and hints.###19 11 2024 new variable assessment#:#tst_addit_passes_blocked_after_passed_msg#:#You have passed the test. The test cannot be started again.###07 02 2020 new variable assessment#:#tst_all_test_competences#:#All Test Competence###26 09 2014 new variable assessment#:#tst_all_user_data_deleted#:#All user data of this test has been deleted! @@ -7265,6 +7268,7 @@ copg#:#copg_page_element_not_found#:#Page element not found.###30 04 2021 new va copg#:#copg_page_type_stys#:#Layout Page###30 04 2021 new variable copg#:#copg_par_format_selection#:#Paragraph Format Selection###17 01 2024 new variable copg#:#copg_pc_mob_does_not_exist#:#This media object does not exist.###28 11 2023 new variable +copg#:#copg_plugin_not_avail#:#Plugin %s not available.###19 11 2024 new variable copg#:#copg_questions_not_supported_here#:#Questions are not supported in this context.###07 02 2017 new variable copg#:#copg_reload_page#:#Reload Page###29 06 2022 new variable copg#:#copg_remove_formats#:#Remove Formatting###17 01 2024 new variable @@ -8966,6 +8970,7 @@ ecs#:#ecs_protocol#:#Protocol ecs#:#ecs_publish_as#:#Publish as: ecs#:#ecs_publish_for#:#Release for: ecs#:#ecs_published_for#:#Published for: +ecs#:#ecs_rcat_created_body_a#:#A new ECS Category has been created:###19 11 2024 new variable ecs#:#ecs_rcrs_created_body_a#:#A new Remote Course has been created: ecs#:#ecs_read_remote_links#:#Update Remote-Courses ecs#:#ecs_refresh_participants#:#Refresh ECS-Participants###27 01 2015 new variable @@ -12345,6 +12350,7 @@ obj#:#obj_tool_setting_skills_info#:#Activates competence management and compete obj#:#obj_tool_setting_tag_cloud#:#Tag Cloud###26 09 2014 new variable obj#:#obj_tool_setting_tag_cloud_info#:#The "tag cloud" block will be displayed inside the "Content" tab.###26 09 2014 new variable obj#:#obj_tool_setting_taxonomies#:#Taxonomies###26 09 2014 new variable +obj#:#obj_tool_setting_taxonomies_info#:#Taxonomies allow the filtering of objects. They are created in the "Metadata" tab.###19 11 2024 new variable obj#:#obj_tool_setting_use_news#:#News###25 10 2016 new variable obj#:#obj_tool_setting_use_news_info#:#Activate the news block and/or timeline view.###25 10 2016 new variable obj#:#obj_tool_setting_use_news_open_settings#:#Open Settings###25 10 2016 new variable @@ -16293,6 +16299,7 @@ tagging#:#tagging_enable_all_users_info#:#Adds a section "All Users" to the info tagging#:#tagging_enable_tagging#:#تفعيل العلامات tagging#:#tagging_forbidden_tags#:#Forbidden Tags tagging#:#tagging_no_obj_for_tag#:#No Resources tagged with %s.###09 03 2022 new variable +tagging#:#tagging_no_perm_write#:#You have no permission to change this data.###19 11 2024 new variable tagging#:#tagging_other_users#:#Other Users###26 09 2014 new variable tagging#:#tagging_resources_for_tag#:#Resources tagged with %s tagging#:#tagging_search_users#:#Search Users diff --git a/lang/ilias_bg.lang b/lang/ilias_bg.lang index 8a76c2c2075a..6547c0b989f9 100644 --- a/lang/ilias_bg.lang +++ b/lang/ilias_bg.lang @@ -1247,6 +1247,7 @@ assessment#:#test_question_set_type_random_info#:#Each test participant will see assessment#:#test_results#:#Опции за резултатите assessment#:#test_scoring#:#Възможности за оценяване assessment#:#test_template_reset#:#Шаблонът е премахнат. +assessment#:#test_using_removed_template#:#This test uses a deleted template. Please remove the connection here: %s.###19 11 2024 new variable assessment#:#test_using_template#:#Този тест използва шаблона %s. Ако не искате да използвате шаблон и да имате достъп до всички настройки, щракнете тук: %s. assessment#:#test_using_template_link#:#Не използвайте повече шаблона assessment#:#text_correct#:#Коректен текст @@ -1285,6 +1286,8 @@ assessment#:#tst_add_quest_cont_edit_mode_IPE#:#Допълнително ред assessment#:#tst_add_quest_cont_edit_mode_IPE_info#:#Не се форматира текстът във въпросите и отговорите. Не се използва и LaTex. Но обратната връзка и подсказките могат да се използват повторно, когато въпросът е вграден в учебния модул на ILIAS. assessment#:#tst_add_quest_cont_edit_mode_RTE#:#Режим на редактиране по подразбиране за допълнително съдържание на въпроса assessment#:#tst_add_quest_cont_edit_mode_RTE_info#:#Позволява форматиране на текста на въпросите, отговорите, отзивите и подсказките. Но обратната връзка и подсказките не могат да се използват повторно, когато въпросът е вграден в учебния модул на ILIAS. +assessment#:#tst_add_quest_cont_edit_mode_plain#:#Use plain text###19 11 2024 new variable +assessment#:#tst_add_quest_cont_edit_mode_plain_info#:#No formatting of text in question, answers, feedback, and hints.###19 11 2024 new variable assessment#:#tst_addit_passes_blocked_after_passed_msg#:#Издържахте теста. Тестът не може да бъде стартиран отново. assessment#:#tst_all_test_competences#:#Всички тестови компетентности assessment#:#tst_all_user_data_deleted#:#Всички потребителски данни за този тест бяха изтрити! @@ -7265,6 +7268,7 @@ copg#:#copg_page_element_not_found#:#Елементът на страницат copg#:#copg_page_type_stys#:#Страница за оформление copg#:#copg_par_format_selection#:#Paragraph Format Selection###17 01 2024 new variable copg#:#copg_pc_mob_does_not_exist#:#This media object does not exist.###28 11 2023 new variable +copg#:#copg_plugin_not_avail#:#Plugin %s not available.###19 11 2024 new variable copg#:#copg_questions_not_supported_here#:#Въпросите не се поддържат в този контекст. copg#:#copg_reload_page#:#Презареждане на страницата###22 06 2022 new variable copg#:#copg_remove_formats#:#Remove Formatting###17 01 2024 new variable @@ -8966,6 +8970,7 @@ ecs#:#ecs_protocol#:#Protocol ecs#:#ecs_publish_as#:#Публикувайте като: ecs#:#ecs_publish_for#:#Издаване за: ecs#:#ecs_published_for#:#Публикувано за: +ecs#:#ecs_rcat_created_body_a#:#A new ECS Category has been created:###19 11 2024 new variable ecs#:#ecs_rcrs_created_body_a#:#Създаден е нов дистанционен курс: ecs#:#ecs_read_remote_links#:#Актуализиране на дистанционните курсове ecs#:#ecs_refresh_participants#:#Обновяване на ECS-участниците @@ -12345,6 +12350,7 @@ obj#:#obj_tool_setting_skills_info#:#Активира управлението obj#:#obj_tool_setting_tag_cloud#:#Tag Cloud obj#:#obj_tool_setting_tag_cloud_info#:#Блокът "облак от етикети" ще се показва в раздела "Съдържание". obj#:#obj_tool_setting_taxonomies#:#Таксономии +obj#:#obj_tool_setting_taxonomies_info#:#Taxonomies allow the filtering of objects. They are created in the "Metadata" tab.###19 11 2024 new variable obj#:#obj_tool_setting_use_news#:#Новини obj#:#obj_tool_setting_use_news_info#:#Активиране на блока с новини и/или изгледа на времевата линия. obj#:#obj_tool_setting_use_news_open_settings#:#Настройки за отваряне @@ -16293,6 +16299,7 @@ tagging#:#tagging_enable_all_users_info#:#Прибавя раздел "Всич tagging#:#tagging_enable_tagging#:#Активиране на маркирането tagging#:#tagging_forbidden_tags#:#Забранени етикети tagging#:#tagging_no_obj_for_tag#:#Няма ресурси, маркирани с %s.###16 03 2022 new variable +tagging#:#tagging_no_perm_write#:#You have no permission to change this data.###19 11 2024 new variable tagging#:#tagging_other_users#:#Етикети на други потребители###22 06 2022 new variable tagging#:#tagging_resources_for_tag#:#Ресурси, маркирани с %s tagging#:#tagging_search_users#:#Търсене на потребители###22 06 2022 new variable diff --git a/lang/ilias_cs.lang b/lang/ilias_cs.lang index 6d8fe8f62d69..c49f4e5dc809 100644 --- a/lang/ilias_cs.lang +++ b/lang/ilias_cs.lang @@ -1247,6 +1247,7 @@ assessment#:#test_question_set_type_random_info#:#Each test participant will see assessment#:#test_results#:#Volby výsledků assessment#:#test_scoring#:#Volby hodnocení assessment#:#test_template_reset#:#Šablona byla odstraněna. +assessment#:#test_using_removed_template#:#This test uses a deleted template. Please remove the connection here: %s.###19 11 2024 new variable assessment#:#test_using_template#:#Tento test používá šablonu %s. Pokud nechcete použít tuto šablonu a mít přístup ke všem nastavením, klepněte prosím zde: %s. assessment#:#test_using_template_link#:#Nepoužívat šablonu nikdy více assessment#:#text_correct#:#Opravit text @@ -1285,6 +1286,8 @@ assessment#:#tst_add_quest_cont_edit_mode_IPE#:#Editace dodatečného obsahu s E assessment#:#tst_add_quest_cont_edit_mode_IPE_info#:#No formatting of text in question and answers. No use of LaTex either. But feedback and hints can be reused when question is embedded in ILIAS learning module.###30 04 2021 new variable assessment#:#tst_add_quest_cont_edit_mode_RTE#:#Výchozí editační mód pro dodatečný obsah otázky assessment#:#tst_add_quest_cont_edit_mode_RTE_info#:#Allows text formatting of questions, answers, feedbacks and hints. But feedback and hints cannot be reused when question is embedded in ILIAS learning module.###30 04 2021 new variable +assessment#:#tst_add_quest_cont_edit_mode_plain#:#Use plain text###19 11 2024 new variable +assessment#:#tst_add_quest_cont_edit_mode_plain_info#:#No formatting of text in question, answers, feedback, and hints.###19 11 2024 new variable assessment#:#tst_addit_passes_blocked_after_passed_msg#:#You have passed the test. The test cannot be started again.###07 02 2020 new variable assessment#:#tst_all_test_competences#:#Způsobilost ve všech testech assessment#:#tst_all_user_data_deleted#:#Všechna uživatelská data tohoto testu byly smazány! @@ -7265,6 +7268,7 @@ copg#:#copg_page_element_not_found#:#Page element not found.###30 04 2021 new va copg#:#copg_page_type_stys#:#Layout Page###30 04 2021 new variable copg#:#copg_par_format_selection#:#Paragraph Format Selection###17 01 2024 new variable copg#:#copg_pc_mob_does_not_exist#:#This media object does not exist.###28 11 2023 new variable +copg#:#copg_plugin_not_avail#:#Plugin %s not available.###19 11 2024 new variable copg#:#copg_questions_not_supported_here#:#V tomto kontextu nejsou otázky podporovány. copg#:#copg_reload_page#:#Reload Page###29 06 2022 new variable copg#:#copg_remove_formats#:#Remove Formatting###17 01 2024 new variable @@ -8966,6 +8970,7 @@ ecs#:#ecs_protocol#:#Protokol ecs#:#ecs_publish_as#:#Publikováno jako: ecs#:#ecs_publish_for#:#Uvolněno pro: ecs#:#ecs_published_for#:#Publikováno pro: +ecs#:#ecs_rcat_created_body_a#:#A new ECS Category has been created:###19 11 2024 new variable ecs#:#ecs_rcrs_created_body_a#:#Nový dálkový kurz byl vytvořen: ecs#:#ecs_read_remote_links#:#Aktualizace dálkových kurzů ecs#:#ecs_refresh_participants#:#Obnovit účastníky ECS @@ -12345,6 +12350,7 @@ obj#:#obj_tool_setting_skills_info#:#Aktivuje řízení a přiřazování způso obj#:#obj_tool_setting_tag_cloud#:#Tag Cloud obj#:#obj_tool_setting_tag_cloud_info#:#Na záložce „Obsah“ se zobrazí „tag cloud“. obj#:#obj_tool_setting_taxonomies#:#Taxonomie +obj#:#obj_tool_setting_taxonomies_info#:#Taxonomies allow the filtering of objects. They are created in the "Metadata" tab.###19 11 2024 new variable obj#:#obj_tool_setting_use_news#:#Zprávy obj#:#obj_tool_setting_use_news_info#:#Aktivujte zobrazení bloku zpráv anebo časové osy. obj#:#obj_tool_setting_use_news_open_settings#:#Otevřete Nastavení @@ -16293,6 +16299,7 @@ tagging#:#tagging_enable_all_users_info#:#Přidává sekci "Všichni uživatelé tagging#:#tagging_enable_tagging#:#Zapnout značkování tagging#:#tagging_forbidden_tags#:#Zakázané značky tagging#:#tagging_no_obj_for_tag#:#No Resources tagged with %s.###09 03 2022 new variable +tagging#:#tagging_no_perm_write#:#You have no permission to change this data.###19 11 2024 new variable tagging#:#tagging_other_users#:#Ostatní uživatelé tagging#:#tagging_resources_for_tag#:#Zdroje označeny s %s tagging#:#tagging_search_users#:#Hledat uživatele diff --git a/lang/ilias_da.lang b/lang/ilias_da.lang index 65524e2ca21b..eb2ddb483d6e 100644 --- a/lang/ilias_da.lang +++ b/lang/ilias_da.lang @@ -1247,6 +1247,7 @@ assessment#:#test_question_set_type_random_info#:#Each test participant will see assessment#:#test_results#:#Results Options###16 09 2013 new variable assessment#:#test_scoring#:#Scoring Options###16 09 2013 new variable assessment#:#test_template_reset#:#The template has been removed.###12 06 2011 new variable +assessment#:#test_using_removed_template#:#This test uses a deleted template. Please remove the connection here: %s.###19 11 2024 new variable assessment#:#test_using_template#:#This test uses the template %s. If you do not want to use a template and have access to all settings, please click here: %s.###12 06 2011 new variable assessment#:#test_using_template_link#:#Do not use template anymore###12 06 2011 new variable assessment#:#text_correct#:#Korrekt tekst @@ -1285,6 +1286,8 @@ assessment#:#tst_add_quest_cont_edit_mode_IPE#:#Additional Content Editing with assessment#:#tst_add_quest_cont_edit_mode_IPE_info#:#No formatting of text in question and answers. No use of LaTex either. But feedback and hints can be reused when question is embedded in ILIAS learning module.###30 04 2021 new variable assessment#:#tst_add_quest_cont_edit_mode_RTE#:#Default Editing Mode for Additional Question Content###16 09 2013 new variable assessment#:#tst_add_quest_cont_edit_mode_RTE_info#:#Allows text formatting of questions, answers, feedbacks and hints. But feedback and hints cannot be reused when question is embedded in ILIAS learning module.###30 04 2021 new variable +assessment#:#tst_add_quest_cont_edit_mode_plain#:#Use plain text###19 11 2024 new variable +assessment#:#tst_add_quest_cont_edit_mode_plain_info#:#No formatting of text in question, answers, feedback, and hints.###19 11 2024 new variable assessment#:#tst_addit_passes_blocked_after_passed_msg#:#You have passed the test. The test cannot be started again.###07 02 2020 new variable assessment#:#tst_all_test_competences#:#All Test Competence###26 09 2014 new variable assessment#:#tst_all_user_data_deleted#:#Alle brugerdata for denne test er blevet slettet! @@ -7265,6 +7268,7 @@ copg#:#copg_page_element_not_found#:#Page element not found.###30 04 2021 new va copg#:#copg_page_type_stys#:#Layout Page###30 04 2021 new variable copg#:#copg_par_format_selection#:#Paragraph Format Selection###17 01 2024 new variable copg#:#copg_pc_mob_does_not_exist#:#This media object does not exist.###28 11 2023 new variable +copg#:#copg_plugin_not_avail#:#Plugin %s not available.###19 11 2024 new variable copg#:#copg_questions_not_supported_here#:#Questions are not supported in this context.###07 02 2017 new variable copg#:#copg_reload_page#:#Reload Page###29 06 2022 new variable copg#:#copg_remove_formats#:#Remove Formatting###17 01 2024 new variable @@ -8966,6 +8970,7 @@ ecs#:#ecs_protocol#:#Protocol###23 07 2008 new variable ecs#:#ecs_publish_as#:#Publicer som: ecs#:#ecs_publish_for#:#Release for:###23 07 2008 new variable ecs#:#ecs_published_for#:#Published for:###26 03 2010 new variable +ecs#:#ecs_rcat_created_body_a#:#A new ECS Category has been created:###19 11 2024 new variable ecs#:#ecs_rcrs_created_body_a#:#A new Remote Course has been created:###23 07 2008 new variable ecs#:#ecs_read_remote_links#:#Update Remote-Courses###23 07 2008 new variable ecs#:#ecs_refresh_participants#:#Refresh ECS-Participants###27 01 2015 new variable @@ -12345,6 +12350,7 @@ obj#:#obj_tool_setting_skills_info#:#Activates competence management and compete obj#:#obj_tool_setting_tag_cloud#:#Tag Cloud###26 09 2014 new variable obj#:#obj_tool_setting_tag_cloud_info#:#The "tag cloud" block will be displayed inside the "Content" tab.###26 09 2014 new variable obj#:#obj_tool_setting_taxonomies#:#Taxonomies###26 09 2014 new variable +obj#:#obj_tool_setting_taxonomies_info#:#Taxonomies allow the filtering of objects. They are created in the "Metadata" tab.###19 11 2024 new variable obj#:#obj_tool_setting_use_news#:#News###25 10 2016 new variable obj#:#obj_tool_setting_use_news_info#:#Activate the news block and/or timeline view.###25 10 2016 new variable obj#:#obj_tool_setting_use_news_open_settings#:#Open Settings###25 10 2016 new variable @@ -16293,6 +16299,7 @@ tagging#:#tagging_enable_all_users_info#:#Tilføjer en sektion "Alle brugere" ti tagging#:#tagging_enable_tagging#:#Aktiver tagging tagging#:#tagging_forbidden_tags#:#Ulovlige tags tagging#:#tagging_no_obj_for_tag#:#No Resources tagged with %s.###09 03 2022 new variable +tagging#:#tagging_no_perm_write#:#You have no permission to change this data.###19 11 2024 new variable tagging#:#tagging_other_users#:#Other Users###26 09 2014 new variable tagging#:#tagging_resources_for_tag#:#Resurser tagged med %s tagging#:#tagging_search_users#:#Find brugere diff --git a/lang/ilias_el.lang b/lang/ilias_el.lang index 8f91bba72e24..40442024b821 100644 --- a/lang/ilias_el.lang +++ b/lang/ilias_el.lang @@ -1248,6 +1248,7 @@ assessment#:#test_question_set_type_random_info#:#Each test participant will see assessment#:#test_results#:#Results Options###24 10 2013 new variable assessment#:#test_scoring#:#Scoring Options###24 10 2013 new variable assessment#:#test_template_reset#:#The template has been removed.###12 06 2011 new variable +assessment#:#test_using_removed_template#:#This test uses a deleted template. Please remove the connection here: %s.###19 11 2024 new variable assessment#:#test_using_template#:#This test uses the template %s. If you do not want to use a template and have access to all settings, please click here: %s.###12 06 2011 new variable assessment#:#test_using_template_link#:#Do not use template anymore###12 06 2011 new variable assessment#:#text_correct#:#Correct Text###24 07 2009 new variable @@ -1286,6 +1287,8 @@ assessment#:#tst_add_quest_cont_edit_mode_IPE#:#Additional Content Editing with assessment#:#tst_add_quest_cont_edit_mode_IPE_info#:#No formatting of text in question and answers. No use of LaTex either. But feedback and hints can be reused when question is embedded in ILIAS learning module.###30 04 2021 new variable assessment#:#tst_add_quest_cont_edit_mode_RTE#:#Default Editing Mode for Additional Question Content###24 10 2013 new variable assessment#:#tst_add_quest_cont_edit_mode_RTE_info#:#Allows text formatting of questions, answers, feedbacks and hints. But feedback and hints cannot be reused when question is embedded in ILIAS learning module.###30 04 2021 new variable +assessment#:#tst_add_quest_cont_edit_mode_plain#:#Use plain text###19 11 2024 new variable +assessment#:#tst_add_quest_cont_edit_mode_plain_info#:#No formatting of text in question, answers, feedback, and hints.###19 11 2024 new variable assessment#:#tst_addit_passes_blocked_after_passed_msg#:#You have passed the test. The test cannot be started again.###07 02 2020 new variable assessment#:#tst_all_test_competences#:#All Test Competence###26 09 2014 new variable assessment#:#tst_all_user_data_deleted#:#Όλα τα στοιχεία χρήστη αυτού του διαγωνίσματος έχουν διαγραφεί! @@ -7266,6 +7269,7 @@ copg#:#copg_page_element_not_found#:#Page element not found.###30 04 2021 new va copg#:#copg_page_type_stys#:#Layout Page###30 04 2021 new variable copg#:#copg_par_format_selection#:#Paragraph Format Selection###17 01 2024 new variable copg#:#copg_pc_mob_does_not_exist#:#This media object does not exist.###28 11 2023 new variable +copg#:#copg_plugin_not_avail#:#Plugin %s not available.###19 11 2024 new variable copg#:#copg_questions_not_supported_here#:#Questions are not supported in this context.###07 02 2017 new variable copg#:#copg_reload_page#:#Reload Page###29 06 2022 new variable copg#:#copg_remove_formats#:#Remove Formatting###17 01 2024 new variable @@ -8967,6 +8971,7 @@ ecs#:#ecs_protocol#:#Protocol ecs#:#ecs_publish_as#:#Publish as: ecs#:#ecs_publish_for#:#Release for: ecs#:#ecs_published_for#:#Published for:###26 03 2010 new variable +ecs#:#ecs_rcat_created_body_a#:#A new ECS Category has been created:###19 11 2024 new variable ecs#:#ecs_rcrs_created_body_a#:#A new Remote Course has been created: ecs#:#ecs_read_remote_links#:#Update Remote-Courses ecs#:#ecs_refresh_participants#:#Refresh ECS-Participants###27 01 2015 new variable @@ -12346,6 +12351,7 @@ obj#:#obj_tool_setting_skills_info#:#Activates competence management and compete obj#:#obj_tool_setting_tag_cloud#:#Tag Cloud###26 09 2014 new variable obj#:#obj_tool_setting_tag_cloud_info#:#The "tag cloud" block will be displayed inside the "Content" tab.###26 09 2014 new variable obj#:#obj_tool_setting_taxonomies#:#Taxonomies###26 09 2014 new variable +obj#:#obj_tool_setting_taxonomies_info#:#Taxonomies allow the filtering of objects. They are created in the "Metadata" tab.###19 11 2024 new variable obj#:#obj_tool_setting_use_news#:#News###25 10 2016 new variable obj#:#obj_tool_setting_use_news_info#:#Activate the news block and/or timeline view.###25 10 2016 new variable obj#:#obj_tool_setting_use_news_open_settings#:#Open Settings###25 10 2016 new variable @@ -16294,6 +16300,7 @@ tagging#:#tagging_enable_all_users_info#:#Adds a section "All Users" to the info tagging#:#tagging_enable_tagging#:#Enable Tagging tagging#:#tagging_forbidden_tags#:#Forbidden Tags###18 08 2009 new variable tagging#:#tagging_no_obj_for_tag#:#No Resources tagged with %s.###09 03 2022 new variable +tagging#:#tagging_no_perm_write#:#You have no permission to change this data.###19 11 2024 new variable tagging#:#tagging_other_users#:#Other Users###26 09 2014 new variable tagging#:#tagging_resources_for_tag#:#Resources tagged with %s tagging#:#tagging_search_users#:#Search Users###18 08 2009 new variable diff --git a/lang/ilias_es.lang b/lang/ilias_es.lang index 7e11747bd9a8..bca2b8795dab 100644 --- a/lang/ilias_es.lang +++ b/lang/ilias_es.lang @@ -1249,6 +1249,7 @@ assessment#:#test_question_set_type_random_info#:#Each test participant will see assessment#:#test_results#:#Opciones de los resultados assessment#:#test_scoring#:#Opciones de puntuación assessment#:#test_template_reset#:#La plantilla ha sido eliminada +assessment#:#test_using_removed_template#:#This test uses a deleted template. Please remove the connection here: %s.###19 11 2024 new variable assessment#:#test_using_template#:#Este test utiliza la plantilla %s. Si no desea utilizar una plantilla y tener acceso a todas las configuraciones, haga clic aquí: %s assessment#:#test_using_template_link#:#No usar la plantilla más assessment#:#text_correct#:#Texto Correcto @@ -1287,6 +1288,8 @@ assessment#:#tst_add_quest_cont_edit_mode_IPE#:#Modo de edición simple (sin for assessment#:#tst_add_quest_cont_edit_mode_IPE_info#:#No formatting of text in question and answers. No use of LaTex either. But feedback and hints can be reused when question is embedded in ILIAS learning module.###30 04 2021 new variable assessment#:#tst_add_quest_cont_edit_mode_RTE#:#Modo de edición avanzado (con formato de texto) para el contenido de las preguntas assessment#:#tst_add_quest_cont_edit_mode_RTE_info#:#Allows text formatting of questions, answers, feedbacks and hints. But feedback and hints cannot be reused when question is embedded in ILIAS learning module.###30 04 2021 new variable +assessment#:#tst_add_quest_cont_edit_mode_plain#:#Use plain text###19 11 2024 new variable +assessment#:#tst_add_quest_cont_edit_mode_plain_info#:#No formatting of text in question, answers, feedback, and hints.###19 11 2024 new variable assessment#:#tst_addit_passes_blocked_after_passed_msg#:#You have passed the test. The test cannot be started again.###07 02 2020 new variable assessment#:#tst_all_test_competences#:#Competencias de todos los Tests assessment#:#tst_all_user_data_deleted#:#Todos los datos de usuario de este test han sido eliminados! @@ -7267,6 +7270,7 @@ copg#:#copg_page_element_not_found#:#Page element not found.###30 04 2021 new va copg#:#copg_page_type_stys#:#Layout Page###30 04 2021 new variable copg#:#copg_par_format_selection#:#Paragraph Format Selection###17 01 2024 new variable copg#:#copg_pc_mob_does_not_exist#:#This media object does not exist.###28 11 2023 new variable +copg#:#copg_plugin_not_avail#:#Plugin %s not available.###19 11 2024 new variable copg#:#copg_questions_not_supported_here#:#En este contexto no se admiten preguntas. copg#:#copg_reload_page#:#Reload Page###29 06 2022 new variable copg#:#copg_remove_formats#:#Remove Formatting###17 01 2024 new variable @@ -8968,6 +8972,7 @@ ecs#:#ecs_protocol#:#Protocolo ecs#:#ecs_publish_as#:#Publicado por: ecs#:#ecs_publish_for#:#Release: ecs#:#ecs_published_for#:#Publicado para +ecs#:#ecs_rcat_created_body_a#:#A new ECS Category has been created:###19 11 2024 new variable ecs#:#ecs_rcrs_created_body_a#:#Un nuevo curso remoto ha sido creado: ecs#:#ecs_read_remote_links#:#Actualizar cursos remotos ecs#:#ecs_refresh_participants#:#Actualizar Participantes ECS @@ -12347,6 +12352,7 @@ obj#:#obj_tool_setting_skills_info#:#Activa la gestión de competencias y la asi obj#:#obj_tool_setting_tag_cloud#:#Nube de etiquetas obj#:#obj_tool_setting_tag_cloud_info#:#Se mostrará el bloque "Nube de etiquetas" en la parte derecha de la pestaña "Contenido". obj#:#obj_tool_setting_taxonomies#:#Taxonomías +obj#:#obj_tool_setting_taxonomies_info#:#Taxonomies allow the filtering of objects. They are created in the "Metadata" tab.###19 11 2024 new variable obj#:#obj_tool_setting_use_news#:#Noticias obj#:#obj_tool_setting_use_news_info#:#Active el bloque de noticias y/o la vista de calendario. obj#:#obj_tool_setting_use_news_open_settings#:#Abrir configuración @@ -16295,6 +16301,7 @@ tagging#:#tagging_enable_all_users_info#:#Agrega una sección "Todos los usuario tagging#:#tagging_enable_tagging#:#Habilitar Etiquetas tagging#:#tagging_forbidden_tags#:#Etiquetas Prohibidas tagging#:#tagging_no_obj_for_tag#:#No Resources tagged with %s.###09 03 2022 new variable +tagging#:#tagging_no_perm_write#:#You have no permission to change this data.###19 11 2024 new variable tagging#:#tagging_other_users#:#Other Users tagging#:#tagging_resources_for_tag#:#Recursos etiquetados con %s tagging#:#tagging_search_users#:#Buscar usuarios diff --git a/lang/ilias_et.lang b/lang/ilias_et.lang index c2804f1ffee3..c6b8ed856ad6 100644 --- a/lang/ilias_et.lang +++ b/lang/ilias_et.lang @@ -1247,6 +1247,7 @@ assessment#:#test_question_set_type_random_info#:#Each test participant will see assessment#:#test_results#:#Results Options assessment#:#test_scoring#:#Scoring Options assessment#:#test_template_reset#:#Mall on eemaldatud. +assessment#:#test_using_removed_template#:#This test uses a deleted template. Please remove the connection here: %s.###19 11 2024 new variable assessment#:#test_using_template#:#See test kasutab malli %s. Kui te ei soovi seda malli kasutada ning soovite juurdepääsu seadetele, klikkige siin: %s. assessment#:#test_using_template_link#:#Ära malli enam kasuta assessment#:#text_correct#:#Korrektne tekst @@ -1285,6 +1286,8 @@ assessment#:#tst_add_quest_cont_edit_mode_IPE#:#Additional Content Editing with assessment#:#tst_add_quest_cont_edit_mode_IPE_info#:#No formatting of text in question and answers. No use of LaTex either. But feedback and hints can be reused when question is embedded in ILIAS learning module.###30 04 2021 new variable assessment#:#tst_add_quest_cont_edit_mode_RTE#:#Default Editing Mode for Additional Question Content assessment#:#tst_add_quest_cont_edit_mode_RTE_info#:#Allows text formatting of questions, answers, feedbacks and hints. But feedback and hints cannot be reused when question is embedded in ILIAS learning module.###30 04 2021 new variable +assessment#:#tst_add_quest_cont_edit_mode_plain#:#Use plain text###19 11 2024 new variable +assessment#:#tst_add_quest_cont_edit_mode_plain_info#:#No formatting of text in question, answers, feedback, and hints.###19 11 2024 new variable assessment#:#tst_addit_passes_blocked_after_passed_msg#:#You have passed the test. The test cannot be started again.###07 02 2020 new variable assessment#:#tst_all_test_competences#:#All Test Competence assessment#:#tst_all_user_data_deleted#:#Kõik selle testi kasutajaandmed on kustutatud! @@ -7265,6 +7268,7 @@ copg#:#copg_page_element_not_found#:#Page element not found.###30 04 2021 new va copg#:#copg_page_type_stys#:#Layout Page###30 04 2021 new variable copg#:#copg_par_format_selection#:#Paragraph Format Selection###17 01 2024 new variable copg#:#copg_pc_mob_does_not_exist#:#This media object does not exist.###28 11 2023 new variable +copg#:#copg_plugin_not_avail#:#Plugin %s not available.###19 11 2024 new variable copg#:#copg_questions_not_supported_here#:#Questions are not supported in this context.###07 02 2017 new variable copg#:#copg_reload_page#:#Reload Page###29 06 2022 new variable copg#:#copg_remove_formats#:#Remove Formatting###17 01 2024 new variable @@ -8966,6 +8970,7 @@ ecs#:#ecs_protocol#:#Protocol ecs#:#ecs_publish_as#:#Publitseeri kui: ecs#:#ecs_publish_for#:#Versiooniuuendus: ecs#:#ecs_published_for#:#Publitseeritud: +ecs#:#ecs_rcat_created_body_a#:#A new ECS Category has been created:###19 11 2024 new variable ecs#:#ecs_rcrs_created_body_a#:#A new Remote Course has been created: ecs#:#ecs_read_remote_links#:#Update Remote-Courses ecs#:#ecs_refresh_participants#:#Refresh ECS-Participants @@ -12345,6 +12350,7 @@ obj#:#obj_tool_setting_skills_info#:#Activates competence management and compete obj#:#obj_tool_setting_tag_cloud#:#Tag Cloud obj#:#obj_tool_setting_tag_cloud_info#:#The "tag cloud" block will be displayed inside the "Content" tab. obj#:#obj_tool_setting_taxonomies#:#Taxonomies +obj#:#obj_tool_setting_taxonomies_info#:#Taxonomies allow the filtering of objects. They are created in the "Metadata" tab.###19 11 2024 new variable obj#:#obj_tool_setting_use_news#:#News###25 10 2016 new variable obj#:#obj_tool_setting_use_news_info#:#Activate the news block and/or timeline view.###25 10 2016 new variable obj#:#obj_tool_setting_use_news_open_settings#:#Open Settings###25 10 2016 new variable @@ -16293,6 +16299,7 @@ tagging#:#tagging_enable_all_users_info#:#Lisab infoväljale sektsiooni "Kõik k tagging#:#tagging_enable_tagging#:#Võimalda märgendamine tagging#:#tagging_forbidden_tags#:#Keela sildid tagging#:#tagging_no_obj_for_tag#:#No Resources tagged with %s.###09 03 2022 new variable +tagging#:#tagging_no_perm_write#:#You have no permission to change this data.###19 11 2024 new variable tagging#:#tagging_other_users#:#Other Users tagging#:#tagging_resources_for_tag#:#Allikad, mis on märgendatud sõnaga %s tagging#:#tagging_search_users#:#Otsi kasutajaid diff --git a/lang/ilias_fa.lang b/lang/ilias_fa.lang index 983f52dd9b0a..0427d4dc953b 100644 --- a/lang/ilias_fa.lang +++ b/lang/ilias_fa.lang @@ -1247,6 +1247,7 @@ assessment#:#test_question_set_type_random_info#:#Each test participant will see assessment#:#test_results#:#Results Options###24 10 2013 new variable assessment#:#test_scoring#:#Scoring Options###24 10 2013 new variable assessment#:#test_template_reset#:#The template has been removed. +assessment#:#test_using_removed_template#:#This test uses a deleted template. Please remove the connection here: %s.###19 11 2024 new variable assessment#:#test_using_template#:#This test uses the template %s. If you do not want to use a template and have access to all settings, please click here: %s. assessment#:#test_using_template_link#:#Do not use template anymore assessment#:#text_correct#:#Correct Text @@ -1285,6 +1286,8 @@ assessment#:#tst_add_quest_cont_edit_mode_IPE#:#Additional Content Editing with assessment#:#tst_add_quest_cont_edit_mode_IPE_info#:#No formatting of text in question and answers. No use of LaTex either. But feedback and hints can be reused when question is embedded in ILIAS learning module.###30 04 2021 new variable assessment#:#tst_add_quest_cont_edit_mode_RTE#:#Default Editing Mode for Additional Question Content###24 10 2013 new variable assessment#:#tst_add_quest_cont_edit_mode_RTE_info#:#Allows text formatting of questions, answers, feedbacks and hints. But feedback and hints cannot be reused when question is embedded in ILIAS learning module.###30 04 2021 new variable +assessment#:#tst_add_quest_cont_edit_mode_plain#:#Use plain text###19 11 2024 new variable +assessment#:#tst_add_quest_cont_edit_mode_plain_info#:#No formatting of text in question, answers, feedback, and hints.###19 11 2024 new variable assessment#:#tst_addit_passes_blocked_after_passed_msg#:#You have passed the test. The test cannot be started again.###07 02 2020 new variable assessment#:#tst_all_test_competences#:#All Test Competence###26 09 2014 new variable assessment#:#tst_all_user_data_deleted#:#All user data of this test has been deleted! @@ -7265,6 +7268,7 @@ copg#:#copg_page_element_not_found#:#Page element not found.###30 04 2021 new va copg#:#copg_page_type_stys#:#Layout Page###30 04 2021 new variable copg#:#copg_par_format_selection#:#Paragraph Format Selection###17 01 2024 new variable copg#:#copg_pc_mob_does_not_exist#:#This media object does not exist.###28 11 2023 new variable +copg#:#copg_plugin_not_avail#:#Plugin %s not available.###19 11 2024 new variable copg#:#copg_questions_not_supported_here#:#Questions are not supported in this context.###07 02 2017 new variable copg#:#copg_reload_page#:#Reload Page###29 06 2022 new variable copg#:#copg_remove_formats#:#Remove Formatting###17 01 2024 new variable @@ -8966,6 +8970,7 @@ ecs#:#ecs_protocol#:#Protocol ecs#:#ecs_publish_as#:#Publish as: ecs#:#ecs_publish_for#:#Release for: ecs#:#ecs_published_for#:#Published for: +ecs#:#ecs_rcat_created_body_a#:#A new ECS Category has been created:###19 11 2024 new variable ecs#:#ecs_rcrs_created_body_a#:#A new Remote Course has been created: ecs#:#ecs_read_remote_links#:#Update Remote-Courses ecs#:#ecs_refresh_participants#:#Refresh ECS-Participants###27 01 2015 new variable @@ -12345,6 +12350,7 @@ obj#:#obj_tool_setting_skills_info#:#Activates competence management and compete obj#:#obj_tool_setting_tag_cloud#:#Tag Cloud###26 09 2014 new variable obj#:#obj_tool_setting_tag_cloud_info#:#The "tag cloud" block will be displayed inside the "Content" tab.###26 09 2014 new variable obj#:#obj_tool_setting_taxonomies#:#Taxonomies###26 09 2014 new variable +obj#:#obj_tool_setting_taxonomies_info#:#Taxonomies allow the filtering of objects. They are created in the "Metadata" tab.###19 11 2024 new variable obj#:#obj_tool_setting_use_news#:#News###25 10 2016 new variable obj#:#obj_tool_setting_use_news_info#:#Activate the news block and/or timeline view.###25 10 2016 new variable obj#:#obj_tool_setting_use_news_open_settings#:#Open Settings###25 10 2016 new variable @@ -16293,6 +16299,7 @@ tagging#:#tagging_enable_all_users_info#:#یک قسمت با عنوان "همه tagging#:#tagging_enable_tagging#:#فعال کردن برچسب گذاری tagging#:#tagging_forbidden_tags#:#برچسبهای ممنوع tagging#:#tagging_no_obj_for_tag#:#No Resources tagged with %s.###09 03 2022 new variable +tagging#:#tagging_no_perm_write#:#You have no permission to change this data.###19 11 2024 new variable tagging#:#tagging_other_users#:#Other Users###26 09 2014 new variable tagging#:#tagging_resources_for_tag#:#منابع با برچسب %s گذاری شدند tagging#:#tagging_search_users#:#جستجوی کاربران diff --git a/lang/ilias_fr.lang b/lang/ilias_fr.lang index 5614b6aeeb57..1ac8534e4a18 100644 --- a/lang/ilias_fr.lang +++ b/lang/ilias_fr.lang @@ -1247,6 +1247,7 @@ assessment#:#test_question_set_type_random_info#:#Each test participant will see assessment#:#test_results#:#Options de Résultats assessment#:#test_scoring#:#Options de Notation assessment#:#test_template_reset#:#Le modèle de paramétrage a été retiré. +assessment#:#test_using_removed_template#:#This test uses a deleted template. Please remove the connection here: %s.###19 11 2024 new variable assessment#:#test_using_template#:#Ce test utilise le modèle de paramétrage : %s.
Si vous ne souhaitez plus utiliser de modèle de paramétrage et avoir accès à la totalité des réglages, cliquez sur le lien : %s. assessment#:#test_using_template_link#:#Ne plus utiliser de modèle de paramétrage assessment#:#text_correct#:#Texte correct @@ -1285,6 +1286,8 @@ assessment#:#tst_add_quest_cont_edit_mode_IPE#:#Edition de Contenu Supplémentai assessment#:#tst_add_quest_cont_edit_mode_IPE_info#:#No formatting of text in question and answers. No use of LaTex either. But feedback and hints can be reused when question is embedded in ILIAS learning module. assessment#:#tst_add_quest_cont_edit_mode_RTE#:#Mode d'Edition par Défaut pour Contenu Additionnel assessment#:#tst_add_quest_cont_edit_mode_RTE_info#:#Allows text formatting of questions, answers, feedbacks and hints. But feedback and hints cannot be reused when question is embedded in ILIAS learning module. +assessment#:#tst_add_quest_cont_edit_mode_plain#:#Use plain text###19 11 2024 new variable +assessment#:#tst_add_quest_cont_edit_mode_plain_info#:#No formatting of text in question, answers, feedback, and hints.###19 11 2024 new variable assessment#:#tst_addit_passes_blocked_after_passed_msg#:#You have passed the test. The test cannot be started again. assessment#:#tst_all_test_competences#:#Tous les tests de compétence assessment#:#tst_all_user_data_deleted#:#Toutes les données utilisateur de ce test ont été détruites @@ -7265,6 +7268,7 @@ copg#:#copg_page_element_not_found#:#Page element not found. copg#:#copg_page_type_stys#:#Layout Page copg#:#copg_par_format_selection#:#Paragraph Format Selection###17 01 2024 new variable copg#:#copg_pc_mob_does_not_exist#:#This media object does not exist.###28 11 2023 new variable +copg#:#copg_plugin_not_avail#:#Plugin %s not available.###19 11 2024 new variable copg#:#copg_questions_not_supported_here#:#Les questions ne sont pas supportées dans ce contexte. copg#:#copg_reload_page#:#Reload Page copg#:#copg_remove_formats#:#Remove Formatting###17 01 2024 new variable @@ -8966,6 +8970,7 @@ ecs#:#ecs_protocol#:#Protocole ecs#:#ecs_publish_as#:#Publié comme : ecs#:#ecs_publish_for#:#Mettre à jour pour : ecs#:#ecs_published_for#:#Publié pour : +ecs#:#ecs_rcat_created_body_a#:#A new ECS Category has been created:###19 11 2024 new variable ecs#:#ecs_rcrs_created_body_a#:#Un nouveau cours à distance a été créé : ecs#:#ecs_read_remote_links#:#Mettre à jour cours à distance ecs#:#ecs_refresh_participants#:#Rafraîchir les participants ECS @@ -12345,6 +12350,7 @@ obj#:#obj_tool_setting_skills_info#:#Active une gestion des compétences et des obj#:#obj_tool_setting_tag_cloud#:#Marquer Cloud obj#:#obj_tool_setting_tag_cloud_info#:#The "tag cloud" block will be displayed inside the "Content" tab. obj#:#obj_tool_setting_taxonomies#:#Taxonomies +obj#:#obj_tool_setting_taxonomies_info#:#Taxonomies allow the filtering of objects. They are created in the "Metadata" tab.###19 11 2024 new variable obj#:#obj_tool_setting_use_news#:#Nouvelles obj#:#obj_tool_setting_use_news_info#:#Activer le bloc de nouvelles et/ou la vue chronologique. obj#:#obj_tool_setting_use_news_open_settings#:#Ouvrir les paramètres @@ -16293,6 +16299,7 @@ tagging#:#tagging_enable_all_users_info#:#Ajouter une section "Tous utilisateurs tagging#:#tagging_enable_tagging#:#Activer Tagging tagging#:#tagging_forbidden_tags#:#Tags interdits tagging#:#tagging_no_obj_for_tag#:#No Resources tagged with %s. +tagging#:#tagging_no_perm_write#:#You have no permission to change this data.###19 11 2024 new variable tagging#:#tagging_other_users#:#Other Users tagging#:#tagging_resources_for_tag#:#Ressources taggées avec %s tagging#:#tagging_search_users#:#Rechercher utilisateurs diff --git a/lang/ilias_hr.lang b/lang/ilias_hr.lang index dfd2b30fdc1b..fd8949a9cd03 100644 --- a/lang/ilias_hr.lang +++ b/lang/ilias_hr.lang @@ -1247,6 +1247,7 @@ assessment#:#test_question_set_type_random_info#:#Each test participant will see assessment#:#test_results#:#Objava rezultata testa assessment#:#test_scoring#:#Ocjenjivanje testa assessment#:#test_template_reset#:#Predložak je uklonjen. +assessment#:#test_using_removed_template#:#This test uses a deleted template. Please remove the connection here: %s.###19 11 2024 new variable assessment#:#test_using_template#:#Ovaj test koristi predložak %s. Ako ne želite koristiti predložak te želite imati pristup svim postavkama, kliknite ovdje: %s. assessment#:#test_using_template_link#:#Ne koristite predložak više assessment#:#text_correct#:#Ispravan tekst @@ -1285,6 +1286,8 @@ assessment#:#tst_add_quest_cont_edit_mode_IPE#:#Za uređivanje povratnih informa assessment#:#tst_add_quest_cont_edit_mode_IPE_info#:#No formatting of text in question and answers. No use of LaTex either. But feedback and hints can be reused when question is embedded in ILIAS learning module.###04 06 2021 new variable assessment#:#tst_add_quest_cont_edit_mode_RTE#:#Za uređivanje povratnih informacija i savjeta koristite urednika rich-text assessment#:#tst_add_quest_cont_edit_mode_RTE_info#:#Allows text formatting of questions, answers, feedbacks and hints. But feedback and hints cannot be reused when question is embedded in ILIAS learning module.###04 06 2021 new variable +assessment#:#tst_add_quest_cont_edit_mode_plain#:#Use plain text###19 11 2024 new variable +assessment#:#tst_add_quest_cont_edit_mode_plain_info#:#No formatting of text in question, answers, feedback, and hints.###19 11 2024 new variable assessment#:#tst_addit_passes_blocked_after_passed_msg#:#You have passed the test. The test cannot be started again.###04 06 2021 new variable assessment#:#tst_all_test_competences#:#Sva kompetencije testa assessment#:#tst_all_user_data_deleted#:#Svi korisnički podaci ovog testa su uklonjeni! @@ -7265,6 +7268,7 @@ copg#:#copg_page_element_not_found#:#Page element not found.###04 06 2021 new va copg#:#copg_page_type_stys#:#Layout Page###04 06 2021 new variable copg#:#copg_par_format_selection#:#Paragraph Format Selection###17 01 2024 new variable copg#:#copg_pc_mob_does_not_exist#:#This media object does not exist.###28 11 2023 new variable +copg#:#copg_plugin_not_avail#:#Plugin %s not available.###19 11 2024 new variable copg#:#copg_questions_not_supported_here#:#Pitanja nisu podržana u ovom kontekstu. copg#:#copg_reload_page#:#Reload Page###29 06 2022 new variable copg#:#copg_remove_formats#:#Remove Formatting###17 01 2024 new variable @@ -8966,6 +8970,7 @@ ecs#:#ecs_protocol#:#Protocol ecs#:#ecs_publish_as#:#Publish as: ecs#:#ecs_publish_for#:#Release for: ecs#:#ecs_published_for#:#Published for: +ecs#:#ecs_rcat_created_body_a#:#A new ECS Category has been created:###19 11 2024 new variable ecs#:#ecs_rcrs_created_body_a#:#A new ECS Course has been created: ecs#:#ecs_read_remote_links#:#Update ECS Courses ecs#:#ecs_refresh_participants#:#Refresh ECS-Participants @@ -12345,6 +12350,7 @@ obj#:#obj_tool_setting_skills_info#:#Aktivira upravljanje kompetencijama i dodje obj#:#obj_tool_setting_tag_cloud#:#Oznaka oblaka obj#:#obj_tool_setting_tag_cloud_info#:#Blok ‘Oznaka oblaka’ prikazat će se unutar kartice ‘Sadržaj’. obj#:#obj_tool_setting_taxonomies#:#Taksonomije +obj#:#obj_tool_setting_taxonomies_info#:#Taxonomies allow the filtering of objects. They are created in the "Metadata" tab.###19 11 2024 new variable obj#:#obj_tool_setting_use_news#:#Vijesti obj#:#obj_tool_setting_use_news_info#:#Aktiviraj blok vijesti i/ili prikaz vremenske trake. obj#:#obj_tool_setting_use_news_open_settings#:#Otvori postavke @@ -16293,6 +16299,7 @@ tagging#:#tagging_enable_all_users_info#:#Adds a section ‘All Users’ to the tagging#:#tagging_enable_tagging#:#Enable Tagging tagging#:#tagging_forbidden_tags#:#Forbidden Tags tagging#:#tagging_no_obj_for_tag#:#No Resources tagged with %s.###09 03 2022 new variable +tagging#:#tagging_no_perm_write#:#You have no permission to change this data.###19 11 2024 new variable tagging#:#tagging_other_users#:#Tags of Other Users tagging#:#tagging_resources_for_tag#:#Resources tagged with %s tagging#:#tagging_search_users#:#Search Users diff --git a/lang/ilias_hu.lang b/lang/ilias_hu.lang index f0f504d8426b..98fcc88c7367 100644 --- a/lang/ilias_hu.lang +++ b/lang/ilias_hu.lang @@ -1262,6 +1262,7 @@ assessment#:#test_question_set_type_random_info#:#Minden tesztkitöltő egyéni assessment#:#test_results#:#Teszteredmények összefoglalója assessment#:#test_scoring#:#Pontozási beállítások assessment#:#test_template_reset#:#A sablont sikeresen eltávolította. +assessment#:#test_using_removed_template#:#This test uses a deleted template. Please remove the connection here: %s.###19 11 2024 new variable assessment#:#test_using_template#:#A teszt ezt a sablont használja: %s. Ha nem szeretne sablont használni a teszthez, és már vannak beállításai, kattintson ide: %s. assessment#:#test_using_template_link#:#Ne használjon a továbbiakban sablont assessment#:#text_correct#:#Helyes szöveg @@ -1300,6 +1301,8 @@ assessment#:#tst_add_quest_cont_edit_mode_IPE#:#Egyszerű szöveg használata k assessment#:#tst_add_quest_cont_edit_mode_IPE_info#:#A kérdések és a válaszok nem formázható szövegek. LaTex sem használható. Viszont a visszajelzések és a tippek újra felhasználhatóak, ha kérdés beágyazott az ILIAS-tananyagban. assessment#:#tst_add_quest_cont_edit_mode_RTE#:#Use Rich-Text-Editor (TinyMCE) for editing questions and answers, feedbacks and hints###26 04 2023 new variable assessment#:#tst_add_quest_cont_edit_mode_RTE_info#:#A kérdések, a válaszok, a visszajelzések és a tippek formázható szövegek. Viszont a visszajelzések és a tippek nem használhatóak fel újra, ha kérdés beágyazott az ILIAS-tananyagban. +assessment#:#tst_add_quest_cont_edit_mode_plain#:#Use plain text###19 11 2024 new variable +assessment#:#tst_add_quest_cont_edit_mode_plain_info#:#No formatting of text in question, answers, feedback, and hints.###19 11 2024 new variable assessment#:#tst_addit_passes_blocked_after_passed_msg#:#A tesztet sikeresen kitöltötte, több kitöltést nem indíthat el. assessment#:#tst_all_test_competences#:#Összes tesztkompetencia assessment#:#tst_all_user_data_deleted#:#Ennek a tesztnek minden felhasználói adatát sikeresen eltávolította. @@ -7280,6 +7283,7 @@ copg#:#copg_page_element_not_found#:#Az oldalelem nem található. copg#:#copg_page_type_stys#:#Lapelrendezés copg#:#copg_par_format_selection#:#Paragraph Format Selection###17 01 2024 new variable copg#:#copg_pc_mob_does_not_exist#:#This media object does not exist.###28 11 2023 new variable +copg#:#copg_plugin_not_avail#:#Plugin %s not available.###19 11 2024 new variable copg#:#copg_questions_not_supported_here#:#Ebben a kontextusban a kérdéseket nem támogatjuk. copg#:#copg_reload_page#:#Reload Page###29 06 2022 new variable copg#:#copg_remove_formats#:#Remove Formatting###17 01 2024 new variable @@ -8981,6 +8985,7 @@ ecs#:#ecs_protocol#:#Protokoll ecs#:#ecs_publish_as#:#Közzététel mint: ecs#:#ecs_publish_for#:#Kibocsátás ennek: ecs#:#ecs_published_for#:#Publikálva neki: +ecs#:#ecs_rcat_created_body_a#:#A new ECS Category has been created:###19 11 2024 new variable ecs#:#ecs_rcrs_created_body_a#:#Új ECS-kurzus jött létre: ecs#:#ecs_read_remote_links#:#ECS-kurzusok frissítése ecs#:#ecs_refresh_participants#:#ECS-résztvevők frissítése @@ -12360,6 +12365,7 @@ obj#:#obj_tool_setting_skills_info#:#Aktiválja a kompetenciamenedzsmentet és a obj#:#obj_tool_setting_tag_cloud#:#Címkefelhő obj#:#obj_tool_setting_tag_cloud_info#:#'Címkefelhő' blokk megjelenik a 'Tartalom' fül alatt. obj#:#obj_tool_setting_taxonomies#:#Taxonómiák +obj#:#obj_tool_setting_taxonomies_info#:#Taxonomies allow the filtering of objects. They are created in the "Metadata" tab.###19 11 2024 new variable obj#:#obj_tool_setting_use_news#:#Hírek obj#:#obj_tool_setting_use_news_info#:#Hírblokk, illetve idővonal nézet bekapcsolása. Amennyiben aktív, a felhasználók értesítést kérhetnek a módosulásról. obj#:#obj_tool_setting_use_news_open_settings#:#Beállítások megnyitása @@ -16308,6 +16314,7 @@ tagging#:#tagging_enable_all_users_info#:#A Tartalomtár objektumainak 'Informá tagging#:#tagging_enable_tagging#:#Címkézés engedélyezése tagging#:#tagging_forbidden_tags#:#Tiltott címkék tagging#:#tagging_no_obj_for_tag#:#Egy erőforrásnak sincs címkéjé: %s. +tagging#:#tagging_no_perm_write#:#You have no permission to change this data.###19 11 2024 new variable tagging#:#tagging_other_users#:#Más felhasználók címkéi tagging#:#tagging_resources_for_tag#:#Források ezzel a címkével: %s tagging#:#tagging_search_users#:#Felhasználók keresése diff --git a/lang/ilias_it.lang b/lang/ilias_it.lang index 2aae494270d4..e5c0406aa55f 100644 --- a/lang/ilias_it.lang +++ b/lang/ilias_it.lang @@ -1261,6 +1261,7 @@ assessment#:#test_question_set_type_random_info#:#Each test participant will see assessment#:#test_results#:#Risultati dei test assessment#:#test_scoring#:#Punteggio dei test assessment#:#test_template_reset#:#Il template è stato rimosso. +assessment#:#test_using_removed_template#:#This test uses a deleted template. Please remove the connection here: %s.###19 11 2024 new variable assessment#:#test_using_template#:#Questo test usa il template %s. Se non vuoi usare un template e accedere a tutte le impostazioni, per favore clicca qui: %s. assessment#:#test_using_template_link#:#Non usare più il template assessment#:#text_correct#:#Testo corretto @@ -1299,6 +1300,8 @@ assessment#:#tst_add_quest_cont_edit_mode_IPE#:#Modifica del contenuto aggiuntiv assessment#:#tst_add_quest_cont_edit_mode_IPE_info#:#Nessuna formattazione del testo in domanda e risposte. Nessun uso di LaTex. Feedback e suggerimenti possono essere riutilizzati quando la domanda è incorporata nel modulo ILIAS. assessment#:#tst_add_quest_cont_edit_mode_RTE#:#Modalità di modifica predefinita per contenuti di domande aggiuntive assessment#:#tst_add_quest_cont_edit_mode_RTE_info#:#Consente la formattazione del testo di domande, risposte, feedback e suggerimenti. Feedback e suggerimenti non possono essere riutilizzati quando la domanda è incorporata nel modulo ILIAS. +assessment#:#tst_add_quest_cont_edit_mode_plain#:#Use plain text###19 11 2024 new variable +assessment#:#tst_add_quest_cont_edit_mode_plain_info#:#No formatting of text in question, answers, feedback, and hints.###19 11 2024 new variable assessment#:#tst_addit_passes_blocked_after_passed_msg#:#Hai superato il test. Il test non può essere riavviato. assessment#:#tst_all_test_competences#:#Tutte le competenze di test assessment#:#tst_all_user_data_deleted#:#Tutti i dati dei partecipanti a questo test sono stati cancellati! @@ -7279,6 +7282,7 @@ copg#:#copg_page_element_not_found#:#Page element not found. copg#:#copg_page_type_stys#:#Pagina layout copg#:#copg_par_format_selection#:#Paragraph Format Selection###17 01 2024 new variable copg#:#copg_pc_mob_does_not_exist#:#This media object does not exist.###28 11 2023 new variable +copg#:#copg_plugin_not_avail#:#Plugin %s not available.###19 11 2024 new variable copg#:#copg_questions_not_supported_here#:#Le domande non sono supportate in questo contesto. copg#:#copg_reload_page#:#Reload Page###29 06 2022 new variable copg#:#copg_remove_formats#:#Remove Formatting###17 01 2024 new variable @@ -8980,6 +8984,7 @@ ecs#:#ecs_protocol#:#Protocollo ecs#:#ecs_publish_as#:#Pubblica come: ecs#:#ecs_publish_for#:#Rilasciato per: ecs#:#ecs_published_for#:#Pubblicato per: +ecs#:#ecs_rcat_created_body_a#:#A new ECS Category has been created:###19 11 2024 new variable ecs#:#ecs_rcrs_created_body_a#:#Un nuovo Corso Remoto e' stato creato: ecs#:#ecs_read_remote_links#:#Aggiorna i Corsi remoti ecs#:#ecs_refresh_participants#:#Aggiorna i partecipanti ECS @@ -12359,6 +12364,7 @@ obj#:#obj_tool_setting_skills_info#:#Attiva la gestione delle competenze e le co obj#:#obj_tool_setting_tag_cloud#:#Tag Cloud obj#:#obj_tool_setting_tag_cloud_info#:#il blocco del "tag cloud" verrà visualizzata nel "Content" tab. obj#:#obj_tool_setting_taxonomies#:#Tassonomie +obj#:#obj_tool_setting_taxonomies_info#:#Taxonomies allow the filtering of objects. They are created in the "Metadata" tab.###19 11 2024 new variable obj#:#obj_tool_setting_use_news#:#Notizie obj#:#obj_tool_setting_use_news_info#:#Attiva il blocco notizie e/o visualizzazione calendario. obj#:#obj_tool_setting_use_news_open_settings#:#Apri impostazioni @@ -16307,6 +16313,7 @@ tagging#:#tagging_enable_all_users_info#:#Aggiungi una sezione "Tutti gli utenti tagging#:#tagging_enable_tagging#:#Attiva il tagging tagging#:#tagging_forbidden_tags#:#Tags vietati tagging#:#tagging_no_obj_for_tag#:#No Resources tagged with %s.###09 03 2022 new variable +tagging#:#tagging_no_perm_write#:#You have no permission to change this data.###19 11 2024 new variable tagging#:#tagging_other_users#:#Tag di altri utenti tagging#:#tagging_resources_for_tag#:#Risorse taggate col %s tagging#:#tagging_search_users#:#Cerca utenti diff --git a/lang/ilias_ja.lang b/lang/ilias_ja.lang index f0bb1cd1bf1d..31df0b1bf0d5 100644 --- a/lang/ilias_ja.lang +++ b/lang/ilias_ja.lang @@ -1247,6 +1247,7 @@ assessment#:#test_question_set_type_random_info#:#各テスト受験者には、 assessment#:#test_results#:#テスト結果サマリ assessment#:#test_scoring#:#採点オプション assessment#:#test_template_reset#:#テンプレートは削除されています。 +assessment#:#test_using_removed_template#:#This test uses a deleted template. Please remove the connection here: %s.###19 11 2024 new variable assessment#:#test_using_template#:#このテストはテンプレート%sを使用します。テンプレートを使用したくなくて全ての設定をアクセスする場合はここ%sをクリックしてください。 assessment#:#test_using_template_link#:#今後テンプレート使用を禁止 assessment#:#text_correct#:#正しいテキスト @@ -1285,6 +1286,8 @@ assessment#:#tst_add_quest_cont_edit_mode_IPE#:#問題、回答、フィード assessment#:#tst_add_quest_cont_edit_mode_IPE_info#:#問題と回答に書式設定がありません。LaTexにもありません。ただし、dフィードバックとヒントはILIAS学習モジュールへ問題が埋め込まれ時に再利用できます。 assessment#:#tst_add_quest_cont_edit_mode_RTE#:#問題、回答、フィードバック、ヒントにはRich-Text-Editor (TinyMCE)を使用します。 assessment#:#tst_add_quest_cont_edit_mode_RTE_info#:#ヒント、フィードバック、回答、問題の書式設定を許可。ただし、フィードバックとヒントはILIAS学習モジュールへ問題が埋め込まれた時には再利用できません。 +assessment#:#tst_add_quest_cont_edit_mode_plain#:#Use plain text###19 11 2024 new variable +assessment#:#tst_add_quest_cont_edit_mode_plain_info#:#No formatting of text in question, answers, feedback, and hints.###19 11 2024 new variable assessment#:#tst_addit_passes_blocked_after_passed_msg#:#試験に合格です。試験は再開できません。 assessment#:#tst_all_test_competences#:#全テスト能力 assessment#:#tst_all_user_data_deleted#:#このテストの全ユーザデータは削除されました! @@ -7265,6 +7268,7 @@ copg#:#copg_page_element_not_found#:#ページ要素が見つかりません。 copg#:#copg_page_type_stys#:#ページをレイアウト copg#:#copg_par_format_selection#:#図書式選択 copg#:#copg_pc_mob_does_not_exist#:#このメディア オブジェクトは存在しません。 +copg#:#copg_plugin_not_avail#:#Plugin %s not available.###19 11 2024 new variable copg#:#copg_questions_not_supported_here#:#問題はこのコンテキスト内でサポートされません。 copg#:#copg_reload_page#:#ページの再読み込み copg#:#copg_remove_formats#:#書式を削除 @@ -8966,6 +8970,7 @@ ecs#:#ecs_protocol#:#プロトコル ecs#:#ecs_publish_as#:#発行者: ecs#:#ecs_publish_for#:#リリース: ecs#:#ecs_published_for#:#発行用途: +ecs#:#ecs_rcat_created_body_a#:#A new ECS Category has been created:###19 11 2024 new variable ecs#:#ecs_rcrs_created_body_a#:#新リモートコースが作成されました ecs#:#ecs_read_remote_links#:#リモートコースを更新 ecs#:#ecs_refresh_participants#:#ECS-受験者をリフレッシュ @@ -12345,6 +12350,7 @@ obj#:#obj_tool_setting_skills_info#:#能力管理とメンバーへの能力割 obj#:#obj_tool_setting_tag_cloud#:#クラウドをタグ obj#:#obj_tool_setting_tag_cloud_info#:# "クラウドをタグ" ブロックは"コンテンツ"タブの内側へ表示されます。 obj#:#obj_tool_setting_taxonomies#:#分類 +obj#:#obj_tool_setting_taxonomies_info#:#Taxonomies allow the filtering of objects. They are created in the "Metadata" tab.###19 11 2024 new variable obj#:#obj_tool_setting_use_news#:#ニュース obj#:#obj_tool_setting_use_news_info#:#ニュースブロックそうでなければタイムライン表示を有効にする obj#:#obj_tool_setting_use_news_open_settings#:#設定を開く @@ -16293,6 +16299,7 @@ tagging#:#tagging_enable_all_users_info#:#リソースへ添付される全ユ tagging#:#tagging_enable_tagging#:#タグ化を有効 tagging#:#tagging_forbidden_tags#:#隠しタグ tagging#:#tagging_no_obj_for_tag#:# %s にはリソースタグがありません。 +tagging#:#tagging_no_perm_write#:#You have no permission to change this data.###19 11 2024 new variable tagging#:#tagging_other_users#:#その他ユーザのタグ tagging#:#tagging_resources_for_tag#:#%s でタグ化されたリソース tagging#:#tagging_search_users#:#ユーザを検索 diff --git a/lang/ilias_ka.lang b/lang/ilias_ka.lang index f81c248ac78b..1c3e358395fc 100644 --- a/lang/ilias_ka.lang +++ b/lang/ilias_ka.lang @@ -1247,6 +1247,7 @@ assessment#:#test_question_set_type_random_info#:#Each test participant will see assessment#:#test_results#:#Results Options###24 10 2013 new variable assessment#:#test_scoring#:#Scoring Options###24 10 2013 new variable assessment#:#test_template_reset#:#ეს ნიმუში ამოშლილია +assessment#:#test_using_removed_template#:#This test uses a deleted template. Please remove the connection here: %s.###19 11 2024 new variable assessment#:#test_using_template#:#ეს ტესტი იყენებს ნიმუშს %s. თუ არ გსურთ მისი გამოყენება და ყველა პარამეტრში შესვლა, დააკლიკეთ %s assessment#:#test_using_template_link#:#აღარ გამოიყენოთ ნიმუში assessment#:#text_correct#:#სწორი ტექსტი @@ -1285,6 +1286,8 @@ assessment#:#tst_add_quest_cont_edit_mode_IPE#:#Additional Content Editing with assessment#:#tst_add_quest_cont_edit_mode_IPE_info#:#No formatting of text in question and answers. No use of LaTex either. But feedback and hints can be reused when question is embedded in ILIAS learning module.###30 04 2021 new variable assessment#:#tst_add_quest_cont_edit_mode_RTE#:#Default Editing Mode for Additional Question Content###24 10 2013 new variable assessment#:#tst_add_quest_cont_edit_mode_RTE_info#:#Allows text formatting of questions, answers, feedbacks and hints. But feedback and hints cannot be reused when question is embedded in ILIAS learning module.###30 04 2021 new variable +assessment#:#tst_add_quest_cont_edit_mode_plain#:#Use plain text###19 11 2024 new variable +assessment#:#tst_add_quest_cont_edit_mode_plain_info#:#No formatting of text in question, answers, feedback, and hints.###19 11 2024 new variable assessment#:#tst_addit_passes_blocked_after_passed_msg#:#You have passed the test. The test cannot be started again.###07 02 2020 new variable assessment#:#tst_all_test_competences#:#All Test Competence###26 09 2014 new variable assessment#:#tst_all_user_data_deleted#:#ამ ტესტის მომხმარებლების ყველა მონაცემი წაიშალა. @@ -7265,6 +7268,7 @@ copg#:#copg_page_element_not_found#:#Page element not found.###30 04 2021 new va copg#:#copg_page_type_stys#:#Layout Page###30 04 2021 new variable copg#:#copg_par_format_selection#:#Paragraph Format Selection###17 01 2024 new variable copg#:#copg_pc_mob_does_not_exist#:#This media object does not exist.###28 11 2023 new variable +copg#:#copg_plugin_not_avail#:#Plugin %s not available.###19 11 2024 new variable copg#:#copg_questions_not_supported_here#:#Questions are not supported in this context.###07 02 2017 new variable copg#:#copg_reload_page#:#Reload Page###29 06 2022 new variable copg#:#copg_remove_formats#:#Remove Formatting###17 01 2024 new variable @@ -8966,6 +8970,7 @@ ecs#:#ecs_protocol#:#პროტოკოლი ecs#:#ecs_publish_as#:#გამოცემა როგორც: ecs#:#ecs_publish_for#:#გამოცემულია ecs#:#ecs_published_for#:#გამოცემულია +ecs#:#ecs_rcat_created_body_a#:#A new ECS Category has been created:###19 11 2024 new variable ecs#:#ecs_rcrs_created_body_a#:#ახალი დისტანციური კურსი შექმნილია ecs#:#ecs_read_remote_links#:#დისტანციური კურსების განახლება ecs#:#ecs_refresh_participants#:#Refresh ECS-Participants###27 01 2015 new variable @@ -12345,6 +12350,7 @@ obj#:#obj_tool_setting_skills_info#:#Activates competence management and compete obj#:#obj_tool_setting_tag_cloud#:#Tag Cloud###26 09 2014 new variable obj#:#obj_tool_setting_tag_cloud_info#:#The "tag cloud" block will be displayed inside the "Content" tab.###26 09 2014 new variable obj#:#obj_tool_setting_taxonomies#:#Taxonomies###26 09 2014 new variable +obj#:#obj_tool_setting_taxonomies_info#:#Taxonomies allow the filtering of objects. They are created in the "Metadata" tab.###19 11 2024 new variable obj#:#obj_tool_setting_use_news#:#News###25 10 2016 new variable obj#:#obj_tool_setting_use_news_info#:#Activate the news block and/or timeline view.###25 10 2016 new variable obj#:#obj_tool_setting_use_news_open_settings#:#Open Settings###25 10 2016 new variable @@ -16293,6 +16299,7 @@ tagging#:#tagging_enable_all_users_info#:#ამატებს განყო tagging#:#tagging_enable_tagging#:#მონიშვნის გააქტიურება tagging#:#tagging_forbidden_tags#:#აკრძალული მონიშვნები tagging#:#tagging_no_obj_for_tag#:#No Resources tagged with %s.###09 03 2022 new variable +tagging#:#tagging_no_perm_write#:#You have no permission to change this data.###19 11 2024 new variable tagging#:#tagging_other_users#:#Other Users###26 09 2014 new variable tagging#:#tagging_resources_for_tag#:#მონიშნული რესურსები %s tagging#:#tagging_search_users#:#მომხმარებლების ძიება diff --git a/lang/ilias_lt.lang b/lang/ilias_lt.lang index af6d7149ae96..9793eaab04f4 100644 --- a/lang/ilias_lt.lang +++ b/lang/ilias_lt.lang @@ -1247,6 +1247,7 @@ assessment#:#test_question_set_type_random_info#:#Each test participant will see assessment#:#test_results#:#Results Options###24 10 2013 new variable assessment#:#test_scoring#:#Scoring Options###24 10 2013 new variable assessment#:#test_template_reset#:#The template has been removed.###12 06 2011 new variable +assessment#:#test_using_removed_template#:#This test uses a deleted template. Please remove the connection here: %s.###19 11 2024 new variable assessment#:#test_using_template#:#This test uses the template %s. If you do not want to use a template and have access to all settings, please click here: %s.###12 06 2011 new variable assessment#:#test_using_template_link#:#Do not use template anymore###12 06 2011 new variable assessment#:#text_correct#:#Correct Text###24 07 2009 new variable @@ -1285,6 +1286,8 @@ assessment#:#tst_add_quest_cont_edit_mode_IPE#:#Additional Content Editing with assessment#:#tst_add_quest_cont_edit_mode_IPE_info#:#No formatting of text in question and answers. No use of LaTex either. But feedback and hints can be reused when question is embedded in ILIAS learning module.###30 04 2021 new variable assessment#:#tst_add_quest_cont_edit_mode_RTE#:#Default Editing Mode for Additional Question Content###24 10 2013 new variable assessment#:#tst_add_quest_cont_edit_mode_RTE_info#:#Allows text formatting of questions, answers, feedbacks and hints. But feedback and hints cannot be reused when question is embedded in ILIAS learning module.###30 04 2021 new variable +assessment#:#tst_add_quest_cont_edit_mode_plain#:#Use plain text###19 11 2024 new variable +assessment#:#tst_add_quest_cont_edit_mode_plain_info#:#No formatting of text in question, answers, feedback, and hints.###19 11 2024 new variable assessment#:#tst_addit_passes_blocked_after_passed_msg#:#You have passed the test. The test cannot be started again.###07 02 2020 new variable assessment#:#tst_all_test_competences#:#All Test Competence###26 09 2014 new variable assessment#:#tst_all_user_data_deleted#:#Visi šio testo vartotojo duomenys buvo ištrinti! @@ -7265,6 +7268,7 @@ copg#:#copg_page_element_not_found#:#Page element not found.###30 04 2021 new va copg#:#copg_page_type_stys#:#Layout Page###30 04 2021 new variable copg#:#copg_par_format_selection#:#Paragraph Format Selection###17 01 2024 new variable copg#:#copg_pc_mob_does_not_exist#:#This media object does not exist.###28 11 2023 new variable +copg#:#copg_plugin_not_avail#:#Plugin %s not available.###19 11 2024 new variable copg#:#copg_questions_not_supported_here#:#Questions are not supported in this context.###07 02 2017 new variable copg#:#copg_reload_page#:#Reload Page###29 06 2022 new variable copg#:#copg_remove_formats#:#Remove Formatting###17 01 2024 new variable @@ -8966,6 +8970,7 @@ ecs#:#ecs_protocol#:#Protocol###23 07 2008 new variable ecs#:#ecs_publish_as#:#Publish as:###23 07 2008 new variable ecs#:#ecs_publish_for#:#Release for:###23 07 2008 new variable ecs#:#ecs_published_for#:#Published for:###26 03 2010 new variable +ecs#:#ecs_rcat_created_body_a#:#A new ECS Category has been created:###19 11 2024 new variable ecs#:#ecs_rcrs_created_body_a#:#A new Remote Course has been created:###23 07 2008 new variable ecs#:#ecs_read_remote_links#:#Update Remote-Courses###23 07 2008 new variable ecs#:#ecs_refresh_participants#:#Refresh ECS-Participants###27 01 2015 new variable @@ -12345,6 +12350,7 @@ obj#:#obj_tool_setting_skills_info#:#Activates competence management and compete obj#:#obj_tool_setting_tag_cloud#:#Tag Cloud###26 09 2014 new variable obj#:#obj_tool_setting_tag_cloud_info#:#The "tag cloud" block will be displayed inside the "Content" tab.###26 09 2014 new variable obj#:#obj_tool_setting_taxonomies#:#Taxonomies###26 09 2014 new variable +obj#:#obj_tool_setting_taxonomies_info#:#Taxonomies allow the filtering of objects. They are created in the "Metadata" tab.###19 11 2024 new variable obj#:#obj_tool_setting_use_news#:#News###25 10 2016 new variable obj#:#obj_tool_setting_use_news_info#:#Activate the news block and/or timeline view.###25 10 2016 new variable obj#:#obj_tool_setting_use_news_open_settings#:#Open Settings###25 10 2016 new variable @@ -16293,6 +16299,7 @@ tagging#:#tagging_enable_all_users_info#:#Adds a section "All Users" to the info tagging#:#tagging_enable_tagging#:#Enable Tagging###23 09 2008 new variable tagging#:#tagging_forbidden_tags#:#Forbidden Tags###18 08 2009 new variable tagging#:#tagging_no_obj_for_tag#:#No Resources tagged with %s.###09 03 2022 new variable +tagging#:#tagging_no_perm_write#:#You have no permission to change this data.###19 11 2024 new variable tagging#:#tagging_other_users#:#Other Users###26 09 2014 new variable tagging#:#tagging_resources_for_tag#:#Resources tagged with %s###02 06 2008 new variable tagging#:#tagging_search_users#:#Search Users###18 08 2009 new variable diff --git a/lang/ilias_nl.lang b/lang/ilias_nl.lang index 2a3e9f7d8df5..ffdca8a36c69 100644 --- a/lang/ilias_nl.lang +++ b/lang/ilias_nl.lang @@ -1247,6 +1247,7 @@ assessment#:#test_question_set_type_random_info#:#Each test participant will see assessment#:#test_results#:#Results Options assessment#:#test_scoring#:#Scoring Options assessment#:#test_template_reset#:#De sjabloon is verwijderd. +assessment#:#test_using_removed_template#:#This test uses a deleted template. Please remove the connection here: %s.###19 11 2024 new variable assessment#:#test_using_template#:#Deze toets gebruikt het sjabloon %s. Als je geen sjabloon wilt gebruiken en toegang hebt tot alle instellingen, klik dan hier: %s. assessment#:#test_using_template_link#:#Gebruik sjabloon niet meer assessment#:#text_correct#:#Juiste tekst @@ -1285,6 +1286,8 @@ assessment#:#tst_add_quest_cont_edit_mode_IPE#:#Edit extra inhoud met behulp van assessment#:#tst_add_quest_cont_edit_mode_IPE_info#:#No formatting of text in question and answers. No use of LaTex either. But feedback and hints can be reused when question is embedded in ILIAS learning module.###30 04 2021 new variable assessment#:#tst_add_quest_cont_edit_mode_RTE#:#Standaard modus voor extra inghooud van vragen assessment#:#tst_add_quest_cont_edit_mode_RTE_info#:#Allows text formatting of questions, answers, feedbacks and hints. But feedback and hints cannot be reused when question is embedded in ILIAS learning module.###30 04 2021 new variable +assessment#:#tst_add_quest_cont_edit_mode_plain#:#Use plain text###19 11 2024 new variable +assessment#:#tst_add_quest_cont_edit_mode_plain_info#:#No formatting of text in question, answers, feedback, and hints.###19 11 2024 new variable assessment#:#tst_addit_passes_blocked_after_passed_msg#:#You have passed the test. The test cannot be started again.###07 02 2020 new variable assessment#:#tst_all_test_competences#:#Alle toets Competenties assessment#:#tst_all_user_data_deleted#:#Alle gebruikersgegevens van deze toets zijn verwijderd! @@ -7265,6 +7268,7 @@ copg#:#copg_page_element_not_found#:#Page element not found.###30 04 2021 new va copg#:#copg_page_type_stys#:#Layout Page###30 04 2021 new variable copg#:#copg_par_format_selection#:#Paragraph Format Selection###17 01 2024 new variable copg#:#copg_pc_mob_does_not_exist#:#This media object does not exist.###28 11 2023 new variable +copg#:#copg_plugin_not_avail#:#Plugin %s not available.###19 11 2024 new variable copg#:#copg_questions_not_supported_here#:#Questions are not supported in this context.###07 02 2017 new variable copg#:#copg_reload_page#:#Reload Page###29 06 2022 new variable copg#:#copg_remove_formats#:#Remove Formatting###17 01 2024 new variable @@ -8966,6 +8970,7 @@ ecs#:#ecs_protocol#:#Protocol ecs#:#ecs_publish_as#:#Publish as: ecs#:#ecs_publish_for#:#Release for: ecs#:#ecs_published_for#:#Published for: +ecs#:#ecs_rcat_created_body_a#:#A new ECS Category has been created:###19 11 2024 new variable ecs#:#ecs_rcrs_created_body_a#:#A new Remote Course has been created: ecs#:#ecs_read_remote_links#:#Update Remote-Courses ecs#:#ecs_refresh_participants#:#Refresh ECS-Participants###06 02 2015 new variable @@ -12345,6 +12350,7 @@ obj#:#obj_tool_setting_skills_info#:#Activates competence management and compete obj#:#obj_tool_setting_tag_cloud#:#Tag Cloud obj#:#obj_tool_setting_tag_cloud_info#:#Het "tag cloud" blok wordt getoond op het "Inhoud" tabblad. obj#:#obj_tool_setting_taxonomies#:#Taxonomieën +obj#:#obj_tool_setting_taxonomies_info#:#Taxonomies allow the filtering of objects. They are created in the "Metadata" tab.###19 11 2024 new variable obj#:#obj_tool_setting_use_news#:#News###25 10 2016 new variable obj#:#obj_tool_setting_use_news_info#:#Activate the news block and/or timeline view.###25 10 2016 new variable obj#:#obj_tool_setting_use_news_open_settings#:#Open Settings###25 10 2016 new variable @@ -16293,6 +16299,7 @@ tagging#:#tagging_enable_all_users_info#:#Voegt sectie "alle gebruikers" toe aan tagging#:#tagging_enable_tagging#:#Labels inschakelen tagging#:#tagging_forbidden_tags#:#Verboden labels tagging#:#tagging_no_obj_for_tag#:#No Resources tagged with %s.###09 03 2022 new variable +tagging#:#tagging_no_perm_write#:#You have no permission to change this data.###19 11 2024 new variable tagging#:#tagging_other_users#:#Andere gebruikers tagging#:#tagging_resources_for_tag#:#Bronnen gelabeld met %s tagging#:#tagging_search_users#:#Gebruikers zoeken diff --git a/lang/ilias_pl.lang b/lang/ilias_pl.lang index 0df21ecf4e3f..e44478ac3ae7 100644 --- a/lang/ilias_pl.lang +++ b/lang/ilias_pl.lang @@ -1247,6 +1247,7 @@ assessment#:#test_question_set_type_random_info#:#Each test participant will see assessment#:#test_results#:#Ogłoszenie wyniku testu assessment#:#test_scoring#:#Ocena testu assessment#:#test_template_reset#:#Usunięto szablon. +assessment#:#test_using_removed_template#:#This test uses a deleted template. Please remove the connection here: %s.###19 11 2024 new variable assessment#:#test_using_template#:#Ten test używa szablonu %s. Jeśli nie chcesz używać szablonu, a chcesz korzystać ze wszystkich ustawień, kliknij tutaj: %s. assessment#:#test_using_template_link#:#Nie używaj więcej szablonu assessment#:#text_correct#:#Prawidłowy tekst @@ -1285,6 +1286,8 @@ assessment#:#tst_add_quest_cont_edit_mode_IPE#:#Użyj edytora stron ILIAS do edy assessment#:#tst_add_quest_cont_edit_mode_IPE_info#:#No formatting of text in question and answers. No use of LaTex either. But feedback and hints can be reused when question is embedded in ILIAS learning module.###30 04 2021 new variable assessment#:#tst_add_quest_cont_edit_mode_RTE#:#Użyj edytora sformatowanego tekstu do edytowania komunikatów zwrotnych oraz podpowiedzi. assessment#:#tst_add_quest_cont_edit_mode_RTE_info#:#Allows text formatting of questions, answers, feedbacks and hints. But feedback and hints cannot be reused when question is embedded in ILIAS learning module.###30 04 2021 new variable +assessment#:#tst_add_quest_cont_edit_mode_plain#:#Use plain text###19 11 2024 new variable +assessment#:#tst_add_quest_cont_edit_mode_plain_info#:#No formatting of text in question, answers, feedback, and hints.###19 11 2024 new variable assessment#:#tst_addit_passes_blocked_after_passed_msg#:#You have passed the test. The test cannot be started again.###07 02 2020 new variable assessment#:#tst_all_test_competences#:#Wszystkie kompetencje testu assessment#:#tst_all_user_data_deleted#:#Wszystkie dane uczestnika testu zostały skasowane! @@ -7265,6 +7268,7 @@ copg#:#copg_page_element_not_found#:#Page element not found.###30 04 2021 new va copg#:#copg_page_type_stys#:#Layout Page###30 04 2021 new variable copg#:#copg_par_format_selection#:#Paragraph Format Selection###17 01 2024 new variable copg#:#copg_pc_mob_does_not_exist#:#This media object does not exist.###28 11 2023 new variable +copg#:#copg_plugin_not_avail#:#Plugin %s not available.###19 11 2024 new variable copg#:#copg_questions_not_supported_here#:#W tym kontekście nie obsługiwane są żadne pytania. copg#:#copg_reload_page#:#Reload Page###29 06 2022 new variable copg#:#copg_remove_formats#:#Remove Formatting###17 01 2024 new variable @@ -8966,6 +8970,7 @@ ecs#:#ecs_protocol#:#Protokół ecs#:#ecs_publish_as#:#Opublikuj na: ecs#:#ecs_publish_for#:#Udostępnij dla: ecs#:#ecs_published_for#:#Podziel się z: +ecs#:#ecs_rcat_created_body_a#:#A new ECS Category has been created:###19 11 2024 new variable ecs#:#ecs_rcrs_created_body_a#:#Utworzono nowy kurs ECS: ecs#:#ecs_read_remote_links#:#Aktualizuj informacje dotyczące kursu ecs#:#ecs_refresh_participants#:#Zaktualizuj uczestników ECS @@ -12345,6 +12350,7 @@ obj#:#obj_tool_setting_skills_info#:#Dzięki tej funkcji można wybrać kompeten obj#:#obj_tool_setting_tag_cloud#:#Chmura znaczników obj#:#obj_tool_setting_tag_cloud_info#:#W sekcji "Wybór wg wątków" w zakładce "Treść" wyświetlana jest chmura znaczników. obj#:#obj_tool_setting_taxonomies#:#Klasyfikacje +obj#:#obj_tool_setting_taxonomies_info#:#Taxonomies allow the filtering of objects. They are created in the "Metadata" tab.###19 11 2024 new variable obj#:#obj_tool_setting_use_news#:#Wewnętrzne wiadomości obj#:#obj_tool_setting_use_news_info#:#Użycie sekcji "Nowości" lub linii czasu dla nowości. obj#:#obj_tool_setting_use_news_open_settings#:#Otwórz ustawienia @@ -16293,6 +16299,7 @@ tagging#:#tagging_enable_all_users_info#:#Wstawia na stronie z informacjami obsz tagging#:#tagging_enable_tagging#:#Włącz tagowanie tagging#:#tagging_forbidden_tags#:#Zakazane tagi tagging#:#tagging_no_obj_for_tag#:#No Resources tagged with %s.###09 03 2022 new variable +tagging#:#tagging_no_perm_write#:#You have no permission to change this data.###19 11 2024 new variable tagging#:#tagging_other_users#:#Znaczniki innych użytkowników tagging#:#tagging_resources_for_tag#:#Treści wg haseł kluczowych %s tagging#:#tagging_search_users#:#Wyszukaj użytkowników diff --git a/lang/ilias_pt.lang b/lang/ilias_pt.lang index 03841f1f5568..f4413dd0bae9 100644 --- a/lang/ilias_pt.lang +++ b/lang/ilias_pt.lang @@ -1247,6 +1247,7 @@ assessment#:#test_question_set_type_random_info#:#Each test participant will see assessment#:#test_results#:#Resumo dos resultados do teste assessment#:#test_scoring#:#Opções de pontuação assessment#:#test_template_reset#:#O modelo foi removido. +assessment#:#test_using_removed_template#:#This test uses a deleted template. Please remove the connection here: %s.###19 11 2024 new variable assessment#:#test_using_template#:#Este teste usa o modelo %s. Se não puder usar um modelo e ter acesso a todas as definições, clique aqui: %s. assessment#:#test_using_template_link#:#Não use mais o modelo assessment#:#text_correct#:#Corrigir texto @@ -1285,6 +1286,8 @@ assessment#:#tst_add_quest_cont_edit_mode_IPE#:#Usar editor de páginas ILIAS pa assessment#:#tst_add_quest_cont_edit_mode_IPE_info#:#No formatting of text in question and answers. No use of LaTex either. But feedback and hints can be reused when question is embedded in ILIAS learning module.###30 04 2021 new variable assessment#:#tst_add_quest_cont_edit_mode_RTE#:#Usar editor de Rich-Text para editar feedback e sugestões assessment#:#tst_add_quest_cont_edit_mode_RTE_info#:#Allows text formatting of questions, answers, feedbacks and hints. But feedback and hints cannot be reused when question is embedded in ILIAS learning module.###30 04 2021 new variable +assessment#:#tst_add_quest_cont_edit_mode_plain#:#Use plain text###19 11 2024 new variable +assessment#:#tst_add_quest_cont_edit_mode_plain_info#:#No formatting of text in question, answers, feedback, and hints.###19 11 2024 new variable assessment#:#tst_addit_passes_blocked_after_passed_msg#:#You have passed the test. The test cannot be started again.###07 02 2020 new variable assessment#:#tst_all_test_competences#:#Todas as competências do teste assessment#:#tst_all_user_data_deleted#:#Todos os dados de utilizador deste teste foram removidos! @@ -7265,6 +7268,7 @@ copg#:#copg_page_element_not_found#:#Page element not found.###30 04 2021 new va copg#:#copg_page_type_stys#:#Layout Page###30 04 2021 new variable copg#:#copg_par_format_selection#:#Paragraph Format Selection###17 01 2024 new variable copg#:#copg_pc_mob_does_not_exist#:#This media object does not exist.###28 11 2023 new variable +copg#:#copg_plugin_not_avail#:#Plugin %s not available.###19 11 2024 new variable copg#:#copg_questions_not_supported_here#:#As perguntas não são suportadas neste contexto. copg#:#copg_reload_page#:#Reload Page###29 06 2022 new variable copg#:#copg_remove_formats#:#Remove Formatting###17 01 2024 new variable @@ -8966,6 +8970,7 @@ ecs#:#ecs_protocol#:#Protocolo ecs#:#ecs_publish_as#:#Publicado como: ecs#:#ecs_publish_for#:#Lançamento para: ecs#:#ecs_published_for#:#Publicado para: +ecs#:#ecs_rcat_created_body_a#:#A new ECS Category has been created:###19 11 2024 new variable ecs#:#ecs_rcrs_created_body_a#:#Partilhas LIT ecs#:#ecs_read_remote_links#:#Objetos partilhados ecs#:#ecs_refresh_participants#:#Atualizar participantes ECS @@ -12345,6 +12350,7 @@ obj#:#obj_tool_setting_skills_info#:#Ativa a gestão e atribuição de competên obj#:#obj_tool_setting_tag_cloud#:#Tag cloud obj#:#obj_tool_setting_tag_cloud_info#:#Adicionar competência obj#:#obj_tool_setting_taxonomies#:#Taxonomias +obj#:#obj_tool_setting_taxonomies_info#:#Taxonomies allow the filtering of objects. They are created in the "Metadata" tab.###19 11 2024 new variable obj#:#obj_tool_setting_use_news#:#Notícias obj#:#obj_tool_setting_use_news_info#:#Ativa o bloco de notícias e/ou a vista da linha cronológica. obj#:#obj_tool_setting_use_news_open_settings#:#Abrir definições @@ -16293,6 +16299,7 @@ tagging#:#tagging_enable_all_users_info#:#Adds a section "All Users" to the info tagging#:#tagging_enable_tagging#:#Habilitar Etiquetas tagging#:#tagging_forbidden_tags#:#Etiquetas proibidas tagging#:#tagging_no_obj_for_tag#:#No Resources tagged with %s.###09 03 2022 new variable +tagging#:#tagging_no_perm_write#:#You have no permission to change this data.###19 11 2024 new variable tagging#:#tagging_other_users#:#Other Users tagging#:#tagging_resources_for_tag#:#Recursos marcados com %s tagging#:#tagging_search_users#:#Pesquisar utilizadores diff --git a/lang/ilias_ro.lang b/lang/ilias_ro.lang index 21b8cdc49c51..5a7a512f0b63 100644 --- a/lang/ilias_ro.lang +++ b/lang/ilias_ro.lang @@ -1247,6 +1247,7 @@ assessment#:#test_question_set_type_random_info#:#Each test participant will see assessment#:#test_results#:#Results Options###24 10 2013 new variable assessment#:#test_scoring#:#Scoring Options###24 10 2013 new variable assessment#:#test_template_reset#:#The template has been removed.###12 06 2011 new variable +assessment#:#test_using_removed_template#:#This test uses a deleted template. Please remove the connection here: %s.###19 11 2024 new variable assessment#:#test_using_template#:#This test uses the template %s. If you do not want to use a template and have access to all settings, please click here: %s.###12 06 2011 new variable assessment#:#test_using_template_link#:#Do not use template anymore###12 06 2011 new variable assessment#:#text_correct#:#Correct Text###24 07 2009 new variable @@ -1285,6 +1286,8 @@ assessment#:#tst_add_quest_cont_edit_mode_IPE#:#Additional Content Editing with assessment#:#tst_add_quest_cont_edit_mode_IPE_info#:#No formatting of text in question and answers. No use of LaTex either. But feedback and hints can be reused when question is embedded in ILIAS learning module.###30 04 2021 new variable assessment#:#tst_add_quest_cont_edit_mode_RTE#:#Default Editing Mode for Additional Question Content###24 10 2013 new variable assessment#:#tst_add_quest_cont_edit_mode_RTE_info#:#Allows text formatting of questions, answers, feedbacks and hints. But feedback and hints cannot be reused when question is embedded in ILIAS learning module.###30 04 2021 new variable +assessment#:#tst_add_quest_cont_edit_mode_plain#:#Use plain text###19 11 2024 new variable +assessment#:#tst_add_quest_cont_edit_mode_plain_info#:#No formatting of text in question, answers, feedback, and hints.###19 11 2024 new variable assessment#:#tst_addit_passes_blocked_after_passed_msg#:#You have passed the test. The test cannot be started again.###07 02 2020 new variable assessment#:#tst_all_test_competences#:#All Test Competence###26 09 2014 new variable assessment#:#tst_all_user_data_deleted#:#Toate datele despre utilizator din acest test au foat sterse! @@ -7265,6 +7268,7 @@ copg#:#copg_page_element_not_found#:#Page element not found.###30 04 2021 new va copg#:#copg_page_type_stys#:#Layout Page###30 04 2021 new variable copg#:#copg_par_format_selection#:#Paragraph Format Selection###17 01 2024 new variable copg#:#copg_pc_mob_does_not_exist#:#This media object does not exist.###28 11 2023 new variable +copg#:#copg_plugin_not_avail#:#Plugin %s not available.###19 11 2024 new variable copg#:#copg_questions_not_supported_here#:#Questions are not supported in this context.###07 02 2017 new variable copg#:#copg_reload_page#:#Reload Page###29 06 2022 new variable copg#:#copg_remove_formats#:#Remove Formatting###17 01 2024 new variable @@ -8966,6 +8970,7 @@ ecs#:#ecs_protocol#:#Protocol###23 07 2008 new variable ecs#:#ecs_publish_as#:#Publish as:###23 07 2008 new variable ecs#:#ecs_publish_for#:#Release for:###23 07 2008 new variable ecs#:#ecs_published_for#:#Published for:###26 03 2010 new variable +ecs#:#ecs_rcat_created_body_a#:#A new ECS Category has been created:###19 11 2024 new variable ecs#:#ecs_rcrs_created_body_a#:#A new Remote Course has been created:###23 07 2008 new variable ecs#:#ecs_read_remote_links#:#Update Remote-Courses###23 07 2008 new variable ecs#:#ecs_refresh_participants#:#Refresh ECS-Participants###27 01 2015 new variable @@ -12345,6 +12350,7 @@ obj#:#obj_tool_setting_skills_info#:#Activates competence management and compete obj#:#obj_tool_setting_tag_cloud#:#Tag Cloud###26 09 2014 new variable obj#:#obj_tool_setting_tag_cloud_info#:#The "tag cloud" block will be displayed inside the "Content" tab.###26 09 2014 new variable obj#:#obj_tool_setting_taxonomies#:#Taxonomies###26 09 2014 new variable +obj#:#obj_tool_setting_taxonomies_info#:#Taxonomies allow the filtering of objects. They are created in the "Metadata" tab.###19 11 2024 new variable obj#:#obj_tool_setting_use_news#:#News###25 10 2016 new variable obj#:#obj_tool_setting_use_news_info#:#Activate the news block and/or timeline view.###25 10 2016 new variable obj#:#obj_tool_setting_use_news_open_settings#:#Open Settings###25 10 2016 new variable @@ -16293,6 +16299,7 @@ tagging#:#tagging_enable_all_users_info#:#Adds a section "All Users" to the info tagging#:#tagging_enable_tagging#:#Enable Tagging###23 09 2008 new variable tagging#:#tagging_forbidden_tags#:#Forbidden Tags###18 08 2009 new variable tagging#:#tagging_no_obj_for_tag#:#No Resources tagged with %s.###09 03 2022 new variable +tagging#:#tagging_no_perm_write#:#You have no permission to change this data.###19 11 2024 new variable tagging#:#tagging_other_users#:#Other Users###26 09 2014 new variable tagging#:#tagging_resources_for_tag#:#Resources tagged with %s###02 06 2008 new variable tagging#:#tagging_search_users#:#Search Users###18 08 2009 new variable diff --git a/lang/ilias_ru.lang b/lang/ilias_ru.lang index 00c9bbd841b5..de83d3a09576 100644 --- a/lang/ilias_ru.lang +++ b/lang/ilias_ru.lang @@ -1247,6 +1247,7 @@ assessment#:#test_question_set_type_random_info#:#Each test participant will see assessment#:#test_results#:#Опции результатов assessment#:#test_scoring#:#Опции оценки assessment#:#test_template_reset#:#The template has been removed. +assessment#:#test_using_removed_template#:#This test uses a deleted template. Please remove the connection here: %s.###19 11 2024 new variable assessment#:#test_using_template#:#This test uses the template %s. If you do not want to use a template and have access to all settings, please click here: %s. assessment#:#test_using_template_link#:#Do not use template anymore assessment#:#text_correct#:#Исправьте текст @@ -1285,6 +1286,8 @@ assessment#:#tst_add_quest_cont_edit_mode_IPE#:#Additional Content Editing with assessment#:#tst_add_quest_cont_edit_mode_IPE_info#:#No formatting of text in question and answers. No use of LaTex either. But feedback and hints can be reused when question is embedded in ILIAS learning module.###30 04 2021 new variable assessment#:#tst_add_quest_cont_edit_mode_RTE#:#Default Editing Mode for Additional Question Content assessment#:#tst_add_quest_cont_edit_mode_RTE_info#:#Allows text formatting of questions, answers, feedbacks and hints. But feedback and hints cannot be reused when question is embedded in ILIAS learning module.###30 04 2021 new variable +assessment#:#tst_add_quest_cont_edit_mode_plain#:#Use plain text###19 11 2024 new variable +assessment#:#tst_add_quest_cont_edit_mode_plain_info#:#No formatting of text in question, answers, feedback, and hints.###19 11 2024 new variable assessment#:#tst_addit_passes_blocked_after_passed_msg#:#You have passed the test. The test cannot be started again.###07 02 2020 new variable assessment#:#tst_all_test_competences#:#All Test Competence###26 09 2014 new variable assessment#:#tst_all_user_data_deleted#:#Все данные пользователей этого теста были удалены! @@ -7265,6 +7268,7 @@ copg#:#copg_page_element_not_found#:#Page element not found.###30 04 2021 new va copg#:#copg_page_type_stys#:#Layout Page###30 04 2021 new variable copg#:#copg_par_format_selection#:#Paragraph Format Selection###17 01 2024 new variable copg#:#copg_pc_mob_does_not_exist#:#This media object does not exist.###28 11 2023 new variable +copg#:#copg_plugin_not_avail#:#Plugin %s not available.###19 11 2024 new variable copg#:#copg_questions_not_supported_here#:#Questions are not supported in this context.###07 02 2017 new variable copg#:#copg_reload_page#:#Reload Page###29 06 2022 new variable copg#:#copg_remove_formats#:#Remove Formatting###17 01 2024 new variable @@ -8966,6 +8970,7 @@ ecs#:#ecs_protocol#:#Protocol ecs#:#ecs_publish_as#:#Publish as: ecs#:#ecs_publish_for#:#Release for: ecs#:#ecs_published_for#:#Published for: +ecs#:#ecs_rcat_created_body_a#:#A new ECS Category has been created:###19 11 2024 new variable ecs#:#ecs_rcrs_created_body_a#:#A new Remote Course has been created: ecs#:#ecs_read_remote_links#:#Update Remote-Courses ecs#:#ecs_refresh_participants#:#Refresh ECS-Participants###27 01 2015 new variable @@ -12345,6 +12350,7 @@ obj#:#obj_tool_setting_skills_info#:#Activates competence management and compete obj#:#obj_tool_setting_tag_cloud#:#Tag Cloud###26 09 2014 new variable obj#:#obj_tool_setting_tag_cloud_info#:#The "tag cloud" block will be displayed inside the "Content" tab.###26 09 2014 new variable obj#:#obj_tool_setting_taxonomies#:#Taxonomies###26 09 2014 new variable +obj#:#obj_tool_setting_taxonomies_info#:#Taxonomies allow the filtering of objects. They are created in the "Metadata" tab.###19 11 2024 new variable obj#:#obj_tool_setting_use_news#:#News###25 10 2016 new variable obj#:#obj_tool_setting_use_news_info#:#Activate the news block and/or timeline view.###25 10 2016 new variable obj#:#obj_tool_setting_use_news_open_settings#:#Open Settings###25 10 2016 new variable @@ -16293,6 +16299,7 @@ tagging#:#tagging_enable_all_users_info#:#Добавляет раздел "Вс tagging#:#tagging_enable_tagging#:#Включить "Ключевые слова" tagging#:#tagging_forbidden_tags#:#Запрещенные ключевые слова tagging#:#tagging_no_obj_for_tag#:#No Resources tagged with %s.###09 03 2022 new variable +tagging#:#tagging_no_perm_write#:#You have no permission to change this data.###19 11 2024 new variable tagging#:#tagging_other_users#:#Other Users###26 09 2014 new variable tagging#:#tagging_resources_for_tag#:#Ресурсы помеченные меткой %s tagging#:#tagging_search_users#:#Найти пользователей diff --git a/lang/ilias_sk.lang b/lang/ilias_sk.lang index 784ec241e011..65fe2b1eb2d5 100644 --- a/lang/ilias_sk.lang +++ b/lang/ilias_sk.lang @@ -1247,6 +1247,7 @@ assessment#:#test_question_set_type_random_info#:#Each test participant will see assessment#:#test_results#:#Results Options###24 10 2013 new variable assessment#:#test_scoring#:#Scoring Options###24 10 2013 new variable assessment#:#test_template_reset#:#The template has been removed.###12 06 2011 new variable +assessment#:#test_using_removed_template#:#This test uses a deleted template. Please remove the connection here: %s.###19 11 2024 new variable assessment#:#test_using_template#:#This test uses the template %s. If you do not want to use a template and have access to all settings, please click here: %s.###12 06 2011 new variable assessment#:#test_using_template_link#:#Do not use template anymore###12 06 2011 new variable assessment#:#text_correct#:#Opravit text @@ -1285,6 +1286,8 @@ assessment#:#tst_add_quest_cont_edit_mode_IPE#:#Additional Content Editing with assessment#:#tst_add_quest_cont_edit_mode_IPE_info#:#No formatting of text in question and answers. No use of LaTex either. But feedback and hints can be reused when question is embedded in ILIAS learning module.###30 04 2021 new variable assessment#:#tst_add_quest_cont_edit_mode_RTE#:#Default Editing Mode for Additional Question Content###24 10 2013 new variable assessment#:#tst_add_quest_cont_edit_mode_RTE_info#:#Allows text formatting of questions, answers, feedbacks and hints. But feedback and hints cannot be reused when question is embedded in ILIAS learning module.###30 04 2021 new variable +assessment#:#tst_add_quest_cont_edit_mode_plain#:#Use plain text###19 11 2024 new variable +assessment#:#tst_add_quest_cont_edit_mode_plain_info#:#No formatting of text in question, answers, feedback, and hints.###19 11 2024 new variable assessment#:#tst_addit_passes_blocked_after_passed_msg#:#You have passed the test. The test cannot be started again.###07 02 2020 new variable assessment#:#tst_all_test_competences#:#All Test Competence###26 09 2014 new variable assessment#:#tst_all_user_data_deleted#:#Všechna uživatelská data tohoto testu byly smazány! @@ -7265,6 +7268,7 @@ copg#:#copg_page_element_not_found#:#Page element not found.###30 04 2021 new va copg#:#copg_page_type_stys#:#Layout Page###30 04 2021 new variable copg#:#copg_par_format_selection#:#Paragraph Format Selection###17 01 2024 new variable copg#:#copg_pc_mob_does_not_exist#:#This media object does not exist.###28 11 2023 new variable +copg#:#copg_plugin_not_avail#:#Plugin %s not available.###19 11 2024 new variable copg#:#copg_questions_not_supported_here#:#Questions are not supported in this context.###07 02 2017 new variable copg#:#copg_reload_page#:#Reload Page###29 06 2022 new variable copg#:#copg_remove_formats#:#Remove Formatting###17 01 2024 new variable @@ -8966,6 +8970,7 @@ ecs#:#ecs_protocol#:#Protokol ecs#:#ecs_publish_as#:#Publikováno jako: ecs#:#ecs_publish_for#:#Uvolněno pro: ecs#:#ecs_published_for#:#Published for +ecs#:#ecs_rcat_created_body_a#:#A new ECS Category has been created:###19 11 2024 new variable ecs#:#ecs_rcrs_created_body_a#:#Nový dálkový kurz byl vytvořen: ecs#:#ecs_read_remote_links#:#Aktualizace dálkových kurzů ecs#:#ecs_refresh_participants#:#Refresh ECS-Participants###27 01 2015 new variable @@ -12345,6 +12350,7 @@ obj#:#obj_tool_setting_skills_info#:#Activates competence management and compete obj#:#obj_tool_setting_tag_cloud#:#Tag Cloud###26 09 2014 new variable obj#:#obj_tool_setting_tag_cloud_info#:#The "tag cloud" block will be displayed inside the "Content" tab.###26 09 2014 new variable obj#:#obj_tool_setting_taxonomies#:#Taxonomies###26 09 2014 new variable +obj#:#obj_tool_setting_taxonomies_info#:#Taxonomies allow the filtering of objects. They are created in the "Metadata" tab.###19 11 2024 new variable obj#:#obj_tool_setting_use_news#:#News###25 10 2016 new variable obj#:#obj_tool_setting_use_news_info#:#Activate the news block and/or timeline view.###25 10 2016 new variable obj#:#obj_tool_setting_use_news_open_settings#:#Open Settings###25 10 2016 new variable @@ -16293,6 +16299,7 @@ tagging#:#tagging_enable_all_users_info#:#Přidává sekci "Všichni uživatelé tagging#:#tagging_enable_tagging#:#Tagging aktivován tagging#:#tagging_forbidden_tags#:#Zakázané značky tagging#:#tagging_no_obj_for_tag#:#No Resources tagged with %s.###09 03 2022 new variable +tagging#:#tagging_no_perm_write#:#You have no permission to change this data.###19 11 2024 new variable tagging#:#tagging_other_users#:#Other Users###26 09 2014 new variable tagging#:#tagging_resources_for_tag#:#Zdroje označeny s %s tagging#:#tagging_search_users#:#Hledat uživatele diff --git a/lang/ilias_sl.lang b/lang/ilias_sl.lang index d88193c01965..45a48b63c9d3 100644 --- a/lang/ilias_sl.lang +++ b/lang/ilias_sl.lang @@ -1261,6 +1261,7 @@ assessment#:#test_question_set_type_random_info#:#Each test participant will see assessment#:#test_results#:#Objava rezultata testa assessment#:#test_scoring#:#Ocenjevanje testa assessment#:#test_template_reset#:#Predloga je bila odstranjena. +assessment#:#test_using_removed_template#:#This test uses a deleted template. Please remove the connection here: %s.###19 11 2024 new variable assessment#:#test_using_template#:#Ta test uporablja predlogo %s. Če ne želite uporabljati predloge in želite imeti dostop do vseh nastavitev, kliknite tukaj: %s. assessment#:#test_using_template_link#:#Ne uporabljajte več predloge assessment#:#text_correct#:#Pravilno besedilo @@ -1299,6 +1300,8 @@ assessment#:#tst_add_quest_cont_edit_mode_IPE#:#Uporabite urejevalnik strani ILI assessment#:#tst_add_quest_cont_edit_mode_IPE_info#:#No formatting of text in question and answers. No use of LaTex either. But feedback and hints can be reused when question is embedded in ILIAS learning module. assessment#:#tst_add_quest_cont_edit_mode_RTE#:#Za urejanje povratnih informacij in nasvetov uporabite urejevalnik obogatenega besedila assessment#:#tst_add_quest_cont_edit_mode_RTE_info#:#Allows text formatting of questions, answers, feedbacks and hints. But feedback and hints cannot be reused when question is embedded in ILIAS learning module. +assessment#:#tst_add_quest_cont_edit_mode_plain#:#Use plain text###19 11 2024 new variable +assessment#:#tst_add_quest_cont_edit_mode_plain_info#:#No formatting of text in question, answers, feedback, and hints.###19 11 2024 new variable assessment#:#tst_addit_passes_blocked_after_passed_msg#:#You have passed the test. The test cannot be started again. assessment#:#tst_all_test_competences#:#Vse testne kompetence assessment#:#tst_all_user_data_deleted#:#Podatki vseh udeležencev testa so bili izbrisani! @@ -7279,6 +7282,7 @@ copg#:#copg_page_element_not_found#:#Page element not found.###19 08 2022 new va copg#:#copg_page_type_stys#:#Layout Page copg#:#copg_par_format_selection#:#Paragraph Format Selection###17 01 2024 new variable copg#:#copg_pc_mob_does_not_exist#:#This media object does not exist.###28 11 2023 new variable +copg#:#copg_plugin_not_avail#:#Plugin %s not available.###19 11 2024 new variable copg#:#copg_questions_not_supported_here#:#Vprašanja v tem kontekstu niso podprta. copg#:#copg_reload_page#:#Reload Page###19 08 2022 new variable copg#:#copg_remove_formats#:#Remove Formatting###17 01 2024 new variable @@ -8980,6 +8984,7 @@ ecs#:#ecs_protocol#:#Protocol ecs#:#ecs_publish_as#:#Publish as ecs#:#ecs_publish_for#:#Release for ecs#:#ecs_published_for#:#Published for +ecs#:#ecs_rcat_created_body_a#:#A new ECS Category has been created:###19 11 2024 new variable ecs#:#ecs_rcrs_created_body_a#:#A new ECS Course has been created ecs#:#ecs_read_remote_links#:#Update ECS Courses ecs#:#ecs_refresh_participants#:#Refresh ECS-Participants @@ -12359,6 +12364,7 @@ obj#:#obj_tool_setting_skills_info#:#Funkcija omogoča izbiro kompetenc in dodel obj#:#obj_tool_setting_tag_cloud#:#Oznaka v oblaku obj#:#obj_tool_setting_tag_cloud_info#:#Oznaka v oblaku "Izbira po temah" bo prikazana v zavihku "Vsebina". obj#:#obj_tool_setting_taxonomies#:#Taksonomije +obj#:#obj_tool_setting_taxonomies_info#:#Taxonomies allow the filtering of objects. They are created in the "Metadata" tab.###19 11 2024 new variable obj#:#obj_tool_setting_use_news#:#Novosti obj#:#obj_tool_setting_use_news_info#:#Uporaba bloka "Novosti" ali časovnice za novosti. obj#:#obj_tool_setting_use_news_open_settings#:#Odpri nastavitve @@ -16307,6 +16313,7 @@ tagging#:#tagging_enable_all_users_info#:#Adds a section ‘All Users’ to the tagging#:#tagging_enable_tagging#:#Enable Tagging tagging#:#tagging_forbidden_tags#:#Forbidden Tags tagging#:#tagging_no_obj_for_tag#:#No Resources tagged with %s. +tagging#:#tagging_no_perm_write#:#You have no permission to change this data.###19 11 2024 new variable tagging#:#tagging_other_users#:#Tags of Other Users tagging#:#tagging_resources_for_tag#:#Resources tagged with %s tagging#:#tagging_search_users#:#Search Users diff --git a/lang/ilias_sq.lang b/lang/ilias_sq.lang index 6409124cc883..3ccfe43c4193 100644 --- a/lang/ilias_sq.lang +++ b/lang/ilias_sq.lang @@ -1247,6 +1247,7 @@ assessment#:#test_question_set_type_random_info#:#Each test participant will see assessment#:#test_results#:#Results Options###24 10 2013 new variable assessment#:#test_scoring#:#Scoring Options###24 10 2013 new variable assessment#:#test_template_reset#:#The template has been removed.###12 06 2011 new variable +assessment#:#test_using_removed_template#:#This test uses a deleted template. Please remove the connection here: %s.###19 11 2024 new variable assessment#:#test_using_template#:#This test uses the template %s. If you do not want to use a template and have access to all settings, please click here: %s.###12 06 2011 new variable assessment#:#test_using_template_link#:#Do not use template anymore###12 06 2011 new variable assessment#:#text_correct#:#Correct Text###24 07 2009 new variable @@ -1285,6 +1286,8 @@ assessment#:#tst_add_quest_cont_edit_mode_IPE#:#Additional Content Editing with assessment#:#tst_add_quest_cont_edit_mode_IPE_info#:#No formatting of text in question and answers. No use of LaTex either. But feedback and hints can be reused when question is embedded in ILIAS learning module.###30 04 2021 new variable assessment#:#tst_add_quest_cont_edit_mode_RTE#:#Default Editing Mode for Additional Question Content###24 10 2013 new variable assessment#:#tst_add_quest_cont_edit_mode_RTE_info#:#Allows text formatting of questions, answers, feedbacks and hints. But feedback and hints cannot be reused when question is embedded in ILIAS learning module.###30 04 2021 new variable +assessment#:#tst_add_quest_cont_edit_mode_plain#:#Use plain text###19 11 2024 new variable +assessment#:#tst_add_quest_cont_edit_mode_plain_info#:#No formatting of text in question, answers, feedback, and hints.###19 11 2024 new variable assessment#:#tst_addit_passes_blocked_after_passed_msg#:#You have passed the test. The test cannot be started again.###07 02 2020 new variable assessment#:#tst_all_test_competences#:#All Test Competence###26 09 2014 new variable assessment#:#tst_all_user_data_deleted#:#Të gjitha të dhënat e shfrytëzuesve të këtij testi janë fshirë! @@ -7265,6 +7268,7 @@ copg#:#copg_page_element_not_found#:#Page element not found.###30 04 2021 new va copg#:#copg_page_type_stys#:#Layout Page###30 04 2021 new variable copg#:#copg_par_format_selection#:#Paragraph Format Selection###17 01 2024 new variable copg#:#copg_pc_mob_does_not_exist#:#This media object does not exist.###28 11 2023 new variable +copg#:#copg_plugin_not_avail#:#Plugin %s not available.###19 11 2024 new variable copg#:#copg_questions_not_supported_here#:#Questions are not supported in this context.###07 02 2017 new variable copg#:#copg_reload_page#:#Reload Page###29 06 2022 new variable copg#:#copg_remove_formats#:#Remove Formatting###17 01 2024 new variable @@ -8966,6 +8970,7 @@ ecs#:#ecs_protocol#:#Protocol###23 07 2008 new variable ecs#:#ecs_publish_as#:#Publish as:###23 07 2008 new variable ecs#:#ecs_publish_for#:#Release for:###23 07 2008 new variable ecs#:#ecs_published_for#:#Published for:###26 03 2010 new variable +ecs#:#ecs_rcat_created_body_a#:#A new ECS Category has been created:###19 11 2024 new variable ecs#:#ecs_rcrs_created_body_a#:#A new Remote Course has been created:###23 07 2008 new variable ecs#:#ecs_read_remote_links#:#Update Remote-Courses###23 07 2008 new variable ecs#:#ecs_refresh_participants#:#Refresh ECS-Participants###27 01 2015 new variable @@ -12345,6 +12350,7 @@ obj#:#obj_tool_setting_skills_info#:#Activates competence management and compete obj#:#obj_tool_setting_tag_cloud#:#Tag Cloud###26 09 2014 new variable obj#:#obj_tool_setting_tag_cloud_info#:#The "tag cloud" block will be displayed inside the "Content" tab.###26 09 2014 new variable obj#:#obj_tool_setting_taxonomies#:#Taxonomies###26 09 2014 new variable +obj#:#obj_tool_setting_taxonomies_info#:#Taxonomies allow the filtering of objects. They are created in the "Metadata" tab.###19 11 2024 new variable obj#:#obj_tool_setting_use_news#:#News###25 10 2016 new variable obj#:#obj_tool_setting_use_news_info#:#Activate the news block and/or timeline view.###25 10 2016 new variable obj#:#obj_tool_setting_use_news_open_settings#:#Open Settings###25 10 2016 new variable @@ -16293,6 +16299,7 @@ tagging#:#tagging_enable_all_users_info#:#Adds a section "All Users" to the info tagging#:#tagging_enable_tagging#:#Enable Tagging###23 09 2008 new variable tagging#:#tagging_forbidden_tags#:#Forbidden Tags###18 08 2009 new variable tagging#:#tagging_no_obj_for_tag#:#No Resources tagged with %s.###09 03 2022 new variable +tagging#:#tagging_no_perm_write#:#You have no permission to change this data.###19 11 2024 new variable tagging#:#tagging_other_users#:#Other Users###26 09 2014 new variable tagging#:#tagging_resources_for_tag#:#Resources tagged with %s###02 06 2008 new variable tagging#:#tagging_search_users#:#Search Users###18 08 2009 new variable diff --git a/lang/ilias_sr.lang b/lang/ilias_sr.lang index 316db7eba8b9..efea0304b1a8 100644 --- a/lang/ilias_sr.lang +++ b/lang/ilias_sr.lang @@ -1247,6 +1247,7 @@ assessment#:#test_question_set_type_random_info#:#Each test participant will see assessment#:#test_results#:#Results Options###24 10 2013 new variable assessment#:#test_scoring#:#Scoring Options###24 10 2013 new variable assessment#:#test_template_reset#:#The template has been removed.###12 06 2011 new variable +assessment#:#test_using_removed_template#:#This test uses a deleted template. Please remove the connection here: %s.###19 11 2024 new variable assessment#:#test_using_template#:#This test uses the template %s. If you do not want to use a template and have access to all settings, please click here: %s.###12 06 2011 new variable assessment#:#test_using_template_link#:#Do not use template anymore###12 06 2011 new variable assessment#:#text_correct#:#Correct Text###24 07 2009 new variable @@ -1285,6 +1286,8 @@ assessment#:#tst_add_quest_cont_edit_mode_IPE#:#Additional Content Editing with assessment#:#tst_add_quest_cont_edit_mode_IPE_info#:#No formatting of text in question and answers. No use of LaTex either. But feedback and hints can be reused when question is embedded in ILIAS learning module.###30 04 2021 new variable assessment#:#tst_add_quest_cont_edit_mode_RTE#:#Default Editing Mode for Additional Question Content###24 10 2013 new variable assessment#:#tst_add_quest_cont_edit_mode_RTE_info#:#Allows text formatting of questions, answers, feedbacks and hints. But feedback and hints cannot be reused when question is embedded in ILIAS learning module.###30 04 2021 new variable +assessment#:#tst_add_quest_cont_edit_mode_plain#:#Use plain text###19 11 2024 new variable +assessment#:#tst_add_quest_cont_edit_mode_plain_info#:#No formatting of text in question, answers, feedback, and hints.###19 11 2024 new variable assessment#:#tst_addit_passes_blocked_after_passed_msg#:#You have passed the test. The test cannot be started again.###07 02 2020 new variable assessment#:#tst_all_test_competences#:#All Test Competence###26 09 2014 new variable assessment#:#tst_all_user_data_deleted#:#Svi podaci o korisniku ovog testa su obrisani! @@ -7265,6 +7268,7 @@ copg#:#copg_page_element_not_found#:#Page element not found.###30 04 2021 new va copg#:#copg_page_type_stys#:#Layout Page###30 04 2021 new variable copg#:#copg_par_format_selection#:#Paragraph Format Selection###17 01 2024 new variable copg#:#copg_pc_mob_does_not_exist#:#This media object does not exist.###28 11 2023 new variable +copg#:#copg_plugin_not_avail#:#Plugin %s not available.###19 11 2024 new variable copg#:#copg_questions_not_supported_here#:#Questions are not supported in this context.###07 02 2017 new variable copg#:#copg_reload_page#:#Reload Page###29 06 2022 new variable copg#:#copg_remove_formats#:#Remove Formatting###17 01 2024 new variable @@ -8966,6 +8970,7 @@ ecs#:#ecs_protocol#:#Protocol###23 07 2008 new variable ecs#:#ecs_publish_as#:#Publish as:###23 07 2008 new variable ecs#:#ecs_publish_for#:#Release for:###23 07 2008 new variable ecs#:#ecs_published_for#:#Published for:###26 03 2010 new variable +ecs#:#ecs_rcat_created_body_a#:#A new ECS Category has been created:###19 11 2024 new variable ecs#:#ecs_rcrs_created_body_a#:#A new Remote Course has been created:###23 07 2008 new variable ecs#:#ecs_read_remote_links#:#Update Remote-Courses###23 07 2008 new variable ecs#:#ecs_refresh_participants#:#Refresh ECS-Participants###27 01 2015 new variable @@ -12345,6 +12350,7 @@ obj#:#obj_tool_setting_skills_info#:#Activates competence management and compete obj#:#obj_tool_setting_tag_cloud#:#Tag Cloud###26 09 2014 new variable obj#:#obj_tool_setting_tag_cloud_info#:#The "tag cloud" block will be displayed inside the "Content" tab.###26 09 2014 new variable obj#:#obj_tool_setting_taxonomies#:#Taxonomies###26 09 2014 new variable +obj#:#obj_tool_setting_taxonomies_info#:#Taxonomies allow the filtering of objects. They are created in the "Metadata" tab.###19 11 2024 new variable obj#:#obj_tool_setting_use_news#:#News###25 10 2016 new variable obj#:#obj_tool_setting_use_news_info#:#Activate the news block and/or timeline view.###25 10 2016 new variable obj#:#obj_tool_setting_use_news_open_settings#:#Open Settings###25 10 2016 new variable @@ -16293,6 +16299,7 @@ tagging#:#tagging_enable_all_users_info#:#Adds a section "All Users" to the info tagging#:#tagging_enable_tagging#:#Enable Tagging###23 09 2008 new variable tagging#:#tagging_forbidden_tags#:#Forbidden Tags###18 08 2009 new variable tagging#:#tagging_no_obj_for_tag#:#No Resources tagged with %s.###09 03 2022 new variable +tagging#:#tagging_no_perm_write#:#You have no permission to change this data.###19 11 2024 new variable tagging#:#tagging_other_users#:#Other Users###26 09 2014 new variable tagging#:#tagging_resources_for_tag#:#Resources tagged with %s###02 06 2008 new variable tagging#:#tagging_search_users#:#Search Users###18 08 2009 new variable diff --git a/lang/ilias_sv.lang b/lang/ilias_sv.lang index 3b3ab4b8b91c..fb24d8033448 100644 --- a/lang/ilias_sv.lang +++ b/lang/ilias_sv.lang @@ -1262,6 +1262,7 @@ assessment#:#test_question_set_type_random_info#:#Varje deltagare får svara på assessment#:#test_results#:#Meddelande av testresultatet assessment#:#test_scoring#:#Utvärdering av testet assessment#:#test_template_reset#:#Mallen har tagits bort. +assessment#:#test_using_removed_template#:#This test uses a deleted template. Please remove the connection here: %s.###19 11 2024 new variable assessment#:#test_using_template#:#Detta test använder mallen %s. Om du inte vill använda en mall och alla inställningar, klicka här assessment#:#test_using_template_link#:#Använd inte mallen längre assessment#:#text_correct#:#Korrigera text @@ -1300,6 +1301,8 @@ assessment#:#tst_add_quest_cont_edit_mode_IPE#:#Oformaterad text för frågor oc assessment#:#tst_add_quest_cont_edit_mode_IPE_info#:#Tillhandahåller inte formatering av text i frågor och svar, men tillåter utformning av feedback och lösningsanteckningar med ILIAS sidredigerare och återanvändning i frågor i ILIAS inlärningsmoduler. assessment#:#tst_add_quest_cont_edit_mode_RTE#:#Riktig textredigerare (TinyMCE) för redigering av frågor, svar, feedback och lösningsanteckningar. assessment#:#tst_add_quest_cont_edit_mode_RTE_info#:#Tillåter formaterad text för frågor, svar, feedback och lösningsanteckningar. Feedback och lösningsanteckningar antas dock inte när frågor integreras i ILIAS inlärningsmoduler. +assessment#:#tst_add_quest_cont_edit_mode_plain#:#Use plain text###19 11 2024 new variable +assessment#:#tst_add_quest_cont_edit_mode_plain_info#:#No formatting of text in question, answers, feedback, and hints.###19 11 2024 new variable assessment#:#tst_addit_passes_blocked_after_passed_msg#:#Du har klarat testet. Testet kan inte påbörjas igen. assessment#:#tst_all_test_competences#:#Alla testfärdigheter assessment#:#tst_all_user_data_deleted#:#Uppgifterna för alla testdeltagare har raderats! @@ -7280,6 +7283,7 @@ copg#:#copg_page_element_not_found#:# Okänt sidelement. copg#:#copg_page_type_stys#:#Sidans layout copg#:#copg_par_format_selection#:#Paragraph Format Selection###17 01 2024 new variable copg#:#copg_pc_mob_does_not_exist#:#This media object does not exist.###28 11 2023 new variable +copg#:#copg_plugin_not_avail#:#Plugin %s not available.###19 11 2024 new variable copg#:#copg_questions_not_supported_here#:#Inga frågor stöds i detta sammanhang. copg#:#copg_reload_page#:#Reload sida copg#:#copg_remove_formats#:#Remove Formatting###17 01 2024 new variable @@ -8981,6 +8985,7 @@ ecs#:#ecs_protocol#:#Protokoll ecs#:#ecs_publish_as#:#Publicera under ecs#:#ecs_publish_for#:#Släpp för ecs#:#ecs_published_for#:#Släppt för +ecs#:#ecs_rcat_created_body_a#:#A new ECS Category has been created:###19 11 2024 new variable ecs#:#ecs_rcrs_created_body_a#:#En ny ECS-kurs skapades ecs#:#ecs_read_remote_links#:#Uppdatera kursinformation ecs#:#ecs_refresh_participants#:#Uppdatera ECS deltagare @@ -12360,6 +12365,7 @@ obj#:#obj_tool_setting_skills_info#:#Funktionen gör det möjligt att välja kom obj#:#obj_tool_setting_tag_cloud#:#Tag Moln obj#:#obj_tool_setting_tag_cloud_info#:#Ett taggmoln visas i blocket "Urval efter ämne" på fliken "Innehåll". obj#:#obj_tool_setting_taxonomies#:#Taxonomier +obj#:#obj_tool_setting_taxonomies_info#:#Taxonomies allow the filtering of objects. They are created in the "Metadata" tab.###19 11 2024 new variable obj#:#obj_tool_setting_use_news#:#Nyheter obj#:#obj_tool_setting_use_news_info#:#Användning av News-blocket eller Timeline för nyheter. Användare kan aktivera aviseringar för nyheter så snart blocket eller tidslinjen är aktiv. obj#:#obj_tool_setting_use_news_open_settings#:#Öppna inställningar för block och tidslinje @@ -16308,6 +16314,7 @@ tagging#:#tagging_enable_all_users_info#:# Lägger till ett "Alla användare"-om tagging#:#tagging_enable_tagging#:#Aktivera taggning tagging#:#tagging_forbidden_tags#:#Förbjudna taggar tagging#:#tagging_no_obj_for_tag#:#Det finns inget innehåll taggat med '%s'. +tagging#:#tagging_no_perm_write#:#You have no permission to change this data.###19 11 2024 new variable tagging#:#tagging_other_users#:#Tags från andra användare tagging#:#tagging_resources_for_tag#:#Innehåll taggat med %s tagging#:#tagging_search_users#:#Sök användare diff --git a/lang/ilias_tr.lang b/lang/ilias_tr.lang index 0fe0780b1541..3bcc9c279c54 100644 --- a/lang/ilias_tr.lang +++ b/lang/ilias_tr.lang @@ -1247,6 +1247,7 @@ assessment#:#test_question_set_type_random_info#:#Each test participant will see assessment#:#test_results#:#Results Options###24 10 2013 new variable assessment#:#test_scoring#:#Scoring Options###24 10 2013 new variable assessment#:#test_template_reset#:#Şablon kaldırıldı. +assessment#:#test_using_removed_template#:#This test uses a deleted template. Please remove the connection here: %s.###19 11 2024 new variable assessment#:#test_using_template#:#Bu test %s şablonunu kullanır. Bir şablon kullanmak ve tüm ayarlara erişim olmasını istemiyorsanız, lütfen tıklayın: %s. assessment#:#test_using_template_link#:#Artık şablon kullanmayın assessment#:#text_correct#:#Doğru Metin @@ -1285,6 +1286,8 @@ assessment#:#tst_add_quest_cont_edit_mode_IPE#:#Additional Content Editing with assessment#:#tst_add_quest_cont_edit_mode_IPE_info#:#No formatting of text in question and answers. No use of LaTex either. But feedback and hints can be reused when question is embedded in ILIAS learning module.###30 04 2021 new variable assessment#:#tst_add_quest_cont_edit_mode_RTE#:#Default Editing Mode for Additional Question Content###24 10 2013 new variable assessment#:#tst_add_quest_cont_edit_mode_RTE_info#:#Allows text formatting of questions, answers, feedbacks and hints. But feedback and hints cannot be reused when question is embedded in ILIAS learning module.###30 04 2021 new variable +assessment#:#tst_add_quest_cont_edit_mode_plain#:#Use plain text###19 11 2024 new variable +assessment#:#tst_add_quest_cont_edit_mode_plain_info#:#No formatting of text in question, answers, feedback, and hints.###19 11 2024 new variable assessment#:#tst_addit_passes_blocked_after_passed_msg#:#You have passed the test. The test cannot be started again.###07 02 2020 new variable assessment#:#tst_all_test_competences#:#All Test Competence###26 09 2014 new variable assessment#:#tst_all_user_data_deleted#:#Bu testin tüm kullanıcı verileri silindi ! @@ -7265,6 +7268,7 @@ copg#:#copg_page_element_not_found#:#Page element not found.###30 04 2021 new va copg#:#copg_page_type_stys#:#Layout Page###30 04 2021 new variable copg#:#copg_par_format_selection#:#Paragraph Format Selection###17 01 2024 new variable copg#:#copg_pc_mob_does_not_exist#:#This media object does not exist.###28 11 2023 new variable +copg#:#copg_plugin_not_avail#:#Plugin %s not available.###19 11 2024 new variable copg#:#copg_questions_not_supported_here#:#Questions are not supported in this context.###07 02 2017 new variable copg#:#copg_reload_page#:#Reload Page###29 06 2022 new variable copg#:#copg_remove_formats#:#Remove Formatting###17 01 2024 new variable @@ -8966,6 +8970,7 @@ ecs#:#ecs_protocol#:#Protokolü ecs#:#ecs_publish_as#:#olarak yayınla: ecs#:#ecs_publish_for#:#İçin Sürüm: ecs#:#ecs_published_for#:#için Yayınlandı: +ecs#:#ecs_rcat_created_body_a#:#A new ECS Category has been created:###19 11 2024 new variable ecs#:#ecs_rcrs_created_body_a#:#Yeni ECS Ders oluşturuldu: ecs#:#ecs_read_remote_links#:#Güncelleme ECS Dersler ecs#:#ecs_refresh_participants#:#Refresh ECS-Participants###27 01 2015 new variable @@ -12345,6 +12350,7 @@ obj#:#obj_tool_setting_skills_info#:#Activates competence management and compete obj#:#obj_tool_setting_tag_cloud#:#Tag Cloud###26 09 2014 new variable obj#:#obj_tool_setting_tag_cloud_info#:#The "tag cloud" block will be displayed inside the "Content" tab.###26 09 2014 new variable obj#:#obj_tool_setting_taxonomies#:#Taxonomies###26 09 2014 new variable +obj#:#obj_tool_setting_taxonomies_info#:#Taxonomies allow the filtering of objects. They are created in the "Metadata" tab.###19 11 2024 new variable obj#:#obj_tool_setting_use_news#:#News###25 10 2016 new variable obj#:#obj_tool_setting_use_news_info#:#Activate the news block and/or timeline view.###25 10 2016 new variable obj#:#obj_tool_setting_use_news_open_settings#:#Open Settings###25 10 2016 new variable @@ -16293,6 +16299,7 @@ tagging#:#tagging_enable_all_users_info#:#Bir kaynağa bağlı tüm kullanıcıl tagging#:#tagging_enable_tagging#:#Etiketleme Etkin tagging#:#tagging_forbidden_tags#:#Yasak Etiketler tagging#:#tagging_no_obj_for_tag#:#No Resources tagged with %s.###09 03 2022 new variable +tagging#:#tagging_no_perm_write#:#You have no permission to change this data.###19 11 2024 new variable tagging#:#tagging_other_users#:#Other Users###26 09 2014 new variable tagging#:#tagging_resources_for_tag#:#%S ile etiketlendi Kaynakları tagging#:#tagging_search_users#:#Kullanıcıları Ara diff --git a/lang/ilias_uk.lang b/lang/ilias_uk.lang index ac681d67cd3a..e599a594eb8e 100644 --- a/lang/ilias_uk.lang +++ b/lang/ilias_uk.lang @@ -1247,6 +1247,7 @@ assessment#:#test_question_set_type_random_info#:#Each test participant will see assessment#:#test_results#:#Results Options###24 10 2013 new variable assessment#:#test_scoring#:#Scoring Options###24 10 2013 new variable assessment#:#test_template_reset#:#The template has been removed.###12 06 2011 new variable +assessment#:#test_using_removed_template#:#This test uses a deleted template. Please remove the connection here: %s.###19 11 2024 new variable assessment#:#test_using_template#:#This test uses the template %s. If you do not want to use a template and have access to all settings, please click here: %s.###12 06 2011 new variable assessment#:#test_using_template_link#:#Do not use template anymore###12 06 2011 new variable assessment#:#text_correct#:#Correct Text###24 07 2009 new variable @@ -1285,6 +1286,8 @@ assessment#:#tst_add_quest_cont_edit_mode_IPE#:#Additional Content Editing with assessment#:#tst_add_quest_cont_edit_mode_IPE_info#:#No formatting of text in question and answers. No use of LaTex either. But feedback and hints can be reused when question is embedded in ILIAS learning module.###30 04 2021 new variable assessment#:#tst_add_quest_cont_edit_mode_RTE#:#Default Editing Mode for Additional Question Content###24 10 2013 new variable assessment#:#tst_add_quest_cont_edit_mode_RTE_info#:#Allows text formatting of questions, answers, feedbacks and hints. But feedback and hints cannot be reused when question is embedded in ILIAS learning module.###30 04 2021 new variable +assessment#:#tst_add_quest_cont_edit_mode_plain#:#Use plain text###19 11 2024 new variable +assessment#:#tst_add_quest_cont_edit_mode_plain_info#:#No formatting of text in question, answers, feedback, and hints.###19 11 2024 new variable assessment#:#tst_addit_passes_blocked_after_passed_msg#:#You have passed the test. The test cannot be started again.###07 02 2020 new variable assessment#:#tst_all_test_competences#:#All Test Competence###26 09 2014 new variable assessment#:#tst_all_user_data_deleted#:#Усі дані користувача по цьому тесту були видалені! @@ -7265,6 +7268,7 @@ copg#:#copg_page_element_not_found#:#Page element not found.###30 04 2021 new va copg#:#copg_page_type_stys#:#Layout Page###30 04 2021 new variable copg#:#copg_par_format_selection#:#Paragraph Format Selection###17 01 2024 new variable copg#:#copg_pc_mob_does_not_exist#:#This media object does not exist.###28 11 2023 new variable +copg#:#copg_plugin_not_avail#:#Plugin %s not available.###19 11 2024 new variable copg#:#copg_questions_not_supported_here#:#Questions are not supported in this context.###07 02 2017 new variable copg#:#copg_reload_page#:#Reload Page###29 06 2022 new variable copg#:#copg_remove_formats#:#Remove Formatting###17 01 2024 new variable @@ -8966,6 +8970,7 @@ ecs#:#ecs_protocol#:#Protocol###23 07 2008 new variable ecs#:#ecs_publish_as#:#Publish as:###23 07 2008 new variable ecs#:#ecs_publish_for#:#Release for:###23 07 2008 new variable ecs#:#ecs_published_for#:#Published for:###26 03 2010 new variable +ecs#:#ecs_rcat_created_body_a#:#A new ECS Category has been created:###19 11 2024 new variable ecs#:#ecs_rcrs_created_body_a#:#A new Remote Course has been created:###23 07 2008 new variable ecs#:#ecs_read_remote_links#:#Update Remote-Courses###23 07 2008 new variable ecs#:#ecs_refresh_participants#:#Refresh ECS-Participants###27 01 2015 new variable @@ -12345,6 +12350,7 @@ obj#:#obj_tool_setting_skills_info#:#Activates competence management and compete obj#:#obj_tool_setting_tag_cloud#:#Tag Cloud###26 09 2014 new variable obj#:#obj_tool_setting_tag_cloud_info#:#The "tag cloud" block will be displayed inside the "Content" tab.###26 09 2014 new variable obj#:#obj_tool_setting_taxonomies#:#Taxonomies###26 09 2014 new variable +obj#:#obj_tool_setting_taxonomies_info#:#Taxonomies allow the filtering of objects. They are created in the "Metadata" tab.###19 11 2024 new variable obj#:#obj_tool_setting_use_news#:#News###25 10 2016 new variable obj#:#obj_tool_setting_use_news_info#:#Activate the news block and/or timeline view.###25 10 2016 new variable obj#:#obj_tool_setting_use_news_open_settings#:#Open Settings###25 10 2016 new variable @@ -16293,6 +16299,7 @@ tagging#:#tagging_enable_all_users_info#:#Adds a section "All Users" to the info tagging#:#tagging_enable_tagging#:#Enable Tagging###23 09 2008 new variable tagging#:#tagging_forbidden_tags#:#Forbidden Tags###18 08 2009 new variable tagging#:#tagging_no_obj_for_tag#:#No Resources tagged with %s.###09 03 2022 new variable +tagging#:#tagging_no_perm_write#:#You have no permission to change this data.###19 11 2024 new variable tagging#:#tagging_other_users#:#Other Users###26 09 2014 new variable tagging#:#tagging_resources_for_tag#:#Resources tagged with %s###02 06 2008 new variable tagging#:#tagging_search_users#:#Search Users###18 08 2009 new variable diff --git a/lang/ilias_vi.lang b/lang/ilias_vi.lang index 9f47c06356e4..6dda2289288d 100644 --- a/lang/ilias_vi.lang +++ b/lang/ilias_vi.lang @@ -1249,6 +1249,7 @@ assessment#:#test_question_set_type_random_info#:#Each test participant will see assessment#:#test_results#:#Results Options###24 10 2013 new variable assessment#:#test_scoring#:#Scoring Options###24 10 2013 new variable assessment#:#test_template_reset#:#The template has been removed.###12 06 2011 new variable +assessment#:#test_using_removed_template#:#This test uses a deleted template. Please remove the connection here: %s.###19 11 2024 new variable assessment#:#test_using_template#:#This test uses the template %s. If you do not want to use a template and have access to all settings, please click here: %s.###12 06 2011 new variable assessment#:#test_using_template_link#:#Do not use template anymore###12 06 2011 new variable assessment#:#text_correct#:#Correct Text###24 07 2009 new variable @@ -1287,6 +1288,8 @@ assessment#:#tst_add_quest_cont_edit_mode_IPE#:#Additional Content Editing with assessment#:#tst_add_quest_cont_edit_mode_IPE_info#:#No formatting of text in question and answers. No use of LaTex either. But feedback and hints can be reused when question is embedded in ILIAS learning module.###30 04 2021 new variable assessment#:#tst_add_quest_cont_edit_mode_RTE#:#Default Editing Mode for Additional Question Content###24 10 2013 new variable assessment#:#tst_add_quest_cont_edit_mode_RTE_info#:#Allows text formatting of questions, answers, feedbacks and hints. But feedback and hints cannot be reused when question is embedded in ILIAS learning module.###30 04 2021 new variable +assessment#:#tst_add_quest_cont_edit_mode_plain#:#Use plain text###19 11 2024 new variable +assessment#:#tst_add_quest_cont_edit_mode_plain_info#:#No formatting of text in question, answers, feedback, and hints.###19 11 2024 new variable assessment#:#tst_addit_passes_blocked_after_passed_msg#:#You have passed the test. The test cannot be started again.###07 02 2020 new variable assessment#:#tst_all_test_competences#:#All Test Competence###26 09 2014 new variable assessment#:#tst_all_user_data_deleted#:#Tất cả thông tin người sử dụng của bài kiểm tra này đã được xóa! @@ -7267,6 +7270,7 @@ copg#:#copg_page_element_not_found#:#Page element not found.###30 04 2021 new va copg#:#copg_page_type_stys#:#Layout Page###30 04 2021 new variable copg#:#copg_par_format_selection#:#Paragraph Format Selection###17 01 2024 new variable copg#:#copg_pc_mob_does_not_exist#:#This media object does not exist.###28 11 2023 new variable +copg#:#copg_plugin_not_avail#:#Plugin %s not available.###19 11 2024 new variable copg#:#copg_questions_not_supported_here#:#Questions are not supported in this context.###07 02 2017 new variable copg#:#copg_reload_page#:#Reload Page###29 06 2022 new variable copg#:#copg_remove_formats#:#Remove Formatting###17 01 2024 new variable @@ -8968,6 +8972,7 @@ ecs#:#ecs_protocol#:#Protocol###23 07 2008 new variable ecs#:#ecs_publish_as#:#Publish as:###23 07 2008 new variable ecs#:#ecs_publish_for#:#Release for:###23 07 2008 new variable ecs#:#ecs_published_for#:#Published for:###26 03 2010 new variable +ecs#:#ecs_rcat_created_body_a#:#A new ECS Category has been created:###19 11 2024 new variable ecs#:#ecs_rcrs_created_body_a#:#A new Remote Course has been created:###23 07 2008 new variable ecs#:#ecs_read_remote_links#:#Update Remote-Courses###23 07 2008 new variable ecs#:#ecs_refresh_participants#:#Refresh ECS-Participants###27 01 2015 new variable @@ -12347,6 +12352,7 @@ obj#:#obj_tool_setting_skills_info#:#Activates competence management and compete obj#:#obj_tool_setting_tag_cloud#:#Tag Cloud###26 09 2014 new variable obj#:#obj_tool_setting_tag_cloud_info#:#The "tag cloud" block will be displayed inside the "Content" tab.###26 09 2014 new variable obj#:#obj_tool_setting_taxonomies#:#Taxonomies###26 09 2014 new variable +obj#:#obj_tool_setting_taxonomies_info#:#Taxonomies allow the filtering of objects. They are created in the "Metadata" tab.###19 11 2024 new variable obj#:#obj_tool_setting_use_news#:#News###25 10 2016 new variable obj#:#obj_tool_setting_use_news_info#:#Activate the news block and/or timeline view.###25 10 2016 new variable obj#:#obj_tool_setting_use_news_open_settings#:#Open Settings###25 10 2016 new variable @@ -16295,6 +16301,7 @@ tagging#:#tagging_enable_all_users_info#:#Adds a section "All Users" to the info tagging#:#tagging_enable_tagging#:#Enable Tagging###23 09 2008 new variable tagging#:#tagging_forbidden_tags#:#Forbidden Tags###18 08 2009 new variable tagging#:#tagging_no_obj_for_tag#:#No Resources tagged with %s.###09 03 2022 new variable +tagging#:#tagging_no_perm_write#:#You have no permission to change this data.###19 11 2024 new variable tagging#:#tagging_other_users#:#Other Users###26 09 2014 new variable tagging#:#tagging_resources_for_tag#:#Resources tagged with %s###02 06 2008 new variable tagging#:#tagging_search_users#:#Search Users###18 08 2009 new variable diff --git a/lang/ilias_zh.lang b/lang/ilias_zh.lang index 5e536dfd7fb8..14ffd6501a0d 100644 --- a/lang/ilias_zh.lang +++ b/lang/ilias_zh.lang @@ -1246,6 +1246,7 @@ assessment#:#test_question_set_type_random_info#:#Each test participant will see assessment#:#test_results#:#Results Options###24 10 2013 new variable assessment#:#test_scoring#:#Scoring Options###24 10 2013 new variable assessment#:#test_template_reset#:#模板已被删除 +assessment#:#test_using_removed_template#:#This test uses a deleted template. Please remove the connection here: %s.###19 11 2024 new variable assessment#:#test_using_template#:#这个测试使用模板 %s 。如果您不想使用一个模板,并且访问所有设置,请点击这里:%s。 assessment#:#test_using_template_link#:#不再使用模板了 assessment#:#text_correct#:#正确文本 @@ -1284,6 +1285,8 @@ assessment#:#tst_add_quest_cont_edit_mode_IPE#:#Additional Content Editing with assessment#:#tst_add_quest_cont_edit_mode_IPE_info#:#No formatting of text in question and answers. No use of LaTex either. But feedback and hints can be reused when question is embedded in ILIAS learning module.###30 04 2021 new variable assessment#:#tst_add_quest_cont_edit_mode_RTE#:#Default Editing Mode for Additional Question Content###24 10 2013 new variable assessment#:#tst_add_quest_cont_edit_mode_RTE_info#:#Allows text formatting of questions, answers, feedbacks and hints. But feedback and hints cannot be reused when question is embedded in ILIAS learning module.###30 04 2021 new variable +assessment#:#tst_add_quest_cont_edit_mode_plain#:#Use plain text###19 11 2024 new variable +assessment#:#tst_add_quest_cont_edit_mode_plain_info#:#No formatting of text in question, answers, feedback, and hints.###19 11 2024 new variable assessment#:#tst_addit_passes_blocked_after_passed_msg#:#You have passed the test. The test cannot be started again.###07 02 2020 new variable assessment#:#tst_all_test_competences#:#All Test Competence###26 09 2014 new variable assessment#:#tst_all_user_data_deleted#:#此次测试的所有用户数据已全部删除! @@ -7264,6 +7267,7 @@ copg#:#copg_page_element_not_found#:#Page element not found.###30 04 2021 new va copg#:#copg_page_type_stys#:#Layout Page###30 04 2021 new variable copg#:#copg_par_format_selection#:#Paragraph Format Selection###17 01 2024 new variable copg#:#copg_pc_mob_does_not_exist#:#This media object does not exist.###28 11 2023 new variable +copg#:#copg_plugin_not_avail#:#Plugin %s not available.###19 11 2024 new variable copg#:#copg_questions_not_supported_here#:#Questions are not supported in this context.###07 02 2017 new variable copg#:#copg_reload_page#:#Reload Page###29 06 2022 new variable copg#:#copg_remove_formats#:#Remove Formatting###17 01 2024 new variable @@ -8965,6 +8969,7 @@ ecs#:#ecs_protocol#:#协议。 ecs#:#ecs_publish_as#:#Publish as: ecs#:#ecs_publish_for#:#Release for: ecs#:#ecs_published_for#:#Published for: +ecs#:#ecs_rcat_created_body_a#:#A new ECS Category has been created:###19 11 2024 new variable ecs#:#ecs_rcrs_created_body_a#:#一个新的远程课程已创建: ecs#:#ecs_read_remote_links#:#更新远程课程 ecs#:#ecs_refresh_participants#:#Refresh ECS-Participants###27 01 2015 new variable @@ -12344,6 +12349,7 @@ obj#:#obj_tool_setting_skills_info#:#Activates competence management and compete obj#:#obj_tool_setting_tag_cloud#:#Tag Cloud###26 09 2014 new variable obj#:#obj_tool_setting_tag_cloud_info#:#The "tag cloud" block will be displayed inside the "Content" tab.###26 09 2014 new variable obj#:#obj_tool_setting_taxonomies#:#Taxonomies###26 09 2014 new variable +obj#:#obj_tool_setting_taxonomies_info#:#Taxonomies allow the filtering of objects. They are created in the "Metadata" tab.###19 11 2024 new variable obj#:#obj_tool_setting_use_news#:#News###25 10 2016 new variable obj#:#obj_tool_setting_use_news_info#:#Activate the news block and/or timeline view.###25 10 2016 new variable obj#:#obj_tool_setting_use_news_open_settings#:#Open Settings###25 10 2016 new variable @@ -16292,6 +16298,7 @@ tagging#:#tagging_enable_all_users_info#:#添加一个段落“所有用户” tagging#:#tagging_enable_tagging#:#启用标签 tagging#:#tagging_forbidden_tags#:#禁止标签 tagging#:#tagging_no_obj_for_tag#:#No Resources tagged with %s.###09 03 2022 new variable +tagging#:#tagging_no_perm_write#:#You have no permission to change this data.###19 11 2024 new variable tagging#:#tagging_other_users#:#Other Users###26 09 2014 new variable tagging#:#tagging_resources_for_tag#:#资源贴上标签 %s tagging#:#tagging_search_users#:#搜索用户 From 05ecac5666037ed00b1f82c774d5c0cd73a9975d Mon Sep 17 00:00:00 2001 From: Releasemanager Date: Tue, 19 Nov 2024 15:21:36 +0000 Subject: [PATCH 230/292] Release 8.16 --- include/inc.ilias_version.php | 4 +-- setup/sql/ilias3.sql | 63 ++++++++++------------------------- 2 files changed, 19 insertions(+), 48 deletions(-) diff --git a/include/inc.ilias_version.php b/include/inc.ilias_version.php index ea89f7c74705..a72f589724a8 100644 --- a/include/inc.ilias_version.php +++ b/include/inc.ilias_version.php @@ -10,5 +10,5 @@ * * @package ilias-core */ -define("ILIAS_VERSION", "8.15 2024-10-01"); -define("ILIAS_VERSION_NUMERIC", "8.15"); // since version ILIAS 6 this must be always x.y: x and y are numbers +define("ILIAS_VERSION", "8.16 2024-11-19"); +define("ILIAS_VERSION_NUMERIC", "8.16"); // since version ILIAS 6 this must be always x.y: x and y are numbers diff --git a/setup/sql/ilias3.sql b/setup/sql/ilias3.sql index d827a25f4532..80f2fe8981ea 100644 --- a/setup/sql/ilias3.sql +++ b/setup/sql/ilias3.sql @@ -818,7 +818,7 @@ CREATE TABLE `ass_log` ( `ass_log_id` int(11) NOT NULL DEFAULT 0, `user_fi` int(11) NOT NULL DEFAULT 0, `obj_fi` int(11) NOT NULL DEFAULT 0, - `logtext` varchar(4000) DEFAULT NULL, + `logtext` text DEFAULT NULL, `question_fi` int(11) DEFAULT NULL, `original_fi` int(11) DEFAULT NULL, `ref_id` int(11) DEFAULT NULL, @@ -7088,6 +7088,8 @@ INSERT INTO `il_db_steps` VALUES ('ilDataCollectionDBUpdateSteps',7,'2024-05-28 INSERT INTO `il_db_steps` VALUES ('ilDataCollectionDBUpdateSteps',8,'2024-06-25 14:05:10.427670','2024-06-25 14:05:10.428311'); INSERT INTO `il_db_steps` VALUES ('ilDataCollectionDBUpdateSteps',9,'2024-08-13 13:24:47.172854','2024-08-13 13:24:47.173513'); INSERT INTO `il_db_steps` VALUES ('ilDataCollectionDBUpdateSteps',10,'2024-10-01 13:17:03.393288','2024-10-01 13:17:03.393692'); +INSERT INTO `il_db_steps` VALUES ('ilDataCollectionDBUpdateSteps',11,'2024-11-19 15:14:55.058607','2024-11-19 15:14:55.066263'); +INSERT INTO `il_db_steps` VALUES ('ilDataCollectionDBUpdateSteps',12,'2024-11-19 15:14:55.066603','2024-11-19 15:14:55.066994'); INSERT INTO `il_db_steps` VALUES ('ilECSDBUpdateSteps',1,'2023-03-31 13:10:08.531142','2023-03-31 13:10:08.536140'); INSERT INTO `il_db_steps` VALUES ('ilECSUpdateSteps8',1,'2023-03-31 13:10:08.954044','2023-03-31 13:10:08.962950'); INSERT INTO `il_db_steps` VALUES ('ilECSUpdateSteps8',2,'2023-03-31 13:10:08.963397','2023-03-31 13:10:08.967878'); @@ -7105,6 +7107,7 @@ INSERT INTO `il_db_steps` VALUES ('ILIAS\\AdvancedMetaData\\Setup\\DBUpdateSteps INSERT INTO `il_db_steps` VALUES ('ILIAS\\AdvancedMetaData\\Setup\\DBUpdateSteps8',4,'2024-08-13 13:24:47.161441','2024-08-13 13:24:47.163504'); INSERT INTO `il_db_steps` VALUES ('ILIAS\\Blog\\Setup\\BlogDBUpdateSteps',1,'2023-03-31 13:10:08.060739','2023-03-31 13:10:08.065162'); INSERT INTO `il_db_steps` VALUES ('ILIAS\\Blog\\Setup\\BlogDBUpdateSteps',2,'2023-03-31 13:10:08.065756','2023-03-31 13:10:08.066454'); +INSERT INTO `il_db_steps` VALUES ('ILIAS\\BookingManager\\Setup\\ilBookingManager8HotfixDBUpdateSteps',1,'2024-11-19 15:14:55.054833','2024-11-19 15:14:55.055302'); INSERT INTO `il_db_steps` VALUES ('ILIAS\\BookingManager\\Setup\\ilBookingManagerDBUpdateSteps',1,'2023-03-31 13:10:08.067151','2023-03-31 13:10:08.073425'); INSERT INTO `il_db_steps` VALUES ('ILIAS\\BookingManager\\Setup\\ilBookingManagerDBUpdateSteps',2,'2023-03-31 13:10:08.073902','2023-03-31 13:10:08.079634'); INSERT INTO `il_db_steps` VALUES ('ILIAS\\BookingManager\\Setup\\ilBookingManagerDBUpdateSteps',3,'2023-03-31 13:10:08.080091','2023-03-31 13:10:08.085665'); @@ -7156,6 +7159,7 @@ INSERT INTO `il_db_steps` VALUES ('ILIAS\\Style\\Content\\Setup\\ilStyleDBUpdate INSERT INTO `il_db_steps` VALUES ('ILIAS\\Style\\Content\\Setup\\ilStyleDBUpdateSteps',11,'2023-03-31 13:10:08.281066','2023-03-31 13:10:08.286593'); INSERT INTO `il_db_steps` VALUES ('ILIAS\\Style\\Content\\Setup\\ilStyleDBUpdateSteps',12,'2023-04-26 17:22:12.948408','2023-04-26 17:22:12.959763'); INSERT INTO `il_db_steps` VALUES ('ILIAS\\SurveyQuestionPool\\Setup\\SurveyQuestionPoolDBUpdateSteps',1,'2024-08-13 13:24:47.169939','2024-08-13 13:24:47.171748'); +INSERT INTO `il_db_steps` VALUES ('ILIAS\\Wiki\\Setup\\ilWiki8HotfixDBUpdateSteps',1,'2024-11-19 15:14:55.057230','2024-11-19 15:14:55.057554'); INSERT INTO `il_db_steps` VALUES ('ILIAS\\Wiki\\Setup\\ilWikiDBUpdateSteps',1,'2023-03-31 13:10:08.287295','2023-03-31 13:10:08.316859'); INSERT INTO `il_db_steps` VALUES ('ILIAS\\Wiki\\Setup\\ilWikiDBUpdateSteps',2,'2023-03-31 13:10:08.317370','2023-03-31 13:10:08.321696'); INSERT INTO `il_db_steps` VALUES ('ILIAS\\Wiki\\Setup\\ilWikiDBUpdateSteps',3,'2023-03-31 13:10:08.322335','2023-03-31 13:10:08.333760'); @@ -7253,6 +7257,7 @@ INSERT INTO `il_db_steps` VALUES ('ilStudyProgrammeProgressTableUpdateSteps',3,' INSERT INTO `il_db_steps` VALUES ('ilStudyProgrammeSettingsTableUpdateSteps',1,'2023-03-31 13:10:08.836404','2023-03-31 13:10:08.840584'); INSERT INTO `il_db_steps` VALUES ('ilStudyProgrammeSettingsTableUpdateSteps',2,'2023-03-31 13:10:08.841037','2023-03-31 13:10:08.852124'); INSERT INTO `il_db_steps` VALUES ('ilTest8DBUpdateSteps',1,'2023-03-31 13:10:08.889188','2023-03-31 13:10:08.894449'); +INSERT INTO `il_db_steps` VALUES ('ilTest8DBUpdateSteps',2,'2024-11-19 15:14:55.072754','2024-11-19 15:14:55.077456'); INSERT INTO `il_db_steps` VALUES ('ilTestQuestionPool80DBUpdateSteps',1,'2023-03-31 13:10:08.858537','2023-03-31 13:10:08.859520'); INSERT INTO `il_db_steps` VALUES ('ilTestQuestionPool80DBUpdateSteps',2,'2023-03-31 13:10:08.859960','2023-03-31 13:10:08.864478'); INSERT INTO `il_db_steps` VALUES ('ilTestQuestionPool80DBUpdateSteps',3,'2023-03-31 13:10:08.864934','2023-03-31 13:10:08.870661'); @@ -7338,7 +7343,6 @@ INSERT INTO `il_dcl_datatype` VALUES (7,'rating','integer',0,100); INSERT INTO `il_dcl_datatype` VALUES (8,'ilias_reference','integer',2,90); INSERT INTO `il_dcl_datatype` VALUES (9,'mob','integer',2,60); INSERT INTO `il_dcl_datatype` VALUES (11,'formula','text',0,110); -INSERT INTO `il_dcl_datatype` VALUES (12,'plugin','text',0,120); INSERT INTO `il_dcl_datatype` VALUES (14,'text_selection','text',1,10); INSERT INTO `il_dcl_datatype` VALUES (15,'date_selection','text',1,50); @@ -7414,39 +7418,6 @@ CREATE TABLE `il_dcl_field_prop` ( -- --- --- Table structure for table `il_dcl_field_prop_b` --- - -CREATE TABLE `il_dcl_field_prop_b` ( - `id` int(11) NOT NULL DEFAULT 0, - `field_id` int(11) NOT NULL DEFAULT 0, - `datatype_prop_id` int(11) NOT NULL DEFAULT 0, - `value` varchar(256) DEFAULT NULL, - PRIMARY KEY (`id`), - KEY `i1_idx` (`field_id`), - KEY `i2_idx` (`datatype_prop_id`) -) ; - --- --- Dumping data for table `il_dcl_field_prop_b` --- - - --- --- Table structure for table `il_dcl_field_prop_s_b` --- - -CREATE TABLE `il_dcl_field_prop_s_b` ( - `sequence` int(11) NOT NULL DEFAULT 0, - PRIMARY KEY (`sequence`) -) ; - --- --- Dumping data for table `il_dcl_field_prop_s_b` --- - - -- -- Table structure for table `il_dcl_field_prop_seq` -- @@ -8271,13 +8242,13 @@ CREATE TABLE `il_md_cpr_selections` ( -- Dumping data for table `il_md_cpr_selections` -- -INSERT INTO `il_md_cpr_selections` VALUES (1,'Attribution Non-commercial No Derivatives (by-nc-nd)','Creative Commons License','\"Creative
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.','en',0,1,0,0,0,NULL,NULL,NULL,NULL,0); -INSERT INTO `il_md_cpr_selections` VALUES (2,'Attribution Non-commercial Share Alike (by-nc-sa)','Creative Commons License','\"Creative
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.','en',0,1,0,0,0,NULL,NULL,NULL,NULL,0); -INSERT INTO `il_md_cpr_selections` VALUES (3,'Attribution Non-commercial (by-nc)','Creative Commons License','\"Creative
This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.','en',0,1,0,0,0,NULL,NULL,NULL,NULL,0); -INSERT INTO `il_md_cpr_selections` VALUES (4,'Attribution No Derivatives (by-nd)','Creative Commons License','\"Creative
This work is licensed under a Creative Commons Attribution-NoDerivatives 4.0 International License.','en',0,1,0,0,0,NULL,NULL,NULL,NULL,0); -INSERT INTO `il_md_cpr_selections` VALUES (5,'Attribution Share Alike (by-sa)','Creative Commons License','\"Creative
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.','en',0,1,0,0,0,NULL,NULL,NULL,NULL,0); -INSERT INTO `il_md_cpr_selections` VALUES (6,'Attribution (by)','Creative Commons License','\"Creative
This work is licensed under a Creative Commons Attribution 4.0 International License.','en',0,1,0,0,0,NULL,NULL,NULL,NULL,0); -INSERT INTO `il_md_cpr_selections` VALUES (7,'All rights reserved','','This work has all rights reserved by the owner.','en',0,1,1,0,0,NULL,NULL,NULL,NULL,0); +INSERT INTO `il_md_cpr_selections` VALUES (1,'Attribution Non-commercial No Derivatives (by-nc-nd)','Creative Commons License','\"Creative
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.','en',0,1,0,0,0,'Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License','http://creativecommons.org/licenses/by-nc-nd/4.0/','https://mirrors.creativecommons.org/presskit/buttons/88x31/svg/by-nc-nd.svg','Creative Commons License',1); +INSERT INTO `il_md_cpr_selections` VALUES (2,'Attribution Non-commercial Share Alike (by-nc-sa)','Creative Commons License','\"Creative
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.','en',0,1,0,0,0,'Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License','http://creativecommons.org/licenses/by-nc-sa/4.0/','https://mirrors.creativecommons.org/presskit/buttons/88x31/svg/by-nc-sa.svg','Creative Commons License',1); +INSERT INTO `il_md_cpr_selections` VALUES (3,'Attribution Non-commercial (by-nc)','Creative Commons License','\"Creative
This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.','en',0,1,0,0,0,'Creative Commons Attribution-NonCommercial 4.0 International License','http://creativecommons.org/licenses/by-nc/4.0/','https://mirrors.creativecommons.org/presskit/buttons/88x31/svg/by-nc.svg','Creative Commons License',1); +INSERT INTO `il_md_cpr_selections` VALUES (4,'Attribution No Derivatives (by-nd)','Creative Commons License','\"Creative
This work is licensed under a Creative Commons Attribution-NoDerivatives 4.0 International License.','en',0,1,0,0,0,'Creative Commons Attribution-NoDerivatives 4.0 International License','http://creativecommons.org/licenses/by-nd/4.0/','https://mirrors.creativecommons.org/presskit/buttons/88x31/svg/by-nd.svg','Creative Commons License',1); +INSERT INTO `il_md_cpr_selections` VALUES (5,'Attribution Share Alike (by-sa)','Creative Commons License','\"Creative
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.','en',0,1,0,0,0,'Creative Commons Attribution-ShareAlike 4.0 International License','http://creativecommons.org/licenses/by-sa/4.0/','https://mirrors.creativecommons.org/presskit/buttons/88x31/svg/by-sa.svg','Creative Commons License',1); +INSERT INTO `il_md_cpr_selections` VALUES (6,'Attribution (by)','Creative Commons License','\"Creative
This work is licensed under a Creative Commons Attribution 4.0 International License.','en',0,1,0,0,0,'Creative Commons Attribution 4.0 International License','http://creativecommons.org/licenses/by/4.0/','https://mirrors.creativecommons.org/presskit/buttons/88x31/svg/by.svg','Creative Commons License',1); +INSERT INTO `il_md_cpr_selections` VALUES (7,'All rights reserved','','This work has all rights reserved by the owner.','en',0,1,1,0,0,'This work has all rights reserved by the owner.','','','',1); -- -- Table structure for table `il_md_cpr_selections_seq` @@ -9455,7 +9426,7 @@ INSERT INTO `il_object_def` VALUES ('prgr','StudyProgrammeReference','Modules/St INSERT INTO `il_object_def` VALUES ('prgs','StudyProgrammeAdmin','Modules/StudyProgramme','Modules/StudyProgramme/classes',0,0,'sys',0,0,0,1,1,0,0,NULL,0,0,1,0,1,0,0,0,0); INSERT INTO `il_object_def` VALUES ('prss','PersonalWorkspaceSettings','Services/PersonalWorkspace','Services/PersonalWorkspace/classes',0,0,'sys',0,0,0,1,1,0,0,NULL,0,0,1,0,1,0,0,0,0); INSERT INTO `il_object_def` VALUES ('prtf','Portfolio','Modules/Portfolio','Modules/Portfolio/classes',0,0,'0',0,0,0,0,0,0,0,NULL,0,0,0,0,0,0,0,0,0); -INSERT INTO `il_object_def` VALUES ('prtt','PortfolioTemplate','Modules/Portfolio','Modules/Portfolio/Template',0,0,'0',0,1,1,1,0,0,500,NULL,500,1,1,0,0,0,0,0,0); +INSERT INTO `il_object_def` VALUES ('prtt','PortfolioTemplate','Modules/Portfolio','Modules/Portfolio/Template',1,0,'0',0,1,1,1,0,0,500,NULL,500,1,1,0,0,0,0,0,0); INSERT INTO `il_object_def` VALUES ('ps','PrivacySecurity','Services/PrivacySecurity','Services/PrivacySecurity/classes',0,0,'sys',0,0,0,1,1,0,0,NULL,0,0,1,0,1,0,0,0,0); INSERT INTO `il_object_def` VALUES ('qpl','QuestionPool','Modules/TestQuestionPool','Modules/TestQuestionPool/classes',1,1,'0',0,1,1,1,0,0,210,NULL,200,1,1,0,0,0,0,0,0); INSERT INTO `il_object_def` VALUES ('rcat','RemoteCategory','Modules/RemoteCategory','Modules/RemoteCategory/classes',1,0,'0',0,1,1,1,0,0,30,'cat',40,0,0,0,0,0,0,0,0); @@ -13142,7 +13113,7 @@ INSERT INTO `object_data` VALUES (34,'typ','lm','Learning module Object',-1,'200 INSERT INTO `object_data` VALUES (35,'typ','notf','Note Folder Object',-1,'2002-12-21 00:04:00','2002-12-21 00:04:00','',NULL); INSERT INTO `object_data` VALUES (36,'typ','note','Note Object',-1,'2002-12-21 00:04:00','2002-12-21 00:04:00','',NULL); INSERT INTO `object_data` VALUES (37,'typ','frm','Forum object',-1,'2002-07-15 15:54:22','2003-08-15 12:36:40','',NULL); -INSERT INTO `object_data` VALUES (70,'lng','en','installed',-1,NULL,'2024-10-01 13:17:03','',NULL); +INSERT INTO `object_data` VALUES (70,'lng','en','installed',-1,NULL,'2024-11-19 15:18:20','',NULL); INSERT INTO `object_data` VALUES (71,'lng','de','not_installed',6,'2003-08-15 10:25:19','2015-12-22 16:29:24','',NULL); INSERT INTO `object_data` VALUES (72,'lng','es','not_installed',6,'2003-08-15 10:25:19','2003-08-15 10:25:19','',NULL); INSERT INTO `object_data` VALUES (73,'lng','it','not_installed',6,'2003-08-15 10:25:19','2003-08-15 10:25:19','',NULL); @@ -20135,7 +20106,7 @@ INSERT INTO `settings` VALUES ('common','ilfrmnoti1','1'); INSERT INTO `settings` VALUES ('common','ilfrmreadidx1','1'); INSERT INTO `settings` VALUES ('common','ilfrmthri2','1'); INSERT INTO `settings` VALUES ('common','ilGlobalTstPoolUsageSettingInitilisation','1'); -INSERT INTO `settings` VALUES ('common','ilias_version','8.15.0'); +INSERT INTO `settings` VALUES ('common','ilias_version','8.16.0'); INSERT INTO `settings` VALUES ('common','ilinc_akclassvalues_required','1'); INSERT INTO `settings` VALUES ('common','ilmpathix','1'); INSERT INTO `settings` VALUES ('common','iloscmsgidx1','1'); @@ -25120,4 +25091,4 @@ CREATE TABLE `xmlvalue_seq` ( --- Dump completed on 2024-10-01 13:17:04 +-- Dump completed on 2024-11-19 15:18:21 From 811157200fef0c04342fa80f166417629d5374f9 Mon Sep 17 00:00:00 2001 From: mjansen Date: Wed, 20 Nov 2024 08:44:37 +0100 Subject: [PATCH 231/292] Auth/Init/A11Y: Prevent empty unordered list on logout page See: https://mantis.ilias.de/view.php?id=41784 (cherry picked from commit 553f1423b91e0753ce48ef3958598da1d22e1934) (cherry picked from commit 1edb8c8d0912ff434c7447002e1a545e11868f52) --- Services/Init/templates/default/tpl.startup_screen.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Services/Init/templates/default/tpl.startup_screen.html b/Services/Init/templates/default/tpl.startup_screen.html index fd0b041c05c1..67dad4177f73 100755 --- a/Services/Init/templates/default/tpl.startup_screen.html +++ b/Services/Init/templates/default/tpl.startup_screen.html @@ -22,6 +22,7 @@

{IMG_PAGEHEADLINE} {TXT_ + + {STARTUP_CONTENT} From c2c7296394195c86cac47cedb3008fd476e73466 Mon Sep 17 00:00:00 2001 From: Releasemanager Date: Tue, 19 Nov 2024 15:35:57 +0000 Subject: [PATCH 232/292] Update composer.lock after release v8.16 --- composer.lock | 369 +++++++++++++++++++++++++------------------------- 1 file changed, 185 insertions(+), 184 deletions(-) diff --git a/composer.lock b/composer.lock index 6b1484a0c5d9..a12b9dbfaa81 100644 --- a/composer.lock +++ b/composer.lock @@ -163,20 +163,20 @@ }, { "name": "ezyang/htmlpurifier", - "version": "v4.17.0", + "version": "v4.18.0", "source": { "type": "git", "url": "https://github.com/ezyang/htmlpurifier.git", - "reference": "bbc513d79acf6691fa9cf10f192c90dd2957f18c" + "reference": "cb56001e54359df7ae76dc522d08845dc741621b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/bbc513d79acf6691fa9cf10f192c90dd2957f18c", - "reference": "bbc513d79acf6691fa9cf10f192c90dd2957f18c", + "url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/cb56001e54359df7ae76dc522d08845dc741621b", + "reference": "cb56001e54359df7ae76dc522d08845dc741621b", "shasum": "" }, "require": { - "php": "~5.6.0 || ~7.0.0 || ~7.1.0 || ~7.2.0 || ~7.3.0 || ~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0" + "php": "~5.6.0 || ~7.0.0 || ~7.1.0 || ~7.2.0 || ~7.3.0 || ~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0" }, "require-dev": { "cerdic/css-tidy": "^1.7 || ^2.0", @@ -218,9 +218,9 @@ ], "support": { "issues": "https://github.com/ezyang/htmlpurifier/issues", - "source": "https://github.com/ezyang/htmlpurifier/tree/v4.17.0" + "source": "https://github.com/ezyang/htmlpurifier/tree/v4.18.0" }, - "time": "2023-11-17T15:01:25+00:00" + "time": "2024-11-01T03:51:45+00:00" }, { "name": "filp/whoops", @@ -622,16 +622,16 @@ }, { "name": "guzzlehttp/promises", - "version": "2.0.3", + "version": "2.0.4", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "6ea8dd08867a2a42619d65c3deb2c0fcbf81c8f8" + "reference": "f9c436286ab2892c7db7be8c8da4ef61ccf7b455" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/6ea8dd08867a2a42619d65c3deb2c0fcbf81c8f8", - "reference": "6ea8dd08867a2a42619d65c3deb2c0fcbf81c8f8", + "url": "https://api.github.com/repos/guzzle/promises/zipball/f9c436286ab2892c7db7be8c8da4ef61ccf7b455", + "reference": "f9c436286ab2892c7db7be8c8da4ef61ccf7b455", "shasum": "" }, "require": { @@ -685,7 +685,7 @@ ], "support": { "issues": "https://github.com/guzzle/promises/issues", - "source": "https://github.com/guzzle/promises/tree/2.0.3" + "source": "https://github.com/guzzle/promises/tree/2.0.4" }, "funding": [ { @@ -701,7 +701,7 @@ "type": "tidelift" } ], - "time": "2024-07-18T10:29:17+00:00" + "time": "2024-10-17T10:06:22+00:00" }, { "name": "guzzlehttp/psr7", @@ -1326,16 +1326,16 @@ }, { "name": "monolog/monolog", - "version": "2.9.3", + "version": "2.10.0", "source": { "type": "git", "url": "https://github.com/Seldaek/monolog.git", - "reference": "a30bfe2e142720dfa990d0a7e573997f5d884215" + "reference": "5cf826f2991858b54d5c3809bee745560a1042a7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/a30bfe2e142720dfa990d0a7e573997f5d884215", - "reference": "a30bfe2e142720dfa990d0a7e573997f5d884215", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/5cf826f2991858b54d5c3809bee745560a1042a7", + "reference": "5cf826f2991858b54d5c3809bee745560a1042a7", "shasum": "" }, "require": { @@ -1412,7 +1412,7 @@ ], "support": { "issues": "https://github.com/Seldaek/monolog/issues", - "source": "https://github.com/Seldaek/monolog/tree/2.9.3" + "source": "https://github.com/Seldaek/monolog/tree/2.10.0" }, "funding": [ { @@ -1424,7 +1424,7 @@ "type": "tidelift" } ], - "time": "2024-04-12T20:52:51+00:00" + "time": "2024-11-12T12:43:37+00:00" }, { "name": "myclabs/php-enum", @@ -1734,16 +1734,16 @@ }, { "name": "phpmailer/phpmailer", - "version": "v6.9.1", + "version": "v6.9.2", "source": { "type": "git", "url": "https://github.com/PHPMailer/PHPMailer.git", - "reference": "039de174cd9c17a8389754d3b877a2ed22743e18" + "reference": "a7b17b42fa4887c92146243f3d2f4ccb962af17c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/039de174cd9c17a8389754d3b877a2ed22743e18", - "reference": "039de174cd9c17a8389754d3b877a2ed22743e18", + "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/a7b17b42fa4887c92146243f3d2f4ccb962af17c", + "reference": "a7b17b42fa4887c92146243f3d2f4ccb962af17c", "shasum": "" }, "require": { @@ -1803,7 +1803,7 @@ "description": "PHPMailer is a full-featured email creation and transfer class for PHP", "support": { "issues": "https://github.com/PHPMailer/PHPMailer/issues", - "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.9.1" + "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.9.2" }, "funding": [ { @@ -1811,7 +1811,7 @@ "type": "github" } ], - "time": "2023-11-25T22:23:28+00:00" + "time": "2024-10-09T10:07:50+00:00" }, { "name": "phpoffice/phpspreadsheet", @@ -2677,16 +2677,16 @@ }, { "name": "sabre/dav", - "version": "4.6.0", + "version": "4.7.0", "source": { "type": "git", "url": "https://github.com/sabre-io/dav.git", - "reference": "554145304b4a026477d130928d16e626939b0b2a" + "reference": "074373bcd689a30bcf5aaa6bbb20a3395964ce7a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sabre-io/dav/zipball/554145304b4a026477d130928d16e626939b0b2a", - "reference": "554145304b4a026477d130928d16e626939b0b2a", + "url": "https://api.github.com/repos/sabre-io/dav/zipball/074373bcd689a30bcf5aaa6bbb20a3395964ce7a", + "reference": "074373bcd689a30bcf5aaa6bbb20a3395964ce7a", "shasum": "" }, "require": { @@ -2756,7 +2756,7 @@ "issues": "https://github.com/sabre-io/dav/issues", "source": "https://github.com/fruux/sabre-dav" }, - "time": "2023-12-11T13:01:23+00:00" + "time": "2024-10-29T11:46:02+00:00" }, { "name": "sabre/event", @@ -2949,16 +2949,16 @@ }, { "name": "sabre/vobject", - "version": "4.5.5", + "version": "4.5.6", "source": { "type": "git", "url": "https://github.com/sabre-io/vobject.git", - "reference": "7148cf57d25aaba0a49f6656d37c35e8175b3087" + "reference": "900266bb3bd448a9f7f41f82344ad0aba237cb27" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sabre-io/vobject/zipball/7148cf57d25aaba0a49f6656d37c35e8175b3087", - "reference": "7148cf57d25aaba0a49f6656d37c35e8175b3087", + "url": "https://api.github.com/repos/sabre-io/vobject/zipball/900266bb3bd448a9f7f41f82344ad0aba237cb27", + "reference": "900266bb3bd448a9f7f41f82344ad0aba237cb27", "shasum": "" }, "require": { @@ -2968,9 +2968,9 @@ }, "require-dev": { "friendsofphp/php-cs-fixer": "~2.17.1", - "phpstan/phpstan": "^0.12", + "phpstan/phpstan": "^0.12 || ^1.11", "phpunit/php-invoker": "^2.0 || ^3.1", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.0" + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.6" }, "suggest": { "hoa/bench": "If you would like to run the benchmark scripts" @@ -3049,7 +3049,7 @@ "issues": "https://github.com/sabre-io/vobject/issues", "source": "https://github.com/fruux/sabre-vobject" }, - "time": "2024-07-02T08:48:52+00:00" + "time": "2024-10-14T11:53:54+00:00" }, { "name": "sabre/xml", @@ -5069,16 +5069,16 @@ }, { "name": "symfony/cache", - "version": "v5.4.44", + "version": "v5.4.46", "source": { "type": "git", "url": "https://github.com/symfony/cache.git", - "reference": "4b3e7bf157b8b5a010865701d9106b5f0a9c99a8" + "reference": "0fe08ee32cec2748fbfea10c52d3ee02049e0f6b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/cache/zipball/4b3e7bf157b8b5a010865701d9106b5f0a9c99a8", - "reference": "4b3e7bf157b8b5a010865701d9106b5f0a9c99a8", + "url": "https://api.github.com/repos/symfony/cache/zipball/0fe08ee32cec2748fbfea10c52d3ee02049e0f6b", + "reference": "0fe08ee32cec2748fbfea10c52d3ee02049e0f6b", "shasum": "" }, "require": { @@ -5146,7 +5146,7 @@ "psr6" ], "support": { - "source": "https://github.com/symfony/cache/tree/v5.4.44" + "source": "https://github.com/symfony/cache/tree/v5.4.46" }, "funding": [ { @@ -5162,7 +5162,7 @@ "type": "tidelift" } ], - "time": "2024-09-13T16:57:39+00:00" + "time": "2024-11-04T11:43:55+00:00" }, { "name": "symfony/cache-contracts", @@ -5245,16 +5245,16 @@ }, { "name": "symfony/config", - "version": "v5.4.40", + "version": "v5.4.46", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "d4e1db78421163b98dd9971d247fd0df4a57ee5e" + "reference": "977c88a02d7d3f16904a81907531b19666a08e78" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/d4e1db78421163b98dd9971d247fd0df4a57ee5e", - "reference": "d4e1db78421163b98dd9971d247fd0df4a57ee5e", + "url": "https://api.github.com/repos/symfony/config/zipball/977c88a02d7d3f16904a81907531b19666a08e78", + "reference": "977c88a02d7d3f16904a81907531b19666a08e78", "shasum": "" }, "require": { @@ -5304,7 +5304,7 @@ "description": "Helps you find, load, combine, autofill and validate configuration values of any kind", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/config/tree/v5.4.40" + "source": "https://github.com/symfony/config/tree/v5.4.46" }, "funding": [ { @@ -5320,20 +5320,20 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:33:22+00:00" + "time": "2024-10-30T07:58:02+00:00" }, { "name": "symfony/console", - "version": "v5.4.44", + "version": "v5.4.47", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "5b5a0aa66e3296e303e22490f90f521551835a83" + "reference": "c4ba980ca61a9eb18ee6bcc73f28e475852bb1ed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/5b5a0aa66e3296e303e22490f90f521551835a83", - "reference": "5b5a0aa66e3296e303e22490f90f521551835a83", + "url": "https://api.github.com/repos/symfony/console/zipball/c4ba980ca61a9eb18ee6bcc73f28e475852bb1ed", + "reference": "c4ba980ca61a9eb18ee6bcc73f28e475852bb1ed", "shasum": "" }, "require": { @@ -5403,7 +5403,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.4.44" + "source": "https://github.com/symfony/console/tree/v5.4.47" }, "funding": [ { @@ -5419,20 +5419,20 @@ "type": "tidelift" } ], - "time": "2024-09-20T07:56:40+00:00" + "time": "2024-11-06T11:30:55+00:00" }, { "name": "symfony/dependency-injection", - "version": "v5.4.44", + "version": "v5.4.45", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "23eb9f3803a931aef16a65f362a9aeb0640a1374" + "reference": "0c199da64bb27e4216ccccb83f451e2ec66b3c4b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/23eb9f3803a931aef16a65f362a9aeb0640a1374", - "reference": "23eb9f3803a931aef16a65f362a9aeb0640a1374", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/0c199da64bb27e4216ccccb83f451e2ec66b3c4b", + "reference": "0c199da64bb27e4216ccccb83f451e2ec66b3c4b", "shasum": "" }, "require": { @@ -5492,7 +5492,7 @@ "description": "Allows you to standardize and centralize the way objects are constructed in your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/dependency-injection/tree/v5.4.44" + "source": "https://github.com/symfony/dependency-injection/tree/v5.4.45" }, "funding": [ { @@ -5508,7 +5508,7 @@ "type": "tidelift" } ], - "time": "2024-09-12T20:01:35+00:00" + "time": "2024-10-22T18:49:16+00:00" }, { "name": "symfony/deprecation-contracts", @@ -5579,16 +5579,16 @@ }, { "name": "symfony/error-handler", - "version": "v5.4.42", + "version": "v5.4.46", "source": { "type": "git", "url": "https://github.com/symfony/error-handler.git", - "reference": "db15ba0fd50890156ed40087ccedc7851a1f5b76" + "reference": "d19ede7a2cafb386be9486c580649d0f9e3d0363" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/error-handler/zipball/db15ba0fd50890156ed40087ccedc7851a1f5b76", - "reference": "db15ba0fd50890156ed40087ccedc7851a1f5b76", + "url": "https://api.github.com/repos/symfony/error-handler/zipball/d19ede7a2cafb386be9486c580649d0f9e3d0363", + "reference": "d19ede7a2cafb386be9486c580649d0f9e3d0363", "shasum": "" }, "require": { @@ -5630,7 +5630,7 @@ "description": "Provides tools to manage errors and ease debugging PHP code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/error-handler/tree/v5.4.42" + "source": "https://github.com/symfony/error-handler/tree/v5.4.46" }, "funding": [ { @@ -5646,20 +5646,20 @@ "type": "tidelift" } ], - "time": "2024-07-23T12:34:05+00:00" + "time": "2024-11-05T14:17:06+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v5.4.40", + "version": "v5.4.45", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "a54e2a8a114065f31020d6a89ede83e34c3b27a4" + "reference": "72982eb416f61003e9bb6e91f8b3213600dcf9e9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/a54e2a8a114065f31020d6a89ede83e34c3b27a4", - "reference": "a54e2a8a114065f31020d6a89ede83e34c3b27a4", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/72982eb416f61003e9bb6e91f8b3213600dcf9e9", + "reference": "72982eb416f61003e9bb6e91f8b3213600dcf9e9", "shasum": "" }, "require": { @@ -5715,7 +5715,7 @@ "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/v5.4.40" + "source": "https://github.com/symfony/event-dispatcher/tree/v5.4.45" }, "funding": [ { @@ -5731,7 +5731,7 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:33:22+00:00" + "time": "2024-09-25T14:11:13+00:00" }, { "name": "symfony/event-dispatcher-contracts", @@ -5814,16 +5814,16 @@ }, { "name": "symfony/filesystem", - "version": "v5.4.44", + "version": "v5.4.45", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "76c3818964e9d32be3862c9318ae3ba9aa280ddc" + "reference": "57c8294ed37d4a055b77057827c67f9558c95c54" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/76c3818964e9d32be3862c9318ae3ba9aa280ddc", - "reference": "76c3818964e9d32be3862c9318ae3ba9aa280ddc", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/57c8294ed37d4a055b77057827c67f9558c95c54", + "reference": "57c8294ed37d4a055b77057827c67f9558c95c54", "shasum": "" }, "require": { @@ -5861,7 +5861,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v5.4.44" + "source": "https://github.com/symfony/filesystem/tree/v5.4.45" }, "funding": [ { @@ -5877,20 +5877,20 @@ "type": "tidelift" } ], - "time": "2024-09-16T14:52:48+00:00" + "time": "2024-10-22T13:05:35+00:00" }, { "name": "symfony/finder", - "version": "v5.4.43", + "version": "v5.4.45", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "ae25a9145a900764158d439653d5630191155ca0" + "reference": "63741784cd7b9967975eec610b256eed3ede022b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/ae25a9145a900764158d439653d5630191155ca0", - "reference": "ae25a9145a900764158d439653d5630191155ca0", + "url": "https://api.github.com/repos/symfony/finder/zipball/63741784cd7b9967975eec610b256eed3ede022b", + "reference": "63741784cd7b9967975eec610b256eed3ede022b", "shasum": "" }, "require": { @@ -5924,7 +5924,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v5.4.43" + "source": "https://github.com/symfony/finder/tree/v5.4.45" }, "funding": [ { @@ -5940,20 +5940,20 @@ "type": "tidelift" } ], - "time": "2024-08-13T14:03:51+00:00" + "time": "2024-09-28T13:32:08+00:00" }, { "name": "symfony/framework-bundle", - "version": "v5.4.44", + "version": "v5.4.45", "source": { "type": "git", "url": "https://github.com/symfony/framework-bundle.git", - "reference": "9ae1957fb817c0fec6d171931f675895a434d988" + "reference": "3d70f14176422d4d8ee400b6acae4e21f7c25ca2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/framework-bundle/zipball/9ae1957fb817c0fec6d171931f675895a434d988", - "reference": "9ae1957fb817c0fec6d171931f675895a434d988", + "url": "https://api.github.com/repos/symfony/framework-bundle/zipball/3d70f14176422d4d8ee400b6acae4e21f7c25ca2", + "reference": "3d70f14176422d4d8ee400b6acae4e21f7c25ca2", "shasum": "" }, "require": { @@ -5992,6 +5992,7 @@ "symfony/mime": "<4.4", "symfony/property-access": "<5.3", "symfony/property-info": "<4.4", + "symfony/runtime": "<5.4.45|>=6.0,<6.4.13|>=7.0,<7.1.6", "symfony/security-csrf": "<5.3", "symfony/serializer": "<5.2", "symfony/service-contracts": ">=3.0", @@ -6074,7 +6075,7 @@ "description": "Provides a tight integration between Symfony components and the Symfony full-stack framework", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/framework-bundle/tree/v5.4.44" + "source": "https://github.com/symfony/framework-bundle/tree/v5.4.45" }, "funding": [ { @@ -6090,20 +6091,20 @@ "type": "tidelift" } ], - "time": "2024-09-20T08:11:35+00:00" + "time": "2024-10-22T13:05:35+00:00" }, { "name": "symfony/http-foundation", - "version": "v5.4.44", + "version": "v5.4.46", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "ae0d217e5932aa0b70ddb4cf7822cc76d48aee53" + "reference": "168b77c71e6f02d8fc479db78beaf742a37d3cab" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/ae0d217e5932aa0b70ddb4cf7822cc76d48aee53", - "reference": "ae0d217e5932aa0b70ddb4cf7822cc76d48aee53", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/168b77c71e6f02d8fc479db78beaf742a37d3cab", + "reference": "168b77c71e6f02d8fc479db78beaf742a37d3cab", "shasum": "" }, "require": { @@ -6150,7 +6151,7 @@ "description": "Defines an object-oriented layer for the HTTP specification", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-foundation/tree/v5.4.44" + "source": "https://github.com/symfony/http-foundation/tree/v5.4.46" }, "funding": [ { @@ -6166,20 +6167,20 @@ "type": "tidelift" } ], - "time": "2024-09-15T07:55:06+00:00" + "time": "2024-11-05T15:52:21+00:00" }, { "name": "symfony/http-kernel", - "version": "v5.4.44", + "version": "v5.4.47", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "788dcf72d9af7432a886aa3b0c5904d68087ba13" + "reference": "0ac42d5e16317f15dc5f8ea83742c51d2ed2350f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/788dcf72d9af7432a886aa3b0c5904d68087ba13", - "reference": "788dcf72d9af7432a886aa3b0c5904d68087ba13", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/0ac42d5e16317f15dc5f8ea83742c51d2ed2350f", + "reference": "0ac42d5e16317f15dc5f8ea83742c51d2ed2350f", "shasum": "" }, "require": { @@ -6263,7 +6264,7 @@ "description": "Provides a structured process for converting a Request into a Response", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-kernel/tree/v5.4.44" + "source": "https://github.com/symfony/http-kernel/tree/v5.4.47" }, "funding": [ { @@ -6279,7 +6280,7 @@ "type": "tidelift" } ], - "time": "2024-09-21T05:47:58+00:00" + "time": "2024-11-13T13:47:53+00:00" }, { "name": "symfony/polyfill-ctype", @@ -6898,16 +6899,16 @@ }, { "name": "symfony/routing", - "version": "v5.4.43", + "version": "v5.4.45", "source": { "type": "git", "url": "https://github.com/symfony/routing.git", - "reference": "b6f71780bbdd5e93e1c5638671cf0ba42aa8c6d8" + "reference": "986597b3d1c86ecefe094c0c236a9e9ad22756f2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/b6f71780bbdd5e93e1c5638671cf0ba42aa8c6d8", - "reference": "b6f71780bbdd5e93e1c5638671cf0ba42aa8c6d8", + "url": "https://api.github.com/repos/symfony/routing/zipball/986597b3d1c86ecefe094c0c236a9e9ad22756f2", + "reference": "986597b3d1c86ecefe094c0c236a9e9ad22756f2", "shasum": "" }, "require": { @@ -6968,7 +6969,7 @@ "url" ], "support": { - "source": "https://github.com/symfony/routing/tree/v5.4.43" + "source": "https://github.com/symfony/routing/tree/v5.4.45" }, "funding": [ { @@ -6984,7 +6985,7 @@ "type": "tidelift" } ], - "time": "2024-08-27T06:36:52+00:00" + "time": "2024-09-30T08:44:06+00:00" }, { "name": "symfony/service-contracts", @@ -7071,16 +7072,16 @@ }, { "name": "symfony/string", - "version": "v5.4.44", + "version": "v5.4.47", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "832caa16b6d9aac6bf11747315225f5aba384c24" + "reference": "136ca7d72f72b599f2631aca474a4f8e26719799" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/832caa16b6d9aac6bf11747315225f5aba384c24", - "reference": "832caa16b6d9aac6bf11747315225f5aba384c24", + "url": "https://api.github.com/repos/symfony/string/zipball/136ca7d72f72b599f2631aca474a4f8e26719799", + "reference": "136ca7d72f72b599f2631aca474a4f8e26719799", "shasum": "" }, "require": { @@ -7137,7 +7138,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.4.44" + "source": "https://github.com/symfony/string/tree/v5.4.47" }, "funding": [ { @@ -7153,20 +7154,20 @@ "type": "tidelift" } ], - "time": "2024-09-20T07:56:40+00:00" + "time": "2024-11-10T20:33:58+00:00" }, { "name": "symfony/var-dumper", - "version": "v5.4.43", + "version": "v5.4.47", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "6be6a6a8af4818564e3726fc65cf936f34743cef" + "reference": "e13e8dfa8eaab2b0536ef365beddc2af723a9ac0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/6be6a6a8af4818564e3726fc65cf936f34743cef", - "reference": "6be6a6a8af4818564e3726fc65cf936f34743cef", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/e13e8dfa8eaab2b0536ef365beddc2af723a9ac0", + "reference": "e13e8dfa8eaab2b0536ef365beddc2af723a9ac0", "shasum": "" }, "require": { @@ -7226,7 +7227,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v5.4.43" + "source": "https://github.com/symfony/var-dumper/tree/v5.4.47" }, "funding": [ { @@ -7242,20 +7243,20 @@ "type": "tidelift" } ], - "time": "2024-08-30T16:01:46+00:00" + "time": "2024-11-08T15:21:10+00:00" }, { "name": "symfony/var-exporter", - "version": "v5.4.40", + "version": "v5.4.45", "source": { "type": "git", "url": "https://github.com/symfony/var-exporter.git", - "reference": "6a13d37336d512927986e09f19a4bed24178baa6" + "reference": "862700068db0ddfd8c5b850671e029a90246ec75" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-exporter/zipball/6a13d37336d512927986e09f19a4bed24178baa6", - "reference": "6a13d37336d512927986e09f19a4bed24178baa6", + "url": "https://api.github.com/repos/symfony/var-exporter/zipball/862700068db0ddfd8c5b850671e029a90246ec75", + "reference": "862700068db0ddfd8c5b850671e029a90246ec75", "shasum": "" }, "require": { @@ -7299,7 +7300,7 @@ "serialize" ], "support": { - "source": "https://github.com/symfony/var-exporter/tree/v5.4.40" + "source": "https://github.com/symfony/var-exporter/tree/v5.4.45" }, "funding": [ { @@ -7315,20 +7316,20 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:33:22+00:00" + "time": "2024-09-25T14:11:13+00:00" }, { "name": "symfony/yaml", - "version": "v5.4.44", + "version": "v5.4.45", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "7025b964f123bbf1896d7563db6ec7f1f63e918a" + "reference": "a454d47278cc16a5db371fe73ae66a78a633371e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/7025b964f123bbf1896d7563db6ec7f1f63e918a", - "reference": "7025b964f123bbf1896d7563db6ec7f1f63e918a", + "url": "https://api.github.com/repos/symfony/yaml/zipball/a454d47278cc16a5db371fe73ae66a78a633371e", + "reference": "a454d47278cc16a5db371fe73ae66a78a633371e", "shasum": "" }, "require": { @@ -7374,7 +7375,7 @@ "description": "Loads and dumps YAML files", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/yaml/tree/v5.4.44" + "source": "https://github.com/symfony/yaml/tree/v5.4.45" }, "funding": [ { @@ -7390,7 +7391,7 @@ "type": "tidelift" } ], - "time": "2024-09-16T14:36:56+00:00" + "time": "2024-09-25T14:11:13+00:00" }, { "name": "technosophos/libris", @@ -7442,16 +7443,16 @@ }, { "name": "tecnickcom/tcpdf", - "version": "6.7.5", + "version": "6.7.7", "source": { "type": "git", "url": "https://github.com/tecnickcom/TCPDF.git", - "reference": "951eabf0338ec2522bd0d5d9c79b08a3a3d36b36" + "reference": "cfbc0028cc23f057f2baf9e73bdc238153c22086" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/tecnickcom/TCPDF/zipball/951eabf0338ec2522bd0d5d9c79b08a3a3d36b36", - "reference": "951eabf0338ec2522bd0d5d9c79b08a3a3d36b36", + "url": "https://api.github.com/repos/tecnickcom/TCPDF/zipball/cfbc0028cc23f057f2baf9e73bdc238153c22086", + "reference": "cfbc0028cc23f057f2baf9e73bdc238153c22086", "shasum": "" }, "require": { @@ -7502,7 +7503,7 @@ ], "support": { "issues": "https://github.com/tecnickcom/TCPDF/issues", - "source": "https://github.com/tecnickcom/TCPDF/tree/6.7.5" + "source": "https://github.com/tecnickcom/TCPDF/tree/6.7.7" }, "funding": [ { @@ -7510,7 +7511,7 @@ "type": "custom" } ], - "time": "2024-04-20T17:25:10+00:00" + "time": "2024-10-26T12:15:02+00:00" }, { "name": "twig/extensions", @@ -7909,16 +7910,16 @@ }, { "name": "composer/pcre", - "version": "3.3.1", + "version": "3.3.2", "source": { "type": "git", "url": "https://github.com/composer/pcre.git", - "reference": "63aaeac21d7e775ff9bc9d45021e1745c97521c4" + "reference": "b2bed4734f0cc156ee1fe9c0da2550420d99a21e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/pcre/zipball/63aaeac21d7e775ff9bc9d45021e1745c97521c4", - "reference": "63aaeac21d7e775ff9bc9d45021e1745c97521c4", + "url": "https://api.github.com/repos/composer/pcre/zipball/b2bed4734f0cc156ee1fe9c0da2550420d99a21e", + "reference": "b2bed4734f0cc156ee1fe9c0da2550420d99a21e", "shasum": "" }, "require": { @@ -7928,8 +7929,8 @@ "phpstan/phpstan": "<1.11.10" }, "require-dev": { - "phpstan/phpstan": "^1.11.10", - "phpstan/phpstan-strict-rules": "^1.1", + "phpstan/phpstan": "^1.12 || ^2", + "phpstan/phpstan-strict-rules": "^1 || ^2", "phpunit/phpunit": "^8 || ^9" }, "type": "library", @@ -7968,7 +7969,7 @@ ], "support": { "issues": "https://github.com/composer/pcre/issues", - "source": "https://github.com/composer/pcre/tree/3.3.1" + "source": "https://github.com/composer/pcre/tree/3.3.2" }, "funding": [ { @@ -7984,7 +7985,7 @@ "type": "tidelift" } ], - "time": "2024-08-27T18:44:43+00:00" + "time": "2024-11-12T16:29:46+00:00" }, { "name": "composer/semver", @@ -8602,16 +8603,16 @@ }, { "name": "myclabs/deep-copy", - "version": "1.12.0", + "version": "1.12.1", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c" + "reference": "123267b2c49fbf30d78a7b2d333f6be754b94845" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c", - "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/123267b2c49fbf30d78a7b2d333f6be754b94845", + "reference": "123267b2c49fbf30d78a7b2d333f6be754b94845", "shasum": "" }, "require": { @@ -8650,7 +8651,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.12.0" + "source": "https://github.com/myclabs/DeepCopy/tree/1.12.1" }, "funding": [ { @@ -8658,20 +8659,20 @@ "type": "tidelift" } ], - "time": "2024-06-12T14:39:25+00:00" + "time": "2024-11-08T17:47:46+00:00" }, { "name": "nikic/php-parser", - "version": "v5.3.0", + "version": "v5.3.1", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "3abf7425cd284141dc5d8d14a9ee444de3345d1a" + "reference": "8eea230464783aa9671db8eea6f8c6ac5285794b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/3abf7425cd284141dc5d8d14a9ee444de3345d1a", - "reference": "3abf7425cd284141dc5d8d14a9ee444de3345d1a", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/8eea230464783aa9671db8eea6f8c6ac5285794b", + "reference": "8eea230464783aa9671db8eea6f8c6ac5285794b", "shasum": "" }, "require": { @@ -8714,9 +8715,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v5.3.0" + "source": "https://github.com/nikic/PHP-Parser/tree/v5.3.1" }, - "time": "2024-09-29T13:56:26+00:00" + "time": "2024-10-08T18:51:32+00:00" }, { "name": "phar-io/manifest", @@ -8838,16 +8839,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.12.5", + "version": "1.12.11", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "7e6c6cb7cecb0a6254009a1a8a7d54ec99812b17" + "reference": "0d1fc20a962a91be578bcfe7cf939e6e1a2ff733" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/7e6c6cb7cecb0a6254009a1a8a7d54ec99812b17", - "reference": "7e6c6cb7cecb0a6254009a1a8a7d54ec99812b17", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/0d1fc20a962a91be578bcfe7cf939e6e1a2ff733", + "reference": "0d1fc20a962a91be578bcfe7cf939e6e1a2ff733", "shasum": "" }, "require": { @@ -8892,7 +8893,7 @@ "type": "github" } ], - "time": "2024-09-26T12:45:22+00:00" + "time": "2024-11-17T14:08:01+00:00" }, { "name": "phpunit/php-code-coverage", @@ -11046,16 +11047,16 @@ }, { "name": "symfony/options-resolver", - "version": "v5.4.40", + "version": "v5.4.45", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "bd1afbde6613a8d6b956115e0e14b196191fd0c4" + "reference": "74e5b6f0db3e8589e6cfd5efb317a1fc2bb52fb6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/bd1afbde6613a8d6b956115e0e14b196191fd0c4", - "reference": "bd1afbde6613a8d6b956115e0e14b196191fd0c4", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/74e5b6f0db3e8589e6cfd5efb317a1fc2bb52fb6", + "reference": "74e5b6f0db3e8589e6cfd5efb317a1fc2bb52fb6", "shasum": "" }, "require": { @@ -11095,7 +11096,7 @@ "options" ], "support": { - "source": "https://github.com/symfony/options-resolver/tree/v5.4.40" + "source": "https://github.com/symfony/options-resolver/tree/v5.4.45" }, "funding": [ { @@ -11111,20 +11112,20 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:33:22+00:00" + "time": "2024-09-25T14:11:13+00:00" }, { "name": "symfony/process", - "version": "v5.4.44", + "version": "v5.4.47", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "1b9fa82b5c62cd49da8c9e3952dd8531ada65096" + "reference": "5d1662fb32ebc94f17ddb8d635454a776066733d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/1b9fa82b5c62cd49da8c9e3952dd8531ada65096", - "reference": "1b9fa82b5c62cd49da8c9e3952dd8531ada65096", + "url": "https://api.github.com/repos/symfony/process/zipball/5d1662fb32ebc94f17ddb8d635454a776066733d", + "reference": "5d1662fb32ebc94f17ddb8d635454a776066733d", "shasum": "" }, "require": { @@ -11157,7 +11158,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v5.4.44" + "source": "https://github.com/symfony/process/tree/v5.4.47" }, "funding": [ { @@ -11173,20 +11174,20 @@ "type": "tidelift" } ], - "time": "2024-09-17T12:46:43+00:00" + "time": "2024-11-06T11:36:42+00:00" }, { "name": "symfony/stopwatch", - "version": "v5.4.40", + "version": "v5.4.45", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "0e9daf3b7c805c747638b2cc48f1649e594f9625" + "reference": "fb2c199cf302eb207f8c23e7ee174c1c31a5c004" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/0e9daf3b7c805c747638b2cc48f1649e594f9625", - "reference": "0e9daf3b7c805c747638b2cc48f1649e594f9625", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/fb2c199cf302eb207f8c23e7ee174c1c31a5c004", + "reference": "fb2c199cf302eb207f8c23e7ee174c1c31a5c004", "shasum": "" }, "require": { @@ -11219,7 +11220,7 @@ "description": "Provides a way to profile code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/stopwatch/tree/v5.4.40" + "source": "https://github.com/symfony/stopwatch/tree/v5.4.45" }, "funding": [ { @@ -11235,7 +11236,7 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:33:22+00:00" + "time": "2024-09-25T14:11:13+00:00" }, { "name": "theseer/tokenizer", @@ -11290,7 +11291,7 @@ ], "aliases": [], "minimum-stability": "stable", - "stability-flags": {}, + "stability-flags": [], "prefer-stable": false, "prefer-lowest": false, "platform": { @@ -11305,6 +11306,6 @@ "ext-mbstring": "*", "ext-xml": "*" }, - "platform-dev": {}, + "platform-dev": [], "plugin-api-version": "2.6.0" } From d3f5f0de64aee3e2b53903adc347fa132fcabbc7 Mon Sep 17 00:00:00 2001 From: Rainer Rillke Date: Wed, 20 Nov 2024 10:27:19 +0100 Subject: [PATCH 233/292] 42733: Restore CAS auth functionality (#8434) * 42733: Restore CAS auth functionality - do not use deprecated setDebug() - fix call to phpCAS::client() by providing ILIAS base URL - Add more debug logging https://mantis.ilias.de/view.php?id=42733 --- .../CAS/classes/class.ilAuthProviderCAS.php | 38 ++++++++++++------- 1 file changed, 25 insertions(+), 13 deletions(-) diff --git a/Services/CAS/classes/class.ilAuthProviderCAS.php b/Services/CAS/classes/class.ilAuthProviderCAS.php index 82185c8f1478..503480752f0d 100644 --- a/Services/CAS/classes/class.ilAuthProviderCAS.php +++ b/Services/CAS/classes/class.ilAuthProviderCAS.php @@ -1,20 +1,22 @@ getLogger()->debug('Starting cas authentication attempt... '); try { - phpCAS::setDebug(false); - phpCAS::setVerbose(true); + // Uncomment the following line to get trace-level loggin by CAS + //phpCAS::setLogger($this->getLogger()); + // Caution: If you set this to "true", there might be output + // and the redirect won't work and you get an ILIAS Whoopsy + // Though, you may need to for debugging other issues. + phpCAS::setVerbose(false); + $this->getLogger()->debug('Create client... '); phpCAS::client( CAS_VERSION_2_0, $this->getSettings()->getServer(), $this->getSettings()->getPort(), - $this->getSettings()->getUri() + $this->getSettings()->getUri(), + ilUtil::_getHttpPath() ); phpCAS::setNoCasServerValidation(); + $this->getLogger()->debug('Fore CAS auth... '); phpCAS::forceAuthentication(); + $this->getLogger()->debug('Fore CAS auth done.'); } catch (Exception $e) { $this->getLogger()->error('Cas authentication failed with message: ' . $e->getMessage()); $this->handleAuthenticationFail($status, 'err_wrong_login'); @@ -58,9 +68,11 @@ public function doAuthentication(ilAuthStatus $status): bool } if (phpCAS::getUser() === '') { + $this->getLogger()->debug('CAS user is empty.'); return $this->handleAuthenticationFail($status, 'err_wrong_login'); } $this->getCredentials()->setUsername(phpCAS::getUser()); + $this->getLogger()->debug('user name set to CAS user.'); // check and handle ldap data sources if (ilLDAPServer::isDataSourceActive(ilAuthUtils::AUTH_CAS)) { From a25e9543be037d88032a36711c6d6d31184b6916 Mon Sep 17 00:00:00 2001 From: Tim Schmitz Date: Wed, 20 Nov 2024 12:23:30 +0100 Subject: [PATCH 234/292] EmployeeTalk: fix table for removed templates (42833) --- .../EmployeeTalk/classes/Talk/class.ilEmployeeTalkTableGUI.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/EmployeeTalk/classes/Talk/class.ilEmployeeTalkTableGUI.php b/Modules/EmployeeTalk/classes/Talk/class.ilEmployeeTalkTableGUI.php index 2d3d19dcdbb1..c48b63366d1a 100644 --- a/Modules/EmployeeTalk/classes/Talk/class.ilEmployeeTalkTableGUI.php +++ b/Modules/EmployeeTalk/classes/Talk/class.ilEmployeeTalkTableGUI.php @@ -241,7 +241,7 @@ public function setTalkData(array $talks): void } $template_title = ''; - if ($talkData->getTemplateId() > 0) { + if ($talkData->getTemplateId() > 0 && ilObject::_exists($talkData->getTemplateId())) { $template = ilObjectFactory::getInstanceByObjId($talkData->getTemplateId()); $template_title = $template->getTitle(); } From 10803f5f19fcf893c988619b2591d7724405eb51 Mon Sep 17 00:00:00 2001 From: Tim Schmitz Date: Fri, 22 Nov 2024 10:53:26 +0100 Subject: [PATCH 235/292] Course: do not show contact mail link if user has no access (31589) --- Modules/Course/classes/class.ilObjCourseGUI.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Modules/Course/classes/class.ilObjCourseGUI.php b/Modules/Course/classes/class.ilObjCourseGUI.php index 9a78f10a7232..2e850663098c 100755 --- a/Modules/Course/classes/class.ilObjCourseGUI.php +++ b/Modules/Course/classes/class.ilObjCourseGUI.php @@ -289,10 +289,20 @@ public function infoScreen(): void ); } if ($this->object->getContactEmail()) { + /* needs to be rbacsystem, does not work with ilAccess */ + $has_mail_access = $this->rbacsystem->checkAccessOfUser( + $this->user->getId(), + 'internal_mail', + ilMailGlobalServices::getMailObjectRefId() + ); $emails = explode(",", $this->object->getContactEmail()); $mailString = ''; foreach ($emails as $email) { $email = trim($email); + if (!$has_mail_access) { + $mailString .= $email . "
"; + continue; + } $etpl = new ilTemplate("tpl.crs_contact_email.html", true, true, 'Modules/Course'); $etpl->setVariable( "EMAIL_LINK", From 9a332b2817f8d58cc6c94f272a14651b1007654d Mon Sep 17 00:00:00 2001 From: Fabian Helfer Date: Thu, 21 Nov 2024 09:13:18 +0100 Subject: [PATCH 236/292] Fix UserAutocomplete Limit being ignored --- Services/User/classes/class.ilUserAutoComplete.php | 1 + 1 file changed, 1 insertion(+) diff --git a/Services/User/classes/class.ilUserAutoComplete.php b/Services/User/classes/class.ilUserAutoComplete.php index e469dac5a43e..5d1317b7a413 100644 --- a/Services/User/classes/class.ilUserAutoComplete.php +++ b/Services/User/classes/class.ilUserAutoComplete.php @@ -243,6 +243,7 @@ public function getList(string $a_str): string } $recs[$rec['usr_id']] = $rec; $usrIds[] = $rec['usr_id']; + $cnt++; } $callable_name = null; if (is_callable($this->user_filter, true, $callable_name)) { From 64d7d73fcd1bbb1a0f56f4df048b834f21540302 Mon Sep 17 00:00:00 2001 From: mjansen Date: Thu, 21 Nov 2024 09:18:48 +0100 Subject: [PATCH 237/292] User: Fix accessing undefined key `default_hits_per_page` See: https://mantis.ilias.de/view.php?id=42866 --- Services/User/classes/class.ilObjUserFolderGUI.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Services/User/classes/class.ilObjUserFolderGUI.php b/Services/User/classes/class.ilObjUserFolderGUI.php index f81e280e279d..43da878eba8b 100755 --- a/Services/User/classes/class.ilObjUserFolderGUI.php +++ b/Services/User/classes/class.ilObjUserFolderGUI.php @@ -2765,10 +2765,10 @@ public function saveGlobalUserSettingsObject(string $action = ""): void } } - if ($selected["default_hits_per_page"]) { + if (isset($selected['default_hits_per_page']) && $selected['default_hits_per_page']) { $ilias->setSetting( - "hits_per_page", - $selected["default_hits_per_page"] + 'hits_per_page', + $selected['default_hits_per_page'] ); } From 5cb932d90301af466da24e9dfe024f39d68e14b9 Mon Sep 17 00:00:00 2001 From: Stephan Kergomard Date: Fri, 22 Nov 2024 15:47:24 +0100 Subject: [PATCH 238/292] Test: Change to in LangVar See: https://mantis.ilias.de/view.php?id=41733 --- lang/ilias_de.lang | 2 +- lang/ilias_en.lang | 2 +- lang/ilias_hu.lang | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lang/ilias_de.lang b/lang/ilias_de.lang index f8d4db15da5d..71cb3b7e8b60 100644 --- a/lang/ilias_de.lang +++ b/lang/ilias_de.lang @@ -1408,7 +1408,7 @@ assessment#:#tst_edit_competence_assign#:#Bearbeite Zuordnungs-Eigenschaften assessment#:#tst_edit_scoring#:#Ändere Bewertung assessment#:#tst_ending_time#:#Ende assessment#:#tst_ending_time_before_starting_time#:#Bitte geben Sie für das Ende des Tests ein Datum ein, das nach dem Startdatum liegt. -assessment#:#tst_ending_time_desc#:#Zeitpunkt, ab dem Teilnehmer keine Antworten mehr abgeben können. Wichtig: Benutzen Sie diese Option nicht für E-Klausuren/Fernklausuren. Verwenden Sie stattdessen die Funktion „Bearbeitungsdauer begrenzen“, siehe unten. Nur dann wird der Test serverseitig beendet und die letzte Eingabe bei Freitext-Fragen jedes Teilnehmers automatisch als Auto-Save-Inhalt gespeichert. +assessment#:#tst_ending_time_desc#:#Zeitpunkt, ab dem Teilnehmer keine Antworten mehr abgeben können. Wichtig: Benutzen Sie diese Option nicht für E-Klausuren/Fernklausuren. Verwenden Sie stattdessen die Funktion „Bearbeitungsdauer begrenzen“, siehe unten. Nur dann wird der Test serverseitig beendet und die letzte Eingabe bei Freitext-Fragen jedes Teilnehmers automatisch als Auto-Save-Inhalt gespeichert. assessment#:#tst_enter_questionpool#:#Bitte geben Sie den Namen eines Fragenpools an, in dem die neue Frage abgelegt werden soll assessment#:#tst_eval_question_points#:#Fragenergebnisse für Testdurchlauf %s assessment#:#tst_eval_results_by_pass#:#Detaillierte Testergebnisse für Testdurchlauf %s diff --git a/lang/ilias_en.lang b/lang/ilias_en.lang index 39c88e4ea6fb..4807b129cd66 100644 --- a/lang/ilias_en.lang +++ b/lang/ilias_en.lang @@ -1408,7 +1408,7 @@ assessment#:#tst_edit_competence_assign#:#Edit Assignment Properties assessment#:#tst_edit_scoring#:#Edit Scoring assessment#:#tst_ending_time#:#End assessment#:#tst_ending_time_before_starting_time#:#Please enter a date for the end of the test that is after the start date. -assessment#:#tst_ending_time_desc#:#Time from which participants can no longer submit answers. Important: Do not use this option for e-exams/distance exams. Instead, use the function 'Limit Duration of Test' (see below). Only then will the test be ended on the server side and each participant's last entry on Essay-Questions automatically saved as auto-save-content. +assessment#:#tst_ending_time_desc#:#Time from which participants can no longer submit answers. Important: Do not use this option for e-exams/distance exams. Instead, use the function 'Limit Duration of Test' (see below). Only then will the test be ended on the server side and each participant's last entry on Essay-Questions automatically saved as auto-save-content. assessment#:#tst_enter_questionpool#:#Please enter a question pool name where the new question will be stored assessment#:#tst_eval_question_points#:#Question Results for Pass %s assessment#:#tst_eval_results_by_pass#:#List of Answers for Pass %s diff --git a/lang/ilias_hu.lang b/lang/ilias_hu.lang index 98fcc88c7367..6fc504683b6b 100644 --- a/lang/ilias_hu.lang +++ b/lang/ilias_hu.lang @@ -1408,7 +1408,7 @@ assessment#:#tst_edit_competence_assign#:#Összerendelési tulajdonságok módos assessment#:#tst_edit_scoring#:#Pontozás módosítása assessment#:#tst_ending_time#:#Záró időpont assessment#:#tst_ending_time_before_starting_time#:#A tesztet lezáró, a kezdődátumnál későbbi dátum. -assessment#:#tst_ending_time_desc#:#Az az időpont, ami utána résztvevők már nem tudnak választ adni. Fontos: Ne használja ezt a lehetőséget vizsgánál, helyett inkább korlátozza a kitöltési időt. Csak ez utóbbi esetben fejeződik be a teszt a szerveroldalon, illetve ekkor mentjük automatikusan az utolsó beírt választ. +assessment#:#tst_ending_time_desc#:#Az az időpont, ami utána résztvevők már nem tudnak választ adni. Fontos: Ne használja ezt a lehetőséget vizsgánál, helyett inkább korlátozza a kitöltési időt. Csak ez utóbbi esetben fejeződik be a teszt a szerveroldalon, illetve ekkor mentjük automatikusan az utolsó beírt választ. assessment#:#tst_enter_questionpool#:#Adja meg annak a kérdéssornak a nevét, amelybe menteni szeretné az új kérdést. assessment#:#tst_eval_question_points#:#Eredményes teljesítéshez kérdéseredmények %s assessment#:#tst_eval_results_by_pass#:#%s. tesztkitöltés kérdésre adott válaszai From 72a3865dc3b7dd174890e202d3b6dd7fb47e9c23 Mon Sep 17 00:00:00 2001 From: mjansen Date: Thu, 21 Nov 2024 09:28:44 +0100 Subject: [PATCH 239/292] User: Fix accessing undefined key `default_mail_incoming_mail` (and others) See: https://mantis.ilias.de/view.php?id=42867 --- Services/User/classes/class.ilObjUserFolderGUI.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Services/User/classes/class.ilObjUserFolderGUI.php b/Services/User/classes/class.ilObjUserFolderGUI.php index 43da878eba8b..cebd76846107 100755 --- a/Services/User/classes/class.ilObjUserFolderGUI.php +++ b/Services/User/classes/class.ilObjUserFolderGUI.php @@ -2783,23 +2783,23 @@ public function saveGlobalUserSettingsObject(string $action = ""): void $ilias->setSetting( 'mail_incoming_mail', - (int) $selected['default_mail_incoming_mail'] + $selected['default_mail_incoming_mail'] ?? '0' ); $ilias->setSetting( 'chat_osc_accept_msg', - $selected['default_chat_osc_accept_msg'] + $selected['default_chat_osc_accept_msg'] ?? 'n' ); $ilias->setSetting( 'chat_broadcast_typing', - $selected['default_chat_broadcast_typing'] + $selected['default_chat_broadcast_typing'] ?? 'n' ); $ilias->setSetting( 'bs_allow_to_contact_me', - $selected['default_bs_allow_to_contact_me'] + $selected['default_bs_allow_to_contact_me'] ?? 'n' ); $ilias->setSetting( 'hide_own_online_status', - $selected['default_hide_own_online_status'] + $selected['default_hide_own_online_status'] ?? 'n' ); if ($this->usrFieldChangeListenersAccepted && count($changedFields) > 0) { From 27c0c795e8431eca2afd87a9d16d908471a3215c Mon Sep 17 00:00:00 2001 From: Alexander Killing Date: Mon, 25 Nov 2024 10:58:36 +0100 Subject: [PATCH 240/292] copage: fixed Undefined array key --- Services/COPage/classes/class.ilPCMediaObjectGUI.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Services/COPage/classes/class.ilPCMediaObjectGUI.php b/Services/COPage/classes/class.ilPCMediaObjectGUI.php index ec5fa8d04343..e57d3868771c 100755 --- a/Services/COPage/classes/class.ilPCMediaObjectGUI.php +++ b/Services/COPage/classes/class.ilPCMediaObjectGUI.php @@ -1318,7 +1318,7 @@ public function getStyleInput(): ilAdvSelectInputGUI $chars = $this->getCharacteristics(); if (is_object($this->content_obj)) { - if ($chars[$selected] == "" && ($this->content_obj->getClass() != "")) { + if (($chars[$selected] ?? "") == "" && ($this->content_obj->getClass() != "")) { $chars = array_merge( array($this->content_obj->getClass() => $this->content_obj->getClass()), $chars From a70bed1c5cc1a00b3c950fa33f63919e294ebc4e Mon Sep 17 00:00:00 2001 From: iszmais <45942348+iszmais@users.noreply.github.com> Date: Mon, 25 Nov 2024 13:34:31 +0100 Subject: [PATCH 241/292] Init copy field option (#8484) --- .../Fields/Copy/class.ilDclCopyFieldModel.php | 44 ++++++ .../class.ilDclCopyFieldRepresentation.php | 134 ++++++++++++++++++ .../Copy/class.ilDclCopyRecordFieldModel.php | 34 +++++ .../class.ilDclCopyRecordRepresentation.php | 29 ++++ .../class.ilDataCollectionDBUpdateSteps80.php | 22 +++ lang/ilias_de.lang | 5 + lang/ilias_en.lang | 5 + 7 files changed, 273 insertions(+) create mode 100644 Modules/DataCollection/classes/Fields/Copy/class.ilDclCopyFieldModel.php create mode 100644 Modules/DataCollection/classes/Fields/Copy/class.ilDclCopyFieldRepresentation.php create mode 100644 Modules/DataCollection/classes/Fields/Copy/class.ilDclCopyRecordFieldModel.php create mode 100644 Modules/DataCollection/classes/Fields/Copy/class.ilDclCopyRecordRepresentation.php diff --git a/Modules/DataCollection/classes/Fields/Copy/class.ilDclCopyFieldModel.php b/Modules/DataCollection/classes/Fields/Copy/class.ilDclCopyFieldModel.php new file mode 100644 index 000000000000..6fc1d5f175b3 --- /dev/null +++ b/Modules/DataCollection/classes/Fields/Copy/class.ilDclCopyFieldModel.php @@ -0,0 +1,44 @@ +getId()} ON (filter_record_field_{$this->getId()}.record_id = record.id AND filter_record_field_{$this->getId()}.field_id = " + . $this->db->quote($this->getId(), 'integer') . ") "; + $join_str .= "INNER JOIN il_dcl_stloc{$this->getStorageLocation()}_value AS filter_stloc_{$this->getId()} ON (filter_stloc_{$this->getId()}.record_field_id = filter_record_field_{$this->getId()}.id AND filter_stloc_{$this->getId()}.value LIKE " + . $this->db->quote("%$filter_value%", 'text') . ") "; + + $sql_obj = new ilDclRecordQueryObject(); + $sql_obj->setJoinStatement($join_str); + + return $sql_obj; + } + + public function getValidFieldProperties(): array + { + return [ + ilDclBaseFieldModel::PROP_REFERENCE, + ilDclBaseFieldModel::PROP_N_REFERENCE + ]; + } +} diff --git a/Modules/DataCollection/classes/Fields/Copy/class.ilDclCopyFieldRepresentation.php b/Modules/DataCollection/classes/Fields/Copy/class.ilDclCopyFieldRepresentation.php new file mode 100644 index 000000000000..92b02f852117 --- /dev/null +++ b/Modules/DataCollection/classes/Fields/Copy/class.ilDclCopyFieldRepresentation.php @@ -0,0 +1,134 @@ +getField()->getProperty(ilDclBaseFieldModel::PROP_N_REFERENCE)) { + $input = new ilMultiSelectInputGUI($this->getField()->getTitle(), 'field_' . $this->getField()->getId()); + } else { + $input = new ilSelectInputGUI($this->getField()->getTitle(), 'field_' . $this->getField()->getId()); + } + + $this->setupInputField($input, $this->getField()); + + $options = []; + if (!$this->getField()->getProperty(ilDclBaseFieldModel::PROP_N_REFERENCE)) { + $options[''] = $this->lng->txt('dcl_please_select'); + } + + $value = null; + $copy_id = $this->getField()->getProperty(ilDclBaseFieldModel::PROP_REFERENCE); + $copy_field = ilDclCache::getFieldCache($copy_id); + if ($copy_field->getTableId() !== 0) { + $copy_table = ilDclCache::getTableCache($copy_field->getTableId()); + foreach ($copy_table->getRecords() as $record) { + $option = $record->getRecordField($copy_field->getId())->getPlainText(); + if (!in_array($option, $options)) { + $options[$option] = $option; + } + } + } else { + $input->setAlert($this->lng->txt('dcl_origin_not_found')); + } + + if ($record_id !== null) { + $value = ilDclCache::getRecordCache($record_id)->getRecordFieldValue($this->getField()->getId()); + if ($value !== '' && !array_key_exists($value, $options)) { + $options[$value] = $value . ' ' . $this->lng->txt('dcl_deprecated_copy'); + } + } + + $input->setOptions($options); + + return $input; + } + + public function addFilterInputFieldToTable(ilTable2GUI $table) + { + $input = $table->addFilterItemByMetaType( + "filter_" . $this->getField()->getId(), + ilTable2GUI::FILTER_TEXT, + false, + $this->getField()->getId() + ); + $input->setSubmitFormOnEnter(true); + + $this->setupFilterInputField($input); + + return $this->getFilterInputFieldValue($input); + } + + public function passThroughFilter(ilDclBaseRecordModel $record, $filter): bool + { + $pass = parent::passThroughFilter($record, $filter); + + $value = $record->getRecordFieldValue($this->getField()->getId()); + if (!$filter || strpos(strtolower($value), strtolower($filter)) !== false) { + $pass = true; + } + + return $pass; + } + + protected function buildFieldCreationInput(ilObjDataCollection $dcl, string $mode = 'create'): ilRadioOption + { + $datetype_title = $this->getField()->getDatatype()->getTitle(); + if ($datetype_title === 'copy') { + $datetype_title = 'copy_field'; + } + $opt = new ilRadioOption($this->lng->txt('dcl_' . $datetype_title), $this->getField()->getDatatypeId()); + $opt->setInfo($this->lng->txt('dcl_' . $datetype_title . '_desc')); + + $options = []; + $tables = $dcl->getTables(); + foreach ($tables as $table) { + foreach ($table->getRecordFields() as $field) { + if (in_array($field->getDatatypeId(), self::VALID_TYPES)) { + $options[$field->getId()] = $table->getTitle() . ' -> ' . $field->getTitle(); + } + } + } + + $prop_table_selection = new ilSelectInputGUI( + $this->lng->txt('dcl_copy_title'), + 'prop_' . ilDclBaseFieldModel::PROP_REFERENCE + ); + $prop_table_selection->setOptions($options); + $opt->addSubItem($prop_table_selection); + + $prop_multi_select = new ilDclCheckboxInputGUI( + $this->lng->txt('dcl_multiple_selection'), + 'prop_' . ilDclBaseFieldModel::PROP_N_REFERENCE + ); + $opt->addSubItem($prop_multi_select); + + return $opt; + } +} diff --git a/Modules/DataCollection/classes/Fields/Copy/class.ilDclCopyRecordFieldModel.php b/Modules/DataCollection/classes/Fields/Copy/class.ilDclCopyRecordFieldModel.php new file mode 100644 index 000000000000..d1eb1abdf956 --- /dev/null +++ b/Modules/DataCollection/classes/Fields/Copy/class.ilDclCopyRecordFieldModel.php @@ -0,0 +1,34 @@ +getInput('field_' . $this->getField()->getId()); + if (is_array($value)) { + $value = implode(', ', $value); + } + $this->setValue($value); + } +} diff --git a/Modules/DataCollection/classes/Fields/Copy/class.ilDclCopyRecordRepresentation.php b/Modules/DataCollection/classes/Fields/Copy/class.ilDclCopyRecordRepresentation.php new file mode 100644 index 000000000000..b10710beeeb6 --- /dev/null +++ b/Modules/DataCollection/classes/Fields/Copy/class.ilDclCopyRecordRepresentation.php @@ -0,0 +1,29 @@ +getField()->getProperty(ilDclBaseFieldModel::PROP_N_REFERENCE)) { + $value = [$value]; + } + + return parent::parseFormInput($value); + } +} diff --git a/Modules/DataCollection/classes/Setup/class.ilDataCollectionDBUpdateSteps80.php b/Modules/DataCollection/classes/Setup/class.ilDataCollectionDBUpdateSteps80.php index 9ae8f56c2fba..d6f5181fb6a7 100644 --- a/Modules/DataCollection/classes/Setup/class.ilDataCollectionDBUpdateSteps80.php +++ b/Modules/DataCollection/classes/Setup/class.ilDataCollectionDBUpdateSteps80.php @@ -222,4 +222,26 @@ public function step_12(): void [ilDclDatatype::INPUTFORMAT_PLUGIN] ); } + + public function step_13(): void + { + $id = false; + $stmt = $this->db->queryF('SELECT id FROM il_dcl_datatype WHERE id LIKE %s', [ilDBConstants::T_INTEGER], [17]); + if ($row = $this->db->fetchAssoc($stmt)) { + $id = true; + } + + if (!$id) { + $this->db->insert( + 'il_dcl_datatype', + [ + 'id' => [ilDBConstants::T_INTEGER, 17], + 'title' => [ilDBConstants::T_TEXT, 'copy'], + 'ildb_type' => [ilDBConstants::T_TEXT, ilDBConstants::T_TEXT], + 'storage_location' => [ilDBConstants::T_INTEGER, 1], + 'sort' => [ilDBConstants::T_INTEGER, 85], + ] + ); + } + } } diff --git a/lang/ilias_de.lang b/lang/ilias_de.lang index 71cb3b7e8b60..a20dd848cd63 100644 --- a/lang/ilias_de.lang +++ b/lang/ilias_de.lang @@ -8469,6 +8469,9 @@ dcl#:#dcl_confirm_delete_table#:#Wollen Sie diese Tabelle wirklich löschen inkl dcl#:#dcl_confirm_storing_records#:#Bitte überprüfen Sie die Angaben vor dem Speichern. dcl#:#dcl_confirm_storing_records_no_permission#:#Sie haben keine Rechte, den Datensatz später nochmals zu bearbeiten. dcl#:#dcl_copy#:#Datensammlung kopieren +dcl#:#dcl_copy_field#:#Kopie +dcl#:#dcl_copy_field_desc#:#Kopieren von Auswahloptionen, die in einem anderen Feld einer Tabelle gepflegt werden +dcl#:#dcl_copy_title#:#Kopie von Tabelle und Feld dcl#:#dcl_create_date#:#Erstellungsdatum dcl#:#dcl_create_entry_rules#:#Eintragserstellung dcl#:#dcl_create_field#:#Feld hinzufügen @@ -8493,6 +8496,7 @@ dcl#:#dcl_delete_tables_no_selection#:#Zum Löschen muss mindestens eine Tabelle dcl#:#dcl_delete_views#:#Ansichten löschen dcl#:#dcl_delete_views_no_selection#:#Zum Löschen muss mindestens eine Ansicht ausgewählt werden. dcl#:#dcl_deleted_records#:#Es wurden %s Datensätze gelöscht. +dcl#:#dcl_deprecated_copy#:#(Veraltet) dcl#:#dcl_desc#:#Absteigende Reihenfolge (DESC) dcl#:#dcl_description#:#Beschreibung dcl#:#dcl_detailed_view#:#Einzelansicht @@ -8611,6 +8615,7 @@ dcl#:#dcl_number#:#Ganze Zahlen dcl#:#dcl_number_desc#:#Eingabefeld für ganze Zahlen (maximal 9 Ziffern). Nicht erlaubt sind Brüche und Dezimalzahlen. dcl#:#dcl_online_info#:#Nur wenn die Datensammlung online geschaltet ist, können Benutzer die Datensammlung sehen und benutzen. dcl#:#dcl_order#:#Sortierung +dcl#:#dcl_origin_not_found#:#Urprungsfeld konnte nicht gefunden werden! dcl#:#dcl_own_entries#:#Nur eigene Einträge dcl#:#dcl_owner#:#Eigener Eintrag von ###Modified as part of gender mainstreaming activities for ILIAS 8 dcl#:#dcl_owner_description#:#Eigene Einträge bleiben stets sichtbar.###Modified as part of gender mainstreaming activities for ILIAS 8 diff --git a/lang/ilias_en.lang b/lang/ilias_en.lang index 4807b129cd66..ebc25fecd026 100644 --- a/lang/ilias_en.lang +++ b/lang/ilias_en.lang @@ -8469,6 +8469,9 @@ dcl#:#dcl_confirm_delete_table#:#Do you really want to delete this table with it dcl#:#dcl_confirm_storing_records#:#Please validate and confirm your input. dcl#:#dcl_confirm_storing_records_no_permission#:#You have no permission to change the record afterwards. dcl#:#dcl_copy#:#Copy Data Collection +dcl#:#dcl_copy_field#:#Copy +dcl#:#dcl_copy_field_desc#:#Field to copy options stored in a different field of a table. +dcl#:#dcl_copy_title#:#Copy of table and field dcl#:#dcl_create_date#:#Creation Date dcl#:#dcl_create_entry_rules#:#Entry Creation dcl#:#dcl_create_field#:#Create Field @@ -8493,6 +8496,7 @@ dcl#:#dcl_delete_tables_no_selection#:#Please select at least one table to delet dcl#:#dcl_delete_views#:#Delete Views dcl#:#dcl_delete_views_no_selection#:#Please select at least one view to delete dcl#:#dcl_deleted_records#:#Successfully deleted %s Entries +dcl#:#dcl_deprecated_copy#:#(Deprecated) dcl#:#dcl_desc#:#Descending Order (DESC) dcl#:#dcl_description#:#Field Description dcl#:#dcl_detailed_view#:#Single @@ -8611,6 +8615,7 @@ dcl#:#dcl_number#:#Integer dcl#:#dcl_number_desc#:#Field for integer values (max. 9 digits). No decimals or fractions. dcl#:#dcl_online_info#:#Only if the Data Collection is online, users are able to use the Data Collection. dcl#:#dcl_order#:#Order +dcl#:#dcl_origin_not_found#:#Origin field was not found! dcl#:#dcl_own_entries#:#Only own entries dcl#:#dcl_owner#:#Owner dcl#:#dcl_owner_description#:#The owner of the entry. From 4dc647097305e2d6447d654a1e1bfa3903aa2c9b Mon Sep 17 00:00:00 2001 From: kergomard <13102171+kergomard@users.noreply.github.com> Date: Mon, 25 Nov 2024 13:35:10 +0100 Subject: [PATCH 242/292] RBAC: Move getRolesByFilter to Generator (#8442) * RBAC: Move getRolesByFilter to Generator See: https://mantis.ilias.de/view.php?id=42223 * RBAC: Document "Array Shape" for "Role List Entry" --------- Co-authored-by: mjansen --- .../classes/class.ilRbacReview.php | 98 ++++++++++++------- .../classes/class.ilRoleTableGUI.php | 23 ++--- .../class.ilRoleAssignmentTableGUI.php | 6 +- .../User/classes/class.ilUserTableGUI.php | 3 +- 4 files changed, 74 insertions(+), 56 deletions(-) diff --git a/Services/AccessControl/classes/class.ilRbacReview.php b/Services/AccessControl/classes/class.ilRbacReview.php index 8afe93a71a5c..23871876457b 100755 --- a/Services/AccessControl/classes/class.ilRbacReview.php +++ b/Services/AccessControl/classes/class.ilRbacReview.php @@ -1,7 +1,5 @@ * @version $Id$ * @ingroup ServicesAccessControl + * @phpstan-type RoleListEntry array{obj_id: int, rol_id: int, parent: int, user_id: int, owner: int, title: ?string, desc: string, description: string, create_date: ?string, last_update: ?string, import_id: ?string, tile_image_rid: ?string, role_type: string, offline: ?int, type: string, assign: string, protected: bool, blocked: int, rol_id: int} */ class ilRbacReview { @@ -134,6 +134,7 @@ public function getParentRoleIds(int $a_endnode_id, bool $a_templates = false): /** * Returns a list of roles in an container + * @return list */ public function getRoleListByObject(int $a_ref_id, bool $a_templates = false): array { @@ -161,13 +162,30 @@ public function getRoleListByObject(int $a_ref_id, bool $a_templates = false): a /** * Returns a list of all assignable roles + * @return list */ public function getAssignableRoles( bool $a_templates = false, bool $a_internal_roles = false, string $title_filter = '' ): array { - $role_list = []; + return iterator_to_array( + $this->getAssignableRolesGenerator( + $a_templates, + $a_internal_roles, + $title_filter + ) + ); + } + + /** + * @return Generator + */ + private function getAssignableRolesGenerator( + bool $a_templates = false, + bool $a_internal_roles = false, + string $title_filter = '' + ): Generator { $where = $this->__setTemplateFilter($a_templates); $query = "SELECT * FROM object_data " . "JOIN rbac_fa ON obj_id = rol_id " . @@ -189,9 +207,8 @@ public function getAssignableRoles( $row["user_id"] = (int) $row["owner"]; $row['obj_id'] = (int) $row['obj_id']; $row['parent'] = (int) $row['parent']; - $role_list[] = $row; + yield $this->setRoleTypeAndProtection($row); } - return $this->__setRoleType($role_list); } /** @@ -267,30 +284,43 @@ protected function __setTemplateFilter(bool $a_templates): string protected function __setRoleType(array $a_role_list): array { foreach ($a_role_list as $key => $val) { - // determine role type - if ($val["type"] == "rolt") { - $a_role_list[$key]["role_type"] = "template"; - } else { - if ($val["assign"] == "y") { - if ($val["parent"] == ROLE_FOLDER_ID) { - $a_role_list[$key]["role_type"] = "global"; - } else { - $a_role_list[$key]["role_type"] = "local"; - } - } else { - $a_role_list[$key]["role_type"] = "linked"; - } - } - - if ($val["protected"] == "y") { - $a_role_list[$key]["protected"] = true; - } else { - $a_role_list[$key]["protected"] = false; - } + $a_role_list[$key] = $this->setRoleTypeAndProtection($val); } return $a_role_list; } + private function setRoleTypeAndProtection(array $role_list_entry): array + { + $role_list_entry['role_type'] = $this->buildRoleType($role_list_entry); + $role_list_entry['protected'] = $this->buildProtectionByStringValue($role_list_entry['protected']); + return $role_list_entry; + } + + private function buildRoleType(array $role_list_entry): string + { + if ($role_list_entry['type'] === 'rolt') { + return 'template'; + } + + if ($role_list_entry['assign'] !== 'y') { + return 'linked'; + } + + if ($role_list_entry['parent'] === ROLE_FOLDER_ID) { + return 'global'; + } + + return 'local'; + } + + private function buildProtectionByStringValue(string $value): bool + { + if ($value === 'y') { + return true; + } + return false; + } + /** * Get the number of assigned users to roles (not properly deleted user accounts are not counted) * @param int[] $a_roles @@ -813,15 +843,19 @@ public function isGlobalRole(int $a_role_id): bool return in_array($a_role_id, $this->getGlobalRoles()); } - public function getRolesByFilter(int $a_filter = 0, int $a_user_id = 0, string $title_filter = ''): array + /** + * @return Generator + */ + public function getRolesByFilter(int $a_filter = 0, int $a_user_id = 0, string $title_filter = ''): Generator { $assign = "y"; switch ($a_filter) { // all (assignable) roles case self::FILTER_ALL: - return $this->getAssignableRoles(true, true, $title_filter); + yield from $this->getAssignableRolesGenerator(true, true, $title_filter); // all (assignable) global roles + // no break case self::FILTER_ALL_GLOBAL: $where = 'WHERE ' . $this->db->in('rbac_fa.rol_id', $this->getGlobalRoles(), false, 'integer') . ' '; break; @@ -854,8 +888,6 @@ public function getRolesByFilter(int $a_filter = 0, int $a_user_id = 0, string $ break; } - $roles = []; - $query = "SELECT * FROM object_data " . "JOIN rbac_fa ON obj_id = rol_id " . $where . @@ -890,9 +922,9 @@ public function getRolesByFilter(int $a_filter = 0, int $a_user_id = 0, string $ $row['obj_id'] = (int) $row['obj_id']; $row['rol_id'] = (int) $row['rol_id']; $row['parent'] = (int) $row['parent']; - $roles[] = $row; + + yield $this->setRoleTypeAndProtection($row); } - return $this->__setRoleType($roles); } public function getTypeId(string $a_type): int diff --git a/Services/AccessControl/classes/class.ilRoleTableGUI.php b/Services/AccessControl/classes/class.ilRoleTableGUI.php index 7c97de2a60ef..65f4008741c8 100644 --- a/Services/AccessControl/classes/class.ilRoleTableGUI.php +++ b/Services/AccessControl/classes/class.ilRoleTableGUI.php @@ -1,6 +1,5 @@ @@ -258,28 +259,16 @@ public function parse(int $role_folder_id): void $filter_orig = ''; if ($this->getType() == self::TYPE_VIEW) { - $filter_orig = $title_filter = $this->filter[self::FILTER_TITLE]; + $filter_orig = $this->filter[self::FILTER_TITLE]; $type_filter = $this->filter[self::FILTER_ROLE_TYPE]; } else { - $filter_orig = $title_filter = $this->getRoleTitleFilter(); + $filter_orig = $this->getRoleTitleFilter(); $type_filter = ilRbacReview::FILTER_ALL; } - // the translation must be filtered - if ($type_filter == ilRbacReview::FILTER_INTERNAL || $type_filter == ilRbacReview::FILTER_ALL) { - // roles like il_crs_... are filtered manually - $title_filter = ''; - } - - $role_list = $this->rbacreview->getRolesByFilter( - $type_filter, - 0, - '' - ); - $counter = 0; - $rows = array(); - foreach ($role_list as $role) { + $rows = []; + foreach ($this->rbacreview->getRolesByFilter($type_filter, 0, '') as $role) { if ( $role['parent'] and ( diff --git a/Services/User/classes/class.ilRoleAssignmentTableGUI.php b/Services/User/classes/class.ilRoleAssignmentTableGUI.php index 8b0fc39b1ea7..d9b9fd1114f9 100644 --- a/Services/User/classes/class.ilRoleAssignmentTableGUI.php +++ b/Services/User/classes/class.ilRoleAssignmentTableGUI.php @@ -1,4 +1,5 @@ user(); $assignable = false; // @todo: check this - - // now get roles depending on filter settings - $role_list = $rbacreview->getRolesByFilter((int) $this->filter["role_filter"], $usr_id); $assigned_roles = $rbacreview->assignedRoles($usr_id); $counter = 0; $records = []; - foreach ($role_list as $role) { + foreach ($rbacreview->getRolesByFilter((int) $this->filter['role_filter'], $usr_id) as $role) { // fetch context path of role $rolf = $rbacreview->getFoldersAssignedToRole($role["obj_id"], true); $ref_id = $rbacreview->getObjectReferenceOfRole($role['rol_id']); diff --git a/Services/User/classes/class.ilUserTableGUI.php b/Services/User/classes/class.ilUserTableGUI.php index f13a8fbfe252..d5f7b1ea30b2 100644 --- a/Services/User/classes/class.ilUserTableGUI.php +++ b/Services/User/classes/class.ilUserTableGUI.php @@ -522,8 +522,7 @@ public function initFilter(): void $options = array( "" => $lng->txt("user_any"), ); - $roles = $rbacreview->getRolesByFilter(2, $ilUser->getId()); - foreach ($roles as $role) { + foreach ($rbacreview->getRolesByFilter(2, $ilUser->getId()) as $role) { $options[$role["rol_id"]] = $role["title"]; } $si = new ilSelectInputGUI($this->lng->txt("user_global_role"), "global_role"); From c9ec7d135896063516212c357bc702a86c444d8c Mon Sep 17 00:00:00 2001 From: iszmais <45942348+iszmais@users.noreply.github.com> Date: Mon, 25 Nov 2024 15:30:18 +0100 Subject: [PATCH 243/292] fix link for alternative view (#8506) --- .../TableView/class.ilDclTableViewTableGUI.php | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/Modules/DataCollection/classes/TableView/class.ilDclTableViewTableGUI.php b/Modules/DataCollection/classes/TableView/class.ilDclTableViewTableGUI.php index 62f6eb89410f..00853e55a91e 100644 --- a/Modules/DataCollection/classes/TableView/class.ilDclTableViewTableGUI.php +++ b/Modules/DataCollection/classes/TableView/class.ilDclTableViewTableGUI.php @@ -1,4 +1,5 @@ - * @ingroup ModulesDataCollection - */ class ilDclTableViewTableGUI extends ilTable2GUI { protected ilDclTable $table; @@ -229,7 +224,9 @@ public function fillRowFromObject(ilDclTableView $a_set): void } $this->tpl->setVariable("TITLE", $a_set->getTitle()); $this->ctrl->setParameterByClass('ildcltablevieweditgui', 'tableview_id', $a_set->getId()); - $this->tpl->setVariable("TITLE_LINK", $this->ctrl->getLinkTargetByClass('ildcltablevieweditgui')); + $this->tpl->setVariable("TITLE_LINK", $this->ctrl->getLinkTargetByClass( + [ilDclTableListGUI::class, ilDclTableViewGUI::class, ilDclTableViewEditGUI::class] + )); $this->tpl->setVariable("DESCRIPTION", $a_set->getDescription()); $icon = $this->factory->symbol()->icon()->custom(ilUtil::getImagePath('icon_not_ok_monochrome.svg'), $this->lng->txt("yes")); From e0e67632320c92368c106e545ddee6dc2f8e602d Mon Sep 17 00:00:00 2001 From: Fred Neumann Date: Mon, 25 Nov 2024 16:59:09 +0100 Subject: [PATCH 244/292] T&A fix 42872: CharSelectorConfig::setDefinition TypeError (#8508) --- Modules/Test/classes/class.ilObjTestSettingsGeneralGUI.php | 4 ++-- .../CharSelector/classes/class.ilCharSelectorGUI.php | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Modules/Test/classes/class.ilObjTestSettingsGeneralGUI.php b/Modules/Test/classes/class.ilObjTestSettingsGeneralGUI.php index 5a5a350e1b2e..779f1abf338d 100644 --- a/Modules/Test/classes/class.ilObjTestSettingsGeneralGUI.php +++ b/Modules/Test/classes/class.ilObjTestSettingsGeneralGUI.php @@ -1266,8 +1266,8 @@ private function addQuestionBehaviourProperties(ilPropertyFormGUI $form) if ($this->isCharSelectorPropertyRequired()) { require_once 'Services/UIComponent/CharSelector/classes/class.ilCharSelectorGUI.php'; $char_selector = new ilCharSelectorGUI(ilCharSelectorConfig::CONTEXT_TEST); - $char_selector->getConfig()->setAvailability($this->testOBJ->getCharSelectorAvailability()); - $char_selector->getConfig()->setDefinition($this->testOBJ->getCharSelectorDefinition()); + $char_selector->getConfig()->setAvailability((int) $this->testOBJ->getCharSelectorAvailability()); + $char_selector->getConfig()->setDefinition((string) $this->testOBJ->getCharSelectorDefinition()); $char_selector->addFormProperties($form); $char_selector->setFormValues($form); } diff --git a/Services/UIComponent/CharSelector/classes/class.ilCharSelectorGUI.php b/Services/UIComponent/CharSelector/classes/class.ilCharSelectorGUI.php index 1c82e2900c91..50ca1b28be97 100755 --- a/Services/UIComponent/CharSelector/classes/class.ilCharSelectorGUI.php +++ b/Services/UIComponent/CharSelector/classes/class.ilCharSelectorGUI.php @@ -194,9 +194,9 @@ public function setFormValues(ilPropertyFormGUI $a_form): void */ public function getFormValues(ilPropertyFormGUI $a_form): void { - $this->config->setAvailability($a_form->getInput('char_selector_availability')); - $this->config->setAddedBlocks($a_form->getInput('char_selector_blocks')); - $this->config->setCustomItems($a_form->getInput('char_selector_custom_items')); + $this->config->setAvailability((int) $a_form->getInput('char_selector_availability')); + $this->config->setAddedBlocks((array) $a_form->getInput('char_selector_blocks')); + $this->config->setCustomItems((string) $a_form->getInput('char_selector_custom_items')); } /** From dcc438e17e57632403894496ecaf8e1696ea8f82 Mon Sep 17 00:00:00 2001 From: Robin Baumgartner Date: Tue, 26 Nov 2024 11:11:57 +0100 Subject: [PATCH 245/292] Services/Component: Fix error message when downgrading plugins (#42931) --- .../Component/classes/class.ilArtifactComponentRepository.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Services/Component/classes/class.ilArtifactComponentRepository.php b/Services/Component/classes/class.ilArtifactComponentRepository.php index a06ad8552ac5..77bd1934b9cd 100644 --- a/Services/Component/classes/class.ilArtifactComponentRepository.php +++ b/Services/Component/classes/class.ilArtifactComponentRepository.php @@ -289,7 +289,7 @@ public function setCurrentPluginVersion(string $plugin_id, Data\Version $version $plugin = $this->getPluginById($plugin_id); if ($plugin->getCurrentVersion() !== null && $plugin->getCurrentVersion()->isGreaterThan($version)) { throw new \RuntimeException( - "Cannot upgrade plugins version from $version to {$plugin->getCurrentVersion()}" + "Cannot downgrade plugins version from {$plugin->getCurrentVersion()} to $version" ); } if ($plugin->getCurrentDBVersion() !== null && $plugin->getCurrentDBVersion() > $db_version) { From 9285eeb0ea6656f3e9a1d3fe44b71515d8dff7b1 Mon Sep 17 00:00:00 2001 From: Thibeau Fuhrer Date: Mon, 25 Nov 2024 11:22:30 +0100 Subject: [PATCH 246/292] [FIX] UI: properly count inputs of Field\HasDynamicInputs templates. (#8422) --- .../Component/Input/Field/Renderer.php | 19 ++++++++++++++++- .../js/Input/Field/dynamic_inputs_renderer.js | 21 ++++++++++++++----- 2 files changed, 34 insertions(+), 6 deletions(-) diff --git a/src/UI/Implementation/Component/Input/Field/Renderer.php b/src/UI/Implementation/Component/Input/Field/Renderer.php index 28eddd351d3e..637fc3b07e4d 100644 --- a/src/UI/Implementation/Component/Input/Field/Renderer.php +++ b/src/UI/Implementation/Component/Input/Field/Renderer.php @@ -908,7 +908,7 @@ protected function initClientsideRenderer( string $template_html ): FI\HasDynamicInputs { $dynamic_inputs_template_html = $this->replaceTemplateIds($template_html); - $dynamic_input_count = count($input->getDynamicInputs()); + $dynamic_input_count = $this->countInputsWithoutGroupsRecursively($input->getTemplateForDynamicInputs()); // note that $dynamic_inputs_template_html is in tilted single quotes (`), // because otherwise the html syntax might collide with normal ones. @@ -928,6 +928,23 @@ protected function initClientsideRenderer( }); } + /** + * Counts all inputs and nested inputs of groups, without counting groups themselves. + */ + protected function countInputsWithoutGroupsRecursively(FormInput|Input $input): int + { + if (!($input instanceof Component\Input\Group)) { + return 1; + } + + $count = 0; + foreach ($input->getInputs() as $sub_input) { + $count += $this->countInputsWithoutGroupsRecursively($sub_input); + } + + return $count; + } + protected function replaceTemplateIds(string $template_html): string { // regex matches anything between 'id="' and '"', hence the js_id. diff --git a/src/UI/templates/js/Input/Field/dynamic_inputs_renderer.js b/src/UI/templates/js/Input/Field/dynamic_inputs_renderer.js index 168c2ec68cd0..6a5fa18bb310 100644 --- a/src/UI/templates/js/Input/Field/dynamic_inputs_renderer.js +++ b/src/UI/templates/js/Input/Field/dynamic_inputs_renderer.js @@ -1,4 +1,19 @@ /** + * This file is part of ILIAS, a powerful learning management system + * published by ILIAS open source e-Learning e.V. + * + * ILIAS is licensed with the GPL-3.0, + * see https://www.gnu.org/licenses/gpl-3.0.en.html + * You should have received a copy of said license along with the + * source code, too. + * + * If this is not the case or you just want to try ILIAS, you'll find + * us at: + * https://www.ilias.de + * https://github.com/ILIAS-eLearning + * + * ******************************************************************* + * * this script is responsible for clientside rendering of Inputs * ILIAS\UI\Component\Input\Field\DynamicInputsAware. * @@ -82,13 +97,9 @@ il.UI.Input = il.UI.Input || {}; * @param {int} sub_input_count */ let addInputTemplateIds = function (template_html, sub_input_count) { - if (1 >= sub_input_count) { - return replaceAll(template_html, INPUT_ID_PLACEHOLDER, generateId()); - } - // Ids must not be all the same, therefore we need to generate // one for each sub-input contained in the template. - for (let i = 0; i < sub_input_count; i++) { + for (let i = 0; i <= sub_input_count; i++) { template_html = replaceAll( template_html, `${INPUT_ID_PLACEHOLDER}_${i}`, From 0330114b951249ad589585cb20f578c77c443be6 Mon Sep 17 00:00:00 2001 From: Thibeau Fuhrer Date: Tue, 26 Nov 2024 14:23:38 +0100 Subject: [PATCH 247/292] [FIX] UI: php 7.4 compatibility of 'properly count inputs of Field\HasDynamicInputs templates. (#8422)' --- src/UI/Implementation/Component/Input/Field/Renderer.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/UI/Implementation/Component/Input/Field/Renderer.php b/src/UI/Implementation/Component/Input/Field/Renderer.php index 637fc3b07e4d..c676f3707af1 100644 --- a/src/UI/Implementation/Component/Input/Field/Renderer.php +++ b/src/UI/Implementation/Component/Input/Field/Renderer.php @@ -930,8 +930,9 @@ protected function initClientsideRenderer( /** * Counts all inputs and nested inputs of groups, without counting groups themselves. + * @param FormInput|Input $input */ - protected function countInputsWithoutGroupsRecursively(FormInput|Input $input): int + protected function countInputsWithoutGroupsRecursively($input): int { if (!($input instanceof Component\Input\Group)) { return 1; From 56f7c9d51982b3767f44a1db612efd9ccf3fed64 Mon Sep 17 00:00:00 2001 From: Luka Stocker Date: Wed, 20 Nov 2024 17:06:17 +0100 Subject: [PATCH 248/292] LSO: 42591, copy intro and extro content page if learning sequence is copied. https://mantis.ilias.de/view.php?id=42591 --- .../classes/class.ilObjLearningSequence.php | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/Modules/LearningSequence/classes/class.ilObjLearningSequence.php b/Modules/LearningSequence/classes/class.ilObjLearningSequence.php index 48bd3972a632..e6020a5fee33 100644 --- a/Modules/LearningSequence/classes/class.ilObjLearningSequence.php +++ b/Modules/LearningSequence/classes/class.ilObjLearningSequence.php @@ -1,7 +1,5 @@ cloneSettings($new_obj); $this->cloneLPSettings($new_obj->getId()); $this->cloneActivation($new_obj, $copy_id); + $this->cloneIntroAndExtroContentPages($new_obj, [self::CP_INTRO, self::CP_EXTRO]); $roles = $new_obj->getLSRoles(); $roles->addLSMember( @@ -147,6 +148,21 @@ public function cloneObject(int $target_id, int $copy_id = 0, bool $omit_tree = return $new_obj; } + protected function cloneIntroAndExtroContentPages(ilObjLearningSequence $new_obj, array $cp_types): void + { + foreach ($cp_types as $type) { + $old_intro_page_id = $this->getContentPageId($type); + if (ilContainerPage::_exists( + "cont", + $old_intro_page_id + )) { + $new_obj->createContentPage($type); + $new_copg_id = $new_obj->getContentPageId($type); + $original_page = new \ilContainerPage($old_intro_page_id); + $original_page->copy($new_copg_id, "cont", $new_copg_id); + } + } + } protected function cloneAutoGeneratedRoles(ilObjLearningSequence $new_obj): bool { From 47795ea1e96fa81999877e7c65f10a75079b4a69 Mon Sep 17 00:00:00 2001 From: Stephan Kergomard Date: Thu, 28 Nov 2024 16:16:13 +0100 Subject: [PATCH 249/292] Test: Do Not Save Suggested Solution on Cancel See: https://mantis.ilias.de/view.php?id=42864 --- Modules/TestQuestionPool/classes/class.assQuestionGUI.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/TestQuestionPool/classes/class.assQuestionGUI.php b/Modules/TestQuestionPool/classes/class.assQuestionGUI.php index 40bea6f464e6..c91a3c9b4fc2 100755 --- a/Modules/TestQuestionPool/classes/class.assQuestionGUI.php +++ b/Modules/TestQuestionPool/classes/class.assQuestionGUI.php @@ -1312,7 +1312,7 @@ public function suggestedsolution(): void $file->setRequired(true); $file->enableFileNameSelection("filename"); - if (array_key_exists("file", $_FILES) && + if ($ave && array_key_exists("file", $_FILES) && array_key_exists("tmp_name", $_FILES["file"]) && $_FILES["file"]["tmp_name"] && $file->checkInput()) { if (!file_exists($this->object->getSuggestedSolutionPath())) { From 61834009ba01151d29a7c66f4e8290fd99493195 Mon Sep 17 00:00:00 2001 From: Tim Schmitz Date: Fri, 29 Nov 2024 12:13:02 +0100 Subject: [PATCH 250/292] Certificate: skip empty ul elements when translating to fo (43008) --- Services/Certificate/xml/xhtml2fo.xsl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Services/Certificate/xml/xhtml2fo.xsl b/Services/Certificate/xml/xhtml2fo.xsl index d87843b251f5..0e5d17fa3e4f 100644 --- a/Services/Certificate/xml/xhtml2fo.xsl +++ b/Services/Certificate/xml/xhtml2fo.xsl @@ -507,7 +507,7 @@ 1em - + @@ -746,7 +746,7 @@ - + From 8afa8635bade0cefc5108421ce2318de840ce2f5 Mon Sep 17 00:00:00 2001 From: Stephan Kergomard Date: Fri, 29 Nov 2024 16:27:00 +0100 Subject: [PATCH 251/292] Test: Fix Typo in Variable Name --- Modules/TestQuestionPool/classes/class.assQuestionGUI.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/TestQuestionPool/classes/class.assQuestionGUI.php b/Modules/TestQuestionPool/classes/class.assQuestionGUI.php index c91a3c9b4fc2..b73625a13d3d 100755 --- a/Modules/TestQuestionPool/classes/class.assQuestionGUI.php +++ b/Modules/TestQuestionPool/classes/class.assQuestionGUI.php @@ -1312,7 +1312,7 @@ public function suggestedsolution(): void $file->setRequired(true); $file->enableFileNameSelection("filename"); - if ($ave && array_key_exists("file", $_FILES) && + if ($save && array_key_exists("file", $_FILES) && array_key_exists("tmp_name", $_FILES["file"]) && $_FILES["file"]["tmp_name"] && $file->checkInput()) { if (!file_exists($this->object->getSuggestedSolutionPath())) { From 6977315b572c34ec98a8417af0f1e1931bba907e Mon Sep 17 00:00:00 2001 From: Stephan Kergomard Date: Fri, 29 Nov 2024 16:29:14 +0100 Subject: [PATCH 252/292] Test: Fix Reload on Cancel in Recap See: https://mantis.ilias.de/view.php?id=42865 --- Modules/TestQuestionPool/classes/class.assQuestionGUI.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Modules/TestQuestionPool/classes/class.assQuestionGUI.php b/Modules/TestQuestionPool/classes/class.assQuestionGUI.php index b73625a13d3d..8a9ea214ea5f 100755 --- a/Modules/TestQuestionPool/classes/class.assQuestionGUI.php +++ b/Modules/TestQuestionPool/classes/class.assQuestionGUI.php @@ -1235,7 +1235,9 @@ public function suggestedsolution(): void $solution_array['type'] = ''; } - $solution_type = $this->request->raw('solutiontype'); + $solution_type = $this->ctrl->getCmd() === 'cancelSuggestedSolution' + ? $solution_array["type"] + : $this->request->raw('solutiontype'); if (is_string($solution_type) && strcmp($solution_type, "file") == 0 && strcmp($solution_array["type"], "file") != 0) { From a376a2b06d0f32693df4a1890ed040a3e6ae5d06 Mon Sep 17 00:00:00 2001 From: Lukas Eichenauer Date: Mon, 4 Nov 2024 13:32:22 +0100 Subject: [PATCH 253/292] fix: remove request superglobal access by replacing it with InternalRequestService (41683/41684) --- Modules/Test/classes/class.ilObjTestGUI.php | 102 ++++++++++---------- 1 file changed, 49 insertions(+), 53 deletions(-) diff --git a/Modules/Test/classes/class.ilObjTestGUI.php b/Modules/Test/classes/class.ilObjTestGUI.php index 3668f51a4e1b..0ace7c8bb809 100755 --- a/Modules/Test/classes/class.ilObjTestGUI.php +++ b/Modules/Test/classes/class.ilObjTestGUI.php @@ -91,6 +91,9 @@ class ilObjTestGUI extends ilObjectGUI implements ilCtrlBaseClassInterface protected array $ui; + protected const INSERT_MODE_BEFORE = 0; + protected const INSERT_MODE_AFTER = 1; + /** * Constructor * @access public @@ -1881,14 +1884,12 @@ public function removeQuestionsObject() */ public function moveQuestionsObject() { - $selected_questions = null; - $selected_questions = $_POST['q_id']; - if ($selected_questions === null && is_numeric($_GET['q_id'])) { - $selected_questions = [$_GET['q_id']]; - } - if (is_array($selected_questions)) { + $selected_questions = $this->testrequest->getQuestionIds() + ? $this->testrequest->getQuestionIds() + : [$this->testrequest->getQuestionId()]; + if (count($selected_questions) > 0) { ilSession::set('tst_qst_move_' . $this->object->getTestId(), $selected_questions); - $this->tpl->setOnScreenMessage('success', $this->lng->txt("msg_selected_for_move"), true); + $this->tpl->setOnScreenMessage('success', $this->lng->txt('msg_selected_for_move'), true); } else { $this->tpl->setOnScreenMessage('failure', $this->lng->txt('no_selection_for_move'), true); } @@ -1900,22 +1901,7 @@ public function moveQuestionsObject() */ public function insertQuestionsBeforeObject() { - // get all questions to move - $move_questions = ilSession::get('tst_qst_move_' . $this->object->getTestId()); - - if (!is_array($_POST['q_id']) || 0 === count($_POST['q_id'])) { - $this->tpl->setOnScreenMessage('failure', $this->lng->txt("no_target_selected_for_move"), true); - $this->ctrl->redirect($this, 'questions'); - } - if (count($_POST['q_id']) > 1) { - $this->tpl->setOnScreenMessage('failure', $this->lng->txt("too_many_targets_selected_for_move"), true); - $this->ctrl->redirect($this, 'questions'); - } - $insert_mode = 0; - $this->object->moveQuestions(ilSession::get('tst_qst_move_' . $this->object->getTestId()), $_POST['q_id'][0], $insert_mode); - $this->tpl->setOnScreenMessage('success', $this->lng->txt("msg_questions_moved"), true); - ilSession::clear('tst_qst_move_' . $this->object->getTestId()); - $this->ctrl->redirect($this, "questions"); + $this->insertQuestionsBeforeOrAfter(self::INSERT_MODE_BEFORE); } /** @@ -1923,21 +1909,30 @@ public function insertQuestionsBeforeObject() */ public function insertQuestionsAfterObject() { - // get all questions to move - $move_questions = ilSession::get('tst_qst_move_' . $this->object->getTestId()); - if (!is_array($_POST['q_id']) || 0 === count($_POST['q_id'])) { - $this->tpl->setOnScreenMessage('failure', $this->lng->txt("no_target_selected_for_move"), true); + $this->insertQuestionsBeforeOrAfter(self::INSERT_MODE_AFTER); + } + + /** + * @param integer $insert_mode 0, if insert before the target position, 1 if insert after the target position + */ + protected function insertQuestionsBeforeOrAfter(int $insert_mode) + { + $target_questions = $this->testrequest->getQuestionIds() + ? $this->testrequest->getQuestionIds() + : [$this->testrequest->getQuestionId()]; + + if (count($target_questions) === 0) { + $this->tpl->setOnScreenMessage('failure', $this->lng->txt('no_target_selected_for_move'), true); $this->ctrl->redirect($this, 'questions'); - } - if (count($_POST['q_id']) > 1) { - $this->tpl->setOnScreenMessage('failure', $this->lng->txt("too_many_targets_selected_for_move"), true); + } elseif (count($target_questions) > 1) { + $this->tpl->setOnScreenMessage('failure', $this->lng->txt('too_many_targets_selected_for_move'), true); $this->ctrl->redirect($this, 'questions'); } - $insert_mode = 1; - $this->object->moveQuestions(ilSession::get('tst_qst_move_' . $this->object->getTestId()), $_POST['q_id'][0], $insert_mode); - $this->tpl->setOnScreenMessage('success', $this->lng->txt("msg_questions_moved"), true); + + $this->object->moveQuestions(ilSession::get('tst_qst_move_' . $this->object->getTestId()), $target_questions[0], $insert_mode); + $this->tpl->setOnScreenMessage('success', $this->lng->txt('msg_questions_moved'), true); ilSession::clear('tst_qst_move_' . $this->object->getTestId()); - $this->ctrl->redirect($this, "questions"); + $this->ctrl->redirect($this, 'questions'); } /** @@ -1947,27 +1942,28 @@ public function insertQuestionsAfterObject() */ public function insertQuestionsObject() { - $selected_array = (is_array($_POST['q_id'])) ? $_POST['q_id'] : array(); - if (!count($selected_array)) { - $this->tpl->setOnScreenMessage('info', $this->lng->txt("tst_insert_missing_question"), true); - $this->ctrl->redirect($this, "browseForQuestions"); + $selected_questions = $this->testrequest->getQuestionIds() + ? $this->testrequest->getQuestionIds() + : [$this->testrequest->getQuestionId()]; + + if (count($selected_questions) === 0) { + $this->tpl->setOnScreenMessage('info', $this->lng->txt('tst_insert_missing_question'), true); + $this->ctrl->redirect($this, 'browseForQuestions'); + } + + $man_scoring = false; + foreach ($selected_questions as $key => $value) { + $this->object->insertQuestion($this->testQuestionSetConfigFactory->getQuestionSetConfig(), $value); + $man_scoring = $man_scoring || assQuestion::_needsManualScoring($value); + } + + $this->object->saveCompleteStatus($this->testQuestionSetConfigFactory->getQuestionSetConfig()); + if ($man_scoring) { + $this->tpl->setOnScreenMessage('info', $this->lng->txt('manscoring_hint'), true); } else { - $manscoring = false; - foreach ($selected_array as $key => $value) { - $this->object->insertQuestion($this->testQuestionSetConfigFactory->getQuestionSetConfig(), $value); - if (!$manscoring) { - $manscoring = $manscoring | assQuestion::_needsManualScoring($value); - } - } - $this->object->saveCompleteStatus($this->testQuestionSetConfigFactory->getQuestionSetConfig()); - if ($manscoring) { - $this->tpl->setOnScreenMessage('info', $this->lng->txt("manscoring_hint"), true); - } else { - $this->tpl->setOnScreenMessage('success', $this->lng->txt("tst_questions_inserted"), true); - } - $this->ctrl->redirect($this, "questions"); - return; + $this->tpl->setOnScreenMessage('success', $this->lng->txt('tst_questions_inserted'), true); } + $this->ctrl->redirect($this, 'questions'); } public function addQuestionObject() From cebf5ef647681686008a403b6098459d60020d14 Mon Sep 17 00:00:00 2001 From: Rainer Rillke Date: Mon, 2 Dec 2024 13:42:24 +0100 Subject: [PATCH 254/292] 42733: Update CAS use instructions in settings GUI (#8489) * 42733: Update CAS use instructions in settings GUI see https://mantis.ilias.de/view.php?id=42733 see https://github.com/ILIAS-eLearning/ILIAS/pull/8434#discussion_r1842090761 * Update license header * CAS: Obtain factory before using it * CAS: Add instructions for more languages * CAS: Drop outdated instructions --- .../CAS/classes/class.ilCASSettingsGUI.php | 35 +++++++++++++------ lang/ilias_da.lang | 2 +- lang/ilias_de.lang | 2 +- lang/ilias_en.lang | 2 +- lang/ilias_es.lang | 2 +- lang/ilias_fr.lang | 2 +- lang/ilias_it.lang | 2 +- lang/ilias_nl.lang | 2 +- lang/ilias_pt.lang | 2 +- lang/ilias_ro.lang | 2 +- lang/ilias_sv.lang | 2 +- 11 files changed, 34 insertions(+), 21 deletions(-) diff --git a/Services/CAS/classes/class.ilCASSettingsGUI.php b/Services/CAS/classes/class.ilCASSettingsGUI.php index f5306951d7e6..c857ef4c337a 100644 --- a/Services/CAS/classes/class.ilCASSettingsGUI.php +++ b/Services/CAS/classes/class.ilCASSettingsGUI.php @@ -1,20 +1,22 @@ @@ -49,6 +51,9 @@ public function __construct(int $a_auth_ref_id) $this->lng->loadLanguageModule('registration'); $this->lng->loadLanguageModule('auth'); + $this->renderer = $DIC->ui()->renderer(); + $this->factory = $DIC->ui()->factory(); + $this->ref_id = $a_auth_ref_id; $this->settings = ilCASSettings::getInstance(); @@ -87,7 +92,15 @@ protected function initFormSettings(): ilPropertyFormGUI $form->setFormAction($this->ctrl->getFormAction($this)); $form->setTitle($this->lng->txt('auth_cas_auth')); - $form->setDescription($this->lng->txt("auth_cas_auth_desc")); + + $drop_in_replacements_url = 'https://github.com/ILIAS-eLearning/ILIAS/tree/trunk/components/ILIAS/HTTP#dropinreplacements'; + $drop_in_replacements_link = $this->factory->link()->standard( + $this->lng->txt("auth_cas_auth_desc"), + $drop_in_replacements_url + ); + $form->setDescription($this->renderer->render( + $drop_in_replacements_link + )); // Form checkbox $check = new ilCheckboxInputGUI($this->lng->txt("active"), 'active'); diff --git a/lang/ilias_da.lang b/lang/ilias_da.lang index eb2ddb483d6e..056eff209d28 100644 --- a/lang/ilias_da.lang +++ b/lang/ilias_da.lang @@ -3523,7 +3523,7 @@ common#:#auth_allow_local#:#Tillad lokal autentificering common#:#auth_cas#:#CAS common#:#auth_cas_allow_local_desc#:#Tillader CAS brugere at authentisere ved brug af deres lokale ILIAS brugernavn og lokale password. common#:#auth_cas_auth#:#Konfigurer CAS autentificering -common#:#auth_cas_auth_desc#:#CAS kræver PHP 4.3.1 eller senere med CURL support (7.5 eller senere) +common#:#auth_cas_auth_desc#:#For at CAS-godkendelse kan fungere, skal serverindstillingen prevent_super_global_replacement i client.ini.php være indstillet. common#:#auth_cas_port_desc#:#E.g. 443 if the full CAS server URI is https://auth.yourserver.com:443/cas/ common#:#auth_cas_server_desc#:#F.eks. auth.yourserver.com hvis den fulde CAS server URI er https://auth.yourserver.com:443/cas/ common#:#auth_cas_uri_desc#:#Local URI, e.g. cas if the full CAS server URI is https://auth.yourserver.com:443/cas/ diff --git a/lang/ilias_de.lang b/lang/ilias_de.lang index a20dd848cd63..84b2b800908d 100644 --- a/lang/ilias_de.lang +++ b/lang/ilias_de.lang @@ -3538,7 +3538,7 @@ common#:#auth_allow_local#:#Erlaube lokale Authentifizierung common#:#auth_cas#:#CAS common#:#auth_cas_allow_local_desc#:#Erlaubt Personen mit CAS-Konten, sich mit ihrem lokalen ILIAS-Anmeldenamen und -Passwort anzumelden. common#:#auth_cas_auth#:#Konfiguriere CAS-Authentifizierung -common#:#auth_cas_auth_desc#:#CAS erfordert PHP 4.3.1 oder höher mit CURL-Unterstützung (7.5 oder höher) +common#:#auth_cas_auth_desc#:#Damit die CAS-Authentifizierung funktioniert, muss die Servereinstellung prevent_super_global_replacement in der Datei client.ini.php gesetzt sein. common#:#auth_cas_port_desc#:#Zum Beispiel "443" bei einer CAS-Server-URI "https://auth.yourserver.com:443/cas/" common#:#auth_cas_server_desc#:#Zum Beispiel "auth.yourserver.com" bei einer CAS-Server-URI "https://auth.yourserver.com:443/cas/" common#:#auth_cas_uri_desc#:#Lokale URI, zum Beispiel "cas" bei einer CAS-Server-URI "https://auth.yourserver.com:443/cas/" diff --git a/lang/ilias_en.lang b/lang/ilias_en.lang index ebc25fecd026..94e62f25e244 100644 --- a/lang/ilias_en.lang +++ b/lang/ilias_en.lang @@ -3538,7 +3538,7 @@ common#:#auth_allow_local#:#Allow Local Authentication common#:#auth_cas#:#CAS common#:#auth_cas_allow_local_desc#:#Allows CAS users to authenticate themselves with their local ILIAS username and a local password. common#:#auth_cas_auth#:#Configure CAS Authentication -common#:#auth_cas_auth_desc#:#CAS requires PHP 4.3.1 or higher with CURL support (7.5 or higher) +common#:#auth_cas_auth_desc#:#For CAS authentication to work, the server setting prevent_super_global_replacement in client.ini.php must be set. common#:#auth_cas_port_desc#:#E.g. 443 if the full CAS server URI is https://auth.yourserver.com:443/cas/ common#:#auth_cas_server_desc#:#E.g. auth.yourserver.com if the full CAS server URI is https://auth.yourserver.com:443/cas/ common#:#auth_cas_uri_desc#:#Local URI, e.g. cas if the full CAS server URI is https://auth.yourserver.com:443/cas/ diff --git a/lang/ilias_es.lang b/lang/ilias_es.lang index bca2b8795dab..67f28beb88d2 100644 --- a/lang/ilias_es.lang +++ b/lang/ilias_es.lang @@ -3525,7 +3525,7 @@ common#:#auth_allow_local#:#Permitir Autenticación Local common#:#auth_cas#:#CAS common#:#auth_cas_allow_local_desc#:#Esto le permite a los usuarios CAS autenticarse con su usuario local ILIAS y una contraseña local common#:#auth_cas_auth#:#Configurar autenticación CAS -common#:#auth_cas_auth_desc#:#CAS requiere PHP 4.3.1 o superior con soporte CURL (7.5 o superior) +common#:#auth_cas_auth_desc#:#Para que la autenticación CAS funcione, debe establecerse la configuración del servidor prevent_super_global_replacement en client.ini.php. common#:#auth_cas_port_desc#:#Ej. 443 si la URI del servidor CAS es https://auth.yourserver.com:443/cas/ common#:#auth_cas_server_desc#:#Ej. auth.yourserver.com si la URI del servidor CAS es https://auth.yourserver.com:443/cas/ common#:#auth_cas_uri_desc#:#Local URI, e.g. cas si la URI del servidor CAS https://auth.yourserver.com:443/cas/ diff --git a/lang/ilias_fr.lang b/lang/ilias_fr.lang index 1ac8534e4a18..6436081c4fbe 100644 --- a/lang/ilias_fr.lang +++ b/lang/ilias_fr.lang @@ -3523,7 +3523,7 @@ common#:#auth_allow_local#:#Autoriser l'Authentification Locale common#:#auth_cas#:#CAS common#:#auth_cas_allow_local_desc#:#Permet aux utilisateurs authentifiés par CAS de se connecter avec leur identifiant et leur mot de passe local. common#:#auth_cas_auth#:#Configurer l'Authentification CAS -common#:#auth_cas_auth_desc#:#CAS requiert PHP 4.3.1 ou supérieur avec support de CURL (7.5 ou supérieur) +common#:#auth_cas_auth_desc#:#Pour que l'authentification CAS fonctionne, le paramètre serveur prevent_super_global_replacement dans client.ini.php doit être défini. common#:#auth_cas_port_desc#:#Par ex. 443 si l'URI du serveur CAS est https://auth.yourserver.com:443/cas/ common#:#auth_cas_server_desc#:#Par ex. auth.yourserver.com si l'URI du serveur CAS est https://auth.yourserver.com:443/cas/ common#:#auth_cas_uri_desc#:#URI local, par ex. cas si l'URI du serveur CAS est https://auth.yourserver.com:443/cas/ diff --git a/lang/ilias_it.lang b/lang/ilias_it.lang index e5c0406aa55f..d0f47113b61b 100644 --- a/lang/ilias_it.lang +++ b/lang/ilias_it.lang @@ -3537,7 +3537,7 @@ common#:#auth_allow_local#:#Consenti Autenticazione Locale common#:#auth_cas#:#CAS common#:#auth_cas_allow_local_desc#:#Ciò consente agli utenti CAS di autenticarsi con il nome utente ILIAS e password locali. common#:#auth_cas_auth#:#Configura CAS Authentication -common#:#auth_cas_auth_desc#:#CAS richiede PHP 4.3.1 o superiore con supporto CURL (7.5 o superiore) +common#:#auth_cas_auth_desc#:#Affinché l'autenticazione CAS funzioni, è necessario impostare l'impostazione del server prevent_super_global_replacement in client.ini.php. common#:#auth_cas_port_desc#:#Ad esempio 443 se l’URI del server CAS completo è https://auth.yourserver.com:443/cas/ common#:#auth_cas_server_desc#:#Ad esempio auth.yourserver.com se l’URI del server CAS completo è https://auth.yourserver.com:443/cas/ common#:#auth_cas_uri_desc#:#URI locale, ad esempio cas se l’URI del server CAS completo è https://auth.yourserver.com:443/cas/ diff --git a/lang/ilias_nl.lang b/lang/ilias_nl.lang index ffdca8a36c69..49d9eb25048d 100644 --- a/lang/ilias_nl.lang +++ b/lang/ilias_nl.lang @@ -3523,7 +3523,7 @@ common#:#auth_allow_local#:#Sta lokale authenticatie toe common#:#auth_cas#:#CAS common#:#auth_cas_allow_local_desc#:#This allows CAS users to authenticate with their local ILIAS username and a local password. common#:#auth_cas_auth#:#Configure CAS Authentication -common#:#auth_cas_auth_desc#:#CAS requires PHP 4.3.1 or higher with CURL support (7.5 or higher) +common#:#auth_cas_auth_desc#:#Om CAS-authenticatie te laten werken, moet de serverinstelling prevent_super_global_replacement in client.ini.php ingesteld zijn. common#:#auth_cas_port_desc#:#E.g. 443 if the full CAS server URI is https://auth.yourserver.com:443/cas/ common#:#auth_cas_server_desc#:#E.g. auth.yourserver.com if the full CAS server URI is https://auth.yourserver.com:443/cas/ common#:#auth_cas_uri_desc#:#Local URI, e.g. cas if the full CAS server URI is https://auth.yourserver.com:443/cas/ diff --git a/lang/ilias_pt.lang b/lang/ilias_pt.lang index f4413dd0bae9..9ea852ad3c52 100644 --- a/lang/ilias_pt.lang +++ b/lang/ilias_pt.lang @@ -3523,7 +3523,7 @@ common#:#auth_allow_local#:#Autorizar autenticação local common#:#auth_cas#:#CAS common#:#auth_cas_allow_local_desc#:#Isto permite aos utilizadores CAS autenticarem-se com o seu nome de utilizador ILIAS local e uma palavra-passe local. common#:#auth_cas_auth#:#Configurar autenticação CAS -common#:#auth_cas_auth_desc#:#CAS requer PHP 4.3.1 ou superior com suporte CURL (7.5 ou superior) +common#:#auth_cas_auth_desc#:#Para que a autenticação CAS funcione, a configuração do servidor prevent_super_global_replacement em client.ini.php deve ser definida. common#:#auth_cas_port_desc#:#P. ex. 443 se o URI de servidor CAS inteiro URI for https://auth.yourserver.com:443/cas/ common#:#auth_cas_server_desc#:#P. ex. auth.yourserver.com se o URI de servidor CAS inteiro for https://auth.yourserver.com:443/cas/ common#:#auth_cas_uri_desc#:#Local URI, p. ex. cas se o URI de servidor CAS inteiro for https://auth.yourserver.com:443/cas/ diff --git a/lang/ilias_ro.lang b/lang/ilias_ro.lang index 5a7a512f0b63..1774d251a140 100644 --- a/lang/ilias_ro.lang +++ b/lang/ilias_ro.lang @@ -3523,7 +3523,7 @@ common#:#auth_allow_local#:#Allow Local Authentication###10 Jul 2006 new variabl common#:#auth_cas#:#CAS###10 Jul 2006 new variable common#:#auth_cas_allow_local_desc#:#This allows CAS users to authenticate with their local ILIAS username and a local password.###10 Jul 2006 new variable common#:#auth_cas_auth#:#Configure CAS Authentication###10 Jul 2006 new variable -common#:#auth_cas_auth_desc#:#CAS requires PHP 4.3.1 or higher with CURL support (7.5 or higher)###10 Jul 2006 new variable +common#:#auth_cas_auth_desc#:#Pentru ca autentificarea CAS să funcționeze, setarea serverului prevent_super_global_replacement din client.ini.php trebuie să fie setată. common#:#auth_cas_port_desc#:#E.g. 443 if the full CAS server URI is https://auth.yourserver.com:443/cas/###10 Jul 2006 new variable common#:#auth_cas_server_desc#:#E.g. auth.yourserver.com if the full CAS server URI is https://auth.yourserver.com:443/cas/###10 Jul 2006 new variable common#:#auth_cas_uri_desc#:#Local URI, e.g. cas if the full CAS server URI is https://auth.yourserver.com:443/cas/###10 Jul 2006 new variable diff --git a/lang/ilias_sv.lang b/lang/ilias_sv.lang index fb24d8033448..4149b6182d7a 100644 --- a/lang/ilias_sv.lang +++ b/lang/ilias_sv.lang @@ -3538,7 +3538,7 @@ common#:#auth_allow_local#:#Tillåt lokal autentisering common#:#auth_cas#:#CAS common#:#auth_cas_allow_local_desc#:#Tillåter personer med CAS-konton att logga in med sitt lokala ILIAS-inloggningsnamn och lösenord. common#:#auth_cas_auth#:#Konfigurera CAS-autentisering -common#:#auth_cas_auth_desc#:#CAS kräver PHP 4.3.1 eller senare med stöd för CURL (7.5 eller senare) +common#:#auth_cas_auth_desc#:#För att CAS-autentisering ska fungera måste serverinställningen prevent_super_global_replacement i client.ini.php vara inställd. common#:#auth_cas_port_desc#:#Till exempel "443" för en CAS-server URI "https common#:#auth_cas_server_desc#:#Till exempel "auth.yourserver.com" för en CAS-server URI "https common#:#auth_cas_uri_desc#:#Lokal URI, t.ex. "cas" för en CAS-server URI "https From a109f7f6b8ea7f300d6282979a5f99e142cad2d2 Mon Sep 17 00:00:00 2001 From: Fabian Schmid Date: Mon, 2 Dec 2024 15:25:22 +0100 Subject: [PATCH 255/292] [FIX] 41940: named objective to reset failed db-steps commit 71ebaba12ffd343a009714644b5bd95584a4fe0e Author: Nils Haagen Date: Mon Dec 2 13:27:54 2024 +0100 Setup: #41940, rename objective and only remove failed steps commit f24b4495ff46ebfbd0e9f07b7e98ea207b745d37 Author: Nils Haagen Date: Thu Nov 28 10:59:36 2024 +0100 Setup: #41940, add docu commit cc35869961c101aa0355574cd1a3ea5895383486 Author: Nils Haagen Date: Wed Nov 27 16:49:17 2024 +0100 Setup: #41940, named objective to reset failed db-steps --- .../class.ilDatabaseResetStepsObjective.php | 84 +++++++++++++++++++ .../Setup/class.ilDatabaseSetupAgent.php | 10 +++ docs/configuration/install.md | 14 ++++ setup/README.md | 15 +++- 4 files changed, 122 insertions(+), 1 deletion(-) create mode 100644 Services/Database/classes/Setup/class.ilDatabaseResetStepsObjective.php diff --git a/Services/Database/classes/Setup/class.ilDatabaseResetStepsObjective.php b/Services/Database/classes/Setup/class.ilDatabaseResetStepsObjective.php new file mode 100644 index 000000000000..4634d05787b8 --- /dev/null +++ b/Services/Database/classes/Setup/class.ilDatabaseResetStepsObjective.php @@ -0,0 +1,84 @@ +getResource(Setup\Environment::RESOURCE_DATABASE); + $db->manipulate('DELETE FROM il_db_steps WHERE finished IS NULL'); + return $environment; + } + + /** + * @inheritDoc + */ + public function isApplicable(Setup\Environment $environment): bool + { + $db = $environment->getResource(Setup\Environment::RESOURCE_DATABASE); + $query = 'SELECT class FROM il_db_steps WHERE finished IS NULL'; + return $db->numRows($db->query($query)) > 0; + } +} diff --git a/Services/Database/classes/Setup/class.ilDatabaseSetupAgent.php b/Services/Database/classes/Setup/class.ilDatabaseSetupAgent.php index 81f24d86fa45..85c3d0a0902f 100644 --- a/Services/Database/classes/Setup/class.ilDatabaseSetupAgent.php +++ b/Services/Database/classes/Setup/class.ilDatabaseSetupAgent.php @@ -121,4 +121,14 @@ public function getMigrations(): array new Setup\ilMysqlMyIsamToInnoDbMigration() ]; } + + public function getNamedObjectives(?Setup\Config $config = null): array + { + return [ + 'resetFailedSteps' => new Setup\ObjectiveConstructor( + 'reset null-states in il_db_steps', + static fn (): Setup\Objective => new ilDatabaseResetStepsObjective() + ) + ]; + } } diff --git a/docs/configuration/install.md b/docs/configuration/install.md index fe2306eb26a8..443915867e76 100755 --- a/docs/configuration/install.md +++ b/docs/configuration/install.md @@ -715,6 +715,20 @@ to manage and monitor your ILIAS installation. To check which update step gets currently executed run the following SQL-Statement on your ILIAS database: `SELECT * FROM `settings` WHERE keyword = "db_update_running"`. +Database updates are performed in steps; it might happen that a step fails, e.g. due +to some edge case or inconsistency in existing data, files, etc. +In this case, a concecutive command `php setup/setup.php update` will error with +a message like +> step 2 was started last, but step 1 was finished last. +> Aborting because of that mismatch. + +You may reset the records for those steps by running: +``` +php setup/setup.php achieve database.resetFailedSteps +``` +However, be sure to understand the cause for the failing steps and tend to it before +resetting and running update again. + ## Information on Updates diff --git a/setup/README.md b/setup/README.md index 1628ccc140a4..227433d9d220 100644 --- a/setup/README.md +++ b/setup/README.md @@ -80,9 +80,22 @@ where the plugins can be controlled with the same options as for `install`. Sometimes it might happen that the database update steps detect some edge case or warn about a possible loss of data. In this case the update is aborted with a message and can be resumed after the messages were read carefully and acted -upon. You may use the `--ignore-db-update-messages` at your own risk if you want +upon. +You may use the `--ignore-db-update-messages` at your own risk if you want to silence the messages. +When an update step failed, you might get a message about inconsistent order +of already performed steps when resuming the setup: +> step 2 was started last, but step 1 was finished last. +> Aborting because of that mismatch. + +You may reset the records for those steps by running: +``` +php setup/setup.php achieve database.resetFailedSteps +``` +However, be sure to understand the cause for the failing steps and tend to it before +resetting and re-running the update. + ## Report Status of ILIAS Via `php setup/setup.php status` you can get a status of your ILIAS installation. From 34a7c28ff927354482b0c26c8b02446f260830f9 Mon Sep 17 00:00:00 2001 From: Nils Haagen Date: Mon, 2 Dec 2024 15:27:54 +0100 Subject: [PATCH 256/292] Setup: #41940, named objective to reset failed db-steps (#8529) * Setup: #41940, named objective to reset failed db-steps * Setup: #41940, add docu * Setup: #41940, rename objective and only remove failed steps From 13295bb8daa7a28a46b0a95f709832ebd85df602 Mon Sep 17 00:00:00 2001 From: iszmais <45942348+iszmais@users.noreply.github.com> Date: Mon, 2 Dec 2024 17:59:44 +0100 Subject: [PATCH 257/292] fix dynamic properties (#8595) --- .../class.ilDclReferenceRecordFieldModel.php | 14 ++------------ .../classes/Helpers/class.ilDclCache.php | 11 ++++------- 2 files changed, 6 insertions(+), 19 deletions(-) diff --git a/Modules/DataCollection/classes/Fields/Reference/class.ilDclReferenceRecordFieldModel.php b/Modules/DataCollection/classes/Fields/Reference/class.ilDclReferenceRecordFieldModel.php index 56bc56f89d79..3b26ec946076 100644 --- a/Modules/DataCollection/classes/Fields/Reference/class.ilDclReferenceRecordFieldModel.php +++ b/Modules/DataCollection/classes/Fields/Reference/class.ilDclReferenceRecordFieldModel.php @@ -14,18 +14,8 @@ * https://www.ilias.de * https://github.com/ILIAS-eLearning * - ******************************************************************** - */ + *********************************************************************/ -/** - * Class ilDclBaseFieldModel - * @author Martin Studer - * @author Marcel Raimann - * @author Fabian Schmid - * @author Oskar Truffer - * @version $Id: - * @ingroup ModulesDataCollection - */ class ilDclReferenceRecordFieldModel extends ilDclBaseRecordFieldModel { protected ?int $dcl_obj_id; @@ -158,8 +148,8 @@ public function afterClone(): void $record_field_clone = ilDclCache::getRecordFieldCache($record_clone, $field_clone); $clone_references = $record_field_clone->getValue(); + $value = []; if (is_array($clone_references)) { - $value = []; foreach ($clone_references as $clone_reference) { if (!is_null($temp_value = $this->getCloneRecordId($clone_reference))) { $value[] = $temp_value; diff --git a/Modules/DataCollection/classes/Helpers/class.ilDclCache.php b/Modules/DataCollection/classes/Helpers/class.ilDclCache.php index 062144fb6d87..548d6a1d2fb1 100644 --- a/Modules/DataCollection/classes/Helpers/class.ilDclCache.php +++ b/Modules/DataCollection/classes/Helpers/class.ilDclCache.php @@ -1,4 +1,5 @@ - * @author Fabian Schmid - */ class ilDclCache { public const TYPE_DATACOLLECTION = 'dcl'; @@ -97,6 +92,8 @@ protected static function initCloneMapping(): void public static function getCloneOf(int $id, string $type): ?object { $type_cache = self::$clone_mapping[$type]; + $clone_id = null; + if (!is_array($type_cache)) { return null; } From 1e76fbc9a5fb45ed973adbcfb29248647f7db41e Mon Sep 17 00:00:00 2001 From: Luka Stocker Date: Wed, 20 Nov 2024 17:26:28 +0100 Subject: [PATCH 258/292] LSO: 42636, check if ls_item_pc_value key exists and handle result accordingly. https://mantis.ilias.de/view.php?id=42636 --- .../classes/class.ilLearningSequenceImporter.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Modules/LearningSequence/classes/class.ilLearningSequenceImporter.php b/Modules/LearningSequence/classes/class.ilLearningSequenceImporter.php index 84a3047ed941..54747998f11d 100644 --- a/Modules/LearningSequence/classes/class.ilLearningSequenceImporter.php +++ b/Modules/LearningSequence/classes/class.ilLearningSequenceImporter.php @@ -1,7 +1,5 @@ getMapping("Services/Container", "refs", $old_ref_id); + $ls_item_pc_value = null; + if (key_exists("ls_item_pc_value", $data)) { + $ls_item_pc_value = $data["ls_item_pc_value"]; + } + $post_condition = new ilLSPostCondition( (int) $new_ref_id, $data["ls_item_pc_condition_type"], - $data["ls_item_pc_value"] + $ls_item_pc_value ); $ls_items[] = new LSItem( From 2e0804e2a7881fabc028722938b024f6b58e5252 Mon Sep 17 00:00:00 2001 From: Luka Stocker Date: Tue, 5 Nov 2024 11:33:17 +0100 Subject: [PATCH 259/292] IASS: use multi byte strlng for comparing the actual middle lengths and the fixed max middle length. --- .../OrgUnit/classes/PathStorage/class.ilOrgUnitPathStorage.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/OrgUnit/classes/PathStorage/class.ilOrgUnitPathStorage.php b/Modules/OrgUnit/classes/PathStorage/class.ilOrgUnitPathStorage.php index ae3ec893bcdf..d7d2a4a07ca3 100644 --- a/Modules/OrgUnit/classes/PathStorage/class.ilOrgUnitPathStorage.php +++ b/Modules/OrgUnit/classes/PathStorage/class.ilOrgUnitPathStorage.php @@ -152,7 +152,7 @@ public static function writePathByRefId(int $ref_id): void $first = array_shift($path); $last = array_pop($path); $middle = implode(self::GLUE_SIMPLE, $path); - if (strlen($middle) > self::MAX_MIDDLE_PATH_LENGTH) { + if (mb_strlen($middle) > self::MAX_MIDDLE_PATH_LENGTH) { $middle = mb_substr($middle, 0, self::MAX_MIDDLE_PATH_LENGTH) . " ..."; } $expression = implode(self::GLUE_SIMPLE, [$first, $middle, $last]); From de03d34996e44c98fe1df7c22bff0cdc8b3b4304 Mon Sep 17 00:00:00 2001 From: "Daniel Cazalla (ZallaxDev)" <86362063+ZallaxDev@users.noreply.github.com> Date: Tue, 3 Dec 2024 11:28:51 +0100 Subject: [PATCH 260/292] LTI: Authentication check for registering new LTI providers and HTML escaping in the rendering of the title and description of LTI Provider tables The LTIConsumer creation entry point has been modified to add a user check and an unused get method check has been removed. Added htmlspecialchars to ilObjLTIConsumerProviderList::getTableDataUsedBy in the title and description of the table providers. --- .../LTIConsumer/classes/class.ilLTIConsumeProviderList.php | 4 ++-- Modules/LTIConsumer/ltiregstart.php | 7 ++----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/Modules/LTIConsumer/classes/class.ilLTIConsumeProviderList.php b/Modules/LTIConsumer/classes/class.ilLTIConsumeProviderList.php index b75f3113fbc9..6735f242f58c 100755 --- a/Modules/LTIConsumer/classes/class.ilLTIConsumeProviderList.php +++ b/Modules/LTIConsumer/classes/class.ilLTIConsumeProviderList.php @@ -390,8 +390,8 @@ public function getTableData(): array $tblRow = array(); $tblRow['id'] = $provider->getId(); - $tblRow['title'] = $provider->getTitle(); - $tblRow['description'] = $provider->getDescription(); + $tblRow['title'] = htmlspecialchars($provider->getTitle()); + $tblRow['description'] = htmlspecialchars($provider->getDescription()); $tblRow['category'] = $provider->getCategory(); $tblRow['keywords'] = $this->getKeywordsFormatted($provider->getKeywordsArray()); $tblRow['outcome'] = $provider->getHasOutcome(); diff --git a/Modules/LTIConsumer/ltiregstart.php b/Modules/LTIConsumer/ltiregstart.php index 1e0c26268b5f..9f76e32c1488 100644 --- a/Modules/LTIConsumer/ltiregstart.php +++ b/Modules/LTIConsumer/ltiregstart.php @@ -26,11 +26,8 @@ ilInitialisation::initILIAS(); global $DIC; -if (strtoupper($DIC->http()->request()->getMethod()) !== "GET") { - $DIC->http()->saveResponse( - $DIC->http()->response() - ->withStatus(400) - ); +if (!$DIC->user()->getId() || $DIC->user()->getId() === ANONYMOUS_USER_ID) { + ilObjLTIConsumer::sendResponseError(401, "unauthorized"); } $params = $DIC->http()->wrapper()->query(); From 1b731e694c65e41493a0a61eb08b37aa35416697 Mon Sep 17 00:00:00 2001 From: iszmais <45942348+iszmais@users.noreply.github.com> Date: Tue, 3 Dec 2024 11:32:10 +0100 Subject: [PATCH 261/292] scrue broken dc ref fields against copy and sort calls (#8598) --- .../Copy/class.ilDclCopyFieldRepresentation.php | 2 +- .../Reference/class.ilDclReferenceFieldModel.php | 15 +++++++-------- .../classes/Table/class.ilDclTable.php | 3 +++ 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/Modules/DataCollection/classes/Fields/Copy/class.ilDclCopyFieldRepresentation.php b/Modules/DataCollection/classes/Fields/Copy/class.ilDclCopyFieldRepresentation.php index 92b02f852117..48214239c91f 100644 --- a/Modules/DataCollection/classes/Fields/Copy/class.ilDclCopyFieldRepresentation.php +++ b/Modules/DataCollection/classes/Fields/Copy/class.ilDclCopyFieldRepresentation.php @@ -47,7 +47,7 @@ public function getInputField(ilPropertyFormGUI $form, ?int $record_id = null): $copy_id = $this->getField()->getProperty(ilDclBaseFieldModel::PROP_REFERENCE); $copy_field = ilDclCache::getFieldCache($copy_id); if ($copy_field->getTableId() !== 0) { - $copy_table = ilDclCache::getTableCache($copy_field->getTableId()); + $copy_table = ilDclCache::getTableCache($copy_field->getTableId()); foreach ($copy_table->getRecords() as $record) { $option = $record->getRecordField($copy_field->getId())->getPlainText(); if (!in_array($option, $options)) { diff --git a/Modules/DataCollection/classes/Fields/Reference/class.ilDclReferenceFieldModel.php b/Modules/DataCollection/classes/Fields/Reference/class.ilDclReferenceFieldModel.php index fd7571e9bf91..5e831ea300bf 100644 --- a/Modules/DataCollection/classes/Fields/Reference/class.ilDclReferenceFieldModel.php +++ b/Modules/DataCollection/classes/Fields/Reference/class.ilDclReferenceFieldModel.php @@ -1,4 +1,5 @@ - * @version 1.0.0 - */ class ilDclReferenceFieldModel extends ilDclBaseFieldModel { public const PROP_REFERENCE = 'table_id'; @@ -39,7 +34,11 @@ public function getRecordQuerySortObject( global $DIC; $ilDB = $DIC['ilDB']; - if ($this->hasProperty(self::PROP_N_REFERENCE)) { + if ( + $this->hasProperty(self::PROP_N_REFERENCE) || + $this->getProperty(self::PROP_REFERENCE) === null || + ilDclCache::getFieldCache($this->getProperty(self::PROP_REFERENCE))->getTableId() === 0 + ) { return null; } diff --git a/Modules/DataCollection/classes/Table/class.ilDclTable.php b/Modules/DataCollection/classes/Table/class.ilDclTable.php index 682ea868b7d3..4527ca15f2e2 100644 --- a/Modules/DataCollection/classes/Table/class.ilDclTable.php +++ b/Modules/DataCollection/classes/Table/class.ilDclTable.php @@ -1042,6 +1042,9 @@ public function cloneStructure(ilDclTable $original): void if (!$orig_field->isStandardField()) { $class_name = get_class($orig_field); $new_field = new $class_name(); + if ($new_field instanceof ilDclReferenceFieldModel && $new_field->getFieldRef()->getTableId() === 0) { + continue; + } $new_field->setTableId($this->getId()); $new_field->cloneStructure($orig_field->getId()); $new_fields[$orig_field->getId()] = $new_field; From 54995e1fed3d24e42ada7e5a2284010bbca51d7e Mon Sep 17 00:00:00 2001 From: Nils Haagen Date: Tue, 5 Nov 2024 09:37:12 +0100 Subject: [PATCH 262/292] 8 PRG, 42157: Acknowledge all courses, remove legacy GUI --- .../classes/class.ilObjStudyProgramme.php | 36 +- .../class.ilObjStudyProgrammeMembersGUI.php | 312 ++++++++++++------ ...mmeAcknowledgeCompletedCoursesTableGUI.php | 53 --- .../classes/class.ilStudyProgrammeDIC.php | 23 +- .../class.ilStudyProgrammeMembersTableGUI.php | 22 +- .../class.ilStudyProgrammeUserTable.php | 57 +++- .../classes/ilStudyProgrammeUserTableRow.php | 23 +- .../tpl.acknowledge_completed_courses.html | 29 -- ...tpl.acknowledge_completed_courses_row.html | 8 - 9 files changed, 331 insertions(+), 232 deletions(-) delete mode 100644 Modules/StudyProgramme/classes/class.ilStudyProgrammeAcknowledgeCompletedCoursesTableGUI.php delete mode 100644 Modules/StudyProgramme/templates/default/tpl.acknowledge_completed_courses.html delete mode 100644 Modules/StudyProgramme/templates/default/tpl.acknowledge_completed_courses_row.html diff --git a/Modules/StudyProgramme/classes/class.ilObjStudyProgramme.php b/Modules/StudyProgramme/classes/class.ilObjStudyProgramme.php index 4ad9f0c1edec..1b1f356b8db4 100644 --- a/Modules/StudyProgramme/classes/class.ilObjStudyProgramme.php +++ b/Modules/StudyProgramme/classes/class.ilObjStudyProgramme.php @@ -492,7 +492,7 @@ public function getChildren(bool $include_references = false): array array_unique( array_map( static function ($data) { - return (int)$data['child']; + return (int) $data['child']; }, array_filter($ref_child_ref_ids, static function ($data) { return $data["deleted"] === null; @@ -752,8 +752,12 @@ public function getCompletedCourses(int $usr_id): array $completed_crss[] = [ "crs_id" => $crs_id , "prg_ref_id" => (int) $ref["parent"] + , "prg_obj_id" => $containing_prg->getId() , "crsr_ref_id" => (int) $ref["child"] , "crsr_id" => (int) $ref["obj_id"] + , "crs_ref_id" => (int) $crs_ref_id + , "crs_id" => (int) $crs_id + , "title" => ilContainerReference::_lookupTitle((int) $ref["obj_id"]) ]; } @@ -1155,7 +1159,7 @@ public function hasRelevantProgresses(): bool { $filter = new ilPRGAssignmentFilter($this->lng); $filter = $filter->withValues([ - 'prg_status_hide_irrelevant'=> true + 'prg_status_hide_irrelevant' => true ]); $count = $this->assignment_repository->countAllForNodeIsContained( $this->getId(), @@ -1817,6 +1821,34 @@ public function updatePlanFromRepository( $this->refreshLPStatus($assignment->getUserId()); } + public function acknowledgeCourses( + int $assignment_id, + array $nodes, + ilPRGMessageCollection $err_collection = null + ): void { + $acting_usr_id = $this->getLoggedInUserId(); + $assignment = $this->assignment_repository->get($assignment_id); + foreach($nodes as $nodeinfo) { + [$node_obj_id, $course_obj_id] = $nodeinfo; + + $assignment = $assignment->succeed( + $this->settings_repository, + $node_obj_id, + $course_obj_id + ); + + $msg = sprintf( + '%s, progress-id (%s/%s)', + $assignment->getUserInformation()->getFullname(), + $assignment->getId(), + (string) $node_obj_id + ); + $err_collection->add(true, 'acknowledged_course', $msg); + } + $this->assignment_repository->store($assignment); + $this->refreshLPStatus($assignment->getUserId()); + } + public function canBeCompleted(ilPRGProgress $progress): bool { if ($this->getLPMode() == ilStudyProgrammeSettings::MODE_LP_COMPLETED) { diff --git a/Modules/StudyProgramme/classes/class.ilObjStudyProgrammeMembersGUI.php b/Modules/StudyProgramme/classes/class.ilObjStudyProgrammeMembersGUI.php index 0021a3a51fc8..93f55291c11a 100644 --- a/Modules/StudyProgramme/classes/class.ilObjStudyProgrammeMembersGUI.php +++ b/Modules/StudyProgramme/classes/class.ilObjStudyProgrammeMembersGUI.php @@ -19,6 +19,7 @@ declare(strict_types=1); use ILIAS\Data\Factory; +use ILIAS\UI\Component\Input\Container\Form\Standard as Form; /** * @ilCtrl_Calls ilObjStudyProgrammeMembersGUI: ilStudyProgrammeRepositorySearchGUI @@ -44,6 +45,7 @@ class ilObjStudyProgrammeMembersGUI public const ACTION_UNMARK_RELEVANT = "unmark_relevant"; public const ACTION_UPDATE_FROM_CURRENT_PLAN = "update_from_current_plan"; public const ACTION_CHANGE_EXPIRE_DATE = "change_expire_date"; + public const ACTION_ACKNOWLEDGE_COURSES = "acknowledge_completed_courses"; public const F_COMMAND_OPTION_ALL = 'select_cmd_all'; public const F_ALL_PROGRESS_IDS = 'all_progress_ids'; @@ -65,6 +67,9 @@ class ilObjStudyProgrammeMembersGUI protected ilConfirmationGUI $confirmation_gui; protected ILIAS\HTTP\Wrapper\WrapperFactory $http_wrapper; protected ILIAS\Refinery\Factory $refinery; + protected ILIAS\UI\Factory $ui_factory; + protected ILIAS\UI\Renderer $ui_renderer; + protected GuzzleHttp\Psr7\ServerRequest $request; protected ?ilObjStudyProgramme $object; protected ?ilPRGPermissionsHelper $permissions; protected ilObjectGUI $parent_gui; @@ -84,7 +89,10 @@ public function __construct( Factory $data_factory, ilConfirmationGUI $confirmation_gui, ILIAS\HTTP\Wrapper\WrapperFactory $http_wrapper, - ILIAS\Refinery\Factory $refinery + ILIAS\Refinery\Factory $refinery, + ILIAS\UI\Factory $ui_factory, + ILIAS\UI\Renderer $ui_renderer, + GuzzleHttp\Psr7\ServerRequest $request ) { $this->tpl = $tpl; $this->ctrl = $ilCtrl; @@ -100,6 +108,9 @@ public function __construct( $this->confirmation_gui = $confirmation_gui; $this->http_wrapper = $http_wrapper; $this->refinery = $refinery; + $this->ui_factory = $ui_factory; + $this->ui_renderer = $ui_renderer; + $this->request = $request; $this->object = null; $this->permissions = null; @@ -186,12 +197,13 @@ public function executeCommand(): void case "unmarkAccreditedMulti": case "removeUser": case "removeUserMulti": - case "addUsersWithAcknowledgedCourses": case "markNotRelevantMulti": case "markRelevant": case "markRelevantMulti": case "updateFromCurrentPlan": case "updateFromCurrentPlanMulti": + case "acknowledgeCourses": + case "acknowledgeCoursesMulti": case "applyFilter": case "resetFilter": case "changeDeadline": @@ -207,6 +219,13 @@ public function executeCommand(): void case "confirmedUpdateFromCurrentPlan": $this->confirmedUpdateFromCurrentPlan(); break; + case "confirmedAcknowledgeCourses": + $this->confirmedAcknowledgeCourses(); + break; + case "confirmedAcknowledgeAllCourses": + $this->confirmedAcknowledgeAllCourses(); + break; + case "mailUserMulti": $this->mailToSelectedUsers(); break; @@ -257,7 +276,7 @@ protected function getMembersTableGUI(): ilStudyProgrammeMembersTableGUI } /** - * @return int[] + * @return PRGProgressId[] */ protected function getPostPrgsIds(): array { @@ -278,6 +297,9 @@ protected function getPostPrgsIds(): array $this->showInfoMessage("no_user_selected"); $this->ctrl->redirect($this, "view"); } + if (is_string($pgs_ids)) { + $pgs_ids = [$pgs_ids]; + } $r = []; foreach ($pgs_ids as $pgs_id) { @@ -346,106 +368,102 @@ public function resetFilter(): void */ public function addUsers(array $user_ids) { - $prg = $this->getStudyProgramme(); $user_ids = $this->getAddableUsers($user_ids); + $prg = $this->getStudyProgramme(); + $assignments = []; + $with_courses = []; - $completed_courses = array(); foreach ($user_ids as $user_id) { - $completed_crss = $prg->getCompletedCourses((int) $user_id); - if ($completed_crss) { - $completed_courses[$user_id] = $completed_crss; + $ass = $prg->assignUser((int) $user_id); + $assignments[] = $ass; + if($prg->getCompletedCourses((int) $user_id)) { + $with_courses[] = $ass; } } - if (count($completed_courses) > 0) { - $this->viewCompletedCourses($completed_courses, $user_ids); - return true; + if (count($assignments) === 1) { + $this->tpl->setOnScreenMessage("success", $this->lng->txt("prg_added_member"), true); + } + if (count($assignments) > 1) { + $this->tpl->setOnScreenMessage("success", $this->lng->txt("prg_added_members"), true); } - $this->_addUsers($user_ids); + if($with_courses) { + $this->tpl->setContent( + $this->ui_renderer->render( + $this->viewCompletedCourses($assignments) + ) + ); + return true; - $this->ctrl->redirect($this, "view"); + } else { + $this->ctrl->redirect($this, "view"); + } } /** - * Shows list of completed courses for each user if he should be assigned - * @param int[] $completed_courses - * @param int[] $users + * Shows list of completed courses for each assignment */ - public function viewCompletedCourses(array $completed_courses, array $users): void + public function viewCompletedCourses(array $assignments): Form { - $tpl = new ilTemplate( - "tpl.acknowledge_completed_courses.html", - true, - true, - "Modules/StudyProgramme" - ); - $tpl->setVariable("TITLE", $this->lng->txt("prg_acknowledge_completed_courses")); - $tpl->setVariable("CAPTION_ADD", $this->lng->txt("btn_next")); - $tpl->setVariable("CAPTION_CANCEL", $this->lng->txt("prg_cancel_acknowledge_completed_courses")); - $tpl->setVariable("FORM_ACTION", $this->ctrl->getFormAction($this)); - $tpl->setVariable("ADD_CMD", "addUsersWithAcknowledgedCourses"); - $tpl->setVariable("CANCEL_CMD", "view"); - - foreach ($completed_courses as $user_id => $completed) { - $names = ilObjUser::_lookupName($user_id); - $tpl->setCurrentBlock("usr_section"); - $tpl->setVariable("FIRSTNAME", $names["firstname"]); - $tpl->setVariable("LASTNAME", $names["lastname"]); - $table = new ilStudyProgrammeAcknowledgeCompletedCoursesTableGUI( - $this, - $user_id, - $completed + $prg = $this->getStudyProgramme(); + $completed_courses = []; + $ass_ids = []; + foreach ($assignments as $ass) { + $ass_ids[] = $ass->getId(); + $completed_crss = $prg->getCompletedCourses($ass->getUserId()); + + $label = sprintf( + "%s (%s)", + $ass->getUserInformation()->getFullname(), + $ass->getId() ); - $tpl->setVariable("TABLE", $table->getHTML()); - $tpl->parseCurrentBlock(); - } + $options = []; + foreach($completed_crss as $opt) { + $options[implode(';', [$ass->getId(), $opt['prg_obj_id'],$opt['crs_id']])] = $opt['title']; + } - foreach ($users as $usr_id) { - $tpl->setCurrentBlock("usr_ids_section"); - $tpl->setVariable("USR_ID", $usr_id); - $tpl->parseCurrentBlock(); + $completed_courses[] = $this->ui_factory->input()->field()->multiselect($label, $options); } - $this->tpl->setContent($tpl->get()); - } + $form_action = $this->ctrl->getFormAction($this, 'confirmedAcknowledgeCourses') + . '&ass_ids=' . implode(',', $ass_ids); - /** - * Assign users if they have any completed course - */ - public function addUsersWithAcknowledgedCourses(): void - { - $users = $this->http_wrapper->post()->retrieve( - "users", - $this->refinery->kindlyTo()->listOf($this->refinery->kindlyTo()->int()) - ); - $users = $this->getAddableUsers($users); - $assignments = $this->_addUsers($users); - - $completed_programmes = null; - if ($this->http_wrapper->post()->has('courses')) { - $completed_programmes = $this->http_wrapper->post()->retrieve( - "courses", - $this->refinery->kindlyTo()->dictOf( - $this->refinery->kindlyTo()->listOf($this->refinery->kindlyTo()->string()) + $form = $this->ui_factory->input()->container()->form()->standard( + $form_action, + [ + $this->ui_factory->input()->field()->section( + $completed_courses, + $this->lng->txt("prg_acknowledge_completed_courses") ) - ); - } - - if (is_array($completed_programmes)) { - foreach ($completed_programmes as $user_id => $prg_ref_ids) { - $ass = $assignments[$user_id]; - foreach ($prg_ref_ids as $ids) { - [$prg_ref_id, $crs_id, $crsr_id] = explode(";", $ids); - $prg = $this->getStudyProgramme((int) $prg_ref_id); - if ($prg->isActive()) { - $prg->succeed($user_id, (int)$crsr_id, $ass); - } + ] + )->withAdditionalTransformation( + $this->refinery->custom()->transformation( + function ($values) { + $values = array_merge(...array_filter(array_shift($values))); + return array_map( + fn ($entry) => explode(';', $entry), + $values + ); } - } - } + ) + ); - $this->ctrl->redirect($this, "view"); + $this->toolbar->addComponent( + $this->ui_factory->link()->standard( + $this->lng->txt('prg_cancel_acknowledge_completed_courses'), + $this->ctrl->getLinkTarget($this, self::DEFAULT_CMD) + ) + ); + $this->toolbar->addComponent( + $this->ui_factory->link()->standard( + $this->lng->txt('prg_acknowledge_all_completed_courses'), + $this->ctrl->getLinkTarget($this, 'confirmedAcknowledgeAllCourses') + . '&ass_ids=' . implode(',', $ass_ids) + ) + ); + + return $form; } /** @@ -472,30 +490,6 @@ protected function getAddableUsers(array $users): array return $to_add; } - /** - * Add users to SP - * @param string[] $user_ids - * @return array - */ - protected function _addUsers(array $user_ids): array - { - $prg = $this->getStudyProgramme(); - $assignments = array(); - - foreach ($user_ids as $user_id) { - $assignments[$user_id] = $prg->assignUser((int) $user_id); - } - - if (count($assignments) === 1) { - $this->tpl->setOnScreenMessage("success", $this->lng->txt("prg_added_member"), true); - } - if (count($assignments) > 1) { - $this->tpl->setOnScreenMessage("success", $this->lng->txt("prg_added_members"), true); - } - - return $assignments; - } - protected function markAccredited(): void { $prgrs_id = $this->getPrgrsId(); @@ -625,11 +619,11 @@ public function updateFromCurrentPlan(): string $this->confirmation_gui->setConfirm($this->lng->txt('confirm'), 'confirmedUpdateFromCurrentPlan'); $this->confirmation_gui->setCancel($this->lng->txt('cancel'), 'view'); - $prgs_id = $this->getPostPrgsId(); + $prgs_id = $this->getPrgrsId(); $user_name = ilObjUser::_lookupFullname($prgs_id->getUsrId()); $this->confirmation_gui->addItem( self::F_SELECTED_PROGRESS_ID, - (string)$prgs_id, + (string) $prgs_id, $user_name ); return $this->confirmation_gui->getHTML(); @@ -646,7 +640,7 @@ public function updateFromCurrentPlanMulti(): string $user_name = ilObjUser::_lookupFullname($progress_id->getUsrId()); $this->confirmation_gui->addItem( self::F_SELECTED_PROGRESS_IDS . '[]', - (string)$progress_id, + (string) $progress_id, $user_name ); } @@ -675,6 +669,103 @@ public function confirmedUpdateFromCurrentPlan() $this->ctrl->redirect($this, "view"); } + public function acknowledgeCourses(): string + { + $progress_id = $this->getPrgrsId(); + $assignments = [ + $this->assignment_db->get($progress_id->getAssignmentId()) + ]; + return $this->ui_renderer->render( + $this->viewCompletedCourses($assignments) + ); + } + + public function acknowledgeCoursesMulti(): string + { + $assignments = []; + foreach ($this->getPostPrgsIds() as $progress_id) { + $assignments[] = $this->assignment_db->get($progress_id->getAssignmentId()); + } + return $this->ui_renderer->render( + $this->viewCompletedCourses($assignments) + ); + } + + /** + * @return ilPRGAssignment[] + */ + protected function getAssignmentsFromQuery(): array + { + $ass_ids = $this->http_wrapper->query()->retrieve( + 'ass_ids', + $this->refinery->custom()->transformation(fn ($ids) => explode(',', $ids)) + ); + $prg = $this->getStudyProgramme(); + $assignments = array_map( + fn ($ass_id) => $this->assignment_db->get((int) $ass_id), + $ass_ids + ); + + $assignments = array_filter( + $assignments, + fn ($ass) => $ass->getRootId() === $prg->getId() + ); + return $assignments; + } + + public function confirmedAcknowledgeAllCourses() + { + $prg = $this->getStudyProgramme(); + $assignments = $this->getAssignmentsFromQuery(); + $msgs = $this->getMessageCollection('msg_acknowledge_courses'); + + foreach ($assignments as $ass) { + $ass_ids[] = $ass->getId(); + $completed_crss = $prg->getCompletedCourses($ass->getUserId()); + $nodes = []; + foreach($completed_crss as $opt) { + $nodes[] = [$opt['prg_obj_id'], $opt['crsr_id']]; + } + $prg->acknowledgeCourses( + $ass->getId(), + $nodes, + $msgs + ); + } + $this->showMessages($msgs); + $this->ctrl->redirect($this, "view"); + } + + public function confirmedAcknowledgeCourses() + { + $assignments = $this->getAssignmentsFromQuery(); + + $form = $this->viewCompletedCourses($assignments)->withRequest($this->request); + $data = $form->getData(); + + $msgs = $this->getMessageCollection('msg_acknowledge_courses'); + + if($data) { + $acknowledge = []; + foreach ($data as $ack) { + [$assignment_id, $node_obj_id, $course_obj_id] = $ack; + if(! array_key_exists($assignment_id, $acknowledge)) { + $acknowledge[$assignment_id] = []; + } + $acknowledge[$assignment_id][] = [(int) $node_obj_id, (int) $course_obj_id]; + } + foreach ($acknowledge as $ass_id => $nodes) { + $this->object->acknowledgeCourses( + (int) $ass_id, + $nodes, + $msgs + ); + } + $this->showMessages($msgs); + } + $this->ctrl->redirect($this, "view"); + } + public function changeDeadline(): void { $this->ctrl->setParameterByClass( @@ -766,7 +857,7 @@ protected function confirmRemoveUsers(array $progress_ids): string $user_name = ilObjUser::_lookupFullname($progress_id->getUsrId()); $this->confirmation_gui->addItem( self::F_SELECTED_PROGRESS_IDS . '[]', - (string)$progress_id, + (string) $progress_id, $user_name ); } @@ -899,6 +990,9 @@ public function getLinkTargetForAction(string $action, string $prgrs_id, int $as case self::ACTION_UPDATE_FROM_CURRENT_PLAN: $target_name = "updateFromCurrentPlan"; break; + case self::ACTION_ACKNOWLEDGE_COURSES: + $target_name = "acknowledgeCourses"; + break; case self::ACTION_CHANGE_DEADLINE: $target_name = "changeDeadline"; break; diff --git a/Modules/StudyProgramme/classes/class.ilStudyProgrammeAcknowledgeCompletedCoursesTableGUI.php b/Modules/StudyProgramme/classes/class.ilStudyProgrammeAcknowledgeCompletedCoursesTableGUI.php deleted file mode 100644 index 0ec9cc55a34e..000000000000 --- a/Modules/StudyProgramme/classes/class.ilStudyProgrammeAcknowledgeCompletedCoursesTableGUI.php +++ /dev/null @@ -1,53 +0,0 @@ -user_id = $user_id; - - $this->addColumn("", "", "1", true); - $this->addColumn($this->lng->txt("title")); - - $this->setRowTemplate("tpl.acknowledge_completed_courses_row.html", "Modules/StudyProgramme"); - - $this->setData($completed_courses); - } - - protected function fillRow(array $a_set): void - { - $this->tpl->setVariable("USR_ID", (string) $this->user_id); - $this->tpl->setVariable("PRG_REF_ID", $a_set["prg_ref_id"]); - $this->tpl->setVariable("CRS_ID", $a_set["crs_id"]); - $this->tpl->setVariable("CRSR_ID", $a_set["crsr_id"]); - $this->tpl->setVariable("CRS_TITLE", $a_set["title"]); - } -} diff --git a/Modules/StudyProgramme/classes/class.ilStudyProgrammeDIC.php b/Modules/StudyProgramme/classes/class.ilStudyProgrammeDIC.php index c9491f102834..5874eac097de 100644 --- a/Modules/StudyProgramme/classes/class.ilStudyProgrammeDIC.php +++ b/Modules/StudyProgramme/classes/class.ilStudyProgrammeDIC.php @@ -43,7 +43,7 @@ public static function specificDicFor(ilObjStudyProgramme $prg): Container ilOrgUnitGlobalSettings::getInstance(), $DIC['ilObjDataCache'], new ilOrgUnitPositionAccess($DIC['ilAccess']), - (int)$prg->getRefid() + (int) $prg->getRefid() ); }; @@ -103,14 +103,14 @@ public static function specificDicFor(ilObjStudyProgramme $prg): Container $dic['ilStudyProgrammeMailMemberSearchGUI'] = static fn ($dic) => new ilStudyProgrammeMailMemberSearchGUI( - $DIC['ilCtrl'], - $DIC['tpl'], - $DIC['lng'], - $DIC['ilAccess'], - $DIC->http()->wrapper(), - $DIC->refinery(), - $dic['permissionhelper'] - ); + $DIC['ilCtrl'], + $DIC['tpl'], + $DIC['lng'], + $DIC['ilAccess'], + $DIC->http()->wrapper(), + $DIC->refinery(), + $dic['permissionhelper'] + ); return $dic; } @@ -211,7 +211,10 @@ protected static function buildDIC(): Container $dic['DataFactory'], new ilConfirmationGUI(), $DIC->http()->wrapper(), - $DIC->refinery() + $DIC->refinery(), + $DIC['ui.factory'], + $DIC['ui.renderer'], + $DIC->http()->request() ); $dic['ilObjStudyProgrammeAutoMembershipsGUI'] = static fn ($dic) => new ilObjStudyProgrammeAutoMembershipsGUI( diff --git a/Modules/StudyProgramme/classes/class.ilStudyProgrammeMembersTableGUI.php b/Modules/StudyProgramme/classes/class.ilStudyProgrammeMembersTableGUI.php index 4286be0abd17..f9cf0a183997 100644 --- a/Modules/StudyProgramme/classes/class.ilStudyProgrammeMembersTableGUI.php +++ b/Modules/StudyProgramme/classes/class.ilStudyProgrammeMembersTableGUI.php @@ -48,7 +48,7 @@ public function __construct( string $parent_cmd = '', string $template_context = '' ) { - $this->setId("sp_member_list"); + $this->setId("sp_member_list_" . $prg_obj_id); $this->prg_obj_id = $prg_obj_id; $this->prg_user_table = $prg_user_table; $this->custom_filter = $custom_filter; @@ -193,10 +193,21 @@ protected function fillRow($row): void case "prg_completion_by": $completion_by = $row->getCompletionBy(); - if ($completion_by_obj_id = $row->getCompletionByObjId()) { - if (ilObject::_lookupType($completion_by_obj_id) === 'crsr') { - $completion_by = $this->getCompletionLink($completion_by_obj_id, $completion_by); + if ($completion_by_obj_ids = $row->getCompletionByObjIds()) { + $out = []; + foreach ($completion_by_obj_ids as $completion_by_obj_id) { + $type = ilObject::_lookupType($completion_by_obj_id); + if ($type === 'crs') { + $out[] = $this->getCompletionLink($completion_by_obj_id, $completion_by); + } else { + $target_obj_id = $completion_by_obj_id; + $out[] = $this->getCompletionLink( + $target_obj_id, + ilStudyProgrammeUserTable::lookupTitle($completion_by_obj_id) + ); + } } + $completion_by = implode(', ', $out); } $this->tpl->setVariable("COMPLETION_BY", $completion_by); break; @@ -274,6 +285,7 @@ protected function buildActionDropDown( case ilObjStudyProgrammeMembersGUI::ACTION_UNMARK_RELEVANT: case ilObjStudyProgrammeMembersGUI::ACTION_MARK_RELEVANT: case ilObjStudyProgrammeMembersGUI::ACTION_UPDATE_FROM_CURRENT_PLAN: + case ilObjStudyProgrammeMembersGUI::ACTION_ACKNOWLEDGE_COURSES: case ilObjStudyProgrammeMembersGUI::ACTION_CHANGE_DEADLINE: case ilObjStudyProgrammeMembersGUI::ACTION_CHANGE_EXPIRE_DATE: if (!$edit_individual_plan) { @@ -335,6 +347,7 @@ protected function getMultiCommands(): array { $permissions_for_edit_individual_plan = [ 'updateFromCurrentPlanMulti' => $this->lng->txt('prg_multi_update_from_current_plan'), + 'acknowledgeCoursesMulti' => $this->lng->txt('prg_acknowledge_completed_courses'), 'markRelevantMulti' => $this->lng->txt('prg_multi_mark_relevant'), 'markNotRelevantMulti' => $this->lng->txt('prg_multi_unmark_relevant'), 'changeDeadlineMulti' => $this->lng->txt('prg_multi_change_deadline'), @@ -405,6 +418,7 @@ protected function getPossibleActions( $actions[] = ilObjStudyProgrammeMembersGUI::ACTION_UNMARK_RELEVANT; $actions[] = ilObjStudyProgrammeMembersGUI::ACTION_MARK_RELEVANT; $actions[] = ilObjStudyProgrammeMembersGUI::ACTION_UPDATE_FROM_CURRENT_PLAN; + $actions[] = ilObjStudyProgrammeMembersGUI::ACTION_ACKNOWLEDGE_COURSES; $actions[] = ilObjStudyProgrammeMembersGUI::ACTION_CHANGE_DEADLINE; $actions[] = ilObjStudyProgrammeMembersGUI::ACTION_CHANGE_EXPIRE_DATE; } diff --git a/Modules/StudyProgramme/classes/class.ilStudyProgrammeUserTable.php b/Modules/StudyProgramme/classes/class.ilStudyProgrammeUserTable.php index 51c84febc1fd..259b28a759c7 100644 --- a/Modules/StudyProgramme/classes/class.ilStudyProgrammeUserTable.php +++ b/Modules/StudyProgramme/classes/class.ilStudyProgrammeUserTable.php @@ -147,7 +147,7 @@ public function fetchData( $valid_user_ids, $custom_filters ); - $rows = array_map(fn($ass) => $this->toRow($ass, $prg_id), $data); + $rows = array_map(fn ($ass) => $this->toRow($ass, $prg_id), $data); $rows = $this->postOrder($rows, $order); if ($limit) { $offset = $offset ?? 0; @@ -159,7 +159,7 @@ public function fetchData( public function fetchSingleUserRootAssignments(int $usr_id): array { $data = $this->assignment_repo->getForUser($usr_id); - $row = array_map(fn($ass) => $this->toRow($ass, $ass->getRootId()), $data); + $row = array_map(fn ($ass) => $this->toRow($ass, $ass->getRootId()), $data); return $row; } @@ -210,10 +210,10 @@ protected function toRow(ilPRGAssignment $ass, int $node_id): ilStudyProgrammeUs $show_lp && $pgs->getCompletionDate() ? $pgs->getCompletionDate()->format($this->getUserDateFormat()) : '' ) ->withCompletionBy( - $show_lp && $pgs->getCompletionBy() ? $this->completionByToRepresent($pgs->getCompletionBy()) : '' + $show_lp && $pgs->getCompletionBy() ? $this->completionByToRepresent($pgs) : '' ) - ->withCompletionByObjId( - $show_lp && $pgs->getCompletionBy() ? $pgs->getCompletionBy() : null + ->withCompletionByObjIds( + $show_lp && $pgs->getCompletionBy() ? $this->completionByToCollection($pgs) : null ) ->withPointsReachable($points_reachable) ->withPointsRequired((string) $pgs->getAmountOfPoints()) @@ -297,12 +297,35 @@ public function assignmentSourceToRepresent(bool $manually, int $assignment_src) ]); } - public function completionByToRepresent(int $completion_by): string + public function completionByToRepresent(ilPRGProgress $progress): string { - if ($completion_by === ilPRGProgress::COMPLETED_BY_SUBNODES) { - return $this->lng->txt("prg_completed_by_subnodes"); + $completion_by = $progress->getCompletionBy(); + if ($completion_by !== ilPRGProgress::COMPLETED_BY_SUBNODES) { + return $this::lookupTitle($completion_by); } - return $this::lookupTitle($completion_by); + + $out = array_map( + fn (int $node_obj_id): string => self::lookupTitle($node_obj_id), + $this->completionByToCollection($progress) + ); + + return implode(', ', $out); + } + + protected function completionByToCollection(ilPRGProgress $progress): array + { + $completion_by = $progress->getCompletionBy(); + if ($completion_by !== ilPRGProgress::COMPLETED_BY_SUBNODES) { + return [$completion_by]; + } + $successful_subnodes = array_filter( + $progress->getSubnodes(), + static fn (ilPRGProgress $pgs): bool => $pgs->isSuccessful() + ); + return array_map( + static fn (ilPRGProgress $pgs): int => $pgs->getNodeId(), + $successful_subnodes + ); } public static function lookupTitle(int $obj_id): string @@ -312,8 +335,20 @@ public static function lookupTitle(int $obj_id): string case 'usr': case 'prg': return ilObject::_lookupTitle($obj_id); - case 'crsr': - return ilContainerReference::_lookupTitle($obj_id); + case 'prg': + $title = ilObject::_lookupTitle($obj_id); + if(ilObject::_isInTrash(ilObjStudyProgramme::getRefIdFor($obj_id))) { + return sprintf('(%s)', $title); + } + return $title; + case 'crs': + $title = ilObject::_lookupTitle($obj_id); + $refs = ilObject::_getAllReferences($obj_id); + $target_ref_id = array_shift($refs) ?? null; + if($target_ref_id === null || ilObject::_isInTrash($target_ref_id)) { + return sprintf('(%s)', $title); + } + return $title; } if ($del = ilObjectDataDeletionLog::get($obj_id)) { diff --git a/Modules/StudyProgramme/classes/ilStudyProgrammeUserTableRow.php b/Modules/StudyProgramme/classes/ilStudyProgrammeUserTableRow.php index 023b0665ac59..8b2295ae837f 100644 --- a/Modules/StudyProgramme/classes/ilStudyProgrammeUserTableRow.php +++ b/Modules/StudyProgramme/classes/ilStudyProgrammeUserTableRow.php @@ -18,6 +18,8 @@ * *********************************************************************/ +declare(strict_types=1); + /** * ilStudyProgrammeUserTable provides a flattened list of progresses at a programme-node. */ @@ -41,7 +43,10 @@ class ilStudyProgrammeUserTableRow protected string $gender; protected string $status; protected string $completion_date; - protected ?int $completion_by_obj_id; + /** + * @var ?int[] + */ + protected ?array $completion_by_obj_ids; protected string $completion_by; protected string $points_reachable; protected string $points_required; @@ -220,16 +225,22 @@ public function getCompletionBy(): string return $this->completion_by; } - public function withCompletionByObjId(?int $obj_id): self + /** + * @param ?int[] $ob_ids + */ + public function withCompletionByObjIds(?array $obj_ids): self { $clone = clone $this; - $clone->completion_by_obj_id = $obj_id; + $clone->completion_by_obj_ids = $obj_ids; return $clone; } - public function getCompletionByObjId(): ?int + /** + * @return ?int[] + */ + public function getCompletionByObjIds(): ?array { - return $this->completion_by_obj_id; + return $this->completion_by_obj_ids; } public function withPointsReachable(string $points_reachable): self @@ -353,7 +364,7 @@ public function getRestartDate(): string public function toArray(): array { return [ - 'prgrs_id' => (string)$this->getId(), + 'prgrs_id' => (string) $this->getId(), 'name' => $this->getName(), 'active_raw' => $this->isUserActiveRaw(), 'active' => $this->getUserActive(), diff --git a/Modules/StudyProgramme/templates/default/tpl.acknowledge_completed_courses.html b/Modules/StudyProgramme/templates/default/tpl.acknowledge_completed_courses.html deleted file mode 100644 index 7e606c047431..000000000000 --- a/Modules/StudyProgramme/templates/default/tpl.acknowledge_completed_courses.html +++ /dev/null @@ -1,29 +0,0 @@ -
-
-
-

{TITLE}

-
- - -
-
- -
-

{LASTNAME}, {FIRSTNAME}

-
-
- {TABLE} -
- - - - -
-
-
- - -
-
-
-
\ No newline at end of file diff --git a/Modules/StudyProgramme/templates/default/tpl.acknowledge_completed_courses_row.html b/Modules/StudyProgramme/templates/default/tpl.acknowledge_completed_courses_row.html deleted file mode 100644 index 774846f275c6..000000000000 --- a/Modules/StudyProgramme/templates/default/tpl.acknowledge_completed_courses_row.html +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - {CRS_TITLE} - - From 79531aa9bee0ff98c9c252c072a544474906151c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ferdinand=20Engl=C3=A4nder?= Date: Tue, 15 Oct 2024 16:53:15 +0200 Subject: [PATCH 263/292] 8/UI/learning-sequence-kiosk_footer-position_42025 --- Modules/LearningSequence/templates/default/tpl.kioskpage.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/LearningSequence/templates/default/tpl.kioskpage.html b/Modules/LearningSequence/templates/default/tpl.kioskpage.html index b6acc4314309..e96e6904d626 100644 --- a/Modules/LearningSequence/templates/default/tpl.kioskpage.html +++ b/Modules/LearningSequence/templates/default/tpl.kioskpage.html @@ -1,4 +1,4 @@ -
+
From 7f412c01e318ff66dbc1329b307b890892ecace3 Mon Sep 17 00:00:00 2001 From: iszmais <45942348+iszmais@users.noreply.github.com> Date: Tue, 3 Dec 2024 13:54:54 +0100 Subject: [PATCH 264/292] dc fix cast of ref prorperty (#8604) --- .../Fields/Reference/class.ilDclReferenceFieldModel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Modules/DataCollection/classes/Fields/Reference/class.ilDclReferenceFieldModel.php b/Modules/DataCollection/classes/Fields/Reference/class.ilDclReferenceFieldModel.php index 5e831ea300bf..b1d9ff2bee73 100644 --- a/Modules/DataCollection/classes/Fields/Reference/class.ilDclReferenceFieldModel.php +++ b/Modules/DataCollection/classes/Fields/Reference/class.ilDclReferenceFieldModel.php @@ -37,12 +37,12 @@ public function getRecordQuerySortObject( if ( $this->hasProperty(self::PROP_N_REFERENCE) || $this->getProperty(self::PROP_REFERENCE) === null || - ilDclCache::getFieldCache($this->getProperty(self::PROP_REFERENCE))->getTableId() === 0 + ilDclCache::getFieldCache((int) $this->getProperty(self::PROP_REFERENCE))->getTableId() === 0 ) { return null; } - $ref_field = ilDclCache::getFieldCache($this->getProperty(self::PROP_REFERENCE)); + $ref_field = ilDclCache::getFieldCache((int) $this->getProperty(self::PROP_REFERENCE)); $select_str = "stloc_{$this->getId()}_joined.value AS field_{$this->getId()},"; $join_str = "LEFT JOIN il_dcl_record_field AS record_field_{$this->getId()} ON (record_field_{$this->getId()}.record_id = record.id AND record_field_{$this->getId()}.field_id = " From 975eaf5dde6bf2bbb31c865427d6124b3aa01921 Mon Sep 17 00:00:00 2001 From: "Daniel Cazalla (ZallaxDev)" <86362063+ZallaxDev@users.noreply.github.com> Date: Wed, 4 Dec 2024 10:43:20 +0100 Subject: [PATCH 265/292] Moved strict_types to avoid error in copyrigh check. --- .../LTIConsumer/classes/class.ilLTIConsumeProviderList.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Modules/LTIConsumer/classes/class.ilLTIConsumeProviderList.php b/Modules/LTIConsumer/classes/class.ilLTIConsumeProviderList.php index 6735f242f58c..c78a5dbda6ed 100755 --- a/Modules/LTIConsumer/classes/class.ilLTIConsumeProviderList.php +++ b/Modules/LTIConsumer/classes/class.ilLTIConsumeProviderList.php @@ -1,7 +1,5 @@ Date: Wed, 4 Dec 2024 16:25:45 +0100 Subject: [PATCH 266/292] Mail: Hide BCC in internal messages See: https://mantis.ilias.de/view.php?id=43029#c110260 --- Services/Mail/classes/class.ilMail.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Services/Mail/classes/class.ilMail.php b/Services/Mail/classes/class.ilMail.php index 13e60892f4dd..f057c832d9d1 100755 --- a/Services/Mail/classes/class.ilMail.php +++ b/Services/Mail/classes/class.ilMail.php @@ -610,7 +610,7 @@ protected function distributeMail( $this->sendChanneledMails( $to, $cc, - $bcc, + '', $toUsrIds, $subject, $message, @@ -628,7 +628,7 @@ protected function distributeMail( $this->sendChanneledMails( $to, $cc, - $bcc, + '', $otherUsrIds, $subject, $this->replacePlaceholders($message, 0, false), @@ -645,7 +645,7 @@ protected function distributeMail( $this->sendChanneledMails( $to, $cc, - $bcc, + '', $usrIds, $subject, $message, From 736ea411d2627bf0240e180c4ca424149993feb2 Mon Sep 17 00:00:00 2001 From: Fabian Helfer <82493694+fhelfer@users.noreply.github.com> Date: Thu, 5 Dec 2024 10:18:40 +0100 Subject: [PATCH 267/292] T&A Bugfix #0042396: Fix Test Scoring Settings for Import/Export (#8412) * Fix Test Scoring Settings for Import/Export * Fix Show Pass Details defaulting to true in Import * Remove passDetails unit test * Fix Copyright ilObjTestTest * Remove local ilObjTest setter score_reporting & results_presentation --- Modules/Test/classes/class.ilObjTest.php | 92 +++--------------------- Modules/Test/test/ilObjTestTest.php | 46 +----------- 2 files changed, 11 insertions(+), 127 deletions(-) diff --git a/Modules/Test/classes/class.ilObjTest.php b/Modules/Test/classes/class.ilObjTest.php index 8f94988fcd1f..afd603924778 100755 --- a/Modules/Test/classes/class.ilObjTest.php +++ b/Modules/Test/classes/class.ilObjTest.php @@ -69,7 +69,6 @@ class ilObjTest extends ilObject implements ilMarkSchemaAware, ilEctsGradesEnabl */ public $mark_schema; public int $sequence_settings; - public int $score_reporting; public int $instant_verification; public int $answer_feedback_points; public $reporting_date; @@ -303,7 +302,6 @@ public function __construct($a_id = 0, bool $a_call_by_reference = true) $this->introduction = ""; $this->questions = array(); $this->sequence_settings = TEST_FIXED_SEQUENCE; - $this->score_reporting = self::SCORE_REPORTING_FINISHED; $this->instant_verification = 0; $this->answer_feedback_points = 0; $this->reporting_date = ""; @@ -1351,7 +1349,6 @@ public function loadFromDb(): void $this->setCustomStyle($data->customstyle); $this->setShowFinalStatement($data->showfinalstatement); $this->setSequenceSettings($data->sequence_settings); - $this->setScoreReporting($data->score_reporting); $this->setInstantFeedbackSolution($data->instant_verification); $this->setAnswerFeedbackPoints($data->answer_feedback_points); $this->setAnswerFeedback($data->answer_feedback); @@ -1371,7 +1368,6 @@ public function loadFromDb(): void $this->setResetProcessingTime($data->reset_processing_time); $this->setReportingDate($data->reporting_date); $this->setShuffleQuestions($data->shuffle_questions); - $this->setResultsPresentation($data->results_presentation); $this->setStartingTimeEnabled($data->starting_time_enabled); $this->setStartingTime($data->starting_time); $this->setEndingTimeEnabled($data->ending_time_enabled); @@ -1695,18 +1691,6 @@ public function setPostponingEnabled($postponingEnabled): void $this->setSequenceSettings((int) $postponingEnabled); } - /** - * Sets the score reporting of the ilObjTest object - * - * @param int|string $score_reporting The score reporting - * @see $score_reporting - * @deprecated - */ - public function setScoreReporting($score_reporting = 0): void - { - $this->score_reporting = (int) $score_reporting; - } - /** * Sets the instant feedback for the solution * @@ -1793,16 +1777,12 @@ public function setReportingDate($reporting_date): void public const SCORE_REPORTING_DATE = 3; public const SCORE_REPORTING_AFTER_PASSED = 4; - /** - * Gets the score reporting of the ilObjTest object - * - * @return integer The score reporting of the test - * @access public - * @see $score_reporting - */ public function getScoreReporting(): int { - return ($this->score_reporting) ? $this->score_reporting : 0; + if ($this->getTestId() !== -1) { + return $this->getScoreSettings()->getResultSummarySettings()->getScoreReporting(); + } + return 0; } public function isScoreReportingEnabled(): bool @@ -4950,7 +4930,6 @@ public function fromXML(ilQTIAssessment $assessment) // online exam $this->setFixedParticipants(1); $this->setListOfQuestionsSettings(7); - $this->setShowSolutionPrintview(1); break; case 5: // varying random test @@ -5095,7 +5074,7 @@ public function fromXML(ilQTIAssessment $assessment) $this->setFixedParticipants($metadata["entry"]); break; case "score_reporting": - $this->setScoreReporting((int) $metadata["entry"]); + $result_summary_settings = $result_summary_settings->withScoreReporting((int) $metadata["entry"]); break; case "shuffle_questions": $this->setShuffleQuestions($metadata["entry"]); @@ -5254,6 +5233,7 @@ public function fromXML(ilQTIAssessment $assessment) } $this->saveToDb(); + $result_summary_settings = $result_summary_settings->withShowPassDetails($result_details_settings->getShowPassDetails()); $score_settings = $score_settings ->withGamificationSettings($gamification_settings) ->withScoringSettings($scoring_settings) @@ -7946,7 +7926,7 @@ public function setListOfQuestionsDescription($a_value = true) */ public function getResultsPresentation(): int { - return ($this->results_presentation) ? $this->results_presentation : 0; + return $this->getScoreSettings()->getResultDetailsSettings()->getResultsPresentation(); } /** @@ -8021,51 +8001,11 @@ public function getShowSolutionListComparison(): bool return $this->getScoreSettings()->getResultDetailsSettings()->getShowSolutionListComparison(); } - /** - * Sets the combined results presentation value - * - * @param integer $a_results_presentation The combined results presentation value - * @access public - * @deprecated - */ - public function setResultsPresentation($a_results_presentation = 3) - { - $this->results_presentation = $a_results_presentation; - } - public function getShowSolutionListOwnAnswers($user_id = null): bool { return $this->getScoreSettings()->getResultDetailsSettings()->getShowSolutionListOwnAnswers(); } - /** - * ------------------------------------------------------------------------- - * Those setters are @deprecated! - * They modify $results_presentation based on some parameter and fall back to - * repo-settings when called without. - * Calls are a.o. in class.ilObjTestGUI.php and here during import; - * I left it in place to not to break too many things now, but they should go. - * Soon. - **/ - - /** - * Sets if the the solution details should be presented to the user or not - * - * @param integer $a_details 1 if the solution details should be presented, 0 otherwise - * @access public - * @deprecated - */ - public function setShowSolutionDetails($a_details = 1) - { - if ($a_details) { - $this->results_presentation = $this->results_presentation | 2; - } else { - if ($this->getShowSolutionDetails()) { - $this->results_presentation = $this->results_presentation ^ 2; - } - } - } - /** * Sets if the the solution printview should be presented to the user or not * @@ -8073,15 +8013,9 @@ public function setShowSolutionDetails($a_details = 1) * @access public * @deprecated */ - public function setShowSolutionPrintview($a_printview = 1) + public function setShowSolutionPrintview(int $a_printview = 1): void { - if ($a_printview) { - $this->results_presentation = $this->results_presentation | 4; - } else { - if ($this->getShowSolutionPrintview()) { - $this->results_presentation = $this->results_presentation ^ 4; - } - } + $this->getScoreSettings()->getResultDetailsSettings()->withShowSolutionPrintview($a_printview === 1); } /** @@ -8803,10 +8737,6 @@ public function applyDefaults($test_defaults): bool $this->setSequenceSettings($testsettings['SequenceSettings']); } - if (array_key_exists('ScoreReporting', $testsettings)) { - $this->setScoreReporting($testsettings['ScoreReporting']); - } - if (array_key_exists('SpecificAnswerFeedback', $testsettings)) { $this->setSpecificAnswerFeedback($testsettings['SpecificAnswerFeedback']); } @@ -8823,10 +8753,6 @@ public function applyDefaults($test_defaults): bool $this->setAnswerFeedbackPoints($testsettings['AnswerFeedbackPoints']); } - if (array_key_exists('ResultsPresentation', $testsettings)) { - $this->setResultsPresentation($testsettings['ResultsPresentation']); - } - if (array_key_exists('Anonymity', $testsettings)) { $this->setAnonymity($testsettings['Anonymity']); } diff --git a/Modules/Test/test/ilObjTestTest.php b/Modules/Test/test/ilObjTestTest.php index 7a83cb9dbead..1757fc83e66c 100644 --- a/Modules/Test/test/ilObjTestTest.php +++ b/Modules/Test/test/ilObjTestTest.php @@ -1,7 +1,5 @@ @@ -165,15 +165,6 @@ public function testSetPostponingEnabled(): void $this->assertTrue($this->testObj->isPostponingEnabled()); } - public function testScoreReporting(): void - { - $this->testObj->setScoreReporting(0); - $this->assertEquals(0, $this->testObj->getScoreReporting()); - - $this->testObj->setScoreReporting(1); - $this->assertEquals(1, $this->testObj->getScoreReporting()); - } - public function testInstantFeedbackSolution(): void { $this->testObj->setInstantFeedbackSolution(0); @@ -210,27 +201,6 @@ public function testAnswerFeedbackPoints(): void $this->assertEquals(1, $this->testObj->getAnswerFeedbackPoints()); } - public function testIsScoreReportingEnabled(): void - { - $this->testObj->setScoreReporting(ilObjTest::SCORE_REPORTING_FINISHED); - $this->assertTrue($this->testObj->isScoreReportingEnabled()); - - $this->testObj->setScoreReporting(ilObjTest::SCORE_REPORTING_IMMIDIATLY); - $this->assertTrue($this->testObj->isScoreReportingEnabled()); - - $this->testObj->setScoreReporting(ilObjTest::SCORE_REPORTING_DATE); - $this->assertTrue($this->testObj->isScoreReportingEnabled()); - - $this->testObj->setScoreReporting(ilObjTest::SCORE_REPORTING_AFTER_PASSED); - $this->assertTrue($this->testObj->isScoreReportingEnabled()); - - $this->testObj->setScoreReporting(ilObjTest::SCORE_REPORTING_DISABLED); - $this->assertFalse($this->testObj->isScoreReportingEnabled()); - - $this->testObj->setScoreReporting(999); - $this->assertFalse($this->testObj->isScoreReportingEnabled()); - } - public function testBlockPassesAfterPassedEnabled(): void { $this->testObj->setBlockPassesAfterPassedEnabled(false); @@ -425,16 +395,4 @@ public function testListOfQuestions(): void $this->testObj->setListOfQuestions(1); $this->assertTrue($this->testObj->getListOfQuestions()); } - - public function testResultsPresentation(): void - { - $this->testObj->setResultsPresentation(0); - $this->assertEquals(0, $this->testObj->getResultsPresentation()); - - $this->testObj->setResultsPresentation(1); - $this->assertEquals(1, $this->testObj->getResultsPresentation()); - - $this->testObj->setResultsPresentation(22); - $this->assertEquals(22, $this->testObj->getResultsPresentation()); - } } From 4fd669de567cd9000868030ddf33ec8f8550fb35 Mon Sep 17 00:00:00 2001 From: Fabian Helfer <82493694+fhelfer@users.noreply.github.com> Date: Thu, 5 Dec 2024 10:26:32 +0100 Subject: [PATCH 268/292] Fix Soap User prefs check rejecting imported values (#8584) --- Services/User/classes/class.ilUserImportParser.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Services/User/classes/class.ilUserImportParser.php b/Services/User/classes/class.ilUserImportParser.php index fba6b6506e74..ba1816a9fe37 100755 --- a/Services/User/classes/class.ilUserImportParser.php +++ b/Services/User/classes/class.ilUserImportParser.php @@ -1078,13 +1078,13 @@ public function importEndTag( } } - if (!is_array($this->prefs) || !in_array('chat_osc_accept_msg', $this->prefs)) { + if (!is_array($this->prefs) || !array_key_exists('chat_osc_accept_msg', $this->prefs)) { $this->userObj->setPref('chat_osc_accept_msg', $ilSetting->get('chat_osc_accept_msg', 'n')); } - if (!is_array($this->prefs) || !in_array('chat_broadcast_typing', $this->prefs)) { + if (!is_array($this->prefs) || !array_key_exists('chat_broadcast_typing', $this->prefs)) { $this->userObj->setPref('chat_broadcast_typing', $ilSetting->get('chat_broadcast_typing', 'n')); } - if (!is_array($this->prefs) || !in_array('bs_allow_to_contact_me', $this->prefs)) { + if (!is_array($this->prefs) || !array_key_exists('bs_allow_to_contact_me', $this->prefs)) { $this->userObj->setPref('bs_allow_to_contact_me', $ilSetting->get('bs_allow_to_contact_me', 'n')); } From 2b28c36c56fae93885fc4543ee82dfd4de9d87c7 Mon Sep 17 00:00:00 2001 From: iszmais <45942348+iszmais@users.noreply.github.com> Date: Thu, 5 Dec 2024 16:27:02 +0100 Subject: [PATCH 269/292] fix co back handling with locked editing (#8635) --- .../class.ilDclCreateViewDefinitionGUI.php | 21 ++----------------- .../class.ilDclDetailedViewDefinitionGUI.php | 20 ++---------------- .../class.ilDclEditViewDefinitionGUI.php | 21 ++----------------- 3 files changed, 6 insertions(+), 56 deletions(-) diff --git a/Modules/DataCollection/classes/CreateView/class.ilDclCreateViewDefinitionGUI.php b/Modules/DataCollection/classes/CreateView/class.ilDclCreateViewDefinitionGUI.php index 8c0fdbed5e9a..c47786a343f0 100644 --- a/Modules/DataCollection/classes/CreateView/class.ilDclCreateViewDefinitionGUI.php +++ b/Modules/DataCollection/classes/CreateView/class.ilDclCreateViewDefinitionGUI.php @@ -1,4 +1,5 @@ * @ilCtrl_Calls ilDclCreateViewDefinitionGUI: ilPageEditorGUI, ilEditClipboardGUI, ilMediaPoolTargetSelector * @ilCtrl_Calls ilDclCreateViewDefinitionGUI: ilPublicUserProfileGUI, ilPageObjectGUI */ @@ -146,21 +144,6 @@ public function deleteView(): void $ilCtrl->redirectByClass("ilDclTableViewEditGUI", "editGeneralSettings"); } - /** - * Release page lock - * overwrite to redirect properly - */ - public function releasePageLock(): void - { - global $DIC; - $ilCtrl = $DIC['ilCtrl']; - $lng = $DIC['lng']; - - $this->getPageObject()->releasePageLock(); - $this->tpl->setOnScreenMessage('success', $lng->txt("cont_page_lock_released"), true); - $ilCtrl->redirectByClass('ilDclTableViewGUI', "show"); - } - /** * Finalizing output processing * @param string $a_output diff --git a/Modules/DataCollection/classes/DetailedView/class.ilDclDetailedViewDefinitionGUI.php b/Modules/DataCollection/classes/DetailedView/class.ilDclDetailedViewDefinitionGUI.php index 664a1a60f5c0..aea975acc29f 100644 --- a/Modules/DataCollection/classes/DetailedView/class.ilDclDetailedViewDefinitionGUI.php +++ b/Modules/DataCollection/classes/DetailedView/class.ilDclDetailedViewDefinitionGUI.php @@ -1,4 +1,5 @@ - * @author Marcel Raimann - * @author Fabian Schmid - * @author Jörg Lützenkirchen * @ilCtrl_Calls ilDclDetailedViewDefinitionGUI: ilPageEditorGUI, ilEditClipboardGUI, ilMediaPoolTargetSelector * @ilCtrl_Calls ilDclDetailedViewDefinitionGUI: ilPublicUserProfileGUI, ilPageObjectGUI */ @@ -168,17 +163,6 @@ public function deleteView(): void $this->ctrl->redirectByClass(self::class, "edit"); } - /** - * Release page lock - * overwrite to redirect properly - */ - public function releasePageLock(): void - { - $this->getPageObject()->releasePageLock(); - $this->tpl->setOnScreenMessage('success', $this->lng->txt("cont_page_lock_released"), true); - $this->ctrl->redirectByClass('ilDclTableViewGUI', "show"); - } - /** * Finalizing output processing */ diff --git a/Modules/DataCollection/classes/EditView/class.ilDclEditViewDefinitionGUI.php b/Modules/DataCollection/classes/EditView/class.ilDclEditViewDefinitionGUI.php index b28192cca2ad..899b3c18dc62 100644 --- a/Modules/DataCollection/classes/EditView/class.ilDclEditViewDefinitionGUI.php +++ b/Modules/DataCollection/classes/EditView/class.ilDclEditViewDefinitionGUI.php @@ -1,4 +1,5 @@ * @ilCtrl_Calls ilDclEditViewDefinitionGUI: ilPageEditorGUI, ilEditClipboardGUI, ilMediaPoolTargetSelector * @ilCtrl_Calls ilDclEditViewDefinitionGUI: ilPublicUserProfileGUI, ilPageObjectGUI */ @@ -143,21 +141,6 @@ public function deleteView(): void $ilCtrl->redirectByClass("ilDclTableViewEditGUI", "editGeneralSettings"); } - /** - * Release page lock - * overwrite to redirect properly - */ - public function releasePageLock(): void - { - global $DIC; - $ilCtrl = $DIC['ilCtrl']; - $lng = $DIC['lng']; - - $this->getPageObject()->releasePageLock(); - $this->tpl->setOnScreenMessage('success', $lng->txt("cont_page_lock_released"), true); - $ilCtrl->redirectByClass('ilDclTableViewGUI', "show"); - } - /** * Finalizing output processing * @param string $a_output From cf2a5ab1bb447a6f2ce67e3a68e33efae7ea7e80 Mon Sep 17 00:00:00 2001 From: iszmais <45942348+iszmais@users.noreply.github.com> Date: Thu, 5 Dec 2024 17:02:17 +0100 Subject: [PATCH 270/292] dc refactor class header (#8639) --- .../class.ilDataCollectionAccessAdapter.php | 7 ++----- ...class.ilDataCollectionOutboundsAdapter.php | 7 ++----- .../class.ilDataCollectionEndpointAdapter.php | 7 ++----- .../Ui/class.ilDataCollectionUiAdapter.php | 7 ++----- .../Content/class.ilDclContentExporter.php | 10 ++-------- .../Content/class.ilDclContentImporter.php | 6 ------ .../Content/class.ilDclRecordEditGUI.php | 9 --------- .../Content/class.ilDclRecordListGUI.php | 8 -------- .../Content/class.ilDclRecordListTableGUI.php | 9 --------- .../class.ilDclCreateViewDefinition.php | 9 ++------- .../class.ilDclCreateViewDefinitionConfig.php | 8 ++------ .../class.ilDclCreateViewTableGUI.php | 8 ++------ .../class.ilDclDetailedViewDefinition.php | 13 ++---------- ...lass.ilDclDetailedViewDefinitionConfig.php | 10 ++-------- .../class.ilDclDetailedViewGUI.php | 7 +------ .../class.ilDclEditViewDefinition.php | 9 ++------- .../class.ilDclEditViewDefinitionConfig.php | 8 ++------ .../EditView/class.ilDclEditViewTableGUI.php | 8 ++------ .../Base/class.ilDclBaseRecordFieldModel.php | 10 ---------- .../Base/class.ilDclBaseRecordModel.php | 10 ---------- .../class.ilDclBaseRecordRepresentation.php | 5 ----- .../Fields/Base/class.ilDclFieldProperty.php | 9 ++------- .../Fields/Base/class.ilDclStandardField.php | 13 ++---------- .../Boolean/class.ilDclBooleanFieldModel.php | 9 ++------- .../class.ilDclBooleanFieldRepresentation.php | 9 ++------- .../class.ilDclBooleanRecordFieldModel.php | 9 +-------- ...class.ilDclBooleanRecordRepresentation.php | 9 ++------- .../class.ilDclDateSelectionFieldModel.php | 8 ++------ ....ilDclDateSelectionFieldRepresentation.php | 8 ++------ ...ass.ilDclDateSelectionRecordFieldModel.php | 8 ++------ ...ilDclDateSelectionRecordRepresentation.php | 8 ++------ .../class.ilDclDatetimeFieldModel.php | 9 ++------- ...class.ilDclDatetimeFieldRepresentation.php | 9 ++------- .../class.ilDclDatetimeRecordFieldModel.php | 9 +-------- ...lass.ilDclDatetimeRecordRepresentation.php | 9 ++------- .../class.ilDclFileuploadFieldModel.php | 9 ++------- ...ass.ilDclFileuploadFieldRepresentation.php | 9 ++------- .../class.ilDclFileuploadRecordFieldModel.php | 6 ------ ...ss.ilDclFileuploadRecordRepresentation.php | 6 ------ .../Formula/class.ilDclExpressionParser.php | 9 ++------- .../Formula/class.ilDclFormulaFieldModel.php | 9 ++------- .../class.ilDclFormulaFieldRepresentation.php | 10 +++------- .../class.ilDclFormulaRecordFieldModel.php | 9 +-------- .../class.ilDclFormulaRecordQueryObject.php | 9 ++------- .../Fields/Formula/class.ilDclStack.php | 9 ++------- .../Fields/Formula/class.ilDclTokenizer.php | 9 ++------- .../class.ilDclIliasReferenceFieldModel.php | 9 ++------- ...ilDclIliasReferenceFieldRepresentation.php | 9 ++------- ...ss.ilDclIliasReferenceRecordFieldModel.php | 12 +---------- ...lDclIliasReferenceRecordRepresentation.php | 9 ++------- .../Fields/Mob/class.ilDclMobFieldModel.php | 5 ----- .../Mob/class.ilDclMobFieldRepresentation.php | 5 ----- .../Mob/class.ilDclMobRecordFieldModel.php | 6 ------ .../class.ilDclMobRecordRepresentation.php | 5 ----- .../Number/class.ilDclNumberFieldModel.php | 9 ++------- .../class.ilDclNumberFieldRepresentation.php | 9 ++------- .../class.ilDclNumberRecordFieldModel.php | 9 +-------- .../Plugin/class.ilDclPluginFieldModel.php | 9 +++------ .../class.ilDclPluginFieldRepresentation.php | 5 ----- .../class.ilDclPluginRecordFieldModel.php | 8 ++------ .../Rating/class.ilDclRatingFieldModel.php | 9 ++------- .../class.ilDclRatingFieldRepresentation.php | 9 ++------- .../class.ilDclRatingRecordFieldModel.php | 13 ++---------- .../class.ilDclRatingRecordRepresentation.php | 8 +------- ...lass.ilDclReferenceFieldRepresentation.php | 9 ++------- ...ass.ilDclReferenceRecordRepresentation.php | 5 ----- .../class.ilDclSelectionFieldModel.php | 8 ++------ ...lass.ilDclSelectionFieldRepresentation.php | 8 ++------ .../Selection/class.ilDclSelectionOption.php | 8 ++------ .../class.ilDclSelectionRecordFieldModel.php | 8 ++------ ...ass.ilDclSelectionRecordRepresentation.php | 8 ++------ .../Fields/Text/class.ilDclTextFieldModel.php | 6 +----- .../class.ilDclTextFieldRepresentation.php | 10 +++------- .../Text/class.ilDclTextRecordFieldModel.php | 4 ---- .../Text/class.ilDclTextRecordQueryObject.php | 9 ++------- .../class.ilDclTextRecordRepresentation.php | 5 ----- .../class.ilDclTextSelectionFieldModel.php | 8 ++------ ....ilDclTextSelectionFieldRepresentation.php | 8 ++------ ...ass.ilDclTextSelectionRecordFieldModel.php | 8 ++------ ...ilDclTextSelectionRecordRepresentation.php | 8 ++------ .../Fields/class.ilDclFieldListGUI.php | 13 ++---------- .../Fields/class.ilDclFieldListTableGUI.php | 3 +-- .../Helpers/class.ilDclCheckboxInputGUI.php | 8 ++------ .../class.ilDclGenericMultiInputGUI.php | 10 +++------- .../classes/Helpers/class.ilDclLinkButton.php | 7 ++----- .../Helpers/class.ilDclMultiTextInputGUI.php | 8 ++------ .../Helpers/class.ilDclPropertyFormGUI.php | 3 --- .../Helpers/class.ilDclRecordQueryObject.php | 9 ++------- .../Helpers/class.ilDclTextInputGUI.php | 8 ++------ .../class.ilDataCollectionAccessPort.php | 8 +++----- .../class.ilDataCollectionOutboundsPort.php | 8 +++----- .../class.ilDataCollectionEndpointPort.php | 8 +++----- ...ss.ilDataCollectionGuiClassFactoryPort.php | 8 +++----- .../class.ilDataCollectionGuiClassPort.php | 7 ++----- .../Ports/Ui/class.ilDataCollectionUiPort.php | 7 ++----- .../classes/Table/class.ilDclTableEditGUI.php | 12 +---------- .../Table/class.ilDclTableFieldSetting.php | 10 ++-------- .../classes/Table/class.ilDclTableHelper.php | 8 ++------ .../classes/Table/class.ilDclTableListGUI.php | 6 ++---- .../Table/class.ilDclTableListTableGUI.php | 8 ++------ .../class.ilDclDefaultValueFactory.php | 16 +++++++++++++++ .../class.ilDclTableViewBaseDefaultValue.php | 18 ++++++++++++++--- .../class.ilDclTableViewDateDefaultValue.php | 18 ++++++++++++++--- ...class.ilDclTableViewEditFieldsTableGUI.php | 19 ++++++++++++++---- .../class.ilDclTableViewEditFormGUI.php | 18 ++++++++++++++--- .../TableView/class.ilDclTableViewEditGUI.php | 19 +++++++++++++++--- .../class.ilDclTableViewFieldSetting.php | 10 ++-------- .../TableView/class.ilDclTableViewGUI.php | 7 ++----- ...class.ilDclTableViewNumberDefaultValue.php | 18 ++++++++++++++--- .../class.ilDclTableViewTextDefaultValue.php | 18 ++++++++++++++--- .../class.ilDataCollectionExporter.php | 5 ----- .../class.ilDataCollectionGlobalTemplate.php | 10 ++-------- .../class.ilDataCollectionImporter.php | 9 ++------- .../classes/class.ilDclExportGUI.php | 9 +++------ .../classes/class.ilDclExportTableGUI.php | 9 +++------ .../classes/class.ilObjDataCollection.php | 7 ------- .../class.ilObjDataCollectionAccess.php | 11 +--------- .../classes/class.ilObjDataCollectionGUI.php | 8 -------- .../class.ilObjDataCollectionListGUI.php | 10 +--------- .../exceptions/class.ilDclException.php | 9 ++------- .../exceptions/class.ilDclInputException.php | 16 +++++---------- Modules/DataCollection/js/datacollection.js | 17 ++++++++++++---- .../js/generic_multi_line_input.js | 16 +++++++++++++++ .../test/ilModulesDataCollectionSuite.php | 20 +++++++++++++++---- 124 files changed, 352 insertions(+), 787 deletions(-) diff --git a/Modules/DataCollection/classes/Adapters/Access/class.ilDataCollectionAccessAdapter.php b/Modules/DataCollection/classes/Adapters/Access/class.ilDataCollectionAccessAdapter.php index dbe2222653f6..e48e61a2e9cf 100644 --- a/Modules/DataCollection/classes/Adapters/Access/class.ilDataCollectionAccessAdapter.php +++ b/Modules/DataCollection/classes/Adapters/Access/class.ilDataCollectionAccessAdapter.php @@ -1,4 +1,5 @@ - * @ingroup ModulesDataCollection - */ class ilDclContentExporter { public const SOAP_FUNCTION_NAME = 'exportDataCollectionContent'; diff --git a/Modules/DataCollection/classes/Content/class.ilDclContentImporter.php b/Modules/DataCollection/classes/Content/class.ilDclContentImporter.php index 0e6c03f38775..81b88b07572b 100644 --- a/Modules/DataCollection/classes/Content/class.ilDclContentImporter.php +++ b/Modules/DataCollection/classes/Content/class.ilDclContentImporter.php @@ -16,12 +16,6 @@ * *********************************************************************/ -/** - * Hook-Class for exporting data-collections (used in SOAP-Class) - * This Class avoids duplicated code by routing the request to the right place - * @author Michael Herren - * @ingroup ModulesDataCollection - */ class ilDclContentImporter { //const SOAP_FUNCTION_NAME = 'exportDataCollectionContent'; diff --git a/Modules/DataCollection/classes/Content/class.ilDclRecordEditGUI.php b/Modules/DataCollection/classes/Content/class.ilDclRecordEditGUI.php index 9abe480fff2f..41309fac1641 100644 --- a/Modules/DataCollection/classes/Content/class.ilDclRecordEditGUI.php +++ b/Modules/DataCollection/classes/Content/class.ilDclRecordEditGUI.php @@ -16,15 +16,6 @@ * *********************************************************************/ -/** - * Class ilDclRecordEditGUI - * @author Martin Studer - * @author Marcel Raimann - * @author Fabian Schmid - * @author Oskar Truffer - * @author Stefan Wanzenried - * @version $Id: - */ class ilDclRecordEditGUI { /** diff --git a/Modules/DataCollection/classes/Content/class.ilDclRecordListGUI.php b/Modules/DataCollection/classes/Content/class.ilDclRecordListGUI.php index 5ea186346a45..d808941b054c 100644 --- a/Modules/DataCollection/classes/Content/class.ilDclRecordListGUI.php +++ b/Modules/DataCollection/classes/Content/class.ilDclRecordListGUI.php @@ -16,14 +16,6 @@ * *********************************************************************/ -/** - * @author Martin Studer - * @author Marcel Raimann - * @author Fabian Schmid - * @author Oskar Truffer - * @version $Id: - * @ingroup ModulesDataCollection - */ class ilDclRecordListGUI { public const GET_TABLE_ID = 'table_id'; diff --git a/Modules/DataCollection/classes/Content/class.ilDclRecordListTableGUI.php b/Modules/DataCollection/classes/Content/class.ilDclRecordListTableGUI.php index 121ee942a5b2..62c39074b1c4 100644 --- a/Modules/DataCollection/classes/Content/class.ilDclRecordListTableGUI.php +++ b/Modules/DataCollection/classes/Content/class.ilDclRecordListTableGUI.php @@ -16,15 +16,6 @@ * *********************************************************************/ -/** - * Class ilDclBaseFieldModel - * @author Martin Studer - * @author Marcel Raimann - * @author Fabian Schmid - * @author Oskar Truffer - * @version $Id: - * @ingroup ModulesDataCollection - */ class ilDclRecordListTableGUI extends ilTable2GUI { public const EXPORT_EXCEL_ASYNC = 10; diff --git a/Modules/DataCollection/classes/CreateView/class.ilDclCreateViewDefinition.php b/Modules/DataCollection/classes/CreateView/class.ilDclCreateViewDefinition.php index d41ba15e55ae..c026de1c349a 100644 --- a/Modules/DataCollection/classes/CreateView/class.ilDclCreateViewDefinition.php +++ b/Modules/DataCollection/classes/CreateView/class.ilDclCreateViewDefinition.php @@ -1,4 +1,5 @@ - * @ingroup ModulesDataCollection - */ class ilDclCreateViewDefinition extends ilPageObject { public const PARENT_TYPE = 'dclf'; diff --git a/Modules/DataCollection/classes/CreateView/class.ilDclCreateViewDefinitionConfig.php b/Modules/DataCollection/classes/CreateView/class.ilDclCreateViewDefinitionConfig.php index 743d6eda2b41..a7612ed9d1c4 100644 --- a/Modules/DataCollection/classes/CreateView/class.ilDclCreateViewDefinitionConfig.php +++ b/Modules/DataCollection/classes/CreateView/class.ilDclCreateViewDefinitionConfig.php @@ -1,4 +1,5 @@ - */ class ilDclCreateViewDefinitionConfig extends ilPageConfig { public function init(): void diff --git a/Modules/DataCollection/classes/CreateView/class.ilDclCreateViewTableGUI.php b/Modules/DataCollection/classes/CreateView/class.ilDclCreateViewTableGUI.php index 4d8bb1f066b1..f535fee817b9 100644 --- a/Modules/DataCollection/classes/CreateView/class.ilDclCreateViewTableGUI.php +++ b/Modules/DataCollection/classes/CreateView/class.ilDclCreateViewTableGUI.php @@ -1,4 +1,5 @@ - */ class ilDclCreateViewTableGUI extends ilTable2GUI { public const VALID_DEFAULT_VALUE_TYPES = [ diff --git a/Modules/DataCollection/classes/DetailedView/class.ilDclDetailedViewDefinition.php b/Modules/DataCollection/classes/DetailedView/class.ilDclDetailedViewDefinition.php index 6ba95f222a31..aff4c564c791 100644 --- a/Modules/DataCollection/classes/DetailedView/class.ilDclDetailedViewDefinition.php +++ b/Modules/DataCollection/classes/DetailedView/class.ilDclDetailedViewDefinition.php @@ -1,4 +1,5 @@ - * @author Marcel Raimann - * @author Fabian Schmid - * @author Oskar Truffer - * @version $Id: - * @ingroup ModulesDataCollection - */ class ilDclDetailedViewDefinition extends ilPageObject { public const PARENT_TYPE = 'dclf'; diff --git a/Modules/DataCollection/classes/DetailedView/class.ilDclDetailedViewDefinitionConfig.php b/Modules/DataCollection/classes/DetailedView/class.ilDclDetailedViewDefinitionConfig.php index 00e64780efec..60d43797558a 100644 --- a/Modules/DataCollection/classes/DetailedView/class.ilDclDetailedViewDefinitionConfig.php +++ b/Modules/DataCollection/classes/DetailedView/class.ilDclDetailedViewDefinitionConfig.php @@ -1,4 +1,5 @@ - * @version $Id$ - * @ingroup ModulesDataCollection - */ class ilDclDetailedViewDefinitionConfig extends ilPageConfig { /** diff --git a/Modules/DataCollection/classes/DetailedView/class.ilDclDetailedViewGUI.php b/Modules/DataCollection/classes/DetailedView/class.ilDclDetailedViewGUI.php index ee63ba10e2ea..529b236303fd 100644 --- a/Modules/DataCollection/classes/DetailedView/class.ilDclDetailedViewGUI.php +++ b/Modules/DataCollection/classes/DetailedView/class.ilDclDetailedViewGUI.php @@ -14,14 +14,9 @@ * https://www.ilias.de * https://github.com/ILIAS-eLearning * - ******************************************************************** - */ + *********************************************************************/ /** - * @author Martin Studer - * @author Marcel Raimann - * @author Fabian Schmid - * @version $Id: * @ilCtrl_Calls ilDclDetailedViewGUI: ilDclDetailedViewDefinitionGUI, ilEditClipboardGUI */ class ilDclDetailedViewGUI diff --git a/Modules/DataCollection/classes/EditView/class.ilDclEditViewDefinition.php b/Modules/DataCollection/classes/EditView/class.ilDclEditViewDefinition.php index 3b9cd3e1fbe6..558378d57a71 100644 --- a/Modules/DataCollection/classes/EditView/class.ilDclEditViewDefinition.php +++ b/Modules/DataCollection/classes/EditView/class.ilDclEditViewDefinition.php @@ -1,4 +1,5 @@ - * @ingroup ModulesDataCollection - */ class ilDclEditViewDefinition extends ilPageObject { public const PARENT_TYPE = 'dclf'; diff --git a/Modules/DataCollection/classes/EditView/class.ilDclEditViewDefinitionConfig.php b/Modules/DataCollection/classes/EditView/class.ilDclEditViewDefinitionConfig.php index 086fa157bec6..5e10204a821b 100644 --- a/Modules/DataCollection/classes/EditView/class.ilDclEditViewDefinitionConfig.php +++ b/Modules/DataCollection/classes/EditView/class.ilDclEditViewDefinitionConfig.php @@ -1,4 +1,5 @@ - */ class ilDclEditViewDefinitionConfig extends ilPageConfig { /** diff --git a/Modules/DataCollection/classes/EditView/class.ilDclEditViewTableGUI.php b/Modules/DataCollection/classes/EditView/class.ilDclEditViewTableGUI.php index 2ba3ed09d50b..6e63798a1811 100644 --- a/Modules/DataCollection/classes/EditView/class.ilDclEditViewTableGUI.php +++ b/Modules/DataCollection/classes/EditView/class.ilDclEditViewTableGUI.php @@ -1,4 +1,5 @@ - */ class ilDclEditViewTableGUI extends ilTable2GUI { protected ilLanguage $lng; diff --git a/Modules/DataCollection/classes/Fields/Base/class.ilDclBaseRecordFieldModel.php b/Modules/DataCollection/classes/Fields/Base/class.ilDclBaseRecordFieldModel.php index d0dcb1c92251..ff94535c8bd4 100644 --- a/Modules/DataCollection/classes/Fields/Base/class.ilDclBaseRecordFieldModel.php +++ b/Modules/DataCollection/classes/Fields/Base/class.ilDclBaseRecordFieldModel.php @@ -16,16 +16,6 @@ * *********************************************************************/ -/** - * Class ilDclBaseFieldModel - * @author Martin Studer - * @author Marcel Raimann - * @author Fabian Schmid - * @author Oskar Truffer - * @author Stefan Wanzenried - * @version $Id: - * @ingroup ModulesDataCollection - */ class ilDclBaseRecordFieldModel { protected ?int $id = null; diff --git a/Modules/DataCollection/classes/Fields/Base/class.ilDclBaseRecordModel.php b/Modules/DataCollection/classes/Fields/Base/class.ilDclBaseRecordModel.php index 2408ac627251..5b025f25fcff 100644 --- a/Modules/DataCollection/classes/Fields/Base/class.ilDclBaseRecordModel.php +++ b/Modules/DataCollection/classes/Fields/Base/class.ilDclBaseRecordModel.php @@ -18,16 +18,6 @@ use ILIAS\Notes\Service; -/** - * Class ilDclBaseRecordModel - * @author Martin Studer - * @author Marcel Raimann - * @author Fabian Schmid - * @author Oskar Truffer - * @author Stefan Wanzenried - * @version $Id: - * @ingroup ModulesDataCollection - */ class ilDclBaseRecordModel { protected \ILIAS\UI\Factory $ui_factory; diff --git a/Modules/DataCollection/classes/Fields/Base/class.ilDclBaseRecordRepresentation.php b/Modules/DataCollection/classes/Fields/Base/class.ilDclBaseRecordRepresentation.php index d86a30fedb02..ade5b929a068 100644 --- a/Modules/DataCollection/classes/Fields/Base/class.ilDclBaseRecordRepresentation.php +++ b/Modules/DataCollection/classes/Fields/Base/class.ilDclBaseRecordRepresentation.php @@ -16,11 +16,6 @@ * *********************************************************************/ -/** - * Class ilDclBaseRecordRepresentation - * @author Michael Herren - * @version 1.0.0 - */ class ilDclBaseRecordRepresentation { protected ilDclBaseRecordFieldModel $record_field; diff --git a/Modules/DataCollection/classes/Fields/Base/class.ilDclFieldProperty.php b/Modules/DataCollection/classes/Fields/Base/class.ilDclFieldProperty.php index e34ed87df5fc..9198cbc32e4d 100644 --- a/Modules/DataCollection/classes/Fields/Base/class.ilDclFieldProperty.php +++ b/Modules/DataCollection/classes/Fields/Base/class.ilDclFieldProperty.php @@ -1,4 +1,5 @@ - * @ingroup ModulesDataCollection - */ class ilDclFieldProperty extends ActiveRecord { /** diff --git a/Modules/DataCollection/classes/Fields/Base/class.ilDclStandardField.php b/Modules/DataCollection/classes/Fields/Base/class.ilDclStandardField.php index 5afb9538b43a..3a3948f84efa 100644 --- a/Modules/DataCollection/classes/Fields/Base/class.ilDclStandardField.php +++ b/Modules/DataCollection/classes/Fields/Base/class.ilDclStandardField.php @@ -1,4 +1,5 @@ - * @author Marcel Raimann - * @author Fabian Schmid - * @author Oskar Truffer - * @version $Id: - * @ingroup ModulesDataCollection - */ class ilDclStandardField extends ilDclBaseFieldModel { private ilGlobalTemplateInterface $main_tpl; diff --git a/Modules/DataCollection/classes/Fields/Boolean/class.ilDclBooleanFieldModel.php b/Modules/DataCollection/classes/Fields/Boolean/class.ilDclBooleanFieldModel.php index 2d526b07bc2e..063586dc30d7 100644 --- a/Modules/DataCollection/classes/Fields/Boolean/class.ilDclBooleanFieldModel.php +++ b/Modules/DataCollection/classes/Fields/Boolean/class.ilDclBooleanFieldModel.php @@ -1,4 +1,5 @@ - * @version 1.0.0 - */ class ilDclBooleanFieldModel extends ilDclBaseFieldModel { /** diff --git a/Modules/DataCollection/classes/Fields/Boolean/class.ilDclBooleanFieldRepresentation.php b/Modules/DataCollection/classes/Fields/Boolean/class.ilDclBooleanFieldRepresentation.php index 2d31d54edb1e..b65ffa873b84 100644 --- a/Modules/DataCollection/classes/Fields/Boolean/class.ilDclBooleanFieldRepresentation.php +++ b/Modules/DataCollection/classes/Fields/Boolean/class.ilDclBooleanFieldRepresentation.php @@ -1,4 +1,5 @@ - * @version 1.0.0 - */ class ilDclBooleanFieldRepresentation extends ilDclBaseFieldRepresentation { public function getInputField(ilPropertyFormGUI $form, ?int $record_id = null): ilDclCheckboxInputGUI diff --git a/Modules/DataCollection/classes/Fields/Boolean/class.ilDclBooleanRecordFieldModel.php b/Modules/DataCollection/classes/Fields/Boolean/class.ilDclBooleanRecordFieldModel.php index 66fa522003db..f7237784a6d4 100644 --- a/Modules/DataCollection/classes/Fields/Boolean/class.ilDclBooleanRecordFieldModel.php +++ b/Modules/DataCollection/classes/Fields/Boolean/class.ilDclBooleanRecordFieldModel.php @@ -14,15 +14,8 @@ * https://www.ilias.de * https://github.com/ILIAS-eLearning * - ******************************************************************** - */ + *********************************************************************/ -/** - * Class ilDclBaseFieldModel - * @author Stefan Wanzenried - * @author Fabian Schmid - * @version $Id: - */ class ilDclBooleanRecordFieldModel extends ilDclBaseRecordFieldModel { /** diff --git a/Modules/DataCollection/classes/Fields/Boolean/class.ilDclBooleanRecordRepresentation.php b/Modules/DataCollection/classes/Fields/Boolean/class.ilDclBooleanRecordRepresentation.php index bea660225823..6756645c65ad 100644 --- a/Modules/DataCollection/classes/Fields/Boolean/class.ilDclBooleanRecordRepresentation.php +++ b/Modules/DataCollection/classes/Fields/Boolean/class.ilDclBooleanRecordRepresentation.php @@ -1,4 +1,5 @@ - * @version 1.0.0 - */ class ilDclBooleanRecordRepresentation extends ilDclBaseRecordRepresentation { /** diff --git a/Modules/DataCollection/classes/Fields/DateSelection/class.ilDclDateSelectionFieldModel.php b/Modules/DataCollection/classes/Fields/DateSelection/class.ilDclDateSelectionFieldModel.php index b6a51b86ea62..82bc7c631157 100644 --- a/Modules/DataCollection/classes/Fields/DateSelection/class.ilDclDateSelectionFieldModel.php +++ b/Modules/DataCollection/classes/Fields/DateSelection/class.ilDclDateSelectionFieldModel.php @@ -1,4 +1,5 @@ - */ class ilDclDateSelectionFieldModel extends ilDclSelectionFieldModel { public const PROP_SELECTION_TYPE = 'date_selection_type'; diff --git a/Modules/DataCollection/classes/Fields/DateSelection/class.ilDclDateSelectionFieldRepresentation.php b/Modules/DataCollection/classes/Fields/DateSelection/class.ilDclDateSelectionFieldRepresentation.php index 701ddf0a3a96..039a111a8bc7 100644 --- a/Modules/DataCollection/classes/Fields/DateSelection/class.ilDclDateSelectionFieldRepresentation.php +++ b/Modules/DataCollection/classes/Fields/DateSelection/class.ilDclDateSelectionFieldRepresentation.php @@ -1,4 +1,5 @@ - */ class ilDclDateSelectionFieldRepresentation extends ilDclSelectionFieldRepresentation { public const PROP_SELECTION_TYPE = 'date_selection_type'; diff --git a/Modules/DataCollection/classes/Fields/DateSelection/class.ilDclDateSelectionRecordFieldModel.php b/Modules/DataCollection/classes/Fields/DateSelection/class.ilDclDateSelectionRecordFieldModel.php index 567db3d8794e..15faa8699e6b 100644 --- a/Modules/DataCollection/classes/Fields/DateSelection/class.ilDclDateSelectionRecordFieldModel.php +++ b/Modules/DataCollection/classes/Fields/DateSelection/class.ilDclDateSelectionRecordFieldModel.php @@ -1,4 +1,5 @@ - */ class ilDclDateSelectionRecordFieldModel extends ilDclSelectionRecordFieldModel { public const PROP_SELECTION_TYPE = 'date_selection_type'; diff --git a/Modules/DataCollection/classes/Fields/DateSelection/class.ilDclDateSelectionRecordRepresentation.php b/Modules/DataCollection/classes/Fields/DateSelection/class.ilDclDateSelectionRecordRepresentation.php index 4e5a7201337a..64cda3406fc7 100644 --- a/Modules/DataCollection/classes/Fields/DateSelection/class.ilDclDateSelectionRecordRepresentation.php +++ b/Modules/DataCollection/classes/Fields/DateSelection/class.ilDclDateSelectionRecordRepresentation.php @@ -1,4 +1,5 @@ - */ class ilDclDateSelectionRecordRepresentation extends ilDclSelectionRecordRepresentation { public const PROP_SELECTION_TYPE = 'date_selection_type'; diff --git a/Modules/DataCollection/classes/Fields/Datetime/class.ilDclDatetimeFieldModel.php b/Modules/DataCollection/classes/Fields/Datetime/class.ilDclDatetimeFieldModel.php index 8aaeb7bad96a..3005aa6bad14 100644 --- a/Modules/DataCollection/classes/Fields/Datetime/class.ilDclDatetimeFieldModel.php +++ b/Modules/DataCollection/classes/Fields/Datetime/class.ilDclDatetimeFieldModel.php @@ -1,4 +1,5 @@ - * @version 1.0.0 - */ class ilDclDatetimeFieldModel extends ilDclBaseFieldModel { /** diff --git a/Modules/DataCollection/classes/Fields/Datetime/class.ilDclDatetimeFieldRepresentation.php b/Modules/DataCollection/classes/Fields/Datetime/class.ilDclDatetimeFieldRepresentation.php index 981f6f6e7077..75ac2ab8d503 100644 --- a/Modules/DataCollection/classes/Fields/Datetime/class.ilDclDatetimeFieldRepresentation.php +++ b/Modules/DataCollection/classes/Fields/Datetime/class.ilDclDatetimeFieldRepresentation.php @@ -1,4 +1,5 @@ - * @version 1.0.0 - */ class ilDclDatetimeFieldRepresentation extends ilDclBaseFieldRepresentation { public function getInputField(ilPropertyFormGUI $form, ?int $record_id = null): ilDateTimeInputGUI diff --git a/Modules/DataCollection/classes/Fields/Datetime/class.ilDclDatetimeRecordFieldModel.php b/Modules/DataCollection/classes/Fields/Datetime/class.ilDclDatetimeRecordFieldModel.php index 3c530b768b4f..d60b4795f054 100644 --- a/Modules/DataCollection/classes/Fields/Datetime/class.ilDclDatetimeRecordFieldModel.php +++ b/Modules/DataCollection/classes/Fields/Datetime/class.ilDclDatetimeRecordFieldModel.php @@ -14,15 +14,8 @@ * https://www.ilias.de * https://github.com/ILIAS-eLearning * - ******************************************************************** - */ + *********************************************************************/ -/** - * Class ilDclBaseFieldModel - * @author Stefan Wanzenried - * @author Fabian Schmid - * @version $Id: - */ class ilDclDatetimeRecordFieldModel extends ilDclBaseRecordFieldModel { /** diff --git a/Modules/DataCollection/classes/Fields/Datetime/class.ilDclDatetimeRecordRepresentation.php b/Modules/DataCollection/classes/Fields/Datetime/class.ilDclDatetimeRecordRepresentation.php index 44a1264eb647..fcff99a66b5f 100644 --- a/Modules/DataCollection/classes/Fields/Datetime/class.ilDclDatetimeRecordRepresentation.php +++ b/Modules/DataCollection/classes/Fields/Datetime/class.ilDclDatetimeRecordRepresentation.php @@ -1,4 +1,5 @@ - * @version 1.0.0 - */ class ilDclDatetimeRecordRepresentation extends ilDclBaseRecordRepresentation { /** diff --git a/Modules/DataCollection/classes/Fields/Fileupload/class.ilDclFileuploadFieldModel.php b/Modules/DataCollection/classes/Fields/Fileupload/class.ilDclFileuploadFieldModel.php index 31b743178f5c..1b12f75c8113 100644 --- a/Modules/DataCollection/classes/Fields/Fileupload/class.ilDclFileuploadFieldModel.php +++ b/Modules/DataCollection/classes/Fields/Fileupload/class.ilDclFileuploadFieldModel.php @@ -1,4 +1,5 @@ - * @version 1.0.0 - */ class ilDclFileuploadFieldModel extends ilDclBaseFieldModel { public function getRecordQuerySortObject( diff --git a/Modules/DataCollection/classes/Fields/Fileupload/class.ilDclFileuploadFieldRepresentation.php b/Modules/DataCollection/classes/Fields/Fileupload/class.ilDclFileuploadFieldRepresentation.php index d34a76e77efc..7ec1cbd18811 100644 --- a/Modules/DataCollection/classes/Fields/Fileupload/class.ilDclFileuploadFieldRepresentation.php +++ b/Modules/DataCollection/classes/Fields/Fileupload/class.ilDclFileuploadFieldRepresentation.php @@ -1,4 +1,5 @@ - * @version 1.0.0 - */ class ilDclFileuploadFieldRepresentation extends ilDclBaseFieldRepresentation { public function getInputField(ilPropertyFormGUI $form, ?int $record_id = null): ilFileInputGUI diff --git a/Modules/DataCollection/classes/Fields/Fileupload/class.ilDclFileuploadRecordFieldModel.php b/Modules/DataCollection/classes/Fields/Fileupload/class.ilDclFileuploadRecordFieldModel.php index 4d676206bb23..004eacb1f8e0 100644 --- a/Modules/DataCollection/classes/Fields/Fileupload/class.ilDclFileuploadRecordFieldModel.php +++ b/Modules/DataCollection/classes/Fields/Fileupload/class.ilDclFileuploadRecordFieldModel.php @@ -19,12 +19,6 @@ use ILIAS\FileUpload\MimeType; use ILIAS\Filesystem\Stream\Streams; -/** - * Class ilDclBaseFieldModel - * @author Stefan Wanzenried - * @author Fabian Schmid - * @version $Id: - */ class ilDclFileuploadRecordFieldModel extends ilDclBaseRecordFieldModel { private \ILIAS\FileUpload\FileUpload $upload; diff --git a/Modules/DataCollection/classes/Fields/Fileupload/class.ilDclFileuploadRecordRepresentation.php b/Modules/DataCollection/classes/Fields/Fileupload/class.ilDclFileuploadRecordRepresentation.php index 6749a190402e..33f757c15efb 100644 --- a/Modules/DataCollection/classes/Fields/Fileupload/class.ilDclFileuploadRecordRepresentation.php +++ b/Modules/DataCollection/classes/Fields/Fileupload/class.ilDclFileuploadRecordRepresentation.php @@ -16,12 +16,6 @@ * *********************************************************************/ - -/** - * Class ilDclFileuploadRecordRepresentation - * @author Michael Herren - * @version 1.0.0 - */ class ilDclFileuploadRecordRepresentation extends ilDclBaseRecordRepresentation { /** diff --git a/Modules/DataCollection/classes/Fields/Formula/class.ilDclExpressionParser.php b/Modules/DataCollection/classes/Fields/Formula/class.ilDclExpressionParser.php index d3c330059022..e9835c68904d 100644 --- a/Modules/DataCollection/classes/Fields/Formula/class.ilDclExpressionParser.php +++ b/Modules/DataCollection/classes/Fields/Formula/class.ilDclExpressionParser.php @@ -1,4 +1,5 @@ - * @author Fabian Schmid - */ class ilDclExpressionParser { public const N_DECIMALS = 1; diff --git a/Modules/DataCollection/classes/Fields/Formula/class.ilDclFormulaFieldModel.php b/Modules/DataCollection/classes/Fields/Formula/class.ilDclFormulaFieldModel.php index 80f4773cbb6a..a9e0ffe9fd16 100644 --- a/Modules/DataCollection/classes/Fields/Formula/class.ilDclFormulaFieldModel.php +++ b/Modules/DataCollection/classes/Fields/Formula/class.ilDclFormulaFieldModel.php @@ -1,4 +1,5 @@ - * @version 1.0.0 - */ class ilDclFormulaFieldModel extends ilDclBaseFieldModel { /** diff --git a/Modules/DataCollection/classes/Fields/Formula/class.ilDclFormulaFieldRepresentation.php b/Modules/DataCollection/classes/Fields/Formula/class.ilDclFormulaFieldRepresentation.php index b9ad1064f42e..ecb4e8b9965a 100644 --- a/Modules/DataCollection/classes/Fields/Formula/class.ilDclFormulaFieldRepresentation.php +++ b/Modules/DataCollection/classes/Fields/Formula/class.ilDclFormulaFieldRepresentation.php @@ -1,4 +1,5 @@ - * @version 1.0.0 - */ + *********************************************************************/ + class ilDclFormulaFieldRepresentation extends ilDclBaseFieldRepresentation { public function getInputField(ilPropertyFormGUI $form, ?int $record_id = null): ilTextInputGUI diff --git a/Modules/DataCollection/classes/Fields/Formula/class.ilDclFormulaRecordFieldModel.php b/Modules/DataCollection/classes/Fields/Formula/class.ilDclFormulaRecordFieldModel.php index 99c69cdd7009..7099d8b88036 100644 --- a/Modules/DataCollection/classes/Fields/Formula/class.ilDclFormulaRecordFieldModel.php +++ b/Modules/DataCollection/classes/Fields/Formula/class.ilDclFormulaRecordFieldModel.php @@ -14,15 +14,8 @@ * https://www.ilias.de * https://github.com/ILIAS-eLearning * - ******************************************************************** - */ + *********************************************************************/ -/** - * Class ilDclBaseFieldModel - * @author Stefan Wanzenried - * @author Fabian Schmid - * @version $Id: - */ class ilDclFormulaRecordFieldModel extends ilDclBaseRecordFieldModel { protected string $expression = ''; diff --git a/Modules/DataCollection/classes/Fields/Formula/class.ilDclFormulaRecordQueryObject.php b/Modules/DataCollection/classes/Fields/Formula/class.ilDclFormulaRecordQueryObject.php index 03318c44ad36..050b00f963d2 100644 --- a/Modules/DataCollection/classes/Fields/Formula/class.ilDclFormulaRecordQueryObject.php +++ b/Modules/DataCollection/classes/Fields/Formula/class.ilDclFormulaRecordQueryObject.php @@ -1,4 +1,5 @@ - * @version 1.0.0 - */ class ilDclFormulaRecordQueryObject extends ilDclRecordQueryObject { public function applyCustomSorting( diff --git a/Modules/DataCollection/classes/Fields/Formula/class.ilDclStack.php b/Modules/DataCollection/classes/Fields/Formula/class.ilDclStack.php index 36c6df5fe8f2..bd3b942080b4 100644 --- a/Modules/DataCollection/classes/Fields/Formula/class.ilDclStack.php +++ b/Modules/DataCollection/classes/Fields/Formula/class.ilDclStack.php @@ -1,4 +1,5 @@ - * @author Fabian Schmid - */ class ilDclStack { protected array $stack = array(); diff --git a/Modules/DataCollection/classes/Fields/Formula/class.ilDclTokenizer.php b/Modules/DataCollection/classes/Fields/Formula/class.ilDclTokenizer.php index b20eacaa46b1..c140ba926832 100644 --- a/Modules/DataCollection/classes/Fields/Formula/class.ilDclTokenizer.php +++ b/Modules/DataCollection/classes/Fields/Formula/class.ilDclTokenizer.php @@ -1,4 +1,5 @@ - * @author Fabian Schmid - */ class ilDclTokenizer { /** diff --git a/Modules/DataCollection/classes/Fields/IliasReference/class.ilDclIliasReferenceFieldModel.php b/Modules/DataCollection/classes/Fields/IliasReference/class.ilDclIliasReferenceFieldModel.php index 475d1452433b..108456b8a788 100644 --- a/Modules/DataCollection/classes/Fields/IliasReference/class.ilDclIliasReferenceFieldModel.php +++ b/Modules/DataCollection/classes/Fields/IliasReference/class.ilDclIliasReferenceFieldModel.php @@ -1,4 +1,5 @@ - * @version 1.0.0 - */ class ilDclIliasReferenceFieldModel extends ilDclBaseFieldModel { /** diff --git a/Modules/DataCollection/classes/Fields/IliasReference/class.ilDclIliasReferenceFieldRepresentation.php b/Modules/DataCollection/classes/Fields/IliasReference/class.ilDclIliasReferenceFieldRepresentation.php index b6287e5634c4..34b841b3f8ee 100644 --- a/Modules/DataCollection/classes/Fields/IliasReference/class.ilDclIliasReferenceFieldRepresentation.php +++ b/Modules/DataCollection/classes/Fields/IliasReference/class.ilDclIliasReferenceFieldRepresentation.php @@ -1,4 +1,5 @@ - * @version 1.0.0 - */ class ilDclIliasReferenceFieldRepresentation extends ilDclBaseFieldRepresentation { public function getInputField(ilPropertyFormGUI $form, ?int $record_id = null): ilRepositorySelector2InputGUI diff --git a/Modules/DataCollection/classes/Fields/IliasReference/class.ilDclIliasReferenceRecordFieldModel.php b/Modules/DataCollection/classes/Fields/IliasReference/class.ilDclIliasReferenceRecordFieldModel.php index ce3fab75d3d2..b9f0d8f3fb8f 100644 --- a/Modules/DataCollection/classes/Fields/IliasReference/class.ilDclIliasReferenceRecordFieldModel.php +++ b/Modules/DataCollection/classes/Fields/IliasReference/class.ilDclIliasReferenceRecordFieldModel.php @@ -14,18 +14,8 @@ * https://www.ilias.de * https://github.com/ILIAS-eLearning * - ******************************************************************** - */ + *********************************************************************/ -/** - * Class ilDclIliasReferenceRecordFieldModel - * @author Martin Studer - * @author Marcel Raimann - * @author Fabian Schmid - * @author Oskar Truffer - * @version $Id: - * @ingroup ModulesDataCollection - */ class ilDclIliasReferenceRecordFieldModel extends ilDclBaseRecordFieldModel { protected int $dcl_obj_id; diff --git a/Modules/DataCollection/classes/Fields/IliasReference/class.ilDclIliasReferenceRecordRepresentation.php b/Modules/DataCollection/classes/Fields/IliasReference/class.ilDclIliasReferenceRecordRepresentation.php index 2addd4c437e6..37b0e1a35647 100644 --- a/Modules/DataCollection/classes/Fields/IliasReference/class.ilDclIliasReferenceRecordRepresentation.php +++ b/Modules/DataCollection/classes/Fields/IliasReference/class.ilDclIliasReferenceRecordRepresentation.php @@ -1,4 +1,5 @@ - * @version 1.0.0 - */ class ilDclIliasReferenceRecordRepresentation extends ilDclBaseRecordRepresentation { public function getHTML(bool $link = true, array $options = []): string diff --git a/Modules/DataCollection/classes/Fields/Mob/class.ilDclMobFieldModel.php b/Modules/DataCollection/classes/Fields/Mob/class.ilDclMobFieldModel.php index 968cfc3a4b17..20fa6c21232d 100644 --- a/Modules/DataCollection/classes/Fields/Mob/class.ilDclMobFieldModel.php +++ b/Modules/DataCollection/classes/Fields/Mob/class.ilDclMobFieldModel.php @@ -16,11 +16,6 @@ * *********************************************************************/ -/** - * Class ilDclBooleanFieldModel - * @author Michael Herren - * @version 1.0.0 - */ class ilDclMobFieldModel extends ilDclFileuploadFieldModel { public static array $mob_suffixes = array('jpg', 'jpeg', 'gif', 'png', 'mp3', 'flx', 'mp4', 'm4v', 'mov', 'wmv'); diff --git a/Modules/DataCollection/classes/Fields/Mob/class.ilDclMobFieldRepresentation.php b/Modules/DataCollection/classes/Fields/Mob/class.ilDclMobFieldRepresentation.php index 44427b727a10..a6d38d1bb42a 100644 --- a/Modules/DataCollection/classes/Fields/Mob/class.ilDclMobFieldRepresentation.php +++ b/Modules/DataCollection/classes/Fields/Mob/class.ilDclMobFieldRepresentation.php @@ -16,11 +16,6 @@ * *********************************************************************/ -/** - * Class ilDclFileuploadFieldRepresentaion - * @author Michael Herren - * @version 1.0.0 - */ class ilDclMobFieldRepresentation extends ilDclFileuploadFieldRepresentation { public function getInputField(ilPropertyFormGUI $form, ?int $record_id = null): ilFileInputGUI diff --git a/Modules/DataCollection/classes/Fields/Mob/class.ilDclMobRecordFieldModel.php b/Modules/DataCollection/classes/Fields/Mob/class.ilDclMobRecordFieldModel.php index b4f7d3ba405d..b3e3314e4ecd 100644 --- a/Modules/DataCollection/classes/Fields/Mob/class.ilDclMobRecordFieldModel.php +++ b/Modules/DataCollection/classes/Fields/Mob/class.ilDclMobRecordFieldModel.php @@ -16,12 +16,6 @@ * *********************************************************************/ -/** - * Class ilDclMobRecordFieldModel - * @author Stefan Wanzenried - * @author Fabian Schmid - * @author Michael Herren - */ class ilDclMobRecordFieldModel extends ilDclBaseRecordFieldModel { private \ilGlobalTemplateInterface $main_tpl; diff --git a/Modules/DataCollection/classes/Fields/Mob/class.ilDclMobRecordRepresentation.php b/Modules/DataCollection/classes/Fields/Mob/class.ilDclMobRecordRepresentation.php index af498fd156eb..636610957c4c 100644 --- a/Modules/DataCollection/classes/Fields/Mob/class.ilDclMobRecordRepresentation.php +++ b/Modules/DataCollection/classes/Fields/Mob/class.ilDclMobRecordRepresentation.php @@ -16,11 +16,6 @@ * *********************************************************************/ -/** - * Class ilDclMobRecordRepresentation - * @author Michael Herren - * @version 1.0.0 - */ class ilDclMobRecordRepresentation extends ilDclFileuploadRecordRepresentation { /** diff --git a/Modules/DataCollection/classes/Fields/Number/class.ilDclNumberFieldModel.php b/Modules/DataCollection/classes/Fields/Number/class.ilDclNumberFieldModel.php index 049723d48d78..a245aa8ff7be 100644 --- a/Modules/DataCollection/classes/Fields/Number/class.ilDclNumberFieldModel.php +++ b/Modules/DataCollection/classes/Fields/Number/class.ilDclNumberFieldModel.php @@ -1,4 +1,5 @@ - * @version 1.0.0 - */ class ilDclNumberFieldModel extends ilDclBaseFieldModel { /** diff --git a/Modules/DataCollection/classes/Fields/Number/class.ilDclNumberFieldRepresentation.php b/Modules/DataCollection/classes/Fields/Number/class.ilDclNumberFieldRepresentation.php index 8a565625c623..6d1ebd4b2860 100644 --- a/Modules/DataCollection/classes/Fields/Number/class.ilDclNumberFieldRepresentation.php +++ b/Modules/DataCollection/classes/Fields/Number/class.ilDclNumberFieldRepresentation.php @@ -1,4 +1,5 @@ - * @version 1.0.0 - */ class ilDclNumberFieldRepresentation extends ilDclBaseFieldRepresentation { public function getInputField(ilPropertyFormGUI $form, ?int $record_id = null): ilNumberInputGUI diff --git a/Modules/DataCollection/classes/Fields/Number/class.ilDclNumberRecordFieldModel.php b/Modules/DataCollection/classes/Fields/Number/class.ilDclNumberRecordFieldModel.php index dd1ff34122bd..b21eac6fefb6 100644 --- a/Modules/DataCollection/classes/Fields/Number/class.ilDclNumberRecordFieldModel.php +++ b/Modules/DataCollection/classes/Fields/Number/class.ilDclNumberRecordFieldModel.php @@ -14,15 +14,8 @@ * https://www.ilias.de * https://github.com/ILIAS-eLearning * - ******************************************************************** - */ + *********************************************************************/ -/** - * Class ilDclNumberRecordFieldModel - * @author Stefan Wanzenried - * @author Fabian Schmid - * @version $Id: - */ class ilDclNumberRecordFieldModel extends ilDclBaseRecordFieldModel { public function parseValue($value): ?float diff --git a/Modules/DataCollection/classes/Fields/Plugin/class.ilDclPluginFieldModel.php b/Modules/DataCollection/classes/Fields/Plugin/class.ilDclPluginFieldModel.php index 63f3d636bf5e..373f910e815d 100644 --- a/Modules/DataCollection/classes/Fields/Plugin/class.ilDclPluginFieldModel.php +++ b/Modules/DataCollection/classes/Fields/Plugin/class.ilDclPluginFieldModel.php @@ -1,4 +1,5 @@ - */ + *********************************************************************/ + class ilDclPluginFieldModel extends ilDclBaseFieldModel { public function getValidFieldProperties(): array diff --git a/Modules/DataCollection/classes/Fields/Plugin/class.ilDclPluginFieldRepresentation.php b/Modules/DataCollection/classes/Fields/Plugin/class.ilDclPluginFieldRepresentation.php index 3432ef945c54..b98124c36bbc 100644 --- a/Modules/DataCollection/classes/Fields/Plugin/class.ilDclPluginFieldRepresentation.php +++ b/Modules/DataCollection/classes/Fields/Plugin/class.ilDclPluginFieldRepresentation.php @@ -16,11 +16,6 @@ * *********************************************************************/ -/** - * Class ilDclPluginFieldRepresentation - * @author Michael Herren - * @version 1.0.0 - */ class ilDclPluginFieldRepresentation extends ilDclBaseFieldRepresentation { protected function buildFieldCreationInput(ilObjDataCollection $dcl, string $mode = 'create'): ?ilRadioOption diff --git a/Modules/DataCollection/classes/Fields/Plugin/class.ilDclPluginRecordFieldModel.php b/Modules/DataCollection/classes/Fields/Plugin/class.ilDclPluginRecordFieldModel.php index 4143f7ab0118..c134968faae3 100644 --- a/Modules/DataCollection/classes/Fields/Plugin/class.ilDclPluginRecordFieldModel.php +++ b/Modules/DataCollection/classes/Fields/Plugin/class.ilDclPluginRecordFieldModel.php @@ -1,4 +1,5 @@ - */ class ilDclPluginRecordFieldModel extends ilDclBaseRecordFieldModel { } diff --git a/Modules/DataCollection/classes/Fields/Rating/class.ilDclRatingFieldModel.php b/Modules/DataCollection/classes/Fields/Rating/class.ilDclRatingFieldModel.php index 7ff78478bfca..c76ba311b740 100644 --- a/Modules/DataCollection/classes/Fields/Rating/class.ilDclRatingFieldModel.php +++ b/Modules/DataCollection/classes/Fields/Rating/class.ilDclRatingFieldModel.php @@ -1,4 +1,5 @@ - * @version 1.0.0 - */ class ilDclRatingFieldModel extends ilDclBaseFieldModel { public function getRecordQuerySortObject( diff --git a/Modules/DataCollection/classes/Fields/Rating/class.ilDclRatingFieldRepresentation.php b/Modules/DataCollection/classes/Fields/Rating/class.ilDclRatingFieldRepresentation.php index 2647746b902f..48f1d04915cd 100644 --- a/Modules/DataCollection/classes/Fields/Rating/class.ilDclRatingFieldRepresentation.php +++ b/Modules/DataCollection/classes/Fields/Rating/class.ilDclRatingFieldRepresentation.php @@ -1,4 +1,5 @@ - * @version 1.0.0 - */ class ilDclRatingFieldRepresentation extends ilDclBaseFieldRepresentation { public function getInputField(ilPropertyFormGUI $form, ?int $record_id = null): ilTextInputGUI diff --git a/Modules/DataCollection/classes/Fields/Rating/class.ilDclRatingRecordFieldModel.php b/Modules/DataCollection/classes/Fields/Rating/class.ilDclRatingRecordFieldModel.php index 23600ca764ef..00c6a154492e 100644 --- a/Modules/DataCollection/classes/Fields/Rating/class.ilDclRatingRecordFieldModel.php +++ b/Modules/DataCollection/classes/Fields/Rating/class.ilDclRatingRecordFieldModel.php @@ -1,4 +1,5 @@ - * @author Marcel Raimann - * @author Fabian Schmid - * @author Oskar Truffer - * @version $Id: - * @ingroup ModulesDataCollection - */ class ilDclRatingRecordFieldModel extends ilDclBaseRecordFieldModel { protected int $dcl_obj_id; diff --git a/Modules/DataCollection/classes/Fields/Rating/class.ilDclRatingRecordRepresentation.php b/Modules/DataCollection/classes/Fields/Rating/class.ilDclRatingRecordRepresentation.php index c571470d5d04..66dcbcbe40c4 100644 --- a/Modules/DataCollection/classes/Fields/Rating/class.ilDclRatingRecordRepresentation.php +++ b/Modules/DataCollection/classes/Fields/Rating/class.ilDclRatingRecordRepresentation.php @@ -14,14 +14,8 @@ * https://www.ilias.de * https://github.com/ILIAS-eLearning * - ******************************************************************** - */ + *********************************************************************/ -/** - * Class ilDclMobRecordRepresentation - * @author Michael Herren - * @version 1.0.0 - */ class ilDclRatingRecordRepresentation extends ilDclBaseRecordRepresentation { public function getHTML(bool $link = true, array $options = []): string diff --git a/Modules/DataCollection/classes/Fields/Reference/class.ilDclReferenceFieldRepresentation.php b/Modules/DataCollection/classes/Fields/Reference/class.ilDclReferenceFieldRepresentation.php index d5724bff1ae8..685253c28c5d 100644 --- a/Modules/DataCollection/classes/Fields/Reference/class.ilDclReferenceFieldRepresentation.php +++ b/Modules/DataCollection/classes/Fields/Reference/class.ilDclReferenceFieldRepresentation.php @@ -1,4 +1,5 @@ - * @version 1.0.0 - */ class ilDclReferenceFieldRepresentation extends ilDclBaseFieldRepresentation { public const REFERENCE_SEPARATOR = " -> "; diff --git a/Modules/DataCollection/classes/Fields/Reference/class.ilDclReferenceRecordRepresentation.php b/Modules/DataCollection/classes/Fields/Reference/class.ilDclReferenceRecordRepresentation.php index 6f08cd9ba1b3..c31da90275d0 100644 --- a/Modules/DataCollection/classes/Fields/Reference/class.ilDclReferenceRecordRepresentation.php +++ b/Modules/DataCollection/classes/Fields/Reference/class.ilDclReferenceRecordRepresentation.php @@ -16,11 +16,6 @@ * *********************************************************************/ -/** - * Class ilDclReferenceRecordRepresentation - * @author Michael Herren - * @version 1.0.0 - */ class ilDclReferenceRecordRepresentation extends ilDclBaseRecordRepresentation { public function getHTML(bool $link = true, array $options = []): string diff --git a/Modules/DataCollection/classes/Fields/Selection/class.ilDclSelectionFieldModel.php b/Modules/DataCollection/classes/Fields/Selection/class.ilDclSelectionFieldModel.php index be92f514b4b4..35c4c7d51ce7 100644 --- a/Modules/DataCollection/classes/Fields/Selection/class.ilDclSelectionFieldModel.php +++ b/Modules/DataCollection/classes/Fields/Selection/class.ilDclSelectionFieldModel.php @@ -1,4 +1,5 @@ - */ abstract class ilDclSelectionFieldModel extends ilDclBaseFieldModel { public const SELECTION_TYPE_SINGLE = 'selection_type_single'; diff --git a/Modules/DataCollection/classes/Fields/Selection/class.ilDclSelectionFieldRepresentation.php b/Modules/DataCollection/classes/Fields/Selection/class.ilDclSelectionFieldRepresentation.php index c88cdaebb057..067c0d2487c0 100644 --- a/Modules/DataCollection/classes/Fields/Selection/class.ilDclSelectionFieldRepresentation.php +++ b/Modules/DataCollection/classes/Fields/Selection/class.ilDclSelectionFieldRepresentation.php @@ -1,4 +1,5 @@ - */ abstract class ilDclSelectionFieldRepresentation extends ilDclBaseFieldRepresentation { // those should be overwritten by subclasses diff --git a/Modules/DataCollection/classes/Fields/Selection/class.ilDclSelectionOption.php b/Modules/DataCollection/classes/Fields/Selection/class.ilDclSelectionOption.php index 46fc3c27f82b..a6fc9ace9a70 100644 --- a/Modules/DataCollection/classes/Fields/Selection/class.ilDclSelectionOption.php +++ b/Modules/DataCollection/classes/Fields/Selection/class.ilDclSelectionOption.php @@ -1,4 +1,5 @@ - */ class ilDclSelectionOption extends ActiveRecord { public const DB_TABLE_NAME = "il_dcl_sel_opts"; diff --git a/Modules/DataCollection/classes/Fields/Selection/class.ilDclSelectionRecordFieldModel.php b/Modules/DataCollection/classes/Fields/Selection/class.ilDclSelectionRecordFieldModel.php index eb6b0e4551ff..6f2cbe248822 100644 --- a/Modules/DataCollection/classes/Fields/Selection/class.ilDclSelectionRecordFieldModel.php +++ b/Modules/DataCollection/classes/Fields/Selection/class.ilDclSelectionRecordFieldModel.php @@ -1,4 +1,5 @@ - */ abstract class ilDclSelectionRecordFieldModel extends ilDclBaseRecordFieldModel { // those should be overwritten by subclasses diff --git a/Modules/DataCollection/classes/Fields/Selection/class.ilDclSelectionRecordRepresentation.php b/Modules/DataCollection/classes/Fields/Selection/class.ilDclSelectionRecordRepresentation.php index f7bc79da62ae..cb98005f51af 100644 --- a/Modules/DataCollection/classes/Fields/Selection/class.ilDclSelectionRecordRepresentation.php +++ b/Modules/DataCollection/classes/Fields/Selection/class.ilDclSelectionRecordRepresentation.php @@ -1,4 +1,5 @@ - */ abstract class ilDclSelectionRecordRepresentation extends ilDclBaseRecordRepresentation { // those should be overwritten by subclasses diff --git a/Modules/DataCollection/classes/Fields/Text/class.ilDclTextFieldModel.php b/Modules/DataCollection/classes/Fields/Text/class.ilDclTextFieldModel.php index d9e7d212b9d8..f1c24e9631f9 100644 --- a/Modules/DataCollection/classes/Fields/Text/class.ilDclTextFieldModel.php +++ b/Modules/DataCollection/classes/Fields/Text/class.ilDclTextFieldModel.php @@ -1,4 +1,5 @@ - * @version 1.0.0 - */ class ilDclTextFieldModel extends ilDclBaseFieldModel { /** diff --git a/Modules/DataCollection/classes/Fields/Text/class.ilDclTextFieldRepresentation.php b/Modules/DataCollection/classes/Fields/Text/class.ilDclTextFieldRepresentation.php index 7c9303aaeba1..31661699d5b5 100644 --- a/Modules/DataCollection/classes/Fields/Text/class.ilDclTextFieldRepresentation.php +++ b/Modules/DataCollection/classes/Fields/Text/class.ilDclTextFieldRepresentation.php @@ -1,4 +1,5 @@ - * @version 1.0.0 - */ + *********************************************************************/ + class ilDclTextFieldRepresentation extends ilDclBaseFieldRepresentation { public function addFilterInputFieldToTable(ilTable2GUI $table): ?string diff --git a/Modules/DataCollection/classes/Fields/Text/class.ilDclTextRecordFieldModel.php b/Modules/DataCollection/classes/Fields/Text/class.ilDclTextRecordFieldModel.php index 71fac0feefc2..e897c1b88fca 100644 --- a/Modules/DataCollection/classes/Fields/Text/class.ilDclTextRecordFieldModel.php +++ b/Modules/DataCollection/classes/Fields/Text/class.ilDclTextRecordFieldModel.php @@ -18,10 +18,6 @@ use PhpOffice\PhpSpreadsheet\Cell\DataType; -/** - * Class ilDclTextRecordFieldModel - * @author Theodor Truffer - */ class ilDclTextRecordFieldModel extends ilDclBaseRecordFieldModel { public function setValueFromForm(ilPropertyFormGUI $form): void diff --git a/Modules/DataCollection/classes/Fields/Text/class.ilDclTextRecordQueryObject.php b/Modules/DataCollection/classes/Fields/Text/class.ilDclTextRecordQueryObject.php index 79c2d5977c92..bfcc43bc3383 100644 --- a/Modules/DataCollection/classes/Fields/Text/class.ilDclTextRecordQueryObject.php +++ b/Modules/DataCollection/classes/Fields/Text/class.ilDclTextRecordQueryObject.php @@ -1,4 +1,5 @@ - * @version 1.0.0 - */ class ilDclTextRecordQueryObject extends ilDclRecordQueryObject { public function applyCustomSorting(ilDclBaseFieldModel $field, array $all_records, $direction = 'asc'): array diff --git a/Modules/DataCollection/classes/Fields/Text/class.ilDclTextRecordRepresentation.php b/Modules/DataCollection/classes/Fields/Text/class.ilDclTextRecordRepresentation.php index dfb1ee497a73..68012795b5ae 100644 --- a/Modules/DataCollection/classes/Fields/Text/class.ilDclTextRecordRepresentation.php +++ b/Modules/DataCollection/classes/Fields/Text/class.ilDclTextRecordRepresentation.php @@ -16,11 +16,6 @@ * *********************************************************************/ -/** - * Class ilDclTextFieldRepresentation - * @author Michael Herren - * @version 1.0.0 - */ class ilDclTextRecordRepresentation extends ilDclBaseRecordRepresentation { public const LINK_MAX_LENGTH = 40; diff --git a/Modules/DataCollection/classes/Fields/TextSelection/class.ilDclTextSelectionFieldModel.php b/Modules/DataCollection/classes/Fields/TextSelection/class.ilDclTextSelectionFieldModel.php index bef429e1b6e9..90c3d56164f6 100644 --- a/Modules/DataCollection/classes/Fields/TextSelection/class.ilDclTextSelectionFieldModel.php +++ b/Modules/DataCollection/classes/Fields/TextSelection/class.ilDclTextSelectionFieldModel.php @@ -1,4 +1,5 @@ - */ class ilDclTextSelectionFieldModel extends ilDclSelectionFieldModel { public const PROP_SELECTION_TYPE = 'text_selection_type'; diff --git a/Modules/DataCollection/classes/Fields/TextSelection/class.ilDclTextSelectionFieldRepresentation.php b/Modules/DataCollection/classes/Fields/TextSelection/class.ilDclTextSelectionFieldRepresentation.php index d5c53e97cf4c..caa4d4bc72d4 100644 --- a/Modules/DataCollection/classes/Fields/TextSelection/class.ilDclTextSelectionFieldRepresentation.php +++ b/Modules/DataCollection/classes/Fields/TextSelection/class.ilDclTextSelectionFieldRepresentation.php @@ -1,4 +1,5 @@ - */ class ilDclTextSelectionFieldRepresentation extends ilDclSelectionFieldRepresentation { public const PROP_SELECTION_TYPE = 'text_selection_type'; diff --git a/Modules/DataCollection/classes/Fields/TextSelection/class.ilDclTextSelectionRecordFieldModel.php b/Modules/DataCollection/classes/Fields/TextSelection/class.ilDclTextSelectionRecordFieldModel.php index 04f61eedd63f..3fdf575826fd 100644 --- a/Modules/DataCollection/classes/Fields/TextSelection/class.ilDclTextSelectionRecordFieldModel.php +++ b/Modules/DataCollection/classes/Fields/TextSelection/class.ilDclTextSelectionRecordFieldModel.php @@ -1,4 +1,5 @@ - */ class ilDclTextSelectionRecordFieldModel extends ilDclSelectionRecordFieldModel { public const PROP_SELECTION_TYPE = 'text_selection_type'; diff --git a/Modules/DataCollection/classes/Fields/TextSelection/class.ilDclTextSelectionRecordRepresentation.php b/Modules/DataCollection/classes/Fields/TextSelection/class.ilDclTextSelectionRecordRepresentation.php index 3c69e83054fb..34da801a151b 100644 --- a/Modules/DataCollection/classes/Fields/TextSelection/class.ilDclTextSelectionRecordRepresentation.php +++ b/Modules/DataCollection/classes/Fields/TextSelection/class.ilDclTextSelectionRecordRepresentation.php @@ -1,4 +1,5 @@ - */ class ilDclTextSelectionRecordRepresentation extends ilDclSelectionRecordRepresentation { public const PROP_SELECTION_TYPE = 'text_selection_type'; diff --git a/Modules/DataCollection/classes/Fields/class.ilDclFieldListGUI.php b/Modules/DataCollection/classes/Fields/class.ilDclFieldListGUI.php index f7fb2798c7d6..925f1ef8b655 100644 --- a/Modules/DataCollection/classes/Fields/class.ilDclFieldListGUI.php +++ b/Modules/DataCollection/classes/Fields/class.ilDclFieldListGUI.php @@ -1,4 +1,5 @@ - * @author Marcel Raimann - * @author Fabian Schmid - * @author Oskar Truffer - * @author Stefan Wanzenried - * @version $Id: - * @ingroup ModulesDataCollection - */ class ilDclFieldListGUI { protected ilCtrl $ctrl; diff --git a/Modules/DataCollection/classes/Fields/class.ilDclFieldListTableGUI.php b/Modules/DataCollection/classes/Fields/class.ilDclFieldListTableGUI.php index 02462f5f25d7..662096ef0cd7 100644 --- a/Modules/DataCollection/classes/Fields/class.ilDclFieldListTableGUI.php +++ b/Modules/DataCollection/classes/Fields/class.ilDclFieldListTableGUI.php @@ -14,8 +14,7 @@ * https://www.ilias.de * https://github.com/ILIAS-eLearning * - ******************************************************************** - */ + *********************************************************************/ class ilDclFieldListTableGUI extends ilTable2GUI { diff --git a/Modules/DataCollection/classes/Helpers/class.ilDclCheckboxInputGUI.php b/Modules/DataCollection/classes/Helpers/class.ilDclCheckboxInputGUI.php index 93000555f53b..dcb4427920b4 100644 --- a/Modules/DataCollection/classes/Helpers/class.ilDclCheckboxInputGUI.php +++ b/Modules/DataCollection/classes/Helpers/class.ilDclCheckboxInputGUI.php @@ -1,4 +1,5 @@ - */ class ilDclCheckboxInputGUI extends ilCheckboxInputGUI { public function checkInput(): bool diff --git a/Modules/DataCollection/classes/Helpers/class.ilDclGenericMultiInputGUI.php b/Modules/DataCollection/classes/Helpers/class.ilDclGenericMultiInputGUI.php index 4a957c0a1e33..5c12686725a6 100644 --- a/Modules/DataCollection/classes/Helpers/class.ilDclGenericMultiInputGUI.php +++ b/Modules/DataCollection/classes/Helpers/class.ilDclGenericMultiInputGUI.php @@ -1,4 +1,5 @@ - * @author Theodor Truffer - */ + *********************************************************************/ + class ilDclGenericMultiInputGUI extends ilFormPropertyGUI { public const HOOK_IS_LINE_REMOVABLE = "hook_is_line_removable"; diff --git a/Modules/DataCollection/classes/Helpers/class.ilDclLinkButton.php b/Modules/DataCollection/classes/Helpers/class.ilDclLinkButton.php index 750c076ab827..909484f43a39 100644 --- a/Modules/DataCollection/classes/Helpers/class.ilDclLinkButton.php +++ b/Modules/DataCollection/classes/Helpers/class.ilDclLinkButton.php @@ -1,4 +1,5 @@ - */ class ilDclLinkButton extends ilLinkButton { public const TYPE_DATACOLLECTION_LINK = 99; diff --git a/Modules/DataCollection/classes/Helpers/class.ilDclMultiTextInputGUI.php b/Modules/DataCollection/classes/Helpers/class.ilDclMultiTextInputGUI.php index db0f7eecc73f..8bdae3344157 100644 --- a/Modules/DataCollection/classes/Helpers/class.ilDclMultiTextInputGUI.php +++ b/Modules/DataCollection/classes/Helpers/class.ilDclMultiTextInputGUI.php @@ -1,4 +1,5 @@ - */ class ilDclMultiTextInputGUI extends ilMultipleTextsInputGUI { public function setValues($values): void diff --git a/Modules/DataCollection/classes/Helpers/class.ilDclPropertyFormGUI.php b/Modules/DataCollection/classes/Helpers/class.ilDclPropertyFormGUI.php index 378db6f23cea..a80b23a123b8 100644 --- a/Modules/DataCollection/classes/Helpers/class.ilDclPropertyFormGUI.php +++ b/Modules/DataCollection/classes/Helpers/class.ilDclPropertyFormGUI.php @@ -17,9 +17,6 @@ *********************************************************************/ /** - * Class ilDclPropertyFormGUI - * @author Michael Herren - * @version 1.0.0 * @ilCtrl_Calls ilDclPropertyFormGUI: ilFormPropertyDispatchGUI */ class ilDclPropertyFormGUI extends ilPropertyFormGUI diff --git a/Modules/DataCollection/classes/Helpers/class.ilDclRecordQueryObject.php b/Modules/DataCollection/classes/Helpers/class.ilDclRecordQueryObject.php index 476aee45d385..50cb7134d807 100644 --- a/Modules/DataCollection/classes/Helpers/class.ilDclRecordQueryObject.php +++ b/Modules/DataCollection/classes/Helpers/class.ilDclRecordQueryObject.php @@ -1,4 +1,5 @@ - * @version 1.0.0 - */ class ilDclRecordQueryObject { protected string $selectStatement = ""; diff --git a/Modules/DataCollection/classes/Helpers/class.ilDclTextInputGUI.php b/Modules/DataCollection/classes/Helpers/class.ilDclTextInputGUI.php index e07875f9061d..02c588c03ca0 100644 --- a/Modules/DataCollection/classes/Helpers/class.ilDclTextInputGUI.php +++ b/Modules/DataCollection/classes/Helpers/class.ilDclTextInputGUI.php @@ -1,4 +1,5 @@ - */ class ilDclTextInputGUI extends ilTextInputGUI { public function setValueByArray(array $a_values): void diff --git a/Modules/DataCollection/classes/Ports/Access/class.ilDataCollectionAccessPort.php b/Modules/DataCollection/classes/Ports/Access/class.ilDataCollectionAccessPort.php index 2e6849357667..93fe0b1e8f80 100644 --- a/Modules/DataCollection/classes/Ports/Access/class.ilDataCollectionAccessPort.php +++ b/Modules/DataCollection/classes/Ports/Access/class.ilDataCollectionAccessPort.php @@ -1,4 +1,5 @@ - * @author Marcel Raimann - * @author Fabian Schmid - * @author Oskar Truffer - * @version $Id: - * @ingroup ModulesDataCollection - */ class ilDclTableEditGUI { private ?int $table_id; diff --git a/Modules/DataCollection/classes/Table/class.ilDclTableFieldSetting.php b/Modules/DataCollection/classes/Table/class.ilDclTableFieldSetting.php index 4e6085455f49..36a8f08b21c8 100644 --- a/Modules/DataCollection/classes/Table/class.ilDclTableFieldSetting.php +++ b/Modules/DataCollection/classes/Table/class.ilDclTableFieldSetting.php @@ -1,4 +1,5 @@ - * @ingroup ModulesDataCollection - */ class ilDclTableFieldSetting extends ActiveRecord { /** diff --git a/Modules/DataCollection/classes/Table/class.ilDclTableHelper.php b/Modules/DataCollection/classes/Table/class.ilDclTableHelper.php index d3f1897d627e..d849cc4e1a20 100644 --- a/Modules/DataCollection/classes/Table/class.ilDclTableHelper.php +++ b/Modules/DataCollection/classes/Table/class.ilDclTableHelper.php @@ -1,4 +1,5 @@ - */ class ilDclTableHelper { protected int $obj_id = 0; diff --git a/Modules/DataCollection/classes/Table/class.ilDclTableListGUI.php b/Modules/DataCollection/classes/Table/class.ilDclTableListGUI.php index b48faafa2207..c4e6dbb14b20 100644 --- a/Modules/DataCollection/classes/Table/class.ilDclTableListGUI.php +++ b/Modules/DataCollection/classes/Table/class.ilDclTableListGUI.php @@ -1,4 +1,5 @@ * @ilCtrl_Calls ilDclTableListGUI: ilDclFieldListGUI, ilDclFieldEditGUI, ilDclTableViewGUI, ilDclTableEditGUI */ class ilDclTableListGUI diff --git a/Modules/DataCollection/classes/Table/class.ilDclTableListTableGUI.php b/Modules/DataCollection/classes/Table/class.ilDclTableListTableGUI.php index d17e47ef2472..0b6f6627d48f 100644 --- a/Modules/DataCollection/classes/Table/class.ilDclTableListTableGUI.php +++ b/Modules/DataCollection/classes/Table/class.ilDclTableListTableGUI.php @@ -1,4 +1,5 @@ - */ class ilDclTableListTableGUI extends ilTable2GUI { /** diff --git a/Modules/DataCollection/classes/TableView/class.ilDclDefaultValueFactory.php b/Modules/DataCollection/classes/TableView/class.ilDclDefaultValueFactory.php index 8a32ac5dbb35..8de1cd2c708f 100644 --- a/Modules/DataCollection/classes/TableView/class.ilDclDefaultValueFactory.php +++ b/Modules/DataCollection/classes/TableView/class.ilDclDefaultValueFactory.php @@ -1,5 +1,21 @@ - */ + * This file is part of ILIAS, a powerful learning management system + * published by ILIAS open source e-Learning e.V. + * + * ILIAS is licensed with the GPL-3.0, + * see https://www.gnu.org/licenses/gpl-3.0.en.html + * You should have received a copy of said license along with the + * source code, too. + * + * If this is not the case or you just want to try ILIAS, you'll find + * us at: + * https://www.ilias.de + * https://github.com/ILIAS-eLearning + * + *********************************************************************/ + abstract class ilDclTableViewBaseDefaultValue extends ActiveRecord { /** diff --git a/Modules/DataCollection/classes/TableView/class.ilDclTableViewDateDefaultValue.php b/Modules/DataCollection/classes/TableView/class.ilDclTableViewDateDefaultValue.php index caa6a1d85aa4..84caa8fd9293 100644 --- a/Modules/DataCollection/classes/TableView/class.ilDclTableViewDateDefaultValue.php +++ b/Modules/DataCollection/classes/TableView/class.ilDclTableViewDateDefaultValue.php @@ -1,9 +1,21 @@ - */ + * This file is part of ILIAS, a powerful learning management system + * published by ILIAS open source e-Learning e.V. + * + * ILIAS is licensed with the GPL-3.0, + * see https://www.gnu.org/licenses/gpl-3.0.en.html + * You should have received a copy of said license along with the + * source code, too. + * + * If this is not the case or you just want to try ILIAS, you'll find + * us at: + * https://www.ilias.de + * https://github.com/ILIAS-eLearning + * + *********************************************************************/ + class ilDclTableViewDateDefaultValue extends ilDclTableViewBaseDefaultValue { /** diff --git a/Modules/DataCollection/classes/TableView/class.ilDclTableViewEditFieldsTableGUI.php b/Modules/DataCollection/classes/TableView/class.ilDclTableViewEditFieldsTableGUI.php index a20299b570ae..76511d73498e 100644 --- a/Modules/DataCollection/classes/TableView/class.ilDclTableViewEditFieldsTableGUI.php +++ b/Modules/DataCollection/classes/TableView/class.ilDclTableViewEditFieldsTableGUI.php @@ -1,10 +1,21 @@ - * @ingroup ModulesDataCollection - */ + * This file is part of ILIAS, a powerful learning management system + * published by ILIAS open source e-Learning e.V. + * + * ILIAS is licensed with the GPL-3.0, + * see https://www.gnu.org/licenses/gpl-3.0.en.html + * You should have received a copy of said license along with the + * source code, too. + * + * If this is not the case or you just want to try ILIAS, you'll find + * us at: + * https://www.ilias.de + * https://github.com/ILIAS-eLearning + * + *********************************************************************/ + class ilDclTableViewEditFieldsTableGUI extends ilTable2GUI { public function __construct(ilDclTableViewEditGUI $a_parent_obj) diff --git a/Modules/DataCollection/classes/TableView/class.ilDclTableViewEditFormGUI.php b/Modules/DataCollection/classes/TableView/class.ilDclTableViewEditFormGUI.php index 473e9711e8f4..feb8c18964e1 100644 --- a/Modules/DataCollection/classes/TableView/class.ilDclTableViewEditFormGUI.php +++ b/Modules/DataCollection/classes/TableView/class.ilDclTableViewEditFormGUI.php @@ -1,9 +1,21 @@ - */ + * This file is part of ILIAS, a powerful learning management system + * published by ILIAS open source e-Learning e.V. + * + * ILIAS is licensed with the GPL-3.0, + * see https://www.gnu.org/licenses/gpl-3.0.en.html + * You should have received a copy of said license along with the + * source code, too. + * + * If this is not the case or you just want to try ILIAS, you'll find + * us at: + * https://www.ilias.de + * https://github.com/ILIAS-eLearning + * + *********************************************************************/ + class ilDclTableViewEditFormGUI extends ilPropertyFormGUI { protected ilDclTableView $tableview; diff --git a/Modules/DataCollection/classes/TableView/class.ilDclTableViewEditGUI.php b/Modules/DataCollection/classes/TableView/class.ilDclTableViewEditGUI.php index e2c1d67e1121..5e225d74a7cc 100644 --- a/Modules/DataCollection/classes/TableView/class.ilDclTableViewEditGUI.php +++ b/Modules/DataCollection/classes/TableView/class.ilDclTableViewEditGUI.php @@ -1,9 +1,22 @@ - * @ingroup ModulesDataCollection + * This file is part of ILIAS, a powerful learning management system + * published by ILIAS open source e-Learning e.V. + * + * ILIAS is licensed with the GPL-3.0, + * see https://www.gnu.org/licenses/gpl-3.0.en.html + * You should have received a copy of said license along with the + * source code, too. + * + * If this is not the case or you just want to try ILIAS, you'll find + * us at: + * https://www.ilias.de + * https://github.com/ILIAS-eLearning + * + *********************************************************************/ + +/** * @ilCtrl_Calls ilDclTableViewEditGUI: ilDclDetailedViewDefinitionGUI * @ilCtrl_Calls ilDclTableViewEditGUI: ilDclCreateViewDefinitionGUI * @ilCtrl_Calls ilDclTableViewEditGUI: ilDclEditViewDefinitionGUI diff --git a/Modules/DataCollection/classes/TableView/class.ilDclTableViewFieldSetting.php b/Modules/DataCollection/classes/TableView/class.ilDclTableViewFieldSetting.php index bb06d929e710..a7adc152cf18 100644 --- a/Modules/DataCollection/classes/TableView/class.ilDclTableViewFieldSetting.php +++ b/Modules/DataCollection/classes/TableView/class.ilDclTableViewFieldSetting.php @@ -1,4 +1,5 @@ - * @ingroup ModulesDataCollection - */ class ilDclTableViewFieldSetting extends ActiveRecord { /** diff --git a/Modules/DataCollection/classes/TableView/class.ilDclTableViewGUI.php b/Modules/DataCollection/classes/TableView/class.ilDclTableViewGUI.php index 8ba75b9dc6fe..ff345a5ab2cf 100644 --- a/Modules/DataCollection/classes/TableView/class.ilDclTableViewGUI.php +++ b/Modules/DataCollection/classes/TableView/class.ilDclTableViewGUI.php @@ -1,4 +1,5 @@ - * @ingroup ModulesDataCollection * @ilCtrl_Calls ilDclTableViewGUI: ilDclTableViewEditGUI */ class ilDclTableViewGUI diff --git a/Modules/DataCollection/classes/TableView/class.ilDclTableViewNumberDefaultValue.php b/Modules/DataCollection/classes/TableView/class.ilDclTableViewNumberDefaultValue.php index df68a31622d0..a7f2c66bd18f 100644 --- a/Modules/DataCollection/classes/TableView/class.ilDclTableViewNumberDefaultValue.php +++ b/Modules/DataCollection/classes/TableView/class.ilDclTableViewNumberDefaultValue.php @@ -1,9 +1,21 @@ - */ + * This file is part of ILIAS, a powerful learning management system + * published by ILIAS open source e-Learning e.V. + * + * ILIAS is licensed with the GPL-3.0, + * see https://www.gnu.org/licenses/gpl-3.0.en.html + * You should have received a copy of said license along with the + * source code, too. + * + * If this is not the case or you just want to try ILIAS, you'll find + * us at: + * https://www.ilias.de + * https://github.com/ILIAS-eLearning + * + *********************************************************************/ + class ilDclTableViewNumberDefaultValue extends ilDclTableViewBaseDefaultValue { /** diff --git a/Modules/DataCollection/classes/TableView/class.ilDclTableViewTextDefaultValue.php b/Modules/DataCollection/classes/TableView/class.ilDclTableViewTextDefaultValue.php index 96cc26cfef18..e67c5f1d45c1 100644 --- a/Modules/DataCollection/classes/TableView/class.ilDclTableViewTextDefaultValue.php +++ b/Modules/DataCollection/classes/TableView/class.ilDclTableViewTextDefaultValue.php @@ -1,9 +1,21 @@ - */ + * This file is part of ILIAS, a powerful learning management system + * published by ILIAS open source e-Learning e.V. + * + * ILIAS is licensed with the GPL-3.0, + * see https://www.gnu.org/licenses/gpl-3.0.en.html + * You should have received a copy of said license along with the + * source code, too. + * + * If this is not the case or you just want to try ILIAS, you'll find + * us at: + * https://www.ilias.de + * https://github.com/ILIAS-eLearning + * + *********************************************************************/ + class ilDclTableViewTextDefaultValue extends ilDclTableViewBaseDefaultValue { /** diff --git a/Modules/DataCollection/classes/class.ilDataCollectionExporter.php b/Modules/DataCollection/classes/class.ilDataCollectionExporter.php index b494f006fbd3..67b191384a39 100644 --- a/Modules/DataCollection/classes/class.ilDataCollectionExporter.php +++ b/Modules/DataCollection/classes/class.ilDataCollectionExporter.php @@ -16,11 +16,6 @@ * *********************************************************************/ -/** - * Class ilDataCollectionExporter - * @author Stefan Wanzenried - * @author Fabian Schmid - */ class ilDataCollectionExporter extends ilXmlExporter { protected ilDataCollectionDataSet $ds; diff --git a/Modules/DataCollection/classes/class.ilDataCollectionGlobalTemplate.php b/Modules/DataCollection/classes/class.ilDataCollectionGlobalTemplate.php index 4bf276a7fce2..4da6b89b6218 100755 --- a/Modules/DataCollection/classes/class.ilDataCollectionGlobalTemplate.php +++ b/Modules/DataCollection/classes/class.ilDataCollectionGlobalTemplate.php @@ -1,4 +1,5 @@ - * @author Sascha Hofmann - * @version $Id$ - */ class ilDataCollectionGlobalTemplate implements ilGlobalTemplateInterface { protected $tree_flat_link = ""; diff --git a/Modules/DataCollection/classes/class.ilDataCollectionImporter.php b/Modules/DataCollection/classes/class.ilDataCollectionImporter.php index f3ac40cce95b..5a6081a7db63 100644 --- a/Modules/DataCollection/classes/class.ilDataCollectionImporter.php +++ b/Modules/DataCollection/classes/class.ilDataCollectionImporter.php @@ -1,4 +1,5 @@ - * @author Fabian Schmid - */ class ilDataCollectionImporter extends ilXmlImporter { protected ilDataCollectionDataSet $ds; diff --git a/Modules/DataCollection/classes/class.ilDclExportGUI.php b/Modules/DataCollection/classes/class.ilDclExportGUI.php index 93c89620b570..22a80af5ff31 100644 --- a/Modules/DataCollection/classes/class.ilDclExportGUI.php +++ b/Modules/DataCollection/classes/class.ilDclExportGUI.php @@ -1,4 +1,5 @@ - */ + *********************************************************************/ + class ilDclExportGUI extends ilExportGUI { protected function buildExportTableGUI(): ilExportTableGUI diff --git a/Modules/DataCollection/classes/class.ilDclExportTableGUI.php b/Modules/DataCollection/classes/class.ilDclExportTableGUI.php index cde33332b1ca..a7682ed5294c 100644 --- a/Modules/DataCollection/classes/class.ilDclExportTableGUI.php +++ b/Modules/DataCollection/classes/class.ilDclExportTableGUI.php @@ -1,4 +1,5 @@ - */ + *********************************************************************/ + class ilDclExportTableGUI extends ilExportTableGUI { public function __construct(ilDclExportGUI $a_parent_obj, string $a_parent_cmd, ilObject $a_exp_obj) diff --git a/Modules/DataCollection/classes/class.ilObjDataCollection.php b/Modules/DataCollection/classes/class.ilObjDataCollection.php index 4df3da81312a..ef35feb4b346 100644 --- a/Modules/DataCollection/classes/class.ilObjDataCollection.php +++ b/Modules/DataCollection/classes/class.ilObjDataCollection.php @@ -16,13 +16,6 @@ * *********************************************************************/ -/** - * Class ilObjDataCollection - * @author Jörg Lützenkirchen - * @author Fabian Schmid - * @version $Id: class.ilObjFolder.php 25528 2010-09-03 10:37:11Z smeyer $ - * @extends ilObject2 - */ class ilObjDataCollection extends ilObject2 { private bool $is_online = false; diff --git a/Modules/DataCollection/classes/class.ilObjDataCollectionAccess.php b/Modules/DataCollection/classes/class.ilObjDataCollectionAccess.php index e8c38807dff1..5f79034446e3 100644 --- a/Modules/DataCollection/classes/class.ilObjDataCollectionAccess.php +++ b/Modules/DataCollection/classes/class.ilObjDataCollectionAccess.php @@ -14,17 +14,8 @@ * https://www.ilias.de * https://github.com/ILIAS-eLearning * - ******************************************************************** - */ + *********************************************************************/ -/** - * Class ilObjDataCollectionAccess - * @author Jörg Lützenkirchen - * @author Martin Studer - * @author Marcel Raimann - * @author Fabian Schmid - * @version $Id: class.ilObjDataCollectionAccess.php 15678 2008-01-06 20:40:55Z akill $ - */ class ilObjDataCollectionAccess extends ilObjectAccess { /** diff --git a/Modules/DataCollection/classes/class.ilObjDataCollectionGUI.php b/Modules/DataCollection/classes/class.ilObjDataCollectionGUI.php index eb7995d2758a..f83a8637f437 100644 --- a/Modules/DataCollection/classes/class.ilObjDataCollectionGUI.php +++ b/Modules/DataCollection/classes/class.ilObjDataCollectionGUI.php @@ -17,13 +17,6 @@ *********************************************************************/ /** - * Class ilObjDataCollectionGUI - * @author Jörg Lützenkirchen - * @author Martin Studer - * @author Marcel Raimann - * @author Fabian Schmid - * @author Oskar Truffer - * @author Stefan Wanzenried * @ilCtrl_Calls ilObjDataCollectionGUI: ilInfoScreenGUI, ilNoteGUI, ilCommonActionDispatcherGUI * @ilCtrl_Calls ilObjDataCollectionGUI: ilPermissionGUI, ilObjectCopyGUI, ilDclExportGUI * @ilCtrl_Calls ilObjDataCollectionGUI: ilDclRecordListGUI, ilDclRecordEditGUI @@ -33,7 +26,6 @@ * @ilCtrl_Calls ilObjDataCollectionGUI: ilRatingGUI * @ilCtrl_Calls ilObjDataCollectionGUI: ilPropertyFormGUI * @ilCtrl_Calls ilObjDataCollectionGUI: ilDclPropertyFormGUI - * @extends ilObject2GUI */ class ilObjDataCollectionGUI extends ilObject2GUI { diff --git a/Modules/DataCollection/classes/class.ilObjDataCollectionListGUI.php b/Modules/DataCollection/classes/class.ilObjDataCollectionListGUI.php index 0bff6bd90032..fa65d6c930e5 100644 --- a/Modules/DataCollection/classes/class.ilObjDataCollectionListGUI.php +++ b/Modules/DataCollection/classes/class.ilObjDataCollectionListGUI.php @@ -14,16 +14,8 @@ * https://www.ilias.de * https://github.com/ILIAS-eLearning * - ******************************************************************** - */ + *********************************************************************/ -/** - * Class ilObjDataCollectionListGUI - * @author Jörg Lützenkirchen - * @author Fabian Schmid - * $Id: class.ilObjRootFolderListGUI.php 23764 2010-05-06 15:11:30Z smeyer $ - * @extends ilObjectListGUI - */ class ilObjDataCollectionListGUI extends ilObjectListGUI { /** diff --git a/Modules/DataCollection/exceptions/class.ilDclException.php b/Modules/DataCollection/exceptions/class.ilDclException.php index 6d5c92c64e8f..c41598694384 100644 --- a/Modules/DataCollection/exceptions/class.ilDclException.php +++ b/Modules/DataCollection/exceptions/class.ilDclException.php @@ -1,4 +1,5 @@ - * @version 1.0.0 - */ class ilDclException extends ilException { public function __construct($a_message, $a_code = 0) diff --git a/Modules/DataCollection/exceptions/class.ilDclInputException.php b/Modules/DataCollection/exceptions/class.ilDclInputException.php index 7544eba3e9ed..852d1bf4b93b 100755 --- a/Modules/DataCollection/exceptions/class.ilDclInputException.php +++ b/Modules/DataCollection/exceptions/class.ilDclInputException.php @@ -1,27 +1,21 @@ - * @author Marcel Raimann - * @author Fabian Schmid - * @author Oskar Truffer - * @version $Id: - * @ingroup ModulesDataCollection - */ class ilDclInputException extends ilException { public const TYPE_EXCEPTION = 0; diff --git a/Modules/DataCollection/js/datacollection.js b/Modules/DataCollection/js/datacollection.js index f620bbccb9e8..612cba06272b 100644 --- a/Modules/DataCollection/js/datacollection.js +++ b/Modules/DataCollection/js/datacollection.js @@ -1,9 +1,18 @@ /** - * ilDataCollection JS + * This file is part of ILIAS, a powerful learning management system + * published by ILIAS open source e-Learning e.V. * - * @author Oskar Truffer - * @author Fabian Schmid - */ + * ILIAS is licensed with the GPL-3.0, + * see https://www.gnu.org/licenses/gpl-3.0.en.html + * You should have received a copy of said license along with the + * source code, too. + * + * If this is not the case or you just want to try ILIAS, you'll find + * us at: + * https://www.ilias.de + * https://github.com/ILIAS-eLearning + * + *********************************************************************/ $(document).ready(function () { var dcl = {}; diff --git a/Modules/DataCollection/js/generic_multi_line_input.js b/Modules/DataCollection/js/generic_multi_line_input.js index ff0f64c20e9f..191ca0717c17 100755 --- a/Modules/DataCollection/js/generic_multi_line_input.js +++ b/Modules/DataCollection/js/generic_multi_line_input.js @@ -1,3 +1,19 @@ +/** + * This file is part of ILIAS, a powerful learning management system + * published by ILIAS open source e-Learning e.V. + * + * ILIAS is licensed with the GPL-3.0, + * see https://www.gnu.org/licenses/gpl-3.0.en.html + * You should have received a copy of said license along with the + * source code, too. + * + * If this is not the case or you just want to try ILIAS, you'll find + * us at: + * https://www.ilias.de + * https://github.com/ILIAS-eLearning + * + *********************************************************************/ + il = il || {}; il.DataCollection = il.DataCollection || {}; diff --git a/Modules/DataCollection/test/ilModulesDataCollectionSuite.php b/Modules/DataCollection/test/ilModulesDataCollectionSuite.php index 530dc2c2cc0f..87abf5a35ee7 100644 --- a/Modules/DataCollection/test/ilModulesDataCollectionSuite.php +++ b/Modules/DataCollection/test/ilModulesDataCollectionSuite.php @@ -1,11 +1,23 @@ - */ class ilModulesDataCollectionSuite extends TestSuite { public static function suite() From f278e813c1f797a762bcf382ff9528ca94d12906 Mon Sep 17 00:00:00 2001 From: Stephan Kergomard Date: Fri, 6 Dec 2024 12:45:50 +0100 Subject: [PATCH 271/292] Test: Remove Unused Lang-Vars See: https://mantis.ilias.de/view.php?id=42996 --- lang/ilias_ar.lang | 2 -- lang/ilias_bg.lang | 2 -- lang/ilias_cs.lang | 2 -- lang/ilias_da.lang | 2 -- lang/ilias_de.lang | 2 -- lang/ilias_el.lang | 2 -- lang/ilias_en.lang | 2 -- lang/ilias_es.lang | 2 -- lang/ilias_et.lang | 2 -- lang/ilias_fa.lang | 2 -- lang/ilias_fr.lang | 2 -- lang/ilias_hr.lang | 2 -- lang/ilias_hu.lang | 2 -- lang/ilias_it.lang | 2 -- lang/ilias_ja.lang | 2 -- lang/ilias_ka.lang | 2 -- lang/ilias_lt.lang | 2 -- lang/ilias_nl.lang | 2 -- lang/ilias_pl.lang | 2 -- lang/ilias_pt.lang | 2 -- lang/ilias_ro.lang | 2 -- lang/ilias_ru.lang | 2 -- lang/ilias_sk.lang | 2 -- lang/ilias_sl.lang | 2 -- lang/ilias_sq.lang | 2 -- lang/ilias_sr.lang | 2 -- lang/ilias_sv.lang | 2 -- lang/ilias_tr.lang | 2 -- lang/ilias_uk.lang | 2 -- lang/ilias_vi.lang | 2 -- lang/ilias_zh.lang | 2 -- 31 files changed, 62 deletions(-) diff --git a/lang/ilias_ar.lang b/lang/ilias_ar.lang index a4675f662d88..d94524d382dd 100644 --- a/lang/ilias_ar.lang +++ b/lang/ilias_ar.lang @@ -1850,8 +1850,6 @@ assessment#:#tst_show_answer_sheet#:#Show Answers assessment#:#tst_show_cancel#:#Show Suspend Test Option assessment#:#tst_show_cancel_description#:#If checked, a button to suspend the test is shown during test execution. assessment#:#tst_show_comp_results#:#Show Competence Results###26 09 2014 new variable -assessment#:#tst_show_pass_details#:#Show Pass Details for running tests -assessment#:#tst_show_pass_details_desc#:#If selected, the question titles and the reached points for every question in the test pass are available if the test is not finished.###07 11 2014 new variable assessment#:#tst_show_results#:#Show Test Results assessment#:#tst_show_side_list#:#Show question list aside assessment#:#tst_show_solution_answers_only#:#Results print view (answers only) diff --git a/lang/ilias_bg.lang b/lang/ilias_bg.lang index 6547c0b989f9..389a45633ae9 100644 --- a/lang/ilias_bg.lang +++ b/lang/ilias_bg.lang @@ -1850,8 +1850,6 @@ assessment#:#tst_show_answer_sheet#:#Показване на отговорит assessment#:#tst_show_cancel#:#Показване на опцията за временно спиране на теста assessment#:#tst_show_cancel_description#:#Ако е маркирано, по време на изпълнението на теста се показва бутон за спиране на теста assessment#:#tst_show_comp_results#:#Показване на резултатите от компетенциите -assessment#:#tst_show_pass_details#:#Показване на подробностите за преминаването на текущите тестове -assessment#:#tst_show_pass_details_desc#:#Ако е избрано, заглавията на въпросите и достигнатите точки за всеки въпрос в теста са достъпни, ако тестът не е завършен. assessment#:#tst_show_results#:#Показване на резултатите от теста assessment#:#tst_show_side_list#:#Показване на списъка с въпроси отстрани assessment#:#tst_show_solution_answers_only#:#Поглед за печат на резултатите (само отговори) diff --git a/lang/ilias_cs.lang b/lang/ilias_cs.lang index c49f4e5dc809..38214d7341b9 100644 --- a/lang/ilias_cs.lang +++ b/lang/ilias_cs.lang @@ -1850,8 +1850,6 @@ assessment#:#tst_show_answer_sheet#:#Zobrazit odpovědi assessment#:#tst_show_cancel#:#Zobrazit volbu přerušení testu assessment#:#tst_show_cancel_description#:#Je-li vybráno, pak tlačítko k přerušení testu bude zobrazeno v průběhu vykonávání testu assessment#:#tst_show_comp_results#:#Zobrazit výsledky způsobilosti -assessment#:#tst_show_pass_details#:#Zobrazit výsledky v průběhu testu -assessment#:#tst_show_pass_details_desc#:#Je-li vybráno, jsou k dispozici nadpisy otázek a dosažené body pro každou otázku v průchodu testem, pokud není test dokončen. assessment#:#tst_show_results#:#Zobrazit výsledky testu assessment#:#tst_show_side_list#:#Zobrazit boční seznam otázek assessment#:#tst_show_solution_answers_only#:#Přehled výsledků (jen odpovědi) diff --git a/lang/ilias_da.lang b/lang/ilias_da.lang index 056eff209d28..ca19d6d79371 100644 --- a/lang/ilias_da.lang +++ b/lang/ilias_da.lang @@ -1850,8 +1850,6 @@ assessment#:#tst_show_answer_sheet#:#Vis svar assessment#:#tst_show_cancel#:#Vis suspender test assessment#:#tst_show_cancel_description#:#Hvis valgt kan deltagerne holde pause. assessment#:#tst_show_comp_results#:#Show Competence Results###26 09 2014 new variable -assessment#:#tst_show_pass_details#:#Show Pass Details for running tests###30 05 2007 new variable -assessment#:#tst_show_pass_details_desc#:#If selected, the question titles and the reached points for every question in the test pass are available if the test is not finished.###07 11 2014 new variable assessment#:#tst_show_results#:#Vis testresultat assessment#:#tst_show_side_list#:#Show question list aside###24 07 2009 new variable assessment#:#tst_show_solution_answers_only#:#Udskriftsvisning af resultater (kun svar) diff --git a/lang/ilias_de.lang b/lang/ilias_de.lang index 84b2b800908d..fb0121907cfc 100644 --- a/lang/ilias_de.lang +++ b/lang/ilias_de.lang @@ -1865,8 +1865,6 @@ assessment#:#tst_show_answer_sheet#:#Antwortenübersicht anzeigen assessment#:#tst_show_cancel#:#"Test unterbrechen" anzeigen assessment#:#tst_show_cancel_description#:#Zeigt während der Durchführung des Tests einen Button an, mit der der Test unterbrochen werden kann. Achtung: Das Unterbrechen des Tests hält nicht die unter 'Maximale Bearbeitungsdauer' festgelegte Bearbeitungszeit an. assessment#:#tst_show_comp_results#:#Kompetenz-Ergebnisse -assessment#:#tst_show_pass_details#:#Show ‘Table of Detailed Test Results’ for each Test Pass upon Selected Point in Time###31 03 2023 new variable -assessment#:#tst_show_pass_details_desc#:#The summary of results will be appended at the point in time indicated in the setting above: A ‘Table of Detailed Test Results’ will show the title of the questions and the points scored in a particular test pass.
Other than that the table will be displayed after the last test pass possible (setting in link ‘General’, option ‘Limit Number of Test Passes’) or after the test is officially finished (setting in link ‘General’, option ‘Finishing Time’).
Further settings about the content of the ‘Table of Detailed Test Results’ can be made in the section ‘Further Details to be Included in Test Results’ of this form.###31 03 2023 new variable assessment#:#tst_show_results#:#Testergebnisse assessment#:#tst_show_side_list#:#Fragenliste an assessment#:#tst_show_solution_answers_only#:#Druckausgabe der Ergebnisse (nur Antworten) diff --git a/lang/ilias_el.lang b/lang/ilias_el.lang index 40442024b821..da27c9af0a6f 100644 --- a/lang/ilias_el.lang +++ b/lang/ilias_el.lang @@ -1851,8 +1851,6 @@ assessment#:#tst_show_answer_sheet#:#προβολή απαντήσεων assessment#:#tst_show_cancel#:#Show Suspend Test Option assessment#:#tst_show_cancel_description#:#If checked, a button to suspend the test is shown during test execution assessment#:#tst_show_comp_results#:#Show Competence Results###26 09 2014 new variable -assessment#:#tst_show_pass_details#:#Show Pass Details for running tests -assessment#:#tst_show_pass_details_desc#:#If selected, the question titles and the reached points for every question in the test pass are available if the test is not finished.###07 11 2014 new variable assessment#:#tst_show_results#:#Προβολή αποτελεσμάτων διαγωνίσματος assessment#:#tst_show_side_list#:#Show question list aside###24 07 2009 new variable assessment#:#tst_show_solution_answers_only#:#Results print view (answers only) diff --git a/lang/ilias_en.lang b/lang/ilias_en.lang index 94e62f25e244..0d72a6322ee3 100644 --- a/lang/ilias_en.lang +++ b/lang/ilias_en.lang @@ -1865,8 +1865,6 @@ assessment#:#tst_show_answer_sheet#:#Show Answers assessment#:#tst_show_cancel#:#Suspend Test assessment#:#tst_show_cancel_description#:#Participants are presented with a button that allows them to pause the test and to continue it later. Caution: Suspending the test does not also pause the time available for taking the test (Time Limit). Tests still need to be completed within the time limit available. assessment#:#tst_show_comp_results#:#Competence Results -assessment#:#tst_show_pass_details#:#Show ‘Table of Detailed Test Results’ for each Test Pass upon Selected Point in Time -assessment#:#tst_show_pass_details_desc#:#The summary of results will be appended at the point in time indicated in the setting above: A ‘Table of Detailed Test Results’ will show the title of the questions and the points scored in a particular test pass.
Other than that the table will be displayed after the last test pass possible (setting in link ‘General’, option ‘Limit Number of Test Passes’) or after the test is officially finished (setting in link ‘General’, option ‘Finishing Time’).
Further settings about the content of the ‘Table of Detailed Test Results’ can be made in the section ‘Further Details to be Included in Test Results’ of this form. assessment#:#tst_show_results#:#Test Results assessment#:#tst_show_side_list#:#Show List of Questions assessment#:#tst_show_solution_answers_only#:#Print View of Results (Answers Only) diff --git a/lang/ilias_es.lang b/lang/ilias_es.lang index 67f28beb88d2..f3f467b0ebbf 100644 --- a/lang/ilias_es.lang +++ b/lang/ilias_es.lang @@ -1852,8 +1852,6 @@ assessment#:#tst_show_answer_sheet#:#mostrar respuestas assessment#:#tst_show_cancel#:#Mostrar la opción de suspender el test assessment#:#tst_show_cancel_description#:#Si se activa, se mostrará un botón para suspender el test durante la ejecución del mismo assessment#:#tst_show_comp_results#:#Mostrar resultados de competencias -assessment#:#tst_show_pass_details#:#Mostrar detalles para los tests en ejecución -assessment#:#tst_show_pass_details_desc#:#Si se selecciona esta opción los títulos de las preguntas y los resultados alcanzados en cada pregunta en la ejecución del test estarán disponibles aunque el test no haya finalizado assessment#:#tst_show_results#:#Mostrar resultados del test assessment#:#tst_show_side_list#:#Mostrar lista de preguntas en el lateral assessment#:#tst_show_solution_answers_only#:#Vista de impresión de resultados (respuestas sólo) diff --git a/lang/ilias_et.lang b/lang/ilias_et.lang index c6b8ed856ad6..b618a94c9d40 100644 --- a/lang/ilias_et.lang +++ b/lang/ilias_et.lang @@ -1850,8 +1850,6 @@ assessment#:#tst_show_answer_sheet#:#Näita vastuseid assessment#:#tst_show_cancel#:#Katkestamisnupu kuvamine assessment#:#tst_show_cancel_description#:#Märgistamise korral on katkestamise nupp näha kogu testisoorituse vältel assessment#:#tst_show_comp_results#:#Show Competence Results -assessment#:#tst_show_pass_details#:#Näita jooksva testi tulemusi -assessment#:#tst_show_pass_details_desc#:#If selected, the question titles and the reached points for every question in the test pass are available if the test is not finished. assessment#:#tst_show_results#:#Näita testitulemusi assessment#:#tst_show_side_list#:#Näita kõrval küsimuste loendit assessment#:#tst_show_solution_answers_only#:#Tulemuste printvaade (ainult vastused) diff --git a/lang/ilias_fa.lang b/lang/ilias_fa.lang index 0427d4dc953b..7eb50c9d6831 100644 --- a/lang/ilias_fa.lang +++ b/lang/ilias_fa.lang @@ -1850,8 +1850,6 @@ assessment#:#tst_show_answer_sheet#:#Show Answers assessment#:#tst_show_cancel#:#نمایش گزینه امکان معوق گذاشتن تست assessment#:#tst_show_cancel_description#:#اگر انتخاب شده باشد، یک دکمه برای معوق کردن تست در طول اجرای تست نمایش داده می شود. assessment#:#tst_show_comp_results#:#Show Competence Results###26 09 2014 new variable -assessment#:#tst_show_pass_details#:#نمایش جزئیات دوره های تست های در حال اجرا -assessment#:#tst_show_pass_details_desc#:#If selected, the question titles and the reached points for every question in the test pass are available if the test is not finished.###07 11 2014 new variable assessment#:#tst_show_results#:#نمایش نتایج تست assessment#:#tst_show_side_list#:#Show question list aside assessment#:#tst_show_solution_answers_only#:#نمای چاپ نتایج - فقط پاسخ ها diff --git a/lang/ilias_fr.lang b/lang/ilias_fr.lang index 6436081c4fbe..61ba991bb365 100644 --- a/lang/ilias_fr.lang +++ b/lang/ilias_fr.lang @@ -1850,8 +1850,6 @@ assessment#:#tst_show_answer_sheet#:#Afficher les Réponses assessment#:#tst_show_cancel#:#Afficher l'Option de Suspension de Test assessment#:#tst_show_cancel_description#:#Si cochée, un bouton permettant de suspendre le test est affiché pendant le test. assessment#:#tst_show_comp_results#:#Montrer les résultats de compétence -assessment#:#tst_show_pass_details#:#Afficher les Critères de Réussite du Test -assessment#:#tst_show_pass_details_desc#:#Si cochée, les titres des questions et les points atteints pour chaque question du test sont affichés même si le test n'est pas terminé. assessment#:#tst_show_results#:#Afficher les Résultats du Test assessment#:#tst_show_side_list#:#Afficher la liste de question sur le côté assessment#:#tst_show_solution_answers_only#:#Impression des Résultats (Réponses Seulement) diff --git a/lang/ilias_hr.lang b/lang/ilias_hr.lang index fd8949a9cd03..c132fa49fe86 100644 --- a/lang/ilias_hr.lang +++ b/lang/ilias_hr.lang @@ -1850,8 +1850,6 @@ assessment#:#tst_show_answer_sheet#:#Prikaži odgovore assessment#:#tst_show_cancel#:#Prekini test assessment#:#tst_show_cancel_description#:#Tijekom testa sudionicima se prikazuje gumb kojim se test može prekinuti te kasnije nastaviti. Oprez: Prekidom test ne zaustavlja se odbrojavanje maksimalnog trajanja testa. assessment#:#tst_show_comp_results#:#Kompetencijski rezultati -assessment#:#tst_show_pass_details#:#Prikaži ‘Tablicu detaljnih rezultata testa’ za svaki prolaz testa u odabranom trenutku. -assessment#:#tst_show_pass_details_desc#:#Sažetk rezultata će u trenutku koji je naveden u gornjoj postavci biti dopunjen sa sljedećim: ‘Tablica detaljnih rezultata testa’ prikazat će za za svaki prolaz testa naslov pitanja i ostvareni broj bodova.
U protivnom se ta tablica prikazuje samo nakon posljednjeg dopuštenog prolaza testa (postavlja se u podkartici ‘Opće postavke’, opcija ‘Ograniči broj prolaza testa’) ili nakon službenog završetka testa (postavlja se u podkartici ‘Opće postavke’, opcija ‘Vrijeme završetka’).
Daljnje postavke vezano za sadržaj ‘Tablice detaljnih rezultata testa’ moguće su pod ‘Daljnji detalji koji trebaju biti uključeni u rezultate testa’. assessment#:#tst_show_results#:#Rezultati testa assessment#:#tst_show_side_list#:#Pokaži popis pitanja assessment#:#tst_show_solution_answers_only#:#Prikaz ispisa rezultata (samo odgovori) diff --git a/lang/ilias_hu.lang b/lang/ilias_hu.lang index 6fc504683b6b..8bfb91ed944c 100644 --- a/lang/ilias_hu.lang +++ b/lang/ilias_hu.lang @@ -1865,8 +1865,6 @@ assessment#:#tst_show_answer_sheet#:#Válaszok megjelenítése assessment#:#tst_show_cancel#:#Teszt felfüggesztése assessment#:#tst_show_cancel_description#:#A résztvevő egy gomb megnyomásával felfüggeszthetik a teszt töltését, hogy később folytathassák azt. FIGYELEM: A teszt felfüggesztése nem állítja le az órát akkor sem, ha maximálisan elhasználható idő be lett állítva. assessment#:#tst_show_comp_results#:#Kompetenciaeredmények -assessment#:#tst_show_pass_details#:#Adott időpontban a 'Részletes teszteredmények táblázata' jelenjen meg az összes tesztkitöltéshez -assessment#:#tst_show_pass_details_desc#:#A fent beállított időponttól az eredmények összesítését hozzáfűzzük: A 'Részletes teszteredmények táblázata' a kérdés címét és a résztvevő adott kitöltésben elért pontszámát mutatja.
A legutolsó lehetséges kitöltés ('Általános' menü 'Tesztkitöltések számának korlátja' beállítás) vagy a teszt zárása ('Általános' menü 'Záró időpont' beállítás) után másik táblázat jelenik meg.
'Részletes teszteredmények táblázata' tartalmával kapcsolatos további beállítások a 'Teszteredmények további tartamai' részben adható meg. assessment#:#tst_show_results#:#Teszteredmények assessment#:#tst_show_side_list#:#Kérdéslista megjelenítése assessment#:#tst_show_solution_answers_only#:#Eredmények nyomtatási előnézete (csak a válaszoké) diff --git a/lang/ilias_it.lang b/lang/ilias_it.lang index d0f47113b61b..bccda7c81703 100644 --- a/lang/ilias_it.lang +++ b/lang/ilias_it.lang @@ -1864,8 +1864,6 @@ assessment#:#tst_show_answer_sheet#:#Mostra le risposte assessment#:#tst_show_cancel#:#Mostra le opzioni di sospensione del test assessment#:#tst_show_cancel_description#:#Se selezionato, un pulsante per sospendere il test è mostrato durante l'esecuzione. assessment#:#tst_show_comp_results#:#Mostra risultati di competenze -assessment#:#tst_show_pass_details#:#Mostra i dettagli del test in corso -assessment#:#tst_show_pass_details_desc#:#Se selezionato, i titoli delle domande e i punti raggiunti per ogni domanda nel test pass sono disponibili se il test non è terminato. assessment#:#tst_show_results#:#Mostra i risultati del test assessment#:#tst_show_side_list#:#Mostra la lista delle domande a lato assessment#:#tst_show_solution_answers_only#:#Stampa dei risultati (solo le risposte) diff --git a/lang/ilias_ja.lang b/lang/ilias_ja.lang index 31df0b1bf0d5..0ce718116243 100644 --- a/lang/ilias_ja.lang +++ b/lang/ilias_ja.lang @@ -1850,8 +1850,6 @@ assessment#:#tst_show_answer_sheet#:#全解答を表示 assessment#:#tst_show_cancel#:#テスト中断オプションを表示 assessment#:#tst_show_cancel_description#:#チェックするとテスト中断ボタンがテスト実行中表示されます。 assessment#:#tst_show_comp_results#:#能力結果を表示 -assessment#:#tst_show_pass_details#:#選択した時点の各テストの'テスト結果詳細'を表示する -assessment#:#tst_show_pass_details_desc#:#結果サマリーは設定の上に表示された時点で追加されます:'詳細テスト結果表'は問題のタイトルと特定のテストに得点された点数を表示します。
その他の表は最後のテストになる可能性の後('全般'リンク設定、オプションの'最大受験回数')またはテストが正式に終了する後('全般'リンク設定、オプションの'終了時間')に表示されます。
'詳細テスト結果表'のコンテンツに関するその他の設定はこのフォームの'テスト結果に含まれるべきその他詳細'セクションへ作成できます。 assessment#:#tst_show_results#:#テスト結果を表示 assessment#:#tst_show_side_list#:#脇に問題一覧を表示 assessment#:#tst_show_solution_answers_only#:#結果印刷表示(解答のみ) diff --git a/lang/ilias_ka.lang b/lang/ilias_ka.lang index 1c3e358395fc..5de14fc474a8 100644 --- a/lang/ilias_ka.lang +++ b/lang/ilias_ka.lang @@ -1850,8 +1850,6 @@ assessment#:#tst_show_answer_sheet#:#პასუხების ჩვენე assessment#:#tst_show_cancel#:#აჩვენე ტესტის შეჩერების პარამეტრი assessment#:#tst_show_cancel_description#:#თუ შემოწმებულია, შეწყვეტის ღილაკით შესაძლებებლია ტესტის შეჩერება ტესტის მსვლელობის დროს assessment#:#tst_show_comp_results#:#Show Competence Results###26 09 2014 new variable -assessment#:#tst_show_pass_details#:#აჩვენე ჩაბარების დეტალები მიმდინარე ტესტებისთვის -assessment#:#tst_show_pass_details_desc#:#If selected, the question titles and the reached points for every question in the test pass are available if the test is not finished.###07 11 2014 new variable assessment#:#tst_show_results#:#აჩვენე ტესტის პასუხები assessment#:#tst_show_side_list#:#აჩვენე კითხვების სია ცალკე assessment#:#tst_show_solution_answers_only#:#შედეგების ამობეჭდვის წინ ჩვენება ( მხოლოდ პასუხები) diff --git a/lang/ilias_lt.lang b/lang/ilias_lt.lang index 9793eaab04f4..f6052bc93612 100644 --- a/lang/ilias_lt.lang +++ b/lang/ilias_lt.lang @@ -1850,8 +1850,6 @@ assessment#:#tst_show_answer_sheet#:#Rodyti atsakymus assessment#:#tst_show_cancel#:#Rodyti Testo Sustabdymo Galimybę assessment#:#tst_show_cancel_description#:#Jei pasirinkta, testo metu matomas sustabdymo mygtumas assessment#:#tst_show_comp_results#:#Show Competence Results###26 09 2014 new variable -assessment#:#tst_show_pass_details#:#Show Pass Details for running tests###30 05 2007 new variable -assessment#:#tst_show_pass_details_desc#:#If selected, the question titles and the reached points for every question in the test pass are available if the test is not finished.###07 11 2014 new variable assessment#:#tst_show_results#:#Rodyti testo rezultatus assessment#:#tst_show_side_list#:#Show question list aside###24 07 2009 new variable assessment#:#tst_show_solution_answers_only#:#Rezultatai spausdinimo formatu (tik atsakymai) diff --git a/lang/ilias_nl.lang b/lang/ilias_nl.lang index 49d9eb25048d..0af7cd05b038 100644 --- a/lang/ilias_nl.lang +++ b/lang/ilias_nl.lang @@ -1850,8 +1850,6 @@ assessment#:#tst_show_answer_sheet#:#Toon antwoorden assessment#:#tst_show_cancel#:#Toon toetsopties assessment#:#tst_show_cancel_description#:#Indien aangevinkt, wordt een knop om de toets op te schorten getoond tijdens de maken van de toets assessment#:#tst_show_comp_results#:#Tonen competentieresultaten -assessment#:#tst_show_pass_details#:#Toon aflopen toetsdetails -assessment#:#tst_show_pass_details_desc#:#Als geselecteerd zijn de toetstitels en het aantal behaalde punten per vraag beschikbaar, als de toets nog niet is voltooid. assessment#:#tst_show_results#:#Laat toetsresultaten zien assessment#:#tst_show_side_list#:#Tonen vragenlijst aan zijkant assessment#:#tst_show_solution_answers_only#:#Resultaten overzicht (alleen de antwoorden) diff --git a/lang/ilias_pl.lang b/lang/ilias_pl.lang index e44478ac3ae7..e2f63f3db165 100644 --- a/lang/ilias_pl.lang +++ b/lang/ilias_pl.lang @@ -1850,8 +1850,6 @@ assessment#:#tst_show_answer_sheet#:#Pokaż odpowiedzi assessment#:#tst_show_cancel#:#Pokaż opcję zawieszenia testu assessment#:#tst_show_cancel_description#:#Jeśli wybrane, to jest widoczny przycisk zawieszenia testu podczas wykonywania testu. Uwaga: przerwanie testu nie powoduje zatrzymanie czasu przetwarzania określonego w opcji 'Maksymalny czas przetwarzania'. assessment#:#tst_show_comp_results#:#Pokaż wyniki kompetencji -assessment#:#tst_show_pass_details#:#Pokaż szczegóły wykonania uruchomionych testów -assessment#:#tst_show_pass_details_desc#:#W wybranym wyżej terminie przedstawione wyniki zostaną uzupełnione o kolejną tabelę.
W tej tabeli wyświetlane są dla każdego przebiegu testu tytuły pytań oraz otrzymana liczba punktów.
W przeciwnym razie tabela wyświetli się tylko po ostatnim dozwolonym przebiegu testu (należy to ustawić w zakładce 'Właściwości ogólne', opcja 'Ogranicz liczbę przebiegów testu') lub po zakończeniu testu (należy to ustawić w zakładce 'Właściwości ogólne', punkt 'Czas ukończenia').
Treść tabeli można uzupełnić w punkcie 'Dane szczegółowe dotyczące wyników testu'. assessment#:#tst_show_results#:#Pokaż wyniki testu assessment#:#tst_show_side_list#:#Lista pytań do assessment#:#tst_show_solution_answers_only#:#Wydruk wyników (tylko odpowiedzi) diff --git a/lang/ilias_pt.lang b/lang/ilias_pt.lang index 9ea852ad3c52..906904dc5267 100644 --- a/lang/ilias_pt.lang +++ b/lang/ilias_pt.lang @@ -1850,8 +1850,6 @@ assessment#:#tst_show_answer_sheet#:#Mostrar respostas assessment#:#tst_show_cancel#:#Regras para seleção aleatória de perguntas assessment#:#tst_show_cancel_description#:#Hora para começar assessment#:#tst_show_comp_results#:#Mostrar resultados de competência -assessment#:#tst_show_pass_details#:#Iniciar nova tentativa de teste -assessment#:#tst_show_pass_details_desc#:#Começar o teste assessment#:#tst_show_results#:#Tempo médio para analisar assessment#:#tst_show_side_list#:#Primeira visita assessment#:#tst_show_solution_answers_only#:#Última visita diff --git a/lang/ilias_ro.lang b/lang/ilias_ro.lang index 1774d251a140..be4354aed011 100644 --- a/lang/ilias_ro.lang +++ b/lang/ilias_ro.lang @@ -1850,8 +1850,6 @@ assessment#:#tst_show_answer_sheet#:#Show answers ### 2006-8-11 --- Add new tran assessment#:#tst_show_cancel#:#Show Suspend Test Option###26 10 2006 new variable assessment#:#tst_show_cancel_description#:#If checked, a button to suspend the test is shown during test execution###26 10 2006 new variable assessment#:#tst_show_comp_results#:#Show Competence Results###26 09 2014 new variable -assessment#:#tst_show_pass_details#:#Show Pass Details for running tests###30 05 2007 new variable -assessment#:#tst_show_pass_details_desc#:#If selected, the question titles and the reached points for every question in the test pass are available if the test is not finished.###07 11 2014 new variable assessment#:#tst_show_results#:#Aratati rezultatele testului assessment#:#tst_show_side_list#:#Show question list aside###24 07 2009 new variable assessment#:#tst_show_solution_answers_only#:#Results print view (answers only)###14 11 2007 new variable diff --git a/lang/ilias_ru.lang b/lang/ilias_ru.lang index de83d3a09576..39e64215d01d 100644 --- a/lang/ilias_ru.lang +++ b/lang/ilias_ru.lang @@ -1850,8 +1850,6 @@ assessment#:#tst_show_answer_sheet#:#Показать ответы assessment#:#tst_show_cancel#:#Отображать опцию "Приостановить тест" assessment#:#tst_show_cancel_description#:#Если включено, то кнопка паузы отображается для участников при прохождения теста. Не используйте это опцию для тестов с ограниченным временем прохождения. Приостановка теста не останавливает таймер теста. assessment#:#tst_show_comp_results#:#Show Competence Results###26 09 2014 new variable -assessment#:#tst_show_pass_details#:#Показать подробности прохождния для запущенных тестов -assessment#:#tst_show_pass_details_desc#:#If selected, the question titles and the reached points for every question in the test pass are available if the test is not finished.###07 11 2014 new variable assessment#:#tst_show_results#:#Просмотреть результаты теста assessment#:#tst_show_side_list#:#Показать список вопросов сбоку assessment#:#tst_show_solution_answers_only#:#Печатный вид результатов (только ответы) diff --git a/lang/ilias_sk.lang b/lang/ilias_sk.lang index 65fe2b1eb2d5..36d465bd358c 100644 --- a/lang/ilias_sk.lang +++ b/lang/ilias_sk.lang @@ -1850,8 +1850,6 @@ assessment#:#tst_show_answer_sheet#:#Zobrazit odpovědi assessment#:#tst_show_cancel#:#Zobrazit volbu přerušení testu assessment#:#tst_show_cancel_description#:#Je-li vybráno, pak tlačítko k přerušení testu bude zobrazeno v průběhu vykonávání testu assessment#:#tst_show_comp_results#:#Show Competence Results###26 09 2014 new variable -assessment#:#tst_show_pass_details#:#Zobrazit výsledky v průběhu testu -assessment#:#tst_show_pass_details_desc#:#If selected, the question titles and the reached points for every question in the test pass are available if the test is not finished.###07 11 2014 new variable assessment#:#tst_show_results#:#Zobrazit výsledky testu assessment#:#tst_show_side_list#:#Zobrazit boční seznam otázek assessment#:#tst_show_solution_answers_only#:#Přehled výsledků (jen odpovědi) diff --git a/lang/ilias_sl.lang b/lang/ilias_sl.lang index 45a48b63c9d3..005fc1413546 100644 --- a/lang/ilias_sl.lang +++ b/lang/ilias_sl.lang @@ -1864,8 +1864,6 @@ assessment#:#tst_show_answer_sheet#:#Prikaži pregled odgovorov assessment#:#tst_show_cancel#:#Prikaži "Prekini test" assessment#:#tst_show_cancel_description#:#Med izvedbo testa se udeležencem prikaže gumb za prekinitev testa. Pozor: Prekinitev testa ne ustavi odštevanja časa obdelave, ki je naveden kot 'Najdaljše trajanje obdelave‘. assessment#:#tst_show_comp_results#:#Rezultati kompetenc -assessment#:#tst_show_pass_details#:#Prikaži 'Tabelo s podrobnimi rezultati testov' za vsako opravljanje testa ob izbranem času. -assessment#:#tst_show_pass_details_desc#:#V zgoraj izbranem trenutku se objava rezultata dopolni z dodatno tabelo.
Ta tabela za vsako opravljanje testa prikaže naslov vprašanj in dosežene točke.
V nasprotnem primeru se ta tabela prikaže le po zadnjem dovoljenem opravljanju testa (nastaviti v podzavihku ‚Splošne nastavitve‘, možnost ‚Omejite število opravljanj testa') ali po zaključku testa (nastaviti v podzavihku ‚Splošne nastavitve', oddelek ‚Zaključek').
Vsebina tabele se v oddelku ‚Podrobnosti o rezultatih testa' lahko še naprej dopolnjuje. assessment#:#tst_show_results#:#Rezultati testa assessment#:#tst_show_side_list#:#Seznam vprašanj za assessment#:#tst_show_solution_answers_only#:#Tiskana različica rezultatov (samo odgovori) diff --git a/lang/ilias_sq.lang b/lang/ilias_sq.lang index 3ccfe43c4193..25269010b17e 100644 --- a/lang/ilias_sq.lang +++ b/lang/ilias_sq.lang @@ -1850,8 +1850,6 @@ assessment#:#tst_show_answer_sheet#:#Show answers ### 2006-8-11 --- Add new tran assessment#:#tst_show_cancel#:#Show Suspend Test Option###26 10 2006 new variable assessment#:#tst_show_cancel_description#:#If checked, a button to suspend the test is shown during test execution###26 10 2006 new variable assessment#:#tst_show_comp_results#:#Show Competence Results###26 09 2014 new variable -assessment#:#tst_show_pass_details#:#Show Pass Details for running tests###30 05 2007 new variable -assessment#:#tst_show_pass_details_desc#:#If selected, the question titles and the reached points for every question in the test pass are available if the test is not finished.###07 11 2014 new variable assessment#:#tst_show_results#:#Shih rezultatet e testit assessment#:#tst_show_side_list#:#Show question list aside###24 07 2009 new variable assessment#:#tst_show_solution_answers_only#:#Results print view (answers only)###14 11 2007 new variable diff --git a/lang/ilias_sr.lang b/lang/ilias_sr.lang index efea0304b1a8..1cf18d387fc4 100644 --- a/lang/ilias_sr.lang +++ b/lang/ilias_sr.lang @@ -1850,8 +1850,6 @@ assessment#:#tst_show_answer_sheet#:#Show answers ### 2006-8-11 --- Add new tran assessment#:#tst_show_cancel#:#Show Suspend Test Option###26 10 2006 new variable assessment#:#tst_show_cancel_description#:#If checked, a button to suspend the test is shown during test execution###26 10 2006 new variable assessment#:#tst_show_comp_results#:#Show Competence Results###26 09 2014 new variable -assessment#:#tst_show_pass_details#:#Show Pass Details for running tests###30 05 2007 new variable -assessment#:#tst_show_pass_details_desc#:#If selected, the question titles and the reached points for every question in the test pass are available if the test is not finished.###07 11 2014 new variable assessment#:#tst_show_results#:#Prikaži rezultate testa assessment#:#tst_show_side_list#:#Show question list aside###24 07 2009 new variable assessment#:#tst_show_solution_answers_only#:#Results print view (answers only)###14 11 2007 new variable diff --git a/lang/ilias_sv.lang b/lang/ilias_sv.lang index 4149b6182d7a..da5701fee9d6 100644 --- a/lang/ilias_sv.lang +++ b/lang/ilias_sv.lang @@ -1865,8 +1865,6 @@ assessment#:#tst_show_answer_sheet#:#Visa översikt över svar assessment#:#tst_show_cancel#:#Display "Avbrottstest assessment#:#tst_show_cancel_description#:#Visar en knapp under testet som kan användas för att avbryta testet. Uppmärksamhet assessment#:#tst_show_comp_results#:#Kompetensresultat -assessment#:#tst_show_pass_details#:#Visa 'Tabell över detaljerade testresultat' för varje godkänt test vid vald tidpunkt###31 03 2023 ny variabel -assessment#:#tst_show_pass_details_desc#:#Sammanfattningen av resultaten kommer att bifogas vid den tidpunkt som anges i inställningen ovan assessment#:#tst_show_results#:#Testresultat assessment#:#tst_show_side_list#:#Frågelista till assessment#:#tst_show_solution_answers_only#:#Skriv ut resultaten (endast svar) diff --git a/lang/ilias_tr.lang b/lang/ilias_tr.lang index 3bcc9c279c54..8fafef1c041c 100644 --- a/lang/ilias_tr.lang +++ b/lang/ilias_tr.lang @@ -1850,8 +1850,6 @@ assessment#:#tst_show_answer_sheet#:#Cevapları Göster assessment#:#tst_show_cancel#:#Testi Askıya Alma Seçeneğini Göster assessment#:#tst_show_cancel_description#:#Seçilirse, testi askıya almak için bir buton çıkar. assessment#:#tst_show_comp_results#:#Show Competence Results###26 09 2014 new variable -assessment#:#tst_show_pass_details#:#Geçiş Detaylarını Göster -assessment#:#tst_show_pass_details_desc#:#If selected, the question titles and the reached points for every question in the test pass are available if the test is not finished.###07 11 2014 new variable assessment#:#tst_show_results#:#Test Sonuçlarını Göster assessment#:#tst_show_side_list#:#Soru listesini göster assessment#:#tst_show_solution_answers_only#:#Sonuçları Yazdır (Sadece Yanıtlar) diff --git a/lang/ilias_uk.lang b/lang/ilias_uk.lang index e599a594eb8e..c2e96dc6a64d 100644 --- a/lang/ilias_uk.lang +++ b/lang/ilias_uk.lang @@ -1850,8 +1850,6 @@ assessment#:#tst_show_answer_sheet#:#show answers###20 Apr 2005 new variable assessment#:#tst_show_cancel#:#Show Suspend Test Option###25 02 2007 new variable assessment#:#tst_show_cancel_description#:#If checked, a button to suspend the test is shown during test execution###25 02 2007 new variable assessment#:#tst_show_comp_results#:#Show Competence Results###26 09 2014 new variable -assessment#:#tst_show_pass_details#:#Show Pass Details for running tests###30 05 2007 new variable -assessment#:#tst_show_pass_details_desc#:#If selected, the question titles and the reached points for every question in the test pass are available if the test is not finished.###07 11 2014 new variable assessment#:#tst_show_results#:#Показати результати тесту assessment#:#tst_show_side_list#:#Show question list aside###24 07 2009 new variable assessment#:#tst_show_solution_answers_only#:#Results print view (answers only)###14 11 2007 new variable diff --git a/lang/ilias_vi.lang b/lang/ilias_vi.lang index 6dda2289288d..4a100e718646 100644 --- a/lang/ilias_vi.lang +++ b/lang/ilias_vi.lang @@ -1852,8 +1852,6 @@ assessment#:#tst_show_answer_sheet#:#hiển thị câu trả lời assessment#:#tst_show_cancel#:#Show Suspend Test Option###25 02 2007 new variable assessment#:#tst_show_cancel_description#:#If checked, a button to suspend the test is shown during test execution###25 02 2007 new variable assessment#:#tst_show_comp_results#:#Show Competence Results###26 09 2014 new variable -assessment#:#tst_show_pass_details#:#Show Pass Details for running tests###30 05 2007 new variable -assessment#:#tst_show_pass_details_desc#:#If selected, the question titles and the reached points for every question in the test pass are available if the test is not finished.###07 11 2014 new variable assessment#:#tst_show_results#:#Hiện kết quả bài kiểm tra assessment#:#tst_show_side_list#:#Show question list aside###24 07 2009 new variable assessment#:#tst_show_solution_answers_only#:#Results print view (answers only)###14 11 2007 new variable diff --git a/lang/ilias_zh.lang b/lang/ilias_zh.lang index 14ffd6501a0d..954506447696 100644 --- a/lang/ilias_zh.lang +++ b/lang/ilias_zh.lang @@ -1849,8 +1849,6 @@ assessment#:#tst_show_answer_sheet#:#展示答案 assessment#:#tst_show_cancel#:#展示暂停测试选项 assessment#:#tst_show_cancel_description#:#如果勾选,将在测试过程中显示一个暂停测试的按钮 assessment#:#tst_show_comp_results#:#Show Competence Results###26 09 2014 new variable -assessment#:#tst_show_pass_details#:#显示正在进行的测试过程细节 -assessment#:#tst_show_pass_details_desc#:#If selected, the question titles and the reached points for every question in the test pass are available if the test is not finished.###07 11 2014 new variable assessment#:#tst_show_results#:#显示测试成绩 assessment#:#tst_show_side_list#:#在旁边显示题目列表 assessment#:#tst_show_solution_answers_only#:#成绩打印视图(仅答案) From 6dbd194d98aff4a19375db032d9887e7d4d1d350 Mon Sep 17 00:00:00 2001 From: Stephan Kergomard Date: Fri, 6 Dec 2024 14:02:33 +0100 Subject: [PATCH 272/292] Category: Fix Assign Role Table See: https://mantis.ilias.de/view.php?id=43018 --- Modules/Category/classes/class.ilCategoryAssignRoleTableGUI.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/Category/classes/class.ilCategoryAssignRoleTableGUI.php b/Modules/Category/classes/class.ilCategoryAssignRoleTableGUI.php index aa2be210e8d7..85100a0d739e 100644 --- a/Modules/Category/classes/class.ilCategoryAssignRoleTableGUI.php +++ b/Modules/Category/classes/class.ilCategoryAssignRoleTableGUI.php @@ -39,7 +39,7 @@ public function __construct( parent::__construct($a_parent_obj, $a_parent_cmd); - $this->addColumn("", "", "", true, "4%"); + $this->addColumn("", "", "4%", true); $this->addColumn($lng->txt("title"), "title", "35%"); $this->addColumn($lng->txt("description"), "desc", "45%"); $this->addColumn($lng->txt("type"), "type", "16%"); From 884d621701c43d1fed2adb023b493c251c5f0810 Mon Sep 17 00:00:00 2001 From: iszmais <45942348+iszmais@users.noreply.github.com> Date: Fri, 6 Dec 2024 14:41:27 +0100 Subject: [PATCH 273/292] dash refactor class header (#8640) --- .../Access/class.DashboardAccess.php | 5 ----- .../classes/class.ilAchievements.php | 7 ------- .../classes/class.ilAchievementsGUI.php | 1 - .../classes/class.ilObjDashboardSettings.php | 5 ----- .../class.ilObjDashboardSettingsAccess.php | 5 ----- .../classes/DashboardLayoutProvider.php | 5 ----- .../classes/class.ilDashObjectsTableGUI.php | 5 ----- .../class.ilDashObjectsTableRenderer.php | 3 --- ...ilDashboardSidePanelSettingsRepository.php | 5 ----- .../classes/class.ilPDMembershipBlockGUI.php | 2 -- .../class.ilPDSelectedItemsBlockGroup.php | 3 --- ...DSelectedItemsBlockMembershipsProvider.php | 2 +- ...SelectedItemsBlockSelectedItemsViewGUI.php | 19 +++++++++++-------- ...terface.ilPDSelectedItemsBlockProvider.php | 3 --- .../class.ilDashboardContentBlockGUI.php | 5 ----- .../classes/class.ilDashboardGUI.php | 2 -- ...ss.ilPersonalDesktopSettingsRepository.php | 5 ----- .../interface.ilDesktopItemHandling.php | 5 ----- 18 files changed, 12 insertions(+), 75 deletions(-) diff --git a/Services/Dashboard/Access/class.DashboardAccess.php b/Services/Dashboard/Access/class.DashboardAccess.php index f5b905ff51a3..8a2cf173d49c 100644 --- a/Services/Dashboard/Access/class.DashboardAccess.php +++ b/Services/Dashboard/Access/class.DashboardAccess.php @@ -18,11 +18,6 @@ namespace ILIAS\Dashboard\Access; -/** - * Dashboard permission wrapper - * - * @author Alexander Killing - */ class DashboardAccess { protected \ilRbacSystem $rbac_system; diff --git a/Services/Dashboard/Achievements/classes/class.ilAchievements.php b/Services/Dashboard/Achievements/classes/class.ilAchievements.php index 12ae110cebc7..e8e0822eef21 100644 --- a/Services/Dashboard/Achievements/classes/class.ilAchievements.php +++ b/Services/Dashboard/Achievements/classes/class.ilAchievements.php @@ -16,13 +16,6 @@ * *********************************************************************/ -/** - * Maybe a separate service in the future. Needs a generic approach. - * - * Currently only the main menu (and personal desktop) should use this. - * - * @author Alexander Killing - */ class ilAchievements { private ilCertificateActiveValidator $validator; diff --git a/Services/Dashboard/Achievements/classes/class.ilAchievementsGUI.php b/Services/Dashboard/Achievements/classes/class.ilAchievementsGUI.php index 74556d006462..17b5b1d09658 100644 --- a/Services/Dashboard/Achievements/classes/class.ilAchievementsGUI.php +++ b/Services/Dashboard/Achievements/classes/class.ilAchievementsGUI.php @@ -18,7 +18,6 @@ /** * @ilCtrl_Calls ilAchievementsGUI: ilLearningProgressGUI, ilPersonalSkillsGUI, ilBadgeProfileGUI, ilLearningHistoryGUI - * @author Alexander Killing */ class ilAchievementsGUI { diff --git a/Services/Dashboard/Administration/classes/class.ilObjDashboardSettings.php b/Services/Dashboard/Administration/classes/class.ilObjDashboardSettings.php index 2ec81073022a..bed69f38286c 100755 --- a/Services/Dashboard/Administration/classes/class.ilObjDashboardSettings.php +++ b/Services/Dashboard/Administration/classes/class.ilObjDashboardSettings.php @@ -16,11 +16,6 @@ * *********************************************************************/ -/** - * Dashboard settings - * - * @author Alexander Killing - */ class ilObjDashboardSettings extends ilObject { public function __construct( diff --git a/Services/Dashboard/Administration/classes/class.ilObjDashboardSettingsAccess.php b/Services/Dashboard/Administration/classes/class.ilObjDashboardSettingsAccess.php index bca88af67d6d..e151ddd40839 100755 --- a/Services/Dashboard/Administration/classes/class.ilObjDashboardSettingsAccess.php +++ b/Services/Dashboard/Administration/classes/class.ilObjDashboardSettingsAccess.php @@ -16,11 +16,6 @@ * *********************************************************************/ -/** - * Dashboard settings access - * - * @author Alexander Killing - */ class ilObjDashboardSettingsAccess extends ilObjectAccess { } diff --git a/Services/Dashboard/GlobalScreen/classes/DashboardLayoutProvider.php b/Services/Dashboard/GlobalScreen/classes/DashboardLayoutProvider.php index 7d17cb5932b9..9050b3dba1a6 100644 --- a/Services/Dashboard/GlobalScreen/classes/DashboardLayoutProvider.php +++ b/Services/Dashboard/GlobalScreen/classes/DashboardLayoutProvider.php @@ -24,11 +24,6 @@ use ILIAS\UI\Component\MainControls\MainBar; use ILIAS\GlobalScreen\ScreenContext\AdditionalData\Collection; -/** - * Class DashboardLayoutProvider - * - * @author Nils Haagen - */ class DashboardLayoutProvider extends AbstractModificationProvider implements ModificationProvider { protected ?Collection $data_collection; diff --git a/Services/Dashboard/ItemsBlock/classes/class.ilDashObjectsTableGUI.php b/Services/Dashboard/ItemsBlock/classes/class.ilDashObjectsTableGUI.php index 7802ded191c3..3132b04f7ef8 100644 --- a/Services/Dashboard/ItemsBlock/classes/class.ilDashObjectsTableGUI.php +++ b/Services/Dashboard/ItemsBlock/classes/class.ilDashObjectsTableGUI.php @@ -16,11 +16,6 @@ * *********************************************************************/ -/** - * Classic table for rep object lists, including checkbox - * - * @author Alexander Killing - */ class ilDashObjectsTableGUI extends ilTable2GUI { public function __construct( diff --git a/Services/Dashboard/ItemsBlock/classes/class.ilDashObjectsTableRenderer.php b/Services/Dashboard/ItemsBlock/classes/class.ilDashObjectsTableRenderer.php index 0e5c59a3a871..129b69916551 100644 --- a/Services/Dashboard/ItemsBlock/classes/class.ilDashObjectsTableRenderer.php +++ b/Services/Dashboard/ItemsBlock/classes/class.ilDashObjectsTableRenderer.php @@ -18,9 +18,6 @@ declare(strict_types=1); -/** - * Dashboard objects table renderer - */ class ilDashObjectsTableRenderer { protected object $parent_gui; diff --git a/Services/Dashboard/ItemsBlock/classes/class.ilDashboardSidePanelSettingsRepository.php b/Services/Dashboard/ItemsBlock/classes/class.ilDashboardSidePanelSettingsRepository.php index ea49a30e111a..2ef680f29e0c 100644 --- a/Services/Dashboard/ItemsBlock/classes/class.ilDashboardSidePanelSettingsRepository.php +++ b/Services/Dashboard/ItemsBlock/classes/class.ilDashboardSidePanelSettingsRepository.php @@ -16,11 +16,6 @@ * *********************************************************************/ -/** - * Dashboard side panel settings Repo - * - * @author Alexander Killing - */ class ilDashboardSidePanelSettingsRepository { public const CALENDAR = "cal"; diff --git a/Services/Dashboard/ItemsBlock/classes/class.ilPDMembershipBlockGUI.php b/Services/Dashboard/ItemsBlock/classes/class.ilPDMembershipBlockGUI.php index 2bc60e3c6f1c..3037a086a856 100755 --- a/Services/Dashboard/ItemsBlock/classes/class.ilPDMembershipBlockGUI.php +++ b/Services/Dashboard/ItemsBlock/classes/class.ilPDMembershipBlockGUI.php @@ -17,8 +17,6 @@ *********************************************************************/ /** - * Memberships block - * @author Alexander Killing * @ilCtrl_Calls ilPDMembershipBlockGUI: ilCommonActionDispatcherGUI */ class ilPDMembershipBlockGUI extends ilPDSelectedItemsBlockGUI diff --git a/Services/Dashboard/ItemsBlock/classes/class.ilPDSelectedItemsBlockGroup.php b/Services/Dashboard/ItemsBlock/classes/class.ilPDSelectedItemsBlockGroup.php index 8f6b1f022d00..a7ba09bee4e8 100644 --- a/Services/Dashboard/ItemsBlock/classes/class.ilPDSelectedItemsBlockGroup.php +++ b/Services/Dashboard/ItemsBlock/classes/class.ilPDSelectedItemsBlockGroup.php @@ -16,9 +16,6 @@ * *********************************************************************/ -/** - * Class ilPDSelectedItemsBlockGroup - */ class ilPDSelectedItemsBlockGroup { protected bool $has_icon = false; diff --git a/Services/Dashboard/ItemsBlock/classes/class.ilPDSelectedItemsBlockMembershipsProvider.php b/Services/Dashboard/ItemsBlock/classes/class.ilPDSelectedItemsBlockMembershipsProvider.php index 0ff12251f2ff..82be42ed09a4 100644 --- a/Services/Dashboard/ItemsBlock/classes/class.ilPDSelectedItemsBlockMembershipsProvider.php +++ b/Services/Dashboard/ItemsBlock/classes/class.ilPDSelectedItemsBlockMembershipsProvider.php @@ -21,7 +21,7 @@ class ilPDSelectedItemsBlockMembershipsProvider implements ilPDSelectedItemsBloc protected ilObjUser $actor; protected ilTree $tree; protected ilAccessHandler $access; - protected ilSetting $settings; + protected ilSetting $settings; private ilPDSelectedItemsBlockMembershipsObjectRepository $repository; public function __construct(ilObjUser $actor) diff --git a/Services/Dashboard/ItemsBlock/classes/class.ilPDSelectedItemsBlockSelectedItemsViewGUI.php b/Services/Dashboard/ItemsBlock/classes/class.ilPDSelectedItemsBlockSelectedItemsViewGUI.php index 9351ece26ac9..cab7a4854171 100644 --- a/Services/Dashboard/ItemsBlock/classes/class.ilPDSelectedItemsBlockSelectedItemsViewGUI.php +++ b/Services/Dashboard/ItemsBlock/classes/class.ilPDSelectedItemsBlockSelectedItemsViewGUI.php @@ -1,17 +1,20 @@ - */ class ilDashboardContentBlockGUI extends ilBlockGUI { public static string $block_type = "dashcontent"; diff --git a/Services/Dashboard/classes/class.ilDashboardGUI.php b/Services/Dashboard/classes/class.ilDashboardGUI.php index 90230a396b5b..414dc2c053f5 100755 --- a/Services/Dashboard/classes/class.ilDashboardGUI.php +++ b/Services/Dashboard/classes/class.ilDashboardGUI.php @@ -17,8 +17,6 @@ *********************************************************************/ /** - * Dashboard UI - * @author Alexander Killing * @ilCtrl_Calls ilDashboardGUI: ilPersonalProfileGUI * @ilCtrl_Calls ilDashboardGUI: ilObjUserGUI, ilPDNotesGUI * @ilCtrl_Calls ilDashboardGUI: ilColumnGUI, ilPDNewsGUI, ilCalendarPresentationGUI diff --git a/Services/Dashboard/classes/class.ilPersonalDesktopSettingsRepository.php b/Services/Dashboard/classes/class.ilPersonalDesktopSettingsRepository.php index a041771832eb..2495c69a1320 100644 --- a/Services/Dashboard/classes/class.ilPersonalDesktopSettingsRepository.php +++ b/Services/Dashboard/classes/class.ilPersonalDesktopSettingsRepository.php @@ -16,11 +16,6 @@ * *********************************************************************/ -/** - * Personal desktop settings repo - * - * @author Alexander Killing - */ class ilPersonalDesktopSettingsRepository { protected \ILIAS\Administration\Setting $settings; diff --git a/Services/Dashboard/interfaces/interface.ilDesktopItemHandling.php b/Services/Dashboard/interfaces/interface.ilDesktopItemHandling.php index 5684ef25fb64..e9d50b873032 100644 --- a/Services/Dashboard/interfaces/interface.ilDesktopItemHandling.php +++ b/Services/Dashboard/interfaces/interface.ilDesktopItemHandling.php @@ -16,11 +16,6 @@ * *********************************************************************/ -/** - * Interface for gui classes (e.g ilLuceneSearchGUI) that offer add/remove to/from desktop - * - * @author Stefan Meyer - */ interface ilDesktopItemHandling { /** From e8a01c57881f792310fb164f092f649f4cfc83da Mon Sep 17 00:00:00 2001 From: iszmais <45942348+iszmais@users.noreply.github.com> Date: Fri, 6 Dec 2024 15:25:35 +0100 Subject: [PATCH 274/292] Refactoring name presentation of fields in lists (#8649) --- .../Fields/Base/class.ilDclBaseFieldModel.php | 13 +++++++++-- .../class.ilDclBaseFieldRepresentation.php | 23 +++++-------------- .../Fields/Copy/class.ilDclCopyFieldModel.php | 10 ++++++++ .../class.ilDclCopyFieldRepresentation.php | 9 +++----- .../Plugin/class.ilDclPluginFieldModel.php | 20 ++++++++++++++++ .../Fields/class.ilDclFieldEditGUI.php | 1 + .../Fields/class.ilDclFieldFactory.php | 1 + .../Fields/class.ilDclFieldListTableGUI.php | 2 +- 8 files changed, 53 insertions(+), 26 deletions(-) diff --git a/Modules/DataCollection/classes/Fields/Base/class.ilDclBaseFieldModel.php b/Modules/DataCollection/classes/Fields/Base/class.ilDclBaseFieldModel.php index e617a6831bfe..832f435ab3b6 100644 --- a/Modules/DataCollection/classes/Fields/Base/class.ilDclBaseFieldModel.php +++ b/Modules/DataCollection/classes/Fields/Base/class.ilDclBaseFieldModel.php @@ -24,7 +24,7 @@ class ilDclBaseFieldModel protected string $description = ""; protected int $datatypeId = 0; protected ?int $order = null; - protected bool $unique; + protected bool $unique = false; /** @var ilDclFieldProperty[] */ protected array $property = []; protected bool $exportable = false; @@ -211,10 +211,19 @@ public function getDatatype(): ilDclDatatype public function getDatatypeTitle(): string { $this->loadDatatype(); - return $this->datatype->getTitle(); } + public function getPresentationTitle(): string + { + return $this->lng->txt('dcl_' . $this->getDatatypeTitle()); + } + + public function getPresentationDescription(): string + { + return $this->lng->txt('dcl_' . $this->getDatatypeTitle() . '_desc'); + } + /** * Get storage location for the model */ diff --git a/Modules/DataCollection/classes/Fields/Base/class.ilDclBaseFieldRepresentation.php b/Modules/DataCollection/classes/Fields/Base/class.ilDclBaseFieldRepresentation.php index bbdedb90ad6f..f7d02b83ce78 100644 --- a/Modules/DataCollection/classes/Fields/Base/class.ilDclBaseFieldRepresentation.php +++ b/Modules/DataCollection/classes/Fields/Base/class.ilDclBaseFieldRepresentation.php @@ -137,15 +137,6 @@ public function addFieldCreationForm( ): void { $opt = $this->buildFieldCreationInput($dcl, $mode); if ($opt !== null) { - if ($mode != 'create' && ilDclFieldTypePlugin::isPluginDatatype($this->getField()->getDatatype()->getTitle())) { - $new_plugin_title = $opt->getTitle(); - $plugin_name = ilDclFieldFactory::getPluginNameFromFieldModel($this->getField()); - if ($plugin_name !== "DclBase") { - $new_plugin_title .= ': ' . $plugin_name; - } - $opt->setTitle($new_plugin_title); - } - $form->addOption($opt); } } @@ -155,15 +146,13 @@ public function addFieldCreationForm( */ protected function buildFieldCreationInput(ilObjDataCollection $dcl, string $mode = 'create'): ?ilRadioOption { - $title = $this->lng->txt('dcl_' . $this->getField()->getDatatype()->getTitle()); - $info = $this->lng->txt('dcl_' . $this->getField()->getDatatype()->getTitle() . '_desc'); - if (ilDclFieldTypePlugin::isPluginDatatype($this->field->getDatatype()->getTitle())) { - $plugin = $this->component_factory->getPlugin(ilDclFieldTypePlugin::getPluginId($this->field->getDatatype()->getTitle())); - $title = (!str_ends_with($plugin->txt('field_type_name'), 'field_type_name-')) ? $plugin->txt('field_type_name') : $plugin->getPluginName(); - $info = (!str_ends_with($plugin->txt('field_type_info'), 'field_type_info-')) ? $plugin->txt('field_type_info') : ''; + $opt = null; + if ($this->getField()->getDatatypeId() !== null) { + $title = $this->field->getPresentationTitle(); + $info = $this->field->getPresentationDescription(); + $opt = new ilRadioOption($title, (string) $this->getField()->getDatatypeId()); + $opt->setInfo($info); } - $opt = new ilRadioOption($title, $this->getField()->getDatatypeId()); - $opt->setInfo($info); return $opt; } diff --git a/Modules/DataCollection/classes/Fields/Copy/class.ilDclCopyFieldModel.php b/Modules/DataCollection/classes/Fields/Copy/class.ilDclCopyFieldModel.php index 6fc1d5f175b3..79ab419301fe 100644 --- a/Modules/DataCollection/classes/Fields/Copy/class.ilDclCopyFieldModel.php +++ b/Modules/DataCollection/classes/Fields/Copy/class.ilDclCopyFieldModel.php @@ -41,4 +41,14 @@ public function getValidFieldProperties(): array ilDclBaseFieldModel::PROP_N_REFERENCE ]; } + + public function getPresentationTitle(): string + { + return $this->lng->txt('dcl_copy_field'); + } + + public function getPresentationDescription(): string + { + return $this->lng->txt('dcl_copy_field_desc'); + } } diff --git a/Modules/DataCollection/classes/Fields/Copy/class.ilDclCopyFieldRepresentation.php b/Modules/DataCollection/classes/Fields/Copy/class.ilDclCopyFieldRepresentation.php index 48214239c91f..68d164795da1 100644 --- a/Modules/DataCollection/classes/Fields/Copy/class.ilDclCopyFieldRepresentation.php +++ b/Modules/DataCollection/classes/Fields/Copy/class.ilDclCopyFieldRepresentation.php @@ -99,12 +99,9 @@ public function passThroughFilter(ilDclBaseRecordModel $record, $filter): bool protected function buildFieldCreationInput(ilObjDataCollection $dcl, string $mode = 'create'): ilRadioOption { - $datetype_title = $this->getField()->getDatatype()->getTitle(); - if ($datetype_title === 'copy') { - $datetype_title = 'copy_field'; - } - $opt = new ilRadioOption($this->lng->txt('dcl_' . $datetype_title), $this->getField()->getDatatypeId()); - $opt->setInfo($this->lng->txt('dcl_' . $datetype_title . '_desc')); + $datetype_title = $this->getField()->getPresentationTitle(); + $opt = new ilRadioOption($this->getField()->getPresentationTitle(), $this->getField()->getDatatypeId()); + $opt->setInfo($this->getField()->getPresentationDescription()); $options = []; $tables = $dcl->getTables(); diff --git a/Modules/DataCollection/classes/Fields/Plugin/class.ilDclPluginFieldModel.php b/Modules/DataCollection/classes/Fields/Plugin/class.ilDclPluginFieldModel.php index 373f910e815d..2954224beadd 100644 --- a/Modules/DataCollection/classes/Fields/Plugin/class.ilDclPluginFieldModel.php +++ b/Modules/DataCollection/classes/Fields/Plugin/class.ilDclPluginFieldModel.php @@ -38,4 +38,24 @@ public function allowFilterInListView(): bool { return false; } + + public function getPresentationTitle(): string + { + global $DIC; + $plugin = $DIC["component.factory"]->getPlugin(ilDclFieldTypePlugin::getPluginId($this->getDatatype()->getTitle())); + if (str_ends_with($plugin->txt('field_type_name'), 'field_type_name-')) { + return $plugin->getPluginName(); + } + return $plugin->txt('field_type_name'); + } + + public function getPresentationDescription(): string + { + global $DIC; + $plugin = $DIC["component.factory"]->getPlugin(ilDclFieldTypePlugin::getPluginId($this->getDatatype()->getTitle())); + if (str_ends_with($plugin->txt('field_type_info'), 'field_type_info-')) { + return ''; + } + return $plugin->txt('field_type_info'); + } } diff --git a/Modules/DataCollection/classes/Fields/class.ilDclFieldEditGUI.php b/Modules/DataCollection/classes/Fields/class.ilDclFieldEditGUI.php index 5b2922473d0f..9176f2da2bc9 100644 --- a/Modules/DataCollection/classes/Fields/class.ilDclFieldEditGUI.php +++ b/Modules/DataCollection/classes/Fields/class.ilDclFieldEditGUI.php @@ -251,6 +251,7 @@ public function initForm(string $a_mode = "create"): void foreach (ilDclDatatype::getAllDatatype() as $datatype) { $model = new ilDclBaseFieldModel(); $model->setDatatypeId($datatype->getId()); + $model = ilDclFieldFactory::getFieldModelInstanceByClass($model); if ($a_mode == 'edit' && $datatype->getId() === $this->field_obj->getDatatypeId()) { $model = $this->field_obj; diff --git a/Modules/DataCollection/classes/Fields/class.ilDclFieldFactory.php b/Modules/DataCollection/classes/Fields/class.ilDclFieldFactory.php index c2139f2be0ee..258691867b55 100644 --- a/Modules/DataCollection/classes/Fields/class.ilDclFieldFactory.php +++ b/Modules/DataCollection/classes/Fields/class.ilDclFieldFactory.php @@ -201,6 +201,7 @@ public static function getFieldModelInstanceByClass( if ($instance == null) { throw new ilDclException("Could not create FieldModel of " . $class); } + $instance->setDatatypeId($field->getDatatypeId()); if ($field->getId() != null) { self::$field_model_cache[$field->getId()] = $instance; diff --git a/Modules/DataCollection/classes/Fields/class.ilDclFieldListTableGUI.php b/Modules/DataCollection/classes/Fields/class.ilDclFieldListTableGUI.php index 662096ef0cd7..3ec00af828eb 100644 --- a/Modules/DataCollection/classes/Fields/class.ilDclFieldListTableGUI.php +++ b/Modules/DataCollection/classes/Fields/class.ilDclFieldListTableGUI.php @@ -245,7 +245,7 @@ public function fillRowFromObject(ilDclBaseFieldModel $a_set): void $this->tpl->setVariable('TITLE', $a_set->getTitle()); $this->tpl->setVariable('DESCRIPTION', $a_set->getDescription()); - $this->tpl->setVariable('DATATYPE', $a_set->getDatatypeTitle()); + $this->tpl->setVariable('DATATYPE', $a_set->getPresentationTitle()); if (!$a_set->isStandardField()) { switch ($a_set->isUnique()) { From 08924fe6d27beff3fa5111a411361c18bd75b851 Mon Sep 17 00:00:00 2001 From: Stephan Kergomard Date: Sat, 7 Dec 2024 16:39:32 +0100 Subject: [PATCH 275/292] Test: Fix Feedback Form Cloze Question --- .../classes/feedback/class.ilAssClozeTestFeedback.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Modules/TestQuestionPool/classes/feedback/class.ilAssClozeTestFeedback.php b/Modules/TestQuestionPool/classes/feedback/class.ilAssClozeTestFeedback.php index 2a4d7594a2ca..66e8dba9d736 100644 --- a/Modules/TestQuestionPool/classes/feedback/class.ilAssClozeTestFeedback.php +++ b/Modules/TestQuestionPool/classes/feedback/class.ilAssClozeTestFeedback.php @@ -62,7 +62,7 @@ protected function buildGapFeedbackLabel(int $gapIndex, assClozeGap $gap): strin $answers = array(); foreach ($gap->getItems($this->randomGroup()->dontShuffle()) as $item) { - $answers[] = '"' . $item->getAnswertext() . '"'; + $answers[] = '"' . ilLegacyFormElementsUtil::prepareFormOutput($item->getAnswertext()) . '"'; } $answers = implode(' / ', $answers); @@ -79,7 +79,7 @@ protected function buildTextGapGivenAnswerFeedbackLabel(int $gapIndex, assAnswer return sprintf( $this->lng->txt('ass_cloze_gap_fb_txt_match_label'), $gapIndex + 1, - $item->getAnswertext() + ilLegacyFormElementsUtil::prepareFormOutput($item->getAnswertext()) ); } @@ -98,7 +98,7 @@ protected function buildSelectGapOptionFeedbackLabel(int $gapIndex, assAnswerClo return sprintf( $this->lng->txt('ass_cloze_gap_fb_sel_opt_label'), $gapIndex + 1, - $item->getAnswertext() + ilLegacyFormElementsUtil::prepareFormOutput($item->getAnswertext()) ); } @@ -883,7 +883,7 @@ public function determineAnswerIndexForAnswerValue(assClozeGap $gap, string $ans } // if ($solutionValue > $upperBound) { - return self::FB_NUMERIC_GAP_TOO_HIGH_INDEX; + return self::FB_NUMERIC_GAP_TOO_HIGH_INDEX; //} } } From 9093a3804d68bb07dbf2eea791175a693b05d32e Mon Sep 17 00:00:00 2001 From: Stephan Kergomard Date: Sun, 8 Dec 2024 08:30:32 +0100 Subject: [PATCH 276/292] Test: Fix Navigation on Empty FileQuestion See: https://mantis.ilias.de/view.php?id=42560 --- .../TestQuestionPool/classes/class.assFileUpload.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Modules/TestQuestionPool/classes/class.assFileUpload.php b/Modules/TestQuestionPool/classes/class.assFileUpload.php index a53ef3429753..1a23310ed520 100644 --- a/Modules/TestQuestionPool/classes/class.assFileUpload.php +++ b/Modules/TestQuestionPool/classes/class.assFileUpload.php @@ -44,6 +44,8 @@ class assFileUpload extends assQuestion implements ilObjQuestionScoringAdjustabl protected $allowedextensions; + private ?string $current_cmd; + /** @var boolean Indicates whether completion by submission is enabled or not */ protected $completion_by_submission = false; @@ -70,8 +72,10 @@ public function __construct( $question = "" ) { parent::__construct($title, $comment, $author, $owner, $question); + /** @var ILIAS\DI\Container $DIC */ global $DIC; - $this->file_upload = $DIC->upload(); + $this->file_upload = $DIC['upload']; + $this->current_cmd = $DIC['ilCtrl']->getCmd(); } /** @@ -687,7 +691,10 @@ public function saveWorkingData($active_id, $pass = null, $authorized = true): b $test_id = $this->lookupTestId($active_id); try { - $upload_handling_required = $this->isFileUploadAvailable() && $this->checkUpload(); + $upload_handling_required = $this->current_cmd !== 'submitSolution' + && !$this->isFileDeletionAction() + && $this->isFileUploadAvailable() + && $this->checkUpload(); } catch (IllegalStateException $e) { $this->tpl->setOnScreenMessage('failure', $e->getMessage(), true); return false; From 25ac9048d333a6fe9894c7d76eb90a3877244832 Mon Sep 17 00:00:00 2001 From: "Daniel Cazalla (ZallaxDev)" <86362063+ZallaxDev@users.noreply.github.com> Date: Mon, 9 Dec 2024 16:46:53 +0100 Subject: [PATCH 277/292] LTI: Added permissions checking and HTML escaping --- .../classes/class.ilLTIConsumerAdministrationGUI.php | 2 +- Modules/LTIConsumer/classes/class.ilObjLTIConsumer.php | 2 +- Modules/LTIConsumer/ltiregstart.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Modules/LTIConsumer/classes/class.ilLTIConsumerAdministrationGUI.php b/Modules/LTIConsumer/classes/class.ilLTIConsumerAdministrationGUI.php index 64f0627e577a..564e984df96b 100755 --- a/Modules/LTIConsumer/classes/class.ilLTIConsumerAdministrationGUI.php +++ b/Modules/LTIConsumer/classes/class.ilLTIConsumerAdministrationGUI.php @@ -785,7 +785,7 @@ protected function confirmDeleteProviders(array $providers, string $cancelComman $confirmationGUI->addItem( 'provider_ids[]', (string) $provider->getId(), - $provider->getTitle(), + htmlspecialchars($provider->getTitle()), $providerIcon ); } diff --git a/Modules/LTIConsumer/classes/class.ilObjLTIConsumer.php b/Modules/LTIConsumer/classes/class.ilObjLTIConsumer.php index 7300ccf9268a..7f1eadb5a60d 100755 --- a/Modules/LTIConsumer/classes/class.ilObjLTIConsumer.php +++ b/Modules/LTIConsumer/classes/class.ilObjLTIConsumer.php @@ -1272,7 +1272,7 @@ public static function registerClient(array $data, object $tokenObj): array $reponseData = $data; $provider = new ilLTIConsumeProvider(); $toolConfig = $data['https://purl.imsglobal.org/spec/lti-tool-configuration']; - $provider->setTitle($data['client_name']); + $provider->setTitle(strip_tags($data['client_name'], ilObjectGUI::ALLOWED_TAGS_IN_TITLE_AND_DESCRIPTION)); $provider->setProviderUrl($toolConfig['target_link_uri']); $provider->setInitiateLogin($data['initiate_login_uri']); $provider->setRedirectionUris(implode(",", $data['redirect_uris'])); diff --git a/Modules/LTIConsumer/ltiregstart.php b/Modules/LTIConsumer/ltiregstart.php index 9f76e32c1488..a36677903a8f 100644 --- a/Modules/LTIConsumer/ltiregstart.php +++ b/Modules/LTIConsumer/ltiregstart.php @@ -26,7 +26,7 @@ ilInitialisation::initILIAS(); global $DIC; -if (!$DIC->user()->getId() || $DIC->user()->getId() === ANONYMOUS_USER_ID) { +if (!$DIC->user()->getId() || !ilLTIConsumerAccess::hasCustomProviderCreationAccess()) { ilObjLTIConsumer::sendResponseError(401, "unauthorized"); } From 985f383cb4aaa115f7631992c3cb65b75d363d04 Mon Sep 17 00:00:00 2001 From: "Daniel Cazalla (ZallaxDev)" <86362063+ZallaxDev@users.noreply.github.com> Date: Mon, 9 Dec 2024 16:51:10 +0100 Subject: [PATCH 278/292] Moved strict_types under copyright --- .../classes/class.ilLTIConsumerAdministrationGUI.php | 4 ++-- Modules/LTIConsumer/classes/class.ilObjLTIConsumer.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Modules/LTIConsumer/classes/class.ilLTIConsumerAdministrationGUI.php b/Modules/LTIConsumer/classes/class.ilLTIConsumerAdministrationGUI.php index 564e984df96b..9e7c0ed77b55 100755 --- a/Modules/LTIConsumer/classes/class.ilLTIConsumerAdministrationGUI.php +++ b/Modules/LTIConsumer/classes/class.ilLTIConsumerAdministrationGUI.php @@ -1,7 +1,5 @@ Date: Mon, 9 Dec 2024 17:05:58 +0100 Subject: [PATCH 279/292] Fixes for PHP-CS-FIXER --- .../classes/class.ilLTIConsumerAdministrationGUI.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Modules/LTIConsumer/classes/class.ilLTIConsumerAdministrationGUI.php b/Modules/LTIConsumer/classes/class.ilLTIConsumerAdministrationGUI.php index 9e7c0ed77b55..dfdafb26f5ea 100755 --- a/Modules/LTIConsumer/classes/class.ilLTIConsumerAdministrationGUI.php +++ b/Modules/LTIConsumer/classes/class.ilLTIConsumerAdministrationGUI.php @@ -123,7 +123,7 @@ public function executeCommand(): void } } -// todo? + // todo? protected function applyGlobalProviderFilterCmd(): void { $table = $this->buildProviderTable($this, self::CMD_SHOW_GLOBAL_PROVIDER); @@ -440,7 +440,7 @@ private function getIconXml(string $url, string $pId): ?string private function checkIconFileExtension(string $ext): bool { -// todo - check? + // todo - check? return false !== ($check = array_search($ext, self::ALLOWED_FILE_EXT)) ? true : false; } @@ -906,7 +906,7 @@ protected function fetchProviderMulti(): array protected function showSettingsCmd(?ilPropertyFormGUI $form = null): void { -// todo - check + // todo - check global $DIC; /* @var \ILIAS\DI\Container $DIC */ return; // no settings at all currently @@ -922,7 +922,7 @@ protected function showSettingsCmd(?ilPropertyFormGUI $form = null): void protected function saveSettingsCmd(): void { -// todo - check + // todo - check global $DIC; /* @var \ILIAS\DI\Container $DIC */ return; // no settings at all currently From f6b247d61cc8f386bec797b707e16b0e991ccda7 Mon Sep 17 00:00:00 2001 From: Tim Schmitz Date: Mon, 9 Dec 2024 18:10:54 +0100 Subject: [PATCH 280/292] AdvMD: defaults for some properties in field definitions (43017) --- .../class.ilADTLocalizedTextDefinition.php | 19 ++++++++++++++++-- .../class.ilADTMultiTextDefinition.php | 20 +++++++++++++++++-- .../Types/Text/class.ilADTTextDefinition.php | 18 ++++++++++++++++- 3 files changed, 52 insertions(+), 5 deletions(-) diff --git a/Services/ADT/classes/Types/LocalizedText/class.ilADTLocalizedTextDefinition.php b/Services/ADT/classes/Types/LocalizedText/class.ilADTLocalizedTextDefinition.php index 5c2942d7616d..bf245baf69a6 100644 --- a/Services/ADT/classes/Types/LocalizedText/class.ilADTLocalizedTextDefinition.php +++ b/Services/ADT/classes/Types/LocalizedText/class.ilADTLocalizedTextDefinition.php @@ -1,7 +1,22 @@ Date: Tue, 10 Dec 2024 15:28:26 +0000 Subject: [PATCH 281/292] sync language files --- lang/ilias_ar.lang | 5 +++++ lang/ilias_bg.lang | 5 +++++ lang/ilias_cs.lang | 5 +++++ lang/ilias_da.lang | 5 +++++ lang/ilias_el.lang | 5 +++++ lang/ilias_es.lang | 5 +++++ lang/ilias_et.lang | 5 +++++ lang/ilias_fa.lang | 5 +++++ lang/ilias_fr.lang | 5 +++++ lang/ilias_hr.lang | 5 +++++ lang/ilias_hu.lang | 5 +++++ lang/ilias_it.lang | 5 +++++ lang/ilias_ja.lang | 5 +++++ lang/ilias_ka.lang | 5 +++++ lang/ilias_lt.lang | 5 +++++ lang/ilias_nl.lang | 5 +++++ lang/ilias_pl.lang | 5 +++++ lang/ilias_pt.lang | 5 +++++ lang/ilias_ro.lang | 5 +++++ lang/ilias_ru.lang | 5 +++++ lang/ilias_sk.lang | 5 +++++ lang/ilias_sl.lang | 5 +++++ lang/ilias_sq.lang | 5 +++++ lang/ilias_sr.lang | 5 +++++ lang/ilias_sv.lang | 5 +++++ lang/ilias_tr.lang | 5 +++++ lang/ilias_uk.lang | 5 +++++ lang/ilias_vi.lang | 5 +++++ lang/ilias_zh.lang | 5 +++++ 29 files changed, 145 insertions(+) diff --git a/lang/ilias_ar.lang b/lang/ilias_ar.lang index d94524d382dd..fcf1c59a0e1e 100644 --- a/lang/ilias_ar.lang +++ b/lang/ilias_ar.lang @@ -8452,6 +8452,9 @@ dcl#:#dcl_confirm_delete_table#:#Do you really want to delete this table with it dcl#:#dcl_confirm_storing_records#:#Please validate and confirm your input.###25 10 2016 new variable dcl#:#dcl_confirm_storing_records_no_permission#:#You have no permission to change the record afterwards.###25 10 2016 new variable dcl#:#dcl_copy#:#Copy Data Collection +dcl#:#dcl_copy_field#:#Copy###10 12 2024 new variable +dcl#:#dcl_copy_field_desc#:#Field to copy options stored in a different field of a table.###10 12 2024 new variable +dcl#:#dcl_copy_title#:#Copy of table and field###10 12 2024 new variable dcl#:#dcl_create_date#:#Creation Date###25 10 2016 new variable dcl#:#dcl_create_entry_rules#:#Entry Creation###30 04 2021 new variable dcl#:#dcl_create_field#:#Create Field @@ -8476,6 +8479,7 @@ dcl#:#dcl_delete_tables_no_selection#:#Please select at least one table to delet dcl#:#dcl_delete_views#:#Delete Views###25 10 2016 new variable dcl#:#dcl_delete_views_no_selection#:#Please select at least one view to delete###31 03 2023 new variable dcl#:#dcl_deleted_records#:#Successfully deleted %s records###26 09 2014 new variable +dcl#:#dcl_deprecated_copy#:#(Deprecated)###10 12 2024 new variable dcl#:#dcl_desc#:#Descending Order (DESC)###26 09 2014 new variable dcl#:#dcl_description#:#Field Description dcl#:#dcl_detailed_view#:#Detailed View###25 10 2016 new variable @@ -8594,6 +8598,7 @@ dcl#:#dcl_number#:#Integer###25 10 2016 new variable dcl#:#dcl_number_desc#:#Field for integer values (max. 9 digits). No decimals or fractions.###25 10 2016 new variable dcl#:#dcl_online_info#:#Only if the Data Collection is online, users are able to use the Data Collection.###06 02 2015 new variable dcl#:#dcl_order#:#Order +dcl#:#dcl_origin_not_found#:#Origin field was not found!###10 12 2024 new variable dcl#:#dcl_own_entries#:#Only own entries###30 08 2015 new variable dcl#:#dcl_owner#:#Owner###20 07 2014 new variable dcl#:#dcl_owner_description#:#The owner of the entry.###20 07 2014 new variable diff --git a/lang/ilias_bg.lang b/lang/ilias_bg.lang index 389a45633ae9..68005075a478 100644 --- a/lang/ilias_bg.lang +++ b/lang/ilias_bg.lang @@ -8452,6 +8452,9 @@ dcl#:#dcl_confirm_delete_table#:# Наистина ли искате да изт dcl#:#dcl_confirm_storing_records#:#Моля, валидирайте и потвърдете въведените данни. dcl#:#dcl_confirm_storing_records_no_permission#:#Нямате разрешение да променяте записа след това. dcl#:#dcl_copy#:#Събиране на данни с копие +dcl#:#dcl_copy_field#:#Copy###10 12 2024 new variable +dcl#:#dcl_copy_field_desc#:#Field to copy options stored in a different field of a table.###10 12 2024 new variable +dcl#:#dcl_copy_title#:#Copy of table and field###10 12 2024 new variable dcl#:#dcl_create_date#:#Дата на създаване dcl#:#dcl_create_entry_rules#:#Създаване на записи###22 06 2022 new variable dcl#:#dcl_create_field#:#Създаване на поле @@ -8476,6 +8479,7 @@ dcl#:#dcl_delete_tables_no_selection#:#Please select at least one table to delet dcl#:#dcl_delete_views#:#Изтриване на изгледи dcl#:#dcl_delete_views_no_selection#:#Please select at least one view to delete###31 03 2023 new variable dcl#:#dcl_deleted_records#:#Успешно изтрити %s записи +dcl#:#dcl_deprecated_copy#:#(Deprecated)###10 12 2024 new variable dcl#:#dcl_desc#:#Намаляващ ред (DESC) dcl#:#dcl_description#:#Описание на полето dcl#:#dcl_detailed_view#:#Подробен изглед @@ -8594,6 +8598,7 @@ dcl#:#dcl_number#:#Integer dcl#:#dcl_number_desc#:#Поле за целочислени стойности (максимум 9 цифри). Не се използват десетични дроби и дробни числа. dcl#:#dcl_online_info#:# Само ако събирането на данни е онлайн, потребителите могат да използват събирането на данни. dcl#:#dcl_order#:#Order +dcl#:#dcl_origin_not_found#:#Origin field was not found!###10 12 2024 new variable dcl#:#dcl_own_entries#:#Само собствени записи dcl#:#dcl_owner#:#Собственик dcl#:#dcl_owner_description#:#Собственикът на записа. diff --git a/lang/ilias_cs.lang b/lang/ilias_cs.lang index 38214d7341b9..340e2e5a1a03 100644 --- a/lang/ilias_cs.lang +++ b/lang/ilias_cs.lang @@ -8452,6 +8452,9 @@ dcl#:#dcl_confirm_delete_table#:#Skutečně chcete smazat tuto tabulku, její ob dcl#:#dcl_confirm_storing_records#:#Ověřte a potvrďte svůj vstup. dcl#:#dcl_confirm_storing_records_no_permission#:#Nemáte oprávnění změnit potom záznam. dcl#:#dcl_copy#:#Kopírovat soubor údajů +dcl#:#dcl_copy_field#:#Copy###10 12 2024 new variable +dcl#:#dcl_copy_field_desc#:#Field to copy options stored in a different field of a table.###10 12 2024 new variable +dcl#:#dcl_copy_title#:#Copy of table and field###10 12 2024 new variable dcl#:#dcl_create_date#:#Datum vytvoření dcl#:#dcl_create_entry_rules#:#Entry Creation###30 04 2021 new variable dcl#:#dcl_create_field#:#Vytvořit pole @@ -8476,6 +8479,7 @@ dcl#:#dcl_delete_tables_no_selection#:#Please select at least one table to delet dcl#:#dcl_delete_views#:#Vymazat zobrazení dcl#:#dcl_delete_views_no_selection#:#Please select at least one view to delete###31 03 2023 new variable dcl#:#dcl_deleted_records#:#Úspěšně smazáno %s záznamů +dcl#:#dcl_deprecated_copy#:#(Deprecated)###10 12 2024 new variable dcl#:#dcl_desc#:#Sestupné pořadí (DESC) dcl#:#dcl_description#:#Popis pole dcl#:#dcl_detailed_view#:#Podrobné zobrazení @@ -8594,6 +8598,7 @@ dcl#:#dcl_number#:#Celé číslo dcl#:#dcl_number_desc#:#Pole pro celočíselné hodnoty (max. 9 číslic). Žádná desetinná místa nebo zlomky. dcl#:#dcl_online_info#:#Pouze v případě, že je sběr dat online, mohou uživatelé používat sběr dat. dcl#:#dcl_order#:#Třídění +dcl#:#dcl_origin_not_found#:#Origin field was not found!###10 12 2024 new variable dcl#:#dcl_own_entries#:#Pouze vlastní vstupy dcl#:#dcl_owner#:#Vlastník dcl#:#dcl_owner_description#:#Vlastník záznamu. diff --git a/lang/ilias_da.lang b/lang/ilias_da.lang index ca19d6d79371..2210e8ddcb80 100644 --- a/lang/ilias_da.lang +++ b/lang/ilias_da.lang @@ -8452,6 +8452,9 @@ dcl#:#dcl_confirm_delete_table#:#Do you really want to delete this table with it dcl#:#dcl_confirm_storing_records#:#Please validate and confirm your input.###25 10 2016 new variable dcl#:#dcl_confirm_storing_records_no_permission#:#You have no permission to change the record afterwards.###25 10 2016 new variable dcl#:#dcl_copy#:#Koper datasamling +dcl#:#dcl_copy_field#:#Copy###10 12 2024 new variable +dcl#:#dcl_copy_field_desc#:#Field to copy options stored in a different field of a table.###10 12 2024 new variable +dcl#:#dcl_copy_title#:#Copy of table and field###10 12 2024 new variable dcl#:#dcl_create_date#:#Creation Date###25 10 2016 new variable dcl#:#dcl_create_entry_rules#:#Entry Creation###30 04 2021 new variable dcl#:#dcl_create_field#:#Create Field###28 08 2012 new variable @@ -8476,6 +8479,7 @@ dcl#:#dcl_delete_tables_no_selection#:#Please select at least one table to delet dcl#:#dcl_delete_views#:#Delete Views###25 10 2016 new variable dcl#:#dcl_delete_views_no_selection#:#Please select at least one view to delete###31 03 2023 new variable dcl#:#dcl_deleted_records#:#Successfully deleted %s records###26 09 2014 new variable +dcl#:#dcl_deprecated_copy#:#(Deprecated)###10 12 2024 new variable dcl#:#dcl_desc#:#Descending Order (DESC)###26 09 2014 new variable dcl#:#dcl_description#:#Feltbeskrivelse dcl#:#dcl_detailed_view#:#Detailed View###25 10 2016 new variable @@ -8594,6 +8598,7 @@ dcl#:#dcl_number#:#Integer###25 10 2016 new variable dcl#:#dcl_number_desc#:#Field for integer values (max. 9 digits). No decimals or fractions.###25 10 2016 new variable dcl#:#dcl_online_info#:#Only if the Data Collection is online, users are able to use the Data Collection.###06 02 2015 new variable dcl#:#dcl_order#:#Sortering +dcl#:#dcl_origin_not_found#:#Origin field was not found!###10 12 2024 new variable dcl#:#dcl_own_entries#:#Only own entries###30 08 2015 new variable dcl#:#dcl_owner#:#Owner###20 07 2014 new variable dcl#:#dcl_owner_description#:#The owner of the entry.###20 07 2014 new variable diff --git a/lang/ilias_el.lang b/lang/ilias_el.lang index da27c9af0a6f..55e3350f2b23 100644 --- a/lang/ilias_el.lang +++ b/lang/ilias_el.lang @@ -8453,6 +8453,9 @@ dcl#:#dcl_confirm_delete_table#:#Do you really want to delete this table with it dcl#:#dcl_confirm_storing_records#:#Please validate and confirm your input.###25 10 2016 new variable dcl#:#dcl_confirm_storing_records_no_permission#:#You have no permission to change the record afterwards.###25 10 2016 new variable dcl#:#dcl_copy#:#Copy Data Collection###28 08 2012 new variable +dcl#:#dcl_copy_field#:#Copy###10 12 2024 new variable +dcl#:#dcl_copy_field_desc#:#Field to copy options stored in a different field of a table.###10 12 2024 new variable +dcl#:#dcl_copy_title#:#Copy of table and field###10 12 2024 new variable dcl#:#dcl_create_date#:#Creation Date###25 10 2016 new variable dcl#:#dcl_create_entry_rules#:#Entry Creation###30 04 2021 new variable dcl#:#dcl_create_field#:#Create Field###28 08 2012 new variable @@ -8477,6 +8480,7 @@ dcl#:#dcl_delete_tables_no_selection#:#Please select at least one table to delet dcl#:#dcl_delete_views#:#Delete Views###25 10 2016 new variable dcl#:#dcl_delete_views_no_selection#:#Please select at least one view to delete###31 03 2023 new variable dcl#:#dcl_deleted_records#:#Successfully deleted %s records###26 09 2014 new variable +dcl#:#dcl_deprecated_copy#:#(Deprecated)###10 12 2024 new variable dcl#:#dcl_desc#:#Descending Order (DESC)###26 09 2014 new variable dcl#:#dcl_description#:#Field Description###28 08 2012 new variable dcl#:#dcl_detailed_view#:#Detailed View###25 10 2016 new variable @@ -8595,6 +8599,7 @@ dcl#:#dcl_number#:#Integer###25 10 2016 new variable dcl#:#dcl_number_desc#:#Field for integer values (max. 9 digits). No decimals or fractions.###25 10 2016 new variable dcl#:#dcl_online_info#:#Only if the Data Collection is online, users are able to use the Data Collection.###06 02 2015 new variable dcl#:#dcl_order#:#Order###28 08 2012 new variable +dcl#:#dcl_origin_not_found#:#Origin field was not found!###10 12 2024 new variable dcl#:#dcl_own_entries#:#Only own entries###30 08 2015 new variable dcl#:#dcl_owner#:#Owner###20 07 2014 new variable dcl#:#dcl_owner_description#:#The owner of the entry.###20 07 2014 new variable diff --git a/lang/ilias_es.lang b/lang/ilias_es.lang index f3f467b0ebbf..707124511a01 100644 --- a/lang/ilias_es.lang +++ b/lang/ilias_es.lang @@ -8454,6 +8454,9 @@ dcl#:#dcl_confirm_delete_table#:#¿Está seguro de que quiere eliminar esta tabl dcl#:#dcl_confirm_storing_records#:#Valide y confirme su entrada. dcl#:#dcl_confirm_storing_records_no_permission#:#No tiene permiso para cambiar el registro después. dcl#:#dcl_copy#:#Copiar colección de datos +dcl#:#dcl_copy_field#:#Copy###10 12 2024 new variable +dcl#:#dcl_copy_field_desc#:#Field to copy options stored in a different field of a table.###10 12 2024 new variable +dcl#:#dcl_copy_title#:#Copy of table and field###10 12 2024 new variable dcl#:#dcl_create_date#:#Fecha de creación dcl#:#dcl_create_entry_rules#:#Entry Creation###30 04 2021 new variable dcl#:#dcl_create_field#:#Crear campo @@ -8478,6 +8481,7 @@ dcl#:#dcl_delete_tables_no_selection#:#Please select at least one table to delet dcl#:#dcl_delete_views#:#Eliminar vistas dcl#:#dcl_delete_views_no_selection#:#Please select at least one view to delete###31 03 2023 new variable dcl#:#dcl_deleted_records#:#Borrados correctamente %s registros. +dcl#:#dcl_deprecated_copy#:#(Deprecated)###10 12 2024 new variable dcl#:#dcl_desc#:#Orden descendente (DESC) dcl#:#dcl_description#:#Descripción del campo dcl#:#dcl_detailed_view#:#Vista detallada @@ -8596,6 +8600,7 @@ dcl#:#dcl_number#:#Entero dcl#:#dcl_number_desc#:#Campo para valores enteros (máximo de 9 dígitos) Sin decimales ni fracciones. dcl#:#dcl_online_info#:#Los usuarios pueden usar la colección de datos sólo si está activa. dcl#:#dcl_order#:#Orden +dcl#:#dcl_origin_not_found#:#Origin field was not found!###10 12 2024 new variable dcl#:#dcl_own_entries#:#Solo entradas propias dcl#:#dcl_owner#:#Propietario dcl#:#dcl_owner_description#:#Propietario de la entrada diff --git a/lang/ilias_et.lang b/lang/ilias_et.lang index b618a94c9d40..887fe8200239 100644 --- a/lang/ilias_et.lang +++ b/lang/ilias_et.lang @@ -8452,6 +8452,9 @@ dcl#:#dcl_confirm_delete_table#:#Do you really want to delete this table with it dcl#:#dcl_confirm_storing_records#:#Please validate and confirm your input.###25 10 2016 new variable dcl#:#dcl_confirm_storing_records_no_permission#:#You have no permission to change the record afterwards.###25 10 2016 new variable dcl#:#dcl_copy#:#Copy Data Collection +dcl#:#dcl_copy_field#:#Copy###10 12 2024 new variable +dcl#:#dcl_copy_field_desc#:#Field to copy options stored in a different field of a table.###10 12 2024 new variable +dcl#:#dcl_copy_title#:#Copy of table and field###10 12 2024 new variable dcl#:#dcl_create_date#:#Creation Date###25 10 2016 new variable dcl#:#dcl_create_entry_rules#:#Entry Creation###30 04 2021 new variable dcl#:#dcl_create_field#:#Create Field @@ -8476,6 +8479,7 @@ dcl#:#dcl_delete_tables_no_selection#:#Please select at least one table to delet dcl#:#dcl_delete_views#:#Delete Views###25 10 2016 new variable dcl#:#dcl_delete_views_no_selection#:#Please select at least one view to delete###31 03 2023 new variable dcl#:#dcl_deleted_records#:#Successfully deleted %s records +dcl#:#dcl_deprecated_copy#:#(Deprecated)###10 12 2024 new variable dcl#:#dcl_desc#:#Descending Order (DESC) dcl#:#dcl_description#:#Field Description dcl#:#dcl_detailed_view#:#Detailed View###25 10 2016 new variable @@ -8594,6 +8598,7 @@ dcl#:#dcl_number#:#Integer###25 10 2016 new variable dcl#:#dcl_number_desc#:#Field for integer values (max. 9 digits). No decimals or fractions.###25 10 2016 new variable dcl#:#dcl_online_info#:#Only if the Data Collection is online, users are able to use the Data Collection.###06 02 2015 new variable dcl#:#dcl_order#:#Order +dcl#:#dcl_origin_not_found#:#Origin field was not found!###10 12 2024 new variable dcl#:#dcl_own_entries#:#Only own entries###30 08 2015 new variable dcl#:#dcl_owner#:#Owner dcl#:#dcl_owner_description#:#The owner of the entry. diff --git a/lang/ilias_fa.lang b/lang/ilias_fa.lang index 7eb50c9d6831..fae177d0841d 100644 --- a/lang/ilias_fa.lang +++ b/lang/ilias_fa.lang @@ -8452,6 +8452,9 @@ dcl#:#dcl_confirm_delete_table#:#Do you really want to delete this table with it dcl#:#dcl_confirm_storing_records#:#Please validate and confirm your input.###25 10 2016 new variable dcl#:#dcl_confirm_storing_records_no_permission#:#You have no permission to change the record afterwards.###25 10 2016 new variable dcl#:#dcl_copy#:#Copy Data Collection###28 08 2012 new variable +dcl#:#dcl_copy_field#:#Copy###10 12 2024 new variable +dcl#:#dcl_copy_field_desc#:#Field to copy options stored in a different field of a table.###10 12 2024 new variable +dcl#:#dcl_copy_title#:#Copy of table and field###10 12 2024 new variable dcl#:#dcl_create_date#:#Creation Date###25 10 2016 new variable dcl#:#dcl_create_entry_rules#:#Entry Creation###30 04 2021 new variable dcl#:#dcl_create_field#:#Create Field###28 08 2012 new variable @@ -8476,6 +8479,7 @@ dcl#:#dcl_delete_tables_no_selection#:#Please select at least one table to delet dcl#:#dcl_delete_views#:#Delete Views###25 10 2016 new variable dcl#:#dcl_delete_views_no_selection#:#Please select at least one view to delete###31 03 2023 new variable dcl#:#dcl_deleted_records#:#Successfully deleted %s records###26 09 2014 new variable +dcl#:#dcl_deprecated_copy#:#(Deprecated)###10 12 2024 new variable dcl#:#dcl_desc#:#Descending Order (DESC)###26 09 2014 new variable dcl#:#dcl_description#:#Field Description###28 08 2012 new variable dcl#:#dcl_detailed_view#:#Detailed View###25 10 2016 new variable @@ -8594,6 +8598,7 @@ dcl#:#dcl_number#:#Integer###25 10 2016 new variable dcl#:#dcl_number_desc#:#Field for integer values (max. 9 digits). No decimals or fractions.###25 10 2016 new variable dcl#:#dcl_online_info#:#Only if the Data Collection is online, users are able to use the Data Collection.###06 02 2015 new variable dcl#:#dcl_order#:#Order###28 08 2012 new variable +dcl#:#dcl_origin_not_found#:#Origin field was not found!###10 12 2024 new variable dcl#:#dcl_own_entries#:#Only own entries###30 08 2015 new variable dcl#:#dcl_owner#:#Owner###20 07 2014 new variable dcl#:#dcl_owner_description#:#The owner of the entry.###20 07 2014 new variable diff --git a/lang/ilias_fr.lang b/lang/ilias_fr.lang index 61ba991bb365..0c8b70fe82ad 100644 --- a/lang/ilias_fr.lang +++ b/lang/ilias_fr.lang @@ -8452,6 +8452,9 @@ dcl#:#dcl_confirm_delete_table#:#Voulez-vous vraiment supprimer ce tableau avec dcl#:#dcl_confirm_storing_records#:#Veuillez valider et confirmer votre entrée. dcl#:#dcl_confirm_storing_records_no_permission#:#Vous avez la permission de modifier le dossier par la suite. dcl#:#dcl_copy#:#Copier Collection de Données +dcl#:#dcl_copy_field#:#Copy###10 12 2024 new variable +dcl#:#dcl_copy_field_desc#:#Field to copy options stored in a different field of a table.###10 12 2024 new variable +dcl#:#dcl_copy_title#:#Copy of table and field###10 12 2024 new variable dcl#:#dcl_create_date#:#Date de création dcl#:#dcl_create_entry_rules#:#Entry Creation dcl#:#dcl_create_field#:#Créer Champ @@ -8476,6 +8479,7 @@ dcl#:#dcl_delete_tables_no_selection#:#Please select at least one table to delet dcl#:#dcl_delete_views#:#Supprimer les vues dcl#:#dcl_delete_views_no_selection#:#Please select at least one view to delete###31 10 2023 new variable dcl#:#dcl_deleted_records#:#Successfully deleted %s records +dcl#:#dcl_deprecated_copy#:#(Deprecated)###10 12 2024 new variable dcl#:#dcl_desc#:#Ordre décroissant (DECR) dcl#:#dcl_description#:#Description du Champ dcl#:#dcl_detailed_view#:#Vue détaillée @@ -8594,6 +8598,7 @@ dcl#:#dcl_number#:#Nombre entier dcl#:#dcl_number_desc#:#Champ pour les valeurs de nombre entier (max. 9 chiffres). Pas de décimales ou de fractions. dcl#:#dcl_online_info#:#Les utilisateurs sont capables d’utiliser la collecte de données uniquement si celle-ci est en ligne. dcl#:#dcl_order#:#Ordre +dcl#:#dcl_origin_not_found#:#Origin field was not found!###10 12 2024 new variable dcl#:#dcl_own_entries#:#Uniquement les entrées propres dcl#:#dcl_owner#:#Propriétaire dcl#:#dcl_owner_description#:#Le propriétaire de l’entrée. diff --git a/lang/ilias_hr.lang b/lang/ilias_hr.lang index c132fa49fe86..1ccf77b3093e 100644 --- a/lang/ilias_hr.lang +++ b/lang/ilias_hr.lang @@ -8452,6 +8452,9 @@ dcl#:#dcl_confirm_delete_table#:#Želite li zaista izbrisati ovu tablicu sa sadr dcl#:#dcl_confirm_storing_records#:#Molimo provjerite i potvrdite svoj unos. dcl#:#dcl_confirm_storing_records_no_permission#:#Nakon toga nećete imati dopuštenje za promjenu zapisa. dcl#:#dcl_copy#:#Kopiraj zbirku podataka +dcl#:#dcl_copy_field#:#Copy###10 12 2024 new variable +dcl#:#dcl_copy_field_desc#:#Field to copy options stored in a different field of a table.###10 12 2024 new variable +dcl#:#dcl_copy_title#:#Copy of table and field###10 12 2024 new variable dcl#:#dcl_create_date#:#Datum stvaranja dcl#:#dcl_create_entry_rules#:#Entry Creation###04 06 2021 new variable dcl#:#dcl_create_field#:#Stvori polje @@ -8476,6 +8479,7 @@ dcl#:#dcl_delete_tables_no_selection#:#Please select at least one table to delet dcl#:#dcl_delete_views#:#Izbriši prikaze dcl#:#dcl_delete_views_no_selection#:#Please select at least one view to delete###31 03 2023 new variable dcl#:#dcl_deleted_records#:#Uspješno izbrisani %s unosi +dcl#:#dcl_deprecated_copy#:#(Deprecated)###10 12 2024 new variable dcl#:#dcl_desc#:#Silazni poredak (DESC) dcl#:#dcl_description#:#Opis polja dcl#:#dcl_detailed_view#:#Detaljan prikaz @@ -8594,6 +8598,7 @@ dcl#:#dcl_number#:#Cijeli broj dcl#:#dcl_number_desc#:#Polje za cijele brojeve (najviše 9 znamenki). Bez decimala ili razlomaka. dcl#:#dcl_online_info#:#Korisnici mogu koristiti zbirku podataka samo ako je zbirka podataka online. dcl#:#dcl_order#:#Redoslijed +dcl#:#dcl_origin_not_found#:#Origin field was not found!###10 12 2024 new variable dcl#:#dcl_own_entries#:#Samo vlastiti unosi dcl#:#dcl_owner#:#Vlasnik dcl#:#dcl_owner_description#:#Vlasnik unosa. diff --git a/lang/ilias_hu.lang b/lang/ilias_hu.lang index 8bfb91ed944c..a9d726eb6e39 100644 --- a/lang/ilias_hu.lang +++ b/lang/ilias_hu.lang @@ -8467,6 +8467,9 @@ dcl#:#dcl_confirm_delete_table#:#Biztos, hogy törli a táblát annak tartalmáv dcl#:#dcl_confirm_storing_records#:#Kérem, ellenőrizze és hagyja jóvá beírt adatát. dcl#:#dcl_confirm_storing_records_no_permission#:#Nincs jogosultsága a bejegyzést utólag módosítani. dcl#:#dcl_copy#:#Adatgyűjtés másolása +dcl#:#dcl_copy_field#:#Copy###10 12 2024 new variable +dcl#:#dcl_copy_field_desc#:#Field to copy options stored in a different field of a table.###10 12 2024 new variable +dcl#:#dcl_copy_title#:#Copy of table and field###10 12 2024 new variable dcl#:#dcl_create_date#:#Létrehozás dátuma dcl#:#dcl_create_entry_rules#:#Bejegyzés létrehozása dcl#:#dcl_create_field#:#Mező létrehozása @@ -8491,6 +8494,7 @@ dcl#:#dcl_delete_tables_no_selection#:#Legalább egy törlendő táblát válass dcl#:#dcl_delete_views#:#Nézetek törlése dcl#:#dcl_delete_views_no_selection#:#Legalább egy törlendő nézetet válasszon ki dcl#:#dcl_deleted_records#:#Sikeresen törölt %s bejegyzéseket +dcl#:#dcl_deprecated_copy#:#(Deprecated)###10 12 2024 new variable dcl#:#dcl_desc#:#Csökkenő sorrend (CSÖKK) dcl#:#dcl_description#:#Mező leírása dcl#:#dcl_detailed_view#:#Egyszerű @@ -8609,6 +8613,7 @@ dcl#:#dcl_number#:#Egész szám dcl#:#dcl_number_desc#:#Egész szám típusú beviteli mező (max. 9 számjegy). Közönséges és tizedes törtek nem engedélyezettek. dcl#:#dcl_online_info#:#Az adatgyűjtést csak online állapotában használhatják a felhasználók. dcl#:#dcl_order#:#Sorrend +dcl#:#dcl_origin_not_found#:#Origin field was not found!###10 12 2024 new variable dcl#:#dcl_own_entries#:#Csak a saját bejegyzéseim dcl#:#dcl_owner#:#Tulajdonos dcl#:#dcl_owner_description#:#Az a felhasználó, aki a bejegyzés tulajdonosa. diff --git a/lang/ilias_it.lang b/lang/ilias_it.lang index bccda7c81703..97562327c1ef 100644 --- a/lang/ilias_it.lang +++ b/lang/ilias_it.lang @@ -8466,6 +8466,9 @@ dcl#:#dcl_confirm_delete_table#:#Vuoi davvero eliminare questa tabella con il su dcl#:#dcl_confirm_storing_records#:#Si prega di convalidare e confermare il proprio input. dcl#:#dcl_confirm_storing_records_no_permission#:#Non è possibile cambiare successivamente la registrazione. dcl#:#dcl_copy#:#Copia raccolta dati +dcl#:#dcl_copy_field#:#Copy###10 12 2024 new variable +dcl#:#dcl_copy_field_desc#:#Field to copy options stored in a different field of a table.###10 12 2024 new variable +dcl#:#dcl_copy_title#:#Copy of table and field###10 12 2024 new variable dcl#:#dcl_create_date#:#Data di creazione dcl#:#dcl_create_entry_rules#:#Creazione della voce dcl#:#dcl_create_field#:#Crea campo @@ -8490,6 +8493,7 @@ dcl#:#dcl_delete_tables_no_selection#:#Please select at least one table to delet dcl#:#dcl_delete_views#:#Elimina visualizzazioni dcl#:#dcl_delete_views_no_selection#:#Please select at least one view to delete###31 03 2023 new variable dcl#:#dcl_deleted_records#:#%S registrazioni eliminate correttamente +dcl#:#dcl_deprecated_copy#:#(Deprecated)###10 12 2024 new variable dcl#:#dcl_desc#:#Ordine discendente (DESC) dcl#:#dcl_description#:#Descrizione campo dcl#:#dcl_detailed_view#:#Visualizzazione dettagliata @@ -8608,6 +8612,7 @@ dcl#:#dcl_number#:#Numero intero dcl#:#dcl_number_desc#:#Campo per valori interni (massimo 9 cifre). Nessun decimale o frazioni. dcl#:#dcl_online_info#:#Solo se la raccolta dati è online, allora gli utenti possono utilizzarla. dcl#:#dcl_order#:#Ordine +dcl#:#dcl_origin_not_found#:#Origin field was not found!###10 12 2024 new variable dcl#:#dcl_own_entries#:#Solo le voci proprie dcl#:#dcl_owner#:#Proprietario dcl#:#dcl_owner_description#:#Il proprietario dell’inserimento. diff --git a/lang/ilias_ja.lang b/lang/ilias_ja.lang index 0ce718116243..cc8c82cdb33a 100644 --- a/lang/ilias_ja.lang +++ b/lang/ilias_ja.lang @@ -8452,6 +8452,9 @@ dcl#:#dcl_confirm_delete_table#:#内容や階層の含まれるこのテーブ dcl#:#dcl_confirm_storing_records#:#有効にして入力を確認して下さい。 dcl#:#dcl_confirm_storing_records_no_permission#:#以降は記録を変更する権利がありません。 dcl#:#dcl_copy#:#データ収集を作成 +dcl#:#dcl_copy_field#:#Copy###10 12 2024 new variable +dcl#:#dcl_copy_field_desc#:#Field to copy options stored in a different field of a table.###10 12 2024 new variable +dcl#:#dcl_copy_title#:#Copy of table and field###10 12 2024 new variable dcl#:#dcl_create_date#:#作成日 dcl#:#dcl_create_entry_rules#:#作成のエントリー dcl#:#dcl_create_field#:#フィールドを作成 @@ -8476,6 +8479,7 @@ dcl#:#dcl_delete_tables_no_selection#:#削除するテーブルを一つは選 dcl#:#dcl_delete_views#:#ビューを削除 dcl#:#dcl_delete_views_no_selection#:#削除するビューを一つは選択して下さい。 dcl#:#dcl_deleted_records#:#%sレコードが正しく削除されました +dcl#:#dcl_deprecated_copy#:#(Deprecated)###10 12 2024 new variable dcl#:#dcl_desc#:#降順 (DESC) dcl#:#dcl_description#:#フィールド説明 dcl#:#dcl_detailed_view#:#詳細ビュー @@ -8594,6 +8598,7 @@ dcl#:#dcl_number#:#整数 dcl#:#dcl_number_desc#:#整数値(最大9桁)用のフィールドです。小数や分数ではありません。 dcl#:#dcl_online_info#:#データ収集がオンラインの場合に限りユーザはデータ収集を使用できます。 dcl#:#dcl_order#:#順 +dcl#:#dcl_origin_not_found#:#Origin field was not found!###10 12 2024 new variable dcl#:#dcl_own_entries#:#自己エントリーのみ dcl#:#dcl_owner#:#オーナ dcl#:#dcl_owner_description#:#エントリーのオーナ diff --git a/lang/ilias_ka.lang b/lang/ilias_ka.lang index 5de14fc474a8..593299c3e73d 100644 --- a/lang/ilias_ka.lang +++ b/lang/ilias_ka.lang @@ -8452,6 +8452,9 @@ dcl#:#dcl_confirm_delete_table#:#Do you really want to delete this table with it dcl#:#dcl_confirm_storing_records#:#Please validate and confirm your input.###25 10 2016 new variable dcl#:#dcl_confirm_storing_records_no_permission#:#You have no permission to change the record afterwards.###25 10 2016 new variable dcl#:#dcl_copy#:#Copy Data Collection +dcl#:#dcl_copy_field#:#Copy###10 12 2024 new variable +dcl#:#dcl_copy_field_desc#:#Field to copy options stored in a different field of a table.###10 12 2024 new variable +dcl#:#dcl_copy_title#:#Copy of table and field###10 12 2024 new variable dcl#:#dcl_create_date#:#Creation Date###25 10 2016 new variable dcl#:#dcl_create_entry_rules#:#Entry Creation###30 04 2021 new variable dcl#:#dcl_create_field#:#Create Field @@ -8476,6 +8479,7 @@ dcl#:#dcl_delete_tables_no_selection#:#Please select at least one table to delet dcl#:#dcl_delete_views#:#Delete Views###25 10 2016 new variable dcl#:#dcl_delete_views_no_selection#:#Please select at least one view to delete###31 03 2023 new variable dcl#:#dcl_deleted_records#:#Successfully deleted %s records###26 09 2014 new variable +dcl#:#dcl_deprecated_copy#:#(Deprecated)###10 12 2024 new variable dcl#:#dcl_desc#:#Descending Order (DESC)###26 09 2014 new variable dcl#:#dcl_description#:#Field Description dcl#:#dcl_detailed_view#:#Detailed View###25 10 2016 new variable @@ -8594,6 +8598,7 @@ dcl#:#dcl_number#:#Integer###25 10 2016 new variable dcl#:#dcl_number_desc#:#Field for integer values (max. 9 digits). No decimals or fractions.###25 10 2016 new variable dcl#:#dcl_online_info#:#Only if the Data Collection is online, users are able to use the Data Collection.###06 02 2015 new variable dcl#:#dcl_order#:#Order +dcl#:#dcl_origin_not_found#:#Origin field was not found!###10 12 2024 new variable dcl#:#dcl_own_entries#:#Only own entries###30 08 2015 new variable dcl#:#dcl_owner#:#Owner###20 07 2014 new variable dcl#:#dcl_owner_description#:#The owner of the entry.###20 07 2014 new variable diff --git a/lang/ilias_lt.lang b/lang/ilias_lt.lang index f6052bc93612..c75528ddfb6e 100644 --- a/lang/ilias_lt.lang +++ b/lang/ilias_lt.lang @@ -8452,6 +8452,9 @@ dcl#:#dcl_confirm_delete_table#:#Do you really want to delete this table with it dcl#:#dcl_confirm_storing_records#:#Please validate and confirm your input.###25 10 2016 new variable dcl#:#dcl_confirm_storing_records_no_permission#:#You have no permission to change the record afterwards.###25 10 2016 new variable dcl#:#dcl_copy#:#Copy Data Collection###28 08 2012 new variable +dcl#:#dcl_copy_field#:#Copy###10 12 2024 new variable +dcl#:#dcl_copy_field_desc#:#Field to copy options stored in a different field of a table.###10 12 2024 new variable +dcl#:#dcl_copy_title#:#Copy of table and field###10 12 2024 new variable dcl#:#dcl_create_date#:#Creation Date###25 10 2016 new variable dcl#:#dcl_create_entry_rules#:#Entry Creation###30 04 2021 new variable dcl#:#dcl_create_field#:#Create Field###28 08 2012 new variable @@ -8476,6 +8479,7 @@ dcl#:#dcl_delete_tables_no_selection#:#Please select at least one table to delet dcl#:#dcl_delete_views#:#Delete Views###25 10 2016 new variable dcl#:#dcl_delete_views_no_selection#:#Please select at least one view to delete###31 03 2023 new variable dcl#:#dcl_deleted_records#:#Successfully deleted %s records###26 09 2014 new variable +dcl#:#dcl_deprecated_copy#:#(Deprecated)###10 12 2024 new variable dcl#:#dcl_desc#:#Descending Order (DESC)###26 09 2014 new variable dcl#:#dcl_description#:#Field Description###28 08 2012 new variable dcl#:#dcl_detailed_view#:#Detailed View###25 10 2016 new variable @@ -8594,6 +8598,7 @@ dcl#:#dcl_number#:#Integer###25 10 2016 new variable dcl#:#dcl_number_desc#:#Field for integer values (max. 9 digits). No decimals or fractions.###25 10 2016 new variable dcl#:#dcl_online_info#:#Only if the Data Collection is online, users are able to use the Data Collection.###06 02 2015 new variable dcl#:#dcl_order#:#Order###28 08 2012 new variable +dcl#:#dcl_origin_not_found#:#Origin field was not found!###10 12 2024 new variable dcl#:#dcl_own_entries#:#Only own entries###30 08 2015 new variable dcl#:#dcl_owner#:#Owner###20 07 2014 new variable dcl#:#dcl_owner_description#:#The owner of the entry.###20 07 2014 new variable diff --git a/lang/ilias_nl.lang b/lang/ilias_nl.lang index 0af7cd05b038..1158b4a57450 100644 --- a/lang/ilias_nl.lang +++ b/lang/ilias_nl.lang @@ -8452,6 +8452,9 @@ dcl#:#dcl_confirm_delete_table#:#Wil je echt deze tabel met alle inhoud en struc dcl#:#dcl_confirm_storing_records#:#Please validate and confirm your input.###25 10 2016 new variable dcl#:#dcl_confirm_storing_records_no_permission#:#You have no permission to change the record afterwards.###25 10 2016 new variable dcl#:#dcl_copy#:#Kopieer gegevensverzameling +dcl#:#dcl_copy_field#:#Copy###10 12 2024 new variable +dcl#:#dcl_copy_field_desc#:#Field to copy options stored in a different field of a table.###10 12 2024 new variable +dcl#:#dcl_copy_title#:#Copy of table and field###10 12 2024 new variable dcl#:#dcl_create_date#:#Creation Date###25 10 2016 new variable dcl#:#dcl_create_entry_rules#:#Entry Creation###30 04 2021 new variable dcl#:#dcl_create_field#:#Aanmaken veld @@ -8476,6 +8479,7 @@ dcl#:#dcl_delete_tables_no_selection#:#Please select at least one table to delet dcl#:#dcl_delete_views#:#Delete Views###25 10 2016 new variable dcl#:#dcl_delete_views_no_selection#:#Please select at least one view to delete###31 03 2023 new variable dcl#:#dcl_deleted_records#:#%s records zijn verwijderd +dcl#:#dcl_deprecated_copy#:#(Deprecated)###10 12 2024 new variable dcl#:#dcl_desc#:#Aflopende volgorde (DESC) dcl#:#dcl_description#:#Veld omschrijving dcl#:#dcl_detailed_view#:#Detailed View###25 10 2016 new variable @@ -8594,6 +8598,7 @@ dcl#:#dcl_number#:#Integer###25 10 2016 new variable dcl#:#dcl_number_desc#:#Field for integer values (max. 9 digits). No decimals or fractions.###25 10 2016 new variable dcl#:#dcl_online_info#:#Only if the Data Collection is online, users are able to use the Data Collection.###06 02 2015 new variable dcl#:#dcl_order#:#Volgorde +dcl#:#dcl_origin_not_found#:#Origin field was not found!###10 12 2024 new variable dcl#:#dcl_own_entries#:#Only own entries###30 08 2015 new variable dcl#:#dcl_owner#:#Eigenaar dcl#:#dcl_owner_description#:#De eigenaar van de post diff --git a/lang/ilias_pl.lang b/lang/ilias_pl.lang index e2f63f3db165..b8e157d26001 100644 --- a/lang/ilias_pl.lang +++ b/lang/ilias_pl.lang @@ -8452,6 +8452,9 @@ dcl#:#dcl_confirm_delete_table#:#Czy naprawdę chcesz usunąć tabelę, łączni dcl#:#dcl_confirm_storing_records#:#Sprawdź dane przed zapisem. dcl#:#dcl_confirm_storing_records_no_permission#:#Nie masz uprawnień, aby ponownie edytować rekord danych. dcl#:#dcl_copy#:#Kopiuj zbiór danych +dcl#:#dcl_copy_field#:#Copy###10 12 2024 new variable +dcl#:#dcl_copy_field_desc#:#Field to copy options stored in a different field of a table.###10 12 2024 new variable +dcl#:#dcl_copy_title#:#Copy of table and field###10 12 2024 new variable dcl#:#dcl_create_date#:#Data utworzenia dcl#:#dcl_create_entry_rules#:#Entry Creation###30 04 2021 new variable dcl#:#dcl_create_field#:#Dodaj pole @@ -8476,6 +8479,7 @@ dcl#:#dcl_delete_tables_no_selection#:#Please select at least one table to delet dcl#:#dcl_delete_views#:#Usuń widoki dcl#:#dcl_delete_views_no_selection#:#Please select at least one view to delete###31 03 2023 new variable dcl#:#dcl_deleted_records#:#Usunięto %s rekordów danych +dcl#:#dcl_deprecated_copy#:#(Deprecated)###10 12 2024 new variable dcl#:#dcl_desc#:#Kolejność malejąca (DESC) dcl#:#dcl_description#:#Opis dcl#:#dcl_detailed_view#:#Widok pojedynczy @@ -8594,6 +8598,7 @@ dcl#:#dcl_number#:#Liczby całkowite dcl#:#dcl_number_desc#:#Pole do wprowadzania liczb całkowitych (maks. 9 cyfr). Ułamki i liczby dziesiętne nie są dozwolone. dcl#:#dcl_online_info#:#Użytkownicy mogą obejrzeć zbiór danych i korzystać z niego tylko wtedy, gdy zbiór jest w trybie online. dcl#:#dcl_order#:#Sortowanie +dcl#:#dcl_origin_not_found#:#Origin field was not found!###10 12 2024 new variable dcl#:#dcl_own_entries#:#Tylko własne wpisy dcl#:#dcl_owner#:#Właściciel dcl#:#dcl_owner_description#:#Właściciel wpisu. diff --git a/lang/ilias_pt.lang b/lang/ilias_pt.lang index 906904dc5267..1ea7d35ecdbd 100644 --- a/lang/ilias_pt.lang +++ b/lang/ilias_pt.lang @@ -8452,6 +8452,9 @@ dcl#:#dcl_confirm_delete_table#:#Tem a certeza que quer apagar esta tabela com o dcl#:#dcl_confirm_storing_records#:#Valide e confirme a sua entrada. dcl#:#dcl_confirm_storing_records_no_permission#:#Não tem permissão para mudar o registo mais tarde. dcl#:#dcl_copy#:#Copiar coleção de dados +dcl#:#dcl_copy_field#:#Copy###10 12 2024 new variable +dcl#:#dcl_copy_field_desc#:#Field to copy options stored in a different field of a table.###10 12 2024 new variable +dcl#:#dcl_copy_title#:#Copy of table and field###10 12 2024 new variable dcl#:#dcl_create_date#:#Data de criação dcl#:#dcl_create_entry_rules#:#Entry Creation###30 04 2021 new variable dcl#:#dcl_create_field#:#Criar campo @@ -8476,6 +8479,7 @@ dcl#:#dcl_delete_tables_no_selection#:#Please select at least one table to delet dcl#:#dcl_delete_views#:#Apagar vistas dcl#:#dcl_delete_views_no_selection#:#Please select at least one view to delete###31 03 2023 new variable dcl#:#dcl_deleted_records#:#Guardar registo corrigido +dcl#:#dcl_deprecated_copy#:#(Deprecated)###10 12 2024 new variable dcl#:#dcl_desc#:#Ordem descendente (DESC) dcl#:#dcl_description#:#Descrição do campo dcl#:#dcl_detailed_view#:#Vista detalhada @@ -8594,6 +8598,7 @@ dcl#:#dcl_number#:#Inteiro dcl#:#dcl_number_desc#:#Campo para valores inteiros (máx. 9 dígitos). Nada de decimais ou frações. dcl#:#dcl_online_info#:#Apenas se a coleção de dados estiver online é que os utilizadores podem usá-la. dcl#:#dcl_order#:#Ordem +dcl#:#dcl_origin_not_found#:#Origin field was not found!###10 12 2024 new variable dcl#:#dcl_own_entries#:#Apenas entradas próprias dcl#:#dcl_owner#:#Proprietário dcl#:#dcl_owner_description#:#O proprietário da entrada. diff --git a/lang/ilias_ro.lang b/lang/ilias_ro.lang index be4354aed011..8f11bbed2d00 100644 --- a/lang/ilias_ro.lang +++ b/lang/ilias_ro.lang @@ -8452,6 +8452,9 @@ dcl#:#dcl_confirm_delete_table#:#Do you really want to delete this table with it dcl#:#dcl_confirm_storing_records#:#Please validate and confirm your input.###25 10 2016 new variable dcl#:#dcl_confirm_storing_records_no_permission#:#You have no permission to change the record afterwards.###25 10 2016 new variable dcl#:#dcl_copy#:#Copy Data Collection###28 08 2012 new variable +dcl#:#dcl_copy_field#:#Copy###10 12 2024 new variable +dcl#:#dcl_copy_field_desc#:#Field to copy options stored in a different field of a table.###10 12 2024 new variable +dcl#:#dcl_copy_title#:#Copy of table and field###10 12 2024 new variable dcl#:#dcl_create_date#:#Creation Date###25 10 2016 new variable dcl#:#dcl_create_entry_rules#:#Entry Creation###30 04 2021 new variable dcl#:#dcl_create_field#:#Create Field###28 08 2012 new variable @@ -8476,6 +8479,7 @@ dcl#:#dcl_delete_tables_no_selection#:#Please select at least one table to delet dcl#:#dcl_delete_views#:#Delete Views###25 10 2016 new variable dcl#:#dcl_delete_views_no_selection#:#Please select at least one view to delete###31 03 2023 new variable dcl#:#dcl_deleted_records#:#Successfully deleted %s records###26 09 2014 new variable +dcl#:#dcl_deprecated_copy#:#(Deprecated)###10 12 2024 new variable dcl#:#dcl_desc#:#Descending Order (DESC)###26 09 2014 new variable dcl#:#dcl_description#:#Field Description###28 08 2012 new variable dcl#:#dcl_detailed_view#:#Detailed View###25 10 2016 new variable @@ -8594,6 +8598,7 @@ dcl#:#dcl_number#:#Integer###25 10 2016 new variable dcl#:#dcl_number_desc#:#Field for integer values (max. 9 digits). No decimals or fractions.###25 10 2016 new variable dcl#:#dcl_online_info#:#Only if the Data Collection is online, users are able to use the Data Collection.###06 02 2015 new variable dcl#:#dcl_order#:#Order###28 08 2012 new variable +dcl#:#dcl_origin_not_found#:#Origin field was not found!###10 12 2024 new variable dcl#:#dcl_own_entries#:#Only own entries###30 08 2015 new variable dcl#:#dcl_owner#:#Owner###20 07 2014 new variable dcl#:#dcl_owner_description#:#The owner of the entry.###20 07 2014 new variable diff --git a/lang/ilias_ru.lang b/lang/ilias_ru.lang index 39e64215d01d..b702454e59d7 100644 --- a/lang/ilias_ru.lang +++ b/lang/ilias_ru.lang @@ -8452,6 +8452,9 @@ dcl#:#dcl_confirm_delete_table#:#Do you really want to delete this table with it dcl#:#dcl_confirm_storing_records#:#Please validate and confirm your input.###25 10 2016 new variable dcl#:#dcl_confirm_storing_records_no_permission#:#You have no permission to change the record afterwards.###25 10 2016 new variable dcl#:#dcl_copy#:#Copy Data Collection +dcl#:#dcl_copy_field#:#Copy###10 12 2024 new variable +dcl#:#dcl_copy_field_desc#:#Field to copy options stored in a different field of a table.###10 12 2024 new variable +dcl#:#dcl_copy_title#:#Copy of table and field###10 12 2024 new variable dcl#:#dcl_create_date#:#Creation Date###25 10 2016 new variable dcl#:#dcl_create_entry_rules#:#Entry Creation###30 04 2021 new variable dcl#:#dcl_create_field#:#Create Field @@ -8476,6 +8479,7 @@ dcl#:#dcl_delete_tables_no_selection#:#Please select at least one table to delet dcl#:#dcl_delete_views#:#Delete Views###25 10 2016 new variable dcl#:#dcl_delete_views_no_selection#:#Please select at least one view to delete###31 03 2023 new variable dcl#:#dcl_deleted_records#:#Successfully deleted %s records###26 09 2014 new variable +dcl#:#dcl_deprecated_copy#:#(Deprecated)###10 12 2024 new variable dcl#:#dcl_desc#:#Descending Order (DESC)###26 09 2014 new variable dcl#:#dcl_description#:#Описание поля dcl#:#dcl_detailed_view#:#Detailed View###25 10 2016 new variable @@ -8594,6 +8598,7 @@ dcl#:#dcl_number#:#Integer###25 10 2016 new variable dcl#:#dcl_number_desc#:#Field for integer values (max. 9 digits). No decimals or fractions.###25 10 2016 new variable dcl#:#dcl_online_info#:#Only if the Data Collection is online, users are able to use the Data Collection.###06 02 2015 new variable dcl#:#dcl_order#:#Порядок +dcl#:#dcl_origin_not_found#:#Origin field was not found!###10 12 2024 new variable dcl#:#dcl_own_entries#:#Only own entries###30 08 2015 new variable dcl#:#dcl_owner#:#Owner dcl#:#dcl_owner_description#:#The owner of the entry. diff --git a/lang/ilias_sk.lang b/lang/ilias_sk.lang index 36d465bd358c..bf0e289abd8e 100644 --- a/lang/ilias_sk.lang +++ b/lang/ilias_sk.lang @@ -8452,6 +8452,9 @@ dcl#:#dcl_confirm_delete_table#:#Do you really want to delete this table with it dcl#:#dcl_confirm_storing_records#:#Please validate and confirm your input.###25 10 2016 new variable dcl#:#dcl_confirm_storing_records_no_permission#:#You have no permission to change the record afterwards.###25 10 2016 new variable dcl#:#dcl_copy#:#Copy Data Collection###28 08 2012 new variable +dcl#:#dcl_copy_field#:#Copy###10 12 2024 new variable +dcl#:#dcl_copy_field_desc#:#Field to copy options stored in a different field of a table.###10 12 2024 new variable +dcl#:#dcl_copy_title#:#Copy of table and field###10 12 2024 new variable dcl#:#dcl_create_date#:#Creation Date###25 10 2016 new variable dcl#:#dcl_create_entry_rules#:#Entry Creation###30 04 2021 new variable dcl#:#dcl_create_field#:#Create Field###28 08 2012 new variable @@ -8476,6 +8479,7 @@ dcl#:#dcl_delete_tables_no_selection#:#Please select at least one table to delet dcl#:#dcl_delete_views#:#Delete Views###25 10 2016 new variable dcl#:#dcl_delete_views_no_selection#:#Please select at least one view to delete###31 03 2023 new variable dcl#:#dcl_deleted_records#:#Successfully deleted %s records###26 09 2014 new variable +dcl#:#dcl_deprecated_copy#:#(Deprecated)###10 12 2024 new variable dcl#:#dcl_desc#:#Descending Order (DESC)###26 09 2014 new variable dcl#:#dcl_description#:#Field Description###28 08 2012 new variable dcl#:#dcl_detailed_view#:#Detailed View###25 10 2016 new variable @@ -8594,6 +8598,7 @@ dcl#:#dcl_number#:#Integer###25 10 2016 new variable dcl#:#dcl_number_desc#:#Field for integer values (max. 9 digits). No decimals or fractions.###25 10 2016 new variable dcl#:#dcl_online_info#:#Only if the Data Collection is online, users are able to use the Data Collection.###06 02 2015 new variable dcl#:#dcl_order#:#Order###28 08 2012 new variable +dcl#:#dcl_origin_not_found#:#Origin field was not found!###10 12 2024 new variable dcl#:#dcl_own_entries#:#Only own entries###30 08 2015 new variable dcl#:#dcl_owner#:#Owner###20 07 2014 new variable dcl#:#dcl_owner_description#:#The owner of the entry.###20 07 2014 new variable diff --git a/lang/ilias_sl.lang b/lang/ilias_sl.lang index 005fc1413546..dcede47cda78 100644 --- a/lang/ilias_sl.lang +++ b/lang/ilias_sl.lang @@ -8466,6 +8466,9 @@ dcl#:#dcl_confirm_delete_table#:#Ali res želite izbrisati to tabelo vključno z dcl#:#dcl_confirm_storing_records#:#Preverite podatke, preden jih shranite. dcl#:#dcl_confirm_storing_records_no_permission#:#Za ponovno urejanje podatkovnega zapisa nimate pravic. dcl#:#dcl_copy#:#Kopiraj zbirko podatkov +dcl#:#dcl_copy_field#:#Copy###10 12 2024 new variable +dcl#:#dcl_copy_field_desc#:#Field to copy options stored in a different field of a table.###10 12 2024 new variable +dcl#:#dcl_copy_title#:#Copy of table and field###10 12 2024 new variable dcl#:#dcl_create_date#:#Datum nastanka dcl#:#dcl_create_entry_rules#:#Entry Creation###19 08 2022 new variable dcl#:#dcl_create_field#:#Dodaj polje @@ -8490,6 +8493,7 @@ dcl#:#dcl_delete_tables_no_selection#:#Please select at least one table to delet dcl#:#dcl_delete_views#:#Izbriši poglede dcl#:#dcl_delete_views_no_selection#:#Please select at least one view to delete###31 03 2023 new variable dcl#:#dcl_deleted_records#:#Izbrisanih je bilo %s podatkovnih zapisov +dcl#:#dcl_deprecated_copy#:#(Deprecated)###10 12 2024 new variable dcl#:#dcl_desc#:#Padajoči vrstni red (DESC) dcl#:#dcl_description#:#Opis dcl#:#dcl_detailed_view#:#Podroben pogled @@ -8608,6 +8612,7 @@ dcl#:#dcl_number#:#Cela števila dcl#:#dcl_number_desc#:#Vnosno polje za cela števila (maksimalno 9 števk). Ulomki in decimalna števila niso dovoljeni. dcl#:#dcl_online_info#:#Samo če je zbirka podatkov na spletu, jo uporabniki lahko vidijo in uporabljajo. dcl#:#dcl_order#:#Razvrstitev +dcl#:#dcl_origin_not_found#:#Origin field was not found!###10 12 2024 new variable dcl#:#dcl_own_entries#:#Samo lastni vnosi dcl#:#dcl_owner#:#Imetnik dcl#:#dcl_owner_description#:#Imetnik tega vnosa. diff --git a/lang/ilias_sq.lang b/lang/ilias_sq.lang index 25269010b17e..a57d326d5b20 100644 --- a/lang/ilias_sq.lang +++ b/lang/ilias_sq.lang @@ -8452,6 +8452,9 @@ dcl#:#dcl_confirm_delete_table#:#Do you really want to delete this table with it dcl#:#dcl_confirm_storing_records#:#Please validate and confirm your input.###25 10 2016 new variable dcl#:#dcl_confirm_storing_records_no_permission#:#You have no permission to change the record afterwards.###25 10 2016 new variable dcl#:#dcl_copy#:#Copy Data Collection###28 08 2012 new variable +dcl#:#dcl_copy_field#:#Copy###10 12 2024 new variable +dcl#:#dcl_copy_field_desc#:#Field to copy options stored in a different field of a table.###10 12 2024 new variable +dcl#:#dcl_copy_title#:#Copy of table and field###10 12 2024 new variable dcl#:#dcl_create_date#:#Creation Date###25 10 2016 new variable dcl#:#dcl_create_entry_rules#:#Entry Creation###30 04 2021 new variable dcl#:#dcl_create_field#:#Create Field###28 08 2012 new variable @@ -8476,6 +8479,7 @@ dcl#:#dcl_delete_tables_no_selection#:#Please select at least one table to delet dcl#:#dcl_delete_views#:#Delete Views###25 10 2016 new variable dcl#:#dcl_delete_views_no_selection#:#Please select at least one view to delete###31 03 2023 new variable dcl#:#dcl_deleted_records#:#Successfully deleted %s records###26 09 2014 new variable +dcl#:#dcl_deprecated_copy#:#(Deprecated)###10 12 2024 new variable dcl#:#dcl_desc#:#Descending Order (DESC)###26 09 2014 new variable dcl#:#dcl_description#:#Field Description###28 08 2012 new variable dcl#:#dcl_detailed_view#:#Detailed View###25 10 2016 new variable @@ -8594,6 +8598,7 @@ dcl#:#dcl_number#:#Integer###25 10 2016 new variable dcl#:#dcl_number_desc#:#Field for integer values (max. 9 digits). No decimals or fractions.###25 10 2016 new variable dcl#:#dcl_online_info#:#Only if the Data Collection is online, users are able to use the Data Collection.###06 02 2015 new variable dcl#:#dcl_order#:#Order###28 08 2012 new variable +dcl#:#dcl_origin_not_found#:#Origin field was not found!###10 12 2024 new variable dcl#:#dcl_own_entries#:#Only own entries###30 08 2015 new variable dcl#:#dcl_owner#:#Owner###20 07 2014 new variable dcl#:#dcl_owner_description#:#The owner of the entry.###20 07 2014 new variable diff --git a/lang/ilias_sr.lang b/lang/ilias_sr.lang index 1cf18d387fc4..be79dba91ad5 100644 --- a/lang/ilias_sr.lang +++ b/lang/ilias_sr.lang @@ -8452,6 +8452,9 @@ dcl#:#dcl_confirm_delete_table#:#Do you really want to delete this table with it dcl#:#dcl_confirm_storing_records#:#Please validate and confirm your input.###25 10 2016 new variable dcl#:#dcl_confirm_storing_records_no_permission#:#You have no permission to change the record afterwards.###25 10 2016 new variable dcl#:#dcl_copy#:#Copy Data Collection###28 08 2012 new variable +dcl#:#dcl_copy_field#:#Copy###10 12 2024 new variable +dcl#:#dcl_copy_field_desc#:#Field to copy options stored in a different field of a table.###10 12 2024 new variable +dcl#:#dcl_copy_title#:#Copy of table and field###10 12 2024 new variable dcl#:#dcl_create_date#:#Creation Date###25 10 2016 new variable dcl#:#dcl_create_entry_rules#:#Entry Creation###30 04 2021 new variable dcl#:#dcl_create_field#:#Create Field###28 08 2012 new variable @@ -8476,6 +8479,7 @@ dcl#:#dcl_delete_tables_no_selection#:#Please select at least one table to delet dcl#:#dcl_delete_views#:#Delete Views###25 10 2016 new variable dcl#:#dcl_delete_views_no_selection#:#Please select at least one view to delete###31 03 2023 new variable dcl#:#dcl_deleted_records#:#Successfully deleted %s records###26 09 2014 new variable +dcl#:#dcl_deprecated_copy#:#(Deprecated)###10 12 2024 new variable dcl#:#dcl_desc#:#Descending Order (DESC)###26 09 2014 new variable dcl#:#dcl_description#:#Field Description###28 08 2012 new variable dcl#:#dcl_detailed_view#:#Detailed View###25 10 2016 new variable @@ -8594,6 +8598,7 @@ dcl#:#dcl_number#:#Integer###25 10 2016 new variable dcl#:#dcl_number_desc#:#Field for integer values (max. 9 digits). No decimals or fractions.###25 10 2016 new variable dcl#:#dcl_online_info#:#Only if the Data Collection is online, users are able to use the Data Collection.###06 02 2015 new variable dcl#:#dcl_order#:#Order###28 08 2012 new variable +dcl#:#dcl_origin_not_found#:#Origin field was not found!###10 12 2024 new variable dcl#:#dcl_own_entries#:#Only own entries###30 08 2015 new variable dcl#:#dcl_owner#:#Owner###20 07 2014 new variable dcl#:#dcl_owner_description#:#The owner of the entry.###20 07 2014 new variable diff --git a/lang/ilias_sv.lang b/lang/ilias_sv.lang index da5701fee9d6..235a7fbd4ba9 100644 --- a/lang/ilias_sv.lang +++ b/lang/ilias_sv.lang @@ -8467,6 +8467,9 @@ dcl#:#dcl_confirm_delete_table#:#Vill du verkligen radera denna tabell inklusive dcl#:#dcl_confirm_storing_records#:#Kontrollera detaljerna innan du sparar. dcl#:#dcl_confirm_storing_records_no_permission#:#Du har ingen rätt att redigera inspelningen igen senare. dcl#:#dcl_copy#:#Kopiering av datainsamling +dcl#:#dcl_copy_field#:#Copy###10 12 2024 new variable +dcl#:#dcl_copy_field_desc#:#Field to copy options stored in a different field of a table.###10 12 2024 new variable +dcl#:#dcl_copy_title#:#Copy of table and field###10 12 2024 new variable dcl#:#dcl_create_date#:#Datum för skapande dcl#:#dcl_create_entry_rules#:#Skapande av ingång dcl#:#dcl_create_field#:#Lägg till fält @@ -8491,6 +8494,7 @@ dcl#:#dcl_delete_tables_no_selection#:#Minst en tabell måste väljas för rader dcl#:#dcl_delete_views#:# Radera vyer dcl#:#dcl_delete_views_no_selection#:#Minst en vy måste väljas för radering dcl#:#dcl_deleted_records#:#%s poster har raderats +dcl#:#dcl_deprecated_copy#:#(Deprecated)###10 12 2024 new variable dcl#:#dcl_desc#:#Descendent ordning (DESC) dcl#:#dcl_description#:#Beskrivning dcl#:#dcl_detailed_view#:#Singelutsikt @@ -8609,6 +8613,7 @@ dcl#:#dcl_number#:#Integers dcl#:#dcl_number_desc#:#Inmatningsfält för hela tal (högst 9 siffror). Bråk och decimaltal är inte tillåtna. dcl#:#dcl_online_info#:#Endast när datainsamlingen är online kan användarna se och använda datainsamlingen. dcl#:#dcl_order#:#Sortering +dcl#:#dcl_origin_not_found#:#Origin field was not found!###10 12 2024 new variable dcl#:#dcl_own_entries#:#Endast egna poster dcl#:#dcl_owner#:#Own entry by ###Modifierad som en del av arbetet med att integrera ett jämställdhetsperspektiv i ILIAS 8 dcl#:#dcl_owner_description#:#Own entries always remain visible.###Modifierad som en del av jämställdhetsintegreringsaktiviteter för ILIAS 8 diff --git a/lang/ilias_tr.lang b/lang/ilias_tr.lang index 8fafef1c041c..92e4a397b2ca 100644 --- a/lang/ilias_tr.lang +++ b/lang/ilias_tr.lang @@ -8452,6 +8452,9 @@ dcl#:#dcl_confirm_delete_table#:#Eğer gerçekten içerik ve yapısı ile bu tab dcl#:#dcl_confirm_storing_records#:#Please validate and confirm your input.###25 10 2016 new variable dcl#:#dcl_confirm_storing_records_no_permission#:#You have no permission to change the record afterwards.###25 10 2016 new variable dcl#:#dcl_copy#:#Kopya Veri Toplama +dcl#:#dcl_copy_field#:#Copy###10 12 2024 new variable +dcl#:#dcl_copy_field_desc#:#Field to copy options stored in a different field of a table.###10 12 2024 new variable +dcl#:#dcl_copy_title#:#Copy of table and field###10 12 2024 new variable dcl#:#dcl_create_date#:#Creation Date###25 10 2016 new variable dcl#:#dcl_create_entry_rules#:#Entry Creation###30 04 2021 new variable dcl#:#dcl_create_field#:#Oluştur Alan @@ -8476,6 +8479,7 @@ dcl#:#dcl_delete_tables_no_selection#:#Please select at least one table to delet dcl#:#dcl_delete_views#:#Delete Views###25 10 2016 new variable dcl#:#dcl_delete_views_no_selection#:#Please select at least one view to delete###31 03 2023 new variable dcl#:#dcl_deleted_records#:#Successfully deleted %s records###26 09 2014 new variable +dcl#:#dcl_deprecated_copy#:#(Deprecated)###10 12 2024 new variable dcl#:#dcl_desc#:#Descending Order (DESC)###26 09 2014 new variable dcl#:#dcl_description#:#Alan Açıklama dcl#:#dcl_detailed_view#:#Detailed View###25 10 2016 new variable @@ -8594,6 +8598,7 @@ dcl#:#dcl_number#:#Integer###25 10 2016 new variable dcl#:#dcl_number_desc#:#Field for integer values (max. 9 digits). No decimals or fractions.###25 10 2016 new variable dcl#:#dcl_online_info#:#Only if the Data Collection is online, users are able to use the Data Collection.###06 02 2015 new variable dcl#:#dcl_order#:#Sıra +dcl#:#dcl_origin_not_found#:#Origin field was not found!###10 12 2024 new variable dcl#:#dcl_own_entries#:#Only own entries###30 08 2015 new variable dcl#:#dcl_owner#:#Owner###20 07 2014 new variable dcl#:#dcl_owner_description#:#The owner of the entry.###20 07 2014 new variable diff --git a/lang/ilias_uk.lang b/lang/ilias_uk.lang index c2e96dc6a64d..b97c9e098c28 100644 --- a/lang/ilias_uk.lang +++ b/lang/ilias_uk.lang @@ -8452,6 +8452,9 @@ dcl#:#dcl_confirm_delete_table#:#Do you really want to delete this table with it dcl#:#dcl_confirm_storing_records#:#Please validate and confirm your input.###25 10 2016 new variable dcl#:#dcl_confirm_storing_records_no_permission#:#You have no permission to change the record afterwards.###25 10 2016 new variable dcl#:#dcl_copy#:#Copy Data Collection###28 08 2012 new variable +dcl#:#dcl_copy_field#:#Copy###10 12 2024 new variable +dcl#:#dcl_copy_field_desc#:#Field to copy options stored in a different field of a table.###10 12 2024 new variable +dcl#:#dcl_copy_title#:#Copy of table and field###10 12 2024 new variable dcl#:#dcl_create_date#:#Creation Date###25 10 2016 new variable dcl#:#dcl_create_entry_rules#:#Entry Creation###30 04 2021 new variable dcl#:#dcl_create_field#:#Create Field###28 08 2012 new variable @@ -8476,6 +8479,7 @@ dcl#:#dcl_delete_tables_no_selection#:#Please select at least one table to delet dcl#:#dcl_delete_views#:#Delete Views###25 10 2016 new variable dcl#:#dcl_delete_views_no_selection#:#Please select at least one view to delete###31 03 2023 new variable dcl#:#dcl_deleted_records#:#Successfully deleted %s records###26 09 2014 new variable +dcl#:#dcl_deprecated_copy#:#(Deprecated)###10 12 2024 new variable dcl#:#dcl_desc#:#Descending Order (DESC)###26 09 2014 new variable dcl#:#dcl_description#:#Field Description###28 08 2012 new variable dcl#:#dcl_detailed_view#:#Detailed View###25 10 2016 new variable @@ -8594,6 +8598,7 @@ dcl#:#dcl_number#:#Integer###25 10 2016 new variable dcl#:#dcl_number_desc#:#Field for integer values (max. 9 digits). No decimals or fractions.###25 10 2016 new variable dcl#:#dcl_online_info#:#Only if the Data Collection is online, users are able to use the Data Collection.###06 02 2015 new variable dcl#:#dcl_order#:#Order###28 08 2012 new variable +dcl#:#dcl_origin_not_found#:#Origin field was not found!###10 12 2024 new variable dcl#:#dcl_own_entries#:#Only own entries###30 08 2015 new variable dcl#:#dcl_owner#:#Owner###20 07 2014 new variable dcl#:#dcl_owner_description#:#The owner of the entry.###20 07 2014 new variable diff --git a/lang/ilias_vi.lang b/lang/ilias_vi.lang index 4a100e718646..9cbed6334fb9 100644 --- a/lang/ilias_vi.lang +++ b/lang/ilias_vi.lang @@ -8454,6 +8454,9 @@ dcl#:#dcl_confirm_delete_table#:#Do you really want to delete this table with it dcl#:#dcl_confirm_storing_records#:#Please validate and confirm your input.###25 10 2016 new variable dcl#:#dcl_confirm_storing_records_no_permission#:#You have no permission to change the record afterwards.###25 10 2016 new variable dcl#:#dcl_copy#:#Copy Data Collection###28 08 2012 new variable +dcl#:#dcl_copy_field#:#Copy###10 12 2024 new variable +dcl#:#dcl_copy_field_desc#:#Field to copy options stored in a different field of a table.###10 12 2024 new variable +dcl#:#dcl_copy_title#:#Copy of table and field###10 12 2024 new variable dcl#:#dcl_create_date#:#Creation Date###25 10 2016 new variable dcl#:#dcl_create_entry_rules#:#Entry Creation###30 04 2021 new variable dcl#:#dcl_create_field#:#Create Field###28 08 2012 new variable @@ -8478,6 +8481,7 @@ dcl#:#dcl_delete_tables_no_selection#:#Please select at least one table to delet dcl#:#dcl_delete_views#:#Delete Views###25 10 2016 new variable dcl#:#dcl_delete_views_no_selection#:#Please select at least one view to delete###31 03 2023 new variable dcl#:#dcl_deleted_records#:#Successfully deleted %s records###26 09 2014 new variable +dcl#:#dcl_deprecated_copy#:#(Deprecated)###10 12 2024 new variable dcl#:#dcl_desc#:#Descending Order (DESC)###26 09 2014 new variable dcl#:#dcl_description#:#Field Description###28 08 2012 new variable dcl#:#dcl_detailed_view#:#Detailed View###25 10 2016 new variable @@ -8596,6 +8600,7 @@ dcl#:#dcl_number#:#Integer###25 10 2016 new variable dcl#:#dcl_number_desc#:#Field for integer values (max. 9 digits). No decimals or fractions.###25 10 2016 new variable dcl#:#dcl_online_info#:#Only if the Data Collection is online, users are able to use the Data Collection.###06 02 2015 new variable dcl#:#dcl_order#:#Order###28 08 2012 new variable +dcl#:#dcl_origin_not_found#:#Origin field was not found!###10 12 2024 new variable dcl#:#dcl_own_entries#:#Only own entries###30 08 2015 new variable dcl#:#dcl_owner#:#Owner###20 07 2014 new variable dcl#:#dcl_owner_description#:#The owner of the entry.###20 07 2014 new variable diff --git a/lang/ilias_zh.lang b/lang/ilias_zh.lang index 954506447696..b6d02577b370 100644 --- a/lang/ilias_zh.lang +++ b/lang/ilias_zh.lang @@ -8451,6 +8451,9 @@ dcl#:#dcl_confirm_delete_table#:#您真的想删除这个表的内容和结构 dcl#:#dcl_confirm_storing_records#:#Please validate and confirm your input.###25 10 2016 new variable dcl#:#dcl_confirm_storing_records_no_permission#:#You have no permission to change the record afterwards.###25 10 2016 new variable dcl#:#dcl_copy#:#复制数据采集 +dcl#:#dcl_copy_field#:#Copy###10 12 2024 new variable +dcl#:#dcl_copy_field_desc#:#Field to copy options stored in a different field of a table.###10 12 2024 new variable +dcl#:#dcl_copy_title#:#Copy of table and field###10 12 2024 new variable dcl#:#dcl_create_date#:#Creation Date###25 10 2016 new variable dcl#:#dcl_create_entry_rules#:#Entry Creation###30 04 2021 new variable dcl#:#dcl_create_field#:#创建字段 @@ -8475,6 +8478,7 @@ dcl#:#dcl_delete_tables_no_selection#:#Please select at least one table to delet dcl#:#dcl_delete_views#:#Delete Views###25 10 2016 new variable dcl#:#dcl_delete_views_no_selection#:#Please select at least one view to delete###31 03 2023 new variable dcl#:#dcl_deleted_records#:#Successfully deleted %s records###26 09 2014 new variable +dcl#:#dcl_deprecated_copy#:#(Deprecated)###10 12 2024 new variable dcl#:#dcl_desc#:#Descending Order (DESC)###26 09 2014 new variable dcl#:#dcl_description#:#字段描述 dcl#:#dcl_detailed_view#:#Detailed View###25 10 2016 new variable @@ -8593,6 +8597,7 @@ dcl#:#dcl_number#:#Integer###25 10 2016 new variable dcl#:#dcl_number_desc#:#Field for integer values (max. 9 digits). No decimals or fractions.###25 10 2016 new variable dcl#:#dcl_online_info#:#Only if the Data Collection is online, users are able to use the Data Collection.###06 02 2015 new variable dcl#:#dcl_order#:#排序 +dcl#:#dcl_origin_not_found#:#Origin field was not found!###10 12 2024 new variable dcl#:#dcl_own_entries#:#Only own entries###30 08 2015 new variable dcl#:#dcl_owner#:#Owner###20 07 2014 new variable dcl#:#dcl_owner_description#:#The owner of the entry.###20 07 2014 new variable From 67787eb7c4026098f47b712895c0bcd4a8ce78ff Mon Sep 17 00:00:00 2001 From: Alex Killing Date: Tue, 3 Dec 2024 15:19:56 +0100 Subject: [PATCH 282/292] 42613: BookingPool/Schedule: Editing a schedule is not protected with RBAC permissions / schedule is bound to other booking pool Signed-off-by: Releasemanager --- .../Objects/class.ilBookingObjectGUI.php | 4 ++++ .../Schedule/class.ilBookingSchedule.php | 15 +++++++++++++++ .../Schedule/class.ilBookingScheduleGUI.php | 5 +++++ 3 files changed, 24 insertions(+) diff --git a/Modules/BookingManager/Objects/class.ilBookingObjectGUI.php b/Modules/BookingManager/Objects/class.ilBookingObjectGUI.php index 70239bc80118..9daf8965d1d5 100644 --- a/Modules/BookingManager/Objects/class.ilBookingObjectGUI.php +++ b/Modules/BookingManager/Objects/class.ilBookingObjectGUI.php @@ -88,6 +88,10 @@ public function __construct( $this->ref_id = $this->book_request->getRefId(); $this->ctrl->saveParameter($this, "object_id"); + if ($this->object_id > 0 && ilBookingObject::lookupPoolId($this->object_id) !== $this->pool_gui->getObject()->getId()) { + throw new ilPermissionException("Booking object pool id does not match pool id."); + } + $this->rsv_ids = array_map('intval', $this->book_request->getReservationIdsFromString()); } diff --git a/Modules/BookingManager/Schedule/class.ilBookingSchedule.php b/Modules/BookingManager/Schedule/class.ilBookingSchedule.php index 9ebb8874d6f2..d5002865ae4e 100644 --- a/Modules/BookingManager/Schedule/class.ilBookingSchedule.php +++ b/Modules/BookingManager/Schedule/class.ilBookingSchedule.php @@ -311,6 +311,21 @@ protected function saveDefinition(): bool return true; } + public static function lookupPoolId(int $schedule_id): int + { + global $DIC; + + $ilDB = $DIC->database(); + + $set = $ilDB->query("SELECT pool_id " . + " FROM booking_schedule" . + " WHERE booking_schedule_id = " . $ilDB->quote($schedule_id, 'integer')); + if ($rec = $ilDB->fetchAssoc($set)) { + return (int) $rec['pool_id']; + } + return 0; + } + /** * Check if given pool has any defined schedules */ diff --git a/Modules/BookingManager/Schedule/class.ilBookingScheduleGUI.php b/Modules/BookingManager/Schedule/class.ilBookingScheduleGUI.php index 42ddc2486f8b..e0c72ef4ef80 100644 --- a/Modules/BookingManager/Schedule/class.ilBookingScheduleGUI.php +++ b/Modules/BookingManager/Schedule/class.ilBookingScheduleGUI.php @@ -53,6 +53,11 @@ public function __construct( ->gui() ->standardRequest(); $this->schedule_id = $this->book_request->getScheduleId(); + + if ($this->schedule_id > 0 && ilBookingSchedule::lookupPoolId($this->schedule_id) !== ilObject::_lookupObjId($this->ref_id)) { + throw new ilPermissionException("Schedule pool id does not match pool id."); + } + } public function executeCommand(): void From 589fb6f3be7eba9dce35d04a1a527b0cc18603a0 Mon Sep 17 00:00:00 2001 From: Releasemanager Date: Tue, 10 Dec 2024 15:38:48 +0000 Subject: [PATCH 283/292] Release 8.17 --- include/inc.ilias_version.php | 4 ++-- setup/sql/ilias3.sql | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/include/inc.ilias_version.php b/include/inc.ilias_version.php index a72f589724a8..e9d780728e4b 100644 --- a/include/inc.ilias_version.php +++ b/include/inc.ilias_version.php @@ -10,5 +10,5 @@ * * @package ilias-core */ -define("ILIAS_VERSION", "8.16 2024-11-19"); -define("ILIAS_VERSION_NUMERIC", "8.16"); // since version ILIAS 6 this must be always x.y: x and y are numbers +define("ILIAS_VERSION", "8.17 2024-12-10"); +define("ILIAS_VERSION_NUMERIC", "8.17"); // since version ILIAS 6 this must be always x.y: x and y are numbers diff --git a/setup/sql/ilias3.sql b/setup/sql/ilias3.sql index 80f2fe8981ea..841569b34204 100644 --- a/setup/sql/ilias3.sql +++ b/setup/sql/ilias3.sql @@ -7090,6 +7090,7 @@ INSERT INTO `il_db_steps` VALUES ('ilDataCollectionDBUpdateSteps',9,'2024-08-13 INSERT INTO `il_db_steps` VALUES ('ilDataCollectionDBUpdateSteps',10,'2024-10-01 13:17:03.393288','2024-10-01 13:17:03.393692'); INSERT INTO `il_db_steps` VALUES ('ilDataCollectionDBUpdateSteps',11,'2024-11-19 15:14:55.058607','2024-11-19 15:14:55.066263'); INSERT INTO `il_db_steps` VALUES ('ilDataCollectionDBUpdateSteps',12,'2024-11-19 15:14:55.066603','2024-11-19 15:14:55.066994'); +INSERT INTO `il_db_steps` VALUES ('ilDataCollectionDBUpdateSteps',13,'2024-12-10 15:28:52.968443','2024-12-10 15:28:52.968902'); INSERT INTO `il_db_steps` VALUES ('ilECSDBUpdateSteps',1,'2023-03-31 13:10:08.531142','2023-03-31 13:10:08.536140'); INSERT INTO `il_db_steps` VALUES ('ilECSUpdateSteps8',1,'2023-03-31 13:10:08.954044','2023-03-31 13:10:08.962950'); INSERT INTO `il_db_steps` VALUES ('ilECSUpdateSteps8',2,'2023-03-31 13:10:08.963397','2023-03-31 13:10:08.967878'); @@ -7345,6 +7346,7 @@ INSERT INTO `il_dcl_datatype` VALUES (9,'mob','integer',2,60); INSERT INTO `il_dcl_datatype` VALUES (11,'formula','text',0,110); INSERT INTO `il_dcl_datatype` VALUES (14,'text_selection','text',1,10); INSERT INTO `il_dcl_datatype` VALUES (15,'date_selection','text',1,50); +INSERT INTO `il_dcl_datatype` VALUES (17,'copy','text',1,85); -- -- Table structure for table `il_dcl_datatype_prop` @@ -13113,7 +13115,7 @@ INSERT INTO `object_data` VALUES (34,'typ','lm','Learning module Object',-1,'200 INSERT INTO `object_data` VALUES (35,'typ','notf','Note Folder Object',-1,'2002-12-21 00:04:00','2002-12-21 00:04:00','',NULL); INSERT INTO `object_data` VALUES (36,'typ','note','Note Object',-1,'2002-12-21 00:04:00','2002-12-21 00:04:00','',NULL); INSERT INTO `object_data` VALUES (37,'typ','frm','Forum object',-1,'2002-07-15 15:54:22','2003-08-15 12:36:40','',NULL); -INSERT INTO `object_data` VALUES (70,'lng','en','installed',-1,NULL,'2024-11-19 15:18:20','',NULL); +INSERT INTO `object_data` VALUES (70,'lng','en','installed',-1,NULL,'2024-12-10 15:28:52','',NULL); INSERT INTO `object_data` VALUES (71,'lng','de','not_installed',6,'2003-08-15 10:25:19','2015-12-22 16:29:24','',NULL); INSERT INTO `object_data` VALUES (72,'lng','es','not_installed',6,'2003-08-15 10:25:19','2003-08-15 10:25:19','',NULL); INSERT INTO `object_data` VALUES (73,'lng','it','not_installed',6,'2003-08-15 10:25:19','2003-08-15 10:25:19','',NULL); @@ -20106,7 +20108,7 @@ INSERT INTO `settings` VALUES ('common','ilfrmnoti1','1'); INSERT INTO `settings` VALUES ('common','ilfrmreadidx1','1'); INSERT INTO `settings` VALUES ('common','ilfrmthri2','1'); INSERT INTO `settings` VALUES ('common','ilGlobalTstPoolUsageSettingInitilisation','1'); -INSERT INTO `settings` VALUES ('common','ilias_version','8.16.0'); +INSERT INTO `settings` VALUES ('common','ilias_version','8.17.0'); INSERT INTO `settings` VALUES ('common','ilinc_akclassvalues_required','1'); INSERT INTO `settings` VALUES ('common','ilmpathix','1'); INSERT INTO `settings` VALUES ('common','iloscmsgidx1','1'); @@ -25091,4 +25093,4 @@ CREATE TABLE `xmlvalue_seq` ( --- Dump completed on 2024-11-19 15:18:21 +-- Dump completed on 2024-12-10 15:28:53 From a392ab49e0d5787859089fb8e7ab700a2a67aae2 Mon Sep 17 00:00:00 2001 From: Nils Haagen Date: Wed, 11 Dec 2024 08:55:40 +0100 Subject: [PATCH 284/292] PRG: 38422, have ObjectListGUI create CommandLink --- .../classes/class.ilObjStudyProgrammeListGUI.php | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/Modules/StudyProgramme/classes/class.ilObjStudyProgrammeListGUI.php b/Modules/StudyProgramme/classes/class.ilObjStudyProgrammeListGUI.php index bbf00787dbca..7085e48671c8 100644 --- a/Modules/StudyProgramme/classes/class.ilObjStudyProgrammeListGUI.php +++ b/Modules/StudyProgramme/classes/class.ilObjStudyProgrammeListGUI.php @@ -58,16 +58,6 @@ public function insertCommonSocialCommands($header_actions = false): void { } - /** - * @inheritdoc - */ - public function getCommandLink(string $cmd): string - { - $this->ctrl->setParameterByClass("ilobjstudyprogrammegui", "ref_id", $this->ref_id); - - return $this->ctrl->getLinkTargetByClass("ilobjstudyprogrammegui", $cmd); - } - /** * @inheritdoc */ From dd15bdc2ed9cd8540f2879e767147cc5c480060d Mon Sep 17 00:00:00 2001 From: Tim Schmitz Date: Wed, 11 Dec 2024 15:13:07 +0100 Subject: [PATCH 285/292] EmployeeTalk: fix limit in pagination (43195) --- .../EmployeeTalk/classes/Talk/class.ilEmployeeTalkTableGUI.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/EmployeeTalk/classes/Talk/class.ilEmployeeTalkTableGUI.php b/Modules/EmployeeTalk/classes/Talk/class.ilEmployeeTalkTableGUI.php index c48b63366d1a..c285315a334f 100644 --- a/Modules/EmployeeTalk/classes/Talk/class.ilEmployeeTalkTableGUI.php +++ b/Modules/EmployeeTalk/classes/Talk/class.ilEmployeeTalkTableGUI.php @@ -265,7 +265,7 @@ public function setTalkData(array $talks): void } $offset = intval($this->getOffset()); - $limit = intval($this->getLimit()) + 1; + $limit = intval($this->getLimit()); $this->setMaxCount(count($data)); From 4c62415399e77fc8f1a62ed57fb7440c01c07241 Mon Sep 17 00:00:00 2001 From: Tim Schmitz Date: Wed, 11 Dec 2024 15:40:59 +0100 Subject: [PATCH 286/292] EmployeeTalk: make table filter case insensitive, ignore whitespace (43194) --- .../Talk/class.ilEmployeeTalkTableGUI.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Modules/EmployeeTalk/classes/Talk/class.ilEmployeeTalkTableGUI.php b/Modules/EmployeeTalk/classes/Talk/class.ilEmployeeTalkTableGUI.php index c285315a334f..0dbc619828be 100644 --- a/Modules/EmployeeTalk/classes/Talk/class.ilEmployeeTalkTableGUI.php +++ b/Modules/EmployeeTalk/classes/Talk/class.ilEmployeeTalkTableGUI.php @@ -188,8 +188,8 @@ public function setTalkData(array $talks): void continue; } - if ($filter['etal_employee'] !== "") { - $filterUser = ilObjUser::getUserIdByLogin($filter['etal_employee']); + if (trim($filter['etal_employee']) !== "") { + $filterUser = ilObjUser::getUserIdByLogin(trim($filter['etal_employee'])); if ($val->getEmployee() !== $filterUser) { continue; } @@ -208,15 +208,15 @@ public function setTalkData(array $talks): void $employeeName = ilObjUser::_lookupLogin($talkData->getEmployee()); } - if ($filter['etal_superior'] !== "") { - $filterUser = ilObjUser::getUserIdByLogin($filter['etal_superior']); + if (trim($filter['etal_superior']) !== "") { + $filterUser = ilObjUser::getUserIdByLogin(trim($filter['etal_superior'])); if (intval($talk->getOwner()) !== $filterUser) { continue; } } - if ($filter['etal_title'] !== "") { - if (strpos($talk->getTitle(), $filter['etal_title']) === false) { + if (trim($filter['etal_title']) !== "") { + if (strpos(strtolower($talk->getTitle()), strtolower(trim($filter['etal_title']))) === false) { continue; } } @@ -245,8 +245,8 @@ public function setTalkData(array $talks): void $template = ilObjectFactory::getInstanceByObjId($talkData->getTemplateId()); $template_title = $template->getTitle(); } - if ($filter['etal_template'] !== "") { - if (strpos($template_title, $filter['etal_template']) === false) { + if (trim($filter['etal_template']) !== "") { + if (strpos(strtolower($template_title), strtolower(trim($filter['etal_template']))) === false) { continue; } } From f7a2f29211811e4ad3acea4924f1f00a6b442a3e Mon Sep 17 00:00:00 2001 From: Stephan Kergomard Date: Wed, 11 Dec 2024 15:45:53 +0100 Subject: [PATCH 287/292] Test: Fix Formating of Feedback See: https://mantis.ilias.de/view.php?id=42908 --- .../class.ilAssQuestionFeedbackEditingGUI.php | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/Modules/TestQuestionPool/classes/class.ilAssQuestionFeedbackEditingGUI.php b/Modules/TestQuestionPool/classes/class.ilAssQuestionFeedbackEditingGUI.php index 48eaded552ba..ea6bf4dea551 100644 --- a/Modules/TestQuestionPool/classes/class.ilAssQuestionFeedbackEditingGUI.php +++ b/Modules/TestQuestionPool/classes/class.ilAssQuestionFeedbackEditingGUI.php @@ -16,6 +16,8 @@ * *********************************************************************/ +use ILIAS\Style\Content\Service as ContentStyle; + /** * GUI class for feedback editing of assessment questions * @@ -101,6 +103,8 @@ class ilAssQuestionFeedbackEditingGUI */ protected $lng = null; + protected ContentStyle $content_style; + /** * Constructor * @@ -117,6 +121,7 @@ public function __construct(assQuestionGUI $questionGUI, ilCtrl $ctrl, ilAccessH $this->questionGUI = $questionGUI; $this->questionOBJ = $questionGUI->object; $this->feedbackOBJ = $questionGUI->object->feedbackOBJ; + /** @var ILIAS\DI\Container $DIC */ global $DIC; $this->request = $DIC->testQuestionPool()->internal()->request(); $this->ctrl = $ctrl; @@ -124,6 +129,7 @@ public function __construct(assQuestionGUI $questionGUI, ilCtrl $ctrl, ilAccessH $this->tpl = $tpl; $this->tabs = $tabs; $this->lng = $lng; + $this->content_style = $DIC->contentStyle(); } /** @@ -152,7 +158,11 @@ public function executeCommand(): void break; default: - $this->tabs->setTabActive('tst_feedback'); + if ($this->questionOBJ->selfassessmenteditingmode) { + $this->tabs->setTabActive('feedback'); + } else { + $this->tabs->setTabActive('tst_feedback'); + } $cmd .= 'Cmd'; $this->$cmd(); break; @@ -164,7 +174,7 @@ public function executeCommand(): void */ protected function setContentStyle(): void { - $this->tpl->addCss(ilObjStyleSheet::getContentStylePath(0)); + $this->content_style->gui()->addCss($this->tpl, $this->request->getRefId()); } /** @@ -174,10 +184,6 @@ protected function setContentStyle(): void */ private function showFeedbackFormCmd(): void { - $this->tpl->setCurrentBlock("ContentStyle"); - $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0)); - $this->tpl->parseCurrentBlock(); - $form = $this->buildForm(); $this->feedbackOBJ->initGenericFormProperties($form); @@ -205,7 +211,7 @@ private function saveFeedbackFormCmd(): void if ($form->checkInput()) { $this->feedbackOBJ->saveGenericFormProperties($form); - if ($this->questionOBJ->hasSpecificFeedback()){ + if ($this->questionOBJ->hasSpecificFeedback()) { $this->feedbackOBJ->saveSpecificFormProperties($form); } $this->questionOBJ->cleanupMediaObjectUsage(); From 96a448d1cfa9ccd6b6f1ebe35a77b3c9c325ba79 Mon Sep 17 00:00:00 2001 From: Stephan Kergomard Date: Wed, 11 Dec 2024 17:57:59 +0100 Subject: [PATCH 288/292] Test: Avoid Showing Failed Upload on Checking Qst See: https://mantis.ilias.de/view.php?id=43187 --- Modules/TestQuestionPool/classes/class.assFileUpload.php | 4 +++- Modules/TestQuestionPool/classes/class.assFileUploadGUI.php | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Modules/TestQuestionPool/classes/class.assFileUpload.php b/Modules/TestQuestionPool/classes/class.assFileUpload.php index 1a23310ed520..6984ebb48d95 100644 --- a/Modules/TestQuestionPool/classes/class.assFileUpload.php +++ b/Modules/TestQuestionPool/classes/class.assFileUpload.php @@ -692,6 +692,7 @@ public function saveWorkingData($active_id, $pass = null, $authorized = true): b try { $upload_handling_required = $this->current_cmd !== 'submitSolution' + && $this->current_cmd !== 'showInstantResponse' && !$this->isFileDeletionAction() && $this->isFileUploadAvailable() && $this->checkUpload(); @@ -859,7 +860,8 @@ protected function savePreviewData(ilAssQuestionPreviewSession $previewSession): } } else { try { - $fileUploadAvailable = $this->isFileUploadAvailable(); + $fileUploadAvailable = $this->current_cmd !== 'instantResponse' + && $this->isFileUploadAvailable(); } catch (IllegalStateException $e) { $this->tpl->setOnScreenMessage('failure', $e->getMessage(), true); return; diff --git a/Modules/TestQuestionPool/classes/class.assFileUploadGUI.php b/Modules/TestQuestionPool/classes/class.assFileUploadGUI.php index fb7a2dc44d89..f8eaa71ecb62 100644 --- a/Modules/TestQuestionPool/classes/class.assFileUploadGUI.php +++ b/Modules/TestQuestionPool/classes/class.assFileUploadGUI.php @@ -342,7 +342,7 @@ public function getPreview($show_question_only = false, $showInlineFeedback = fa $template->parseCurrentBlock(); } - if (strlen($this->object->getAllowedExtensions())) { + if ($this->object->getAllowedExtensions() !== '') { $template->setCurrentBlock("allowed_extensions"); $template->setVariable("TXT_ALLOWED_EXTENSIONS", $this->object->prepareTextareaOutput($this->lng->txt("allowedextensions") . ": " . $this->object->getAllowedExtensions())); $template->parseCurrentBlock(); @@ -390,7 +390,7 @@ public function getTestOutput($active_id, $pass, $is_postponed = false, $use_pos $template->parseCurrentBlock(); } - if (strlen($this->object->getAllowedExtensions())) { + if ($this->object->getAllowedExtensions() !== '') { $template->setCurrentBlock("allowed_extensions"); $template->setVariable("TXT_ALLOWED_EXTENSIONS", $this->object->prepareTextareaOutput($this->lng->txt("allowedextensions") . ": " . $this->object->getAllowedExtensions())); $template->parseCurrentBlock(); From 91d1b661d7e5f2d2d3ba43a3831be1d41e196377 Mon Sep 17 00:00:00 2001 From: fbartz Date: Tue, 3 Dec 2024 13:27:05 +0100 Subject: [PATCH 289/292] fixed form tag bug --- Modules/Test/classes/class.ilObjTestGUI.php | 1 - 1 file changed, 1 deletion(-) diff --git a/Modules/Test/classes/class.ilObjTestGUI.php b/Modules/Test/classes/class.ilObjTestGUI.php index 0ace7c8bb809..d86fed0ca0aa 100755 --- a/Modules/Test/classes/class.ilObjTestGUI.php +++ b/Modules/Test/classes/class.ilObjTestGUI.php @@ -2701,7 +2701,6 @@ public function infoScreen($session_lock = "") $this->trackTestObjectReadEvent(); } $info = new ilInfoScreenGUI($this); - $info->setOpenFormTag(false); if ($this->isCommandClassAnyInfoScreenChild()) { return $this->ctrl->forwardCommand($info); From 5adfe7c2db5d9d66274e3e0d261bdcad49e4d6de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20D=C3=ADaz?= Date: Thu, 12 Dec 2024 13:23:44 +0100 Subject: [PATCH 290/292] HTML escaping --- .../classes/class.ilLTIConsumerSettingsFormGUI.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Modules/LTIConsumer/classes/class.ilLTIConsumerSettingsFormGUI.php b/Modules/LTIConsumer/classes/class.ilLTIConsumerSettingsFormGUI.php index 4a51167e4584..3a59163ffb1b 100755 --- a/Modules/LTIConsumer/classes/class.ilLTIConsumerSettingsFormGUI.php +++ b/Modules/LTIConsumer/classes/class.ilLTIConsumerSettingsFormGUI.php @@ -1,7 +1,5 @@ language()->txt('provider_info')); $item->setValue($this->object->getProvider()->getTitle()); - $item->setInfo($this->object->getProvider()->getDescription()); + $item->setInfo(htmlspecialchars($this->object->getProvider()->getDescription())); $this->addItem($item); $item = new ilTextInputGUI($DIC->language()->txt('title'), 'title'); From dd936be07afb3afc71be6ace6d702a2f8d3c4780 Mon Sep 17 00:00:00 2001 From: Maja Boldt Date: Fri, 5 Jul 2024 08:24:41 +0200 Subject: [PATCH 291/292] adapts regex used for gaps in cloze questions in learning modules so that square brackets can be part of the answer --- Modules/Scorm2004/scripts/questions/question_handling.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/Scorm2004/scripts/questions/question_handling.js b/Modules/Scorm2004/scripts/questions/question_handling.js index a7049e529dc4..1f74a991e63a 100644 --- a/Modules/Scorm2004/scripts/questions/question_handling.js +++ b/Modules/Scorm2004/scripts/questions/question_handling.js @@ -657,7 +657,7 @@ ilias.questions.initClozeTest = function(a_id) { closecounter++; return input.outerHTML(); }; - var parsed=jQuery("div#"+a_id).get(0).innerHTML.replace(/\[gap\][^\[]+\[\/gap\]/g, + var parsed=jQuery("div#"+a_id).get(0).innerHTML.replace(/\[gap[\s\S\d]*?\](.*?)\[\/gap\]/g, () => {return _initClozeTestCallBack();}); jQuery("div#"+a_id).html(parsed); }; From 24e1b5d84f0b92ad39d87b54694935b2e5291619 Mon Sep 17 00:00:00 2001 From: iszmais <45942348+iszmais@users.noreply.github.com> Date: Thu, 12 Dec 2024 18:25:28 +0100 Subject: [PATCH 292/292] dc fix filters and sortation (#8717) --- .../Content/class.ilDclRecordListGUI.php | 26 +++++++------------ .../class.ilDclDetailedViewGUI.php | 4 +-- .../Base/class.ilDclBaseRecordModel.php | 1 + .../classes/Table/class.ilDclTable.php | 10 +++++++ 4 files changed, 22 insertions(+), 19 deletions(-) diff --git a/Modules/DataCollection/classes/Content/class.ilDclRecordListGUI.php b/Modules/DataCollection/classes/Content/class.ilDclRecordListGUI.php index d808941b054c..05728fd43a38 100644 --- a/Modules/DataCollection/classes/Content/class.ilDclRecordListGUI.php +++ b/Modules/DataCollection/classes/Content/class.ilDclRecordListGUI.php @@ -48,6 +48,7 @@ class ilDclRecordListGUI protected ilTabsGUI $tabs; protected ILIAS\HTTP\Services $http; protected ILIAS\Refinery\Factory $refinery; + protected bool $filter_changed = false; private function init( ilDataCollectionOutboundsAdapter $adapter @@ -324,7 +325,8 @@ protected function applyFilter(): void $table->initFilter(); $table->resetOffset(); $table->writeFilterToSession(); - $this->ctrl->redirect($this, self::CMD_LIST_RECORDS); + $this->filter_changed = true; + $this->listRecords(); } /** @@ -336,7 +338,8 @@ protected function resetFilter(): void $table->initFilter(); $table->resetOffset(); $table->resetFilter(); - $this->ctrl->redirect($this, self::CMD_LIST_RECORDS); + $this->filter_changed = true; + $this->listRecords(); } /** @@ -528,24 +531,13 @@ protected function getRecordListTableGUI(bool $use_tableview_filter): ilDclRecor $list->setExternalSorting(true); $list->determineOffsetAndOrder(); - $limit = $list->getLimit(); - $offset = $list->getOffset(); - - $num_records = count($table_obj->getPartialRecords( - (string) $this->getRefId(), - $list->getOrderField(), - $list->getOrderDirection(), - $limit, - $offset, - $list->getFilter() - )); - - // Fix no data found on new filter application when on a site other than the first - if ($num_records === 0) { + if ($this->filter_changed) { $list->resetOffset(); - $offset = 0; } + $limit = $list->getLimit(); + $offset = $list->getOffset(); + $data = $table_obj->getPartialRecords( (string) $this->getRefId(), $list->getOrderField(), diff --git a/Modules/DataCollection/classes/DetailedView/class.ilDclDetailedViewGUI.php b/Modules/DataCollection/classes/DetailedView/class.ilDclDetailedViewGUI.php index 529b236303fd..ec4d1370666b 100644 --- a/Modules/DataCollection/classes/DetailedView/class.ilDclDetailedViewGUI.php +++ b/Modules/DataCollection/classes/DetailedView/class.ilDclDetailedViewGUI.php @@ -413,14 +413,14 @@ private function setOptions(string $link_name): array */ private function loadSession(): void { - // We need the default sorting etc. to dertermine on which position we currently are, thus we instantiate the table gui. $list = new ilDclRecordListTableGUI( new ilDclRecordListGUI($this->dcl_gui_object, $this->table->getId(), $this->tableview_id), "listRecords", $this->table, $this->tableview_id ); - //we then partially load the records. note that this also fills up session data. + $list->initFilter(); + $list->determineOffsetAndOrder(); $this->table->getPartialRecords( $this->table->getId(), $list->getOrderField(), diff --git a/Modules/DataCollection/classes/Fields/Base/class.ilDclBaseRecordModel.php b/Modules/DataCollection/classes/Fields/Base/class.ilDclBaseRecordModel.php index 5b025f25fcff..b5806b7253bb 100644 --- a/Modules/DataCollection/classes/Fields/Base/class.ilDclBaseRecordModel.php +++ b/Modules/DataCollection/classes/Fields/Base/class.ilDclBaseRecordModel.php @@ -118,6 +118,7 @@ public function doRead(): void } $this->setTableId((int) $rec["table_id"]); + $this->loadTable(); if (null !== $rec["create_date"]) { $this->setCreateDate(new ilDateTime($rec["create_date"], IL_CAL_DATETIME)); } diff --git a/Modules/DataCollection/classes/Table/class.ilDclTable.php b/Modules/DataCollection/classes/Table/class.ilDclTable.php index 4527ca15f2e2..19d667e0b60d 100644 --- a/Modules/DataCollection/classes/Table/class.ilDclTable.php +++ b/Modules/DataCollection/classes/Table/class.ilDclTable.php @@ -1295,6 +1295,16 @@ public function getPartialRecords( $total_record_ids = $sort_query_object->applyCustomSorting($sort_field, $total_record_ids, $direction); } + if ($sort === 'n_comments') { + global $DIC; + $comments_nr = []; + foreach ($total_record_ids as $id) { + $comments_nr[$id] = $DIC->notes()->domain()->getNrOfCommentsForContext($DIC->notes()->data()->context($this->getObjId(), $id, 'dcl')); + } + uasort($comments_nr, static fn ($a, $b) => ($direction === 'asc' ? 1 : -1) * ($a <=> $b)); + $total_record_ids = array_keys($comments_nr); + } + // Now slice the array to load only the needed records in memory $record_ids = array_slice($total_record_ids, $offset, $limit);